diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2022-01-05 13:03:14 +0300 |
---|---|---|
committer | Gülşah Köse <gulsah.kose@collabora.com> | 2022-01-06 15:16:28 +0100 |
commit | fa5ab8aa5d88e7128015127af75980a65f945cbb (patch) | |
tree | 9f89485e7354c181d6e6c6f7a7ea5e5d9b94b63f | |
parent | 42e7dc75363ee7f326f7f9e2b4476e55300f1f7a (diff) |
tdf#135843 Fix the missing border handling
Adding +1 at that stage causes indexoutofbounds.
But never throws that exception and tries to pull
empty cell style instead. As a result we can not
see the border. Actually no idea why +1 used here.
Change-Id: Id54ba6445d022540173af3bbf5d679b7edefc55b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127990
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
-rw-r--r-- | sd/qa/unit/data/pptx/tdf135843.pptx | bin | 0 -> 22951 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 27 | ||||
-rw-r--r-- | svx/source/table/viewcontactoftableobj.cxx | 4 |
3 files changed, 28 insertions, 3 deletions
diff --git a/sd/qa/unit/data/pptx/tdf135843.pptx b/sd/qa/unit/data/pptx/tdf135843.pptx Binary files differnew file mode 100644 index 000000000000..0a5dcb334b0c --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf135843.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 303ab76bed7b..5035fa6cedb8 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -101,6 +101,7 @@ #include <vcl/dibtools.hxx> #include <svx/svdograf.hxx> #include <vcl/filter/PDFiumLibrary.hxx> +#include <vcl/gdimtf.hxx> using namespace ::com::sun::star; @@ -117,7 +118,7 @@ static std::ostream& operator<<(std::ostream& rStrm, const uno::Reference<T>& xR /// Impress import filters tests. -class SdImportTest : public SdModelTestBase +class SdImportTest : public SdModelTestBaseXML { public: virtual void setUp() override; @@ -187,6 +188,7 @@ public: void testTdf93124(); void testTdf99729(); void testTdf89927(); + void testTdf135843(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -255,6 +257,7 @@ public: CPPUNIT_TEST(testTdf93124); CPPUNIT_TEST(testTdf99729); CPPUNIT_TEST(testTdf89927); + CPPUNIT_TEST(testTdf135843); CPPUNIT_TEST_SUITE_END(); }; @@ -1958,6 +1961,28 @@ void SdImportTest::testTdf89927() xDocShRef->DoClose(); } +void SdImportTest::testTdf135843() +{ + sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf135843.pptx"), PPTX ); + + std::shared_ptr<GDIMetaFile> xMetaFile = xDocShRef->GetPreviewMetaFile(); + MetafileXmlDump dumper; + + xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + // Without the fix, the test fails with: + // - Expected: 21165 + // - Actual : 4218 + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[5]/polyline[1]/point[1]", "x", "21165"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[5]/polyline[1]/point[1]", "y", "3866"); + + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[5]/polyline[1]/point[2]", "x", "21165"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[5]/polyline[1]/point[2]", "y", "5956"); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index 6419c5057dab..932844fe98d7 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -259,9 +259,9 @@ namespace sdr::contact { // copy styles for current cell to CellBorderArray for primitive creation aArray.SetCellStyleLeft(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, false, nColCount, nRowCount, bIsRTL)); - aArray.SetCellStyleRight(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol + 1, aCellPos.mnRow, false, nColCount, nRowCount, bIsRTL)); + aArray.SetCellStyleRight(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, false, nColCount, nRowCount, bIsRTL)); aArray.SetCellStyleTop(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, true, nColCount, nRowCount, bIsRTL)); - aArray.SetCellStyleBottom(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow + 1, true, nColCount, nRowCount, bIsRTL)); + aArray.SetCellStyleBottom(aCellPos.mnCol, aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, true, nColCount, nRowCount, bIsRTL)); // ignore merged cells (all except the top-left of a merged cell) if(!xCurrentCell->isMerged()) |