Kaydet (Commit) af7f6edd authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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
üst 0df2c02d
......@@ -2552,7 +2552,7 @@ void Test::testFunctionLists()
for (sal_uInt32 j = 0; j < nFuncCount; ++j)
{
const formula::IFunctionDescription* pFunc = pCat->getFunction(j);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected function name", pFunc->getFunctionName(), OUString::createFromAscii(aTests[i].Functions[j]));
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected function name", OUString::createFromAscii(aTests[i].Functions[j]), pFunc->getFunctionName());
}
}
}
......
......@@ -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:
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment