26#include <svx/svxids.hrc>
32#include <stlsheet.hxx>
76#define MAXHEIGHT 28350
84 for (sal_Int32
i = 0;
i < rRanges.
size(); ++
i)
86 p1 = rRanges[
i].first;
87 p2 = rRanges[
i].second;
90 while(
i < rRanges.
size()-1 && (rRanges[
i+1].first - p2 == 1))
92 p2 = rRanges[
i+1].second;
103:
FuPoor(pViewSh, pWin, pView, pDoc, rReq),
105 mpArgs( rReq.GetArgs() ),
106 mbPageBckgrdDeleted( false ),
107 mbMasterPage( false ),
108 mbDisplayBackgroundTabPage( true ),
110 mpDrawViewShell(nullptr)
117 xFunc->DoExecute(rReq);
179 rMergedAttr.
Put(rBackgroundAttributes);
207 SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER,
208 SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW,
209 SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED,
210 SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG,
211 SID_ATTR_PAGE_COLOR, SID_ATTR_PAGE_FILLSTYLE
220 aNewAttr.Put( aShadowItem );
222 aNewAttr.Put( aBoxItem );
225 mpDoc->
GetDefaultWritingMode() == css::text::WritingMode_RL_TB ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB,
235 aNewAttr.Put( aPageItem );
240 aNewAttr.Put( aSizeItem );
244 aNewAttr.Put( aMaxSizeItem );
248 aNewAttr.Put( aPaperBinItem );
251 aNewAttr.Put( aLRSpaceItem );
254 aNewAttr.Put( aULSpaceItem );
258 aNewAttr.Put(
SfxBoolItem( SID_ATTR_PAGE_EXT1, bScale ) );
264 grabBag.
GetGrabBag()[
"BackgroundFullSize"] <<= bFullSize;
273 pTheme->ToAny(aTheme);
278 aNewAttr.Put(grabBag);
283 sal_uInt16 p1 = rRanges[0].first, p2 = rRanges[0].second;
285 while(
idx < rRanges.
size() && (rRanges[
idx].first - p2 == 1))
287 p2 = rRanges[
idx].second;
290 SfxItemSet aMergedAttr( *aNewAttr.GetPool(), p1, p2 );
302 std::optional< SfxItemSet > pTempSet;
305 if (
nId == SID_SAVE_BACKGROUND)
308 if (drawing::FillStyle_BITMAP == rStyleItem.GetValue())
315 else if (
nId == SID_SELECT_BACKGROUND)
323 if (pArgs && pArgs->
GetItemState(SID_SELECT_BACKGROUND,
true, &pItem) == SfxItemState::SET)
326 OUString aFilterName;
329 aFilterName = pFilterItem->GetValue();
347 pTempSet.emplace(
mpDoc->
GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST> );
368 if( pDlg->Execute() ==
RET_OK )
369 pTempSet.emplace( *pDlg->GetOutputItemSet() );
372 if (pTempSet && pStyleSheet)
380 bool bChanges =
false;
385 if( pTempSet->GetItemState(
i ) == SfxItemState::DEFAULT )
386 pTempSet->Put( aMergedAttr.
Get(
i ) );
388 if( aMergedAttr.
GetItem(
i ) != pTempSet->GetItem(
i ) )
395 assert(pTempFillStyleItem);
396 if (pTempFillStyleItem->GetValue() == drawing::FillStyle_NONE)
403 assert(pMergedFillStyleItem);
404 if (pMergedFillStyleItem->GetValue() == drawing::FillStyle_NONE)
410 if (pTempGradItem && pTempGradItem->
GetName().isEmpty())
419 if (pTempHatchItem && pTempHatchItem->
GetName().isEmpty())
448 pTempSet->ClearInvalidItems();
456 pStyleSheet->Broadcast(
SfxHint(SfxHintId::DataChanged));
464 pTempSet->ClearItem( nWhich );
472 mpDoc->
SetDefaultWritingMode( nVal == SvxFrameDirection::Horizontal_RL_TB ? css::text::WritingMode_RL_TB : css::text::WritingMode_LR_TB );
479 OSL_ENSURE(rUsedMasterPage.
IsMasterPage(),
"No MasterPage (!)");
482 "MasterPage without StyleSheet detected (!)");
485 aNewAttr.Put(*pTempSet);
504 bool bSetPageSizeAndBorder =
false;
506 sal_Int32 nLeft = -1, nRight = -1, nUpper = -1, nLower = -1;
507 bool bScaleAll =
true;
513 if( pArgs->
GetItemState(SID_ATTR_PAGE,
true, &pPoolItem) == SfxItemState::SET )
517 eOrientation =
static_cast<const SvxPageItem*
>(pPoolItem)->IsLandscape() ?
518 Orientation::Landscape : Orientation::Portrait;
521 bSetPageSizeAndBorder =
true;
526 if( pArgs->
GetItemState(SID_ATTR_PAGE_SIZE,
true, &pPoolItem) == SfxItemState::SET )
528 aNewSize =
static_cast<const SvxSizeItem*
>(pPoolItem)->GetSize();
531 bSetPageSizeAndBorder =
true;
535 true, &pPoolItem) == SfxItemState::SET )
538 nRight =
static_cast<const SvxLRSpaceItem*
>(pPoolItem)->GetRight();
541 bSetPageSizeAndBorder =
true;
546 true, &pPoolItem) == SfxItemState::SET )
548 nUpper =
static_cast<const SvxULSpaceItem*
>(pPoolItem)->GetUpper();
549 nLower =
static_cast<const SvxULSpaceItem*
>(pPoolItem)->GetLower();
552 bSetPageSizeAndBorder =
true;
560 if (SfxItemState::SET == pArgs->
GetItemState(SID_ATTR_CHAR_GRABBAG,
true, &pPoolItem))
563 if (pGrabBag->
GetGrabBag().find(
"BackgroundFullSize")->second >>= bFullSize)
567 bSetPageSizeAndBorder =
true;
574 auto it = pGrabBag->
GetGrabBag().find(
"Theme");
582 SAL_WARN(
"sd.ui",
"FuPage::ApplyItemSet: got no theme");
593 bSetPageSizeAndBorder =
true;
596 if (nLeft == -1 && nUpper != -1)
598 bSetPageSizeAndBorder =
true;
602 else if (nLeft != -1 && nUpper == -1)
604 bSetPageSizeAndBorder =
true;
static GraphicFilter & GetGraphicFilter()
static ErrCode LoadGraphic(const OUString &rPath, const OUString &rFilter, Graphic &rGraphic, GraphicFilter *pFilter=nullptr, sal_uInt16 *pDeterminedFormat=nullptr)
static OUString ExportGraphic(weld::Window *pWin, const Graphic &rGraphic, const OUString &rGraphicName)
const Graphic & GetGraphic() const
OUString const & GetName() const
virtual VclPtr< SfxAbstractTabDialog > CreateSdTabPageDialog(weld::Window *pWindow, const SfxItemSet *pAttr, SfxObjectShell *pDocShell, bool bAreaPage, bool bIsImpressDoc, bool bIsImpressMaster)=0
static SD_DLLPUBLIC SdAbstractDialogFactory * Create()
SAL_DLLPRIVATE SfxItemPool & GetPool()
SAL_DLLPRIVATE void SetPageNumType(SvxNumType eType)
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
SAL_DLLPRIVATE void SetDefaultWritingMode(css::text::WritingMode eMode)
css::text::WritingMode GetDefaultWritingMode() const
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
SAL_DLLPRIVATE SvxNumType GetPageNumType() const override
SAL_DLLPRIVATE DocumentType GetDocumentType() const
virtual Orientation GetOrientation() const override
SdStyleSheet * getPresentationStyle(sal_uInt32 nHelpId) const
returns the presentation style with the given helpid from this masterpage or this slides masterpage
const OUString & GetName() const
sal_uInt16 GetPaperBin() const
virtual SfxItemSet & GetItemSet() override
create if necessary and return ItemSets
void AdjustToFontHeight(SfxItemSet &rSet, bool bOnlyMissingItems=true)
Adjust the bullet width and the left text indent of the provided ItemSets to their font height.
void SetMaxObjSize(const Size &rSiz)
static void MigrateItemSet(const SfxItemSet *pSourceSet, SfxItemSet *pDestSet, SdrModel *pNewModel)
const SfxItemSet & GetItemSet() const
void PutItemSet(const SfxItemSet &rSet)
void PutItem(const SfxPoolItem &rItem)
std::shared_ptr< model::Theme > const & GetTheme() const
SfxStyleSheet * GetStyleSheet() const
void SetTheme(std::shared_ptr< model::Theme > const &pTheme)
void ClearItem(const sal_uInt16 nWhich=0)
SdrPage & TRG_GetMasterPage() const
bool IsMasterPage() const
sal_Int32 GetUpperBorder() const
sal_Int32 GetRightBorder() const
sal_Int32 GetLeftBorder() const
SdrPageProperties & getSdrPageProperties()
bool IsBackgroundFullSize() const
sal_Int32 GetLowerBorder() const
const std::map< OUString, css::uno::Any > & GetGrabBag() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
const WhichRangesContainer & GetRanges() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
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
const SfxItemSet * GetArgs() const
void Done(bool bRemove=false)
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
ErrCode GetGraphic(Graphic &) const
void SetNumType(SvxNumType eNum)
SvxNumType GetNumType() const
void SetLandscape(bool bL)
void SetPageUsage(SvxPageUsage eU)
void SetDescName(const OUString &rStr)
const GraphicObject & GetGraphicObject() const
const basegfx::BGradient & GetGradientValue() const
const XHatch & GetHatchValue() const
static std::unique_ptr< Theme > FromAny(const css::uno::Any &rVal)
virtual SfxUndoManager * GetUndoManager() override
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
virtual SdPage * getCurrentPage() const override
inherited from sd::ViewShell
EditMode GetEditMode() const
virtual SdPage * GetActualPage() override
void ResetActualPage()
Select new refreshed page, in case of a page order change (eg.
PageKind GetPageKind() const
const SfxItemSet * ExecuteDialog(weld::Window *pParent, const SfxRequest &rReq)
void ApplyItemSet(const SfxItemSet *pArgs)
virtual void DoExecute(SfxRequest &rReq) override
bool mbDisplayBackgroundTabPage
DrawViewShell * mpDrawViewShell
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
FuPage(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
virtual ~FuPage() override
virtual void Deactivate() override
deactivates the function
const SfxItemSet * mpArgs
std::unique_ptr< SdBackgroundObjUndoAction > mpBackgroundObjUndoAction
virtual void Activate() override
activates the function
Base class for all functions.
sal_uInt16 GetSlotID() const
VclPtr< ::sd::Window > mpWindow
Base class of the stacked shell hierarchy.
virtual void UpdatePreview(SdPage *pPage)
This method is still used by the OutlineViewShell to update the model according to the content of the...
SdDrawDocument * GetDoc() const
void SetPageSizeAndBorder(PageKind ePageKind, const Size &rNewSize, ::tools::Long nLeft, ::tools::Long nRight, ::tools::Long nUpper, ::tools::Long nLower, bool bScaleAll, Orientation eOrient, sal_uInt16 nPaperBin, bool bBackgroundFullSize)
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
An SdWindow contains the actual working area of ViewShell.
#define DBG_ASSERT(sCon, aError)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
#define ERRCODE_GRFILTER_OPENERROR
#define SAL_WARN(area, stream)
static void mergeItemSetsImpl(SfxItemSet &rTarget, const SfxItemSet &rSource)
void MergePageBackgroundFilling(SdPage *pPage, SdStyleSheet *pStyleSheet, bool bMasterPage, SfxItemSet &rMergedAttr)
Merge the background properties together and deposit the result in rMergeAttr.
void CleanupFillProperties(SfxItemSet &rItemSet)
OUString SdResId(TranslateId aId)
sal_Int32 size() const noexcept
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)