sc/source/core/data/documen7.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 8b7551fb5c5416670b8ab70c2252d35bfaace3fa
Author: Eike Rathke <er...@redhat.com>
Date:   Tue Nov 7 14:34:41 2017 +0100

    LimitRangeToAvailableSheets: check ValidTab() first
    
    That already includes BCA_LISTEN_ALWAYS which only needs to be
    checked if the ordinary tab check failed in case the definition
    changed.
    
    Change-Id: Ic31daf67f600b48b76406f07ba039462c5944170

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

Reply via email to