20#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
21#include <com/sun/star/beans/XPropertySet.hpp>
22#include <com/sun/star/container/XNameAccess.hpp>
23#include <com/sun/star/frame/XModel.hpp>
27#include <svx/svxids.hrc>
51#include <stlsheet.hxx>
83 :
FuPoor( pViewSh, pWin, pView, pDoc, rReq )
90 xFunc->DoExecute(rReq);
97 sal_uInt16 nSId = rReq.
GetSlot();
105 if( pArgs && SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_FAMILY,
108 nFamily =
static_cast<SfxStyleFamily>( pArgs->
Get( SID_STYLE_FAMILY ).GetValue());
110 else if( pArgs && SfxItemState::SET == pArgs->
GetItemState( SID_STYLE_FAMILYNAME,
113 OUString sFamily = pArgs->
Get( SID_STYLE_FAMILYNAME ).GetValue();
114 if (sFamily ==
"graphics")
115 nFamily = SfxStyleFamily::Para;
117 nFamily = SfxStyleFamily::Pseudo;
121 sal_uInt16 nRetMask =
static_cast<sal_uInt16
>(SfxStyleSearchBits::All);
125 case SID_STYLE_APPLY:
127 case SID_STYLE_DELETE:
130 case SID_STYLE_FAMILY:
131 case SID_STYLE_NEW_BY_EXAMPLE:
135 if ( pFamilyItem && pNameItem )
145 xInfo->getPropertyValue(
"DisplayName" ) >>=
aUIName;
154 if (pArgs && pArgs->
GetItemState(nSId) == SfxItemState::SET)
169 pStyleSheet = &pSSPool->
Make( aStyleName, nFamily, SfxStyleSearchBits::UserDefined );
171 if (pArgs && pArgs->
GetItemState(SID_STYLE_REFERENCE) == SfxItemState::SET)
173 OUString aParentName( pArgs->
Get(SID_STYLE_REFERENCE).GetValue());
183 case SID_STYLE_NEW_BY_EXAMPLE:
192 pStyleSheet = &pSSPool->
Make( aStyleName, nFamily, SfxStyleSearchBits::UserDefined );
198 pStyleSheet = pSSPool->
Find( aStyleName, nFamily);
201 case SID_STYLE_DELETE:
202 pStyleSheet = pSSPool->
Find( aStyleName, nFamily);
205 pSSPool->
Remove( pStyleSheet );
206 nRetMask = sal_uInt16(
true);
211 nRetMask = sal_uInt16(
false);
217 pStyleSheet = pSSPool->
Find( aStyleName, nFamily);
218 pStyleSheet->
SetHidden( nSId == SID_STYLE_HIDE );
219 nRetMask = sal_uInt16(
true);
222 case SID_STYLE_APPLY:
224 pStyleSheet = pSSPool->
Find( aStyleName, nFamily);
227 if ( pStyleSheet && pStyleSheet->
GetFamily() != SfxStyleFamily::Pseudo )
239 (pStyleSheet->
GetFamily() == SfxStyleFamily::Para && pOldStyleSheet->
GetHelpId(
aStr ) == HID_PSEUDOSHEET_BACKGROUNDOBJECTS) ||
251 case SID_STYLE_WATERCAN:
253 if( !
SD_MOD()->GetWaterCan() )
255 if (pArgs && pArgs->
GetItemState( nSId ) == SfxItemState::SET)
258 SD_MOD()->SetWaterCan(
true );
259 pStyleSheet = pSSPool->
Find( aStyleName, nFamily);
262 if( pStyleSheet && pStyleSheet->
GetFamily() != SfxStyleFamily::Pseudo )
264 static_cast<SdStyleSheetPool*
>( pSSPool )->SetActualStyleSheet( pStyleSheet );
268 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
272 SD_MOD()->SetWaterCan(
false );
276 SD_MOD()->SetWaterCan(
false );
302 if (eFamily == SfxStyleFamily::Para)
306 else if (eFamily == SfxStyleFamily::Pseudo)
309 bool bBackground =
false;
310 bool bOldDocInOtherLanguage =
false;
321 SdResId(STR_PSEUDOSHEET_BACKGROUND))
327 SdResId(STR_PSEUDOSHEET_BACKGROUNDOBJECTS))
332 SdResId(STR_PSEUDOSHEET_NOTES))
336 else if(
aName.indexOf(
SdResId(STR_PSEUDOSHEET_OUTLINE)) != -1)
338 OUString aOutlineStr(
SdResId(STR_PSEUDOSHEET_OUTLINE));
340 std::u16string_view aNumStr(
aName.subView(aOutlineStr.getLength() + 1));
341 sal_uInt16 nLevel =
static_cast<sal_uInt16
>(
o3tl::toInt32(aNumStr));
357 OSL_FAIL(
"StyleSheet from older version with different language");
358 bOldDocInOtherLanguage =
true;
361 if( !bOldDocInOtherLanguage )
371 nResult = pStdDlg->Execute();
372 pOutSet = pStdDlg->GetOutputItemSet();
376 nResult = pPresDlg->Execute();
377 pOutSet = pPresDlg->GetOutputItemSet();
384 nRetMask =
static_cast<sal_uInt16
>(pStyleSheet->
GetMask());
386 if (eFamily == SfxStyleFamily::Pseudo)
396 aTempSet.
Put( aBackColorItem );
398 static_cast<SdStyleSheet*
>(pStyleSheet)->AdjustToFontHeight(aTempSet);
413 OUString sStyleName(
SdResId(STR_PSEUDOSHEET_OUTLINE) +
" 1");
420 pRealSheet->Broadcast(
SfxHint(SfxHintId::DataChanged));
439 std::unique_ptr<SfxPoolItem> pNewItem =
static_cast<const XFillBitmapItem*
>(pOldItem)->checkForUniqueItem(
mpDoc );
442 rAttr.
Put( std::move(pNewItem) );
448 std::unique_ptr<SfxPoolItem> pNewItem =
static_cast<const XLineDashItem*
>(pOldItem)->checkForUniqueItem(
mpDoc );
451 rAttr.
Put( std::move(pNewItem) );
457 std::unique_ptr<SfxPoolItem> pNewItem =
static_cast<const XLineStartItem*
>(pOldItem)->checkForUniqueItem(
mpDoc );
460 rAttr.
Put( std::move(pNewItem) );
466 std::unique_ptr<SfxPoolItem> pNewItem =
static_cast<const XLineEndItem*
>(pOldItem)->checkForUniqueItem(
mpDoc );
469 rAttr.
Put( std::move(pNewItem) );
475 std::unique_ptr<SfxPoolItem> pNewItem =
static_cast<const XFillGradientItem*
>(pOldItem)->checkForUniqueItem(
mpDoc );
478 rAttr.
Put( std::move(pNewItem) );
487 rAttr.
Put( std::move(pNewItem) );
493 std::unique_ptr<SfxPoolItem> pNewItem =
static_cast<const XFillHatchItem*
>(pOldItem)->checkForUniqueItem(
mpDoc );
496 rAttr.
Put( std::move(pNewItem) );
521 if(
dynamic_cast< const SdrPageObj *
>( pObj ) !=
nullptr )
549 if( nSId == SID_STYLE_NEW )
550 pSSPool->
Remove( pStyleSheet );
558 case SID_STYLE_NEW_BY_EXAMPLE:
562 nRetMask =
static_cast<sal_uInt16
>(pStyleSheet->
GetMask());
570 if( pOldStyle != pStyleSheet )
578 pStyleSet->
Put(aCoreSet);
597 case SID_STYLE_UPDATE_BY_EXAMPLE:
606 nRetMask =
static_cast<sal_uInt16
>(pStyleSheet->
GetMask());
611 pStyleSet->
Put( aCoreSet );
624 if( nRetMask !=
static_cast<sal_uInt16
>(SfxStyleSearchBits::All) )
const OUString & GetValue() const
void disposeAndReset(reference_type *pBody)
virtual VclPtr< SfxAbstractTabDialog > CreateSdTabTemplateDlg(weld::Window *pParent, const SfxObjectShell *pDocShell, SfxStyleSheetBase &rStyleBase, SdrModel *pModel, SdrView *pView)=0
virtual VclPtr< SfxAbstractTabDialog > CreateSdPresLayoutTemplateDlg(SfxObjectShell *pDocSh, weld::Window *pParent, bool bBackgroundDlg, SfxStyleSheetBase &rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool *pSSPool)=0
static SD_DLLPUBLIC SdAbstractDialogFactory * Create()
SAL_DLLPRIVATE void StopOnlineSpelling()
SAL_DLLPRIVATE SfxItemPool & GetPool()
SAL_DLLPRIVATE bool GetOnlineSpell() const
SAL_DLLPRIVATE void StartOnlineSpelling(bool bForceSpelling=true)
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
SAL_DLLPRIVATE DocumentType GetDocumentType() const
static void BroadcastSdStyleSheetChange(SfxStyleSheetBase const *pStyleSheet, PresentationObjects ePO, SfxStyleSheetBasePool *pSSPool)
size_t GetMarkCount() const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
SdrTextObj * GetTextEditObject() const
void ActionChanged() const
SdrPage & TRG_GetMasterPage() const
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
void AppendItem(const SfxPoolItem &)
void SetReturnValue(const SfxPoolItem &)
virtual void Invalidate(sal_uInt16 nId=0)
virtual void Remove(SfxStyleSheetBase *)
virtual SfxStyleSheetBase & Make(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
SfxStyleSearchBits GetMask() const
const OUString & GetName() const
SfxStyleFamily GetFamily() const
virtual void SetHidden(bool bValue)
virtual sal_uLong GetHelpId(OUString &rFile)
virtual bool SetParent(const OUString &)
virtual SfxItemSet & GetItemSet()
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
const Color & GetColor() const
const SvxNumRule & GetNumRule() const
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
EditMode GetEditMode() const
PageKind GetPageKind() const
Base class for all functions.
virtual void Deactivate() override
deactivates the function
virtual void DoExecute(SfxRequest &rReq) override
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
FuTemplate(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
virtual void Activate() override
activates the function
Derivative of sd::View for the outline mode |* .
Base class of the stacked shell hierarchy.
virtual SdPage * GetActualPage()=0
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
virtual bool SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr=false)
virtual void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
virtual SfxStyleSheet * GetStyleSheet() const
An SdWindow contains the actual working area of ViewShell.
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_BKGCOLOR(EE_CHAR_START+32)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
constexpr TypedWhichId< SvxNumBulletItem > EE_PARA_NUMBULLET(EE_PARA_START+5)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
void CleanupFillProperties(SfxItemSet &rItemSet)
OUString SdResId(TranslateId aId)
Reference< XModel > xModel
constexpr TypedWhichId< XLineDashItem > XATTR_LINEDASH(XATTR_LINE_FIRST+1)
constexpr TypedWhichId< XLineEndItem > XATTR_LINEEND(XATTR_LINE_FIRST+5)
constexpr TypedWhichId< XLineStartItem > XATTR_LINESTART(XATTR_LINE_FIRST+4)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)