[Libreoffice-commits] core.git: sc/source

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Mon Apr 1 15:58:12 UTC 2019


 sc/source/ui/inc/viewdata.hxx  |    4 ++--
 sc/source/ui/view/viewdata.cxx |   23 ++++++++++++++---------
 2 files changed, 16 insertions(+), 11 deletions(-)

New commits:
commit 0ef7bc8a1d2f00715d6849f1bbceb26e32382d41
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Mar 29 09:01:05 2019 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Mon Apr 1 17:57:45 2019 +0200

    sc lok: avoid save incorrect data, whether the pane has ...
    
    horizontal / vertical splits
    
    In the tiled rendering case the horizontal / vertical splits were
    not implemented, so the leftmost visible column is 0.
    So preserve horizontal / vertical splits when saving the document
    
    Change-Id: I15b6f009910e51fdaf475de5aac1ebded16c1956
    Reviewed-on: https://gerrit.libreoffice.org/69926
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 09342f1d741c..8f65e80c9a47 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -393,8 +393,8 @@ public:
 
     SCTAB           GetTabNo() const                        { return nTabNo; }
     ScSplitPos      GetActivePart() const                   { return pThisTab->eWhichActive; }
-    SCCOL           GetPosX( ScHSplitPos eWhich ) const     { return pThisTab->nPosX[eWhich]; }
-    SCROW           GetPosY( ScVSplitPos eWhich ) const     { return pThisTab->nPosY[eWhich]; }
+    SCCOL           GetPosX( ScHSplitPos eWhich ) const;
+    SCROW           GetPosY( ScVSplitPos eWhich ) const;
     SCCOL           GetCurX() const                         { return pThisTab->nCurX; }
     SCROW           GetCurY() const                         { return pThisTab->nCurY; }
     SCCOL           GetCurXForTab( SCTAB nTabIndex ) const;
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 823150303fe0..f2ad828d95fe 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -566,7 +566,6 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
     sal_Int32 nTempPosHTw(0);
     bool bHasVSplitInTwips = false;
     bool bHasHSplitInTwips = false;
-    bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
     for (sal_Int32 i = 0; i < nCount; i++)
     {
         OUString sName(aSettings[i].Name);
@@ -618,26 +617,22 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV
         else if (sName == SC_POSITIONLEFT)
         {
             aSettings[i].Value >>= nTemp32;
-            nPosX[SC_SPLIT_LEFT] = bIsTiledRendering ? 0 :
-                                   SanitizeCol( static_cast<SCCOL>(nTemp32));
+            nPosX[SC_SPLIT_LEFT] = SanitizeCol( static_cast<SCCOL>(nTemp32));
         }
         else if (sName == SC_POSITIONRIGHT)
         {
             aSettings[i].Value >>= nTemp32;
-            nPosX[SC_SPLIT_RIGHT] = bIsTiledRendering ? 0 :
-                                    SanitizeCol( static_cast<SCCOL>(nTemp32));
+            nPosX[SC_SPLIT_RIGHT] = SanitizeCol( static_cast<SCCOL>(nTemp32));
         }
         else if (sName == SC_POSITIONTOP)
         {
             aSettings[i].Value >>= nTemp32;
-            nPosY[SC_SPLIT_TOP] = bIsTiledRendering ? 0 :
-                                  SanitizeRow( static_cast<SCROW>(nTemp32));
+            nPosY[SC_SPLIT_TOP] = SanitizeRow( static_cast<SCROW>(nTemp32));
         }
         else if (sName == SC_POSITIONBOTTOM)
         {
             aSettings[i].Value >>= nTemp32;
-            nPosY[SC_SPLIT_BOTTOM] = bIsTiledRendering ? 0 :
-                                     SanitizeRow( static_cast<SCROW>(nTemp32));
+            nPosY[SC_SPLIT_BOTTOM] = SanitizeRow( static_cast<SCROW>(nTemp32));
         }
         else if (sName == SC_ZOOMTYPE)
         {
@@ -1291,6 +1286,16 @@ void ScViewData::ResetOldCursor()
     pThisTab->mbOldCursorValid = false;
 }
 
+SCCOL ScViewData::GetPosX( ScHSplitPos eWhich ) const
+{
+    return comphelper::LibreOfficeKit::isActive() ? 0 : pThisTab->nPosX[eWhich];
+}
+
+SCROW ScViewData::GetPosY( ScVSplitPos eWhich ) const
+{
+    return comphelper::LibreOfficeKit::isActive() ? 0 : pThisTab->nPosY[eWhich];
+}
+
 SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const
 {
     if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size())))


More information about the Libreoffice-commits mailing list