[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/source
Pranam Lashkari (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 24 14:31:50 UTC 2020
sc/source/ui/inc/viewdata.hxx | 1
sc/source/ui/view/tabvwsh3.cxx | 53 +++++++++++++++++++++++++++++++++++------
sc/source/ui/view/tabvwsha.cxx | 15 +++++++++--
sc/source/ui/view/viewdata.cxx | 7 +++++
4 files changed, 66 insertions(+), 10 deletions(-)
New commits:
commit 69b0fe3a11990403730a51fda5475f46915c27d3
Author: Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Fri Aug 21 07:41:37 2020 +0530
Commit: Dennis Francis <dennis.francis at collabora.com>
CommitDate: Mon Aug 24 16:31:19 2020 +0200
lok-freezepanes: fixed freeze row and column handling
Added freeze row and column buttons in online UI did not work
because the case for LOK was not handled
Change-Id: I44315c6bc89ae02b7a8ac4c7c493ad7e8eda439e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101127
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Dennis Francis <dennis.francis at collabora.com>
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 58e8c1701d0e..da753a509653 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -656,6 +656,7 @@ public:
SCCOLROW GetLOKSheetFreezeIndex(bool bIsCol) const;
bool SetLOKSheetFreezeIndex(const SCCOLROW nFreezeIndex, bool bIsCol, SCTAB nForTab = -1);
+ bool RemoveLOKFreeze();
void DeriveLOKFreezeAllSheets();
void DeriveLOKFreezeIfNeeded(SCTAB nForTab);
void OverrideWithLOKFreeze(ScSplitMode& eExHSplitMode, ScSplitMode& eExVSplitMode,
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 2f637eeca969..0570e0b76385 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -929,15 +929,52 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
case SID_WINDOW_FIX:
{
- ScSplitMode eHSplit = GetViewData().GetHSplitMode();
- ScSplitMode eVSplit = GetViewData().GetVSplitMode();
- if ( eHSplit == SC_SPLIT_FIX || eVSplit == SC_SPLIT_FIX ) // remove
- RemoveSplit();
+ if (!comphelper::LibreOfficeKit::isActive())
+ {
+ ScSplitMode eHSplit = GetViewData().GetHSplitMode();
+ ScSplitMode eVSplit = GetViewData().GetVSplitMode();
+ if ( eHSplit == SC_SPLIT_FIX || eVSplit == SC_SPLIT_FIX ) // remove
+ RemoveSplit();
+ else
+ FreezeSplitters( true, SC_SPLIT_METHOD_CURSOR); // create or fixate
+ rReq.Done();
+ InvalidateSplit();
+ }
else
- FreezeSplitters( true, SC_SPLIT_METHOD_CURSOR); // create or fixate
+ {
+ ScViewData& rViewData = GetViewData();
+ SCTAB nThisTab = rViewData.GetTabNo();
+ bool bChangedX, bChangedY;
+ if (rViewData.GetLOKSheetFreezeIndex(true) > 0 ||
+ rViewData.GetLOKSheetFreezeIndex(false) > 0 ) // remove freeze
+ {
+ bChangedX = rViewData.RemoveLOKFreeze();
+ } // create or fixate
+ else
+ {
+ bChangedX = rViewData.SetLOKSheetFreezeIndex(rViewData.GetCurX(), true); // Freeze column
+ bChangedY = rViewData.SetLOKSheetFreezeIndex(rViewData.GetCurY(), false); // Freeze row
+ }
- rReq.Done();
- InvalidateSplit();
+ rReq.Done();
+ if (bChangedX || bChangedY)
+ {
+ rBindings.Invalidate( SID_WINDOW_FIX );
+ rBindings.Invalidate( SID_WINDOW_FIX_COL );
+ rBindings.Invalidate( SID_WINDOW_FIX_ROW );
+ // Invalidate the slot for all views on the same tab of the document.
+ SfxLokHelper::forEachOtherView(this, [nThisTab](ScTabViewShell* pOther) {
+ ScViewData& rOtherViewData = pOther->GetViewData();
+ if (rOtherViewData.GetTabNo() != nThisTab)
+ return;
+
+ SfxBindings& rOtherBind = rOtherViewData.GetBindings();
+ rOtherBind.Invalidate( SID_WINDOW_FIX );
+ rOtherBind.Invalidate( SID_WINDOW_FIX_COL );
+ rOtherBind.Invalidate( SID_WINDOW_FIX_ROW );
+ });
+ }
+ }
}
break;
@@ -961,6 +998,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
rReq.Done();
if (bChanged)
{
+ rBindings.Invalidate( SID_WINDOW_FIX );
rBindings.Invalidate(nSlot);
// Invalidate the slot for all views on the same tab of the document.
SfxLokHelper::forEachOtherView(this, [nSlot, nThisTab](ScTabViewShell* pOther) {
@@ -969,6 +1007,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
return;
SfxBindings& rOtherBind = rOtherViewData.GetBindings();
+ rOtherBind.Invalidate( SID_WINDOW_FIX );
rOtherBind.Invalidate(nSlot);
});
}
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 538897613053..f527e539b62b 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -412,9 +412,18 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
break;
case SID_WINDOW_FIX:
- rSet.Put(SfxBoolItem(nWhich,
- rViewData.GetHSplitMode() == SC_SPLIT_FIX ||
- rViewData.GetVSplitMode() == SC_SPLIT_FIX ));
+ if(!comphelper::LibreOfficeKit::isActive())
+ {
+ rSet.Put(SfxBoolItem(nWhich,
+ rViewData.GetHSplitMode() == SC_SPLIT_FIX ||
+ rViewData.GetVSplitMode() == SC_SPLIT_FIX ));
+ }
+ else
+ {
+ rSet.Put(SfxBoolItem(nWhich,
+ rViewData.GetLOKSheetFreezeIndex(true) > 0 ||
+ rViewData.GetLOKSheetFreezeIndex(false) > 0 ));
+ }
break;
case SID_WINDOW_FIX_COL:
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index dca6a35069c2..e98378fa853f 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -4133,6 +4133,13 @@ bool ScViewData::SetLOKSheetFreezeIndex(const SCCOLROW nFreezeIndex, bool bIsCol
pDoc->SetLOKFreezeRow(static_cast<SCROW>(nFreezeIndex), nForTab);
}
+bool ScViewData::RemoveLOKFreeze()
+{
+ bool colUnfreezed = SetLOKSheetFreezeIndex(0, true);
+ bool rowUnfreezed = SetLOKSheetFreezeIndex(0, false);
+ return colUnfreezed || rowUnfreezed;
+}
+
void ScViewData::DeriveLOKFreezeAllSheets()
{
SCTAB nMaxTab = static_cast<SCTAB>(maTabData.size()) - 1;
More information about the Libreoffice-commits
mailing list