summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-07-31 15:25:18 +0300
committerAndras Timar <andras.timar@collabora.com>2018-08-04 20:58:51 +0200
commit7a94069af971b9326e017d93b78118201291c48d (patch)
tree9e6450b51e7fcd1732b8c486ea861c5ef301fc45 /sd
parent26300f5d4c4e6241baf8cadcfea094e7969814a5 (diff)
tdf#119015: don't call TableModel::optimize in CellCursor::merge()
Better do that explicitly in the SvxTableController::MergeRange, so that the UI-driven operation still optimizes the table, but import code gets the initial column count, and not throw trying to access the deleted column. Change-Id: Ib4b4d716935ec2036ccb839c36f1be5b0cb878d5 Reviewed-on: https://gerrit.libreoffice.org/58359 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/58380 Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf119015.pptxbin0 -> 11652 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx24
2 files changed, 24 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf119015.pptx b/sd/qa/unit/data/pptx/tdf119015.pptx
new file mode 100644
index 000000000000..8c2313ad9b27
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf119015.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index b9d7b21db3aa..0c7f4debfd99 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -187,6 +187,7 @@ public:
bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
void testPptCrop();
+ void testTdf119015();
CPPUNIT_TEST_SUITE(SdImportTest);
@@ -268,6 +269,7 @@ public:
CPPUNIT_TEST(testTdf77747);
CPPUNIT_TEST(testTdf116266);
CPPUNIT_TEST(testPptCrop);
+ CPPUNIT_TEST(testTdf119015);
CPPUNIT_TEST_SUITE_END();
};
@@ -2533,6 +2535,28 @@ void SdImportTest::testTdf116266()
CPPUNIT_ASSERT_EQUAL(size_t(1), rLinkManager->GetLinks().size());
}
+void SdImportTest::testTdf119015()
+{
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf119015.pptx"), PPTX);
+
+ const SdrPage* pPage = GetPage(1, xDocShRef);
+
+ sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT(pTableObj);
+ // The position was previously not properly initialized: (0, 0, 100, 100)
+ CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(6991, 6902), Size(14099, 1999)),
+ pTableObj->GetLogicRect());
+ uno::Reference<table::XTable> xTable(pTableObj->getTable());
+
+ // Test that we actually have three cells: this threw css.lang.IndexOutOfBoundsException
+ uno::Reference<text::XTextRange> xTextRange(xTable->getCellByPosition(2, 0),
+ uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(OUString("A3"), xTextRange->getString());
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();