summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-05-07 18:18:43 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-05-19 10:26:29 +0200
commit4e98ba4ba5c17ab8ae1170662af645b9d2bfde84 (patch)
tree645ebd6f8d5daf918190e8fe7d71a456ddfd0d90 /sw
parentbd03dc39f6f02a875590413378355daa4893a988 (diff)
tdf#103602 xmloff,sw: ODF 1.3 import: PageStyle with drawing-page style
Associate a style of family "drawing-page" with a style:master-page. This fixes the small part of the draw:fill attribute problem that is covered by OFFICE-3937 in ODF 1.3. This is the import part. Change-Id: I4c86fa24c36407b64ce33f0890e5da8c26c5292a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93670 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/odfexport/data/sw_hatch.odtbin0 -> 6560 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx10
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx11
3 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/sw_hatch.odt b/sw/qa/extras/odfexport/data/sw_hatch.odt
new file mode 100644
index 000000000000..45e36c6ecc00
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/sw_hatch.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index dd8729f21912..540e6359dd1f 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1682,6 +1682,16 @@ DECLARE_ODFEXPORT_TEST(testOdtBorderTypes, "border_types.odt")
} while (xParaEnum->hasMoreElements());
}
+DECLARE_ODFEXPORT_TEST(testMasterPageWithDrawingPage, "sw_hatch.odt")
+{
+ uno::Reference<container::XNameAccess> xStyles(getStyles("PageStyles"));
+ uno::Reference<beans::XPropertySet> xStyle(xStyles->getByName("Standard"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_HATCH, getProperty<drawing::FillStyle>(xStyle, "FillStyle"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Blue -45 Degrees"), getProperty<OUString>(xStyle, "FillHatchName"));
+ CPPUNIT_ASSERT(!getProperty<sal_Bool>(xStyle, "FillBackground"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xStyle, "FillTransparence"));
+}
+
DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index 7966379588f8..8bf022141423 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -41,6 +41,8 @@
#include <xmloff/XMLTextMasterStylesContext.hxx>
#include <xmloff/XMLTextShapeStyleContext.hxx>
#include <xmloff/XMLGraphicsDefaultStyle.hxx>
+#include <xmloff/XMLDrawingPageStyleContext.hxx>
+#include <xmloff/XMLTextMasterPageContext.hxx>
#include <xmloff/table/XMLTableImport.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/XModel.hpp>
@@ -832,6 +834,10 @@ SvXMLStyleContext *SwXMLStylesContext_Impl::CreateStyleStyleChildContext(
pStyle = new XMLTextShapeStyleContext( GetImport(), nPrefix,
rLocalName, xAttrList, *this, nFamily );
break;
+ case XmlStyleFamily::SD_DRAWINGPAGE_ID:
+ pStyle = new XMLDrawingPageStyleContext(GetImport(), nPrefix, rLocalName,
+ xAttrList, *this, g_MasterPageContextIDs, g_MasterPageFamilies);
+ break;
default:
pStyle = SvXMLStylesContext::CreateStyleStyleChildContext( nFamily,
nPrefix,
@@ -930,6 +936,11 @@ rtl::Reference < SvXMLImportPropertyMapper > SwXMLStylesContext_Impl::GetImportP
else if( nFamily == XmlStyleFamily::TABLE_CELL )
xMapper = XMLTextImportHelper::CreateTableCellExtPropMapper(
const_cast<SwXMLStylesContext_Impl*>( this )->GetImport() );
+ else if (nFamily == XmlStyleFamily::SD_DRAWINGPAGE_ID)
+ {
+ xMapper = XMLTextImportHelper::CreateDrawingPageExtPropMapper(
+ const_cast<SwXMLStylesContext_Impl*>(this)->GetImport());
+ }
else
xMapper = SvXMLStylesContext::GetImportPropertyMapper( nFamily );
return xMapper;