oox/source/vml/vmlshape.cxx | 6 +++++- sw/qa/extras/ww8import/data/tdf134902.docx |binary sw/qa/extras/ww8import/ww8import.cxx | 22 ++++++++++++++++++++++ xmloff/inc/xmlprop.hxx | 1 + 4 files changed, 28 insertions(+), 1 deletion(-)
New commits: commit 07ea82b5be907e84f701964aa389331c476e186f Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Wed Aug 7 12:56:05 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Sep 10 01:01:53 2024 +0200 tdf#134902 Test added Import test added as follow-up to 0d512cb88757ced10a825a3d544e41696a54341a to check that the imported shape is not visible. Change-Id: I9671930a5613021be20c75e021213dfda5e763cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173057 Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> Tested-by: allotropia jenkins <jenk...@allotropia.de> diff --git a/sw/qa/extras/ww8import/data/tdf134902.docx b/sw/qa/extras/ww8import/data/tdf134902.docx new file mode 100644 index 000000000000..fc89611f65cd Binary files /dev/null and b/sw/qa/extras/ww8import/data/tdf134902.docx differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 58c2bcfbf138..e749970b7167 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -275,6 +275,28 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf142003) CPPUNIT_ASSERT(xParagraph->getString().startsWith("Lorem ipsum , consectetur adipiscing elit.")); } +CPPUNIT_TEST_FIXTURE(Test, testTdf134902) +{ + createSwDoc("tdf134902.docx"); + CPPUNIT_ASSERT_EQUAL(4, getShapes()); + uno::Reference<drawing::XShape> xShape; + uno::Reference< beans::XPropertySet > XPropSet; + for (int i = 3; i<= getShapes(); i++) + { + xShape = getShape(i); + XPropSet.set( xShape, uno::UNO_QUERY_THROW ); + try + { + bool isVisible = true; + XPropSet->getPropertyValue(u"Visible"_ustr) >>= isVisible; + CPPUNIT_ASSERT(!isVisible); + } + catch (beans::UnknownPropertyException &) + { /* ignore */ } + } + +} + // tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT CPPUNIT_PLUGIN_IMPLEMENT(); commit 07b12c54055159f221835c8966774fc566a22507 Author: Oliver Specht <oliver.spe...@cib.de> AuthorDate: Thu May 23 14:59:22 2024 +0200 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Tue Sep 10 01:01:43 2024 +0200 tdf#134902 evaluate visibility of VML shapes VML shapes from docx should be invisible if "visibility:hidden" is set. Change-Id: I8299a5c3a7fca8deae2ec37523c3f2e240376893 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167989 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> (cherry picked from commit 0d512cb88757ced10a825a3d544e41696a54341a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173020 Tested-by: allotropia jenkins <jenk...@allotropia.de> diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 5284de176839..993e81e54f0d 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -866,7 +866,11 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes aPropertySet.setAnyProperty(PROP_VertOrientPosition, Any(aShapeRect.Y)); } } - + if (!maTypeModel.mbVisible) + { + aPropertySet.setAnyProperty(PROP_Visible, uno::Any(false)); + aPropertySet.setAnyProperty(PROP_Printable, uno::Any(false)); + } // custom shape geometry attributes std::vector<css::beans::PropertyValue> aPropVec; diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx index 89c53b72a8ea..c83709e21192 100644 --- a/xmloff/inc/xmlprop.hxx +++ b/xmloff/inc/xmlprop.hxx @@ -526,6 +526,7 @@ inline constexpr OUString PROP_PolynomialDegree = u"PolynomialDegree"_ustr; inline constexpr OUString PROP_PositionProtected = u"PositionProtected"_ustr; inline constexpr OUString PROP_PositiveError = u"PositiveError"_ustr; inline constexpr OUString PROP_Print = u"Print"_ustr; +inline constexpr OUString PROP_Printable = u"Printable"_ustr; inline constexpr OUString PROP_PrintAnnotations = u"PrintAnnotations"_ustr; inline constexpr OUString PROP_PrintCharts = u"PrintCharts"_ustr; inline constexpr OUString PROP_PrintDownFirst = u"PrintDownFirst"_ustr;