summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorAttila Bakos <bakos.attilakaroly@nisz.hu>2020-08-13 16:37:58 +0200
committerLászló Németh <nemeth@numbertext.org>2020-08-27 11:29:51 +0200
commit636d16efe45a55c1a5a7a451c46fbb8618bf0393 (patch)
tree9556f58447b7bc14297277026e3dc67a27745695 /sw
parent894fddc5edf5aad6fc6d0e18a6c934bfa7f001e4 (diff)
tdf#135653 OOXML import: fix OLE background color
When importing a .docx file Writer used to ignore the 'filled' and 'fillcolor' attributes in the 'shape' tag belonging to an OLE object. Now both these are imported and displayed correctly. Co-authored-by: Daniel Arato (NISZ) Change-Id: I2e6b880d88e4c46af6f3f2316ee966bac1a1f2e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100922 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf135653.docxbin0 -> 15117 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf135653.docx b/sw/qa/extras/ooxmlexport/data/tdf135653.docx
new file mode 100644
index 000000000000..b53777f81952
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf135653.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index e78e7fba8179..818664f384f1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -9,6 +9,8 @@
#include <swmodeltestbase.hxx>
+#include <com/sun/star/drawing/FillStyle.hpp>
+#include <tools/color.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
@@ -369,6 +371,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/Text[3]", "nWidth").toInt32());
}
+DECLARE_OOXMLIMPORT_TEST(TestTdf135653, "tdf135653.docx")
+{
+ uno::Reference<beans::XPropertySet> xOLEProps(getShape(1), uno::UNO_QUERY_THROW);
+ drawing::FillStyle nFillStyle = static_cast<drawing::FillStyle>(-1);
+ xOLEProps->getPropertyValue("FillStyle") >>= nFillStyle;
+ Color aFillColor(COL_AUTO);
+ xOLEProps->getPropertyValue("FillColor") >>= aFillColor;
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Fill style setting does not match!",
+ drawing::FillStyle::FillStyle_SOLID, nFillStyle);
+ Color aExpectedColor;
+ aExpectedColor.SetRed(255);
+ aExpectedColor.SetGreen(0);
+ aExpectedColor.SetBlue(0);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("OLE bg color does not match!", aExpectedColor, aFillColor);
+}
+
DECLARE_OOXMLEXPORT_TEST(testAtPageShapeRelOrientation, "rotated_shape.fodt")
{
// invalid combination of at-page anchor and horizontal-rel="paragraph"