summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-11-15 19:03:56 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-11-18 17:25:39 -0500
commitaf7f6edd2fa36c8e28c43e707e30361fa3f7bf25 (patch)
tree4d493cc5103f407865b11b7e0aed148b2fd293f6 /sc/source
parent0df2c02d4f40b627f17d68d80a18999f4f40aea2 (diff)
Handle external functions (add-ins).
Unfortunately we can't test this piece easily just yet. Enabling add-in functions would mess up the function list which is unit-tested and thus fail if we enable add-ins in unit test. Change-Id: Ieda5e5560d4c7e68d7c6272c5d85f2ac63bd4ee4
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/tool/token.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 89efbc319ad9..b1d7e941f8d9 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -41,6 +41,7 @@
#include "tokenstringcontext.hxx"
#include "types.hxx"
#include "globstr.hrc"
+#include "addincol.hxx"
#include "svl/sharedstring.hxx"
using ::std::vector;
@@ -3318,7 +3319,26 @@ void appendTokenByType( sc::TokenStringContext& rCxt, OUStringBuffer& rBuf, cons
}
break;
case svExternal:
- // TODO : Implement this.
+ {
+ // mapped or translated name of AddIns
+ OUString aAddIn = rToken.GetExternal();
+ bool bMapped = rCxt.mxOpCodeMap->isPODF(); // ODF 1.1 directly uses programmatical name
+ if (!bMapped && rCxt.mxOpCodeMap->hasExternals())
+ {
+ const ExternalHashMap& rExtMap = *rCxt.mxOpCodeMap->getReverseExternalHashMap();
+ ExternalHashMap::const_iterator it = rExtMap.find(aAddIn);
+ if (it != rExtMap.end())
+ {
+ aAddIn = it->second;
+ bMapped = true;
+ }
+ }
+
+ if (!bMapped && !rCxt.mxOpCodeMap->isEnglish())
+ ScGlobal::GetAddInCollection()->LocalizeString(aAddIn);
+
+ rBuf.append(aAddIn);
+ }
break;
case svError:
{