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([pDlg, this](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  pDlg->disposeOnce();
673  });
674 
675  UpdateExample();
676 }
677 
679 {
680  if ( nId == SID_ATTR_PAGE_HEADERSET )
681  {
682  m_aBspWin.SetHeader( m_xTurnOnBox->get_active() );
683  m_aBspWin.SetHdHeight( GetCoreValue( *m_xHeightEdit, MapUnit::MapTwip ) );
684  m_aBspWin.SetHdDist( GetCoreValue( *m_xDistEdit, MapUnit::MapTwip ) );
685  m_aBspWin.SetHdLeft( GetCoreValue( *m_xLMEdit, MapUnit::MapTwip ) );
686  m_aBspWin.SetHdRight( GetCoreValue( *m_xRMEdit, MapUnit::MapTwip ) );
687  }
688  else
689  {
690  m_aBspWin.SetFooter( m_xTurnOnBox->get_active() );
691  m_aBspWin.SetFtHeight( GetCoreValue( *m_xHeightEdit, MapUnit::MapTwip ) );
692  m_aBspWin.SetFtDist( GetCoreValue( *m_xDistEdit, MapUnit::MapTwip ) );
693  m_aBspWin.SetFtLeft( GetCoreValue( *m_xLMEdit, MapUnit::MapTwip ) );
694  m_aBspWin.SetFtRight( GetCoreValue( *m_xRMEdit, MapUnit::MapTwip ) );
695  }
697 }
698 
700 {
701  sal_uInt16 nWhich(GetWhich(SID_ATTR_PAGE_HEADERSET));
702 
703  if (SfxItemState::SET == rSet.GetItemState(nWhich, false))
704  {
705  const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false));
706  const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
707  const SfxBoolItem& rOn = static_cast< const SfxBoolItem& >(rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON)));
708 
709  if(rOn.GetValue())
710  {
712 
714  {
715  // create FillAttributes directly from DrawingLayer FillStyle entries
716  aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet);
717  }
718  else
719  {
720  nWhich = GetWhich(SID_ATTR_BRUSH);
721 
722  if(SfxItemState::SET == rTmpSet.GetItemState(nWhich))
723  {
724  // create FillAttributes from SvxBrushItem
725  const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
727 
729  aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
730  }
731  }
732 
733  m_aBspWin.setHeaderFillAttributes(aHeaderFillAttributes);
734  }
735  }
736 
737  nWhich = GetWhich(SID_ATTR_PAGE_FOOTERSET);
738 
739  if (SfxItemState::SET == rSet.GetItemState(nWhich, false))
740  {
741  const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false));
742  const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
743  const SfxBoolItem& rOn = static_cast< const SfxBoolItem& >(rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON)));
744 
745  if(rOn.GetValue())
746  {
748 
750  {
751  // create FillAttributes directly from DrawingLayer FillStyle entries
752  aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet);
753  }
754  else
755  {
756  nWhich = GetWhich(SID_ATTR_BRUSH);
757 
758  if(SfxItemState::SET == rTmpSet.GetItemState(nWhich))
759  {
760  // create FillAttributes from SvxBrushItem
761  const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
763 
765  aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
766  }
767  }
768 
769  m_aBspWin.setFooterFillAttributes(aFooterFillAttributes);
770  }
771  }
772 
774 
776  {
777  // create FillAttributes directly from DrawingLayer FillStyle entries
778  aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rSet);
779  }
780  else
781  {
782  nWhich = GetWhich(SID_ATTR_BRUSH);
783 
784  if(rSet.GetItemState(nWhich) >= SfxItemState::DEFAULT)
785  {
786  // create FillAttributes from SvxBrushItem
787  const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rSet.Get(nWhich));
789 
791  aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
792  }
793  }
794 
795  m_aBspWin.setPageFillAttributes(aPageFillAttributes);
796 }
797 
799 {
800  const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_LRSPACE );
801 
802  if ( pItem )
803  {
804  // Set left and right margins
805  const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem);
806 
807  m_aBspWin.SetLeft( rLRSpace.GetLeft() );
808  m_aBspWin.SetRight( rLRSpace.GetRight() );
809  }
810  else
811  {
812  m_aBspWin.SetLeft( 0 );
813  m_aBspWin.SetRight( 0 );
814  }
815 
816  pItem = GetItem( rSet, SID_ATTR_ULSPACE );
817 
818  if ( pItem )
819  {
820  // Set top and bottom margins
821  const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(*pItem);
822 
823  m_aBspWin.SetTop( rULSpace.GetUpper() );
824  m_aBspWin.SetBottom( rULSpace.GetLower() );
825  }
826  else
827  {
828  m_aBspWin.SetTop( 0 );
829  m_aBspWin.SetBottom( 0 );
830  }
831 
833  pItem = GetItem( rSet, SID_ATTR_PAGE );
834 
835  if ( pItem )
836  nUsage = static_cast<const SvxPageItem*>(pItem)->GetPageUsage();
837 
838  m_aBspWin.SetUsage( nUsage );
839 
840  if ( SvxPageUsage::Right == nUsage || SvxPageUsage::Left == nUsage )
841  m_xCntSharedBox->set_sensitive(false);
842  else
843  {
844  m_xCntSharedBox->set_sensitive(true);
845  m_xCntSharedFirstBox->set_sensitive(true);
846  }
847  pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE );
848 
849  if ( pItem )
850  {
851  // Orientation and Size from the PageItem
852  const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(*pItem);
853  // if the size is already swapped (Landscape)
854  m_aBspWin.SetSize( rSize.GetSize() );
855  }
856 
857  // Evaluate Header attribute
858  const SvxSetItem* pSetItem = nullptr;
859 
860  if ( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_PAGE_HEADERSET ),
861  false,
862  reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
863  {
864  const SfxItemSet& rHeaderSet = pSetItem->GetItemSet();
865  const SfxBoolItem& rHeaderOn =
866  static_cast<const SfxBoolItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ));
867 
868  if ( rHeaderOn.GetValue() )
869  {
870  const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(
871  rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ));
872  const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(
873  rHeaderSet.Get( GetWhich(SID_ATTR_ULSPACE ) ));
874  const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(
875  rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
876  long nDist = rUL.GetLower();
877 
878  m_aBspWin.SetHdHeight( rSize.GetSize().Height() - nDist );
879  m_aBspWin.SetHdDist( nDist );
880  m_aBspWin.SetHdLeft( rLR.GetLeft() );
881  m_aBspWin.SetHdRight( rLR.GetRight() );
882  m_aBspWin.SetHeader( true );
883  }
884  else
885  pSetItem = nullptr;
886  }
887 
888  if ( !pSetItem )
889  {
890  m_aBspWin.SetHeader( false );
891 
892  if ( SID_ATTR_PAGE_HEADERSET == nId )
893  {
894  m_xCntSharedBox->set_sensitive(false);
895  m_xCntSharedFirstBox->set_sensitive(false);
896  }
897  }
898  pSetItem = nullptr;
899 
900  if ( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_PAGE_FOOTERSET ),
901  false,
902  reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
903  {
904  const SfxItemSet& rFooterSet = pSetItem->GetItemSet();
905  const SfxBoolItem& rFooterOn =
906  static_cast<const SfxBoolItem&>(rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ));
907 
908  if ( rFooterOn.GetValue() )
909  {
910  const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(
911  rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ));
912  const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(
913  rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) ));
914  const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(
915  rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
916  long nDist = rUL.GetUpper();
917 
918  m_aBspWin.SetFtHeight( rSize.GetSize().Height() - nDist );
919  m_aBspWin.SetFtDist( nDist );
920  m_aBspWin.SetFtLeft( rLR.GetLeft() );
921  m_aBspWin.SetFtRight( rLR.GetRight() );
922  m_aBspWin.SetFooter( true );
923  }
924  else
925  pSetItem = nullptr;
926  }
927 
928  if ( !pSetItem )
929  {
930  m_aBspWin.SetFooter( false );
931 
932  if ( SID_ATTR_PAGE_FOOTERSET == nId )
933  {
934  m_xCntSharedBox->set_sensitive(false);
935  m_xCntSharedFirstBox->set_sensitive(false);
936  }
937  }
938 
939  pItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 );
940 
941  if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
942  {
943  m_aBspWin.SetTable( true );
944  m_aBspWin.SetHorz( pBoolItem->GetValue() );
945  }
946 
947  pItem = GetItem( rSet, SID_ATTR_PAGE_EXT2 );
948 
949  if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
950  {
951  m_aBspWin.SetTable( true );
952  m_aBspWin.SetVert( pBoolItem->GetValue() );
953  }
954  ResetBackground_Impl( rSet );
955  RangeHdl();
956 }
957 
959 {
960  if ( _pSet )
961  FillItemSet( _pSet );
962  return DeactivateRC::LeavePage;
963 }
964 
966 {
967  UpdateExample();
968  RangeHdl();
969 }
970 
972 {
973  long nHHeight = m_aBspWin.GetHdHeight();
974  long nHDist = m_aBspWin.GetHdDist();
975 
976  long nFHeight = m_aBspWin.GetFtHeight();
977  long nFDist = m_aBspWin.GetFtDist();
978 
979  long nHeight = std::max(long(MINBODY),
980  static_cast<long>(m_xHeightEdit->denormalize(m_xHeightEdit->get_value(FieldUnit::TWIP))));
981  long nDist = m_xTurnOnBox->get_active() ?
982  static_cast<long>(m_xDistEdit->denormalize(m_xDistEdit->get_value(FieldUnit::TWIP))) : 0;
983 
984  long nMin;
985  long nMax;
986 
987  if ( nId == SID_ATTR_PAGE_HEADERSET )
988  {
989  nHHeight = nHeight;
990  nHDist = nDist;
991  }
992  else
993  {
994  nFHeight = nHeight;
995  nFDist = nDist;
996  }
997 
998  // Current values of the side edges
999  long nBT = m_aBspWin.GetTop();
1000  long nBB = m_aBspWin.GetBottom();
1001  long nBL = m_aBspWin.GetLeft();
1002  long nBR = m_aBspWin.GetRight();
1003 
1004  long nH = m_aBspWin.GetSize().Height();
1005  long nW = m_aBspWin.GetSize().Width();
1006 
1007  // Borders
1008  if ( nId == SID_ATTR_PAGE_HEADERSET )
1009  {
1010  // Header
1011  nMin = ( nH - nBB - nBT ) / 5; // 20%
1012  nMax = std::max( nH - nMin - nHDist - nFDist - nFHeight - nBB - nBT,
1013  nMin );
1014  m_xHeightEdit->set_max(m_xHeightEdit->normalize(nMax), FieldUnit::TWIP);
1015  nMin = ( nH - nBB - nBT ) / 5; // 20%
1016  nDist = std::max( nH - nMin - nHHeight - nFDist - nFHeight - nBB - nBT,
1017  long(0) );
1018  m_xDistEdit->set_max(m_xDistEdit->normalize(nDist), FieldUnit::TWIP);
1019  }
1020  else
1021  {
1022  // Footer
1023  nMin = ( nH - nBT - nBB ) / 5; // 20%
1024  nMax = std::max( nH - nMin - nFDist - nHDist - nHHeight - nBT - nBB,
1025  nMin );
1026  m_xHeightEdit->set_max(m_xHeightEdit->normalize(nMax), FieldUnit::TWIP);
1027  nMin = ( nH - nBT - nBB ) / 5; // 20%
1028  nDist = std::max( nH - nMin - nFHeight - nHDist - nHHeight - nBT - nBB,
1029  long(0) );
1030  m_xDistEdit->set_max(m_xDistEdit->normalize(nDist), FieldUnit::TWIP);
1031  }
1032 
1033  // Limit Indentation
1034  nMax = nW - nBL - nBR -
1035  static_cast<long>(m_xRMEdit->denormalize(m_xRMEdit->get_value(FieldUnit::TWIP))) - MINBODY;
1036  m_xLMEdit->set_max(m_xLMEdit->normalize(nMax), FieldUnit::TWIP);
1037 
1038  nMax = nW - nBL - nBR -
1039  static_cast<long>(m_xLMEdit->denormalize(m_xLMEdit->get_value(FieldUnit::TWIP))) - MINBODY;
1040  m_xRMEdit->set_max(m_xLMEdit->normalize(nMax), FieldUnit::TWIP);
1041 }
1042 
1044 {
1045  m_xDynSpacingCB->show();
1046 }
1047 
1049 {
1050  const SfxBoolItem* pSupportDrawingLayerFillStyleItem = rSet.GetItem<SfxBoolItem>(SID_DRAWINGLAYER_FILLSTYLES, false);
1051 
1052  if (pSupportDrawingLayerFillStyleItem)
1053  {
1054  const bool bNew(pSupportDrawingLayerFillStyleItem->GetValue());
1055 
1057  }
1058 }
1059 
1060 /* 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:678
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:1043
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:1048
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
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:971
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:699
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
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
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: hdft.cxx:798
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:107
bool mbEnableDrawingLayerFillStyles
Definition: hdft.hxx:63
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: hdft.cxx:958
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