LibreOffice Module sc (master)  1
consoli.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_INC_CONSOLI_HXX
21 #define INCLUDED_SC_INC_CONSOLI_HXX
22 
23 #include "global.hxx"
24 #include "address.hxx"
25 #include <vector>
26 
27 class ScDocument;
28 class ScFunctionData;
29 
30 // Sequence:
31 // 1) create ScConsData
32 // 2) Parameter (Size/Flags)
33 // 3) AddFields for all areas (only needed for bColByName or bRowByName)
34 // 4) DoneFields ( " " )
35 // 5) AddData for all areas
36 // perhaps AddName after each area
37 // 6) OutputToDocument
38 
40 
42 {
43 private:
44  struct ScReferenceEntry // without constructor !
45  {
49  };
50  typedef std::vector<ScReferenceEntry> ScReferenceList;
52  bool bReference;
53  bool bColByName;
54  bool bRowByName;
57  std::unique_ptr<std::unique_ptr<bool[]>[]> ppUsed;
58  std::unique_ptr<std::unique_ptr<ScFunctionData[]>[]> ppFunctionData;
59  std::unique_ptr<std::unique_ptr<ScReferenceList[]>[]> ppRefs;
60  ::std::vector<OUString> maColHeaders;
61  ::std::vector<OUString> maRowHeaders;
62  ::std::vector<OUString> maTitles;
64  std::unique_ptr<std::unique_ptr<SCSIZE[]>[]> ppTitlePos;
66  OUString aCornerText; // only for bColByName && bRowByName
67 
68 public:
69  ScConsData();
70  ~ScConsData();
71 
72  void SetSize( SCCOL nCols, SCROW nRows );
73  void SetFlags( ScSubTotalFunc eFunc, bool bColName, bool bRowName, bool bRef );
74 
75  void InitData();
76  void DeleteData();
77 
78  void AddFields( const ScDocument* pSrcDoc, SCTAB nTab,
79  SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
80  void DoneFields();
81 
82  void AddData( ScDocument* pSrcDoc, SCTAB nTab,
83  SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
84  void AddName( const OUString& rName );
85 
86  void OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow, SCTAB nTab );
87 
88  void GetSize( SCCOL& rCols, SCROW& rRows ) const;
89  SCROW GetInsertCount() const;
90 };
91 
92 #endif
93 
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void AddName(const OUString &rName)
Definition: consoli.cxx:207
~ScConsData()
Definition: consoli.cxx:69
void DoneFields()
Definition: consoli.cxx:131
bool bCornerUsed
Definition: consoli.hxx:65
SCSIZE nDataCount
Definition: consoli.hxx:63
Use structure ScDocument if a certain size is exceeded?
Definition: consoli.hxx:41
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition: address.hxx:45
ScConsData()
Definition: consoli.cxx:57
void GetSize(SCCOL &rCols, SCROW &rRows) const
Definition: consoli.cxx:143
std::unique_ptr< std::unique_ptr< SCSIZE[]>[]> ppTitlePos
Definition: consoli.hxx:64
void InitData()
Definition: consoli.cxx:91
void OutputToDocument(ScDocument *pDestDoc, SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: consoli.cxx:393
void SetFlags(ScSubTotalFunc eFunc, bool bColName, bool bRowName, bool bRef)
Definition: consoli.cxx:149
::std::vector< OUString > maRowHeaders
Definition: consoli.hxx:61
void AddFields(const ScDocument *pSrcDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Definition: consoli.cxx:160
bool bColByName
Definition: consoli.hxx:53
SCSIZE nRowCount
Definition: consoli.hxx:56
sal_Int16 SCCOL
Definition: types.hxx:22
void AddData(ScDocument *pSrcDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Definition: consoli.cxx:240
SCSIZE nColCount
Definition: consoli.hxx:55
std::unique_ptr< std::unique_ptr< bool[]>[]> ppUsed
Definition: consoli.hxx:57
std::unique_ptr< std::unique_ptr< ScFunctionData[]>[]> ppFunctionData
Definition: consoli.hxx:58
void DeleteData()
Definition: consoli.cxx:73
bool bRowByName
Definition: consoli.hxx:54
SCROW GetInsertCount() const
Definition: consoli.cxx:371
sal_Int32 SCROW
Definition: types.hxx:18
To calculate a single subtotal function.
Definition: subtotal.hxx:61
void SetSize(SCCOL nCols, SCROW nRows)
Definition: consoli.cxx:136
std::unique_ptr< std::unique_ptr< ScReferenceList[]>[]> ppRefs
Definition: consoli.hxx:59
::std::vector< OUString > maTitles
Definition: consoli.hxx:62
::std::vector< OUString > maColHeaders
Definition: consoli.hxx:60
ScSubTotalFunc eFunction
Definition: consoli.hxx:51
ScSubTotalFunc
Definition: global.hxx:847
bool bReference
Definition: consoli.hxx:52
std::vector< ScReferenceEntry > ScReferenceList
Definition: consoli.hxx:50
OUString aCornerText
Definition: consoli.hxx:66
sal_Int16 SCTAB
Definition: types.hxx:23