summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2021-08-26 22:09:31 +0530
committerAndras Timar <andras.timar@collabora.com>2021-08-30 12:18:55 +0200
commit4c49ba8b302c52b0175701ab3106a9392ad8115a (patch)
treee87493f5d75abee16812ca69b6ac0a7f086c1269 /sc/source
parent32b0289cc53527b3eb45a4b6600cd26472f59282 (diff)
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@gmail.com> Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/view/viewdata.cxx34
1 files changed, 20 insertions, 14 deletions
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