Coverage Report

Created: 2026-03-31 11:00

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