summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2020-08-11 00:43:49 +0300
committerXisco Fauli <xiscofauli@libreoffice.org>2020-09-01 18:02:37 +0200
commit6b6fc688ba334c4f08996b9a258018ef3912ae50 (patch)
treecfca2a97f93a3892bbc9909d9ab9fb2ff2ef5df3 /sd
parente479eb8048aecb8b7309b02b83234592660f6417 (diff)
tdf#133015 Add test for multicolumn textboxes.
Change-Id: I92d6af17313fb5a4a27fc8768b8f3fbe64db1816 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100452 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101751
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/multicol.pptxbin0 -> 25935 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx29
2 files changed, 29 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/multicol.pptx b/sd/qa/unit/data/pptx/multicol.pptx
new file mode 100644
index 000000000000..3590d84c1a6b
--- /dev/null
+++ b/sd/qa/unit/data/pptx/multicol.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 632872f40084..b285b490894b 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -145,6 +145,7 @@ public:
void testPredefinedTableStyle();
void testBnc591147();
void testCreationDate();
+ void testMultiColTexts();
void testBnc584721_1();
void testBnc584721_2();
void testBnc584721_4();
@@ -254,6 +255,7 @@ public:
CPPUNIT_TEST(testPredefinedTableStyle);
CPPUNIT_TEST(testBnc591147);
CPPUNIT_TEST(testCreationDate);
+ CPPUNIT_TEST(testMultiColTexts);
CPPUNIT_TEST(testBnc584721_1);
CPPUNIT_TEST(testBnc584721_2);
CPPUNIT_TEST(testBnc584721_4);
@@ -931,6 +933,33 @@ void SdImportTest::testCreationDate()
xDocShRef->DoClose();
}
+void SdImportTest::testMultiColTexts()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/multicol.pptx"), PPTX );
+ const SdrPage *pPage = GetPage( 1, xDocShRef );
+
+ sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT( pTableObj );
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pTableObj->getRowCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), pTableObj->getColumnCount());
+
+ sdr::table::SdrTableObj *pMasterTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->TRG_GetMasterPage().GetObj(0));
+ CPPUNIT_ASSERT( pMasterTableObj );
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pMasterTableObj->getRowCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), pMasterTableObj->getColumnCount());
+
+ uno::Reference< table::XCellRange > xTable(pMasterTableObj->getTable(), uno::UNO_QUERY_THROW);
+ uno::Reference< beans::XPropertySet > xCell;
+ xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
+ uno::Reference<text::XTextRange> xParagraph(getParagraphFromShape(0, xCell));
+ uno::Reference<text::XTextRange> xRun( getRunFromParagraph (0, xParagraph ) );
+ OUString sText = xRun->getString();
+
+ CPPUNIT_ASSERT_EQUAL(OUString(""), sText); //We don't import master table text for multicolumn case.
+}
+
void SdImportTest::testPredefinedTableStyle()
{
// 073A0DAA-6AF3-43AB-8588-CEC1D06C72B9 (Medium Style 2)