diff --git a/skin_generator/main.cpp b/skin_generator/main.cpp index 1729e287d6..d242759180 100644 --- a/skin_generator/main.cpp +++ b/skin_generator/main.cpp @@ -40,7 +40,6 @@ int main(int argc, char *argv[]) gen.renderPages(); - gen.writeToFile(FLAGS_skinName + FLAGS_skinSuffix); QString newSkin(FLAGS_skinName.c_str()); newSkin.replace("basic", "symbols"); gen.writeToFileNewStyle(newSkin.toStdString() + FLAGS_skinSuffix); diff --git a/skin_generator/skin_generator.cpp b/skin_generator/skin_generator.cpp index 11cd544659..965bc3cb46 100644 --- a/skin_generator/skin_generator.cpp +++ b/skin_generator/skin_generator.cpp @@ -244,72 +244,6 @@ namespace tools m_overflowDetected = true; } - bool SkinGenerator::writeToFile(std::string const & skinName) - { - /// Creating Data file - QDomDocument doc = QDomDocument("skin"); - QDomElement skinElem = doc.createElement("skin"); - doc.appendChild(skinElem); - - for (vector::const_iterator it = m_pages.begin(); it != m_pages.end(); ++it) - { - SkinPageInfo const & page = *it; - - QDomElement pageElem = doc.createElement("page"); - skinElem.appendChild(pageElem); - pageElem.setAttribute("width", page.m_width); - pageElem.setAttribute("height", page.m_height); - pageElem.setAttribute("file", (page.m_fileName.substr(page.m_fileName.find_last_of("/") + 1) + ".png").c_str()); - - int minDynamicID = 0; - int maxFontResourceID = 0; - - minDynamicID += maxFontResourceID + 1; - int maxImageResourceID = 0; - - for (vector::const_iterator it = page.m_symbols.begin(); it != page.m_symbols.end(); ++it) - { - QDomElement symbolStyle = doc.createElement("symbolStyle"); - - QDomElement resourceStyle = doc.createElement("resourceStyle"); - - m2::RectU r = page.m_packer.find(it->m_handle).second; - - resourceStyle.setAttribute("x", r.minX()); - resourceStyle.setAttribute("y", r.minY()); - resourceStyle.setAttribute("width", r.SizeX()); - resourceStyle.setAttribute("height", r.SizeY()); - - symbolStyle.appendChild(resourceStyle); - symbolStyle.setAttribute("id", minDynamicID + it->m_handle); - symbolStyle.setAttribute("name", it->m_symbolID.toLower()); - - maxImageResourceID = max(maxImageResourceID, (int)it->m_handle); - - pageElem.appendChild(symbolStyle); - } - - minDynamicID += maxImageResourceID + 1; - } - - QFile::remove(QString((skinName + ".skn").c_str())); - - if (QFile::exists((skinName + ".skn").c_str())) - throw std::exception(); - - QFile file(QString((skinName + ".skn").c_str())); - - LOG(LINFO, ("writing skin into ", skinName + ".skn")); - - if (!file.open(QIODevice::ReadWrite)) - throw std::exception(); - QTextStream ts(&file); - ts.setCodec("UTF-8"); - ts << doc.toString(); - - return true; - } - void SkinGenerator::writeToFileNewStyle(const string & skinName) { QDomDocument doc = QDomDocument("skin");