summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-06-12 18:28:26 +0200
committerEike Rathke <erack@redhat.com>2015-06-12 18:32:14 +0200
commit15f18d1bb6e76ea934a461031b2784564f9d00c1 (patch)
treebfd429b883b8856e8c9c145d95e460c96521fd83
parentd5cebdd22465d020e1c83223a416c0ffafedbbcc (diff)
do not adjust RPN named expressions relative references, tdf#91842 follow-up
Change-Id: I5a991d3b86fec0a3800d8243f73eb764789c8c69
-rw-r--r--sc/source/core/tool/token.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index f81435230d7f..727a3d6d1a4a 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -138,7 +138,25 @@ namespace
// Handle all tokens in RPN, and code tokens only if they have a
// reference count of 1, which means they are not referenced in
// RPN.
- return i == 0 && (*pp)->GetRef() > 1;
+ if (i == 0)
+ return (*pp)->GetRef() > 1;
+
+ // Skip (do not adjust) relative references resulting from named
+ // expressions.
+ switch ((*pp)->GetType())
+ {
+ case svSingleRef:
+ return (*pp)->GetSingleRef()->IsRelName();
+ case svDoubleRef:
+ {
+ const ScComplexRefData& rRef = *(*pp)->GetDoubleRef();
+ return rRef.Ref1.IsRelName() || rRef.Ref2.IsRelName();
+ }
+ default:
+ ; // nothing
+ }
+
+ return false;
}
};