summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-03-12 22:21:16 +0100
committerMichael Stahl <mstahl@redhat.com>2014-03-12 23:55:29 +0100
commit92cb21ebeda98c5193c50c4cf7ef3d60611c2a52 (patch)
tree0e4e40005935918ba55c9ad6a15044d8720ce5d9 /sw
parent7225de6c5c3c5881c1edf60cf9d088043bf30b51 (diff)
fdo#75872: ODF import: fix up graphics defaults stroke/fill colors
These have changed a few times, notably in LO 4.0 with commit 895890563cb0cc5fa872bdfd06918a46cdda172d and AOO 4.0 with commit c0eb5e7772c848806db8ab461f77f9549c1d8b2b; unfortunately historic OOo and current AOO do not write the values into ODF files, whereas LO 4.x does (probably by accident, since 45d3577bc5726eee44f491fd30a7f11dc428431a by design). Try to set the defaults depending on the generator; since the defaults are not specified by ODF they are implementation defined anyway so this should be OK. Change-Id: I1270d6e0cdeea5cb493724a0998f661a0cf644f1
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/odfimport/data/fdo75872_aoo40.odtbin0 -> 8625 bytes
-rw-r--r--sw/qa/extras/odfimport/data/fdo75872_ooo33.odtbin0 -> 8348 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx20
3 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/data/fdo75872_aoo40.odt b/sw/qa/extras/odfimport/data/fdo75872_aoo40.odt
new file mode 100644
index 000000000000..549a56706de9
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/fdo75872_aoo40.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/data/fdo75872_ooo33.odt b/sw/qa/extras/odfimport/data/fdo75872_ooo33.odt
new file mode 100644
index 000000000000..4cc3de7cc9aa
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/fdo75872_ooo33.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 8fa14b45581a..299fea7ae161 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -279,6 +279,26 @@ DECLARE_ODFIMPORT_TEST(testFdo56272, "fdo56272.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(422), xShape->getPosition().Y); // Was -2371
}
+DECLARE_ODFIMPORT_TEST(testFdo75872_ooo33, "fdo75872_ooo33.odt")
+{
+ // graphics default style: line color and fill color changed
+ uno::Reference<drawing::XShape> xShape = getShape(1);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_BLACK),
+ getProperty<sal_Int32>(xShape, "LineColor"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(RGB_COLORDATA(153, 204, 255)),
+ getProperty<sal_Int32>(xShape, "FillColor"));
+}
+
+DECLARE_ODFIMPORT_TEST(testFdo75872_aoo40, "fdo75872_aoo40.odt")
+{
+ // graphics default style: line color and fill color changed
+ uno::Reference<drawing::XShape> xShape = getShape(1);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(RGB_COLORDATA(128, 128, 128)),
+ getProperty<sal_Int32>(xShape, "LineColor"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(RGB_COLORDATA(0xCF, 0xE7, 0xF5)),
+ getProperty<sal_Int32>(xShape, "FillColor"));
+}
+
DECLARE_ODFIMPORT_TEST(testFdo55814, "fdo55814.odt")
{
uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);