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