Kaydet (Commit) 7c5f1caa authored tarafından Daniel's avatar Daniel Kaydeden (comit) Thorsten Behrens

tdf#117581 impress: fix selection overlay after moving table

Change-Id: Ie5afa4fbddf86c6692a7ed68af9ef990c2f9f487
Reviewed-on: https://gerrit.libreoffice.org/54493Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst b3b169dd
...@@ -177,6 +177,7 @@ private: ...@@ -177,6 +177,7 @@ private:
CellPos maCursorFirstPos; CellPos maCursorFirstPos;
CellPos maCursorLastPos; CellPos maCursorLastPos;
bool mbCellSelectionMode; bool mbCellSelectionMode;
bool mbHasJustMerged;
CellPos maMouseDownPos; CellPos maMouseDownPos;
bool mbLeftButtonDown; bool mbLeftButtonDown;
std::unique_ptr<sdr::overlay::OverlayObjectList> mpSelectionOverlay; std::unique_ptr<sdr::overlay::OverlayObjectList> mpSelectionOverlay;
......
...@@ -172,6 +172,7 @@ SvxTableController::SvxTableController( ...@@ -172,6 +172,7 @@ SvxTableController::SvxTableController(
SdrView& rView, SdrView& rView,
const SdrTableObj& rObj) const SdrTableObj& rObj)
: mbCellSelectionMode(false) : mbCellSelectionMode(false)
,mbHasJustMerged(false)
,mbLeftButtonDown(false) ,mbLeftButtonDown(false)
,mpSelectionOverlay(nullptr) ,mpSelectionOverlay(nullptr)
,mrView(rView) ,mrView(rView)
...@@ -1820,6 +1821,8 @@ void SvxTableController::MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, s ...@@ -1820,6 +1821,8 @@ void SvxTableController::MergeRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, s
} }
xRange->merge(); xRange->merge();
mbHasJustMerged = true;
setSelectedCells( maCursorFirstPos, maCursorFirstPos );
if( bUndo ) if( bUndo )
rModel.EndUndo(); rModel.EndUndo();
...@@ -2144,6 +2147,11 @@ void SvxTableController::onTableModified() ...@@ -2144,6 +2147,11 @@ void SvxTableController::onTableModified()
void SvxTableController::updateSelectionOverlay() 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(); destroySelectionOverlay();
if( mbCellSelectionMode ) if( mbCellSelectionMode )
{ {
...@@ -2792,9 +2800,11 @@ IMPL_LINK_NOARG(SvxTableController, UpdateHdl, void*, void) ...@@ -2792,9 +2800,11 @@ IMPL_LINK_NOARG(SvxTableController, UpdateHdl, void*, void)
if( aStart != maCursorFirstPos || aEnd != maCursorLastPos ) if( aStart != maCursorFirstPos || aEnd != maCursorLastPos )
{ {
setSelectedCells( aStart, aEnd ); setSelectedCells( aStart, aEnd );
updateSelectionOverlay();
} }
} }
updateSelectionOverlay();
mbHasJustMerged = false;
} }
namespace namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment