summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-07-19 12:12:14 +0200
committerPetr Mladek <pmladek@suse.cz>2012-07-24 11:59:39 +0200
commit524caf98ca542668df91ee214c970ba50fc3f268 (patch)
treebe27ac711041bd66f561d294ae53b1840987da69
parent39afe59baf321c198cfd9c53d69ee8ab301b7d3d (diff)
fdo#38056: ODF import: fix page style attributes:
PageMasterImportPropMapper: in the case of a single "fo:border" and "style:border-line-width" attribute, it is possible that the border is imported wrongly, like this: 1. pAllBorderProperty is set from the imported value, with name "TopBorder" 2. individual pNewBorder[i] are created as copies from pAllBorderProperty, one of which also with name "TopBorder" 3. pNewBorder[i] is updated with widths from pBorderWidths[i] 4. the individual pNewBorder[i] are added to the property vector 5. the property vector is sorted by property name 6. the properites are applied in order; if the pNewBorder[TOP] happens to precede the pAllBorderProperty (which is indeterminate as they both have name "TopBorder"), then the pAllBorderProperty will overwrite the border widths computed in step 3. Thus, nerf the various pAllFoo properties so they do not override the individual Foo properties later on. (cherry picked from commit 7f9928bfa561ccb6ed4e2baacc7d6960bc1ce231) Change-Id: I87755f1184d59da2aa72ac053e6f77d7295d6958 Signed-off-by: Miklos Vajna <vmiklos@suse.cz> Signed-off-by: Petr Mladek <pmladek@suse.cz> Signed-off-by: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
-rw-r--r--xmloff/source/style/PageMasterImportPropMapper.cxx51
1 files changed, 51 insertions, 0 deletions
diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx
index ad45cdb01331..005c732351ca 100644
--- a/xmloff/source/style/PageMasterImportPropMapper.cxx
+++ b/xmloff/source/style/PageMasterImportPropMapper.cxx
@@ -408,6 +408,57 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >&
rProperties.push_back(*pFooterDynamic);
delete pFooterDynamic;
}
+
+ // fdo#38056: nerf the various AllFoo properties so they do not override
+ // the individual Foo properties later on
+ if (pAllPaddingProperty)
+ {
+ pAllPaddingProperty->mnIndex = -1;
+ }
+ if (pAllBorderProperty)
+ {
+ pAllBorderProperty->mnIndex = -1;
+ }
+ if (pAllBorderWidthProperty)
+ {
+ pAllBorderWidthProperty->mnIndex = -1;
+ }
+ if (pAllHeaderPaddingProperty)
+ {
+ pAllHeaderPaddingProperty->mnIndex = -1;
+ }
+ if (pAllHeaderBorderProperty)
+ {
+ pAllHeaderBorderProperty->mnIndex = -1;
+ }
+ if (pAllHeaderBorderWidthProperty)
+ {
+ pAllHeaderBorderWidthProperty->mnIndex = -1;
+ }
+ if (pAllFooterPaddingProperty)
+ {
+ pAllFooterPaddingProperty->mnIndex = -1;
+ }
+ if (pAllFooterBorderProperty)
+ {
+ pAllFooterBorderProperty->mnIndex = -1;
+ }
+ if (pAllFooterBorderWidthProperty)
+ {
+ pAllFooterBorderWidthProperty->mnIndex = -1;
+ }
+ if (pAllMarginProperty)
+ {
+ pAllMarginProperty->mnIndex = -1;
+ }
+ if (pAllHeaderMarginProperty)
+ {
+ pAllHeaderMarginProperty->mnIndex = -1;
+ }
+ if (pAllFooterMarginProperty)
+ {
+ pAllFooterMarginProperty->mnIndex = -1;
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */