本文整理汇总了C++中KoShapeSavingContext::isSet方法的典型用法代码示例。如果您正苦于以下问题:C++ KoShapeSavingContext::isSet方法的具体用法?C++ KoShapeSavingContext::isSet怎么用?C++ KoShapeSavingContext::isSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KoShapeSavingContext
的用法示例。
在下文中一共展示了KoShapeSavingContext::isSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveParagraphStyle
QString KoTextWriter::saveParagraphStyle(const QTextBlockFormat &blockFormat, const QTextCharFormat &charFormat, KoStyleManager * styleManager, KoShapeSavingContext &context)
{
KoParagraphStyle *defaultParagraphStyle = styleManager->defaultParagraphStyle();
KoParagraphStyle *originalParagraphStyle = styleManager->paragraphStyle(blockFormat.intProperty(KoParagraphStyle::StyleId));
if (!originalParagraphStyle)
originalParagraphStyle = defaultParagraphStyle;
QString generatedName;
QString displayName = originalParagraphStyle->name();
QString internalName = QString(QUrl::toPercentEncoding(displayName, "", " ")).replace('%', '_');
// we'll convert the blockFormat to a KoParagraphStyle to check for local changes.
KoParagraphStyle paragStyle(blockFormat, charFormat);
if (paragStyle == (*originalParagraphStyle)) { // This is the real, unmodified character style.
// TODO zachmann: this could use the name of the saved style without saving it again
// therefore we would need to store that information in the saving context
if (originalParagraphStyle != defaultParagraphStyle) {
KoGenStyle style(KoGenStyle::ParagraphStyle, "paragraph");
originalParagraphStyle->saveOdf(style, context);
generatedName = context.mainStyles().insert(style, internalName, KoGenStyles::DontAddNumberToName);
}
} else { // There are manual changes... We'll have to store them then
KoGenStyle style(KoGenStyle::ParagraphAutoStyle, "paragraph", internalName);
if (context.isSet(KoShapeSavingContext::AutoStyleInStyleXml))
style.setAutoStyleInStylesDotXml(true);
if (originalParagraphStyle) {
paragStyle.removeDuplicates(*originalParagraphStyle);
paragStyle.setParentStyle(originalParagraphStyle);
}
paragStyle.saveOdf(style, context);
generatedName = context.mainStyles().insert(style, "P");
}
return generatedName;
}