/* static */ void BoxChar::PrepareToWrite(std::vector<BoxChar*>* boxes) { bool rtl_rules = ContainsMostlyRTL(*boxes); bool vertical_rules = MostlyVertical(*boxes); InsertNewlines(rtl_rules, vertical_rules, boxes); InsertSpaces(rtl_rules, vertical_rules, boxes); for (unsigned int i = 0; i < boxes->size(); ++i) { if ((*boxes)[i]->box_ == nullptr) tprintf("Null box at index %u\n", i); } if (rtl_rules) { ReorderRTLText(boxes); } }
/* static */ void BoxChar::PrepareToWrite(vector<BoxChar*>* boxes) { bool rtl_rules = ContainsMostlyRTL(*boxes); bool vertical_rules = MostlyVertical(*boxes); InsertNewlines(rtl_rules, vertical_rules, boxes); InsertSpaces(rtl_rules, vertical_rules, boxes); for (int i = 0; i < boxes->size(); ++i) { if ((*boxes)[i]->box_ == NULL) tprintf("Null box at index %d\n", i); } if (rtl_rules) { ReorderRTLText(boxes); } tprintf("Rtl = %d ,vertical=%d\n", rtl_rules, vertical_rules); }
void CWHTable::GetData(int nChoice, CString& csDataType, CString& csName, CString& csDescription) { int nColumn; int nIndex = m_nIndex; // Locate the choice in the column FindChoiceIndex(nChoice, nIndex); // Current column is determined by # of items on branch stack nColumn = m_IndexStack.GetCount(); // Data type is at m_nColumns-3 (0 based) int i = nColumn; while (i < m_nColumns-3) { IncrementColumn(nIndex); i++; } csDataType = m_csaLine[nIndex]; // Name is right next to it IncrementColumn(nIndex); csName = m_csaLine[nIndex]; // Then we have the description IncrementColumn(nIndex); csDescription = m_csaLine[nIndex]; if (!csDescription.IsEmpty()) { // Strip out quotes if (csDescription[0] == '"') { csDescription = csDescription.Mid(1, csDescription.GetLength()-2); } // Replace '|' character with '\n' InsertNewlines(csDescription); } }
BOOL CWHTable::AddFoundString(CStringArray& csStrings, int nIndex) { CString cs = m_csaLine[nIndex]; // Strip out quotes if (cs[0] == '"') { cs = cs.Mid(1, cs.GetLength()-2); } // If this is the first string (top text), replace '|' with '\n' if (csStrings.GetSize() == 0) InsertNewlines(cs); BOOL f; if ((f = (cs[0] == m_cListEnd))) { // Strip off the token cs = cs.Right(cs.GetLength()-1); } csStrings.Add(cs); return f; }