[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sc/source

Pranam Lashkari (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 30 08:33:10 UTC 2021


 sc/source/ui/view/viewdata.cxx |   34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

New commits:
commit 24fc9061ffa90ea0223c89364eea4d0c6254f889
Author:     Pranam Lashkari <lpranam at collabora.com>
AuthorDate: Thu Aug 26 22:09:31 2021 +0530
Commit:     Pranam Lashkari <lpranam at collabora.com>
CommitDate: Mon Aug 30 10:32:48 2021 +0200

    LOK: avoid writing freeze pans data to file if not set
    
    Change-Id: I9bc4023ae1673a2ae68db584357fb6c6643342a3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121126
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Pranam Lashkari <lpranam at collabora.com>

diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index f2b19ad71a67..1d4451b9b2d0 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -545,20 +545,26 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>
     pSettings[SC_CURSOR_X].Value <<= sal_Int32(nCurX);
     pSettings[SC_CURSOR_Y].Name = SC_CURSORPOSITIONY;
     pSettings[SC_CURSOR_Y].Value <<= sal_Int32(nCurY);
-    pSettings[SC_HORIZONTAL_SPLIT_MODE].Name = SC_HORIZONTALSPLITMODE;
-    pSettings[SC_HORIZONTAL_SPLIT_MODE].Value <<= sal_Int16(eExHSplitMode);
-    pSettings[SC_VERTICAL_SPLIT_MODE].Name = SC_VERTICALSPLITMODE;
-    pSettings[SC_VERTICAL_SPLIT_MODE].Value <<= sal_Int16(eExVSplitMode);
-    pSettings[SC_HORIZONTAL_SPLIT_POSITION].Name = SC_HORIZONTALSPLITPOSITION;
-    if (eExHSplitMode == SC_SPLIT_FIX)
-        pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nExFixPosX);
-    else
-        pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nExHSplitPos);
-    pSettings[SC_VERTICAL_SPLIT_POSITION].Name = SC_VERTICALSPLITPOSITION;
-    if (eExVSplitMode == SC_SPLIT_FIX)
-        pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nExFixPosY);
-    else
-        pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nExVSplitPos);
+
+    // Write freezepan data only when freeze pans are set
+    if(nExFixPosX != 0 || nExFixPosY != 0 || nExHSplitPos != 0 || nExVSplitPos != 0)
+    {
+        pSettings[SC_HORIZONTAL_SPLIT_MODE].Name = SC_HORIZONTALSPLITMODE;
+        pSettings[SC_HORIZONTAL_SPLIT_MODE].Value <<= sal_Int16(eExHSplitMode);
+        pSettings[SC_VERTICAL_SPLIT_MODE].Name = SC_VERTICALSPLITMODE;
+        pSettings[SC_VERTICAL_SPLIT_MODE].Value <<= sal_Int16(eExVSplitMode);
+        pSettings[SC_HORIZONTAL_SPLIT_POSITION].Name = SC_HORIZONTALSPLITPOSITION;
+        if (eExHSplitMode == SC_SPLIT_FIX)
+            pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nExFixPosX);
+        else
+            pSettings[SC_HORIZONTAL_SPLIT_POSITION].Value <<= sal_Int32(nExHSplitPos);
+        pSettings[SC_VERTICAL_SPLIT_POSITION].Name = SC_VERTICALSPLITPOSITION;
+        if (eExVSplitMode == SC_SPLIT_FIX)
+            pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nExFixPosY);
+        else
+            pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= sal_Int32(nExVSplitPos);
+    }
+
     // Prevent writing odd settings that would make crash versions that
     // don't apply SanitizeWhichActive() when reading the settings.
     // See tdf#117093


More information about the Libreoffice-commits mailing list