summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/page-graphic-background.odtbin0 -> 32296 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx11
-rw-r--r--sw/source/filter/ww8/docxexport.cxx3
3 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/page-graphic-background.odt b/sw/qa/extras/ooxmlexport/data/page-graphic-background.odt
new file mode 100644
index 000000000000..15050e630737
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/page-graphic-background.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 8b4308e856c4..494076c0cb50 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -72,6 +72,7 @@ public:
void testI120928();
void testFdo64826();
void testPageBackground();
+ void testPageGraphicBackground();
void testFdo65265();
void testFdo65655();
@@ -123,6 +124,7 @@ void Test::run()
{"i120928.docx", &Test::testI120928},
{"fdo64826.docx", &Test::testFdo64826},
{"page-background.docx", &Test::testPageBackground},
+ {"page-graphic-background.odt", &Test::testPageGraphicBackground},
{"fdo65265.docx", &Test::testFdo65265},
{"fdo65655.docx", &Test::testFdo65655},
};
@@ -692,6 +694,15 @@ void Test::testPageBackground()
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x92D050), getProperty<sal_Int32>(xPageStyle, "BackColor"));
}
+void Test::testPageGraphicBackground()
+{
+ // No idea how the graphic background should be exported (seems there is no
+ // way to do a non-tiling export to OOXML), but at least the background
+ // color shouldn't be black.
+ uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(xPageStyle, "BackColor"));
+}
+
void Test::testFdo65265()
{
// Redline (tracked changes) of text formatting were not exported
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 0afa634ab5ce..40dc957fcb0b 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -746,7 +746,8 @@ boost::optional<const SvxBrushItem*> DocxExport::getBackground()
{
// The 'color' is set for the first page style - take it and use it as the background color of the entire DOCX
const SvxBrushItem* pBrush = (const SvxBrushItem*)pItem;
- oRet.reset(pBrush);
+ if (pBrush->GetColor().GetColor() != COL_AUTO)
+ oRet.reset(pBrush);
}
return oRet;
}