tdf#90720 Textframe background was not transparent
In case of 'no fill' for vml textboxes, MS office rendered as
transpanrent textbox.
When opened same file on LO, it rendered it as textframe with white
background. (Even if the fillstyle is type of 'no fill' and 'backcolortransparency
' is 100%)
So, Fixing this issue by applying 100% 'FillTransparency' if it gets above situation.
Change-Id: Ied2d3855354ada994288c29c78d9ccb4e5b0b4d6
Reviewed-on: https://gerrit.libreoffice.org/15390
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 1bb21a1..bd738d2 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -329,6 +329,11 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS
aGrabBag[length+1].Value = uno::makeAny(sal_Int32(NormAngle360((maTypeModel.maRotation.toInt32()) * -100)));
}
propertySet->setPropertyValue( "FrameInteropGrabBag", uno::makeAny(aGrabBag) );
if (propertySet->getPropertyValue("FillStyle") == FillStyle_NONE &&
propertySet->getPropertyValue("BackColorTransparency") == makeAny(100)) {
// If there is no fill, the Word default is 100% transparency.
propertySet->setPropertyValue("FillTransparence", makeAny(100));
}
}
else
{
diff --git a/sw/qa/extras/ooxmlimport/data/testfdo90720.docx b/sw/qa/extras/ooxmlimport/data/testfdo90720.docx
new file mode 100644
index 0000000..a4e8ba9
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/testfdo90720.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 107060f..eebdc08 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -360,6 +360,18 @@ xray image.FillColor
CPPUNIT_ASSERT_EQUAL( sal_Int32( 0xc0504d ), fillColor );
}
DECLARE_OOXMLIMPORT_TEST(testfdo90720, "testfdo90720.docx")
{
uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
uno::Reference<text::XTextFrame> textbox(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
uno::Reference<beans::XPropertySet> properties(textbox, uno::UNO_QUERY);
sal_Int32 fill_transperence;
properties->getPropertyValue( "FillTransparence" ) >>= fill_transperence;
CPPUNIT_ASSERT_EQUAL( sal_Int32(100), fill_transperence );
}
DECLARE_OOXMLIMPORT_TEST(testN747461, "n747461.docx")
{
/*