summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2019-10-03 21:00:28 +0200
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2019-10-06 00:27:48 +0200
commit58367241f53ffca86c933f1cec506f05513b6a4f (patch)
tree23fab674f6ddb2904cfd612c04ea0de71a8ca029
parentb5e6978869227d70eb68a6fd25922674a21b8c8f (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 (cherry picked from commit 354b29ace32b19a1b40e46612349b8d76f00c0c6) Reviewed-on: https://gerrit.libreoffice.org/80168 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--sc/inc/refdata.hxx7
-rw-r--r--sc/source/core/tool/refdata.cxx2
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 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