summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-06-27 16:37:56 +0200
committerEike Rathke <erack@redhat.com>2016-06-27 17:24:20 +0200
commit2795cb694b6563772e1326b74cfd678ed251681f (patch)
tree266707032ea2ec9cc516430a0a5e40885f35bf2a
parent4e3bcddeb561309f94973115e05d5ac63b178e0d (diff)
add an isPODF() block to ScCompiler::IsOpCode(), tdf#100641 related
... as we can't rename RID_STRLIST_FUNCTION_NAMES_ENGLISH names. Should we need yet another resource block to differentiate between PODF/API names and actual always available English names? Ugly but maybe. A much better approach would be if Text[en-US] would be always available, additionally to the current localized resource. Change-Id: If8eaf18643f4e24c811149c52efff1097a3c1596
-rw-r--r--formula/source/core/resource/core_resource.src3
-rw-r--r--sc/source/core/tool/compiler.cxx26
2 files changed, 29 insertions, 0 deletions
diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src
index 2124218ae5f7..6a2d7d2eb82a 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -896,6 +896,9 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
// DO NOT CHANGE NAMES! Only add functions.
// These English names are used internally to store/load ODF v1.0/v1.1 and for
// API XFunctionAccess.
+// If there is a reason for another name for some function then add an
+// *additional* name to be recognized to sc/source/core/tool/compiler.cxx
+// ScCompiler::IsOpCode() in the else if (mxSymbols->isPODF()) block.
Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
{
String SC_OPCODE_IF { Text = "IF" ; };
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index e5a91be9f367..2ed3d597f45e 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2762,6 +2762,32 @@ bool ScCompiler::IsOpCode( const OUString& rName, bool bInArray )
}
}
}
+ else if (mxSymbols->isPODF())
+ {
+ // PODF names are ODF 1.0/1.1 and also used in API XFunctionAccess.
+ // We can't rename them in
+ // formula/source/core/resource/core_resource.src but can add
+ // additional names to be recognized here so they match the UI names if
+ // those are renamed.
+ struct FunctionName
+ {
+ const sal_Char* pName;
+ OpCode eOp;
+ };
+ static const FunctionName aPodfAliases[] = {
+ { "EFFECT", ocEffect } // EFFECTIVE -> EFFECT
+ };
+ for (const FunctionName& rPodfAlias : aPodfAliases)
+ {
+ if (rName.equalsIgnoreAsciiCaseAscii( rPodfAlias.pName))
+ {
+ maRawToken.SetOpCode( rPodfAlias.eOp);
+ bFound = true;
+ break; // for
+ }
+ }
+ }
+
if (!bFound)
{
OUString aIntName;