summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-06-10 18:19:30 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-06-12 13:17:32 +0000
commitb56c4afb219c3ad2507af9d4eadf0c765c3bc0e0 (patch)
tree13bf38bc773490f501f487fc82f55171f08162b2 /sd
parent15a4ad716c169f8502a4156238a3e79a9d7b7319 (diff)
Related bnc#862510: extend handling of txXfrm
We don't actually need to check mbAnchorCtr to change text spacing. This txXfrm workaround works only with rectangles, because other shapes' text area can be smaller then the shape size. So add some condition to avoid using it for other shapes. Plus fix typos cause regression introduced in: 53c376d35b7223d53e8c9403390afe53d1f69089 (cherry picked from commit 98dd0f2bb5801f974374ef341037e094e4275cbb) Conflicts: sd/qa/unit/import-tests.cxx Change-Id: I87917b8e0b2bb97ae1bba773e7dda7f81682736f Reviewed-on: https://gerrit.libreoffice.org/9728 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/bnc862510_5.pptxbin0 -> 63675 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx23
2 files changed, 23 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/bnc862510_5.pptx b/sd/qa/unit/data/pptx/bnc862510_5.pptx
new file mode 100644
index 000000000000..ed145e4cfc2c
--- /dev/null
+++ b/sd/qa/unit/data/pptx/bnc862510_5.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 32431b11c60c..f4f4f081d6aa 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -62,6 +62,7 @@ public:
void testBnc870233_1();
void testBnc870233_2();
void testBnc880763();
+ void testBnc862510_5();
CPPUNIT_TEST_SUITE(SdFiltersTest);
CPPUNIT_TEST(testDocumentLayout);
@@ -77,6 +78,7 @@ public:
CPPUNIT_TEST(testBnc870233_1);
CPPUNIT_TEST(testBnc870233_2);
CPPUNIT_TEST(testBnc880763);
+ CPPUNIT_TEST(testBnc862510_5);
CPPUNIT_TEST_SUITE_END();
};
@@ -592,6 +594,27 @@ void SdFiltersTest::testBnc880763()
xDocShRef->DoClose();
}
+void SdFiltersTest::testBnc862510_5()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/bnc862510_5.pptx"));
+ xDocShRef = saveAndReload( xDocShRef, PPTX );
+
+ SdDrawDocument *pDoc = xDocShRef->GetDoc();
+ CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
+ const SdrPage *pPage = pDoc->GetPage (1);
+ CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
+
+ // Same as testBnc870237, but here we check the horizontal spacing
+ const SdrObject* pObj = dynamic_cast<SdrObject*>( pPage->GetObj( 1 ) );
+ CPPUNIT_ASSERT_MESSAGE( "no object", pObj != NULL);
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrTextUpperDistItem& >(pObj->GetMergedItem(SDRATTR_TEXT_UPPERDIST))).GetValue());
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrTextLowerDistItem& >(pObj->GetMergedItem(SDRATTR_TEXT_LOWERDIST))).GetValue());
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(7510), (static_cast< const SdrTextRightDistItem& >(pObj->GetMergedItem(SDRATTR_TEXT_RIGHTDIST))).GetValue());
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(0), (static_cast< const SdrTextLeftDistItem& >(pObj->GetMergedItem(SDRATTR_TEXT_LEFTDIST))).GetValue());
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdFiltersTest);
CPPUNIT_PLUGIN_IMPLEMENT();