LibreOffice Module sc (master) 1
xmlcelli.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#pragma once
20
22#include "importcontext.hxx"
23#include <formula/grammar.hxx>
24#include <svl/itemset.hxx>
25#include <editeng/editdata.hxx>
26
27#include <optional>
28#include <memory>
29#include <vector>
30
31class ScXMLImport;
32class ScFormulaCell;
34class SvxFieldData;
37
39{
41 {
44
45 explicit ParaFormat(const ScEditEngineDefaulter& rEditEngine);
46 };
47
48 struct Field
49 {
50 std::unique_ptr<SvxFieldData> mpData;
52
53 Field(const Field&) = delete;
54 const Field& operator=(const Field&) = delete;
55
56 explicit Field(std::unique_ptr<SvxFieldData> pData);
57 ~Field();
58 };
59
60 typedef std::vector<std::unique_ptr<Field> > FieldsType;
61 typedef std::pair<OUString, OUString> FormulaWithNamespace;
62
63 std::optional<FormulaWithNamespace> maFormula;
64 std::optional<OUString> maStringValue;
65 std::optional<OUString> maContentValidationName;
66 std::optional<OUString> maFirstParagraph;
67
69 OUStringBuffer maParagraph{32};
70 sal_Int32 mnCurParagraph;
71
72 std::vector<std::unique_ptr<ParaFormat> > maFormats;
74
75 std::unique_ptr< ScXMLAnnotationData > mxAnnotationData;
76 std::unique_ptr< ScMyImpDetectiveObjVec > pDetectiveObjVec;
77 std::unique_ptr< ScMyImpCellRangeSource > pCellRangeSource;
78 double fValue;
83 sal_Int16 nCellType;
98
99 void DoMerge(const ScAddress& rScCellPos, const SCCOL nCols, const SCROW nRows);
100
101 void SetContentValidation( const ScRange& rScRange );
102 void SetContentValidation( const ScAddress& rScCellPos );
103
104 void LockSolarMutex();
105
106 bool CellsAreRepeated() const;
107
108 void SetFormulaCell ( ScFormulaCell* pFCell ) const;
109 void PutTextCell ( const ScAddress& rScCurrentPos, const SCCOL nCurrentCol,
110 const ::std::optional< OUString >& pOUText );
111 void PutValueCell ( const ScAddress& rScCurrentPos );
112 void AddTextAndValueCell ( const ScAddress& rScCellPos,
113 const ::std::optional< OUString >& pOUText, ScAddress& rScCurrentPos );
114 void AddNonFormulaCell ( const ScAddress& rScCellPos );
115 void PutFormulaCell ( const ScAddress& rScCurrentPos );
116 void AddFormulaCell ( const ScAddress& rScCellPos );
117
119
120 bool IsPossibleErrorString() const;
121
122 void PushParagraphField(std::unique_ptr<SvxFieldData> pData, const OUString& rStyleName);
123
124 void PushFormat(sal_Int32 nBegin, sal_Int32 nEnd, const OUString& rStyleName);
125
126 OUString GetFirstParagraph() const;
127
128public:
129
132 const bool bIsCovered, const sal_Int32 nRepeatedRows );
133
134 virtual ~ScXMLTableRowCellContext() override;
135
136 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
137 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
138
139 void PushParagraphSpan(std::u16string_view rSpan, const OUString& rStyleName);
140 void PushParagraphFieldDate(const OUString& rStyleName);
141 void PushParagraphFieldSheetName(const OUString& rStyleName);
142 void PushParagraphFieldDocTitle(const OUString& rStyleName);
143 void PushParagraphFieldURL(const OUString& rURL, const OUString& rRep, const OUString& rStyleName, const OUString& rTargetFrame);
144 void PushParagraphEnd();
145
146 void SetAnnotation( const ScAddress& rPosition );
147 void SetDetectiveObj( const ScAddress& rPosition );
148 void SetCellRangeSource( const ScAddress& rPosition );
149
150 virtual void SAL_CALL endFastElement(sal_Int32 nElement) override;
151};
152
153/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class exists only to provide GetScImport() to its derived classes.
void SetCellRangeSource(const ScAddress &rPosition)
Definition: xmlcelli.cxx:969
virtual ~ScXMLTableRowCellContext() override
Definition: xmlcelli.cxx:290
std::pair< OUString, OUString > FormulaWithNamespace
Definition: xmlcelli.hxx:61
void PushFormat(sal_Int32 nBegin, sal_Int32 nEnd, const OUString &rStyleName)
Definition: xmlcelli.cxx:338
void PushParagraphFieldDocTitle(const OUString &rStyleName)
Definition: xmlcelli.cxx:587
void PushParagraphFieldSheetName(const OUString &rStyleName)
Definition: xmlcelli.cxx:581
void PutFormulaCell(const ScAddress &rScCurrentPos)
Definition: xmlcelli.cxx:1345
ScEditEngineDefaulter * mpEditEngine
unformatted first paragraph, for better performance.
Definition: xmlcelli.hxx:68
std::unique_ptr< ScMyImpDetectiveObjVec > pDetectiveObjVec
Definition: xmlcelli.hxx:76
void AddNonFormulaCell(const ScAddress &rScCellPos)
Definition: xmlcelli.cxx:1308
OUStringBuffer maParagraph
Definition: xmlcelli.hxx:69
void SetFormulaCell(ScFormulaCell *pFCell) const
Definition: xmlcelli.cxx:988
void PutValueCell(const ScAddress &rScCurrentPos)
Definition: xmlcelli.cxx:1127
ScXMLTableRowCellContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, const bool bIsCovered, const sal_Int32 nRepeatedRows)
Definition: xmlcelli.cxx:114
OUString GetFirstParagraph() const
Definition: xmlcelli.cxx:568
void AddTextAndValueCell(const ScAddress &rScCellPos, const ::std::optional< OUString > &pOUText, ScAddress &rScCurrentPos)
Definition: xmlcelli.cxx:1169
void SetAnnotation(const ScAddress &rPosition)
Definition: xmlcelli.cxx:823
std::optional< OUString > maFirstParagraph
Definition: xmlcelli.hxx:66
formula::FormulaGrammar::Grammar eGrammar
Definition: xmlcelli.hxx:82
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlcelli.cxx:1499
std::optional< FormulaWithNamespace > maFormula
Definition: xmlcelli.hxx:63
std::vector< std::unique_ptr< Field > > FieldsType
Definition: xmlcelli.hxx:60
bool IsPossibleErrorString() const
Definition: xmlcelli.cxx:1490
void PushParagraphSpan(std::u16string_view rSpan, const OUString &rStyleName)
Definition: xmlcelli.cxx:313
std::unique_ptr< ScXMLAnnotationData > mxAnnotationData
Definition: xmlcelli.hxx:75
bool CellsAreRepeated() const
Definition: xmlcelli.cxx:1267
void PutTextCell(const ScAddress &rScCurrentPos, const SCCOL nCurrentCol, const ::std::optional< OUString > &pOUText)
Definition: xmlcelli.cxx:1030
void DoMerge(const ScAddress &rScCellPos, const SCCOL nCols, const SCROW nRows)
Definition: xmlcelli.cxx:713
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmlcelli.cxx:631
ScXMLImport & rXMLImport
Definition: xmlcelli.hxx:81
std::optional< OUString > maContentValidationName
office:string-value attribute
Definition: xmlcelli.hxx:65
void AddFormulaCell(const ScAddress &rScCellPos)
Definition: xmlcelli.cxx:1392
std::optional< OUString > maStringValue
table:formula attribute
Definition: xmlcelli.hxx:64
void SetContentValidation(const ScRange &rScRange)
Definition: xmlcelli.cxx:762
void PushParagraphField(std::unique_ptr< SvxFieldData > pData, const OUString &rStyleName)
Definition: xmlcelli.cxx:322
void PushParagraphFieldDate(const OUString &rStyleName)
Definition: xmlcelli.cxx:576
void PushParagraphFieldURL(const OUString &rURL, const OUString &rRep, const OUString &rStyleName, const OUString &rTargetFrame)
Definition: xmlcelli.cxx:592
std::unique_ptr< ScMyImpCellRangeSource > pCellRangeSource
Definition: xmlcelli.hxx:77
std::vector< std::unique_ptr< ParaFormat > > maFormats
Definition: xmlcelli.hxx:72
void SetDetectiveObj(const ScAddress &rPosition)
Definition: xmlcelli.cxx:947
Field(const Field &)=delete
const Field & operator=(const Field &)=delete
std::unique_ptr< SvxFieldData > mpData
Definition: xmlcelli.hxx:50
ParaFormat(const ScEditEngineDefaulter &rEditEngine)
Definition: xmlcelli.cxx:105
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17