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

New commits:
commit 58367241f53ffca86c933f1cec506f05513b6a4f
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Thu Oct 3 21:00:28 2019 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Sun Oct 6 00:27:48 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 <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 354b29ace32b19a1b40e46612349b8d76f00c0c6)
    Reviewed-on: https://gerrit.libreoffice.org/80168
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

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 bae3acc83ad1..4262da9c8ce3 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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to