Commit b1a90b45 authored by Thorsten Zachmann's avatar Thorsten Zachmann

Save autostyle in the correct file.

When KoShapeSavingContext::AutoStyleInStyleXml is set styles auto styles needed to be written
to the styles.xml. This fixes the problem that the style in bug 296664 for the list was saved to content.xml
instead styles.xml.

BUG: 296664

Please review so I can backport to 2.4 branch.

Roundtrip tested with my odp and odt test set.

CCMAIL: calligra-devel@kde.org
parent e5ae1252
......@@ -193,6 +193,8 @@ QHash<QTextList *, QString> KoTextWriter::Private::saveListStyles(QTextBlock blo
}
bool automatic = listStyle->styleId() == 0;
KoGenStyle style(automatic ? KoGenStyle::ListAutoStyle : KoGenStyle::ListStyle);
if (automatic && context.isSet(KoShapeSavingContext::AutoStyleInStyleXml))
style.setAutoStyleInStylesDotXml(true);
listStyle->saveOdf(style, context);
QString generatedName = context.mainStyles().insert(style, listStyle->name(), listStyle->isNumberingStyle() ? KoGenStyles::AllowDuplicates : KoGenStyles::DontAddNumberToName);
listStyles[textList] = generatedName;
......@@ -202,6 +204,8 @@ QHash<QTextList *, QString> KoTextWriter::Private::saveListStyles(QTextBlock blo
continue;
KoListLevelProperties llp = KoListLevelProperties::fromTextList(textList);
KoGenStyle style(KoGenStyle::ListAutoStyle);
if (context.isSet(KoShapeSavingContext::AutoStyleInStyleXml))
style.setAutoStyleInStylesDotXml(true);
KoListStyle listStyle;
listStyle.setLevelProperties(llp);
if (listStyle.isOulineStyle()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment