summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsc/qa/unit/data/xlsx/tdf83672.xlsxbin0 -> 40167 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx21
-rw-r--r--sc/source/filter/oox/drawingfragment.cxx6
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
new file mode 100755
index 000000000000..0469682b2f43
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf83672.xlsx
Binary files 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) )