summaryrefslogtreecommitdiff
path: root/sw/qa/extras/layout/layout.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-04-10 17:46:55 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2018-05-07 15:25:05 +0200
commit75967a849ceae371b4548178ec74e461f9e1aa70 (patch)
tree55f4a7e3dd4f98521b9bf5fcd59d286449eea55c /sw/qa/extras/layout/layout.cxx
parentfcb19284875f08485e77fe9a30daee7285eaa48a (diff)
tdf#116925 sw: consider fill styles of shape for in-textbox auto color
Automatic color is determined in SwDrawTextInfo::ApplyAutoColor(), but it uses this function to determine the background color. Be consistent and consider the same background in both the shape-with-editeng-text and shape-with-sw-text cases. (cherry picked from commit f966767e1ccfa432da33e1a0fd6de69e17a36bc3) Change-Id: I52249a908193765bc128789d96187af334c1017c Reviewed-on: https://gerrit.libreoffice.org/52983 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 9e0b21e416470d826f6f27d463ba2e42bee5222d) Reviewed-on: https://gerrit.libreoffice.org/53737 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sw/qa/extras/layout/layout.cxx')
-rw-r--r--sw/qa/extras/layout/layout.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 16efa14c5875..3709e306f53d 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -17,9 +17,11 @@ class SwLayoutWriter : public SwModelTestBase
{
public:
void testTdf116830();
+ void testTdf116925();
CPPUNIT_TEST_SUITE(SwLayoutWriter);
CPPUNIT_TEST(testTdf116830);
+ CPPUNIT_TEST(testTdf116925);
CPPUNIT_TEST_SUITE_END();
private:
@@ -62,6 +64,26 @@ void SwLayoutWriter::testTdf116830()
assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/rect", 1);
}
+void SwLayoutWriter::testTdf116925()
+{
+ SwDoc* pDoc = createDoc("tdf116925.docx");
+ SwDocShell* pShell = pDoc->GetDocShell();
+
+ // Dump the rendering of the first page as an XML file.
+ std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
+ MetafileXmlDump dumper;
+ xmlDocPtr pXmlDoc = dumper.dumpAndParse(*xMetaFile);
+ CPPUNIT_ASSERT(pXmlDoc);
+
+ assertXPathContent(pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/textarray/text",
+ "hello");
+ // This failed, text color was #000000.
+ assertXPath(
+ pXmlDoc,
+ "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/push[3]/textcolor[@color='#ffffff']", 1);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter);
CPPUNIT_PLUGIN_IMPLEMENT();