diff options
-rw-r--r-- | sc/source/core/data/documen7.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index 4340827035cb..b8d577b6b9c8 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -92,13 +92,15 @@ void ScDocument::EndListeningArea( const ScRange& rRange, bool bGroupListening, bool ScDocument::LimitRangeToAvailableSheets( const ScRange& rRange, ScRange& o_rRange, bool& o_bEntirelyOutOfBounds ) const { - if (rRange == BCA_LISTEN_ALWAYS) - return false; - const SCTAB nMaxTab = GetTableCount() - 1; if (ValidTab( rRange.aStart.Tab(), nMaxTab) && ValidTab( rRange.aEnd.Tab(), nMaxTab)) return false; + // Originally BCA_LISTEN_ALWAYS uses an implicit tab 0 and should had been + // valid already, but in case that would change.. + if (rRange == BCA_LISTEN_ALWAYS) + return false; + SCTAB nTab1 = rRange.aStart.Tab(); SCTAB nTab2 = rRange.aEnd.Tab(); SAL_WARN("sc.core","ScDocument::LimitRangeToAvailableSheets - bad sheet range: " << nTab1 << ".." << nTab2 << |