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 #pragma once
21 
22 #include "xlformula.hxx"
23 #include "xeroot.hxx"
24 #include <memory>
25 
26 struct XclAddress;
27 
28 // External reference log =====================================================
29 
32 {
36  sal_uInt16 mnFirstXclTab;
37  sal_uInt16 mnLastXclTab;
38 
39  explicit XclExpRefLogEntry();
40 };
41 
43 typedef ::std::vector< XclExpRefLogEntry > XclExpRefLog;
44 
45 // Formula compiler ===========================================================
46 
47 class ScRangeList;
48 class XclExpFmlaCompImpl;
49 
52 {
53 public:
54  explicit XclExpFormulaCompiler( const XclExpRoot& rRoot );
55  virtual ~XclExpFormulaCompiler() override;
56 
59  XclFormulaType eType, const ScTokenArray& rScTokArr,
60  const ScAddress* pScBasePos = nullptr, XclExpRefLog* pRefLog = nullptr );
61 
64 
66  XclTokenArrayRef CreateFormula( XclFormulaType eType, const ScRange& rScRange );
67 
69  XclTokenArrayRef CreateFormula( XclFormulaType eType, const ScRangeList& rScRanges );
70 
73 
78 
81  XclTokenArrayRef CreateNameXFormula( sal_uInt16 nExtSheet, sal_uInt16 nExtName );
82 
83  bool IsRef2D( const ScSingleRefData& rRefData ) const;
84  bool IsRef2D( const ScComplexRefData& rRefData ) const;
85 
86 private:
87  typedef std::shared_ptr< XclExpFmlaCompImpl > XclExpFmlaCompImplRef;
88  XclExpFmlaCompImplRef mxImpl;
89 };
90 
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class stores an unformatted or formatted string for Excel export.
Definition: xestring.hxx:47
XclExpRefLogEntry()
Calc index of the last sheet.
Definition: xeformula.cxx:43
Single reference (one address) into the sheet.
Definition: refdata.hxx:29
sal_uInt16 mnFirstXclTab
Name of the last sheet.
Definition: xeformula.hxx:36
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:51
XclFormulaType
Mask for number of appended ranges.
Definition: xlformula.hxx:159
Access to global data from other classes.
Definition: xeroot.hxx:112
sal_uInt16 mnLastXclTab
Calc index of the first sheet.
Definition: xeformula.hxx:37
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:88
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:35
const XclExpString * mpFirstTab
URL of the document containing the first sheet.
Definition: xeformula.hxx:34
::std::vector< XclExpRefLogEntry > XclExpRefLog
Vector containing a log for all external references in a formula, used i.e.
Definition: xeformula.hxx:43
A 2D cell address struct with Excel column and row indexes.
Definition: xladdress.hxx:29
std::shared_ptr< XclTokenArray > XclTokenArrayRef
Definition: xlformula.hxx:416
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:87
const XclExpString * mpUrl
Definition: xeformula.hxx:33
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:31
Complex reference (a range) into the sheet.
Definition: refdata.hxx:122
bool IsRef2D(const ScSingleRefData &rRefData) const
Definition: xeformula.cxx:2693