[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - oox/source sd/qa
Miklos Vajna
vmiklos at collabora.co.uk
Wed Nov 12 00:03:35 PST 2014
oox/source/export/drawingml.cxx | 13 ++++++++-----
sd/qa/unit/data/fdo79731.odp |binary
sd/qa/unit/import-tests.cxx | 12 ++++++++++++
3 files changed, 20 insertions(+), 5 deletions(-)
New commits:
commit f597199442bac978c38704705a15af4cb0ab6af2
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Nov 5 11:11:45 2014 +0100
fdo#79731 fdo#85813 drawingML export: fix handling of impress tables
(cherry picked from commit 02e52b15908a6d89b4aeb3c349e7414240eb9563)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
Conflicts:
oox/source/export/drawingml.cxx
sd/qa/unit/export-tests.cxx
Change-Id: Ia17b14c4b27e808ceab388aa33602875e67433a5
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 641cb4d..96c90c5 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1088,10 +1088,12 @@ void DrawingML::WriteShapeTransformation( Reference< XShape > rXShape, sal_Int32
aPos.X-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Width/2-facsin*sin(nRotation*F_PI18000)*aSize.Height/2;
aPos.Y-=(1-faccos*cos(nRotation*F_PI18000))*aSize.Height/2+facsin*sin(nRotation*F_PI18000)*aSize.Width/2;
}
- }
- if (!bSuppressRotation)
- {
- if (bFlipV) {nRotation=(nRotation+18000)%36000;}
+
+ // The RotateAngle property's value is independent from any flipping, and that's exactly what we need here.
+ uno::Reference<beans::XPropertySet> xPropertySet(rXShape, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
+ if (xPropertySetInfo->hasPropertyByName("RotateAngle"))
+ xPropertySet->getPropertyValue("RotateAngle") >>= nRotation;
}
WriteTransformation( Rectangle( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) ), nXmlNamespace, bFlipH, bFlipV, PPTX_EXPORT_ROTATE_CLOCKWISIFY(nRotation) );
}
@@ -1791,7 +1793,8 @@ void DrawingML::WriteText( Reference< XInterface > rXIface, bool bBodyPr, bool b
if( !enumeration.is() )
return;
- SdrObject* pSdrObject = GetSdrObjectFromXShape(uno::Reference<drawing::XShape>(rXIface, uno::UNO_QUERY_THROW));
+ uno::Reference<drawing::XShape> xShape(rXIface, uno::UNO_QUERY);
+ SdrObject* pSdrObject = xShape.is() ? GetSdrObjectFromXShape(xShape) : 0;
const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, pSdrObject);
if (pTxtObj && mpTextExport)
{
diff --git a/sd/qa/unit/data/fdo79731.odp b/sd/qa/unit/data/fdo79731.odp
new file mode 100644
index 0000000..d5d094a
Binary files /dev/null and b/sd/qa/unit/data/fdo79731.odp differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 640063a..ede33d6 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -91,6 +91,7 @@ public:
void testBnc480256();
void testCreationDate();
void testBnc584721_4();
+ void testFdo79731();
CPPUNIT_TEST_SUITE(SdFiltersTest);
CPPUNIT_TEST(testDocumentLayout);
@@ -123,6 +124,7 @@ public:
CPPUNIT_TEST(testBnc480256);
CPPUNIT_TEST(testCreationDate);
CPPUNIT_TEST(testBnc584721_4);
+ CPPUNIT_TEST(testFdo79731);
CPPUNIT_TEST_SUITE_END();
};
@@ -1105,6 +1107,16 @@ void SdFiltersTest::testBnc584721_4()
xDocShRef->DoClose();
}
+void SdFiltersTest::testFdo79731()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo79731.odp"));
+ xDocShRef = saveAndReload(xDocShRef, PPTX);
+ SdDrawDocument *pDoc = xDocShRef->GetDoc();
+ CPPUNIT_ASSERT(pDoc);
+ xDocShRef->DoClose();
+}
+
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest);
CPPUNIT_PLUGIN_IMPLEMENT();
More information about the Libreoffice-commits
mailing list