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  for (sal_Int32 nPos=0; nPos<nLen; nPos++)
391  {
392  const formula::FormulaToken& rToken = *pTokens[nPos];
393  sheet::FormulaToken& rAPI = rSequence[nPos];
394 
395  OpCode eOpCode = rToken.GetOpCode();
396  // eOpCode may be changed in the following switch/case
397  switch ( rToken.GetType() )
398  {
399  case svByte:
400  // Only the count of spaces is stored as "long". Parameter count is ignored.
401  if ( eOpCode == ocSpaces )
402  rAPI.Data <<= static_cast<sal_Int32>(rToken.GetByte());
403  else if (eOpCode == ocWhitespace)
404  {
405  // Convention is one character repeated.
406  if (rToken.GetByte() == 1)
407  rAPI.Data <<= OUString( rToken.GetChar());
408  else
409  {
410  OUStringBuffer aBuf( rToken.GetByte());
411  comphelper::string::padToLength( aBuf, rToken.GetByte(), rToken.GetChar());
412  rAPI.Data <<= aBuf.makeStringAndClear();
413  }
414  }
415  else
416  rAPI.Data.clear(); // no data
417  break;
418  case formula::svDouble:
419  rAPI.Data <<= rToken.GetDouble();
420  break;
421  case formula::svString:
422  rAPI.Data <<= rToken.GetString().getString();
423  break;
424  case svExternal:
425  // Function name is stored as string.
426  // Byte (parameter count) is ignored.
427  rAPI.Data <<= rToken.GetExternal();
428  break;
429  case svSingleRef:
430  {
431  sheet::SingleReference aSingleRef;
432  lcl_SingleRefToApi( aSingleRef, *rToken.GetSingleRef() );
433  rAPI.Data <<= aSingleRef;
434  }
435  break;
437  {
438  sheet::ComplexReference aCompRef;
439  lcl_SingleRefToApi( aCompRef.Reference1, *rToken.GetSingleRef() );
440  lcl_SingleRefToApi( aCompRef.Reference2, *rToken.GetSingleRef2() );
441  rAPI.Data <<= aCompRef;
442  }
443  break;
444  case svIndex:
445  {
446  sheet::NameToken aNameToken;
447  aNameToken.Index = static_cast<sal_Int32>( rToken.GetIndex() );
448  aNameToken.Sheet = rToken.GetSheet();
449  rAPI.Data <<= aNameToken;
450  }
451  break;
452  case svMatrix:
453  if (!ScRangeToSequence::FillMixedArray( rAPI.Data, rToken.GetMatrix(), true))
454  rAPI.Data.clear();
455  break;
456  case svExternalSingleRef:
457  {
458  sheet::SingleReference aSingleRef;
459  lcl_ExternalRefToApi( aSingleRef, *rToken.GetSingleRef() );
460  size_t nCacheId;
462  rToken.GetIndex(), rToken.GetString().getString(), false, &nCacheId);
463  aSingleRef.Sheet = static_cast< sal_Int32 >( nCacheId );
464  sheet::ExternalReference aExtRef;
465  aExtRef.Index = rToken.GetIndex();
466  aExtRef.Reference <<= aSingleRef;
467  rAPI.Data <<= aExtRef;
468  eOpCode = ocPush;
469  }
470  break;
471  case svExternalDoubleRef:
472  {
473  sheet::ComplexReference aComplRef;
474  lcl_ExternalRefToApi( aComplRef.Reference1, *rToken.GetSingleRef() );
475  lcl_ExternalRefToApi( aComplRef.Reference2, *rToken.GetSingleRef2() );
476  size_t nCacheId;
478  rToken.GetIndex(), rToken.GetString().getString(), false, &nCacheId);
479  aComplRef.Reference1.Sheet = static_cast< sal_Int32 >( nCacheId );
480  // NOTE: This assumes that cached sheets are in consecutive order!
481  aComplRef.Reference2.Sheet =
482  aComplRef.Reference1.Sheet +
483  (rToken.GetSingleRef2()->Tab() - rToken.GetSingleRef()->Tab());
484  sheet::ExternalReference aExtRef;
485  aExtRef.Index = rToken.GetIndex();
486  aExtRef.Reference <<= aComplRef;
487  rAPI.Data <<= aExtRef;
488  eOpCode = ocPush;
489  }
490  break;
491  case svExternalName:
492  {
493  sheet::ExternalReference aExtRef;
494  aExtRef.Index = rToken.GetIndex();
495  aExtRef.Reference <<= rToken.GetString().getString();
496  rAPI.Data <<= aExtRef;
497  eOpCode = ocPush;
498  }
499  break;
500  default:
501  SAL_WARN("sc", "ScTokenConversion::ConvertToTokenSequence: unhandled token type " << StackVarEnumToString(rToken.GetType()));
502  [[fallthrough]];
503  case svJump: // occurs with ocIf, ocChoose
504  case svError: // seems to be fairly common, and probably not exceptional and not worth a warning?
505  case svMissing: // occurs with ocMissing
506  case svSep: // occurs with ocSep, ocOpen, ocClose, ocArray*
507  rAPI.Data.clear(); // no data
508  }
509  rAPI.OpCode = static_cast<sal_Int32>(eOpCode);
510  }
511  }
512  else
513  rSequence.realloc(0);
514 }
515 
516 ScFormulaOpCodeMapperObj::ScFormulaOpCodeMapperObj(::std::unique_ptr<formula::FormulaCompiler> && _pCompiler)
517 : formula::FormulaOpCodeMapperObj(std::move(_pCompiler))
518 {
519 }
520 
521 /* 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:566
#define SC_UNO_EXTERNALLINKS
Definition: unonames.hxx:676
#define SC_SERVICENAME_FORMULAPARS
Definition: unonames.hxx:29
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:677
#define SC_UNO_FORMULACONVENTION
Definition: unonames.hxx:673
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:461
OpCode GetOpCode() const
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:984
ocSpaces
#define SC_UNO_IGNORELEADING
Definition: unonames.hxx:674
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:623
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:675
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
#define static
Definition: arraysum.hxx:27
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:516
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:2026
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: tokenuno.cxx:179
#define SC_UNO_COMPILEENGLISH
Definition: unonames.hxx:672
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:906
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:432
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:678
static const SfxItemPropertyMapEntry * lcl_GetFormulaParserMap()
Definition: tokenuno.cxx:49
#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