diff options
author | serdarot5 <serdarot5@gmail.com> | 2017-08-05 21:11:22 +0300 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-27 00:59:23 +0200 |
commit | 2b7561799eeb0bf8ae14bff3702ffa6cda15d17c (patch) | |
tree | 5ffc2c03771aef34f41fb4847e01cd9da6a01045 /sc | |
parent | 714282573cd6fe8c9d95d3072c15d1e6cb94dc73 (diff) |
fixed image and textbox rotation on xlsx files tdf#83672
Change-Id: If91e64e46601e1f8b5834d278f14182f8c949a2b
Reviewed-on: https://gerrit.libreoffice.org/40790
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rwxr-xr-x | sc/qa/unit/data/xlsx/tdf83672.xlsx | bin | 0 -> 40167 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_filters-test.cxx | 21 | ||||
-rw-r--r-- | sc/source/filter/oox/drawingfragment.cxx | 6 |
3 files changed, 24 insertions, 3 deletions
diff --git a/sc/qa/unit/data/xlsx/tdf83672.xlsx b/sc/qa/unit/data/xlsx/tdf83672.xlsx Binary files differnew file mode 100755 index 000000000000..0469682b2f43 --- /dev/null +++ b/sc/qa/unit/data/xlsx/tdf83672.xlsx 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) ) |