LibreOffice Module sd (master) 1
fupage.cxx
Go to the documentation of this file.
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#include <fupage.hxx>
21
22// arrange Tab-Page
23
24#include <sfx2/sfxdlg.hxx>
25#include <svx/pageitem.hxx>
26#include <svx/svxids.hrc>
27#include <svl/itempool.hxx>
28#include <svl/grabbagitem.hxx>
29#include <sfx2/request.hxx>
30#include <vcl/prntypes.hxx>
31#include <vcl/graphicfilter.hxx>
32#include <stlsheet.hxx>
33#include <editeng/eeitem.hxx>
35#include <svx/graphichelper.hxx>
36#include <svx/xfillit0.hxx>
37#include <svx/xbtmpit.hxx>
38#include <svx/xflbstit.hxx>
39#include <svx/xflbmtit.hxx>
40#include <svx/xflgrit.hxx>
41#include <svx/xflhtit.hxx>
42#include <editeng/ulspitem.hxx>
43#include <editeng/lrspitem.hxx>
45#include <editeng/shaditem.hxx>
46#include <editeng/boxitem.hxx>
47#include <editeng/sizeitem.hxx>
48#include <editeng/pbinitem.hxx>
49#include <sfx2/opengrf.hxx>
50#include <sal/log.hxx>
52
53#include <strings.hrc>
54#include <sdpage.hxx>
55#include <View.hxx>
56#include <Window.hxx>
57#include <pres.hxx>
58#include <drawdoc.hxx>
59#include <DrawDocShell.hxx>
60#include <ViewShell.hxx>
61#include <DrawViewShell.hxx>
62#include <app.hrc>
63#include <unchss.hxx>
64#include <undoback.hxx>
65#include <sdabstdlg.hxx>
66#include <sdresid.hxx>
67
68#include <memory>
69
70using namespace com::sun::star;
71
72namespace sd {
73
74// 50 cm 28350
75// adapted from writer
76#define MAXHEIGHT 28350
77#define MAXWIDTH 28350
78
79
80static void mergeItemSetsImpl( SfxItemSet& rTarget, const SfxItemSet& rSource )
81{
82 const WhichRangesContainer& rRanges = rSource.GetRanges();
83 sal_uInt16 p1, p2;
84 for (sal_Int32 i = 0; i < rRanges.size(); ++i)
85 {
86 p1 = rRanges[i].first;
87 p2 = rRanges[i].second;
88
89 // make ranges discrete
90 while(i < rRanges.size()-1 && (rRanges[i+1].first - p2 == 1))
91 {
92 p2 = rRanges[i+1].second;
93 ++i;
94 }
95 rTarget.MergeRange( p1, p2 );
96 }
97
98 rTarget.Put(rSource);
99}
100
102 SdDrawDocument* pDoc, SfxRequest& rReq )
103: FuPoor(pViewSh, pWin, pView, pDoc, rReq),
104 mrReq(rReq),
105 mpArgs( rReq.GetArgs() ),
106 mbPageBckgrdDeleted( false ),
107 mbMasterPage( false ),
108 mbDisplayBackgroundTabPage( true ),
109 mpPage(nullptr),
110 mpDrawViewShell(nullptr)
111{
112}
113
115{
116 rtl::Reference<FuPoor> xFunc( new FuPage( pViewSh, pWin, pView, pDoc, rReq ) );
117 xFunc->DoExecute(rReq);
118 return xFunc;
119}
120
122{
123 mpDrawViewShell = dynamic_cast<DrawViewShell*>(mpViewShell);
124 DBG_ASSERT( mpDrawViewShell, "sd::FuPage::FuPage(), called without a current DrawViewShell!" );
125
126 if( mpDrawViewShell )
127 {
129 // we don't really want to format page background with SID_ATTR_PAGE[_SIZE] slots
131 ( nSlotId != SID_ATTR_PAGE_SIZE) && ( nSlotId != SID_ATTR_PAGE );
133 }
134
135 if( !mpPage )
136 return;
137
138 // if there are no arguments given, open the dialog
139 if (!mpArgs || mpArgs->GetItemState(SID_SELECT_BACKGROUND) == SfxItemState::SET)
140 {
142 mpArgs = ExecuteDialog(mpWindow ? mpWindow->GetFrameWeld() : nullptr, rReq);
143 }
144
145 // if we now have arguments, apply them to current page
146 if( mpArgs )
147 {
149 }
150}
151
153{
154}
155
157{
158}
159
161{
162}
163
164void MergePageBackgroundFilling(SdPage *pPage, SdStyleSheet *pStyleSheet, bool bMasterPage, SfxItemSet& rMergedAttr)
165{
166 if (bMasterPage)
167 {
168 if (pStyleSheet)
169 mergeItemSetsImpl(rMergedAttr, pStyleSheet->GetItemSet());
170 }
171 else
172 {
173 // Only this page, get attributes for background fill
174 const SfxItemSet& rBackgroundAttributes = pPage->getSdrPageProperties().GetItemSet();
175
176 if(drawing::FillStyle_NONE != rBackgroundAttributes.Get(XATTR_FILLSTYLE).GetValue())
177 {
178 // page attributes are used, take them
179 rMergedAttr.Put(rBackgroundAttributes);
180 }
181 else
182 {
183 if(pStyleSheet
184 && drawing::FillStyle_NONE != pStyleSheet->GetItemSet().Get(XATTR_FILLSTYLE).GetValue())
185 {
186 // if the page has no fill style, use the settings from the
187 // background stylesheet (if used)
188 mergeItemSetsImpl(rMergedAttr, pStyleSheet->GetItemSet());
189 }
190 else
191 {
192 // no fill style from page, start with no fill style
193 rMergedAttr.Put(XFillStyleItem(drawing::FillStyle_NONE));
194 }
195 }
196 }
197}
198
200{
201 if (!mpDrawViewShell)
202 return nullptr;
203
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
212 > aNewAttr(mpDoc->GetPool());
213 // Keep it sorted
214 aNewAttr.MergeRange(mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
215 mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE));
216
217 // Retrieve additional data for dialog
218
219 SvxShadowItem aShadowItem(SID_ATTR_BORDER_SHADOW);
220 aNewAttr.Put( aShadowItem );
221 SvxBoxItem aBoxItem( SID_ATTR_BORDER_OUTER );
222 aNewAttr.Put( aBoxItem );
223
224 aNewAttr.Put( SvxFrameDirectionItem(
225 mpDoc->GetDefaultWritingMode() == css::text::WritingMode_RL_TB ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB,
227
228 // Retrieve page-data for dialog
229
230 SvxPageItem aPageItem( SID_ATTR_PAGE );
231 aPageItem.SetDescName( mpPage->GetName() );
232 aPageItem.SetPageUsage( SvxPageUsage::All );
233 aPageItem.SetLandscape( mpPage->GetOrientation() == Orientation::Landscape );
234 aPageItem.SetNumType( mpDoc->GetPageNumType() );
235 aNewAttr.Put( aPageItem );
236
237 // size
238 maSize = mpPage->GetSize();
239 SvxSizeItem aSizeItem( SID_ATTR_PAGE_SIZE, maSize );
240 aNewAttr.Put( aSizeItem );
241
242 // Max size
243 SvxSizeItem aMaxSizeItem( SID_ATTR_PAGE_MAXSIZE, Size( MAXWIDTH, MAXHEIGHT ) );
244 aNewAttr.Put( aMaxSizeItem );
245
246 // paperbin
247 SvxPaperBinItem aPaperBinItem( SID_ATTR_PAGE_PAPERBIN, static_cast<sal_uInt8>(mpPage->GetPaperBin()) );
248 aNewAttr.Put( aPaperBinItem );
249
250 SvxLRSpaceItem aLRSpaceItem( static_cast<sal_uInt16>(mpPage->GetLeftBorder()), static_cast<sal_uInt16>(mpPage->GetRightBorder()), 0, mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE));
251 aNewAttr.Put( aLRSpaceItem );
252
253 SvxULSpaceItem aULSpaceItem( static_cast<sal_uInt16>(mpPage->GetUpperBorder()), static_cast<sal_uInt16>(mpPage->GetLowerBorder()), mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE));
254 aNewAttr.Put( aULSpaceItem );
255
256 // Application
257 bool bScale = mpDoc->GetDocumentType() != DocumentType::Draw;
258 aNewAttr.Put( SfxBoolItem( SID_ATTR_PAGE_EXT1, bScale ) );
259
260 bool bFullSize = mpPage->IsMasterPage() ?
261 mpPage->IsBackgroundFullSize() : static_cast<SdPage&>(mpPage->TRG_GetMasterPage()).IsBackgroundFullSize();
262
263 SfxGrabBagItem grabBag(SID_ATTR_CHAR_GRABBAG);
264 grabBag.GetGrabBag()["BackgroundFullSize"] <<= bFullSize;
265
267 {
268 // A master slide may have a theme.
269 auto const& pTheme = mpPage->getSdrPageProperties().GetTheme();
270 if (pTheme)
271 {
272 uno::Any aTheme;
273 pTheme->ToAny(aTheme);
274 grabBag.GetGrabBag()["Theme"] = aTheme;
275 }
276 }
277
278 aNewAttr.Put(grabBag);
279
280 // Merge ItemSet for dialog
281
282 const WhichRangesContainer& rRanges = aNewAttr.GetRanges();
283 sal_uInt16 p1 = rRanges[0].first, p2 = rRanges[0].second;
284 sal_Int32 idx = 1;
285 while(idx < rRanges.size() && (rRanges[idx].first - p2 == 1))
286 {
287 p2 = rRanges[idx].second;
288 ++idx;
289 }
290 SfxItemSet aMergedAttr( *aNewAttr.GetPool(), p1, p2 );
291
292 mergeItemSetsImpl( aMergedAttr, aNewAttr );
293
294 SdStyleSheet* pStyleSheet = mpPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND);
295
296 // merge page background filling to the dialogs input set
298 {
299 MergePageBackgroundFilling(mpPage, pStyleSheet, mbMasterPage, aMergedAttr);
300 }
301
302 std::optional< SfxItemSet > pTempSet;
303
304 const sal_uInt16 nId = GetSlotID();
305 if (nId == SID_SAVE_BACKGROUND)
306 {
307 const XFillStyleItem& rStyleItem = aMergedAttr.Get(XATTR_FILLSTYLE);
308 if (drawing::FillStyle_BITMAP == rStyleItem.GetValue())
309 {
310 const XFillBitmapItem& rBitmap = aMergedAttr.Get(XATTR_FILLBITMAP);
311 const GraphicObject& rGraphicObj = rBitmap.GetGraphicObject();
312 GraphicHelper::ExportGraphic(pParent, rGraphicObj.GetGraphic(), "");
313 }
314 }
315 else if (nId == SID_SELECT_BACKGROUND)
316 {
317 Graphic aGraphic;
319
320 const SfxItemSet* pArgs = rReq.GetArgs();
321 const SfxPoolItem* pItem;
322
323 if (pArgs && pArgs->GetItemState(SID_SELECT_BACKGROUND, true, &pItem) == SfxItemState::SET)
324 {
325 OUString aFileName(static_cast<const SfxStringItem*>(pItem)->GetValue());
326 OUString aFilterName;
327
328 if (const SfxStringItem* pFilterItem = pArgs->GetItemIfSet(FN_PARAM_FILTER))
329 aFilterName = pFilterItem->GetValue();
330
331 nError = GraphicFilter::LoadGraphic(aFileName, aFilterName, aGraphic,
333 }
334 else
335 {
336 SvxOpenGraphicDialog aDlg(SdResId(STR_SET_BACKGROUND_PICTURE), pParent);
337
338 nError = aDlg.Execute();
339 if (nError == ERRCODE_NONE)
340 {
341 nError = aDlg.GetGraphic(aGraphic);
342 }
343 }
344
345 if (nError == ERRCODE_NONE)
346 {
347 pTempSet.emplace( mpDoc->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST> );
348
349 pTempSet->Put( XFillStyleItem( drawing::FillStyle_BITMAP ) );
350
351 // MigrateItemSet makes sure the XFillBitmapItem will have a unique name
353 aMigrateSet.Put(XFillBitmapItem("background", std::move(aGraphic)));
354 SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, mpDoc );
355
356 pTempSet->Put( XFillBmpStretchItem( true ));
357 pTempSet->Put( XFillBmpTileItem( false ));
358 }
359 }
360
361 else
362 {
363 bool bIsImpressDoc = mpDrawViewShell->GetDoc()->GetDocumentType() == DocumentType::Impress;
364
365 // create the dialog
368 if( pDlg->Execute() == RET_OK )
369 pTempSet.emplace( *pDlg->GetOutputItemSet() );
370 }
371
372 if (pTempSet && pStyleSheet)
373 {
374 pStyleSheet->AdjustToFontHeight(*pTempSet);
375
377 {
378 // if some fillstyle-items are not set in the dialog, then
379 // try to use the items before
380 bool bChanges = false;
381 for( sal_uInt16 i=XATTR_FILL_FIRST; i<XATTR_FILL_LAST; i++ )
382 {
383 if( aMergedAttr.GetItemState( i ) != SfxItemState::DEFAULT )
384 {
385 if( pTempSet->GetItemState( i ) == SfxItemState::DEFAULT )
386 pTempSet->Put( aMergedAttr.Get( i ) );
387 else
388 if( aMergedAttr.GetItem( i ) != pTempSet->GetItem( i ) )
389 bChanges = true;
390 }
391 }
392
393 // if the background for this page was set to invisible, the background-object has to be deleted, too.
394 const XFillStyleItem* pTempFillStyleItem = pTempSet->GetItem<XFillStyleItem>(XATTR_FILLSTYLE);
395 assert(pTempFillStyleItem);
396 if (pTempFillStyleItem->GetValue() == drawing::FillStyle_NONE)
397 mbPageBckgrdDeleted = true;
398 else
399 {
400 if (pTempSet->GetItemState(XATTR_FILLSTYLE) == SfxItemState::DEFAULT)
401 {
402 const XFillStyleItem* pMergedFillStyleItem = aMergedAttr.GetItem<XFillStyleItem>(XATTR_FILLSTYLE);
403 assert(pMergedFillStyleItem);
404 if (pMergedFillStyleItem->GetValue() == drawing::FillStyle_NONE)
405 mbPageBckgrdDeleted = true;
406 }
407 }
408
409 const XFillGradientItem* pTempGradItem = pTempSet->GetItem<XFillGradientItem>(XATTR_FILLGRADIENT);
410 if (pTempGradItem && pTempGradItem->GetName().isEmpty())
411 {
412 // MigrateItemSet guarantees unique gradient names
414 aMigrateSet.Put( XFillGradientItem("gradient", pTempGradItem->GetGradientValue()) );
415 SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, mpDoc);
416 }
417
418 const XFillHatchItem* pTempHatchItem = pTempSet->GetItem<XFillHatchItem>(XATTR_FILLHATCH);
419 if (pTempHatchItem && pTempHatchItem->GetName().isEmpty())
420 {
421 // MigrateItemSet guarantees unique hatch names
423 aMigrateSet.Put( XFillHatchItem("hatch", pTempHatchItem->GetHatchValue()) );
424 SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, mpDoc);
425 }
426
427 if( !mbMasterPage && bChanges && mbPageBckgrdDeleted )
428 {
431
432 if(!mpPage->IsMasterPage())
433 {
434 // on normal pages, switch off fill attribute usage
435 SdrPageProperties& rPageProperties = mpPage->getSdrPageProperties();
436 rPageProperties.ClearItem( XATTR_FILLBITMAP );
437 rPageProperties.ClearItem( XATTR_FILLGRADIENT );
438 rPageProperties.ClearItem( XATTR_FILLHATCH );
439 rPageProperties.PutItem(XFillStyleItem(drawing::FillStyle_NONE));
440 }
441 }
442
443
444 /* Special treatment: reset the INVALIDS to
445 NULL-Pointer (otherwise INVALIDs or pointer point
446 to DefaultItems in the template; both would
447 prevent the attribute inheritance) */
448 pTempSet->ClearInvalidItems();
449
450 if( mbMasterPage )
451 {
452 mpDocSh->GetUndoManager()->AddUndoAction(std::make_unique<StyleSheetUndoAction>(
453 mpDoc, static_cast<SfxStyleSheet*>(pStyleSheet), &(*pTempSet)));
454 pStyleSheet->GetItemSet().Put( *pTempSet );
456 pStyleSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
457 }
458
459 // if background filling is set to master pages then clear from page set
460 if( mbMasterPage )
461 {
462 for( sal_uInt16 nWhich = XATTR_FILL_FIRST; nWhich <= XATTR_FILL_LAST; nWhich++ )
463 {
464 pTempSet->ClearItem( nWhich );
465 }
466 pTempSet->Put(XFillStyleItem(drawing::FillStyle_NONE));
467 }
468
469 if( const SvxFrameDirectionItem* pItem = pTempSet->GetItemIfSet( EE_PARA_WRITINGDIR, false ) )
470 {
471 SvxFrameDirection nVal = pItem->GetValue();
472 mpDoc->SetDefaultWritingMode( nVal == SvxFrameDirection::Horizontal_RL_TB ? css::text::WritingMode_RL_TB : css::text::WritingMode_LR_TB );
473 }
474
475 mpDoc->SetChanged();
476
477 // BackgroundFill of Masterpage: no hard attributes allowed
478 SdrPage& rUsedMasterPage = mpPage->IsMasterPage() ? *mpPage : mpPage->TRG_GetMasterPage();
479 OSL_ENSURE(rUsedMasterPage.IsMasterPage(), "No MasterPage (!)");
480 rUsedMasterPage.getSdrPageProperties().ClearItem();
481 OSL_ENSURE(nullptr != rUsedMasterPage.getSdrPageProperties().GetStyleSheet(),
482 "MasterPage without StyleSheet detected (!)");
483 }
484
485 aNewAttr.Put(*pTempSet);
486 mrReq.Done( aNewAttr );
487
488 return mrReq.GetArgs();
489 }
490 else
491 {
492 return nullptr;
493 }
494}
495
497{
498 if (!pArgs || !mpDrawViewShell)
499 return;
500
501 // Set new page-attributes
502 PageKind ePageKind = mpDrawViewShell->GetPageKind();
503 const SfxPoolItem* pPoolItem;
504 bool bSetPageSizeAndBorder = false;
505 Size aNewSize(maSize);
506 sal_Int32 nLeft = -1, nRight = -1, nUpper = -1, nLower = -1;
507 bool bScaleAll = true;
508 Orientation eOrientation = mpPage->GetOrientation();
509 SdPage* pMasterPage = mpPage->IsMasterPage() ? mpPage : &static_cast<SdPage&>(mpPage->TRG_GetMasterPage());
510 bool bFullSize = pMasterPage->IsBackgroundFullSize();
511 sal_uInt16 nPaperBin = mpPage->GetPaperBin();
512
513 if( pArgs->GetItemState(SID_ATTR_PAGE, true, &pPoolItem) == SfxItemState::SET )
514 {
515 mpDoc->SetPageNumType(static_cast<const SvxPageItem*>(pPoolItem)->GetNumType());
516
517 eOrientation = static_cast<const SvxPageItem*>(pPoolItem)->IsLandscape() ?
518 Orientation::Landscape : Orientation::Portrait;
519
520 if( mpPage->GetOrientation() != eOrientation )
521 bSetPageSizeAndBorder = true;
522
524 }
525
526 if( pArgs->GetItemState(SID_ATTR_PAGE_SIZE, true, &pPoolItem) == SfxItemState::SET )
527 {
528 aNewSize = static_cast<const SvxSizeItem*>(pPoolItem)->GetSize();
529
530 if( mpPage->GetSize() != aNewSize )
531 bSetPageSizeAndBorder = true;
532 }
533
534 if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
535 true, &pPoolItem) == SfxItemState::SET )
536 {
537 nLeft = static_cast<const SvxLRSpaceItem*>(pPoolItem)->GetLeft();
538 nRight = static_cast<const SvxLRSpaceItem*>(pPoolItem)->GetRight();
539
540 if( mpPage->GetLeftBorder() != nLeft || mpPage->GetRightBorder() != nRight )
541 bSetPageSizeAndBorder = true;
542
543 }
544
545 if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE),
546 true, &pPoolItem) == SfxItemState::SET )
547 {
548 nUpper = static_cast<const SvxULSpaceItem*>(pPoolItem)->GetUpper();
549 nLower = static_cast<const SvxULSpaceItem*>(pPoolItem)->GetLower();
550
551 if( mpPage->GetUpperBorder() != nUpper || mpPage->GetLowerBorder() != nLower )
552 bSetPageSizeAndBorder = true;
553 }
554
555 if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_PAGE_EXT1), true, &pPoolItem) == SfxItemState::SET )
556 {
557 bScaleAll = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
558 }
559
560 if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_CHAR_GRABBAG, true, &pPoolItem))
561 {
562 SfxGrabBagItem const*const pGrabBag(static_cast<SfxGrabBagItem const*>(pPoolItem));
563 if (pGrabBag->GetGrabBag().find("BackgroundFullSize")->second >>= bFullSize)
564 {
565 if (pMasterPage->IsBackgroundFullSize() != bFullSize)
566 {
567 bSetPageSizeAndBorder = true;
568 }
569 }
570
572 {
573 // The item set may have a theme.
574 auto it = pGrabBag->GetGrabBag().find("Theme");
575 if (it != pGrabBag->GetGrabBag().end())
576 {
577 std::shared_ptr<model::Theme> pTheme = model::Theme::FromAny(it->second);
578 pMasterPage->getSdrPageProperties().SetTheme(pTheme);
579 }
580 else
581 {
582 SAL_WARN("sd.ui", "FuPage::ApplyItemSet: got no theme");
583 }
584 }
585 }
586
587 // Paper Bin
588 if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_PAGE_PAPERBIN), true, &pPoolItem) == SfxItemState::SET )
589 {
590 nPaperBin = static_cast<const SvxPaperBinItem*>(pPoolItem)->GetValue();
591
592 if( mpPage->GetPaperBin() != nPaperBin )
593 bSetPageSizeAndBorder = true;
594 }
595
596 if (nLeft == -1 && nUpper != -1)
597 {
598 bSetPageSizeAndBorder = true;
599 nLeft = mpPage->GetLeftBorder();
600 nRight = mpPage->GetRightBorder();
601 }
602 else if (nLeft != -1 && nUpper == -1)
603 {
604 bSetPageSizeAndBorder = true;
605 nUpper = mpPage->GetUpperBorder();
606 nLower = mpPage->GetLowerBorder();
607 }
608
609 if( bSetPageSizeAndBorder || !mbMasterPage )
610 mpDrawViewShell->SetPageSizeAndBorder(ePageKind, aNewSize, nLeft, nRight, nUpper, nLower, bScaleAll, eOrientation, nPaperBin, bFullSize );
611
612 // if bMasterPage==sal_False then create a background-object for this page with the
613 // properties set in the dialog before, but if mbPageBckgrdDeleted==sal_True then
614 // the background of this page was set to invisible, so it would be a mistake
615 // to create a new background-object for this page !
616
618 {
620 {
621 // Only this page
624 SfxItemSet aSet( *pArgs );
628 }
629 }
630
631 // add undo action for background object
633 {
634 // set merge flag, because a SdUndoGroupAction could have been inserted before
636 }
637
638 // Objects can not be bigger than ViewSize
639 Size aPageSize = mpDoc->GetSdPage(0, ePageKind)->GetSize();
640 Size aViewSize(aPageSize.Width() * 3, aPageSize.Height() * 2);
641 mpDoc->SetMaxObjSize(aViewSize);
642
643 // if necessary, we tell Preview the new context
645}
646
647} // end of namespace sd
648
649/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FPDF_PAGE mpPage
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()
Definition: sdabstdlg.cxx:38
SAL_DLLPRIVATE SfxItemPool & GetPool()
Definition: drawdoc.hxx:237
SAL_DLLPRIVATE void SetPageNumType(SvxNumType eType)
Definition: drawdoc.hxx:248
SdPage * GetSdPage(sal_uInt16 nPgNum, PageKind ePgKind) const
Definition: drawdoc2.cxx:207
SAL_DLLPRIVATE void SetDefaultWritingMode(css::text::WritingMode eMode)
Definition: drawdoc4.cxx:1206
css::text::WritingMode GetDefaultWritingMode() const
Definition: drawdoc4.cxx:1184
virtual SAL_DLLPRIVATE void SetChanged(bool bFlag=true) override
Definition: drawdoc.cxx:658
SAL_DLLPRIVATE SvxNumType GetPageNumType() const override
Definition: drawdoc.cxx:1029
SAL_DLLPRIVATE DocumentType GetDocumentType() const
Definition: drawdoc.hxx:251
virtual Orientation GetOrientation() const override
Definition: sdpage.cxx:2562
SdStyleSheet * getPresentationStyle(sal_uInt32 nHelpId) const
returns the presentation style with the given helpid from this masterpage or this slides masterpage
Definition: sdpage.cxx:674
const OUString & GetName() const
Definition: sdpage.cxx:2505
sal_uInt16 GetPaperBin() const
Definition: sdpage.hxx:278
virtual SfxItemSet & GetItemSet() override
create if necessary and return ItemSets
Definition: stlsheet.cxx:207
void AdjustToFontHeight(SfxItemSet &rSet, bool bOnlyMissingItems=true)
Adjust the bullet width and the left text indent of the provided ItemSets to their font height.
Definition: stlsheet.cxx:541
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
Size GetSize() 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
Definition: docshell.cxx:363
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
Definition: drviews1.cxx:636
EditMode GetEditMode() const
virtual SdPage * GetActualPage() override
void ResetActualPage()
Select new refreshed page, in case of a page order change (eg.
Definition: drviews1.cxx:661
PageKind GetPageKind() const
Size maSize
Definition: fupage.hxx:63
const SfxItemSet * ExecuteDialog(weld::Window *pParent, const SfxRequest &rReq)
Definition: fupage.cxx:199
void ApplyItemSet(const SfxItemSet *pArgs)
Definition: fupage.cxx:496
virtual void DoExecute(SfxRequest &rReq) override
Definition: fupage.cxx:121
bool mbMasterPage
Definition: fupage.hxx:65
bool mbDisplayBackgroundTabPage
Definition: fupage.hxx:66
DrawViewShell * mpDrawViewShell
Definition: fupage.hxx:68
SfxRequest & mrReq
Definition: fupage.hxx:59
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fupage.cxx:114
FuPage(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fupage.cxx:101
virtual ~FuPage() override
Definition: fupage.cxx:152
SdPage * mpPage
Definition: fupage.hxx:67
virtual void Deactivate() override
deactivates the function
Definition: fupage.cxx:160
bool mbPageBckgrdDeleted
Definition: fupage.hxx:64
const SfxItemSet * mpArgs
Definition: fupage.hxx:60
std::unique_ptr< SdBackgroundObjUndoAction > mpBackgroundObjUndoAction
Definition: fupage.hxx:62
virtual void Activate() override
activates the function
Definition: fupage.cxx:156
Base class for all functions.
Definition: fupoor.hxx:48
SdDrawDocument * mpDoc
Definition: fupoor.hxx:148
sal_uInt16 GetSlotID() const
Definition: fupoor.hxx:86
VclPtr< ::sd::Window > mpWindow
Definition: fupoor.hxx:146
ViewShell * mpViewShell
Definition: fupoor.hxx:145
sal_uInt16 nSlotId
Definition: fupoor.hxx:150
DrawDocShell * mpDocSh
Definition: fupoor.hxx:147
::sd::View * mpView
Definition: fupoor.hxx:144
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
virtual void UpdatePreview(SdPage *pPage)
This method is still used by the OutlineViewShell to update the model according to the content of the...
Definition: viewshel.cxx:1087
SdDrawDocument * GetDoc() const
Definition: viewshel.cxx:1412
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)
Definition: viewshe2.cxx:450
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
Definition: viewshel.cxx:1582
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
Definition: sdview.cxx:772
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
#define DBG_ASSERT(sCon, aError)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
#define ERRCODE_NONE
FilterGroup & rTarget
SvxFrameDirection
#define MAXWIDTH
Definition: fupage.cxx:77
#define MAXHEIGHT
Definition: fupage.cxx:76
#define ERRCODE_GRFILTER_OPENERROR
const sal_uInt16 idx[]
#define SAL_WARN(area, stream)
int i
static void mergeItemSetsImpl(SfxItemSet &rTarget, const SfxItemSet &rSource)
Definition: fupage.cxx:80
void MergePageBackgroundFilling(SdPage *pPage, SdStyleSheet *pStyleSheet, bool bMasterPage, SfxItemSet &rMergedAttr)
Merge the background properties together and deposit the result in rMergeAttr.
Definition: fupage.cxx:164
void CleanupFillProperties(SfxItemSet &rItemSet)
sal_Int16 nId
const char GetValue[]
PageKind
Definition: pres.hxx:45
Orientation
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83
sal_Int32 size() const noexcept
unsigned char sal_uInt8
RET_OK
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)