sc/qa/unit/data/xlsx/tdf83672.xlsx |binary sc/qa/unit/subsequent_filters-test.cxx | 21 +++++++++++++++++++++ sc/source/filter/oox/drawingfragment.cxx | 6 +++--- 3 files changed, 24 insertions(+), 3 deletions(-)
New commits: commit 2b7561799eeb0bf8ae14bff3702ffa6cda15d17c Author: serdarot5 <serdar...@gmail.com> Date: Sat Aug 5 21:11:22 2017 +0300 fixed image and textbox rotation on xlsx files tdf#83672 Change-Id: If91e64e46601e1f8b5834d278f14182f8c949a2b Reviewed-on: https://gerrit.libreoffice.org/40790 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/qa/unit/data/xlsx/tdf83672.xlsx b/sc/qa/unit/data/xlsx/tdf83672.xlsx new file mode 100755 index 000000000000..0469682b2f43 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf83672.xlsx differ diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 66873628055a..43c0664e5245 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -241,6 +241,7 @@ public: void testTdf100709XLSX(); void testTdf97598XLSX(); void testTdf110440XLSX(); + void testTdf83672XLSX(); void testPageScalingXLSX(); void testActiveXCheckboxXLSX(); @@ -369,6 +370,7 @@ public: CPPUNIT_TEST(testTdf100709XLSX); CPPUNIT_TEST(testTdf97598XLSX); CPPUNIT_TEST(testTdf110440XLSX); + CPPUNIT_TEST(testTdf83672XLSX); CPPUNIT_TEST(testPageScalingXLSX); CPPUNIT_TEST(testActiveXCheckboxXLSX); @@ -3929,6 +3931,25 @@ void ScFiltersTest::testTdf97598XLSX() xDocSh->DoClose(); } +void ScFiltersTest::testTdf83672XLSX() +{ + ScDocShellRef xDocSh = loadDoc("tdf83672.", FORMAT_XLSX); + CPPUNIT_ASSERT_MESSAGE("Failed to load tdf83672.xlsx", xDocSh.is()); + uno::Reference< drawing::XDrawPagesSupplier > xDoc( + xDocSh->GetModel(), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XDrawPage > xPage( + xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XShape > xShape( + xPage->getByIndex(0), uno::UNO_QUERY_THROW ); + CPPUNIT_ASSERT_MESSAGE( "failed to load shape", xShape.is() ); + uno::Reference< beans::XPropertySet > xShapeProperties( + xShape, uno::UNO_QUERY ); + sal_Int32 nRotate = 0; + xShapeProperties->getPropertyValue("RotateAngle") >>= nRotate; + CPPUNIT_ASSERT(nRotate != 0); + xDocSh->DoClose(); +} + #ifdef UNX void ScFiltersTest::testUnicodeFileNameGnumeric() { diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index 9675067d168b..555a3fe5f14f 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -257,9 +257,9 @@ void DrawingFragment::onEndElement() if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() ) { // Rotation is decided by orientation of shape determined - // by the anchor position given by 'twoCellAnchor' - if ( getCurrentElement() == XDR_TOKEN( twoCellAnchor ) ) - mxShape->setRotation(0); + // by the anchor position given by 'editAs="oneCell"' + if ( mxAnchor->getEditAs() != ShapeAnchor::ANCHOR_ONECELL ) + mxShape->setRotation(0); EmuRectangle aShapeRectEmu = mxAnchor->calcAnchorRectEmu( getDrawPageSize() ); const bool bIsShapeVisible = mxAnchor->isAnchorValid(); if( (aShapeRectEmu.X >= 0) && (aShapeRectEmu.Y >= 0) && (aShapeRectEmu.Width >= 0) && (aShapeRectEmu.Height >= 0) ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits