LibreOffice Module sc (master)  1
tokenuno.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <memory>
21 #include <tokenuno.hxx>
22 
23 #include <sal/macros.h>
24 #include <sal/log.hxx>
25 
26 #include <com/sun/star/sheet/ComplexReference.hpp>
27 #include <com/sun/star/sheet/ExternalReference.hpp>
28 #include <com/sun/star/sheet/ReferenceFlags.hpp>
29 #include <com/sun/star/sheet/AddressConvention.hpp>
30 #include <com/sun/star/sheet/NameToken.hpp>
31 #include <com/sun/star/table/CellAddress.hpp>
32 
33 #include <svl/itemprop.hxx>
34 #include <vcl/svapp.hxx>
35 #include <comphelper/string.hxx>
36 
37 #include <miscuno.hxx>
38 #include <convuno.hxx>
39 #include <unonames.hxx>
40 #include <compiler.hxx>
41 #include <tokenarray.hxx>
42 #include <docsh.hxx>
43 #include <rangeseq.hxx>
44 #include <externalrefmgr.hxx>
45 
46 using namespace ::formula;
47 using namespace ::com::sun::star;
48 
50 {
51  static const SfxItemPropertyMapEntry aFormulaParserMap_Impl[] =
52  {
58  { u"", 0, css::uno::Type(), 0, 0 }
59  };
60  return aFormulaParserMap_Impl;
61 }
62 
64  formula::FormulaGrammar::CONV_OOO, // <- AddressConvention::OOO
65  formula::FormulaGrammar::CONV_XL_A1, // <- AddressConvention::XL_A1
66  formula::FormulaGrammar::CONV_XL_R1C1, // <- AddressConvention::XL_R1C1
67  formula::FormulaGrammar::CONV_XL_OOX, // <- AddressConvention::XL_OOX
68  formula::FormulaGrammar::CONV_LOTUS_A1 // <- AddressConvention::LOTUS_A1
69 };
70 // sal_Int16 because of comparison of integer expressions below.
71 constexpr sal_Int16 nConvMapCount = SAL_N_ELEMENTS(aConvMap);
72 
73 
75 
77  mpDocShell( pDocSh ),
78  mnConv( sheet::AddressConvention::UNSPECIFIED ),
79  mbEnglish( false ),
80  mbIgnoreSpaces( true ),
81  mbCompileFAP( false ),
82  mbRefConventionChartOOXML( false )
83 {
84  mpDocShell->GetDocument().AddUnoObject(*this);
85 }
86 
88 {
90 
91  if (mpDocShell)
93 }
94 
96 {
97  if ( rHint.GetId() == SfxHintId::Dying )
98  mpDocShell = nullptr;
99 }
100 
101 // XFormulaParser
102 
104 {
106  if (mnConv >= 0 && mnConv < nConvMapCount)
107  eConv = aConvMap[mnConv];
108 
109  // If mxOpCodeMap is not empty it overrides mbEnglish, and vice versa. We
110  // don't need to initialize things twice.
111  if (mxOpCodeMap)
112  rCompiler.SetFormulaLanguage( mxOpCodeMap );
113  else
114  {
115  const sal_Int32 nFormulaLanguage = (eConv == formula::FormulaGrammar::CONV_XL_OOX ?
116  sheet::FormulaLanguage::OOXML :
117  (mbEnglish ? sheet::FormulaLanguage::ENGLISH : sheet::FormulaLanguage::NATIVE));
118  ScCompiler::OpCodeMapPtr xMap = rCompiler.GetOpCodeMap( nFormulaLanguage);
119  rCompiler.SetFormulaLanguage( xMap);
120  }
121 
122  rCompiler.SetRefConvention( eConv );
124  rCompiler.EnableStopOnError(!mbCompileFAP);
125 
128 }
129 
130 uno::Sequence<sheet::FormulaToken> SAL_CALL ScFormulaParserObj::parseFormula(
131  const OUString& aFormula, const table::CellAddress& rReferencePos )
132 {
133  SolarMutexGuard aGuard;
134  uno::Sequence<sheet::FormulaToken> aRet;
135 
136  if (mpDocShell)
137  {
138  ScDocument& rDoc = mpDocShell->GetDocument();
139  ScExternalRefManager::ApiGuard aExtRefGuard(rDoc);
140 
142  ScUnoConversion::FillScAddress( aRefPos, rReferencePos );
143  ScCompiler aCompiler( rDoc, aRefPos, rDoc.GetGrammar());
144  SetCompilerFlags( aCompiler );
145 
146  std::unique_ptr<ScTokenArray> pCode = aCompiler.CompileString( aFormula );
147  ScTokenConversion::ConvertToTokenSequence( rDoc, aRet, *pCode );
148  }
149 
150  return aRet;
151 }
152 
154  const uno::Sequence<sheet::FormulaToken>& aTokens, const table::CellAddress& rReferencePos )
155 {
156  SolarMutexGuard aGuard;
157  OUString aRet;
158 
159  if (mpDocShell)
160  {
161  ScDocument& rDoc = mpDocShell->GetDocument();
162  ScTokenArray aCode(rDoc);
163  (void)ScTokenConversion::ConvertToTokenArray( rDoc, aCode, aTokens );
165  ScUnoConversion::FillScAddress( aRefPos, rReferencePos );
166  ScCompiler aCompiler(rDoc, aRefPos, aCode, rDoc.GetGrammar());
167  SetCompilerFlags( aCompiler );
168 
169  OUStringBuffer aBuffer;
170  aCompiler.CreateStringFromTokenArray( aBuffer );
171  aRet = aBuffer.makeStringAndClear();
172  }
173 
174  return aRet;
175 }
176 
177 // XPropertySet
178 
179 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScFormulaParserObj::getPropertySetInfo()
180 {
181  SolarMutexGuard aGuard;
182  static uno::Reference< beans::XPropertySetInfo > aRef(new SfxItemPropertySetInfo( lcl_GetFormulaParserMap() ));
183  return aRef;
184 }
185 
187  const OUString& aPropertyName, const uno::Any& aValue )
188 {
189  SolarMutexGuard aGuard;
190  if ( aPropertyName == SC_UNO_COMPILEFAP )
191  {
192  aValue >>= mbCompileFAP;
193  }
194  else if ( aPropertyName == SC_UNO_COMPILEENGLISH )
195  {
196  bool bOldEnglish = mbEnglish;
197  if (!(aValue >>= mbEnglish))
198  throw lang::IllegalArgumentException();
199 
200  // Need to recreate the symbol map to change English property
201  // because the map is const. So for performance reasons set
202  // CompileEnglish _before_ OpCodeMap!
203  if (mxOpCodeMap && mbEnglish != bOldEnglish)
204  {
205  ScDocument& rDoc = mpDocShell->GetDocument();
206  ScCompiler aCompiler( rDoc, ScAddress(), rDoc.GetGrammar());
208  }
209 
210  }
211  else if ( aPropertyName == SC_UNO_FORMULACONVENTION )
212  {
213  aValue >>= mnConv;
214 
215  bool bOldEnglish = mbEnglish;
216  if (mnConv >= 0 && mnConv < nConvMapCount
218  mbEnglish = true;
219 
220  // Same as for SC_UNO_COMPILEENGLISH, though an OpCodeMap should not
221  // had been set for CONV_XL_OOX.
222  if (mxOpCodeMap && mbEnglish != bOldEnglish)
223  {
224  ScDocument& rDoc = mpDocShell->GetDocument();
225  ScCompiler aCompiler( rDoc, ScAddress(), rDoc.GetGrammar());
227  }
228  }
229  else if ( aPropertyName == SC_UNO_IGNORELEADING )
230  {
231  aValue >>= mbIgnoreSpaces;
232  }
233  else if ( aPropertyName == SC_UNO_OPCODEMAP )
234  {
235  if (!(aValue >>= maOpCodeMapping))
236  throw lang::IllegalArgumentException();
237 
238  ScDocument& rDoc = mpDocShell->GetDocument();
239  ScCompiler aCompiler(rDoc, ScAddress(), rDoc.GetGrammar());
241 
242  }
243  else if ( aPropertyName == SC_UNO_EXTERNALLINKS )
244  {
245  if (!(aValue >>= maExternalLinks))
246  throw lang::IllegalArgumentException();
247  }
248  else if ( aPropertyName == SC_UNO_REF_CONV_CHARTOOXML )
249  {
250  if (!(aValue >>= mbRefConventionChartOOXML))
251  throw lang::IllegalArgumentException();
252  }
253  else
254  throw beans::UnknownPropertyException(aPropertyName);
255 }
256 
257 uno::Any SAL_CALL ScFormulaParserObj::getPropertyValue( const OUString& aPropertyName )
258 {
259  SolarMutexGuard aGuard;
260  uno::Any aRet;
261  if ( aPropertyName == SC_UNO_COMPILEFAP )
262  {
263  aRet <<= mbCompileFAP;
264  }
265  else if ( aPropertyName == SC_UNO_COMPILEENGLISH )
266  {
267  aRet <<= mbEnglish;
268  }
269  else if ( aPropertyName == SC_UNO_FORMULACONVENTION )
270  {
271  aRet <<= mnConv;
272  }
273  else if ( aPropertyName == SC_UNO_IGNORELEADING )
274  {
275  aRet <<= mbIgnoreSpaces;
276  }
277  else if ( aPropertyName == SC_UNO_OPCODEMAP )
278  {
279  aRet <<= maOpCodeMapping;
280  }
281  else if ( aPropertyName == SC_UNO_EXTERNALLINKS )
282  {
283  aRet <<= maExternalLinks;
284  }
285  else if ( aPropertyName == SC_UNO_REF_CONV_CHARTOOXML )
286  {
287  aRet <<= mbRefConventionChartOOXML;
288  }
289  else
290  throw beans::UnknownPropertyException(aPropertyName);
291  return aRet;
292 }
293 
295 
296 static void lcl_ExternalRefToApi( sheet::SingleReference& rAPI, const ScSingleRefData& rRef )
297 {
298  rAPI.Column = 0;
299  rAPI.Row = 0;
300  rAPI.Sheet = 0;
301  rAPI.RelativeColumn = 0;
302  rAPI.RelativeRow = 0;
303  rAPI.RelativeSheet = 0;
304 
305  sal_Int32 nFlags = 0;
306  if ( rRef.IsColRel() )
307  {
308  nFlags |= sheet::ReferenceFlags::COLUMN_RELATIVE;
309  rAPI.RelativeColumn = rRef.Col();
310  }
311  else
312  rAPI.Column = rRef.Col();
313 
314  if ( rRef.IsRowRel() )
315  {
316  nFlags |= sheet::ReferenceFlags::ROW_RELATIVE;
317  rAPI.RelativeRow = rRef.Row();
318  }
319  else
320  rAPI.Row = rRef.Row();
321 
322  if ( rRef.IsColDeleted() ) nFlags |= sheet::ReferenceFlags::COLUMN_DELETED;
323  if ( rRef.IsRowDeleted() ) nFlags |= sheet::ReferenceFlags::ROW_DELETED;
324  if ( rRef.IsFlag3D() ) nFlags |= sheet::ReferenceFlags::SHEET_3D;
325  if ( rRef.IsRelName() ) nFlags |= sheet::ReferenceFlags::RELATIVE_NAME;
326  rAPI.Flags = nFlags;
327 }
328 
329 static void lcl_SingleRefToApi( sheet::SingleReference& rAPI, const ScSingleRefData& rRef )
330 {
331  sal_Int32 nFlags = 0;
332  if ( rRef.IsColRel() )
333  {
334  nFlags |= sheet::ReferenceFlags::COLUMN_RELATIVE;
335  rAPI.RelativeColumn = rRef.Col();
336  rAPI.Column = 0;
337  }
338  else
339  {
340  rAPI.RelativeColumn = 0;
341  rAPI.Column = rRef.Col();
342  }
343 
344  if ( rRef.IsRowRel() )
345  {
346  nFlags |= sheet::ReferenceFlags::ROW_RELATIVE;
347  rAPI.RelativeRow = rRef.Row();
348  rAPI.Row = 0;
349  }
350  else
351  {
352  rAPI.RelativeRow = 0;
353  rAPI.Row = rRef.Row();
354  }
355 
356  if ( rRef.IsTabRel() )
357  {
358  nFlags |= sheet::ReferenceFlags::SHEET_RELATIVE;
359  rAPI.RelativeSheet = rRef.Tab();
360  rAPI.Sheet = 0;
361  }
362  else
363  {
364  rAPI.RelativeSheet = 0;
365  rAPI.Sheet = rRef.Tab();
366  }
367 
368  if ( rRef.IsColDeleted() ) nFlags |= sheet::ReferenceFlags::COLUMN_DELETED;
369  if ( rRef.IsRowDeleted() ) nFlags |= sheet::ReferenceFlags::ROW_DELETED;
370  if ( rRef.IsTabDeleted() ) nFlags |= sheet::ReferenceFlags::SHEET_DELETED;
371  if ( rRef.IsFlag3D() ) nFlags |= sheet::ReferenceFlags::SHEET_3D;
372  if ( rRef.IsRelName() ) nFlags |= sheet::ReferenceFlags::RELATIVE_NAME;
373  rAPI.Flags = nFlags;
374 }
375 
377  ScTokenArray& rTokenArray, const uno::Sequence<sheet::FormulaToken>& rSequence )
378 {
379  return !rTokenArray.Fill(rSequence, rDoc.GetSharedStringPool(), rDoc.GetExternalRefManager());
380 }
381 
383  uno::Sequence<sheet::FormulaToken>& rSequence, const ScTokenArray& rTokenArray )
384 {
385  sal_Int32 nLen = static_cast<sal_Int32>(rTokenArray.GetLen());
386  formula::FormulaToken** pTokens = rTokenArray.GetArray();
387  if ( pTokens )
388  {
389  rSequence.realloc(nLen);
390  auto pSequence = rSequence.getArray();
391  for (sal_Int32 nPos=0; nPos<nLen; nPos++)
392  {
393  const formula::FormulaToken& rToken = *pTokens[nPos];
394  sheet::FormulaToken& rAPI = pSequence[nPos];
395 
396  OpCode eOpCode = rToken.GetOpCode();
397  // eOpCode may be changed in the following switch/case
398  switch ( rToken.GetType() )
399  {
400  case svByte:
401  // Only the count of spaces is stored as "long". Parameter count is ignored.
402  if ( eOpCode == ocSpaces )
403  rAPI.Data <<= static_cast<sal_Int32>(rToken.GetByte());
404  else if (eOpCode == ocWhitespace)
405  {
406  // Convention is one character repeated.
407  if (rToken.GetByte() == 1)
408  rAPI.Data <<= OUString( rToken.GetChar());
409  else
410  {
411  OUStringBuffer aBuf( rToken.GetByte());
412  comphelper::string::padToLength( aBuf, rToken.GetByte(), rToken.GetChar());
413  rAPI.Data <<= aBuf.makeStringAndClear();
414  }
415  }
416  else
417  rAPI.Data.clear(); // no data
418  break;
419  case formula::svDouble:
420  rAPI.Data <<= rToken.GetDouble();
421  break;
422  case formula::svString:
423  rAPI.Data <<= rToken.GetString().getString();
424  break;
425  case svExternal:
426  // Function name is stored as string.
427  // Byte (parameter count) is ignored.
428  rAPI.Data <<= rToken.GetExternal();
429  break;
430  case svSingleRef:
431  {
432  sheet::SingleReference aSingleRef;
433  lcl_SingleRefToApi( aSingleRef, *rToken.GetSingleRef() );
434  rAPI.Data <<= aSingleRef;
435  }
436  break;
438  {
439  sheet::ComplexReference aCompRef;
440  lcl_SingleRefToApi( aCompRef.Reference1, *rToken.GetSingleRef() );
441  lcl_SingleRefToApi( aCompRef.Reference2, *rToken.GetSingleRef2() );
442  rAPI.Data <<= aCompRef;
443  }
444  break;
445  case svIndex:
446  {
447  sheet::NameToken aNameToken;
448  aNameToken.Index = static_cast<sal_Int32>( rToken.GetIndex() );
449  aNameToken.Sheet = rToken.GetSheet();
450  rAPI.Data <<= aNameToken;
451  }
452  break;
453  case svMatrix:
454  if (!ScRangeToSequence::FillMixedArray( rAPI.Data, rToken.GetMatrix(), true))
455  rAPI.Data.clear();
456  break;
457  case svExternalSingleRef:
458  {
459  sheet::SingleReference aSingleRef;
460  lcl_ExternalRefToApi( aSingleRef, *rToken.GetSingleRef() );
461  size_t nCacheId;
463  rToken.GetIndex(), rToken.GetString().getString(), false, &nCacheId);
464  aSingleRef.Sheet = static_cast< sal_Int32 >( nCacheId );
465  sheet::ExternalReference aExtRef;
466  aExtRef.Index = rToken.GetIndex();
467  aExtRef.Reference <<= aSingleRef;
468  rAPI.Data <<= aExtRef;
469  eOpCode = ocPush;
470  }
471  break;
472  case svExternalDoubleRef:
473  {
474  sheet::ComplexReference aComplRef;
475  lcl_ExternalRefToApi( aComplRef.Reference1, *rToken.GetSingleRef() );
476  lcl_ExternalRefToApi( aComplRef.Reference2, *rToken.GetSingleRef2() );
477  size_t nCacheId;
479  rToken.GetIndex(), rToken.GetString().getString(), false, &nCacheId);
480  aComplRef.Reference1.Sheet = static_cast< sal_Int32 >( nCacheId );
481  // NOTE: This assumes that cached sheets are in consecutive order!
482  aComplRef.Reference2.Sheet =
483  aComplRef.Reference1.Sheet +
484  (rToken.GetSingleRef2()->Tab() - rToken.GetSingleRef()->Tab());
485  sheet::ExternalReference aExtRef;
486  aExtRef.Index = rToken.GetIndex();
487  aExtRef.Reference <<= aComplRef;
488  rAPI.Data <<= aExtRef;
489  eOpCode = ocPush;
490  }
491  break;
492  case svExternalName:
493  {
494  sheet::ExternalReference aExtRef;
495  aExtRef.Index = rToken.GetIndex();
496  aExtRef.Reference <<= rToken.GetString().getString();
497  rAPI.Data <<= aExtRef;
498  eOpCode = ocPush;
499  }
500  break;
501  default:
502  SAL_WARN("sc", "ScTokenConversion::ConvertToTokenSequence: unhandled token type " << StackVarEnumToString(rToken.GetType()));
503  [[fallthrough]];
504  case svJump: // occurs with ocIf, ocChoose
505  case svError: // seems to be fairly common, and probably not exceptional and not worth a warning?
506  case svMissing: // occurs with ocMissing
507  case svSep: // occurs with ocSep, ocOpen, ocClose, ocArray*
508  rAPI.Data.clear(); // no data
509  }
510  rAPI.OpCode = static_cast<sal_Int32>(eOpCode);
511  }
512  }
513  else
514  rSequence.realloc(0);
515 }
516 
517 ScFormulaOpCodeMapperObj::ScFormulaOpCodeMapperObj(::std::unique_ptr<formula::FormulaCompiler> && _pCompiler)
518 : formula::FormulaOpCodeMapperObj(std::move(_pCompiler))
519 {
520 }
521 
522 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsTabRel() const
Definition: refdata.hxx:69
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: tokenuno.cxx:186
SCCOL Col() const
Definition: refdata.cxx:247
bool IsTabDeleted() const
Definition: refdata.hxx:86
OUString getString() const
SC_DLLPUBLIC svl::SharedStringPool & GetSharedStringPool()
Definition: documen2.cxx:584
#define SC_UNO_EXTERNALLINKS
Definition: unonames.hxx:680
svSep
Single reference (one address) into the sheet.
Definition: refdata.hxx:29
void SetCompilerFlags(ScCompiler &rCompiler) const
Definition: tokenuno.cxx:103
bool Fill(const css::uno::Sequence< css::sheet::FormulaToken > &rSequence, svl::SharedStringPool &rSPool, ExternalReferenceHelper *pExtRef)
aBuf
constexpr sal_Int16 nConvMapCount
Definition: tokenuno.cxx:71
#define SC_UNO_COMPILEFAP
Definition: unonames.hxx:681
#define SC_UNO_FORMULACONVENTION
Definition: unonames.hxx:677
virtual double GetDouble() const
void SetExternalLinks(const css::uno::Sequence< css::sheet::ExternalLinkInfo > &rLinks)
Set external link info for ScAddress::CONV_XL_OOX.
Definition: compiler.hxx:463
OpCode GetOpCode() const
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:1007
ocSpaces
#define SC_UNO_IGNORELEADING
Definition: unonames.hxx:678
svExternalName
SfxHintId GetId() const
virtual css::uno::Sequence< css::sheet::FormulaToken > SAL_CALL parseFormula(const OUString &aFormula, const css::table::CellAddress &rReferencePos) override
Definition: tokenuno.cxx:130
virtual sal_Int16 GetSheet() const
static void lcl_SingleRefToApi(sheet::SingleReference &rAPI, const ScSingleRefData &rRef)
Definition: tokenuno.cxx:329
svError
virtual const ScMatrix * GetMatrix() const
ScDocShell * mpDocShell
Definition: tokenuno.hxx:60
virtual const OUString & GetExternal() const
OpCode
virtual const ScSingleRefData * GetSingleRef() const
SC_DLLPUBLIC ScExternalRefManager * GetExternalRefManager() const
Definition: documen3.cxx:627
sal_Int16 mnConv
Definition: tokenuno.hxx:61
bool IsColRel() const
Definition: refdata.hxx:65
virtual sal_uInt8 GetByte() const
static bool FillMixedArray(css::uno::Any &rAny, ScDocument &rDoc, const ScRange &rRange, bool bAllowNV=false)
std::string StackVarEnumToString(StackVar const e)
OpCodeMapPtr GetOpCodeMap(const sal_Int32 nLanguage) const
sal_uInt16 GetLen() const
#define SAL_N_ELEMENTS(arr)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: tokenuno.cxx:257
ocWhitespace
virtual sal_Unicode GetChar() const
#define SC_UNO_OPCODEMAP
Definition: unonames.hxx:679
css::uno::Sequence< css::sheet::ExternalLinkInfo > maExternalLinks
Definition: tokenuno.hxx:58
static void lcl_ExternalRefToApi(sheet::SingleReference &rAPI, const ScSingleRefData &rRef)
Definition: tokenuno.cxx:296
ocPush
svIndex
void EnableJumpCommandReorder(bool bEnable)
static SC_DLLPUBLIC void ConvertToTokenSequence(const ScDocument &rDoc, css::uno::Sequence< css::sheet::FormulaToken > &rSequence, const ScTokenArray &rTokenArray)
Definition: tokenuno.cxx:382
float u
svByte
svExternalDoubleRef
static SC_DLLPUBLIC bool ConvertToTokenArray(ScDocument &rDoc, ScTokenArray &rTokenArray, const css::uno::Sequence< css::sheet::FormulaToken > &rSequence)
Definition: tokenuno.cxx:376
FormulaToken ** GetArray() const
svExternalSingleRef
ScExternalRefCache::TableTypeRef getCacheTable(sal_uInt16 nFileId, size_t nTabIndex) const
Get a cache table instance for specified table and table index.
bool IsRowRel() const
Definition: refdata.hxx:67
css::uno::Type const & get()
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
Definition: miscuno.hxx:63
static void FillScAddress(ScAddress &rScAddress, const css::table::CellAddress &rApiAddress)
Definition: convuno.hxx:63
SCTAB Tab() const
Definition: refdata.cxx:254
ScFormulaOpCodeMapperObj(::std::unique_ptr< formula::FormulaCompiler > &&_pCompiler)
Definition: tokenuno.cxx:517
void EnableStopOnError(bool bEnable)
virtual sal_uInt16 GetIndex() const
svSingleRef
bool IsFlag3D() const
Definition: refdata.hxx:90
#define SC_IMPL_DUMMY_PROPERTY_LISTENER(ClassName)
Definition: miscuno.hxx:72
svJump
void SetFormulaLanguage(const OpCodeMapPtr &xMap)
Set symbol map if not empty.
Definition: compiler.cxx:284
void SetRefConvention(const Convention *pConvP)
Definition: compiler.cxx:2020
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: tokenuno.cxx:179
#define SC_UNO_COMPILEENGLISH
Definition: unonames.hxx:676
virtual ~ScFormulaParserObj() override
Definition: tokenuno.cxx:87
std::unique_ptr< char[]> aBuffer
ScCompiler::OpCodeMapPtr mxOpCodeMap
Definition: tokenuno.hxx:59
virtual const ScSingleRefData * GetSingleRef2() const
virtual const svl::SharedString & GetString() const
static OpCodeMapPtr CreateOpCodeMap(const css::uno::Sequence< const css::sheet::FormulaOpCodeMapEntry > &rMapping, bool bEnglish)
svMatrix
svExternal
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:909
SCROW Row() const
Definition: refdata.cxx:240
bool mbRefConventionChartOOXML
Definition: tokenuno.hxx:65
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
void SetRefConventionChartOOXML(bool bVal)
Definition: compiler.hxx:434
bool IsRelName() const
Definition: refdata.hxx:92
virtual OUString SAL_CALL printFormula(const css::uno::Sequence< css::sheet::FormulaToken > &aTokens, const css::table::CellAddress &rReferencePos) override
Definition: tokenuno.cxx:153
#define SC_UNO_REF_CONV_CHARTOOXML
Definition: unonames.hxx:682
static const SfxItemPropertyMapEntry * lcl_GetFormulaParserMap()
Definition: tokenuno.cxx:49
constexpr OUStringLiteral SC_SERVICENAME_FORMULAPARS
Definition: unonames.hxx:31
#define SAL_WARN(area, stream)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: tokenuno.cxx:95
std::shared_ptr< const OpCodeMap > OpCodeMapPtr
bool IsRowDeleted() const
Definition: refdata.hxx:84
svMissing
StackVar GetType() const
css::uno::Sequence< const css::sheet::FormulaOpCodeMapEntry > maOpCodeMapping
Definition: tokenuno.hxx:57
const formula::FormulaGrammar::AddressConvention aConvMap[]
Definition: tokenuno.cxx:63
sal_uInt16 nPos
bool IsColDeleted() const
Definition: refdata.hxx:82
Use this guard when performing something from the API that might query values from external reference...
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill= '\0')
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo