[Libreoffice-commits] core.git: sc/source
Pranam Lashkari (via logerrit)
logerrit at kemper.freedesktop.org
Mon Aug 30 08:32:53 UTC 2021
sc/source/ui/view/viewdata.cxx | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
New commits:
commit e60a94f016bb26bf0b388899f6a3261ec9df5225
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:29 2021 +0200
LOK: avoid writing freeze pans data to file if not set
Change-Id: I9bc4023ae1673a2ae68db584357fb6c6643342a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121065
Tested-by: Jenkins
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 3a41f6b61137..8e76f4d985aa 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -546,20 +546,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