summaryrefslogtreecommitdiff
path: root/sd/qa/unit
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2020-08-11 00:43:49 +0300
committerGülşah Köse <gulsah.kose@collabora.com>2020-08-11 11:52:09 +0200
commit6e99f606baad33d6e662ecb21964f3d11b562750 (patch)
tree26e961249622a9aa12ac795abac31eb115fd2812 /sd/qa/unit
parent2d582244680e7f6dec6e4a466e276f93ccb01dc9 (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>
Diffstat (limited to 'sd/qa/unit')
-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 d595d3d421fd..0dcdd28ee99b 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)