LibreOffice Module sc (master)  1
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
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 .
18  */
20 #pragma once
22 #include "xlformula.hxx"
23 #include "xeroot.hxx"
24 #include <memory>
26 struct XclAddress;
28 // External reference log =====================================================
32 {
36  sal_uInt16 mnFirstXclTab;
37  sal_uInt16 mnLastXclTab;
39  explicit XclExpRefLogEntry();
40 };
43 typedef ::std::vector< XclExpRefLogEntry > XclExpRefLog;
45 // Formula compiler ===========================================================
47 class ScRangeList;
48 class XclExpFmlaCompImpl;
52 {
53 public:
54  explicit XclExpFormulaCompiler( const XclExpRoot& rRoot );
55  virtual ~XclExpFormulaCompiler() override;
59  XclFormulaType eType, const ScTokenArray& rScTokArr,
60  const ScAddress* pScBasePos = nullptr, XclExpRefLog* pRefLog = nullptr );
66  XclTokenArrayRef CreateFormula( XclFormulaType eType, const ScRange& rScRange );
69  XclTokenArrayRef CreateFormula( XclFormulaType eType, const ScRangeList& rScRanges );
81  XclTokenArrayRef CreateNameXFormula( sal_uInt16 nExtSheet, sal_uInt16 nExtName );
83  bool IsRef2D( const ScSingleRefData& rRefData ) const;
84  bool IsRef2D( const ScComplexRefData& rRefData ) const;
86 private:
87  typedef std::shared_ptr< XclExpFmlaCompImpl > XclExpFmlaCompImplRef;
88  XclExpFmlaCompImplRef mxImpl;
89 };
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class stores an unformatted or formatted string for Excel export.
Definition: xestring.hxx:47
Calc index of the last sheet.
Definition: xeformula.cxx:42
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:2693
Implementation class of the export formula compiler.
Definition: xeformula.cxx:296
The formula compiler to create Excel token arrays from Calc token arrays.
Definition: xeformula.hxx:51
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:2687
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:2682
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:2639
XclExpFormulaCompiler(const XclExpRoot &rRoot)
Definition: xeformula.cxx:2633
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:2643
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:2699