Kaydet (Commit) 2b756179 authored tarafından serdarot5's avatar serdarot5 Kaydeden (comit) Markus Mohrhard

fixed image and textbox rotation on xlsx files tdf#83672

Change-Id: If91e64e46601e1f8b5834d278f14182f8c949a2b
Reviewed-on: https://gerrit.libreoffice.org/40790Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 71428257
...@@ -241,6 +241,7 @@ public: ...@@ -241,6 +241,7 @@ public:
void testTdf100709XLSX(); void testTdf100709XLSX();
void testTdf97598XLSX(); void testTdf97598XLSX();
void testTdf110440XLSX(); void testTdf110440XLSX();
void testTdf83672XLSX();
void testPageScalingXLSX(); void testPageScalingXLSX();
void testActiveXCheckboxXLSX(); void testActiveXCheckboxXLSX();
...@@ -369,6 +370,7 @@ public: ...@@ -369,6 +370,7 @@ public:
CPPUNIT_TEST(testTdf100709XLSX); CPPUNIT_TEST(testTdf100709XLSX);
CPPUNIT_TEST(testTdf97598XLSX); CPPUNIT_TEST(testTdf97598XLSX);
CPPUNIT_TEST(testTdf110440XLSX); CPPUNIT_TEST(testTdf110440XLSX);
CPPUNIT_TEST(testTdf83672XLSX);
CPPUNIT_TEST(testPageScalingXLSX); CPPUNIT_TEST(testPageScalingXLSX);
CPPUNIT_TEST(testActiveXCheckboxXLSX); CPPUNIT_TEST(testActiveXCheckboxXLSX);
...@@ -3929,6 +3931,25 @@ void ScFiltersTest::testTdf97598XLSX() ...@@ -3929,6 +3931,25 @@ void ScFiltersTest::testTdf97598XLSX()
xDocSh->DoClose(); 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 #ifdef UNX
void ScFiltersTest::testUnicodeFileNameGnumeric() void ScFiltersTest::testUnicodeFileNameGnumeric()
{ {
......
...@@ -257,9 +257,9 @@ void DrawingFragment::onEndElement() ...@@ -257,9 +257,9 @@ void DrawingFragment::onEndElement()
if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() ) if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() )
{ {
// Rotation is decided by orientation of shape determined // Rotation is decided by orientation of shape determined
// by the anchor position given by 'twoCellAnchor' // by the anchor position given by 'editAs="oneCell"'
if ( getCurrentElement() == XDR_TOKEN( twoCellAnchor ) ) if ( mxAnchor->getEditAs() != ShapeAnchor::ANCHOR_ONECELL )
mxShape->setRotation(0); mxShape->setRotation(0);
EmuRectangle aShapeRectEmu = mxAnchor->calcAnchorRectEmu( getDrawPageSize() ); EmuRectangle aShapeRectEmu = mxAnchor->calcAnchorRectEmu( getDrawPageSize() );
const bool bIsShapeVisible = mxAnchor->isAnchorValid(); const bool bIsShapeVisible = mxAnchor->isAnchorValid();
if( (aShapeRectEmu.X >= 0) && (aShapeRectEmu.Y >= 0) && (aShapeRectEmu.Width >= 0) && (aShapeRectEmu.Height >= 0) ) if( (aShapeRectEmu.X >= 0) && (aShapeRectEmu.Y >= 0) && (aShapeRectEmu.Width >= 0) && (aShapeRectEmu.Height >= 0) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment