Kaydet (Commit) 908854a7 authored tarafından Eike Rathke's avatar Eike Rathke Kaydeden (comit) Caolán McNamara

CheckLinkFormulaNeedingCheck() for named expressions

 This is a combination of 3 commits.

CheckLinkFormulaNeedingCheck() for .ods named expressions

This is specifically necessary for named expressions that are used
in conditional format formulas, for which RPN is generated at a
later stage, not during import.

(cherry picked from commit eae9648e)

CheckLinkFormulaNeedingCheck() for .xls named expressions

(cherry picked from commit 8512f13c)

CheckLinkFormulaNeedingCheck() for .xlsx named expressions

(cherry picked from commit a1f933ee)

 Conflicts:
	sc/source/filter/oox/defnamesbuffer.cxx

e03cb5767c34f8157a492a6d6c3b0700d065052d
217c89822ab477a6c383d170ae739e44efd10fa3

Change-Id: I54ab8dc14f81d6b18b0d17f448187d19d8e396fc
Reviewed-on: https://gerrit.libreoffice.org/48858Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst fa3b7206
......@@ -64,9 +64,14 @@ ScRangeData::ScRangeData( ScDocument* pDok,
mnMaxCol (-1)
{
if (!rSymbol.isEmpty())
CompileRangeData( rSymbol, pDoc->IsImportingXML());
{
// Let the compiler set an error on unknown names for a subsequent
// CompileUnresolvedXML().
const bool bImporting = pDoc->IsImportingXML();
CompileRangeData( rSymbol, bImporting);
if (bImporting)
pDoc->CheckLinkFormulaNeedingCheck( *pCode);
}
else
{
// #i63513#/#i65690# don't leave pCode as NULL.
......@@ -195,6 +200,7 @@ void ScRangeData::CompileUnresolvedXML( sc::CompileFormulaContext& rCxt )
// Don't let the compiler set an error for unknown names on final
// compile, errors are handled by the interpreter thereafter.
CompileRangeData( aSymbol, false);
rCxt.getDoc()->CheckLinkFormulaNeedingCheck( *pCode);
}
}
......
......@@ -265,7 +265,10 @@ void XclImpName::InsertName(const ScTokenArray* pArray)
}
}
if (pData)
{
GetDoc().CheckLinkFormulaNeedingCheck( *pData->GetCode());
mpScData = pData; // cache for later use
}
}
XclImpNameManager::XclImpNameManager( const XclImpRoot& rRoot ) :
......
......@@ -39,6 +39,7 @@
#include "tokenarray.hxx"
#include "tokenuno.hxx"
#include "compiler.hxx"
#include "document.hxx"
namespace oox {
namespace xls {
......@@ -332,6 +333,7 @@ std::unique_ptr<ScTokenArray> DefinedName::getScTokens(
// after, a resulting error must be reset.
FormulaError nErr = pArray->GetCodeError();
aCompiler.CompileTokenArray();
getScDocument().CheckLinkFormulaNeedingCheck( *pArray);
pArray->DelRPN();
pArray->SetCodeError(nErr);
......
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