File bsc1098891.patch of Package libreoffice.openSUSE_Leap_42.3_Update

From 4a130847f8da0b57ec425affa36a645da7fbac17 Mon Sep 17 00:00:00 2001
From: Mike Kaganski <mike.kaganski@collabora.com>
Date: Tue, 31 Jul 2018 15:25:18 +0300
Subject: [PATCH] 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>
---
 sd/qa/unit/data/pptx/tdf119015.pptx  | Bin 0 -> 11652 bytes
 sd/qa/unit/import-tests.cxx          |  24 ++++++++++++++++++++++++
 svx/source/table/cellcursor.cxx      |   1 -
 svx/source/table/tablecontroller.cxx |   1 +
 4 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 sd/qa/unit/data/pptx/tdf119015.pptx

diff --git a/svx/source/table/cellcursor.cxx b/svx/source/table/cellcursor.cxx
index db68fdb61ab4..2b12292d42cc 100644
--- a/svx/source/table/cellcursor.cxx
+++ b/svx/source/table/cellcursor.cxx
@@ -251,7 +251,6 @@ void SAL_CALL CellCursor::merge(  )
     try
     {
         mxTable->merge( aStart.mnCol, aStart.mnRow, aEnd.mnCol - aStart.mnCol + 1, aEnd.mnRow - aStart.mnRow + 1 );
-        mxTable->optimize();
         mxTable->setModified(true);
     }
     catch( Exception& )
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 6649ba4df9b4..2135362e429c 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1807,6 +1807,7 @@ void SvxTableController::MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, s
             }

             xRange->merge();
+            mxTable->optimize();

             if( bUndo )
                 mpModel->EndUndo();
--
2.13.7

openSUSE Build Service is sponsored by