sw/qa/extras/rtfexport/data/tdf154129_transparentFrame.rtf | 3 +++ sw/qa/extras/rtfexport/rtfexport3.cxx | 6 ++++++ writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 ++++++---- 3 files changed, 15 insertions(+), 4 deletions(-)
New commits: commit b1194e42dde6e3749631a6510d9e7b969e5eae8e Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Mon Mar 13 12:57:35 2023 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Wed Mar 15 16:16:24 2023 +0000 tdf#154129 writerfilter framePr: deduplicate BackColorTransparency Well, not really deduplicate, because it only existed once. Added long ago with commit 4ac48167662c592c21025b89fe8f6925c680c6e0 Author: Miklos Vajna on Mon Feb 20 15:46:08 2012 +0100 n#695479 fix rtf/docx import of transparent frames However, it didn't handle the situation where {\stylesheet{\fs19\lang1033 \snext0 Normal;}} was missing. In that case there is no "Normal" paragraph style to inherit from, and thus his fix is also needed in the no-style case. make CppunitTest_sw_rtfexport3 \ CPPUNIT_TEST_NAME=testTdf154129_transparentFrame Change-Id: Iaa5b92cd626192d44d11c1365b9b483bd46dff9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148815 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> diff --git a/sw/qa/extras/rtfexport/data/tdf154129_transparentFrame.rtf b/sw/qa/extras/rtfexport/data/tdf154129_transparentFrame.rtf new file mode 100644 index 000000000000..29cece2af5c8 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf154129_transparentFrame.rtf @@ -0,0 +1,3 @@ +{\rtf1\ansi\ansicpg1252\deff0\deflang1033 +\paperw7920\paperh6120\margl360\margr360\margt360\margb302\gutter0 \windowctrl\ftnbj\viewkind1\viewscale100 \sectd \linex0 +{\pard \pvpg\phcol\posx2204\posy3791\absw1772\absh-230\overlay {\pard \cf1 \f0 \b \pvpg\phcol\posx2204\posy3791\absw1772\absh-220\overlay VISIBLE\par}\par}\sect } diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx index e47212c82f86..83d1743e05d2 100644 --- a/sw/qa/extras/rtfexport/rtfexport3.cxx +++ b/sw/qa/extras/rtfexport/rtfexport3.cxx @@ -109,6 +109,12 @@ DECLARE_RTFEXPORT_TEST(testTdf130817, "tdf130817.rtf") CPPUNIT_ASSERT_EQUAL(OUString("$"), xEndnote1->getAnchor()->getString()); } +DECLARE_RTFEXPORT_TEST(testTdf154129_transparentFrame, "tdf154129_transparentFrame.rtf") +{ + // Without the fix, this was zero, and the text frame with "Visible" just looks white. + CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(getShape(1), "FillTransparence")); +} + DECLARE_RTFEXPORT_TEST(testTdf137683_charHighlightNone, "tdf137683_charHighlightNone.rtf") { uno::Reference<beans::XPropertySet> xRun(getRun(getParagraph(1), 1), uno::UNO_QUERY_THROW); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 0f8991819b3b..2324fa78c2b5 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1811,12 +1811,14 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) comphelper::makePropertyValue(getPropertyName(PROP_FRM_DIRECTION), *nDirection)); } + // If there is no fill, the Word default is 100% transparency. + // Otherwise CellColorHandler has priority, and this setting + // will be ignored. + aFrameProperties.push_back(comphelper::makePropertyValue( + getPropertyName(PROP_BACK_COLOR_TRANSPARENCY), sal_Int32(100))); + if (vProps.size() > 1) { - // If there is no fill, the Word default is 100% transparency. - // Otherwise CellColorHandler has priority, and this setting - // will be ignored. - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_BACK_COLOR_TRANSPARENCY), sal_Int32(100))); uno::Sequence<beans::PropertyValue> aGrabBag( comphelper::InitPropertySequence({ { "ParaFrameProperties", uno::Any(rAppendContext.pLastParagraphProperties->IsFrameMode()) }