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
committerGülşah Köse <gulsah.kose@collabora.com>2020-08-18 20:29:59 +0200
commit91f298fa883e173125e4cb1fd3fc862530d1bfad (patch)
tree5c08e3f60df10bb08974bf747e040aa934059035 /sd
parent103eb18195f370bd654fa5333147923b1a0958f8 (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> (cherry picked from commit 6e99f606baad33d6e662ecb21964f3d11b562750) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100366 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
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 793f99c6cd8f..85fac6becdd1 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -141,6 +141,7 @@ public:
void testPredefinedTableStyle();
void testBnc591147();
void testCreationDate();
+ void testMultiColTexts();
void testBnc584721_1();
void testBnc584721_2();
void testBnc584721_4();
@@ -249,6 +250,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);
@@ -913,6 +915,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)