QNCLContourLine::QNCLContourLine(QDomDocument &doc) { templateName.clear(); leftLongitude = 0; topLatitude = 0; rightLongitude = 0; bottomLatitude = 0; width = 0; height = 0; colormap.clear(); font.clear(); dashPattern = 0; fillPattern = 0; mapProject.clear(); polarPosition.clear(); foregroundColor.setRgb(0, 0, 0); backgroundColor.setRgb(255, 255, 255); levelSelectionMode.clear(); FillMode.clear(); minLevel = 0; maxLevel = 0; levelSpacing = 0; maxLevelCount = 0; for (int idx = 0; idx < 255; idx++) { lineLevels[idx] = 0; lineThicknesses[idx] = 0; lineColors[idx] = 0; lineFont[idx].clear(); lineDashPatterns[idx] = 0; lineFillPatterns[idx] = 0; } loadFromXmlDocument(doc); }
bool cppcheck::Platform::loadPlatformFile(const char exename[], const std::string &filename) { // open file.. tinyxml2::XMLDocument doc; if (doc.LoadFile(filename.c_str()) != tinyxml2::XML_SUCCESS) { std::vector<std::string> filenames; filenames.push_back(filename + ".xml"); if (exename && (std::string::npos != Path::fromNativeSeparators(exename).find('/'))) { filenames.push_back(Path::getPathFromFilename(Path::fromNativeSeparators(exename)) + "platforms/" + filename); filenames.push_back(Path::getPathFromFilename(Path::fromNativeSeparators(exename)) + "platforms/" + filename + ".xml"); } #ifdef CFGDIR std::string cfgdir = CFGDIR; if (!cfgdir.empty() && cfgdir[cfgdir.size()-1] != '/') cfgdir += '/'; filenames.push_back(cfgdir + ("../platforms/" + filename)); filenames.push_back(cfgdir + ("../platforms/" + filename + ".xml")); #endif bool success = false; for (int i = 0; i < filenames.size(); ++i) { if (doc.LoadFile(filenames[i].c_str()) == tinyxml2::XML_SUCCESS) { success = true; break; } } if (!success) return false; } return loadFromXmlDocument(&doc); }