28#include <editeng/editeng.hxx>
40#include <osl/diagnose.h>
47#include <document.hxx>
50#include <stlsheet.hxx>
57 pActualStyleSheet( nullptr ),
59 bHasStandardStyles( false )
83 OSL_FAIL(
"renaming additional default style");
85 for ( sal_uInt32 nAdd = 1; nAdd <=
nCount; nAdd++ )
87 OUString aNewName =
ScResId(STR_STYLENAME_STANDARD) + OUString::number( nAdd );
88 if (
Find( aNewName, eFam ) ==
nullptr )
104 if ( eFamily != SfxStyleFamily::Page &&
ScResId(STR_STYLENAME_STANDARD) != rName )
105 pSheet->SetParent(
ScResId(STR_STYLENAME_STANDARD) );
112 OSL_ENSURE( rStyle.
isScStyleSheet(),
"Invalid StyleSheet-class! :-/" );
120 OSL_ENSURE( SfxStyleSearchBits::UserDefined & pStyle->
GetMask(),
121 "SfxStyleSearchBits::UserDefined not set!" );
140 pDestSheet = &
Make( rName, eFamily );
142 rDestSet.
PutExtended( rSourceSet, SfxItemState::DONTCARE, SfxItemState::DEFAULT );
144 if ( eFamily == SfxStyleFamily::Page )
150 const SfxItemSet& rSrcSub = pSetItem->GetItemSet();
152 aDestSub.
PutExtended( rSrcSub, SfxItemState::DONTCARE, SfxItemState::DEFAULT );
156 const SfxItemSet& rSrcSub = pSetItem->GetItemSet();
158 aDestSub.
PutExtended( rSrcSub, SfxItemState::DONTCARE, SfxItemState::DEFAULT );
174 sal_uInt32 nNewFormat = it->second;
199 if ( aNewItem !=
rSet.
Get( nItemId ) )
214 const OUString aHelpFile;
219 std::unique_ptr<EditTextObject> pEmptyTxtObj = aEdEngine.
CreateTextObject();
220 std::unique_ptr<EditTextObject> pTxtObj;
228 OUString aStrStandard =
ScResId(STR_STYLENAME_STANDARD);
234 pSheet =
static_cast<ScStyleSheet*
>( &
Make( aStrStandard, SfxStyleFamily::Para, SfxStyleSearchBits::ScStandard ) );
235 pSheet->
SetHelpId( aHelpFile, HID_SC_SHEET_CELL_STD );
251 eLatin = eUiLanguage;
268 SfxStyleFamily::Page,
269 SfxStyleSearchBits::ScStandard ) );
272 pSheet->
SetHelpId( aHelpFile, HID_SC_SHEET_PAGE_STD );
277 pSet->
Put( aHFSetItem );
279 pSet->
Put( aHFSetItem );
290 pSet->
Put( aHeaderItem );
297 nStrLen =
aStr.getLength();
303 pSet->
Put( aFooterItem );
308 SfxStyleFamily::Page,
309 SfxStyleSearchBits::ScStandard ) );
311 pSheet->
SetHelpId( aHelpFile, HID_SC_SHEET_PAGE_REP );
314 aBoxItem.
SetLine( &aBorderLine, SvxBoxItemLine::TOP );
315 aBoxItem.
SetLine( &aBorderLine, SvxBoxItemLine::BOTTOM );
316 aBoxItem.
SetLine( &aBorderLine, SvxBoxItemLine::LEFT );
317 aBoxItem.
SetLine( &aBorderLine, SvxBoxItemLine::RIGHT );
319 aBoxInfoItem.
SetValid( SvxBoxInfoItemValidFlags::TOP );
320 aBoxInfoItem.
SetValid( SvxBoxInfoItemValidFlags::BOTTOM );
321 aBoxInfoItem.
SetValid( SvxBoxInfoItemValidFlags::LEFT );
322 aBoxInfoItem.
SetValid( SvxBoxInfoItemValidFlags::RIGHT );
323 aBoxInfoItem.
SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
328 pHFSet = &(aHFSetItem2.GetItemSet());
331 pHFSet->
Put( aBoxItem );
332 pHFSet->
Put( aBoxInfoItem );
334 pSet->
Put( aHFSetItem2 );
336 pSet->
Put( aHFSetItem2 );
355 pSet->
Put( aHeaderItem );
361 nStrLen =
aStr.getLength();
363 sal_Int32 nStrLen2 =
aStr.getLength();
371 pSet->
Put( aFooterItem );
380 CaseInsensitiveNamePredicate(
const OUString& rName,
SfxStyleFamily eFam)
391 if (mUppercaseName == aUpName)
399 OUString mUppercaseName;
408 CaseInsensitiveNamePredicate aPredicate(rName, eFam);
412 for (
const auto& rPos : aFoundPositions)
418 if (pFound->
GetName() == rName)
431 if (
auto pFound =
Find(
ScResId(STR_STYLENAME_STANDARD), SfxStyleFamily::Para))
432 if (pFound->isScStyleSheet())
442 pSheet->
SetMask(SfxStyleSearchBits::ScStandard);
const LanguageTag & GetUILanguageTag() const
static const AllSettings & GetSettings()
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
sal_uInt32 GetValue() const
std::unique_ptr< EditTextObject > CreateTextObject()
bool SetUpdateLayout(bool bUpdate, bool bRestoring=false)
void QuickInsertField(const SvxFieldItem &rFld, const ESelection &rSel)
static rtl::Reference< SfxItemPool > CreatePool()
LanguageType getLanguageType(bool bResolveSystem=true) const
static bool isKorean(LanguageType nLang)
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
SC_DLLPUBLIC void GetLanguage(LanguageType &rLatin, LanguageType &rCjk, LanguageType &rCtl) const
SvNumberFormatterIndexTable * GetFormatExchangeList() const
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
static SC_DLLPUBLIC const CharClass & getCharClass()
void SetLeftArea(const EditTextObject &rNew)
void SetCenterArea(const EditTextObject &rNew)
void SetRightArea(const EditTextObject &rNew)
static SC_DLLPUBLIC OUString ProgrammaticToDisplayName(const OUString &rProgName, SfxStyleFamily nType)
ScStyleSheetPool(const SfxItemPool &rPool, ScDocument *pDocument)
virtual ~ScStyleSheetPool() override
void SetDocument(ScDocument *pDocument)
ScStyleSheet * FindCaseIns(const OUString &rName, SfxStyleFamily eFam)
ScStyleSheet * FindAutoStyle(const OUString &rName)
void CopyStdStylesFrom(ScStyleSheetPool *pSrcPool)
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All) override
void setAllParaStandard()
virtual rtl::Reference< SfxStyleSheetBase > Create(const OUString &rName, SfxStyleFamily eFamily, SfxStyleSearchBits nMask) override
void CreateStandardStyles()
virtual void Remove(SfxStyleSheetBase *pStyle) override
void CopyStyleFrom(ScStyleSheetPool *pSrcPool, const OUString &rName, SfxStyleFamily eFamily)
virtual SC_DLLPUBLIC SfxItemSet & GetItemSet() override
const WhichRangesContainer & GetRanges() const
SfxItemPool * GetPool() const
void PutExtended(const SfxItemSet &, SfxItemState eDontCareAs, SfxItemState eDefaultAs)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All) const
SfxStyleSheetBase * GetStyleSheetByPositionInIndex(unsigned pos)
virtual void Remove(SfxStyleSheetBase *)
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
SfxStyleSheetBase * Next()
const svl::IndexedStyleSheets & GetIndexedStyleSheets() const
SfxStyleSearchBits GetMask() const
const OUString & GetName() const
SfxStyleFamily GetFamily() const
virtual void SetHelpId(const OUString &r, sal_uLong nId)
virtual SfxItemSet & GetItemSet()
virtual bool isScStyleSheet() const
void SetMask(SfxStyleSearchBits mask)
static const sal_Int16 Medium
void SetValid(SvxBoxInfoItemValidFlags nValid, bool bValid=true)
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
void SetAllDistances(sal_Int16 nNew)
sal_Int32 GetNumberOfStyleSheets() const
std::vector< sal_Int32 > FindPositionsByPredicate(StyleSheetPredicate &predicate) const
FontFamily GetFamilyType()
const OUString & GetStyleName() const
const OUString & GetFamilyName() const
rtl_TextEncoding GetCharSet() const
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr OUStringLiteral STRING_STANDARD
#define LANGUAGE_DONTKNOW
constexpr OUStringLiteral first
PyRef getCharClass(const Runtime &)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
OUString ScResId(TranslateId aId)
constexpr TypedWhichId< SvxFontItem > ATTR_CJK_FONT(111)
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_HEADERSET(184)
constexpr TypedWhichId< SvxFontItem > ATTR_CTL_FONT(116)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_FOOTERRIGHT(181)
constexpr TypedWhichId< ScPageHFItem > ATTR_PAGE_HEADERRIGHT(180)
constexpr TypedWhichId< SvxBrushItem > ATTR_BACKGROUND(148)
constexpr TypedWhichId< SvxBoxInfoItem > ATTR_BORDER_INNER(151)
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
constexpr TypedWhichId< SvxSetItem > ATTR_PAGE_FOOTERSET(185)
static void lcl_CheckFont(SfxItemSet &rSet, LanguageType eLang, DefaultFontType nFontType, sal_uInt16 nItemId)
virtual bool Check(const SfxStyleSheetBase &styleSheet)=0