LibreOffice Module svx (master)  1
hdft.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 <svl/itemiter.hxx>
21 #include <sfx2/objsh.hxx>
22 #include <svx/svxids.hrc>
23 
24 #include <svl/intitem.hxx>
25 #include <svtools/unitconv.hxx>
26 
27 #include <svx/hdft.hxx>
28 #include <svx/pageitem.hxx>
29 
30 #include <svx/dlgutil.hxx>
31 #include <sfx2/htmlmode.hxx>
32 
33 #include <editeng/brushitem.hxx>
34 #include <editeng/lrspitem.hxx>
35 #include <editeng/ulspitem.hxx>
36 #include <editeng/sizeitem.hxx>
37 #include <editeng/boxitem.hxx>
38 
39 #include <svx/svxdlg.hxx>
40 #include <memory>
41 
42 #include <svx/xdef.hxx>
43 #include <svx/xfillit0.hxx>
45 
46 using namespace com::sun::star;
47 
48 // Word 97 incompatibility (#i19922#)
49 // #i19922# - tdf#126051 see cui/source/tabpages/page.cxx and sw/source/uibase/sidebar/PageMarginControl.hxx
50 static const long MINBODY = 56; // 1mm in twips rounded
51 
52 // default distance to Header or footer
53 static const long DEF_DIST_WRITER = 500; // 5mm (Writer)
54 static const long DEF_DIST_CALC = 250; // 2.5mm (Calc)
55 
56 const sal_uInt16 SvxHFPage::pRanges[] =
57 {
58  SID_ATTR_BRUSH, SID_ATTR_BRUSH,
59 
60  // Support DrawingLayer FillStyles (no real call to below GetRanges()
61  // detected, still do the complete transition)
63 
64  SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER,
65  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
66  SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW,
67  SID_ATTR_LRSPACE, SID_ATTR_LRSPACE,
68  SID_ATTR_ULSPACE, SID_ATTR_ULSPACE,
69  SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
70  SID_ATTR_PAGE_HEADERSET, SID_ATTR_PAGE_HEADERSET,
71  SID_ATTR_PAGE_FOOTERSET, SID_ATTR_PAGE_FOOTERSET,
72  SID_ATTR_PAGE_ON, SID_ATTR_PAGE_ON,
73  SID_ATTR_PAGE_DYNAMIC, SID_ATTR_PAGE_DYNAMIC,
74  SID_ATTR_PAGE_SHARED, SID_ATTR_PAGE_SHARED,
75  SID_ATTR_PAGE_SHARED_FIRST, SID_ATTR_PAGE_SHARED_FIRST,
76  SID_ATTR_HDFT_DYNAMIC_SPACING, SID_ATTR_HDFT_DYNAMIC_SPACING,
77  0
78 };
79 
80 namespace svx {
81 
83  {
84  bool bRes = false;
86  ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxBorderBackgroundDlg(pParent, *pBBSet, true /*bEnableDrawingLayerFillStyles*/));
87  if ( pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet() )
88  {
89  SfxItemIter aIter( *pDlg->GetOutputItemSet() );
90 
91  for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
92  {
93  if ( !IsInvalidItem( pItem ) )
94  pBBSet->Put( *pItem );
95  }
96  bRes = true;
97  }
98  return bRes;
99  }
100 }
101 
102 std::unique_ptr<SfxTabPage> SvxHeaderPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet )
103 {
104  return std::make_unique<SvxHeaderPage>( pPage, pController, *rSet );
105 }
106 
107 std::unique_ptr<SfxTabPage> SvxFooterPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet )
108 {
109  return std::make_unique<SvxFooterPage>( pPage, pController, *rSet );
110 }
111 
113  : SvxHFPage( pPage, pController, rAttr, SID_ATTR_PAGE_HEADERSET )
114 {
115 }
116 
118  : SvxHFPage( pPage, pController, rAttr, SID_ATTR_PAGE_FOOTERSET )
119 {
120 }
121 
122 SvxHFPage::SvxHFPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet, sal_uInt16 nSetId)
123  : SfxTabPage(pPage, pController, "svx/ui/headfootformatpage.ui", "HFFormatPage", &rSet)
124  , nId(nSetId)
125  , mbDisableQueryBox(false)
126  , mbEnableDrawingLayerFillStyles(false)
127  , m_xCntSharedBox(m_xBuilder->weld_check_button("checkSameLR"))
128  , m_xCntSharedFirstBox(m_xBuilder->weld_check_button("checkSameFP"))
129  , m_xLMLbl(m_xBuilder->weld_label("labelLeftMarg"))
130  , m_xLMEdit(m_xBuilder->weld_metric_spin_button("spinMargLeft", FieldUnit::CM))
131  , m_xRMLbl(m_xBuilder->weld_label("labelRightMarg"))
132  , m_xRMEdit(m_xBuilder->weld_metric_spin_button("spinMargRight", FieldUnit::CM))
133  , m_xDistFT(m_xBuilder->weld_label("labelSpacing"))
134  , m_xDistEdit(m_xBuilder->weld_metric_spin_button("spinSpacing", FieldUnit::CM))
135  , m_xDynSpacingCB(m_xBuilder->weld_check_button("checkDynSpacing"))
136  , m_xHeightFT(m_xBuilder->weld_label("labelHeight"))
137  , m_xHeightEdit(m_xBuilder->weld_metric_spin_button("spinHeight", FieldUnit::CM))
138  , m_xHeightDynBtn(m_xBuilder->weld_check_button("checkAutofit"))
139  , m_xBackgroundBtn(m_xBuilder->weld_button("buttonMore"))
140  , m_xBspWin(new weld::CustomWeld(*m_xBuilder, "drawingareaPageHF", m_aBspWin))
141 {
142  //swap header <-> footer in UI
143  if (nId == SID_ATTR_PAGE_FOOTERSET)
144  {
145  m_xContainer->set_help_id("svx/ui/headfootformatpage/FFormatPage");
146  m_xPageLbl = m_xBuilder->weld_label("labelFooterFormat");
147  m_xTurnOnBox = m_xBuilder->weld_check_button("checkFooterOn");
148 
149  /* Set custom HIDs for the Footer help page (shared/01/05040400.xhp)
150  otherwise it would display the same extended help
151  on both the Header and Footer tabs */
152  m_xCntSharedBox->set_help_id( "SVX_HID_FOOTER_CHECKSAMELR" );
153  m_xCntSharedFirstBox->set_help_id( "SVX_HID_FOOTER_CHECKSAMEFP" );
154  m_xLMEdit->set_help_id( "SVX_HID_FOOTER_SPINMARGLEFT" );
155  m_xRMEdit->set_help_id( "SVX_HID_FOOTER_SPINMARGRIGHT" );
156  m_xDistEdit->set_help_id( "SVX_HID_FOOTER_SPINSPACING" );
157  m_xDynSpacingCB->set_help_id( "SVX_HID_FOOTER_CHECKDYNSPACING" );
158  m_xHeightEdit->set_help_id( "SVX_HID_FOOTER_SPINHEIGHT" );
159  m_xHeightDynBtn->set_help_id( "SVX_HID_FOOTER_CHECKAUTOFIT" );
160  m_xBackgroundBtn->set_help_id( "SVX_HID_FOOTER_BUTTONMORE" );
161  }
162  else //Header
163  {
164  m_xContainer->set_help_id("svx/ui/headfootformatpage/HFormatPage");
165  m_xPageLbl = m_xBuilder->weld_label("labelHeaderFormat");
166  m_xTurnOnBox = m_xBuilder->weld_check_button("checkHeaderOn");
167  }
168  m_xTurnOnBox->show();
169  m_xPageLbl->show();
170 
171  InitHandler();
172  m_aBspWin.EnableRTL(false);
173 
174  // This Page needs ExchangeSupport
176 
177  // Set metrics
178  FieldUnit eFUnit = GetModuleFieldUnit( rSet );
179  SetFieldUnit( *m_xDistEdit, eFUnit );
180  SetFieldUnit( *m_xHeightEdit, eFUnit );
181  SetFieldUnit( *m_xLMEdit, eFUnit );
182  SetFieldUnit( *m_xRMEdit, eFUnit );
183 }
184 
186 {
187 }
188 
190 {
191  const sal_uInt16 nWSize = GetWhich(SID_ATTR_PAGE_SIZE);
192  const sal_uInt16 nWLRSpace = GetWhich(SID_ATTR_LRSPACE);
193  const sal_uInt16 nWULSpace = GetWhich(SID_ATTR_ULSPACE);
194  const sal_uInt16 nWOn = GetWhich(SID_ATTR_PAGE_ON);
195  const sal_uInt16 nWDynamic = GetWhich(SID_ATTR_PAGE_DYNAMIC);
196  const sal_uInt16 nWDynSpacing = GetWhich(SID_ATTR_HDFT_DYNAMIC_SPACING);
197  const sal_uInt16 nWShared = GetWhich(SID_ATTR_PAGE_SHARED);
198  const sal_uInt16 nWSharedFirst = GetWhich( SID_ATTR_PAGE_SHARED_FIRST );
199  const sal_uInt16 nWBrush = GetWhich(SID_ATTR_BRUSH);
200  const sal_uInt16 nWBox = GetWhich(SID_ATTR_BORDER_OUTER);
201  const sal_uInt16 nWBoxInfo = GetWhich(SID_ATTR_BORDER_INNER);
202  const sal_uInt16 nWShadow = GetWhich(SID_ATTR_BORDER_SHADOW);
203 
204  const sal_uInt16 aWhichTab[] = {
205  nWSize, nWSize,
206  nWLRSpace, nWLRSpace,
207  nWULSpace, nWULSpace,
208  nWOn, nWOn,
209  nWDynamic, nWDynamic,
210  nWShared, nWShared,
211  nWSharedFirst, nWSharedFirst,
212  nWBrush, nWBrush,
213  nWBoxInfo, nWBoxInfo,
214  nWBox, nWBox,
215  nWShadow, nWShadow,
216  nWDynSpacing, nWDynSpacing,
217 
218  // take over DrawingLayer FillStyles
220 
221  0, 0};
222 
223  const SfxItemSet& rOldSet = GetItemSet();
224  SfxItemPool* pPool = rOldSet.GetPool();
225  DBG_ASSERT(pPool,"no pool :-(");
226  MapUnit eUnit = pPool->GetMetric(nWSize);
227  SfxItemSet aSet(*pPool,aWhichTab);
228 
230  {
231  // When using the XATTR_FILLSTYLE DrawingLayer FillStyle definition
232  // extra action has to be done here since the pool default is drawing::FillStyle_SOLID
233  // instead of drawing::FillStyle_NONE (to have the default blue fill color at start).
234  aSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
235  }
236 
237  aSet.Put( SfxBoolItem( nWOn, m_xTurnOnBox->get_active() ) );
238  aSet.Put( SfxBoolItem( nWDynamic, m_xHeightDynBtn->get_active() ) );
239  aSet.Put( SfxBoolItem( nWShared, m_xCntSharedBox->get_active() ) );
240  if(m_xCntSharedFirstBox->get_visible())
241  aSet.Put(SfxBoolItem(nWSharedFirst, m_xCntSharedFirstBox->get_active()));
242  if (m_xDynSpacingCB->get_visible() && SfxItemPool::IsWhich(nWDynSpacing))
243  {
244  std::unique_ptr<SfxBoolItem> pBoolItem(static_cast<SfxBoolItem*>(pPool->GetDefaultItem(nWDynSpacing).Clone()));
245  pBoolItem->SetValue(m_xDynSpacingCB->get_active());
246  aSet.Put(std::move(pBoolItem));
247  }
248 
249  // Size
250  SvxSizeItem aSizeItem( static_cast<const SvxSizeItem&>(rOldSet.Get( nWSize )) );
251  Size aSize( aSizeItem.GetSize() );
252  long nDist = GetCoreValue( *m_xDistEdit, eUnit );
253  long nH = GetCoreValue( *m_xHeightEdit, eUnit );
254 
255  nH += nDist; // add distance
256  aSize.setHeight( nH );
257  aSizeItem.SetSize( aSize );
258  aSet.Put( aSizeItem );
259 
260  // Margins
261  SvxLRSpaceItem aLR( nWLRSpace );
262  aLR.SetLeft( static_cast<sal_uInt16>(GetCoreValue( *m_xLMEdit, eUnit )) );
263  aLR.SetRight( static_cast<sal_uInt16>(GetCoreValue( *m_xRMEdit, eUnit )) );
264  aSet.Put( aLR );
265 
266  SvxULSpaceItem aUL( nWULSpace );
267  if ( nId == SID_ATTR_PAGE_HEADERSET )
268  aUL.SetLower( static_cast<sal_uInt16>(nDist) );
269  else
270  aUL.SetUpper( static_cast<sal_uInt16>(nDist) );
271  aSet.Put( aUL );
272 
273  // Background and border?
274  if (pBBSet)
275  {
276  aSet.Put(*pBBSet);
277  }
278  else
279  {
280  const SfxPoolItem* pItem;
281 
282  if(SfxItemState::SET == GetItemSet().GetItemState(GetWhich(nId), false, &pItem))
283  {
284  const SfxItemSet* _pSet = &(static_cast< const SvxSetItem* >(pItem)->GetItemSet());
285 
286  if(_pSet->GetItemState(nWBrush) == SfxItemState::SET)
287  {
288  aSet.Put(_pSet->Get(nWBrush));
289  }
290 
291  if(_pSet->GetItemState(nWBoxInfo) == SfxItemState::SET)
292  {
293  aSet.Put(_pSet->Get(nWBoxInfo));
294  }
295 
296  if(_pSet->GetItemState(nWBox) == SfxItemState::SET)
297  {
298  aSet.Put(_pSet->Get(nWBox));
299  }
300 
301  if(_pSet->GetItemState(nWShadow) == SfxItemState::SET)
302  {
303  aSet.Put(_pSet->Get(nWShadow));
304  }
305 
306  // take care of [XATTR_XATTR_FILL_FIRST .. XATTR_FILL_LAST]
307  for(sal_uInt16 nFillStyleId(XATTR_FILL_FIRST); nFillStyleId <= XATTR_FILL_LAST; nFillStyleId++)
308  {
309  if(_pSet->GetItemState(nFillStyleId) == SfxItemState::SET)
310  {
311  aSet.Put(_pSet->Get(nFillStyleId));
312  }
313  }
314  }
315  }
316 
317  // Flush the SetItem
318  SvxSetItem aSetItem( GetWhich( nId ), aSet );
319  rSet->Put( aSetItem );
320 
321  return true;
322 }
323 
324 
325 void SvxHFPage::Reset( const SfxItemSet* rSet )
326 {
327  ActivatePage( *rSet );
328  ResetBackground_Impl( *rSet );
329 
330  SfxItemPool* pPool = GetItemSet().GetPool();
331  DBG_ASSERT( pPool, "Where is the pool" );
332  MapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_PAGE_SIZE ) );
333 
334  //hide "same content on first page when this is calc
335  bool bIsCalc = false;
336  const SfxPoolItem* pExt1 = GetItem(*rSet, SID_ATTR_PAGE_EXT1);
337  const SfxPoolItem* pExt2 = GetItem(*rSet, SID_ATTR_PAGE_EXT2);
338  if (dynamic_cast<const SfxBoolItem*>(pExt1) && dynamic_cast<const SfxBoolItem*>(pExt2) )
339  bIsCalc = true;
340  m_xCntSharedFirstBox->set_visible(!bIsCalc);
341 
342  // Evaluate header-/footer- attributes
343  const SvxSetItem* pSetItem = nullptr;
344 
345  if ( SfxItemState::SET == rSet->GetItemState( GetWhich(nId), false,
346  reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
347  {
348  const SfxItemSet& rHeaderSet = pSetItem->GetItemSet();
349  const SfxBoolItem& rHeaderOn =
350  static_cast<const SfxBoolItem&>(rHeaderSet.Get(GetWhich(SID_ATTR_PAGE_ON)));
351 
352  m_xTurnOnBox->set_active(rHeaderOn.GetValue());
353 
354  if ( rHeaderOn.GetValue() )
355  {
356  const SfxBoolItem& rDynamic =
357  static_cast<const SfxBoolItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_DYNAMIC ) ));
358  const SfxBoolItem& rShared =
359  static_cast<const SfxBoolItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SHARED ) ));
360  const SfxBoolItem* pSharedFirst = nullptr;
361  if (rHeaderSet.HasItem(GetWhich(SID_ATTR_PAGE_SHARED_FIRST)))
362  pSharedFirst = static_cast<const SfxBoolItem*>(&rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SHARED_FIRST ) ));
363  const SvxSizeItem& rSize =
364  static_cast<const SvxSizeItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ));
365  const SvxULSpaceItem& rUL =
366  static_cast<const SvxULSpaceItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_ULSPACE ) ));
367  const SvxLRSpaceItem& rLR =
368  static_cast<const SvxLRSpaceItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
369  if (m_xDynSpacingCB->get_visible())
370  {
371  const SfxBoolItem& rDynSpacing =
372  static_cast<const SfxBoolItem&>(rHeaderSet.Get(GetWhich(SID_ATTR_HDFT_DYNAMIC_SPACING)));
373  m_xDynSpacingCB->set_active(rDynSpacing.GetValue());
374  }
375 
376 
377  if ( nId == SID_ATTR_PAGE_HEADERSET )
378  { // Header
379  SetMetricValue( *m_xDistEdit, rUL.GetLower(), eUnit );
380  SetMetricValue( *m_xHeightEdit, rSize.GetSize().Height() - rUL.GetLower(), eUnit );
381  }
382  else
383  { // Footer
384  SetMetricValue( *m_xDistEdit, rUL.GetUpper(), eUnit );
385  SetMetricValue( *m_xHeightEdit, rSize.GetSize().Height() - rUL.GetUpper(), eUnit );
386  }
387 
388  m_xHeightDynBtn->set_active(rDynamic.GetValue());
389  SetMetricValue( *m_xLMEdit, rLR.GetLeft(), eUnit );
390  SetMetricValue( *m_xRMEdit, rLR.GetRight(), eUnit );
391  m_xCntSharedBox->set_active(rShared.GetValue());
392  if (pSharedFirst)
393  m_xCntSharedFirstBox->set_active(pSharedFirst->GetValue());
394  else
395  m_xCntSharedFirstBox->hide();
396  }
397  else
398  pSetItem = nullptr;
399  }
400  else
401  {
402  // defaults for distance and height
403  long nDefaultDist = bIsCalc ? DEF_DIST_CALC : DEF_DIST_WRITER;
404  SetMetricValue( *m_xDistEdit, nDefaultDist, MapUnit::Map100thMM );
405  SetMetricValue( *m_xHeightEdit, 500, MapUnit::Map100thMM );
406  }
407 
408  if ( !pSetItem )
409  {
410  m_xTurnOnBox->set_active(false);
411  m_xHeightDynBtn->set_active(true);
412  m_xCntSharedBox->set_active(true);
413  m_xCntSharedFirstBox->set_active(true);
414  }
415 
416  TurnOn(nullptr);
417 
418  m_xTurnOnBox->save_state();
419  m_xDistEdit->save_value();
420  m_xHeightEdit->save_value();
421  m_xHeightDynBtn->save_state();
422  m_xLMEdit->save_value();
423  m_xRMEdit->save_value();
424  m_xCntSharedBox->save_state();
425  RangeHdl();
426 
427  const SfxPoolItem* pItem = nullptr;
428  SfxObjectShell* pShell;
429  if(SfxItemState::SET == rSet->GetItemState(SID_HTML_MODE, false, &pItem) ||
430  ( nullptr != (pShell = SfxObjectShell::Current()) &&
431  nullptr != (pItem = pShell->GetItem(SID_HTML_MODE))))
432  {
433  sal_uInt16 nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
434  if (nHtmlMode & HTMLMODE_ON)
435  {
436  m_xCntSharedBox->hide();
437  m_xBackgroundBtn->hide();
438  }
439  }
440 
441 }
442 
444 {
445  m_xTurnOnBox->connect_toggled(LINK(this, SvxHFPage, TurnOnHdl));
446  m_xDistEdit->connect_value_changed(LINK(this, SvxHFPage, ValueChangeHdl));
447  m_xHeightEdit->connect_value_changed(LINK(this,SvxHFPage,ValueChangeHdl));
448 
449  m_xLMEdit->connect_value_changed(LINK(this, SvxHFPage, ValueChangeHdl));
450  m_xRMEdit->connect_value_changed(LINK(this, SvxHFPage, ValueChangeHdl));
451  m_xBackgroundBtn->connect_clicked(LINK(this,SvxHFPage, BackgroundHdl));
452 }
453 
455 {
456  if (m_xTurnOnBox->get_active())
457  {
458  m_xDistFT->set_sensitive(true);
459  m_xDistEdit->set_sensitive(true);
460  m_xDynSpacingCB->set_sensitive(true);
461  m_xHeightFT->set_sensitive(true);
462  m_xHeightEdit->set_sensitive(true);
463  m_xHeightDynBtn->set_sensitive(true);
464  m_xLMLbl->set_sensitive(true);
465  m_xLMEdit->set_sensitive(true);
466  m_xRMLbl->set_sensitive(true);
467  m_xRMEdit->set_sensitive(true);
468 
469  SvxPageUsage nUsage = m_aBspWin.GetUsage();
470 
471  if( nUsage == SvxPageUsage::Right || nUsage == SvxPageUsage::Left )
472  m_xCntSharedBox->set_sensitive(false);
473  else
474  {
475  m_xCntSharedBox->set_sensitive(true);
476  m_xCntSharedFirstBox->set_sensitive(true);
477  }
478  m_xBackgroundBtn->set_sensitive(true);
479  }
480  else
481  {
482  bool bDelete = true;
483 
484  if (!mbDisableQueryBox && pBox && m_xTurnOnBox->get_saved_state() == TRISTATE_TRUE)
485  {
486  short nResult;
487  if (nId == SID_ATTR_PAGE_HEADERSET)
488  {
490  nResult = aDlg.run();
491  }
492  else
493  {
495  nResult = aDlg.run();
496  }
497  bDelete = nResult == RET_YES;
498  }
499 
500  if ( bDelete )
501  {
502  m_xDistFT->set_sensitive(false);
503  m_xDistEdit->set_sensitive(false);
504  m_xDynSpacingCB->set_sensitive(false);
505  m_xHeightFT->set_sensitive(false);
506  m_xHeightEdit->set_sensitive(false);
507  m_xHeightDynBtn->set_sensitive(false);
508 
509  m_xLMLbl->set_sensitive(false);
510  m_xLMEdit->set_sensitive(false);
511  m_xRMLbl->set_sensitive(false);
512  m_xRMEdit->set_sensitive(false);
513 
514  m_xCntSharedBox->set_sensitive(false);
515  m_xBackgroundBtn->set_sensitive(false);
516  m_xCntSharedFirstBox->set_sensitive(false);
517  }
518  else
519  m_xTurnOnBox->set_active(true);
520  }
521  UpdateExample();
522 }
523 
524 IMPL_LINK(SvxHFPage, TurnOnHdl, weld::ToggleButton&, rBox, void)
525 {
526  TurnOn(&rBox);
527 }
528 
529 IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void)
530 {
531  if(!pBBSet)
532  {
533  // Use only the necessary items for border and background
534  const sal_uInt16 nOuter(GetWhich(SID_ATTR_BORDER_OUTER));
535  const sal_uInt16 nInner(GetWhich(SID_ATTR_BORDER_INNER, false));
536  const sal_uInt16 nShadow(GetWhich(SID_ATTR_BORDER_SHADOW));
537 
538  if(mbEnableDrawingLayerFillStyles)
539  {
540  pBBSet.reset(new SfxItemSet(
541  *GetItemSet().GetPool(),
542  {{XATTR_FILL_FIRST, XATTR_FILL_LAST}, // DrawingLayer FillStyle definitions
543  {SID_COLOR_TABLE, SID_PATTERN_LIST}, // XPropertyLists for Color, Gradient, Hatch and Graphic fills
544  {nOuter, nOuter},
545  {nInner, nInner},
546  {nShadow, nShadow}}));
547 
548  // copy items for XPropertyList entries from the DrawModel so that
549  // the Area TabPage can access them
550  static const sal_uInt16 nCopyFlags[] = {
551  SID_COLOR_TABLE,
552  SID_GRADIENT_LIST,
553  SID_HATCH_LIST,
554  SID_BITMAP_LIST,
555  SID_PATTERN_LIST,
556  0
557  };
558 
559  for(sal_uInt16 a(0); nCopyFlags[a]; a++)
560  {
561  const SfxPoolItem* pItem = GetItemSet().GetItem(nCopyFlags[a]);
562 
563  if(pItem)
564  {
565  pBBSet->Put(*pItem);
566  }
567  else
568  {
569  OSL_ENSURE(false, "XPropertyList missing (!)");
570  }
571  }
572  }
573  else
574  {
575  const sal_uInt16 nBrush(GetWhich(SID_ATTR_BRUSH));
576 
577  pBBSet.reset( new SfxItemSet(
578  *GetItemSet().GetPool(),
580  {nBrush, nBrush},
581  {nOuter, nOuter},
582  {nInner, nInner},
583  {nShadow, nShadow}}) );
584  }
585 
586  const SfxPoolItem* pItem;
587 
588  if(SfxItemState::SET == GetItemSet().GetItemState(GetWhich(nId), false, &pItem))
589  {
590  // If a SfxItemSet from the SetItem for SID_ATTR_PAGE_HEADERSET or
591  // SID_ATTR_PAGE_FOOTERSET exists, use its content
592  pBBSet->Put(static_cast<const SvxSetItem*>(pItem)->GetItemSet());
593  }
594  else
595  {
596  if(mbEnableDrawingLayerFillStyles)
597  {
598  // The style for header/footer is not yet created, need to reset
599  // XFillStyleItem to drawing::FillStyle_NONE which is the same as in the style
600  // initialization. This needs to be done since the pool default for
601  // XFillStyleItem is drawing::FillStyle_SOLID
602  pBBSet->Put(XFillStyleItem(drawing::FillStyle_NONE));
603  }
604  }
605 
606  if(SfxItemState::SET == GetItemSet().GetItemState(nInner, false, &pItem))
607  {
608  // The set InfoItem is always required
609  pBBSet->Put(*pItem);
610  }
611  }
612 
614 
616  GetFrameWeld(),
617  *pBBSet,
618  mbEnableDrawingLayerFillStyles));
619 
620  pDlg->StartExecuteAsync([&](sal_Int32 nResult) {
621  if (nResult == RET_OK && pDlg->GetOutputItemSet())
622  {
623  SfxItemIter aIter(*pDlg->GetOutputItemSet());
624 
625  for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
626  {
627  if(!IsInvalidItem(pItem))
628  {
629  pBBSet->Put(*pItem);
630  }
631  }
632 
633  {
635 
636  if (mbEnableDrawingLayerFillStyles)
637  {
638  // create FillAttributes directly from DrawingLayer FillStyle entries
639  aFillAttributes =
640  std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(*pBBSet);
641  }
642  else
643  {
644  const sal_uInt16 nWhich = GetWhich(SID_ATTR_BRUSH);
645 
646  if (pBBSet->GetItemState(nWhich) == SfxItemState::SET)
647  {
648  // create FillAttributes from SvxBrushItem
649  const SvxBrushItem& rItem
650  = static_cast<const SvxBrushItem&>(pBBSet->Get(nWhich));
651  SfxItemSet aTempSet(*pBBSet->GetPool(),
653 
655  aFillAttributes =
656  std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
657  }
658  }
659 
660  if (SID_ATTR_PAGE_HEADERSET == nId)
661  {
662  //m_aBspWin.SetHdColor(rItem.GetColor());
663  m_aBspWin.setHeaderFillAttributes(aFillAttributes);
664  }
665  else
666  {
667  //m_aBspWin.SetFtColor(rItem.GetColor());
668  m_aBspWin.setFooterFillAttributes(aFillAttributes);
669  }
670  }
671  }
672  });
673 
674  UpdateExample();
675 }
676 
678 {
679  if ( nId == SID_ATTR_PAGE_HEADERSET )
680  {
681  m_aBspWin.SetHeader( m_xTurnOnBox->get_active() );
682  m_aBspWin.SetHdHeight( GetCoreValue( *m_xHeightEdit, MapUnit::MapTwip ) );
683  m_aBspWin.SetHdDist( GetCoreValue( *m_xDistEdit, MapUnit::MapTwip ) );
684  m_aBspWin.SetHdLeft( GetCoreValue( *m_xLMEdit, MapUnit::MapTwip ) );
685  m_aBspWin.SetHdRight( GetCoreValue( *m_xRMEdit, MapUnit::MapTwip ) );
686  }
687  else
688  {
689  m_aBspWin.SetFooter( m_xTurnOnBox->get_active() );
690  m_aBspWin.SetFtHeight( GetCoreValue( *m_xHeightEdit, MapUnit::MapTwip ) );
691  m_aBspWin.SetFtDist( GetCoreValue( *m_xDistEdit, MapUnit::MapTwip ) );
692  m_aBspWin.SetFtLeft( GetCoreValue( *m_xLMEdit, MapUnit::MapTwip ) );
693  m_aBspWin.SetFtRight( GetCoreValue( *m_xRMEdit, MapUnit::MapTwip ) );
694  }
696 }
697 
699 {
700  sal_uInt16 nWhich(GetWhich(SID_ATTR_PAGE_HEADERSET));
701 
702  if (SfxItemState::SET == rSet.GetItemState(nWhich, false))
703  {
704  const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false));
705  const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
706  const SfxBoolItem& rOn = static_cast< const SfxBoolItem& >(rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON)));
707 
708  if(rOn.GetValue())
709  {
711 
713  {
714  // create FillAttributes directly from DrawingLayer FillStyle entries
715  aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet);
716  }
717  else
718  {
719  nWhich = GetWhich(SID_ATTR_BRUSH);
720 
721  if(SfxItemState::SET == rTmpSet.GetItemState(nWhich))
722  {
723  // create FillAttributes from SvxBrushItem
724  const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
726 
728  aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
729  }
730  }
731 
732  m_aBspWin.setHeaderFillAttributes(aHeaderFillAttributes);
733  }
734  }
735 
736  nWhich = GetWhich(SID_ATTR_PAGE_FOOTERSET);
737 
738  if (SfxItemState::SET == rSet.GetItemState(nWhich, false))
739  {
740  const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false));
741  const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
742  const SfxBoolItem& rOn = static_cast< const SfxBoolItem& >(rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON)));
743 
744  if(rOn.GetValue())
745  {
747 
749  {
750  // create FillAttributes directly from DrawingLayer FillStyle entries
751  aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet);
752  }
753  else
754  {
755  nWhich = GetWhich(SID_ATTR_BRUSH);
756 
757  if(SfxItemState::SET == rTmpSet.GetItemState(nWhich))
758  {
759  // create FillAttributes from SvxBrushItem
760  const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
762 
764  aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
765  }
766  }
767 
768  m_aBspWin.setFooterFillAttributes(aFooterFillAttributes);
769  }
770  }
771 
773 
775  {
776  // create FillAttributes directly from DrawingLayer FillStyle entries
777  aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rSet);
778  }
779  else
780  {
781  nWhich = GetWhich(SID_ATTR_BRUSH);
782 
783  if(rSet.GetItemState(nWhich) >= SfxItemState::DEFAULT)
784  {
785  // create FillAttributes from SvxBrushItem
786  const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rSet.Get(nWhich));
788 
790  aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
791  }
792  }
793 
794  m_aBspWin.setPageFillAttributes(aPageFillAttributes);
795 }
796 
798 {
799  const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_LRSPACE );
800 
801  if ( pItem )
802  {
803  // Set left and right margins
804  const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem);
805 
806  m_aBspWin.SetLeft( rLRSpace.GetLeft() );
807  m_aBspWin.SetRight( rLRSpace.GetRight() );
808  }
809  else
810  {
811  m_aBspWin.SetLeft( 0 );
812  m_aBspWin.SetRight( 0 );
813  }
814 
815  pItem = GetItem( rSet, SID_ATTR_ULSPACE );
816 
817  if ( pItem )
818  {
819  // Set top and bottom margins
820  const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(*pItem);
821 
822  m_aBspWin.SetTop( rULSpace.GetUpper() );
823  m_aBspWin.SetBottom( rULSpace.GetLower() );
824  }
825  else
826  {
827  m_aBspWin.SetTop( 0 );
828  m_aBspWin.SetBottom( 0 );
829  }
830 
832  pItem = GetItem( rSet, SID_ATTR_PAGE );
833 
834  if ( pItem )
835  nUsage = static_cast<const SvxPageItem*>(pItem)->GetPageUsage();
836 
837  m_aBspWin.SetUsage( nUsage );
838 
839  if ( SvxPageUsage::Right == nUsage || SvxPageUsage::Left == nUsage )
840  m_xCntSharedBox->set_sensitive(false);
841  else
842  {
843  m_xCntSharedBox->set_sensitive(true);
844  m_xCntSharedFirstBox->set_sensitive(true);
845  }
846  pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE );
847 
848  if ( pItem )
849  {
850  // Orientation and Size from the PageItem
851  const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(*pItem);
852  // if the size is already swapped (Landscape)
853  m_aBspWin.SetSize( rSize.GetSize() );
854  }
855 
856  // Evaluate Header attribute
857  const SvxSetItem* pSetItem = nullptr;
858 
859  if ( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_PAGE_HEADERSET ),
860  false,
861  reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
862  {
863  const SfxItemSet& rHeaderSet = pSetItem->GetItemSet();
864  const SfxBoolItem& rHeaderOn =
865  static_cast<const SfxBoolItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ));
866 
867  if ( rHeaderOn.GetValue() )
868  {
869  const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(
870  rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ));
871  const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(
872  rHeaderSet.Get( GetWhich(SID_ATTR_ULSPACE ) ));
873  const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(
874  rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
875  long nDist = rUL.GetLower();
876 
877  m_aBspWin.SetHdHeight( rSize.GetSize().Height() - nDist );
878  m_aBspWin.SetHdDist( nDist );
879  m_aBspWin.SetHdLeft( rLR.GetLeft() );
880  m_aBspWin.SetHdRight( rLR.GetRight() );
881  m_aBspWin.SetHeader( true );
882  }
883  else
884  pSetItem = nullptr;
885  }
886 
887  if ( !pSetItem )
888  {
889  m_aBspWin.SetHeader( false );
890 
891  if ( SID_ATTR_PAGE_HEADERSET == nId )
892  {
893  m_xCntSharedBox->set_sensitive(false);
894  m_xCntSharedFirstBox->set_sensitive(false);
895  }
896  }
897  pSetItem = nullptr;
898 
899  if ( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_PAGE_FOOTERSET ),
900  false,
901  reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
902  {
903  const SfxItemSet& rFooterSet = pSetItem->GetItemSet();
904  const SfxBoolItem& rFooterOn =
905  static_cast<const SfxBoolItem&>(rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ));
906 
907  if ( rFooterOn.GetValue() )
908  {
909  const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(
910  rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ));
911  const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(
912  rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) ));
913  const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(
914  rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
915  long nDist = rUL.GetUpper();
916 
917  m_aBspWin.SetFtHeight( rSize.GetSize().Height() - nDist );
918  m_aBspWin.SetFtDist( nDist );
919  m_aBspWin.SetFtLeft( rLR.GetLeft() );
920  m_aBspWin.SetFtRight( rLR.GetRight() );
921  m_aBspWin.SetFooter( true );
922  }
923  else
924  pSetItem = nullptr;
925  }
926 
927  if ( !pSetItem )
928  {
929  m_aBspWin.SetFooter( false );
930 
931  if ( SID_ATTR_PAGE_FOOTERSET == nId )
932  {
933  m_xCntSharedBox->set_sensitive(false);
934  m_xCntSharedFirstBox->set_sensitive(false);
935  }
936  }
937 
938  pItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 );
939 
940  if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
941  {
942  m_aBspWin.SetTable( true );
943  m_aBspWin.SetHorz( pBoolItem->GetValue() );
944  }
945 
946  pItem = GetItem( rSet, SID_ATTR_PAGE_EXT2 );
947 
948  if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
949  {
950  m_aBspWin.SetTable( true );
951  m_aBspWin.SetVert( pBoolItem->GetValue() );
952  }
953  ResetBackground_Impl( rSet );
954  RangeHdl();
955 }
956 
958 {
959  if ( _pSet )
960  FillItemSet( _pSet );
961  return DeactivateRC::LeavePage;
962 }
963 
965 {
966  UpdateExample();
967  RangeHdl();
968 }
969 
971 {
972  long nHHeight = m_aBspWin.GetHdHeight();
973  long nHDist = m_aBspWin.GetHdDist();
974 
975  long nFHeight = m_aBspWin.GetFtHeight();
976  long nFDist = m_aBspWin.GetFtDist();
977 
978  long nHeight = std::max(long(MINBODY),
979  static_cast<long>(m_xHeightEdit->denormalize(m_xHeightEdit->get_value(FieldUnit::TWIP))));
980  long nDist = m_xTurnOnBox->get_active() ?
981  static_cast<long>(m_xDistEdit->denormalize(m_xDistEdit->get_value(FieldUnit::TWIP))) : 0;
982 
983  long nMin;
984  long nMax;
985 
986  if ( nId == SID_ATTR_PAGE_HEADERSET )
987  {
988  nHHeight = nHeight;
989  nHDist = nDist;
990  }
991  else
992  {
993  nFHeight = nHeight;
994  nFDist = nDist;
995  }
996 
997  // Current values of the side edges
998  long nBT = m_aBspWin.GetTop();
999  long nBB = m_aBspWin.GetBottom();
1000  long nBL = m_aBspWin.GetLeft();
1001  long nBR = m_aBspWin.GetRight();
1002 
1003  long nH = m_aBspWin.GetSize().Height();
1004  long nW = m_aBspWin.GetSize().Width();
1005 
1006  // Borders
1007  if ( nId == SID_ATTR_PAGE_HEADERSET )
1008  {
1009  // Header
1010  nMin = ( nH - nBB - nBT ) / 5; // 20%
1011  nMax = std::max( nH - nMin - nHDist - nFDist - nFHeight - nBB - nBT,
1012  nMin );
1013  m_xHeightEdit->set_max(m_xHeightEdit->normalize(nMax), FieldUnit::TWIP);
1014  nMin = ( nH - nBB - nBT ) / 5; // 20%
1015  nDist = std::max( nH - nMin - nHHeight - nFDist - nFHeight - nBB - nBT,
1016  long(0) );
1017  m_xDistEdit->set_max(m_xDistEdit->normalize(nDist), FieldUnit::TWIP);
1018  }
1019  else
1020  {
1021  // Footer
1022  nMin = ( nH - nBT - nBB ) / 5; // 20%
1023  nMax = std::max( nH - nMin - nFDist - nHDist - nHHeight - nBT - nBB,
1024  nMin );
1025  m_xHeightEdit->set_max(m_xHeightEdit->normalize(nMax), FieldUnit::TWIP);
1026  nMin = ( nH - nBT - nBB ) / 5; // 20%
1027  nDist = std::max( nH - nMin - nFHeight - nHDist - nHHeight - nBT - nBB,
1028  long(0) );
1029  m_xDistEdit->set_max(m_xDistEdit->normalize(nDist), FieldUnit::TWIP);
1030  }
1031 
1032  // Limit Indentation
1033  nMax = nW - nBL - nBR -
1034  static_cast<long>(m_xRMEdit->denormalize(m_xRMEdit->get_value(FieldUnit::TWIP))) - MINBODY;
1035  m_xLMEdit->set_max(m_xLMEdit->normalize(nMax), FieldUnit::TWIP);
1036 
1037  nMax = nW - nBL - nBR -
1038  static_cast<long>(m_xLMEdit->denormalize(m_xLMEdit->get_value(FieldUnit::TWIP))) - MINBODY;
1039  m_xRMEdit->set_max(m_xLMEdit->normalize(nMax), FieldUnit::TWIP);
1040 }
1041 
1043 {
1044  m_xDynSpacingCB->show();
1045 }
1046 
1048 {
1049  const SfxBoolItem* pSupportDrawingLayerFillStyleItem = rSet.GetItem<SfxBoolItem>(SID_DRAWINGLAYER_FILLSTYLES, false);
1050 
1051  if (pSupportDrawingLayerFillStyleItem)
1052  {
1053  const bool bNew(pSupportDrawingLayerFillStyleItem->GetValue());
1054 
1056  }
1057 }
1058 
1059 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long GetLeft() const
bool GetValue() const
long Width() const
long GetFtHeight() const
Definition: pagectrl.hxx:134
std::unique_ptr< weld::MetricSpinButton > m_xHeightEdit
Definition: hdft.hxx:78
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
void SetFtRight(long nNew)
Definition: pagectrl.hxx:127
void SetHdRight(long nNew)
Definition: pagectrl.hxx:117
IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button &, void)
Definition: hdft.cxx:529
FieldUnit
long GetTop() const
Definition: pagectrl.hxx:111
void SetBottom(long nNew)
Definition: pagectrl.hxx:107
void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
Definition: pagectrl.hxx:81
sal_uInt16 GetLower() const
void SetFooter(bool bNew)
Definition: pagectrl.hxx:140
void SetHdDist(long nNew)
Definition: pagectrl.hxx:118
SVX_DLLPRIVATE SvxFooterPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: hdft.cxx:117
std::string GetValue
virtual VclPtr< SfxAbstractTabDialog > CreateSvxBorderBackgroundDlg(weld::Window *pParent, const SfxItemSet &rCoreSet, bool bEnableDrawingLayerFillStyles)=0
long Height() const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
Definition: pagectrl.hxx:89
static SvxAbstractDialogFactory * Create()
Definition: svxdlg.cxx:23
void InitHandler()
Definition: hdft.cxx:443
SvxPageWindow m_aBspWin
Definition: hdft.hxx:65
long GetBottom() const
Definition: pagectrl.hxx:112
void UpdateExample()
Definition: hdft.cxx:677
const SfxItemSet & GetItemSet() const
sal_Int16 nId
static SfxObjectShell * Current()
sal_uInt16 const nId
Definition: hdft.hxx:60
void SetHdLeft(long nNew)
Definition: pagectrl.hxx:116
TRISTATE_TRUE
void EnableDynamicSpacing()
Definition: hdft.cxx:1042
static const SfxPoolItem * GetItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
Definition: dlgutil.cxx:31
void SetFtLeft(long nNew)
Definition: pagectrl.hxx:126
static const long MINBODY
Definition: hdft.cxx:50
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
std::unique_ptr< weld::MetricSpinButton > m_xLMEdit
Definition: hdft.hxx:71
bool ShowBorderBackgroundDlg(weld::Window *pParent, SfxItemSet *pBBSet)
Definition: hdft.cxx:82
void SetTable(bool bNew)
Definition: pagectrl.hxx:141
Reference< XNameAccess > m_xContainer
void SetLeft(const long nL, const sal_uInt16 nProp=100)
RET_YES
SVX_DLLPRIVATE SvxHeaderPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: hdft.cxx:112
void SetExchangeSupport()
void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
Definition: pagectrl.hxx:85
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
static const long DEF_DIST_CALC
Definition: hdft.cxx:54
virtual void Reset(const SfxItemSet *rSet) override
Definition: hdft.cxx:325
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
const SfxItemSet & GetItemSet() const
std::unique_ptr< weld::MetricSpinButton > m_xRMEdit
Definition: hdft.hxx:73
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
virtual void PageCreated(const SfxAllItemSet &) override
Definition: hdft.cxx:1047
void SetRight(const long nR, const sal_uInt16 nProp=100)
std::unique_ptr< weld::CheckButton > m_xTurnOnBox
Definition: hdft.hxx:67
SvxHFPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet, sal_uInt16 nSetId)
Definition: hdft.cxx:122
std::unique_ptr< weld::Label > m_xDistFT
Definition: hdft.hxx:74
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
void SetTop(long nNew)
Definition: pagectrl.hxx:106
uno_Any a
std::unique_ptr< weld::CheckButton > m_xHeightDynBtn
Definition: hdft.hxx:79
std::unique_ptr< weld::CheckButton > m_xCntSharedBox
Definition: hdft.hxx:68
static bool GetWhich(const SfxItemSet &rSet, sal_uInt16 nSlot, sal_uInt16 &rWhich)
Definition: fntctrl.cxx:458
void SetHeader(bool bNew)
Definition: pagectrl.hxx:139
int GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
HTMLMODE_ON
void SetFtHeight(long nNew)
Definition: pagectrl.hxx:129
void SetHdHeight(long nNew)
Definition: pagectrl.hxx:119
std::unique_ptr< SfxItemSet > pBBSet
Definition: hdft.hxx:61
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
std::unique_ptr< weld::Label > m_xHeightFT
Definition: hdft.hxx:77
void SetSize(const Size &rSize)
Definition: pagectrl.hxx:97
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
long GetFtDist() const
Definition: pagectrl.hxx:133
void RangeHdl()
Definition: hdft.cxx:970
void SetMetricValue(weld::MetricSpinButton &rField, int nCoreValue, MapUnit eUnit)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
long GetLeft() const
Definition: pagectrl.hxx:113
SfxItemPool * GetPool() const
SVX_DLLPRIVATE void ResetBackground_Impl(const SfxItemSet &rSet)
Definition: hdft.cxx:698
SvxPageUsage GetUsage() const
Definition: pagectrl.hxx:137
SvxPageUsage
Definition: pageitem.hxx:34
void TurnOn(const weld::ToggleButton *pButton)
Definition: hdft.cxx:454
const Size & GetSize() const
Definition: pagectrl.hxx:101
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
weld::Window * GetFrameWeld() const
long GetHdDist() const
Definition: pagectrl.hxx:123
std::unique_ptr< weld::Button > m_xBackgroundBtn
Definition: hdft.hxx:80
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
RET_OK
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
void SetSize(const Size &rSize)
long GetRight() const
Definition: pagectrl.hxx:114
virtual short run()
virtual ~SvxHFPage() override
Definition: hdft.cxx:185
bool mbDisableQueryBox
Definition: hdft.hxx:62
void SetRight(long nNew)
Definition: pagectrl.hxx:109
IMPL_LINK(SvxHFPage, TurnOnHdl, weld::ToggleButton &, rBox, void)
Definition: hdft.cxx:524
constexpr sal_uInt16 XATTR_FILL_FIRST
Definition: xdef.hxx:106
std::unique_ptr< weld::Label > m_xRMLbl
Definition: hdft.hxx:72
static const long DEF_DIST_WRITER
Definition: hdft.cxx:53
long GetRight() const
virtual bool FillItemSet(SfxItemSet *rOutSet) override
Definition: hdft.cxx:189
DeactivateRC
constexpr sal_uInt16 XATTR_FILL_LAST
Definition: xdef.hxx:127
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: hdft.cxx:797
MapUnit
std::unique_ptr< weld::CheckButton > m_xCntSharedFirstBox
Definition: hdft.hxx:69
long GetHdHeight() const
Definition: pagectrl.hxx:124
void SetUsage(SvxPageUsage eU)
Definition: pagectrl.hxx:136
void SetHorz(bool bNew)
Definition: pagectrl.hxx:142
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: hdft.cxx:107
bool mbEnableDrawingLayerFillStyles
Definition: hdft.hxx:63
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: hdft.cxx:957
bool IsInvalidItem(const SfxPoolItem *pItem)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
std::unique_ptr< weld::CheckButton > m_xDynSpacingCB
Definition: hdft.hxx:76
std::unique_ptr< weld::MetricSpinButton > m_xDistEdit
Definition: hdft.hxx:75
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
static const sal_uInt16 pRanges[]
Definition: hdft.hxx:53
void SetLeft(long nNew)
Definition: pagectrl.hxx:108
std::unique_ptr< weld::Label > m_xLMLbl
Definition: hdft.hxx:70
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: hdft.cxx:102
void SetVert(bool bNew)
Definition: pagectrl.hxx:143
static bool IsWhich(sal_uInt16 nId)
const Size & GetSize() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
void SetFtDist(long nNew)
Definition: pagectrl.hxx:128
sal_uInt16 GetUpper() const
void EnableRTL(bool bEnable)
std::unique_ptr< weld::Label > m_xPageLbl
Definition: hdft.hxx:66