diff options
Diffstat (limited to 'src/Client/XLSSheet.cpp')
-rw-r--r-- | src/Client/XLSSheet.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Client/XLSSheet.cpp b/src/Client/XLSSheet.cpp index 915234f..9c4b5a9 100644 --- a/src/Client/XLSSheet.cpp +++ b/src/Client/XLSSheet.cpp @@ -26,12 +26,12 @@ namespace Mad { namespace Client { -std::string XLSSheet::getSheetLevelField(const std::string &name) const { +Core::String XLSSheet::getSheetLevelField(const Core::String &name) const { xmlNodePtr entry = XLSReader::findNode(node, name); if(entry) - return std::string((char*)xmlNodeGetContent(entry)); + return Core::String::fromUTF8((char*)xmlNodeGetContent(entry)); else - return std::string(); + return Core::String(); } void XLSSheet::readRows() { @@ -58,7 +58,7 @@ void XLSSheet::readRows() { if(col >= colCount) continue; - colNames[col] = (char*)xmlNodeGetContent(cellEntry); + colNames[col] = Core::String::fromUTF8((char*)xmlNodeGetContent(cellEntry)); } // Skip the first row @@ -71,7 +71,7 @@ void XLSSheet::readRows() { if(rowEntry->type != XML_ELEMENT_NODE || xmlStrcmp(rowEntry->name, (xmlChar*)"row")) continue; - boost::shared_ptr<std::vector<std::string> > rowVector(new std::vector<std::string>(colCount)); + boost::shared_ptr<std::vector<Core::String> > rowVector(new std::vector<Core::String>(colCount)); rows.push_back(rowVector); for(xmlNodePtr cellEntry = rowEntry->children; cellEntry != 0; cellEntry = cellEntry->next) { @@ -86,20 +86,20 @@ void XLSSheet::readRows() { if(col >= colCount) continue; - (*rowVector)[col] = (char*)xmlNodeGetContent(cellEntry); + (*rowVector)[col] = Core::String::fromUTF8((char*)xmlNodeGetContent(cellEntry)); } } } XLSSheet::XLSSheet(boost::shared_ptr<xmlDoc> doc0, xmlNodePtr node0) : doc(doc0), node(node0), firstRowColNames(false) { title = getSheetLevelField("pagetitle"); - colCount = std::strtoul(getSheetLevelField("lastcol").c_str(), 0, 10)+1-std::strtoul(getSheetLevelField("firstcol").c_str(), 0, 10); + colCount = std::strtoul(getSheetLevelField("lastcol").extract().c_str(), 0, 10)+1-std::strtoul(getSheetLevelField("firstcol").extract().c_str(), 0, 10); for(unsigned col = 0; col < colCount; ++col) { std::ostringstream stream; stream << col; - colNames.push_back(stream.str()); + colNames.push_back(stream.str().c_str()); } readRows(); |