Commit f1ddaa24 authored by Elvis Stansvik's avatar Elvis Stansvik

Load fo:margin and fo:padding shorthands first.

The left/right/top/bottom variants should override the
fo:margin/fo:padding shorthands.
parent 2370da9b
...@@ -1358,6 +1358,10 @@ void KoParagraphStyle::loadOdfProperties(KoShapeLoadingContext &scontext) ...@@ -1358,6 +1358,10 @@ void KoParagraphStyle::loadOdfProperties(KoShapeLoadingContext &scontext)
} }
// Spacing (padding) // Spacing (padding)
const QString padding(styleStack.property(KoXmlNS::fo, "padding"));
if (!padding.isEmpty()) {
setPadding(KoUnit::parseValue(padding));
}
const QString paddingLeft(styleStack.property(KoXmlNS::fo, "padding-left" )); const QString paddingLeft(styleStack.property(KoXmlNS::fo, "padding-left" ));
if (!paddingLeft.isEmpty()) { if (!paddingLeft.isEmpty()) {
setLeftPadding(KoUnit::parseValue(paddingLeft)); setLeftPadding(KoUnit::parseValue(paddingLeft));
...@@ -1374,12 +1378,12 @@ void KoParagraphStyle::loadOdfProperties(KoShapeLoadingContext &scontext) ...@@ -1374,12 +1378,12 @@ void KoParagraphStyle::loadOdfProperties(KoShapeLoadingContext &scontext)
if (!paddingBottom.isEmpty()) { if (!paddingBottom.isEmpty()) {
setBottomPadding(KoUnit::parseValue(paddingBottom)); setBottomPadding(KoUnit::parseValue(paddingBottom));
} }
const QString padding(styleStack.property(KoXmlNS::fo, "padding"));
if (!padding.isEmpty()) {
setPadding(KoUnit::parseValue(padding));
}
// Indentation (margin) // Indentation (margin)
const QString margin(styleStack.property(KoXmlNS::fo, "margin"));
if (!margin.isEmpty()) {
setMargin(KoText::parseLength(margin));
}
const QString marginLeft(styleStack.property(KoXmlNS::fo, "margin-left" )); const QString marginLeft(styleStack.property(KoXmlNS::fo, "margin-left" ));
if (!marginLeft.isEmpty()) { if (!marginLeft.isEmpty()) {
setLeftMargin(KoText::parseLength(marginLeft)); setLeftMargin(KoText::parseLength(marginLeft));
...@@ -1396,10 +1400,6 @@ void KoParagraphStyle::loadOdfProperties(KoShapeLoadingContext &scontext) ...@@ -1396,10 +1400,6 @@ void KoParagraphStyle::loadOdfProperties(KoShapeLoadingContext &scontext)
if (!marginBottom.isEmpty()) { if (!marginBottom.isEmpty()) {
setBottomMargin(KoText::parseLength(marginBottom)); setBottomMargin(KoText::parseLength(marginBottom));
} }
const QString margin(styleStack.property(KoXmlNS::fo, "margin"));
if (!margin.isEmpty()) {
setMargin(KoText::parseLength(margin));
}
// Automatic Text indent // Automatic Text indent
// OOo is not assuming this. Commenting this line thus allow more OpenDocuments to be supported, including a // OOo is not assuming this. Commenting this line thus allow more OpenDocuments to be supported, including a
......
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