summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/viewfunc.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/viewfunc.cxx')
-rw-r--r--sc/source/ui/view/viewfunc.cxx26
1 files changed, 24 insertions, 2 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 4c475a7296a7..ef317d7389ae 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1832,6 +1832,8 @@ void ScViewFunc::SetWidthOrHeight(
ScDocShell* pDocSh = GetViewData().GetDocShell();
ScDocument& rDoc = pDocSh->GetDocument();
+ SCCOL nCurX = GetViewData().GetCurX();
+ SCROW nCurY = GetViewData().GetCurY();
SCTAB nFirstTab = aMarkData.GetFirstSelected();
SCTAB nCurTab = GetViewData().GetTabNo();
SCTAB nTab;
@@ -1989,7 +1991,13 @@ void ScViewFunc::SetWidthOrHeight(
rDoc.SetRowHeightRange( nStartNo, nEndNo, nTab, nSizeTwips );
rDoc.SetManualHeight( nStartNo, nEndNo, nTab, true ); // height was set manually
}
+
rDoc.ShowRows( nStartNo, nEndNo, nTab, nSizeTwips != 0 );
+
+ if (!bShow && nStartNo <= nCurY && nCurY <= nEndNo && nTab == nCurTab)
+ {
+ nCurY = -1;
+ }
}
else if ( eMode==SC_SIZE_SHOW )
{
@@ -2010,12 +2018,16 @@ void ScViewFunc::SetWidthOrHeight(
rDoc.SetColWidth( nCol, nTab, nThisSize );
rDoc.ShowCol( nCol, nTab, bShow );
+
+ if (!bShow && nCol == nCurX && nTab == nCurTab)
+ {
+ nCurX = -1;
+ }
}
}
}
- // adjust outline
-
+ // adjust outline
if (bWidth)
{
if ( rDoc.UpdateOutlineCol( static_cast<SCCOL>(nStartNo),
@@ -2042,6 +2054,16 @@ void ScViewFunc::SetWidthOrHeight(
pUndoDoc, aUndoRanges, pUndoTab, eMode, nSizeTwips, bWidth));
}
+ if (nCurX < 0)
+ {
+ MoveCursorRel( 1, 0, SC_FOLLOW_LINE, false );
+ }
+
+ if (nCurY < 0)
+ {
+ MoveCursorRel( 0, 1, SC_FOLLOW_LINE, false );
+ }
+
// fdo#36247 Ensure that the drawing layer's map mode scaling factors match
// the new heights and widths.
GetViewData().GetView()->RefreshZoom();