summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/sdr/table/tablecontroller.hxx1
-rw-r--r--svx/source/table/tablecontroller.cxx12
2 files changed, 12 insertions, 1 deletions
diff --git a/include/svx/sdr/table/tablecontroller.hxx b/include/svx/sdr/table/tablecontroller.hxx
index 3a8ec322aaeb..130d57a6da3e 100644
--- a/include/svx/sdr/table/tablecontroller.hxx
+++ b/include/svx/sdr/table/tablecontroller.hxx
@@ -177,6 +177,7 @@ private:
CellPos maCursorFirstPos;
CellPos maCursorLastPos;
bool mbCellSelectionMode;
+ bool mbHasJustMerged;
CellPos maMouseDownPos;
bool mbLeftButtonDown;
std::unique_ptr<sdr::overlay::OverlayObjectList> mpSelectionOverlay;
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 3568fa743fd7..3241f2c7d304 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -172,6 +172,7 @@ SvxTableController::SvxTableController(
SdrView& rView,
const SdrTableObj& rObj)
: mbCellSelectionMode(false)
+ ,mbHasJustMerged(false)
,mbLeftButtonDown(false)
,mpSelectionOverlay(nullptr)
,mrView(rView)
@@ -1820,6 +1821,8 @@ void SvxTableController::MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, s
}
xRange->merge();
+ mbHasJustMerged = true;
+ setSelectedCells( maCursorFirstPos, maCursorFirstPos );
if( bUndo )
rModel.EndUndo();
@@ -2144,6 +2147,11 @@ void SvxTableController::onTableModified()
void SvxTableController::updateSelectionOverlay()
{
+ // There is no need to update selection overlay after merging cells
+ // since the selection overlay should remain the same
+ if ( mbHasJustMerged )
+ return;
+
destroySelectionOverlay();
if( mbCellSelectionMode )
{
@@ -2792,9 +2800,11 @@ IMPL_LINK_NOARG(SvxTableController, UpdateHdl, void*, void)
if( aStart != maCursorFirstPos || aEnd != maCursorLastPos )
{
setSelectedCells( aStart, aEnd );
- updateSelectionOverlay();
}
}
+
+ updateSelectionOverlay();
+ mbHasJustMerged = false;
}
namespace