本文整理汇总了C++中KoXmlWriter::addConfigItem方法的典型用法代码示例。如果您正苦于以下问题:C++ KoXmlWriter::addConfigItem方法的具体用法?C++ KoXmlWriter::addConfigItem怎么用?C++ KoXmlWriter::addConfigItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KoXmlWriter
的用法示例。
在下文中一共展示了KoXmlWriter::addConfigItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveOdfHelper
bool DocBase::saveOdfHelper(SavingContext & documentContext, SaveFlag saveFlag,
QString* /*plainText*/)
{
Q_UNUSED(saveFlag);
KoStore * store = documentContext.odfStore.store();
KoXmlWriter * manifestWriter = documentContext.odfStore.manifestWriter();
KoStoreDevice dev(store);
KoGenStyles mainStyles;//for compile
KoXmlWriter* contentWriter = documentContext.odfStore.contentWriter();
KoXmlWriter* bodyWriter = documentContext.odfStore.bodyWriter();
KoShapeSavingContext savingContext(*bodyWriter, mainStyles, documentContext.embeddedSaver);
//todo fixme just add a element for testing saving content.xml
bodyWriter->startElement("office:body");
bodyWriter->startElement("office:spreadsheet");
// Saving the map.
map()->saveOdf(*contentWriter, savingContext);
bodyWriter->endElement(); ////office:spreadsheet
bodyWriter->endElement(); ////office:body
// Done with writing out the contents to the tempfile, we can now write out the automatic styles
mainStyles.saveOdfStyles(KoGenStyles::DocumentAutomaticStyles, contentWriter);
documentContext.odfStore.closeContentWriter();
//add manifest line for content.xml
manifestWriter->addManifestEntry("content.xml", "text/xml");
mainStyles.saveOdfStylesDotXml(store, manifestWriter);
if (!store->open("settings.xml"))
return false;
KoXmlWriter* settingsWriter = KoOdfWriteStore::createOasisXmlWriter(&dev, "office:document-settings");
settingsWriter->startElement("office:settings");
settingsWriter->startElement("config:config-item-set");
settingsWriter->addAttribute("config:name", "view-settings");
saveUnitOdf(settingsWriter);
saveOdfSettings(*settingsWriter);
settingsWriter->endElement(); // config:config-item-set
settingsWriter->startElement("config:config-item-set");
settingsWriter->addAttribute("config:name", "configuration-settings");
settingsWriter->addConfigItem("SpellCheckerIgnoreList", d->spellListIgnoreAll.join(","));
settingsWriter->endElement(); // config:config-item-set
settingsWriter->endElement(); // office:settings
settingsWriter->endElement(); // Root:element
settingsWriter->endDocument();
delete settingsWriter;
if (!store->close())
return false;
if (!savingContext.saveDataCenter(store, manifestWriter)) {
return false;
}
manifestWriter->addManifestEntry("settings.xml", "text/xml");
setModified(false);
return true;
}