[Libreoffice-commits] core.git: sc/inc sc/source

Eike Rathke erack at redhat.com
Fri Jul 31 12:19:37 PDT 2015


 sc/inc/token.hxx              |    1 +
 sc/source/core/tool/token.cxx |    9 +++++++++
 2 files changed, 10 insertions(+)

New commits:
commit a713fb5e3ac8b521abd441f040853f439f1a3f7c
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Jul 31 21:06:57 2015 +0200

    TableRef: implement ScTableRefToken::IsGlobal() override
    
    To diustinguish from formula::FormulaToken::IsGlobal() virtual dummy
    implementation error message and spot code that possibly makes false
    assumptions about svIndex tokens.
    
    Change-Id: I5c4a62dc5fdf3a97b7a4d143ce1e419f15a8fdb0

diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx
index 3e4f7f8..e13039c 100644
--- a/sc/inc/token.hxx
+++ b/sc/inc/token.hxx
@@ -231,6 +231,7 @@ public:
 
     virtual sal_uInt16          GetIndex() const SAL_OVERRIDE;
     virtual void                SetIndex( sal_uInt16 n ) SAL_OVERRIDE;
+    virtual bool                IsGlobal() const SAL_OVERRIDE;
     virtual bool                operator==( const formula::FormulaToken& rToken ) const SAL_OVERRIDE;
     virtual FormulaToken*       Clone() const SAL_OVERRIDE { return new ScTableRefToken(*this); }
 
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index e9a9afa..8a67152 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -934,6 +934,15 @@ void ScTableRefToken::SetIndex( sal_uInt16 n )
     mnIndex = n;
 }
 
+bool ScTableRefToken::IsGlobal() const
+{
+    // Code asking for this may have to be adapted as it might assume an
+    // svIndex token would always be ocName or ocDBArea.
+    SAL_WARN("sc.core","ScTableRefToken::IsGlobal - maybe adapt caller to know about TableRef?");
+    // Database range is always global.
+    return true;
+}
+
 ScTableRefToken::Item ScTableRefToken::GetItem() const
 {
     return meItem;


More information about the Libreoffice-commits mailing list