DOCX: don't export auto color as page background
That auto here would mean black, potentially rendering the whole document unreadable. Change-Id: Ie17a6a9b00c9ab24204291d09175a3fba69cd4ea
This commit is contained in:
BIN
sw/qa/extras/ooxmlexport/data/page-graphic-background.odt
Normal file
BIN
sw/qa/extras/ooxmlexport/data/page-graphic-background.odt
Normal file
Binary file not shown.
@@ -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
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user