Changeset 21 for trunk/tmdmcreator/src/tmdmprocessor.cpp
- Timestamp:
- 02/25/13 11:47:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tmdmcreator/src/tmdmprocessor.cpp
r19 r21 21 21 m_FileSrc = src; 22 22 m_FileDst = dest; 23 m_LanguageCol = 0; 23 24 } 24 25 … … 42 43 } 43 44 return wxNOT_FOUND; 45 } 46 47 48 49 wxString TmDmProcessor::SwitchCols(wxArrayString * cols, wxArrayString * values, int item) { 50 if (m_LanguageCol == 0) { 51 return values->Item(item); 52 } 53 54 55 if(cols->Item(item).Contains(_T("_0")) == true) { 56 return values->Item(item + m_LanguageCol); 57 } 58 59 wxString myColName = wxString::Format(_T("_%d"), m_LanguageCol); 60 if (cols->Item(item).Contains(myColName) == true) { 61 return values->Item(item - m_LanguageCol); 62 } 63 return values->Item(item); 64 } 65 66 67 68 void TmDmProcessor::SetLanguageColumn(int value) { 69 m_LanguageCol = value; 44 70 } 45 71 … … 104 130 myInsert.Append(_T(") VALUES (")); 105 131 for (unsigned int i = 0; i< mySQLCols.GetCount(); i++) { 106 myInsert.Append(wxString::Format(_T("\"%s\","), myValues.Item(i)));132 myInsert.Append(wxString::Format(_T("\"%s\","), SwitchCols(&mySQLCols, &myValues, i))); 107 133 } 108 134 myInsert.RemoveLast(); … … 232 258 wxString myInsert = _T("INSERT INTO `dmn_catalog` VALUES ("); 233 259 for (unsigned int i = START_COL; i< mySQLCols.GetCount(); i++) { 234 myInsert.Append(wxString::Format(_T("\"%s\","), myValues.Item(i)));260 myInsert.Append(wxString::Format(_T("\"%s\","), SwitchCols(&mySQLCols, &myValues, i))); 235 261 } 236 262 myInsert.RemoveLast();
Note: See TracChangeset
for help on using the changeset viewer.