Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hello,

I fear I'm a bit late for this patch to be included into 3.4.2 but at least
we should push it to 3.4

It fixes that we can't use database ranges in formulas because ScNameToken
always used ocName but it could also be ocDBArea for database ranges. It's
nothing special, just added an optional parameter to the constructor of
ScNameToken that will be passed to ScToken.

Regards,
Markus
From 9e098c065220ff56497c25edc0a92df5462fafc5 Mon Sep 17 00:00:00 2001
From: Markus Mohrhard <markus.mohrhard@googlemail.com>
Date: Tue, 19 Jul 2011 13:09:20 +0200
Subject: [PATCH] fix for fdo#39333: database ranges don't work in formulas

---
 sc/inc/token.hxx              |    2 +-
 sc/source/core/tool/token.cxx |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx
index 78364e9..ce16c17 100644
--- a/sc/inc/token.hxx
+++ b/sc/inc/token.hxx
@@ -244,7 +244,7 @@ private:
 private:
                                 ScNameToken(); // disabled
 public:
-                                ScNameToken(sal_uInt16 nIndex, bool bGlobal);
+                                ScNameToken(sal_uInt16 nIndex, bool bGlobal, OpCode eOpCode = 
ocName);
                                 ScNameToken(const ScNameToken& r);
     virtual                     ~ScNameToken();
     virtual sal_uInt8                GetByte() const;
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 0153ca4..1cf448e 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -380,7 +380,7 @@ FormulaToken* ScRawToken::CreateToken() const
             IF_NOT_OPCODE_ERROR( ocPush, ScMatrixToken);
             return new ScMatrixToken( pMat );
         case svIndex :
-            return new ScNameToken(name.nIndex, name.bGlobal);
+            return new ScNameToken(name.nIndex, name.bGlobal, eOp);
         case svExternalSingleRef:
             {
                 String aTabName(extref.cTabName);
@@ -949,8 +949,8 @@ bool ScExternalDoubleRefToken::operator ==( const FormulaToken& r ) const
 
 // ============================================================================
 
-ScNameToken::ScNameToken(sal_uInt16 nIndex, bool bGlobal) :
-    ScToken(svIndex, ocName), mnIndex(nIndex), mbGlobal(bGlobal) {}
+ScNameToken::ScNameToken(sal_uInt16 nIndex, bool bGlobal, OpCode eOpCode) :
+    ScToken(svIndex, eOpCode), mnIndex(nIndex), mbGlobal(bGlobal) {}
 
 ScNameToken::ScNameToken(const ScNameToken& r) :
     ScToken(r), mnIndex(r.mnIndex), mbGlobal(r.mbGlobal) {}
-- 
1.7.3.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.