23#include <osl/diagnose.h>
43 aParent( rOther.aParent )
94 if (
eFamily == SfxStyleFamily::Frame)
95 return ScResId(STR_UNDO_EDITGRAPHICSTYLE);
96 if (
eFamily == SfxStyleFamily::Page)
97 return ScResId(STR_UNDO_EDITPAGESTYLE);
99 return ScResId(STR_UNDO_EDITCELLSTYLE);
108 double nPPTX = aLogic.
X() / 1000.0;
109 double nPPTY = aLogic.
Y() / 1000.0;
123 const OUString& aNewName = rData.
GetName();
124 bool bDelete = aNewName.isEmpty();
125 bool bNew = ( rName.isEmpty() && !bDelete );
128 if ( !rName.isEmpty() )
131 pStyle = pStlPool->
Find( rName, eStyleFamily );
132 OSL_ENSURE( pStyle,
"style not found" );
134 if ( pStyle && !bDelete )
143 pStyle = &pStlPool->
Make( aNewName, eStyleFamily, SfxStyleSearchBits::UserDefined );
145 if ( eStyleFamily == SfxStyleFamily::Para )
153 if ( eStyleFamily == SfxStyleFamily::Para )
155 else if ( eStyleFamily == SfxStyleFamily::Page )
159 pStlPool->
Remove( pStyle );
165 const OUString& aNewParent = rData.
GetParent();
170 const std::optional<SfxItemSet>& pNewSet = rData.
GetItems();
171 OSL_ENSURE( pNewSet,
"no ItemSet for style" );
173 rStyleSet.
Set( *pNewSet,
false );
175 if ( eStyleFamily == SfxStyleFamily::Para )
179 else if ( eStyleFamily == SfxStyleFamily::Page )
183 if ( bNew && aNewName != rName )
229 maOldStyle(
std::move( aOldStyle ))
245 maEntries.emplace_back( nTab, rOldStyle );
250 return ScResId( STR_UNDO_APPLYPAGESTYLE );
constexpr tools::Long Y() const
constexpr tools::Long X() const
const ScDocument & GetDocument() const
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
void PageStyleModified(std::u16string_view rStyleName, bool bApi)
void CellStyleCreated(std::u16string_view rName, const ScDocument &rDoc)
void ModifyStyleSheet(SfxStyleSheetBase &rPageStyle, const SfxItemSet &rChanges)
bool RemovePageStyleInUse(std::u16string_view rStrPageStyle)
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC ScDocumentPool * GetPool()
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
void StyleSheetChanged(const SfxStyleSheetBase *pStyleSheet, bool bRemoved, OutputDevice *pDev, double nPPTX, double nPPTY, const Fraction &rZoomX, const Fraction &rZoomY)
SC_DLLPUBLIC void SetPageStyle(SCTAB nTab, const OUString &rName)
bool RenamePageStyleInUse(std::u16string_view rOld, const OUString &rNew)
ScStyleSaveData & operator=(const ScStyleSaveData &rOther)
const std::optional< SfxItemSet > & GetItems() const
const OUString & GetParent() const
void InitFromStyle(const SfxStyleSheetBase *pSource)
const OUString & GetName() const
std::optional< SfxItemSet > moItems
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All) override
virtual void Remove(SfxStyleSheetBase *pStyle) override
void AddSheetAction(SCTAB nTab, const OUString &rOld)
virtual void Undo() override
ScUndoApplyPageStyle(ScDocShell *pDocSh, OUString aNewStyle)
virtual OUString GetComment() const override
virtual void Redo() override
virtual ~ScUndoApplyPageStyle() override
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
virtual void Repeat(SfxRepeatTarget &rTarget) override
virtual OUString GetComment() const override
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
virtual void Repeat(SfxRepeatTarget &rTarget) override
ScUndoModifyStyle(ScDocShell *pDocSh, SfxStyleFamily eFam, const ScStyleSaveData &rOld, const ScStyleSaveData &rNew)
static void DoChange(ScDocShell *pDocSh, const OUString &rName, SfxStyleFamily eStyleFamily, const ScStyleSaveData &rData)
virtual ~ScUndoModifyStyle() override
virtual void Redo() override
virtual void Undo() override
bool Set(const SfxItemSet &, bool bDeep=true)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual bool SetName(const OUString &rNewName, bool bReindexNow=true)
virtual const OUString & GetParent() const
const OUString & GetName() const
virtual bool SetParent(const OUString &)
virtual SfxItemSet & GetItemSet()
OUString ScResId(TranslateId aId)
ApplyStyleEntry(SCTAB nTab, OUString aOldStyle)
static void lcl_DocStyleChanged(ScDocument *pDoc, const SfxStyleSheetBase *pStyle, bool bRemoved)