LibreOffice Module sc (master)  1
xeformula.hxx
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 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XEFORMULA_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_XEFORMULA_HXX
22 
23 #include "xlformula.hxx"
24 #include "xeroot.hxx"
25 #include <memory>
26 
27 struct XclAddress;
28 
29 // External reference log =====================================================
30 
33 {
37  sal_uInt16 mnFirstXclTab;
38  sal_uInt16 mnLastXclTab;
39 
40  explicit XclExpRefLogEntry();
41 };
42 
44 typedef ::std::vector< XclExpRefLogEntry > XclExpRefLog;
45 
46 // Formula compiler ===========================================================
47 
48 class ScRangeList;
49 class XclExpFmlaCompImpl;
50 
53 {
54 public:
55  explicit XclExpFormulaCompiler( const XclExpRoot& rRoot );
56  virtual ~XclExpFormulaCompiler() override;
57 
60  XclFormulaType eType, const ScTokenArray& rScTokArr,
61  const ScAddress* pScBasePos = nullptr, XclExpRefLog* pRefLog = nullptr );
62 
65 
67  XclTokenArrayRef CreateFormula( XclFormulaType eType, const ScRange& rScRange );
68 
70  XclTokenArrayRef CreateFormula( XclFormulaType eType, const ScRangeList& rScRanges );
71 
74 
79 
82  XclTokenArrayRef CreateNameXFormula( sal_uInt16 nExtSheet, sal_uInt16 nExtName );
83 
84  bool IsRef2D( const ScSingleRefData& rRefData ) const;
85  bool IsRef2D( const ScComplexRefData& rRefData ) const;
86 
87 private:
88  typedef std::shared_ptr< XclExpFmlaCompImpl > XclExpFmlaCompImplRef;
89  XclExpFmlaCompImplRef mxImpl;
90 };
91 
92 #endif
93 
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class stores an unformatted or formatted string for Excel export.
Definition: xestring.hxx:43
XclExpRefLogEntry()
Calc index of the last sheet.
Definition: xeformula.cxx:43
Single reference (one address) into the sheet.
Definition: refdata.hxx:30
sal_uInt16 mnFirstXclTab
Name of the last sheet.
Definition: xeformula.hxx:37
XclTokenArrayRef CreateNameXFormula(sal_uInt16 nExtSheet, sal_uInt16 nExtName)
Creates a single tNameXR token for a reference to an external name.
Definition: xeformula.cxx:2687
Implementation class of the export formula compiler.
Definition: xeformula.cxx:297
The formula compiler to create Excel token arrays from Calc token arrays.
Definition: xeformula.hxx:52
XclFormulaType
Mask for number of appended ranges.
Definition: xlformula.hxx:160
Access to global data from other classes.
Definition: xeroot.hxx:113
sal_uInt16 mnLastXclTab
Calc index of the first sheet.
Definition: xeformula.hxx:38
XclTokenArrayRef CreateSpecialRefFormula(sal_uInt8 nTokenId, const XclAddress &rXclPos)
Creates a single token for a special cell reference.
Definition: xeformula.cxx:2681
XclExpFmlaCompImplRef mxImpl
Definition: xeformula.hxx:89
DocumentType eType
XclTokenArrayRef CreateErrorFormula(sal_uInt8 nErrCode)
Creates a single error token containing the passed error code.
Definition: xeformula.cxx:2676
const XclExpString * mpLastTab
Name of the first sheet.
Definition: xeformula.hxx:36
const XclExpString * mpFirstTab
URL of the document containing the first sheet.
Definition: xeformula.hxx:35
::std::vector< XclExpRefLogEntry > XclExpRefLog
Vector containing a log for all external references in a formula, used i.e.
Definition: xeformula.hxx:44
A 2D cell address struct with Excel column and row indexes.
Definition: xladdress.hxx:30
std::shared_ptr< XclTokenArray > XclTokenArrayRef
Definition: xlformula.hxx:417
virtual ~XclExpFormulaCompiler() override
Definition: xeformula.cxx:2633
XclExpFormulaCompiler(const XclExpRoot &rRoot)
Definition: xeformula.cxx:2627
unsigned char sal_uInt8
std::shared_ptr< XclExpFmlaCompImpl > XclExpFmlaCompImplRef
Definition: xeformula.hxx:88
const XclExpString * mpUrl
Definition: xeformula.hxx:34
XclTokenArrayRef CreateFormula(XclFormulaType eType, const ScTokenArray &rScTokArr, const ScAddress *pScBasePos=nullptr, XclExpRefLog *pRefLog=nullptr)
Creates and returns the token array of a formula.
Definition: xeformula.cxx:2637
Log entry for external references in a formula, used i.e.
Definition: xeformula.hxx:32
Complex reference (a range) into the sheet.
Definition: refdata.hxx:123
bool IsRef2D(const ScSingleRefData &rRefData) const
Definition: xeformula.cxx:2693