summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-01-09 11:17:09 -0500
committerEike Rathke <erack@redhat.com>2013-01-09 21:58:45 +0000
commit97a10ade202537a60bf15ad58f2e44cfb785bb3f (patch)
tree1128ed1f7f42a4e4465fafbf0f3fcee11410a60f /formula
parent075a1e6fdaebd441be4cb46fbc30ef7ded4cabaa (diff)
fdo#58539: Correctly set cached matrix formula result.
During the import, a cached matrix value only has an empty matrix of correct geometry, plus the token type of the top-left cell. The rest of the elements are imported as hybrid values. For now, this seems to do the trick. In the future we may want to change it to fully populate the matrix cache value during the import, and skip setting the hybrid values for the non-top-left elements. This commit also make several other trivial changes: * Mark pRawToken mutable so that we can mark those IsFoo() methods const. * Move the ScCompiler instance from static instance to member of ScXMLImport. Since we don't need the instance to persist once the import is over, this is more appropriate. Change-Id: I1abde03c0fcd91b02ef4dbf8b5526f7965eaf19c Reviewed-on: https://gerrit.libreoffice.org/1623 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'formula')
-rw-r--r--formula/inc/formula/FormulaCompiler.hxx3
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx2
2 files changed, 3 insertions, 2 deletions
diff --git a/formula/inc/formula/FormulaCompiler.hxx b/formula/inc/formula/FormulaCompiler.hxx
index ce4157dae9c9..85295b244cb4 100644
--- a/formula/inc/formula/FormulaCompiler.hxx
+++ b/formula/inc/formula/FormulaCompiler.hxx
@@ -212,6 +212,8 @@ public:
*/
OpCode GetEnglishOpCode( const String& rName ) const;
+ sal_uInt16 GetErrorConstant( const String& rName ) const;
+
void SetCompileForFAP( bool bVal )
{ bCompileForFAP = bVal; bIgnoreErrors = bVal; }
@@ -265,7 +267,6 @@ protected:
virtual void CreateStringFromIndex(rtl::OUStringBuffer& rBuffer,FormulaToken* pTokenP);
virtual void LocalizeString( String& rName ); // modify rName - input: exact name
- sal_uInt16 GetErrorConstant( const String& rName );
void AppendErrorConstant( rtl::OUStringBuffer& rBuffer, sal_uInt16 nError );
bool GetToken();
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 29b66945c799..f79201b6c673 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -816,7 +816,7 @@ void FormulaCompiler::OpCodeMap::copyFrom( const OpCodeMap& r )
}
// -----------------------------------------------------------------------------
-sal_uInt16 FormulaCompiler::GetErrorConstant( const String& rName )
+sal_uInt16 FormulaCompiler::GetErrorConstant( const String& rName ) const
{
sal_uInt16 nError = 0;
OpCodeHashMap::const_iterator iLook( mxSymbols->getHashMap()->find( rName));