summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-09-04 18:35:33 +0200
committerEike Rathke <erack@redhat.com>2017-09-20 16:58:50 +0200
commitea572a4fc616721b2d77baf6242c48a371fdc489 (patch)
treeecb36fc6e9673c937602045296e710be7de11e2e
parentecdf8f280379c87e23c8dd1f138d63a75f4a9dbd (diff)
Resolves: tdf#99477 freeze first col/row always set a freeze
The previous implementation had the odd behavior that Freeze First Column and Freeze First Row removed any frozen state (column or row) if there was one, instead of freezing the actually selected choice. Changed to * Freeze First Column * always freezes the first column * removes another column freeze if there was one * keeps a row freeze if there is one * checks the Freeze Rows and Columns toggle box * Freeze First Row * always freezes the first row * removes another row freeze if there was one * keeps a column freeze if there is one * checks the Freeze Rows and Columns toggle box * Freeze Rows and Columns * freezes at the current cell cursor position if there was no freeze (toggle box was unchecked) * removes any freeze if there was one (toggle box was checked) Change-Id: I38c4b6f0486ef8e93da0bb3a69a99e5c7709a21e Reviewed-on: https://gerrit.libreoffice.org/41908 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/ui/view/tabview.cxx8
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx26
2 files changed, 23 insertions, 11 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index ee238ffa9dac..bd963bc0d438 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -1962,9 +1962,13 @@ void ScTabView::FreezeSplitters( bool bFreeze, SplitMethod eSplitMetod)
bool bLeft;
bool bTop;
aViewData.GetMouseQuadrant( aSplit, ePos, nPosX, nPosY, bLeft, bTop );
- if (!bLeft)
+ if (eSplitMetod == SC_SPLIT_METHOD_FIRST_COL)
+ nPosX = 1;
+ else if (!bLeft)
++nPosX;
- if (!bTop)
+ if (eSplitMetod == SC_SPLIT_METHOD_FIRST_ROW)
+ nPosY = 1;
+ else if (!bTop)
++nPosY;
}
else
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index a3c9efdf4259..36dc62070d65 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -945,23 +945,31 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
break;
case SID_WINDOW_FIX:
- case SID_WINDOW_FIX_COL:
- case SID_WINDOW_FIX_ROW:
{
- SplitMethod eSplitMethod = SC_SPLIT_METHOD_CURSOR;
- if (nSlot == SID_WINDOW_FIX_COL)
- eSplitMethod = SC_SPLIT_METHOD_FIRST_COL;
- else if (nSlot == SID_WINDOW_FIX_ROW)
- eSplitMethod = SC_SPLIT_METHOD_FIRST_ROW;
-
ScSplitMode eHSplit = GetViewData().GetHSplitMode();
ScSplitMode eVSplit = GetViewData().GetVSplitMode();
if ( eHSplit == SC_SPLIT_FIX || eVSplit == SC_SPLIT_FIX ) // remove
RemoveSplit();
else
- FreezeSplitters( true, eSplitMethod); // create or fixate
+ FreezeSplitters( true, SC_SPLIT_METHOD_CURSOR); // create or fixate
+
rReq.Done();
+ InvalidateSplit();
+ }
+ break;
+ case SID_WINDOW_FIX_COL:
+ {
+ FreezeSplitters( true, SC_SPLIT_METHOD_FIRST_COL);
+ rReq.Done();
+ InvalidateSplit();
+ }
+ break;
+
+ case SID_WINDOW_FIX_ROW:
+ {
+ FreezeSplitters( true, SC_SPLIT_METHOD_FIRST_ROW);
+ rReq.Done();
InvalidateSplit();
}
break;