summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/view/tabview4.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx
index 3ed71a5ef931..9ff3d41ef4df 100644
--- a/sc/source/ui/view/tabview4.cxx
+++ b/sc/source/ui/view/tabview4.cxx
@@ -229,9 +229,13 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ )
ScRefType eType = aViewData.GetRefType();
if ( eType == SC_REFTYPE_REF )
{
+ if ((nStartX > nEndX || nStartY > nEndY) &&
+ rDoc.HasAttrib(nStartX, nStartY, nTab, HasAttrFlags::Merged))
+ rDoc.ExtendMerge( nStartX, nStartY, nStartX, nStartY, nTab );
+
ScRange aRef(
- aViewData.GetRefStartX(), aViewData.GetRefStartY(), aViewData.GetRefStartZ(),
- aViewData.GetRefEndX(), aViewData.GetRefEndY(), aViewData.GetRefEndZ() );
+ nStartX, nStartY, aViewData.GetRefStartZ(),
+ nEndX, nEndY, aViewData.GetRefEndZ() );
SC_MOD()->SetReference( aRef, rDoc, &rMark );
ShowRefTip();
}