Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / cui / source / tabpages / page.cxx
blob99d1fcb67bcdf7428d0757e29cb6b5b59844a986
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <memory>
21 #include <sfx2/objsh.hxx>
22 #include <sfx2/printer.hxx>
23 #include <sfx2/viewsh.hxx>
24 #include <svl/languageoptions.hxx>
25 #include <svtools/unitconv.hxx>
26 #include <vcl/svapp.hxx>
27 #include <vcl/weld.hxx>
28 #include <sfx2/htmlmode.hxx>
29 #include <sal/macros.h>
31 #include <svx/strings.hrc>
32 #include <svx/dialmgr.hxx>
33 #include <page.hxx>
34 #include <svx/pageitem.hxx>
35 #include <editeng/brushitem.hxx>
36 #include <editeng/boxitem.hxx>
37 #include <editeng/shaditem.hxx>
38 #include <editeng/pbinitem.hxx>
39 #include <editeng/lrspitem.hxx>
40 #include <editeng/ulspitem.hxx>
41 #include <editeng/sizeitem.hxx>
42 #include <editeng/frmdiritem.hxx>
43 #include <svx/dlgutil.hxx>
44 #include <editeng/paperinf.hxx>
45 #include <svl/stritem.hxx>
46 #include <editeng/eerdll.hxx>
47 #include <editeng/editrids.hrc>
48 #include <svx/svxids.hrc>
49 #include <svtools/optionsdrawinglayer.hxx>
50 #include <svl/slstitm.hxx>
51 #include <svl/aeitem.hxx>
52 #include <svx/xdef.hxx>
53 #include <svx/unobrushitemhelper.hxx>
54 #include <svx/SvxNumOptionsTabPageHelper.hxx>
56 // static ----------------------------------------------------------------
58 // #i19922# - tdf#126051 see svx/source/dialog/hdft.cxx and sw/source/uibase/sidebar/PageMarginControl.hxx
59 static const long MINBODY = 56; // 1mm in twips rounded
61 const sal_uInt16 SvxPageDescPage::pRanges[] =
63 SID_ATTR_BORDER_OUTER,
64 SID_ATTR_BORDER_SHADOW,
65 SID_ATTR_LRSPACE,
66 SID_ATTR_PAGE_SHARED,
67 SID_SWREGISTER_COLLECTION,
68 SID_SWREGISTER_MODE,
71 // ------- Mapping page layout ------------------------------------------
73 const SvxPageUsage aArr[] =
75 SvxPageUsage::All,
76 SvxPageUsage::Mirror,
77 SvxPageUsage::Right,
78 SvxPageUsage::Left
82 static sal_uInt16 PageUsageToPos_Impl( SvxPageUsage nUsage )
84 for ( size_t i = 0; i < SAL_N_ELEMENTS(aArr); ++i )
85 if ( aArr[i] == nUsage )
86 return i;
87 return 3;
91 static SvxPageUsage PosToPageUsage_Impl( sal_uInt16 nPos )
93 if ( nPos >= SAL_N_ELEMENTS(aArr) )
94 return SvxPageUsage::NONE;
95 return aArr[nPos];
99 static Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBox )
101 Size aSz;
102 aSz.setHeight( rShadow.CalcShadowSpace( SvxShadowItemSide::BOTTOM ) + rBox.CalcLineSpace( SvxBoxItemLine::BOTTOM ) );
103 aSz.AdjustHeight(rShadow.CalcShadowSpace( SvxShadowItemSide::TOP ) + rBox.CalcLineSpace( SvxBoxItemLine::TOP ) );
104 aSz.setWidth( rShadow.CalcShadowSpace( SvxShadowItemSide::LEFT ) + rBox.CalcLineSpace( SvxBoxItemLine::LEFT ) );
105 aSz.AdjustWidth(rShadow.CalcShadowSpace( SvxShadowItemSide::RIGHT ) + rBox.CalcLineSpace( SvxBoxItemLine::RIGHT ) );
106 return aSz;
110 static long ConvertLong_Impl( const long nIn, MapUnit eUnit )
112 return OutputDevice::LogicToLogic( nIn, eUnit, MapUnit::MapTwip );
115 static bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize )
117 if ( pSize )
119 Size aSize = pSize->GetSize();
120 long nDiffW = std::abs( rSize.Width () - aSize.Width () );
121 long nDiffH = std::abs( rSize.Height() - aSize.Height() );
122 return ( nDiffW < 10 && nDiffH < 10 );
124 else
125 return false;
129 #define MARGIN_LEFT ( MarginPosition(0x0001) )
130 #define MARGIN_RIGHT ( MarginPosition(0x0002) )
131 #define MARGIN_TOP ( MarginPosition(0x0004) )
132 #define MARGIN_BOTTOM ( MarginPosition(0x0008) )
134 // class SvxPageDescPage --------------------------------------------------
136 std::unique_ptr<SfxTabPage> SvxPageDescPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet )
138 return std::make_unique<SvxPageDescPage>(pPage, pController, *rSet);
141 SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rAttr)
142 : SfxTabPage(pPage, pController, "cui/ui/pageformatpage.ui", "PageFormatPage", &rAttr)
143 , bLandscape(false)
144 , eMode(SVX_PAGE_MODE_STANDARD)
145 , ePaperStart(PAPER_A3)
146 , m_nPos(0)
147 , mpDefPrinter(nullptr)
148 , mbDelPrinter(false)
149 , mbEnableDrawingLayerFillStyles(false)
150 , m_xPaperSizeBox(new SvxPaperSizeListBox(m_xBuilder->weld_combo_box("comboPageFormat")))
151 , m_xPaperWidthEdit(m_xBuilder->weld_metric_spin_button("spinWidth", FieldUnit::CM))
152 , m_xPaperHeightEdit(m_xBuilder->weld_metric_spin_button("spinHeight", FieldUnit::CM))
153 , m_xOrientationFT(m_xBuilder->weld_label("labelOrientation"))
154 , m_xPortraitBtn(m_xBuilder->weld_radio_button("radiobuttonPortrait"))
155 , m_xLandscapeBtn(m_xBuilder->weld_radio_button("radiobuttonLandscape"))
156 , m_xTextFlowLbl(m_xBuilder->weld_label("labelTextFlow"))
157 , m_xTextFlowBox(new svx::FrameDirectionListBox(m_xBuilder->weld_combo_box("comboTextFlowBox")))
158 , m_xPaperTrayBox(m_xBuilder->weld_combo_box("comboPaperTray"))
159 , m_xLeftMarginLbl(m_xBuilder->weld_label("labelLeftMargin"))
160 , m_xLeftMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargLeft", FieldUnit::CM))
161 , m_xRightMarginLbl(m_xBuilder->weld_label("labelRightMargin"))
162 , m_xRightMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargRight", FieldUnit::CM))
163 , m_xTopMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargTop", FieldUnit::CM))
164 , m_xBottomMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargBot", FieldUnit::CM))
165 , m_xPageText(m_xBuilder->weld_label("labelPageLayout"))
166 , m_xLayoutBox(m_xBuilder->weld_combo_box("comboPageLayout"))
167 , m_xNumberFormatText(m_xBuilder->weld_label("labelPageNumbers"))
168 , m_xNumberFormatBox(new SvxPageNumberListBox(m_xBuilder->weld_combo_box("comboLayoutFormat")))
169 , m_xTblAlignFT(m_xBuilder->weld_label("labelTblAlign"))
170 , m_xHorzBox(m_xBuilder->weld_check_button("checkbuttonHorz"))
171 , m_xVertBox(m_xBuilder->weld_check_button("checkbuttonVert"))
172 , m_xAdaptBox(m_xBuilder->weld_check_button("checkAdaptBox"))
173 , m_xRegisterCB(m_xBuilder->weld_check_button("checkRegisterTrue"))
174 , m_xRegisterFT(m_xBuilder->weld_label("labelRegisterStyle"))
175 , m_xRegisterLB(m_xBuilder->weld_combo_box("comboRegisterStyle"))
176 // Strings stored in UI
177 , m_xInsideLbl(m_xBuilder->weld_label("labelInner"))
178 , m_xOutsideLbl(m_xBuilder->weld_label("labelOuter"))
179 , m_xPrintRangeQueryText(m_xBuilder->weld_label("labelMsg"))
180 , m_xBspWin(new weld::CustomWeld(*m_xBuilder, "drawingareaPageDirection", m_aBspWin))
182 m_xRegisterLB->set_size_request(m_xRegisterLB->get_approximate_digit_width() * 20, -1);
184 bBorderModified = false;
185 m_aBspWin.EnableRTL(false);
187 // this page needs ExchangeSupport
188 SetExchangeSupport();
190 SvtLanguageOptions aLangOptions;
191 bool bCJK = aLangOptions.IsAsianTypographyEnabled();
192 bool bCTL = aLangOptions.IsCTLFontEnabled();
193 bool bWeb = false;
194 const SfxPoolItem* pItem;
196 SfxObjectShell* pShell;
197 if(SfxItemState::SET == rAttr.GetItemState(SID_HTML_MODE, false, &pItem) ||
198 ( nullptr != (pShell = SfxObjectShell::Current()) &&
199 nullptr != (pItem = pShell->GetItem(SID_HTML_MODE))))
200 bWeb = 0 != (static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON);
202 // fill text flow listbox with valid entries
204 m_xTextFlowBox->append(SvxFrameDirection::Horizontal_LR_TB, SvxResId(RID_SVXSTR_PAGEDIR_LTR_HORI));
206 if (bCTL)
207 m_xTextFlowBox->append(SvxFrameDirection::Horizontal_RL_TB, SvxResId(RID_SVXSTR_PAGEDIR_RTL_HORI));
210 // #109989# do not show vertical directions in Writer/Web
211 if( !bWeb && bCJK )
213 m_xTextFlowBox->append(SvxFrameDirection::Vertical_RL_TB, SvxResId(RID_SVXSTR_PAGEDIR_RTL_VERT));
214 m_xTextFlowBox->append(SvxFrameDirection::Vertical_LR_TB, SvxResId(RID_SVXSTR_PAGEDIR_LTR_VERT));
217 // #109989# show the text direction box in Writer/Web too
218 if( (bCJK || bCTL) &&
219 SfxItemState::UNKNOWN < rAttr.GetItemState(GetWhich( SID_ATTR_FRAMEDIRECTION )))
221 m_xTextFlowLbl->show();
222 m_xTextFlowBox->show();
223 m_xTextFlowBox->connect_changed(LINK(this, SvxPageDescPage, FrameDirectionModify_Impl));
225 m_aBspWin.EnableFrameDirection(true);
227 Init_Impl();
229 FieldUnit eFUnit = GetModuleFieldUnit( rAttr );
230 SetFieldUnit( *m_xLeftMarginEdit, eFUnit );
231 SetFieldUnit( *m_xRightMarginEdit, eFUnit );
232 SetFieldUnit( *m_xTopMarginEdit, eFUnit );
233 SetFieldUnit( *m_xBottomMarginEdit, eFUnit );
234 SetFieldUnit( *m_xPaperWidthEdit, eFUnit );
235 SetFieldUnit( *m_xPaperHeightEdit, eFUnit );
237 if ( SfxViewShell::Current() && SfxViewShell::Current()->GetPrinter() )
239 mpDefPrinter = SfxViewShell::Current()->GetPrinter();
241 else
243 mpDefPrinter = VclPtr<Printer>::Create();
244 mbDelPrinter = true;
247 MapMode aOldMode = mpDefPrinter->GetMapMode();
248 mpDefPrinter->SetMapMode(MapMode(MapUnit::MapTwip));
250 // set first- and last-values for the margins
251 Size aPaperSize = mpDefPrinter->GetPaperSize();
252 Size aPrintSize = mpDefPrinter->GetOutputSize();
255 * To convert a point ( 0,0 ) into logic coordinates
256 * looks like nonsense; but it makes sense when the
257 * coordinate system's origin has been moved.
259 Point aPrintOffset = mpDefPrinter->GetPageOffset() - mpDefPrinter->PixelToLogic( Point() );
260 mpDefPrinter->SetMapMode( aOldMode );
262 nFirstLeftMargin = m_xLeftMarginEdit->convert_value_from(m_xLeftMarginEdit->normalize(aPrintOffset.X()), FieldUnit::TWIP);
263 nFirstRightMargin = m_xRightMarginEdit->convert_value_from(m_xRightMarginEdit->normalize(aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X()), FieldUnit::TWIP);
264 nFirstTopMargin = m_xTopMarginEdit->convert_value_from(m_xTopMarginEdit->normalize(aPrintOffset.Y() ), FieldUnit::TWIP);
265 nFirstBottomMargin = m_xBottomMarginEdit->convert_value_from(m_xBottomMarginEdit->normalize(aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y()), FieldUnit::TWIP );
266 nLastLeftMargin = m_xLeftMarginEdit->convert_value_from(m_xLeftMarginEdit->normalize(aPrintOffset.X() + aPrintSize.Width()), FieldUnit::TWIP);
267 nLastRightMargin = m_xRightMarginEdit->convert_value_from(m_xRightMarginEdit->normalize(aPrintOffset.X() + aPrintSize.Width()), FieldUnit::TWIP);
268 nLastTopMargin = m_xTopMarginEdit->convert_value_from(m_xTopMarginEdit->normalize(aPrintOffset.Y() + aPrintSize.Height()), FieldUnit::TWIP);
269 nLastBottomMargin = m_xBottomMarginEdit->convert_value_from(m_xBottomMarginEdit->normalize(aPrintOffset.Y() + aPrintSize.Height()), FieldUnit::TWIP);
271 // #i4219# get DrawingLayer options
272 const SvtOptionsDrawinglayer aDrawinglayerOpt;
274 // #i4219# take Maximum now from configuration (1/100th cm)
275 // was: 11900 -> 119 cm ;new value 3 meters -> 300 cm -> 30000
276 m_xPaperWidthEdit->set_max(m_xPaperWidthEdit->normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FieldUnit::CM);
277 m_xPaperHeightEdit->set_max(m_xPaperHeightEdit->normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FieldUnit::CM);
279 // #i4219# also for margins (1/100th cm). Was: 9999, keeping.
280 m_xLeftMarginEdit->set_max(m_xLeftMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperLeftMargin()), FieldUnit::MM);
281 m_xRightMarginEdit->set_max(m_xRightMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperRightMargin()), FieldUnit::MM);
282 m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperTopMargin()), FieldUnit::MM);
283 m_xBottomMarginEdit->set_max(m_xBottomMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperBottomMargin()), FieldUnit::MM);
285 // Get the i18n framework numberings and add them to the listbox.
286 SvxNumOptionsTabPageHelper::GetI18nNumbering(m_xNumberFormatBox->get_widget(), std::numeric_limits<sal_uInt16>::max());
289 SvxPageDescPage::~SvxPageDescPage()
291 if(mbDelPrinter)
293 mpDefPrinter.disposeAndClear();
294 mbDelPrinter = false;
298 void SvxPageDescPage::Init_Impl()
300 // adjust the handler
301 m_xLayoutBox->connect_changed(LINK(this, SvxPageDescPage, LayoutHdl_Impl));
303 m_xPaperSizeBox->connect_changed(LINK(this, SvxPageDescPage, PaperSizeSelect_Impl));
304 m_xPaperWidthEdit->connect_value_changed( LINK(this, SvxPageDescPage, PaperSizeModify_Impl));
305 m_xPaperHeightEdit->connect_value_changed(LINK(this, SvxPageDescPage, PaperSizeModify_Impl));
306 m_xLandscapeBtn->connect_clicked(LINK(this, SvxPageDescPage, SwapOrientation_Impl));
307 m_xPortraitBtn->connect_clicked(LINK(this, SvxPageDescPage, SwapOrientation_Impl));
309 Link<weld::MetricSpinButton&, void> aLink = LINK(this, SvxPageDescPage, BorderModify_Impl);
310 m_xLeftMarginEdit->connect_value_changed(aLink);
311 m_xRightMarginEdit->connect_value_changed(aLink);
312 m_xTopMarginEdit->connect_value_changed(aLink);
313 m_xBottomMarginEdit->connect_value_changed(aLink);
315 m_xHorzBox->connect_toggled(LINK(this, SvxPageDescPage, CenterHdl_Impl));
316 m_xVertBox->connect_toggled(LINK(this, SvxPageDescPage, CenterHdl_Impl));
319 void SvxPageDescPage::Reset( const SfxItemSet* rSet )
321 SfxItemPool* pPool = rSet->GetPool();
322 DBG_ASSERT( pPool, "Where is the pool?" );
323 MapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) );
325 // adjust margins (right/left)
326 const SfxPoolItem* pItem = GetItem( *rSet, SID_ATTR_LRSPACE );
328 if ( pItem )
330 const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem);
331 SetMetricValue( *m_xLeftMarginEdit, rLRSpace.GetLeft(), eUnit );
332 m_aBspWin.SetLeft(
333 static_cast<sal_uInt16>(ConvertLong_Impl( rLRSpace.GetLeft(), eUnit )) );
334 SetMetricValue( *m_xRightMarginEdit, rLRSpace.GetRight(), eUnit );
335 m_aBspWin.SetRight(
336 static_cast<sal_uInt16>(ConvertLong_Impl( rLRSpace.GetRight(), eUnit )) );
339 // adjust margins (top/bottom)
340 pItem = GetItem( *rSet, SID_ATTR_ULSPACE );
342 if ( pItem )
344 const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(*pItem);
345 SetMetricValue( *m_xTopMarginEdit, rULSpace.GetUpper(), eUnit );
346 m_aBspWin.SetTop(
347 static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<long>(rULSpace.GetUpper()), eUnit )) );
348 SetMetricValue( *m_xBottomMarginEdit, rULSpace.GetLower(), eUnit );
349 m_aBspWin.SetBottom(
350 static_cast<sal_uInt16>(ConvertLong_Impl( static_cast<long>(rULSpace.GetLower()), eUnit )) );
353 // general page data
354 SvxNumType eNumType = SVX_NUM_ARABIC;
355 bLandscape = ( mpDefPrinter->GetOrientation() == Orientation::Landscape );
356 SvxPageUsage nUse = SvxPageUsage::All;
357 pItem = GetItem( *rSet, SID_ATTR_PAGE );
359 if ( pItem )
361 const SvxPageItem& rItem = static_cast<const SvxPageItem&>(*pItem);
362 eNumType = rItem.GetNumType();
363 nUse = rItem.GetPageUsage();
364 bLandscape = rItem.IsLandscape();
367 // alignment
368 m_xLayoutBox->set_active(::PageUsageToPos_Impl(nUse));
369 m_aBspWin.SetUsage( nUse );
370 LayoutHdl_Impl( *m_xLayoutBox );
372 //adjust numeration type of the page style
373 //Get the Position of the saved NumType
374 for (int i=0; i < m_xNumberFormatBox->get_count(); ++i)
376 if (eNumType == m_xNumberFormatBox->get_id(i).toInt32())
378 m_xNumberFormatBox->set_active(i);
379 break;
383 m_xPaperTrayBox->clear();
384 sal_uInt8 nPaperBin = PAPERBIN_PRINTER_SETTINGS;
385 pItem = GetItem( *rSet, SID_ATTR_PAGE_PAPERBIN );
387 if ( pItem )
389 nPaperBin = static_cast<const SvxPaperBinItem*>(pItem)->GetValue();
391 if ( nPaperBin >= mpDefPrinter->GetPaperBinCount() )
392 nPaperBin = PAPERBIN_PRINTER_SETTINGS;
395 OUString aBinName;
397 if ( PAPERBIN_PRINTER_SETTINGS == nPaperBin )
398 aBinName = EditResId(RID_SVXSTR_PAPERBIN_SETTINGS);
399 else
400 aBinName = mpDefPrinter->GetPaperBinName( static_cast<sal_uInt16>(nPaperBin) );
402 m_xPaperTrayBox->append(OUString::number(nPaperBin), aBinName);
403 m_xPaperTrayBox->set_active_text(aBinName);
404 // reset focus handler to default first so know none already connected
405 m_xPaperTrayBox->connect_focus_in(Link<weld::Widget&, void>());
406 // update the list when widget gets focus
407 m_xPaperTrayBox->connect_focus_in(LINK(this, SvxPageDescPage, PaperBinHdl_Impl));
409 Size aPaperSize = SvxPaperInfo::GetPaperSize( mpDefPrinter );
410 pItem = GetItem( *rSet, SID_ATTR_PAGE_SIZE );
412 if ( pItem )
413 aPaperSize = static_cast<const SvxSizeItem*>(pItem)->GetSize();
415 bool bOrientationSupport =
416 mpDefPrinter->HasSupport( PrinterSupport::SetOrientation );
418 if ( !bOrientationSupport &&
419 aPaperSize.Width() > aPaperSize.Height() )
420 bLandscape = true;
422 m_xLandscapeBtn->set_active(bLandscape);
423 m_xPortraitBtn->set_active(!bLandscape);
425 m_aBspWin.SetSize( Size( ConvertLong_Impl( aPaperSize.Width(), eUnit ),
426 ConvertLong_Impl( aPaperSize.Height(), eUnit ) ) );
428 aPaperSize = OutputDevice::LogicToLogic(aPaperSize, MapMode(eUnit), MapMode(MapUnit::Map100thMM));
429 if ( bLandscape )
430 Swap( aPaperSize );
432 // Actual Paper Format
433 Paper ePaper = SvxPaperInfo::GetSvxPaper( aPaperSize, MapUnit::Map100thMM );
435 if ( PAPER_USER != ePaper )
436 aPaperSize = SvxPaperInfo::GetPaperSize( ePaper, MapUnit::Map100thMM );
438 if ( bLandscape )
439 Swap( aPaperSize );
441 // write values into the edits
442 SetMetricValue( *m_xPaperHeightEdit, aPaperSize.Height(), MapUnit::Map100thMM );
443 SetMetricValue( *m_xPaperWidthEdit, aPaperSize.Width(), MapUnit::Map100thMM );
444 m_xPaperSizeBox->clear();
446 m_xPaperSizeBox->FillPaperSizeEntries( ( ePaperStart == PAPER_A3 ) ? PaperSizeApp::Std : PaperSizeApp::Draw );
447 m_xPaperSizeBox->SetSelection( ePaper );
449 // application specific
451 switch ( eMode )
453 case SVX_PAGE_MODE_CENTER:
455 m_xTblAlignFT->show();
456 m_xHorzBox->show();
457 m_xVertBox->show();
458 DisableVerticalPageDir();
460 // horizontal alignment
461 pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT1 );
462 m_xHorzBox->set_active(pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue());
464 // vertical alignment
465 pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT2 );
466 m_xVertBox->set_active(pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue());
468 // set example window on the table
469 m_aBspWin.SetTable( true );
470 m_aBspWin.SetHorz(m_xHorzBox->get_active());
471 m_aBspWin.SetVert(m_xVertBox->get_active());
473 break;
476 case SVX_PAGE_MODE_PRESENTATION:
478 DisableVerticalPageDir();
479 m_xAdaptBox->show();
480 pItem = GetItem( *rSet, SID_ATTR_PAGE_EXT1 );
481 m_xAdaptBox->set_active( pItem &&
482 static_cast<const SfxBoolItem*>(pItem)->GetValue() );
484 //!!! hidden, because not implemented by StarDraw
485 m_xLayoutBox->hide();
486 m_xPageText->hide();
488 break;
490 default: ;//prevent warning
494 // display background and border in the example
495 ResetBackground_Impl( *rSet );
496 //! UpdateExample_Impl();
497 RangeHdl_Impl();
499 InitHeadFoot_Impl( *rSet );
501 bBorderModified = false;
502 SwapFirstValues_Impl( false );
503 UpdateExample_Impl();
505 m_xLeftMarginEdit->save_value();
506 m_xRightMarginEdit->save_value();
507 m_xTopMarginEdit->save_value();
508 m_xBottomMarginEdit->save_value();
509 m_xLayoutBox->save_value();
510 m_xNumberFormatBox->save_value();
511 m_xPaperSizeBox->save_value();
512 m_xPaperWidthEdit->save_value();
513 m_xPaperHeightEdit->save_value();
514 m_xPortraitBtn->save_state();
515 m_xLandscapeBtn->save_state();
516 m_xPaperTrayBox->save_value();
517 m_xVertBox->save_state();
518 m_xHorzBox->save_state();
519 m_xAdaptBox->save_state();
521 CheckMarginEdits( true );
524 if(SfxItemState::SET == rSet->GetItemState(SID_SWREGISTER_MODE))
526 m_xRegisterCB->set_active(static_cast<const SfxBoolItem&>(rSet->Get(
527 SID_SWREGISTER_MODE)).GetValue());
528 m_xRegisterCB->save_state();
529 RegisterModify(*m_xRegisterCB);
531 if(SfxItemState::SET == rSet->GetItemState(SID_SWREGISTER_COLLECTION))
533 m_xRegisterLB->set_active_text(
534 static_cast<const SfxStringItem&>(rSet->Get(SID_SWREGISTER_COLLECTION)).GetValue());
535 m_xRegisterLB->save_value();
538 SfxItemState eState = rSet->GetItemState( GetWhich( SID_ATTR_FRAMEDIRECTION ),
539 true, &pItem );
540 if( SfxItemState::UNKNOWN != eState )
542 SvxFrameDirection nVal = SfxItemState::SET == eState
543 ? static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue()
544 : SvxFrameDirection::Horizontal_LR_TB;
545 m_xTextFlowBox->set_active_id(nVal);
547 m_xTextFlowBox->save_value();
548 m_aBspWin.SetFrameDirection(nVal);
552 void SvxPageDescPage::FillUserData()
554 if (SVX_PAGE_MODE_PRESENTATION == eMode)
555 SetUserData(m_xAdaptBox->get_active() ? OUString("1") : OUString("0")) ;
559 bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
561 bool bModified = false;
562 const SfxItemSet& rOldSet = GetItemSet();
563 SfxItemPool* pPool = rOldSet.GetPool();
564 DBG_ASSERT( pPool, "Where is the pool?" );
565 sal_uInt16 nWhich = GetWhich( SID_ATTR_LRSPACE );
566 MapUnit eUnit = pPool->GetMetric( nWhich );
567 const SfxPoolItem* pOld = nullptr;
569 // copy old left and right margins
570 SvxLRSpaceItem aMargin( static_cast<const SvxLRSpaceItem&>(rOldSet.Get( nWhich )) );
572 // copy old top and bottom margins
573 nWhich = GetWhich( SID_ATTR_ULSPACE );
574 SvxULSpaceItem aTopMargin( static_cast<const SvxULSpaceItem&>(rOldSet.Get( nWhich )) );
576 if (m_xLeftMarginEdit->get_value_changed_from_saved())
578 aMargin.SetLeft( static_cast<sal_uInt16>(GetCoreValue( *m_xLeftMarginEdit, eUnit )) );
579 bModified = true;
582 if (m_xRightMarginEdit->get_value_changed_from_saved())
584 aMargin.SetRight( static_cast<sal_uInt16>(GetCoreValue( *m_xRightMarginEdit, eUnit )) );
585 bModified = true;
588 // set left and right margins
589 if (bModified)
591 pOld = GetOldItem( *rSet, SID_ATTR_LRSPACE );
593 if ( !pOld || *static_cast<const SvxLRSpaceItem*>(pOld) != aMargin )
594 rSet->Put( aMargin );
595 else
596 bModified = false;
599 bool bMod = false;
601 if (m_xTopMarginEdit->get_value_changed_from_saved())
603 aTopMargin.SetUpper( static_cast<sal_uInt16>(GetCoreValue( *m_xTopMarginEdit, eUnit )) );
604 bMod = true;
607 if (m_xBottomMarginEdit->get_value_changed_from_saved())
609 aTopMargin.SetLower( static_cast<sal_uInt16>(GetCoreValue( *m_xBottomMarginEdit, eUnit )) );
610 bMod = true;
613 // set top and bottom margins
615 if ( bMod )
617 pOld = GetOldItem( *rSet, SID_ATTR_ULSPACE );
619 if ( !pOld || *static_cast<const SvxULSpaceItem*>(pOld) != aTopMargin )
621 bModified = true;
622 rSet->Put( aTopMargin );
626 // paper tray
627 nWhich = GetWhich( SID_ATTR_PAGE_PAPERBIN );
628 sal_Int32 nPos = m_xPaperTrayBox->get_active();
629 sal_uInt16 nBin = m_xPaperTrayBox->get_id(nPos).toInt32();
630 pOld = GetOldItem( *rSet, SID_ATTR_PAGE_PAPERBIN );
632 if ( !pOld || static_cast<const SvxPaperBinItem*>(pOld)->GetValue() != nBin )
634 rSet->Put( SvxPaperBinItem( nWhich, static_cast<sal_uInt8>(nBin) ) );
635 bModified = true;
638 Paper ePaper = m_xPaperSizeBox->GetSelection();
639 bool bChecked = m_xLandscapeBtn->get_active();
641 if ( PAPER_USER == ePaper )
643 if ( m_xPaperSizeBox->get_value_changed_from_saved() ||
644 m_xPaperWidthEdit->get_value_changed_from_saved() ||
645 m_xPaperHeightEdit->get_value_changed_from_saved() ||
646 m_xLandscapeBtn->get_state_changed_from_saved() )
648 Size aSize( GetCoreValue( *m_xPaperWidthEdit, eUnit ),
649 GetCoreValue( *m_xPaperHeightEdit, eUnit ) );
650 pOld = GetOldItem( *rSet, SID_ATTR_PAGE_SIZE );
652 if ( !pOld || static_cast<const SvxSizeItem*>(pOld)->GetSize() != aSize )
654 rSet->Put( SvxSizeItem( GetWhich(SID_ATTR_PAGE_SIZE), aSize ) );
655 bModified = true;
659 else
661 if (m_xPaperSizeBox->get_value_changed_from_saved() || m_xLandscapeBtn->get_state_changed_from_saved())
663 Size aSize( SvxPaperInfo::GetPaperSize( ePaper, eUnit ) );
665 if ( bChecked )
666 Swap( aSize );
668 pOld = GetOldItem( *rSet, SID_ATTR_PAGE_SIZE );
670 if ( !pOld || static_cast<const SvxSizeItem*>(pOld)->GetSize() != aSize )
672 rSet->Put( SvxSizeItem( GetWhich(SID_ATTR_PAGE_SIZE), aSize ) );
673 bModified = true;
678 nWhich = GetWhich( SID_ATTR_PAGE );
679 SvxPageItem aPage( static_cast<const SvxPageItem&>(rOldSet.Get( nWhich )) );
680 bMod = m_xLayoutBox->get_value_changed_from_saved();
682 if ( bMod )
683 aPage.SetPageUsage(::PosToPageUsage_Impl(m_xLayoutBox->get_active()));
685 if (m_xLandscapeBtn->get_state_changed_from_saved())
687 aPage.SetLandscape(bChecked);
688 bMod = true;
691 //Get the NumType value
692 nPos = m_xNumberFormatBox->get_active();
693 SvxNumType nEntryData = static_cast<SvxNumType>(m_xNumberFormatBox->get_id(nPos).toInt32());
694 if (m_xNumberFormatBox->get_value_changed_from_saved())
696 aPage.SetNumType( nEntryData );
697 bMod = true;
700 if ( bMod )
702 pOld = GetOldItem( *rSet, SID_ATTR_PAGE );
704 if ( !pOld || *static_cast<const SvxPageItem*>(pOld) != aPage )
706 rSet->Put( aPage );
707 bModified = true;
710 else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich ) )
711 rSet->ClearItem( nWhich );
712 else
713 rSet->Put( rOldSet.Get( nWhich ) );
715 // evaluate mode specific controls
717 switch ( eMode )
719 case SVX_PAGE_MODE_CENTER:
721 if (m_xHorzBox->get_state_changed_from_saved())
723 SfxBoolItem aHorz( GetWhich( SID_ATTR_PAGE_EXT1 ),
724 m_xHorzBox->get_active() );
725 rSet->Put( aHorz );
726 bModified = true;
729 if (m_xVertBox->get_state_changed_from_saved())
731 SfxBoolItem aVert( GetWhich( SID_ATTR_PAGE_EXT2 ),
732 m_xVertBox->get_active() );
733 rSet->Put( aVert );
734 bModified = true;
736 break;
739 case SVX_PAGE_MODE_PRESENTATION:
741 // always put so that draw can evaluate this
742 rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_PAGE_EXT1 ),
743 m_xAdaptBox->get_active() ) );
744 bModified = true;
745 break;
747 default: ;//prevent warning
751 if (m_xRegisterCB->get_visible() &&
752 (m_xRegisterCB->get_active() || m_xRegisterCB->get_state_changed_from_saved()))
754 const SfxBoolItem& rRegItem = static_cast<const SfxBoolItem&>(rOldSet.Get(SID_SWREGISTER_MODE));
755 std::unique_ptr<SfxBoolItem> pRegItem(static_cast<SfxBoolItem*>(rRegItem.Clone()));
756 bool bCheck = m_xRegisterCB->get_active();
757 pRegItem->SetValue(bCheck);
758 rSet->Put(std::move(pRegItem));
759 bModified = true;
760 if(bCheck)
762 bModified = true;
763 rSet->Put(SfxStringItem(SID_SWREGISTER_COLLECTION,
764 m_xRegisterLB->get_active_text()));
768 if (m_xTextFlowBox->get_visible() && m_xTextFlowBox->get_value_changed_from_saved())
770 SvxFrameDirection eDirection = m_xTextFlowBox->get_active_id();
771 rSet->Put( SvxFrameDirectionItem( eDirection, GetWhich( SID_ATTR_FRAMEDIRECTION ) ) );
772 bModified = true;
775 return bModified;
778 IMPL_LINK_NOARG(SvxPageDescPage, LayoutHdl_Impl, weld::ComboBox&, void)
780 // switch inside outside
781 const SvxPageUsage nUsage = PosToPageUsage_Impl(m_xLayoutBox->get_active());
783 if (nUsage == SvxPageUsage::Mirror)
785 m_xLeftMarginLbl->hide();
786 m_xRightMarginLbl->hide();
787 m_xInsideLbl->show();
788 m_xOutsideLbl->show();
790 else
792 m_xLeftMarginLbl->show();
793 m_xRightMarginLbl->show();
794 m_xInsideLbl->hide();
795 m_xOutsideLbl->hide();
797 UpdateExample_Impl( true );
800 IMPL_LINK_NOARG(SvxPageDescPage, PaperBinHdl_Impl, weld::Widget&, void)
802 // tdf#124226 disconnect so not called again, unless Reset occurs
803 m_xPaperTrayBox->connect_focus_in(Link<weld::Widget&, void>());
805 OUString aOldName = m_xPaperTrayBox->get_active_text();
806 m_xPaperTrayBox->freeze();
807 m_xPaperTrayBox->clear();
808 m_xPaperTrayBox->append(OUString::number(PAPERBIN_PRINTER_SETTINGS), EditResId(RID_SVXSTR_PAPERBIN_SETTINGS));
809 OUString aPaperBin(EditResId(RID_SVXSTR_PAPERBIN));
810 const sal_uInt16 nBinCount = mpDefPrinter->GetPaperBinCount();
812 for (sal_uInt16 i = 0; i < nBinCount; ++i)
814 OUString aName = mpDefPrinter->GetPaperBinName(i);
815 if (aName.isEmpty())
817 aName = aPaperBin + " " + OUString::number( i+1 );
819 m_xPaperTrayBox->append(OUString::number(i), aName);
821 m_xPaperTrayBox->set_active_text(aOldName);
822 m_xPaperTrayBox->thaw();
824 // tdf#123650 explicitly grab-focus after the modification otherwise gtk loses track
825 // of there the focus should be
826 m_xPaperTrayBox->grab_focus();
829 IMPL_LINK_NOARG(SvxPageDescPage, PaperSizeSelect_Impl, weld::ComboBox&, void)
831 Paper ePaper = m_xPaperSizeBox->GetSelection();
833 if ( ePaper != PAPER_USER )
835 Size aSize( SvxPaperInfo::GetPaperSize( ePaper, MapUnit::Map100thMM ) );
837 if (m_xLandscapeBtn->get_active())
838 Swap( aSize );
840 if ( aSize.Height() < m_xPaperHeightEdit->get_min( FieldUnit::MM_100TH ) )
841 m_xPaperHeightEdit->set_min(
842 m_xPaperHeightEdit->normalize( aSize.Height() ), FieldUnit::MM_100TH );
843 if ( aSize.Width() < m_xPaperWidthEdit->get_min( FieldUnit::MM_100TH ) )
844 m_xPaperWidthEdit->set_min(
845 m_xPaperWidthEdit->normalize( aSize.Width() ), FieldUnit::MM_100TH );
846 SetMetricValue( *m_xPaperHeightEdit, aSize.Height(), MapUnit::Map100thMM );
847 SetMetricValue( *m_xPaperWidthEdit, aSize.Width(), MapUnit::Map100thMM );
849 CalcMargin_Impl();
851 RangeHdl_Impl();
852 UpdateExample_Impl( true );
854 if ( eMode == SVX_PAGE_MODE_PRESENTATION )
856 // Draw: if paper format the margin shall be 1 cm
857 long nTmp = 0;
858 bool bScreen = (( PAPER_SCREEN_4_3 == ePaper )||( PAPER_SCREEN_16_9 == ePaper)||( PAPER_SCREEN_16_10 == ePaper));
860 if ( !bScreen )
861 // no margin if screen
862 nTmp = 1; // accordingly 1 cm
864 if ( bScreen || m_xRightMarginEdit->get_value(FieldUnit::NONE) == 0 )
865 SetMetricValue( *m_xRightMarginEdit, nTmp, MapUnit::MapCM );
866 if ( bScreen || m_xLeftMarginEdit->get_value(FieldUnit::NONE) == 0 )
867 SetMetricValue( *m_xLeftMarginEdit, nTmp, MapUnit::MapCM );
868 if ( bScreen || m_xBottomMarginEdit->get_value(FieldUnit::NONE) == 0 )
869 SetMetricValue( *m_xBottomMarginEdit, nTmp, MapUnit::MapCM );
870 if ( bScreen || m_xTopMarginEdit->get_value(FieldUnit::NONE) == 0 )
871 SetMetricValue( *m_xTopMarginEdit, nTmp, MapUnit::MapCM );
872 UpdateExample_Impl( true );
877 IMPL_LINK_NOARG(SvxPageDescPage, PaperSizeModify_Impl, weld::MetricSpinButton&, void)
879 sal_uInt16 nWhich = GetWhich( SID_ATTR_LRSPACE );
880 MapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWhich );
881 Size aSize( GetCoreValue( *m_xPaperWidthEdit, eUnit ),
882 GetCoreValue( *m_xPaperHeightEdit, eUnit ) );
884 if ( aSize.Width() > aSize.Height() )
886 m_xLandscapeBtn->set_active(true);
887 bLandscape = true;
889 else
891 m_xPortraitBtn->set_active(true);
892 bLandscape = false;
895 Paper ePaper = SvxPaperInfo::GetSvxPaper( aSize, eUnit );
896 m_xPaperSizeBox->SetSelection( ePaper );
897 UpdateExample_Impl( true );
899 RangeHdl_Impl();
902 IMPL_LINK(SvxPageDescPage, SwapOrientation_Impl, weld::Button&, rBtn, void)
904 if (
905 (!bLandscape && &rBtn == m_xLandscapeBtn.get()) ||
906 (bLandscape && &rBtn == m_xPortraitBtn.get())
909 bLandscape = m_xLandscapeBtn->get_active();
911 const long lWidth = GetCoreValue( *m_xPaperWidthEdit, MapUnit::Map100thMM );
912 const long lHeight = GetCoreValue( *m_xPaperHeightEdit, MapUnit::Map100thMM );
914 // swap width and height
915 SetMetricValue(*m_xPaperWidthEdit, lHeight, MapUnit::Map100thMM);
916 SetMetricValue(*m_xPaperHeightEdit, lWidth, MapUnit::Map100thMM);
918 // recalculate margins if necessary
919 CalcMargin_Impl();
921 PaperSizeSelect_Impl(m_xPaperSizeBox->get_widget());
922 RangeHdl_Impl();
923 SwapFirstValues_Impl(bBorderModified);
924 UpdateExample_Impl(true);
928 void SvxPageDescPage::SwapFirstValues_Impl( bool bSet )
930 MapMode aOldMode = mpDefPrinter->GetMapMode();
931 Orientation eOri = Orientation::Portrait;
933 if ( bLandscape )
934 eOri = Orientation::Landscape;
935 Orientation eOldOri = mpDefPrinter->GetOrientation();
936 mpDefPrinter->SetOrientation( eOri );
937 mpDefPrinter->SetMapMode(MapMode(MapUnit::MapTwip));
939 // set first- and last-values for margins
940 Size aPaperSize = mpDefPrinter->GetPaperSize();
941 Size aPrintSize = mpDefPrinter->GetOutputSize();
943 * To convert a point ( 0,0 ) into logic coordinates
944 * looks like nonsense; but it makes sense if the
945 * coordinate system's origin has been moved.
947 Point aPrintOffset = mpDefPrinter->GetPageOffset() - mpDefPrinter->PixelToLogic( Point() );
948 mpDefPrinter->SetMapMode( aOldMode );
949 mpDefPrinter->SetOrientation( eOldOri );
951 sal_Int64 nSetL = m_xLeftMarginEdit->denormalize(
952 m_xLeftMarginEdit->get_value( FieldUnit::TWIP ) );
953 sal_Int64 nSetR = m_xRightMarginEdit->denormalize(
954 m_xRightMarginEdit->get_value( FieldUnit::TWIP ) );
955 sal_Int64 nSetT = m_xTopMarginEdit->denormalize(
956 m_xTopMarginEdit->get_value( FieldUnit::TWIP ) );
957 sal_Int64 nSetB = m_xBottomMarginEdit->denormalize(
958 m_xBottomMarginEdit->get_value( FieldUnit::TWIP ) );
960 long nNewL = aPrintOffset.X();
961 long nNewR = aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X();
962 long nNewT = aPrintOffset.Y();
963 long nNewB = aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y();
965 nFirstLeftMargin = m_xLeftMarginEdit->convert_value_from(m_xLeftMarginEdit->normalize(nNewL), FieldUnit::TWIP);
966 nFirstRightMargin = m_xRightMarginEdit->convert_value_from(m_xRightMarginEdit->normalize(nNewR), FieldUnit::TWIP);
967 nFirstTopMargin = m_xTopMarginEdit->convert_value_from(m_xTopMarginEdit->normalize(nNewT), FieldUnit::TWIP);
968 nFirstBottomMargin = m_xBottomMarginEdit->convert_value_from(m_xBottomMarginEdit->normalize(nNewB), FieldUnit::TWIP);
970 if ( bSet )
972 if ( nSetL < nNewL )
973 m_xLeftMarginEdit->set_value( m_xLeftMarginEdit->normalize( nNewL ),
974 FieldUnit::TWIP );
975 if ( nSetR < nNewR )
976 m_xRightMarginEdit->set_value( m_xRightMarginEdit->normalize( nNewR ),
977 FieldUnit::TWIP );
978 if ( nSetT < nNewT )
979 m_xTopMarginEdit->set_value( m_xTopMarginEdit->normalize( nNewT ),
980 FieldUnit::TWIP );
981 if ( nSetB < nNewB )
982 m_xBottomMarginEdit->set_value( m_xBottomMarginEdit->normalize( nNewB ),
983 FieldUnit::TWIP );
987 IMPL_LINK_NOARG(SvxPageDescPage, BorderModify_Impl, weld::MetricSpinButton&, void)
989 if ( !bBorderModified )
990 bBorderModified = true;
991 UpdateExample_Impl();
993 RangeHdl_Impl();
996 void SvxPageDescPage::UpdateExample_Impl( bool bResetbackground )
998 // Size
999 Size aSize( GetCoreValue( *m_xPaperWidthEdit, MapUnit::MapTwip ),
1000 GetCoreValue( *m_xPaperHeightEdit, MapUnit::MapTwip ) );
1002 m_aBspWin.SetSize( aSize );
1004 // Margins
1005 m_aBspWin.SetTop( GetCoreValue( *m_xTopMarginEdit, MapUnit::MapTwip ) );
1006 m_aBspWin.SetBottom( GetCoreValue( *m_xBottomMarginEdit, MapUnit::MapTwip ) );
1007 m_aBspWin.SetLeft( GetCoreValue( *m_xLeftMarginEdit, MapUnit::MapTwip ) );
1008 m_aBspWin.SetRight( GetCoreValue( *m_xRightMarginEdit, MapUnit::MapTwip ) );
1010 // Layout
1011 m_aBspWin.SetUsage(PosToPageUsage_Impl(m_xLayoutBox->get_active()));
1012 if ( bResetbackground )
1013 m_aBspWin.ResetBackground();
1014 m_aBspWin.Invalidate();
1018 void SvxPageDescPage::ResetBackground_Impl(const SfxItemSet& rSet)
1020 sal_uInt16 nWhich(GetWhich(SID_ATTR_PAGE_HEADERSET));
1022 if (SfxItemState::SET == rSet.GetItemState(nWhich, false))
1024 const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false));
1025 const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
1026 const SfxBoolItem& rOn = static_cast< const SfxBoolItem& >(rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON)));
1028 if(rOn.GetValue())
1030 drawinglayer::attribute::SdrAllFillAttributesHelperPtr aHeaderFillAttributes;
1032 if(mbEnableDrawingLayerFillStyles)
1034 // create FillAttributes directly from DrawingLayer FillStyle entries
1035 aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rTmpSet));
1037 else
1039 nWhich = GetWhich(SID_ATTR_BRUSH);
1041 if(SfxItemState::SET == rTmpSet.GetItemState(nWhich))
1043 // create FillAttributes from SvxBrushItem
1044 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
1045 SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
1047 setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
1048 aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
1052 m_aBspWin.setHeaderFillAttributes(aHeaderFillAttributes);
1056 nWhich = GetWhich(SID_ATTR_PAGE_FOOTERSET);
1058 if (SfxItemState::SET == rSet.GetItemState(nWhich, false))
1060 const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich,false));
1061 const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
1062 const SfxBoolItem& rOn = static_cast< const SfxBoolItem& >(rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON)));
1064 if(rOn.GetValue())
1066 drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFooterFillAttributes;
1068 if(mbEnableDrawingLayerFillStyles)
1070 // create FillAttributes directly from DrawingLayer FillStyle entries
1071 aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rTmpSet));
1073 else
1075 nWhich = GetWhich(SID_ATTR_BRUSH);
1077 if(SfxItemState::SET == rTmpSet.GetItemState(nWhich))
1079 // create FillAttributes from SvxBrushItem
1080 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
1081 SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
1083 setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
1084 aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
1088 m_aBspWin.setFooterFillAttributes(aFooterFillAttributes);
1092 drawinglayer::attribute::SdrAllFillAttributesHelperPtr aPageFillAttributes;
1093 const SfxPoolItem* pItem = nullptr;
1095 if(mbEnableDrawingLayerFillStyles)
1097 // create FillAttributes directly from DrawingLayer FillStyle entries
1098 aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rSet));
1100 else
1102 pItem = GetItem(rSet, SID_ATTR_BRUSH);
1104 if(pItem)
1106 // create FillAttributes from SvxBrushItem
1107 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(*pItem);
1108 SfxItemSet aTempSet(*rSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
1110 setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
1111 aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
1115 m_aBspWin.setPageFillAttributes(aPageFillAttributes);
1118 void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
1120 bLandscape = m_xLandscapeBtn->get_active();
1121 const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE );
1123 if ( pItem )
1124 m_aBspWin.SetSize( static_cast<const SvxSizeItem*>(pItem)->GetSize() );
1126 const SvxSetItem* pSetItem = nullptr;
1128 // evaluate header attributes
1130 if ( SfxItemState::SET ==
1131 rSet.GetItemState( GetWhich( SID_ATTR_PAGE_HEADERSET ),
1132 false, reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
1134 const SfxItemSet& rHeaderSet = pSetItem->GetItemSet();
1135 const SfxBoolItem& rHeaderOn =
1136 static_cast<const SfxBoolItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ));
1138 if ( rHeaderOn.GetValue() )
1140 const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(
1141 rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ));
1142 const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(
1143 rHeaderSet.Get( GetWhich( SID_ATTR_ULSPACE ) ));
1144 long nDist = rUL.GetLower();
1145 m_aBspWin.SetHdHeight( rSize.GetSize().Height() - nDist );
1146 m_aBspWin.SetHdDist( nDist );
1147 const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(
1148 rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
1149 m_aBspWin.SetHdLeft( rLR.GetLeft() );
1150 m_aBspWin.SetHdRight( rLR.GetRight() );
1151 m_aBspWin.SetHeader( true );
1153 else
1154 m_aBspWin.SetHeader( false );
1156 // show background and border in the example
1157 drawinglayer::attribute::SdrAllFillAttributesHelperPtr aHeaderFillAttributes;
1159 if(mbEnableDrawingLayerFillStyles)
1161 // create FillAttributes directly from DrawingLayer FillStyle entries
1162 aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rHeaderSet));
1164 else
1166 const sal_uInt16 nWhich(GetWhich(SID_ATTR_BRUSH));
1168 if(rHeaderSet.GetItemState(nWhich) >= SfxItemState::DEFAULT)
1170 // aBspWin.SetHdColor(rItem.GetColor());
1171 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rHeaderSet.Get(nWhich));
1172 SfxItemSet aTempSet(*rHeaderSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
1174 setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
1175 aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
1179 m_aBspWin.setHeaderFillAttributes(aHeaderFillAttributes);
1182 // evaluate footer attributes
1184 if ( SfxItemState::SET ==
1185 rSet.GetItemState( GetWhich( SID_ATTR_PAGE_FOOTERSET ),
1186 false, reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
1188 const SfxItemSet& rFooterSet = pSetItem->GetItemSet();
1189 const SfxBoolItem& rFooterOn =
1190 static_cast<const SfxBoolItem&>(rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ));
1192 if ( rFooterOn.GetValue() )
1194 const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(
1195 rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ));
1196 const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(
1197 rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) ));
1198 long nDist = rUL.GetUpper();
1199 m_aBspWin.SetFtHeight( rSize.GetSize().Height() - nDist );
1200 m_aBspWin.SetFtDist( nDist );
1201 const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(
1202 rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
1203 m_aBspWin.SetFtLeft( rLR.GetLeft() );
1204 m_aBspWin.SetFtRight( rLR.GetRight() );
1205 m_aBspWin.SetFooter( true );
1207 else
1208 m_aBspWin.SetFooter( false );
1210 // show background and border in the example
1211 drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFooterFillAttributes;
1213 if(mbEnableDrawingLayerFillStyles)
1215 // create FillAttributes directly from DrawingLayer FillStyle entries
1216 aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rFooterSet));
1218 else
1220 const sal_uInt16 nWhich(GetWhich(SID_ATTR_BRUSH));
1222 if(rFooterSet.GetItemState(nWhich) >= SfxItemState::DEFAULT)
1224 // aBspWin.SetFtColor(rItem.GetColor());
1225 const SvxBrushItem& rItem = static_cast<const SvxBrushItem&>(rFooterSet.Get(nWhich));
1226 SfxItemSet aTempSet(*rFooterSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
1228 setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
1229 aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
1233 m_aBspWin.setFooterFillAttributes(aFooterFillAttributes);
1237 void SvxPageDescPage::ActivatePage( const SfxItemSet& rSet )
1239 InitHeadFoot_Impl( rSet );
1240 UpdateExample_Impl();
1241 ResetBackground_Impl( rSet );
1242 RangeHdl_Impl();
1245 DeactivateRC SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet )
1247 // Inquiry whether the page margins are beyond the printing area.
1248 // If not, ask user whether they shall be taken.
1249 // If not, stay on the TabPage.
1250 Paper ePaper = m_xPaperSizeBox->GetSelection();
1252 if ( ePaper != PAPER_SCREEN_4_3 && ePaper != PAPER_SCREEN_16_9 && ePaper != PAPER_SCREEN_16_10 && IsMarginOutOfRange() )
1254 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
1255 VclMessageType::Question, VclButtonsType::YesNo,
1256 m_xPrintRangeQueryText->get_label()));
1257 xQueryBox->set_default_response(RET_NO);
1258 if (xQueryBox->run() == RET_NO)
1260 weld::MetricSpinButton* pField = nullptr;
1261 if ( IsPrinterRangeOverflow( *m_xLeftMarginEdit, nFirstLeftMargin, nLastLeftMargin, MARGIN_LEFT ) )
1262 pField = m_xLeftMarginEdit.get();
1263 if ( IsPrinterRangeOverflow( *m_xRightMarginEdit, nFirstRightMargin, nLastRightMargin, MARGIN_RIGHT )
1264 && !pField )
1265 pField = m_xRightMarginEdit.get();
1266 if ( IsPrinterRangeOverflow( *m_xTopMarginEdit, nFirstTopMargin, nLastTopMargin, MARGIN_TOP )
1267 && !pField )
1268 pField = m_xTopMarginEdit.get();
1269 if ( IsPrinterRangeOverflow( *m_xBottomMarginEdit, nFirstBottomMargin, nLastBottomMargin, MARGIN_BOTTOM )
1270 && !pField )
1271 pField = m_xBottomMarginEdit.get();
1272 if ( pField )
1273 pField->grab_focus();
1274 UpdateExample_Impl();
1275 return DeactivateRC::KeepPage;
1277 else
1278 CheckMarginEdits( false );
1281 if ( _pSet )
1283 FillItemSet( _pSet );
1285 // put portray/landscape if applicable
1286 sal_uInt16 nWh = GetWhich( SID_ATTR_PAGE_SIZE );
1287 MapUnit eUnit = GetItemSet().GetPool()->GetMetric( nWh );
1288 Size aSize( GetCoreValue( *m_xPaperWidthEdit, eUnit ),
1289 GetCoreValue( *m_xPaperHeightEdit, eUnit ) );
1291 // put, if current size is different to the value in _pSet
1292 const SvxSizeItem* pSize = GetItem( *_pSet, SID_ATTR_PAGE_SIZE );
1293 if ( aSize.Width() && ( !pSize || !IsEqualSize_Impl( pSize, aSize ) ) )
1294 _pSet->Put( SvxSizeItem( nWh, aSize ) );
1297 return DeactivateRC::LeavePage;
1300 void SvxPageDescPage::RangeHdl_Impl()
1302 // example window
1303 long nHHeight = m_aBspWin.GetHdHeight();
1304 long nHDist = m_aBspWin.GetHdDist();
1306 long nFHeight = m_aBspWin.GetFtHeight();
1307 long nFDist = m_aBspWin.GetFtDist();
1309 long nHFLeft = std::max(m_aBspWin.GetHdLeft(), m_aBspWin.GetFtLeft());
1310 long nHFRight = std::max(m_aBspWin.GetHdRight(), m_aBspWin.GetFtRight());
1312 // current values for page margins
1313 long nBT = static_cast<long>(m_xTopMarginEdit->denormalize(m_xTopMarginEdit->get_value(FieldUnit::TWIP)));
1314 long nBB = static_cast<long>(m_xBottomMarginEdit->denormalize(m_xBottomMarginEdit->get_value(FieldUnit::TWIP)));
1315 long nBL = static_cast<long>(m_xLeftMarginEdit->denormalize(m_xLeftMarginEdit->get_value(FieldUnit::TWIP)));
1316 long nBR = static_cast<long>(m_xRightMarginEdit->denormalize(m_xRightMarginEdit->get_value(FieldUnit::TWIP)));
1318 // calculate width of page border
1319 const SfxItemSet* _pSet = &GetItemSet();
1320 Size aBorder;
1322 if ( _pSet->GetItemState( GetWhich(SID_ATTR_BORDER_SHADOW) ) >=
1323 SfxItemState::DEFAULT &&
1324 _pSet->GetItemState( GetWhich(SID_ATTR_BORDER_OUTER) ) >=
1325 SfxItemState::DEFAULT )
1327 aBorder = GetMinBorderSpace_Impl(
1328 static_cast<const SvxShadowItem&>(_pSet->Get(GetWhich(SID_ATTR_BORDER_SHADOW))),
1329 static_cast<const SvxBoxItem&>(_pSet->Get(GetWhich(SID_ATTR_BORDER_OUTER))));
1332 // limits paper
1333 // maximum is 54 cm
1335 long nMin = nHHeight + nHDist + nFDist + nFHeight + nBT + nBB +
1336 MINBODY + aBorder.Height();
1337 m_xPaperHeightEdit->set_min(m_xPaperHeightEdit->normalize(nMin), FieldUnit::TWIP);
1339 nMin = MINBODY + nBL + nBR + aBorder.Width();
1340 m_xPaperWidthEdit->set_min(m_xPaperWidthEdit->normalize(nMin), FieldUnit::TWIP);
1342 long nH = static_cast<long>(m_xPaperHeightEdit->denormalize(m_xPaperHeightEdit->get_value(FieldUnit::TWIP)));
1343 long nW = static_cast<long>(m_xPaperWidthEdit->denormalize(m_xPaperWidthEdit->get_value(FieldUnit::TWIP)));
1345 // Top
1346 long nMax = nH - nBB - aBorder.Height() - MINBODY -
1347 nFDist - nFHeight - nHDist - nHHeight;
1349 m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(nMax), FieldUnit::TWIP);
1351 // Bottom
1352 nMax = nH - nBT - aBorder.Height() - MINBODY -
1353 nFDist - nFHeight - nHDist - nHHeight;
1355 m_xBottomMarginEdit->set_max(m_xTopMarginEdit->normalize(nMax), FieldUnit::TWIP);
1357 // Left
1358 nMax = nW - nBR - MINBODY - aBorder.Width() - nHFLeft - nHFRight;
1359 m_xLeftMarginEdit->set_max(m_xLeftMarginEdit->normalize(nMax), FieldUnit::TWIP);
1361 // Right
1362 nMax = nW - nBL - MINBODY - aBorder.Width() - nHFLeft - nHFRight;
1363 m_xRightMarginEdit->set_max(m_xRightMarginEdit->normalize(nMax), FieldUnit::TWIP);
1366 void SvxPageDescPage::CalcMargin_Impl()
1368 // current values for page margins
1369 long nBT = GetCoreValue( *m_xTopMarginEdit, MapUnit::MapTwip );
1370 long nBB = GetCoreValue( *m_xBottomMarginEdit, MapUnit::MapTwip );
1372 long nBL = GetCoreValue( *m_xLeftMarginEdit, MapUnit::MapTwip );
1373 long nBR = GetCoreValue( *m_xRightMarginEdit, MapUnit::MapTwip );
1375 long nH = GetCoreValue( *m_xPaperHeightEdit, MapUnit::MapTwip );
1376 long nW = GetCoreValue( *m_xPaperWidthEdit, MapUnit::MapTwip );
1378 long nWidth = nBL + nBR + MINBODY;
1379 long nHeight = nBT + nBB + MINBODY;
1381 if ( nWidth > nW || nHeight > nH )
1383 if ( nWidth > nW )
1385 long nTmp = nBL <= nBR ? nBR : nBL;
1386 nTmp -= nWidth - nW;
1388 if ( nBL <= nBR )
1389 SetMetricValue( *m_xRightMarginEdit, nTmp, MapUnit::MapTwip );
1390 else
1391 SetMetricValue( *m_xLeftMarginEdit, nTmp, MapUnit::MapTwip );
1394 if ( nHeight > nH )
1396 long nTmp = nBT <= nBB ? nBB : nBT;
1397 nTmp -= nHeight - nH;
1399 if ( nBT <= nBB )
1400 SetMetricValue( *m_xBottomMarginEdit, nTmp, MapUnit::MapTwip );
1401 else
1402 SetMetricValue( *m_xTopMarginEdit, nTmp, MapUnit::MapTwip );
1407 IMPL_LINK_NOARG(SvxPageDescPage, CenterHdl_Impl, weld::ToggleButton&, void)
1409 m_aBspWin.SetHorz(m_xHorzBox->get_active());
1410 m_aBspWin.SetVert(m_xVertBox->get_active());
1411 UpdateExample_Impl();
1414 void SvxPageDescPage::SetCollectionList(const std::vector<OUString> &aList)
1416 OSL_ENSURE(!aList.empty(), "Empty string list");
1418 sStandardRegister = aList[0];
1419 m_xRegisterLB->freeze();
1420 for (size_t i = 1; i < aList.size(); ++i)
1421 m_xRegisterLB->append_text(aList[i]);
1422 m_xRegisterLB->thaw();
1424 m_xRegisterCB->show();
1425 m_xRegisterFT->show();
1426 m_xRegisterLB->show();
1427 m_xRegisterCB->connect_toggled(LINK(this, SvxPageDescPage, RegisterModify));
1430 IMPL_LINK(SvxPageDescPage, RegisterModify, weld::ToggleButton&, rBox, void)
1432 bool bEnable = false;
1433 if (rBox.get_active())
1435 bEnable = true;
1436 if (m_xRegisterLB->get_active() == -1)
1437 m_xRegisterLB->set_active_text(sStandardRegister);
1439 m_xRegisterFT->set_sensitive(bEnable);
1440 m_xRegisterLB->set_sensitive(bEnable);
1443 void SvxPageDescPage::DisableVerticalPageDir()
1445 m_xTextFlowBox->remove_id(SvxFrameDirection::Vertical_RL_TB);
1446 m_xTextFlowBox->remove_id(SvxFrameDirection::Vertical_LR_TB);
1447 if (m_xTextFlowBox->get_count() < 2)
1449 m_xTextFlowLbl->hide();
1450 m_xTextFlowBox->hide();
1451 m_aBspWin.EnableFrameDirection( false );
1455 IMPL_LINK_NOARG(SvxPageDescPage, FrameDirectionModify_Impl, weld::ComboBox&, void)
1457 m_aBspWin.SetFrameDirection(m_xTextFlowBox->get_active_id());
1458 m_aBspWin.Invalidate();
1461 bool SvxPageDescPage::IsPrinterRangeOverflow(
1462 weld::MetricSpinButton& rField, long nFirstMargin, long nLastMargin, MarginPosition nPos )
1464 bool bRet = false;
1465 bool bCheck = ( ( m_nPos & nPos ) == 0 );
1466 long nValue = rField.get_value(FieldUnit::NONE);
1467 if ( bCheck &&
1468 ( nValue < nFirstMargin || nValue > nLastMargin ) &&
1469 rField.get_value_changed_from_saved() )
1471 rField.set_value(nValue < nFirstMargin ? nFirstMargin : nLastMargin, FieldUnit::NONE);
1472 bRet = true;
1475 return bRet;
1478 /** Check if a value of a margin edit is outside the printer paper margins
1479 and save this information.
1481 void SvxPageDescPage::CheckMarginEdits( bool _bClear )
1483 if ( _bClear )
1484 m_nPos = 0;
1486 sal_Int64 nValue = m_xLeftMarginEdit->get_value(FieldUnit::NONE);
1487 if ( nValue < nFirstLeftMargin || nValue > nLastLeftMargin )
1488 m_nPos |= MARGIN_LEFT;
1489 nValue = m_xRightMarginEdit->get_value(FieldUnit::NONE);
1490 if ( nValue < nFirstRightMargin || nValue > nLastRightMargin )
1491 m_nPos |= MARGIN_RIGHT;
1492 nValue = m_xTopMarginEdit->get_value(FieldUnit::NONE);
1493 if ( nValue < nFirstTopMargin || nValue > nLastTopMargin )
1494 m_nPos |= MARGIN_TOP;
1495 nValue = m_xBottomMarginEdit->get_value(FieldUnit::NONE);
1496 if ( nValue < nFirstBottomMargin || nValue > nLastBottomMargin )
1497 m_nPos |= MARGIN_BOTTOM;
1500 bool SvxPageDescPage::IsMarginOutOfRange() const
1502 bool bRet = ( ( ( !( m_nPos & MARGIN_LEFT ) &&
1503 m_xLeftMarginEdit->get_value_changed_from_saved() ) &&
1504 ( m_xLeftMarginEdit->get_value(FieldUnit::NONE) < nFirstLeftMargin ||
1505 m_xLeftMarginEdit->get_value(FieldUnit::NONE) > nLastLeftMargin ) ) ||
1506 ( ( !( m_nPos & MARGIN_RIGHT ) &&
1507 m_xRightMarginEdit->get_value_changed_from_saved() ) &&
1508 ( m_xRightMarginEdit->get_value(FieldUnit::NONE) < nFirstRightMargin ||
1509 m_xRightMarginEdit->get_value(FieldUnit::NONE) > nLastRightMargin ) ) ||
1510 ( ( !( m_nPos & MARGIN_TOP ) &&
1511 m_xTopMarginEdit->get_value_changed_from_saved() ) &&
1512 ( m_xTopMarginEdit->get_value(FieldUnit::NONE) < nFirstTopMargin ||
1513 m_xTopMarginEdit->get_value(FieldUnit::NONE) > nLastTopMargin ) ) ||
1514 ( ( !( m_nPos & MARGIN_BOTTOM ) &&
1515 m_xBottomMarginEdit->get_value_changed_from_saved() ) &&
1516 ( m_xBottomMarginEdit->get_value(FieldUnit::NONE) < nFirstBottomMargin ||
1517 m_xBottomMarginEdit->get_value(FieldUnit::NONE) > nLastBottomMargin ) ) );
1518 return bRet;
1521 void SvxPageDescPage::PageCreated(const SfxAllItemSet& aSet)
1523 const SfxUInt16Item* pModeItem = aSet.GetItem(SID_ENUM_PAGE_MODE, false);
1524 const SfxUInt16Item* pPaperStartItem = aSet.GetItem(SID_PAPER_START, false);
1525 const SfxUInt16Item* pPaperEndItem = aSet.GetItem(SID_PAPER_END, false);
1526 const SfxStringListItem* pCollectListItem = aSet.GetItem<SfxStringListItem>(SID_COLLECT_LIST, false);
1527 const SfxBoolItem* pSupportDrawingLayerFillStyleItem = aSet.GetItem<SfxBoolItem>(SID_DRAWINGLAYER_FILLSTYLES, false);
1528 const SfxBoolItem* pIsImpressDoc = aSet.GetItem<SfxBoolItem>(SID_IMPRESS_DOC, false);
1530 if (pModeItem)
1532 eMode = static_cast<SvxModeType>(pModeItem->GetValue());
1535 if(pPaperStartItem && pPaperEndItem)
1537 SetPaperFormatRanges(static_cast<Paper>(pPaperStartItem->GetValue()));
1540 if(pCollectListItem)
1542 SetCollectionList(pCollectListItem->GetList());
1545 if(pSupportDrawingLayerFillStyleItem)
1547 const bool bNew(pSupportDrawingLayerFillStyleItem->GetValue());
1549 mbEnableDrawingLayerFillStyles = bNew;
1552 if (pIsImpressDoc)
1553 m_xNumberFormatText->set_label(SvxResId(STR_SLIDE_NUMBERS));
1556 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */