diff options
author | Pallavi Jadhav <pallavi.jadhav@synerzip.com> | 2014-05-30 15:11:51 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-02 07:53:11 +0000 |
commit | ef8293485adbf6554569ca37b8c1bf8cce955842 (patch) | |
tree | cfed4a16353c9b0c9bc367642dde6a6cbccb7b27 | |
parent | c0190efe9e2e27bd60fbf7e35a698e1e3c4ef77c (diff) |
fdo#76934 : DOCX: Preservation: AutoSpacing property not getting preserved.
Issue :
- In styles.xml, beforeAutospacing property was set to true.
- In code LO grab bags AustoSpacing property using "ParaInteropGrabBag".
- But ParaInteropGrabBag had only an entry for direct paragraph properties,
not paragraph styles.
- Hence while importing AustoSpacing property from styles.xml, LO was throwing exception
as "Some style properties could not be set: Unknown property: ParaInteropGrabBag".
Implementation :
- Added "ParaInteropGarbBag" entry for Paragraph styles in
sw/source/core/unocore/unomap.cxx
- Removed code from StyleSheetTable::ApplyStyleSheets() as it was previously added to
"Ignore" the AutoSpacing property.
The code was previously added beacuse due to AutpSpacing in styles.xml,
LO was throwing an exception and this was causing unhandling of properties after AutoSpacing.
So to prevent unhandling of other properties due to AutoSpacing property, a check was added to
"Ignore" AutoSpacing, thus enabling handling of properties after AutoSpacing.
Please refer to : https://gerrit.libreoffice.org/#/c/8902/
But as now we have to "Preserve AutoSpacing" this check needs to be removed in order to set
it in StyelSheetTable.cxx.
- Added Export Unit test case
Change-Id: I6748f97befcdf40643e75388766e05740290306b
Reviewed-on: https://gerrit.libreoffice.org/9561
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/fdo76934.docx | bin | 0 -> 31867 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 3 | ||||
-rw-r--r-- | writerfilter/source/dmapper/StyleSheetTable.cxx | 3 |
4 files changed, 18 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo76934.docx b/sw/qa/extras/ooxmlexport/data/fdo76934.docx Binary files differnew file mode 100644 index 000000000000..0515cf2bf2d4 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/fdo76934.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 9c1ee8e901dc..aeb66e96463e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3426,6 +3426,21 @@ DECLARE_OOXMLEXPORT_TEST(testFdo78910, "fdo78910.docx") assertXPath ( pXmlDoc, "//w:hyperlink[2]/w:r[5]/w:fldChar", "fldCharType", "end" ); } +DECLARE_OOXMLEXPORT_TEST(testfdo76934, "fdo76934.docx") +{ + /* Issue was, AuoSpacing property if present inside styles.xml, LO was not able to + * preserve it. + */ + + xmlDocPtr pXmlDoc = parseExport("word/styles.xml"); + + if (!pXmlDoc) + return; + + // Ensure that after fix LO is preserving AutoSpacing property in styles.xml + assertXPath ( pXmlDoc, "/w:styles[1]/w:style[36]/w:pPr[1]/w:spacing[1]", "beforeAutospacing", "1" ); +} + DECLARE_OOXMLEXPORT_TEST(testFDO79062, "fdo79062.docx") { xmlDocPtr pXmlFootNotes = parseExport("word/footnotes.xml"); diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 5a9cb5a762eb..6a26b9db16a5 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -535,7 +535,8 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { OUString(UNO_NAME_SNAP_TO_GRID), RES_PARATR_SNAPTOGRID, cppu::UnoType<bool>::get(), PropertyAttribute::MAYBEVOID, 0 }, \ { OUString(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL,cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, 0}, \ { OUString(UNO_NAME_HIDDEN), FN_UNO_HIDDEN, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, \ - { OUString(UNO_NAME_STYLE_INTEROP_GRAB_BAG), FN_UNO_STYLE_INTEROP_GRAB_BAG, cppu::UnoType< cppu::UnoSequenceType<css::beans::PropertyValue> >::get(), PROPERTY_NONE, 0}, + { OUString(UNO_NAME_STYLE_INTEROP_GRAB_BAG), FN_UNO_STYLE_INTEROP_GRAB_BAG, cppu::UnoType< cppu::UnoSequenceType<css::beans::PropertyValue> >::get(), PROPERTY_NONE, 0}, \ + { OUString(UNO_NAME_PARA_INTEROP_GRAB_BAG), RES_PARATR_GRABBAG, cppu::UnoType< cppu::UnoSequenceType<css::beans::PropertyValue> >::get(), PROPERTY_NONE, 0}, #define COMMON_FLDTYP_PROPERTIES \ { OUString(UNO_NAME_IS_FIELD_USED), FIELD_PROP_IS_FIELD_USED, cppu::UnoType<float>::get(), PropertyAttribute::READONLY, 0},\ diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index ed5ecbe14c66..a8da87676177 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -1113,8 +1113,7 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) // Don't add the style name properties bool bIsParaStyleName = aPropValues[nProp].Name == "ParaStyleName"; bool bIsCharStyleName = aPropValues[nProp].Name == "CharStyleName"; - bool bIsParaInteropGrabBag = aPropValues[nProp].Name == "ParaInteropGrabBag"; - if ( !bIsParaStyleName && !bIsCharStyleName && !bIsParaInteropGrabBag) + if ( !bIsParaStyleName && !bIsCharStyleName ) { aSortedPropVals.Insert( aPropValues[nProp] ); } |