[Libreoffice-commits] core.git: sw/qa sw/source writerfilter/source
Pallavi Jadhav
pallavi.jadhav at synerzip.com
Mon Jun 2 00:53:31 PDT 2014
sw/qa/extras/ooxmlexport/data/fdo76934.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 15 +++++++++++++++
sw/source/core/unocore/unomap.cxx | 3 ++-
writerfilter/source/dmapper/StyleSheetTable.cxx | 3 +--
4 files changed, 18 insertions(+), 3 deletions(-)
New commits:
commit ef8293485adbf6554569ca37b8c1bf8cce955842
Author: Pallavi Jadhav <pallavi.jadhav at synerzip.com>
Date: Fri May 30 15:11:51 2014 +0530
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 at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/qa/extras/ooxmlexport/data/fdo76934.docx b/sw/qa/extras/ooxmlexport/data/fdo76934.docx
new file mode 100644
index 0000000..0515cf2
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo76934.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 9c1ee8e..aeb66e9 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 5a9cb5a..6a26b9d 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 ed5ecbe..a8da876 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] );
}
More information about the Libreoffice-commits
mailing list