diff options
author | Eike Rathke <erack@redhat.com> | 2019-10-03 21:00:28 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2019-10-03 22:36:23 +0200 |
commit | 354b29ace32b19a1b40e46612349b8d76f00c0c6 (patch) | |
tree | ad382bca760b1cfe5b6cae7fb93d4524841cb960 /sc | |
parent | 30308a8b4c89ea806dd61a20707bbe28c27286dc (diff) |
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@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/refdata.hxx | 7 | ||||
-rw-r--r-- | sc/source/core/tool/refdata.cxx | 2 |
2 files changed, 6 insertions, 3 deletions
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 |