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

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 3 20:38:00 UTC 2019


 sc/inc/refdata.hxx              |    7 +++++--
 sc/source/core/tool/refdata.cxx |    2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 354b29ace32b19a1b40e46612349b8d76f00c0c6
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Oct 3 21:00:28 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Thu Oct 3 22:36:23 2019 +0200

    Resolves: tdf#122011 fix ValidExternal() check
    
    Tab==-1 may have been the condition 10 years ago, but at least since
    
        commit 296baa2fb6dd4150a7855114093a9703cdc18b09
        CommitDate: Tue Oct 5 18:14:37 2010 -0400
    
            Ported calc-extref-interpreter-rework-*.diff from ooo-build.
    
    that's not the case anymore.
    
    The check is only used in
    ScRefTokenHelper::compileRangeRepresentation() that is only used
    when creating chart data sources and sequences, thus may have gone
    undetected.
    
    Change-Id: I2eeb20ec740d286918b6ea29c017c32d03f970ad
    Reviewed-on: https://gerrit.libreoffice.org/80163
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/sc/inc/refdata.hxx b/sc/inc/refdata.hxx
index 7edac9f4bb01..1274636d17da 100644
--- a/sc/inc/refdata.hxx
+++ b/sc/inc/refdata.hxx
@@ -94,7 +94,9 @@ public:
     bool ColValid() const;
     bool RowValid() const;
     bool TabValid() const;
-    /// In external references nTab is -1
+    /** In external references nTab is -1 if the external document was not
+        loaded but the sheet was cached, or >=0 if the external document was
+        loaded. */
     bool ValidExternal() const;
 
     ScAddress toAbs( const ScAddress& rPos ) const;
@@ -145,7 +147,8 @@ struct ScComplexRefData
     bool Valid() const;
 
     /** In external references nTab is -1 for the start tab and -1 for the end
-        tab if one sheet, or >=0 if more than one sheets. */
+        tab if one sheet and the external document was not loaded but sheet was
+        cached, or >=0 also if more than one sheets. */
     bool ValidExternal() const;
 
     /** Whether this references entire columns, A:A */
diff --git a/sc/source/core/tool/refdata.cxx b/sc/source/core/tool/refdata.cxx
index 397421ad6007..4321e96d3e8a 100644
--- a/sc/source/core/tool/refdata.cxx
+++ b/sc/source/core/tool/refdata.cxx
@@ -181,7 +181,7 @@ bool ScSingleRefData::TabValid() const
 
 bool ScSingleRefData::ValidExternal() const
 {
-    return ColValid() && RowValid() && mnTab == -1;
+    return ColValid() && RowValid() && mnTab >= -1;
 }
 
 ScAddress ScSingleRefData::toAbs( const ScAddress& rPos ) const


More information about the Libreoffice-commits mailing list