LibreOffice Module sc (master)  1
extlstcontext.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 
10 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_EXTLSTCONTEXT_HXX
11 #define INCLUDED_SC_SOURCE_FILTER_INC_EXTLSTCONTEXT_HXX
12 
13 #include "excelhandlers.hxx"
15 #include "condformatbuffer.hxx"
16 
17 #include <vector>
18 #include <memory>
19 
20 extern sal_Int32 rStyleIdx; // Holds index of the <extlst> <cfRule> style (Will be reset by finalize import)
21 
22 struct ScDataBarFormatData;
23 namespace oox { class AttributeList; }
24 namespace oox::xls { class WorkbookFragment; }
25 namespace oox::xls { class WorksheetFragment; }
26 
27 namespace oox::xls {
28 
30 {
31 public:
32  explicit ExtCfRuleContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pDataBar );
33 
34  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
35  virtual void onStartElement( const AttributeList& rAttribs ) override;
36 
37 private:
39 
41 };
42 
44 {
45 public:
47 
48  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
49  virtual void onStartElement( const AttributeList& rAttribs ) override;
50  virtual void onCharacters(const OUString& rCharacters) override;
51  virtual void onEndElement() override;
52 
53 private:
54  OUString aChars; // Characters of between xml elements.
55  OUString rStyle; // Style of the corresponding condition
56  sal_Int32 nPriority; // Priority of last cfRule element.
57  ScConditionMode eOperator; // Used only when cfRule type is "cellIs"
58  bool isPreviousElementF; // Used to distinguish alone <sqref> from <f> and <sqref>
59  std::vector<std::unique_ptr<ScFormatEntry> > maEntries;
60  std::vector< OUString > rFormulas; // It holds formulas for a range, there can be more formula for same range.
61  std::unique_ptr<IconSetRule> mpCurrentRule;
62  std::vector<sal_Int32> maPriorities;
63 };
64 
74 {
75 public:
76  explicit ExtLstLocalContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pTarget ); // until now a ExtLst always extends an existing entry
77 
78 protected:
79  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
80  virtual void onStartElement( const AttributeList& rAttribs ) override;
81  virtual void onCharacters( const OUString& rChars ) override;
82 
83 private:
85 };
86 
91 {
92 public:
93  explicit ExtGlobalContext( WorksheetContextBase& rFragment );
94 
95 protected:
96  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
97  virtual void onStartElement( const AttributeList& rAttribs ) override;
98 
99 private:
100 };
101 
107 {
108 public:
109  explicit ExtLstGlobalContext( WorksheetFragment& rFragment );
110 
111 protected:
112  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
113 };
114 
116 {
117 public:
118  explicit ExtGlobalWorkbookContext( WorkbookContextBase& rFragment );
119 
120 protected:
121  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
122  virtual void onStartElement( const AttributeList& rAttribs ) override;
123 
124 private:
125 };
126 
128 {
129 public:
130  explicit ExtLstGlobalWorkbookContext( WorkbookFragment& rFragment );
131 
132 protected:
133  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
134 };
135 
136 } //namespace oox::xls
137 
138 #endif
139 
140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void onCharacters(const OUString &rChars) override
std::vector< std::unique_ptr< ScFormatEntry > > maEntries
virtual void onStartElement(const AttributeList &rAttribs) override
ScDataBarFormatData * mpTarget
ScDataBarFormatData * mpTarget
Handle ExtLst entries in xlsx.
A single ext entry.
virtual void onStartElement(const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
Used for the actual ExtLst containing the new extended definition.
ScConditionMode
Definition: conditio.hxx:61
ExtCfRuleContext(WorksheetContextBase &rFragment, ScDataBarFormatData *pDataBar)
ExtLstGlobalContext(WorksheetFragment &rFragment)
sal_Int32 rStyleIdx
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual void onCharacters(const OUString &rCharacters) override
virtual void onStartElement(const AttributeList &rAttribs) override
ExtLstGlobalWorkbookContext(WorkbookFragment &rFragment)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
Context handler derived from the WorkbookHelper helper class.
ExtGlobalContext(WorksheetContextBase &rFragment)
ExtConditionalFormattingContext(WorksheetContextBase &rFragment)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
Context handler derived from the WorksheetHelper helper class.
ExtLstLocalContext(WorksheetContextBase &rFragment, ScDataBarFormatData *pTarget)
std::unique_ptr< IconSetRule > mpCurrentRule
virtual void onStartElement(const AttributeList &rAttribs) override
ExtGlobalWorkbookContext(WorkbookContextBase &rFragment)
virtual void onStartElement(const AttributeList &rAttribs) override