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