/src/libreoffice/sc/inc/patattr.hxx
Line | Count | Source |
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 <optional> |
23 | | |
24 | | #include <svl/itemset.hxx> |
25 | | #include <svl/languageoptions.hxx> |
26 | | #include <tools/degree.hxx> |
27 | | #include <editeng/svxenum.hxx> |
28 | | #include <o3tl/sorted_vector.hxx> |
29 | | #include "scdllapi.h" |
30 | | #include "fonthelper.hxx" |
31 | | #include "scitems.hxx" |
32 | | #include "attrib.hxx" |
33 | | #include <unordered_map> |
34 | | |
35 | | namespace vcl { class Font; } |
36 | | namespace model { class ComplexColor; } |
37 | | struct ScInterpreterContext; |
38 | | class OutputDevice; |
39 | | class Fraction; |
40 | | class ScStyleSheet; |
41 | | class SvNumberFormatter; |
42 | | class ScDocument; |
43 | | enum class ScRotateDir : sal_uInt8; |
44 | | |
45 | | /// how to treat COL_AUTO in GetFont: |
46 | | |
47 | | enum class ScAutoFontColorMode |
48 | | { |
49 | | Raw, ///< COL_AUTO is returned |
50 | | Print, ///< black or white, depending on background |
51 | | Display, ///< from style settings, or black/white if needed |
52 | | IgnoreFont, ///< like DISPLAY, but ignore stored font color (assume COL_AUTO) |
53 | | IgnoreBack, ///< like DISPLAY, but ignore stored background color (use configured color) |
54 | | IgnoreAll ///< like DISPLAY, but ignore stored font and background colors |
55 | | }; |
56 | | |
57 | | class ScPatternAttr; |
58 | | |
59 | | class SC_DLLPUBLIC CellAttributeHelper final |
60 | | { |
61 | | friend class CellAttributeHolder; |
62 | | |
63 | | // Data structure chosen so that |
64 | | // (a) we can find by name |
65 | | // (b) we can erase quickly, by using name and pointer. |
66 | | // (c) scanning through all the entries with the same name is cheap |
67 | | struct RegisteredAttrMapHash |
68 | | { |
69 | | size_t operator()(const std::optional<OUString>&) const; |
70 | | }; |
71 | | typedef std::unordered_map<std::optional<OUString>, o3tl::sorted_vector<const ScPatternAttr*>, RegisteredAttrMapHash> RegisteredAttrMap; |
72 | | |
73 | | SfxItemPool& mrSfxItemPool; |
74 | | mutable ScPatternAttr* mpDefaultCellAttribute; |
75 | | mutable RegisteredAttrMap maRegisteredCellAttributes; |
76 | | mutable const ScPatternAttr* mpLastHit; |
77 | | mutable sal_uInt64 mnCurrentMaxKey; |
78 | | |
79 | | // only to be used from CellAttributeHolder, so private |
80 | | const ScPatternAttr* registerAndCheck(const ScPatternAttr& rCandidate, bool bPassingOwnership) const; |
81 | | void doUnregister(const ScPatternAttr& rCandidate); |
82 | | |
83 | | public: |
84 | | explicit CellAttributeHelper(SfxItemPool& rSfxItemPool); |
85 | | ~CellAttributeHelper(); |
86 | | |
87 | | const ScPatternAttr& getDefaultCellAttribute() const; |
88 | 3.84M | SfxItemPool& GetPool() const { return mrSfxItemPool; } |
89 | | |
90 | | void CellStyleDeleted(const ScStyleSheet& rStyle); |
91 | | void CellStyleCreated(const ScDocument& rDoc, const OUString& rName); |
92 | | void RenameCellStyle(ScStyleSheet& rStyle, const OUString& rNewName); |
93 | | void UpdateAllStyleSheets(const ScDocument& rDoc); |
94 | | void AllStylesToNames(); |
95 | | void ReIndexRegistered(); |
96 | | }; |
97 | | |
98 | | class SC_DLLPUBLIC CellAttributeHolder final |
99 | | { |
100 | | const ScPatternAttr* mpScPatternAttr; |
101 | | |
102 | | public: |
103 | 168M | CellAttributeHolder() : mpScPatternAttr(nullptr) {} |
104 | | CellAttributeHolder(const ScPatternAttr* pScPatternAttr, bool bPassingOwnership = false); |
105 | | CellAttributeHolder(const CellAttributeHolder& rHolder); |
106 | | CellAttributeHolder(CellAttributeHolder&& rHolder) noexcept |
107 | 134M | : mpScPatternAttr(rHolder.mpScPatternAttr) |
108 | 134M | { rHolder.mpScPatternAttr = nullptr; } |
109 | | ~CellAttributeHolder(); |
110 | | |
111 | | CellAttributeHolder& operator=(const CellAttributeHolder& rHolder); |
112 | 20.0M | CellAttributeHolder& operator=(CellAttributeHolder&& rHolder) { std::swap(mpScPatternAttr, rHolder.mpScPatternAttr); return *this; } |
113 | | bool operator==(const CellAttributeHolder& rHolder) const; |
114 | | |
115 | 779M | const ScPatternAttr* getScPatternAttr() const { return mpScPatternAttr; } |
116 | | void setScPatternAttr(const ScPatternAttr* pNew, bool bPassingOwnership = false); |
117 | | |
118 | 0 | bool operator!() const { return nullptr == mpScPatternAttr; } |
119 | 0 | explicit operator bool() const { return nullptr != mpScPatternAttr; } |
120 | | |
121 | | // version that allows nullptrs |
122 | | static bool areSame(const CellAttributeHolder* p1, const CellAttributeHolder* p2); |
123 | | }; |
124 | | |
125 | | class SAL_DLLPUBLIC_RTTI ScPatternAttr final |
126 | | { |
127 | | friend class CellAttributeHelper; |
128 | | |
129 | | SfxItemSet maLocalSfxItemSet; |
130 | | mutable std::optional<size_t> moHashCode; |
131 | | std::optional<OUString> moName; |
132 | | mutable std::optional<bool> mxVisible; |
133 | | mutable std::optional<sal_uInt32> mxNumberFormatKey; |
134 | | mutable std::optional<LanguageType> mxLanguageType; |
135 | | ScStyleSheet* pStyle; |
136 | | CellAttributeHelper* pCellAttributeHelper; |
137 | | sal_uInt64 mnPAKey; |
138 | | mutable size_t mnRefCount; |
139 | | #ifdef DBG_UTIL |
140 | | [[maybe_unused]] sal_uInt32 m_nSerialNumber; |
141 | | bool m_bDeleted; |
142 | | #endif |
143 | | |
144 | | public: |
145 | | SC_DLLPUBLIC ScPatternAttr(CellAttributeHelper& rHelper, const SfxItemSet* pItemSet = nullptr, const OUString* pStyleName = nullptr); |
146 | | SC_DLLPUBLIC ScPatternAttr(const ScPatternAttr& rPatternAttr); |
147 | | SC_DLLPUBLIC ~ScPatternAttr(); |
148 | | |
149 | | bool operator==(const ScPatternAttr& rCmp) const; |
150 | 245M | size_t GetHashCode() const { if (!moHashCode) CalcHashCode(); return *moHashCode; } |
151 | | |
152 | | // version that allows nullptrs |
153 | | SC_DLLPUBLIC static bool areSame(const ScPatternAttr* pItem1, const ScPatternAttr* pItem2); |
154 | 116M | bool isRegistered() const { return 0 != mnRefCount; } |
155 | 0 | bool isDefault() const { return this == &pCellAttributeHelper->getDefaultCellAttribute(); } |
156 | 673M | CellAttributeHelper& getCellAttributeHelper() const { return *pCellAttributeHelper; } |
157 | | |
158 | 129M | const SfxItemSet& GetItemSet() const { return maLocalSfxItemSet; } |
159 | | SC_DLLPUBLIC SfxItemSet& GetItemSetWritable(); |
160 | | SC_DLLPUBLIC void ItemSetPut(const SfxPoolItem& rItem); |
161 | | void ItemSetPut(std::unique_ptr<SfxPoolItem> xItem); |
162 | | void ItemSetClearItem(sal_uInt16 nWhich); |
163 | | |
164 | | const SfxPoolItem& GetItem(sal_uInt16 nWhichP) const |
165 | 53.3M | { |
166 | 53.3M | return maLocalSfxItemSet.Get(nWhichP, true); // GetByOffset used bSrchInParent==true |
167 | 53.3M | } |
168 | | template<class T> const T& GetItem( TypedWhichId<T> nWhich ) const |
169 | 49.8M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); }ScCondFormatItem const& ScPatternAttr::GetItem<ScCondFormatItem>(TypedWhichId<ScCondFormatItem>) const Line | Count | Source | 169 | 4.20M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
ScMergeAttr const& ScPatternAttr::GetItem<ScMergeAttr>(TypedWhichId<ScMergeAttr>) const Line | Count | Source | 169 | 4.00M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: SvxVerJustifyItem const& ScPatternAttr::GetItem<SvxVerJustifyItem>(TypedWhichId<SvxVerJustifyItem>) const ScMergeFlagAttr const& ScPatternAttr::GetItem<ScMergeFlagAttr>(TypedWhichId<ScMergeFlagAttr>) const Line | Count | Source | 169 | 24.0M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: SvxFontItem const& ScPatternAttr::GetItem<SvxFontItem>(TypedWhichId<SvxFontItem>) const SvxHorJustifyItem const& ScPatternAttr::GetItem<SvxHorJustifyItem>(TypedWhichId<SvxHorJustifyItem>) const Line | Count | Source | 169 | 3.42M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: SvxWeightItem const& ScPatternAttr::GetItem<SvxWeightItem>(TypedWhichId<SvxWeightItem>) const Unexecuted instantiation: SvxPostureItem const& ScPatternAttr::GetItem<SvxPostureItem>(TypedWhichId<SvxPostureItem>) const Unexecuted instantiation: SvxUnderlineItem const& ScPatternAttr::GetItem<SvxUnderlineItem>(TypedWhichId<SvxUnderlineItem>) const SfxUInt32Item const& ScPatternAttr::GetItem<SfxUInt32Item>(TypedWhichId<SfxUInt32Item>) const Line | Count | Source | 169 | 668 | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: SfxStringItem const& ScPatternAttr::GetItem<SfxStringItem>(TypedWhichId<SfxStringItem>) const SvxBrushItem const& ScPatternAttr::GetItem<SvxBrushItem>(TypedWhichId<SvxBrushItem>) const Line | Count | Source | 169 | 8 | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: ScProtectionAttr const& ScPatternAttr::GetItem<ScProtectionAttr>(TypedWhichId<ScProtectionAttr>) const SvxFontHeightItem const& ScPatternAttr::GetItem<SvxFontHeightItem>(TypedWhichId<SvxFontHeightItem>) const Line | Count | Source | 169 | 50.4k | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
SvxMarginItem const& ScPatternAttr::GetItem<SvxMarginItem>(TypedWhichId<SvxMarginItem>) const Line | Count | Source | 169 | 3.53M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
ScIndentItem const& ScPatternAttr::GetItem<ScIndentItem>(TypedWhichId<ScIndentItem>) const Line | Count | Source | 169 | 2.45k | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: ScVerticalStackCell const& ScPatternAttr::GetItem<ScVerticalStackCell>(TypedWhichId<ScVerticalStackCell>) const Unexecuted instantiation: SfxBoolItem const& ScPatternAttr::GetItem<SfxBoolItem>(TypedWhichId<SfxBoolItem>) const SvxBoxItem const& ScPatternAttr::GetItem<SvxBoxItem>(TypedWhichId<SvxBoxItem>) const Line | Count | Source | 169 | 7.96k | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: SvxBoxInfoItem const& ScPatternAttr::GetItem<SvxBoxInfoItem>(TypedWhichId<SvxBoxInfoItem>) const Unexecuted instantiation: SvxColorItem const& ScPatternAttr::GetItem<SvxColorItem>(TypedWhichId<SvxColorItem>) const ScLineBreakCell const& ScPatternAttr::GetItem<ScLineBreakCell>(TypedWhichId<ScLineBreakCell>) const Line | Count | Source | 169 | 3.54M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: SvxOverlineItem const& ScPatternAttr::GetItem<SvxOverlineItem>(TypedWhichId<SvxOverlineItem>) const Unexecuted instantiation: SvxWordLineModeItem const& ScPatternAttr::GetItem<SvxWordLineModeItem>(TypedWhichId<SvxWordLineModeItem>) const Unexecuted instantiation: SvxCrossedOutItem const& ScPatternAttr::GetItem<SvxCrossedOutItem>(TypedWhichId<SvxCrossedOutItem>) const Unexecuted instantiation: SvxContourItem const& ScPatternAttr::GetItem<SvxContourItem>(TypedWhichId<SvxContourItem>) const Unexecuted instantiation: SvxShadowedItem const& ScPatternAttr::GetItem<SvxShadowedItem>(TypedWhichId<SvxShadowedItem>) const Unexecuted instantiation: SvxJustifyMethodItem const& ScPatternAttr::GetItem<SvxJustifyMethodItem>(TypedWhichId<SvxJustifyMethodItem>) const ScRotateValueItem const& ScPatternAttr::GetItem<ScRotateValueItem>(TypedWhichId<ScRotateValueItem>) const Line | Count | Source | 169 | 3.41M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: SvxForbiddenRuleItem const& ScPatternAttr::GetItem<SvxForbiddenRuleItem>(TypedWhichId<SvxForbiddenRuleItem>) const SvxEmphasisMarkItem const& ScPatternAttr::GetItem<SvxEmphasisMarkItem>(TypedWhichId<SvxEmphasisMarkItem>) const Line | Count | Source | 169 | 3.46M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: SvxCharReliefItem const& ScPatternAttr::GetItem<SvxCharReliefItem>(TypedWhichId<SvxCharReliefItem>) const SvxLanguageItem const& ScPatternAttr::GetItem<SvxLanguageItem>(TypedWhichId<SvxLanguageItem>) const Line | Count | Source | 169 | 51.8k | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
SvxShadowItem const& ScPatternAttr::GetItem<SvxShadowItem>(TypedWhichId<SvxShadowItem>) const Line | Count | Source | 169 | 154k | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
SvxRotateModeItem const& ScPatternAttr::GetItem<SvxRotateModeItem>(TypedWhichId<SvxRotateModeItem>) const Line | Count | Source | 169 | 18 | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich))); } |
Unexecuted instantiation: SvxLineItem const& ScPatternAttr::GetItem<SvxLineItem>(TypedWhichId<SvxLineItem>) const Unexecuted instantiation: ScHyphenateCell const& ScPatternAttr::GetItem<ScHyphenateCell>(TypedWhichId<ScHyphenateCell>) const |
170 | | static const SfxPoolItem& GetItem(sal_uInt16 nWhich, const SfxItemSet& rItemSet, const SfxItemSet* pCondSet); |
171 | | template<class T> static const T& GetItem(TypedWhichId<T> nWhich, const SfxItemSet& rItemSet, const SfxItemSet* pCondSet) |
172 | 7.09M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich), rItemSet, pCondSet)); }ScVerticalStackCell const& ScPatternAttr::GetItem<ScVerticalStackCell>(TypedWhichId<ScVerticalStackCell>, SfxItemSet const&, SfxItemSet const*) Line | Count | Source | 172 | 3.54M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich), rItemSet, pCondSet)); } |
ScRotateValueItem const& ScPatternAttr::GetItem<ScRotateValueItem>(TypedWhichId<ScRotateValueItem>, SfxItemSet const&, SfxItemSet const*) Line | Count | Source | 172 | 3.54M | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich), rItemSet, pCondSet)); } |
|
173 | | SC_DLLPUBLIC const SfxPoolItem& GetItem( sal_uInt16 nWhich, const SfxItemSet* pCondSet ) const; |
174 | | template<class T> const T& GetItem(TypedWhichId<T> nWhich, const SfxItemSet* pCondSet) const |
175 | 346 | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich), pCondSet)); }Unexecuted instantiation: ScMergeFlagAttr const& ScPatternAttr::GetItem<ScMergeFlagAttr>(TypedWhichId<ScMergeFlagAttr>, SfxItemSet const*) const Unexecuted instantiation: ScMergeAttr const& ScPatternAttr::GetItem<ScMergeAttr>(TypedWhichId<ScMergeAttr>, SfxItemSet const*) const Unexecuted instantiation: SvxUnderlineItem const& ScPatternAttr::GetItem<SvxUnderlineItem>(TypedWhichId<SvxUnderlineItem>, SfxItemSet const*) const Unexecuted instantiation: SvxCrossedOutItem const& ScPatternAttr::GetItem<SvxCrossedOutItem>(TypedWhichId<SvxCrossedOutItem>, SfxItemSet const*) const Unexecuted instantiation: SvxColorItem const& ScPatternAttr::GetItem<SvxColorItem>(TypedWhichId<SvxColorItem>, SfxItemSet const*) const SvxHorJustifyItem const& ScPatternAttr::GetItem<SvxHorJustifyItem>(TypedWhichId<SvxHorJustifyItem>, SfxItemSet const*) const Line | Count | Source | 175 | 283 | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich), pCondSet)); } |
Unexecuted instantiation: SvxVerJustifyItem const& ScPatternAttr::GetItem<SvxVerJustifyItem>(TypedWhichId<SvxVerJustifyItem>, SfxItemSet const*) const Unexecuted instantiation: SvxBrushItem const& ScPatternAttr::GetItem<SvxBrushItem>(TypedWhichId<SvxBrushItem>, SfxItemSet const*) const Unexecuted instantiation: ScRotateValueItem const& ScPatternAttr::GetItem<ScRotateValueItem>(TypedWhichId<ScRotateValueItem>, SfxItemSet const*) const Unexecuted instantiation: SvxRotateModeItem const& ScPatternAttr::GetItem<SvxRotateModeItem>(TypedWhichId<SvxRotateModeItem>, SfxItemSet const*) const Unexecuted instantiation: ScLineBreakCell const& ScPatternAttr::GetItem<ScLineBreakCell>(TypedWhichId<ScLineBreakCell>, SfxItemSet const*) const Unexecuted instantiation: SvxOverlineItem const& ScPatternAttr::GetItem<SvxOverlineItem>(TypedWhichId<SvxOverlineItem>, SfxItemSet const*) const Unexecuted instantiation: SvxMarginItem const& ScPatternAttr::GetItem<SvxMarginItem>(TypedWhichId<SvxMarginItem>, SfxItemSet const*) const Unexecuted instantiation: ScIndentItem const& ScPatternAttr::GetItem<ScIndentItem>(TypedWhichId<ScIndentItem>, SfxItemSet const*) const Unexecuted instantiation: ScShrinkToFitCell const& ScPatternAttr::GetItem<ScShrinkToFitCell>(TypedWhichId<ScShrinkToFitCell>, SfxItemSet const*) const Unexecuted instantiation: ScProtectionAttr const& ScPatternAttr::GetItem<ScProtectionAttr>(TypedWhichId<ScProtectionAttr>, SfxItemSet const*) const SfxBoolItem const& ScPatternAttr::GetItem<SfxBoolItem>(TypedWhichId<SfxBoolItem>, SfxItemSet const*) const Line | Count | Source | 175 | 63 | { return static_cast<const T&>(GetItem(sal_uInt16(nWhich), pCondSet)); } |
Unexecuted instantiation: SvxBoxItem const& ScPatternAttr::GetItem<SvxBoxItem>(TypedWhichId<SvxBoxItem>, SfxItemSet const*) const Unexecuted instantiation: SvxLineItem const& ScPatternAttr::GetItem<SvxLineItem>(TypedWhichId<SvxLineItem>, SfxItemSet const*) const |
176 | | |
177 | | /// @param pWhich are no ranges, but single IDs, 0-terminated |
178 | | bool HasItemsSet( const sal_uInt16* pWhich ) const; |
179 | | void ClearItems( const sal_uInt16* pWhich ); |
180 | | void DeleteUnchanged( const ScPatternAttr* pOldAttrs ); |
181 | | |
182 | | static SvxCellOrientation GetCellOrientation( const SfxItemSet& rItemSet, const SfxItemSet* pCondSet ); |
183 | | SvxCellOrientation GetCellOrientation( const SfxItemSet* pCondSet = nullptr ) const; |
184 | | |
185 | | /** Static helper function to fill a font object from the passed item set. */ |
186 | | SC_DLLPUBLIC static void fillFontOnly(vcl::Font& rFont, const SfxItemSet& rItemSet, |
187 | | const OutputDevice* pOutDev = nullptr, |
188 | | const Fraction* pScale = nullptr, |
189 | | const SfxItemSet* pCondSet = nullptr, |
190 | | const SfxItemSet* pTableSet = nullptr, |
191 | | SvtScriptType nScript = SvtScriptType::NONE); |
192 | | |
193 | | static void fillFont( vcl::Font& rFont, const SfxItemSet& rItemSet, |
194 | | ScAutoFontColorMode eAutoMode, |
195 | | const OutputDevice* pOutDev = nullptr, |
196 | | const Fraction* pScale = nullptr, |
197 | | const SfxItemSet* pCondSet = nullptr, |
198 | | const SfxItemSet* pTableSet = nullptr, |
199 | | SvtScriptType nScript = SvtScriptType::NONE, const Color* pBackConfigColor = nullptr, |
200 | | const Color* pTextConfigColor = nullptr); |
201 | | |
202 | | SC_DLLPUBLIC static void fillColor(model::ComplexColor& rComplexColor, |
203 | | const SfxItemSet& rItemSet, |
204 | | ScAutoFontColorMode eAutoMode, |
205 | | const SfxItemSet* pCondSet = nullptr, |
206 | | const SfxItemSet* pTableSet = nullptr, |
207 | | const Color* pBackConfigColor = nullptr, |
208 | | const Color* pTextConfigColor = nullptr); |
209 | | |
210 | | |
211 | | SC_DLLPUBLIC static ScDxfFont GetDxfFont(const SfxItemSet& rSet, SvtScriptType nScript); |
212 | | |
213 | | void fillColor(model::ComplexColor& rComplexColor, |
214 | | ScAutoFontColorMode eAutoMode, |
215 | | const SfxItemSet* pCondSet = nullptr, |
216 | | const SfxItemSet* pTableSet = nullptr, |
217 | | const Color* pBackConfigColor = nullptr, |
218 | | const Color* pTextConfigColor = nullptr) const |
219 | 0 | { |
220 | 0 | fillColor(rComplexColor, maLocalSfxItemSet, eAutoMode, pCondSet, pTableSet, pBackConfigColor, pTextConfigColor); |
221 | 0 | } |
222 | | |
223 | | void fillFontOnly(vcl::Font& rFont, |
224 | | const OutputDevice* pOutDev = nullptr, |
225 | | const Fraction* pScale = nullptr, |
226 | | const SfxItemSet* pCondSet = nullptr, |
227 | | const SfxItemSet* pTableSet = nullptr, |
228 | | SvtScriptType nScript = SvtScriptType::NONE) const |
229 | 71.9k | { |
230 | 71.9k | fillFontOnly(rFont, maLocalSfxItemSet, pOutDev, pScale, pCondSet, pTableSet, nScript); |
231 | 71.9k | } |
232 | | |
233 | | /** Fills a font object from the own item set. */ |
234 | | void fillFont(vcl::Font& rFont, ScAutoFontColorMode eAutoMode, |
235 | | const OutputDevice* pOutDev = nullptr, |
236 | | const Fraction* pScale = nullptr, |
237 | | const SfxItemSet* pCondSet = nullptr, |
238 | | const SfxItemSet* pTableSet = nullptr, |
239 | | SvtScriptType nScript = SvtScriptType::NONE, |
240 | | const Color* pBackConfigColor = nullptr, |
241 | | const Color* pTextConfigColor = nullptr) const |
242 | 0 | { |
243 | 0 | fillFont(rFont, maLocalSfxItemSet, eAutoMode, pOutDev, pScale, pCondSet, pTableSet, nScript, pBackConfigColor, pTextConfigColor); |
244 | 0 | } |
245 | | |
246 | | /** Converts all Calc items contained in rSrcSet to edit engine items and puts them into rEditSet. */ |
247 | | SC_DLLPUBLIC static void FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& rSrcSet, const SfxItemSet* pCondSet = nullptr, const SfxItemSet* pTableSet = nullptr ); |
248 | | /** Converts all Calc items contained in the own item set to edit engine items and puts them into pEditSet. */ |
249 | | SC_DLLPUBLIC void FillEditItemSet( SfxItemSet* pEditSet, const SfxItemSet* pCondSet = nullptr, const SfxItemSet* pTableSet = nullptr ) const; |
250 | | |
251 | | /** Converts all edit engine items contained in rEditSet to Calc items and puts them into rDestSet. */ |
252 | | SC_DLLPUBLIC static void GetFromEditItemSet( SfxItemSet& rDestSet, const SfxItemSet& rEditSet ); |
253 | | /** Converts all edit engine items contained in pEditSet to Calc items and puts them into the own item set. */ |
254 | | SC_DLLPUBLIC void GetFromEditItemSet( const SfxItemSet* pEditSet ); |
255 | | |
256 | | void FillEditParaItems( SfxItemSet* pSet ) const; |
257 | | |
258 | | CellAttributeHolder MigrateToDocument( ScDocument* pDestDoc, ScDocument* pSrcDoc ) const; |
259 | | |
260 | | SC_DLLPUBLIC void SetStyleSheet(ScStyleSheet* pNewStyle, bool bClearDirectFormat = true); |
261 | 923k | const ScStyleSheet* GetStyleSheet() const { return pStyle; } |
262 | | SC_DLLPUBLIC const OUString* GetStyleName() const; |
263 | | bool UpdateStyleSheet(const ScDocument& rDoc); |
264 | | void StyleToName(); |
265 | | |
266 | | bool IsVisible() const; |
267 | | bool IsVisibleEqual( const ScPatternAttr& rOther ) const; |
268 | | |
269 | | /** If font is an old symbol font StarBats/StarMath |
270 | | with text encoding RTL_TEXTENC_SYMBOL */ |
271 | | bool IsSymbolFont() const; |
272 | | |
273 | | bool HasValidNumberFormat() const; // Returns false e.g. for multiformat selection |
274 | | SC_DLLPUBLIC sal_uInt32 GetNumberFormat( SvNumberFormatter* ) const; |
275 | | sal_uInt32 GetNumberFormat( const ScInterpreterContext& rContext ) const; |
276 | | sal_uInt32 GetNumberFormat( SvNumberFormatter* pFormatter, |
277 | | const SfxItemSet* pCondSet ) const; |
278 | | SC_DLLPUBLIC sal_uInt32 GetNumberFormat( const ScInterpreterContext& rContext, |
279 | | const SfxItemSet* pCondSet ) const; |
280 | | |
281 | | Degree100 GetRotateVal( const SfxItemSet* pCondSet ) const; |
282 | | ScRotateDir GetRotateDir( const SfxItemSet* pCondSet ) const; |
283 | | |
284 | | void SetPAKey(sal_uInt64 nKey); |
285 | | sal_uInt64 GetPAKey() const; |
286 | | |
287 | | private: |
288 | | bool CalcVisible() const; |
289 | | sal_uInt32 GetNumberFormatKey() const; |
290 | | LanguageType GetLanguageType() const; |
291 | | void InvalidateCaches(); |
292 | | void InvalidateCacheFor(sal_uInt16 nWhich); |
293 | | void CalcHashCode() const; |
294 | | }; |
295 | | |
296 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |