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
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
50using 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
54constexpr tools::Long MINBODY = o3tl::toTwips(1, o3tl::Length::mm); // 1mm in twips rounded
55
56// default distance to Header or footer
57const tools::Long DEF_DIST_WRITER = 500; // 5mm (Writer)
58const 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
81namespace 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
103std::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
108std::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
123SvxHFPage::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
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
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( TypedWhichId<SvxSetItem>(GetWhich( nId )), aSet );
315 rSet->Put( aSetItem );
316
317 return true;
318}
319
320
321void SvxHFPage::Reset( const SfxItemSet* rSet )
322{
323 ActivatePage( *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 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 rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_DYNAMIC ) );
346 const SfxBoolItem& rShared =
347 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 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 SfxObjectShell* pShell;
420 const SfxUInt16Item* pItem = rSet->GetItemIfSet(SID_HTML_MODE, false);
421 if(pItem ||
422 ( nullptr != (pShell = SfxObjectShell::Current()) &&
423 nullptr != (pItem = pShell->GetItem(SID_HTML_MODE))))
424 {
425 sal_uInt16 nHtmlMode = 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
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 }
514}
515
516IMPL_LINK(SvxHFPage, TurnOnHdl, weld::Toggleable&, rBox, void)
517{
518 TurnOn(&rBox);
519}
520
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 SfxItemSetFixed
533 <XATTR_FILL_FIRST, XATTR_FILL_LAST, // DrawingLayer FillStyle definitions
534 SID_COLOR_TABLE, SID_PATTERN_LIST> // XPropertyLists for Color, Gradient, Hatch and Graphic fills
535 (*GetItemSet().GetPool()));
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
571 (*GetItemSet().GetPool()) );
572 // Keep it valid
573 pBBSet->MergeRange(nBrush, nBrush);
574 pBBSet->MergeRange(nOuter, nOuter);
575 pBBSet->MergeRange(nInner, nInner);
576 pBBSet->MergeRange(nShadow, nShadow);
577 }
578
579 const SfxPoolItem* pItem;
580
581 if(SfxItemState::SET == GetItemSet().GetItemState(GetWhich(nId), false, &pItem))
582 {
583 // If a SfxItemSet from the SetItem for SID_ATTR_PAGE_HEADERSET or
584 // SID_ATTR_PAGE_FOOTERSET exists, use its content
585 pBBSet->Put(static_cast<const SvxSetItem*>(pItem)->GetItemSet());
586 }
587 else
588 {
589 if(mbEnableDrawingLayerFillStyles)
590 {
591 // The style for header/footer is not yet created, need to reset
592 // XFillStyleItem to drawing::FillStyle_NONE which is the same as in the style
593 // initialization. This needs to be done since the pool default for
594 // XFillStyleItem is drawing::FillStyle_SOLID
595 pBBSet->Put(XFillStyleItem(drawing::FillStyle_NONE));
596 }
597 }
598
599 if(SfxItemState::SET == GetItemSet().GetItemState(nInner, false, &pItem))
600 {
601 // The set InfoItem is always required
602 pBBSet->Put(*pItem);
603 }
604 }
605
607
609 GetFrameWeld(),
610 *pBBSet,
611 mbEnableDrawingLayerFillStyles));
612
613 pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nResult) {
614 if (nResult == RET_OK && pDlg->GetOutputItemSet())
615 {
616 SfxItemIter aIter(*pDlg->GetOutputItemSet());
617
618 for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
619 {
620 if(!IsInvalidItem(pItem))
621 {
622 pBBSet->Put(*pItem);
623 }
624 }
625
626 {
627 drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
628
629 if (mbEnableDrawingLayerFillStyles)
630 {
631 // create FillAttributes directly from DrawingLayer FillStyle entries
632 aFillAttributes =
633 std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(*pBBSet);
634 }
635 else
636 {
637 const sal_uInt16 nWhich = GetWhich(SID_ATTR_BRUSH);
638
639 if (pBBSet->GetItemState(nWhich) == SfxItemState::SET)
640 {
641 // create FillAttributes from SvxBrushItem
642 const SvxBrushItem& rItem
643 = static_cast<const SvxBrushItem&>(pBBSet->Get(nWhich));
644 SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aTempSet(*pBBSet->GetPool());
645
646 setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
647 aFillAttributes =
648 std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
649 }
650 }
651
652 if (SID_ATTR_PAGE_HEADERSET == nId)
653 {
654 //m_aBspWin.SetHdColor(rItem.GetColor());
655 m_aBspWin.setHeaderFillAttributes(aFillAttributes);
656 }
657 else
658 {
659 //m_aBspWin.SetFtColor(rItem.GetColor());
660 m_aBspWin.setFooterFillAttributes(aFillAttributes);
661 }
662 }
663 }
664 pDlg->disposeOnce();
665 });
666
667 UpdateExample();
668}
669
671{
672 if ( nId == SID_ATTR_PAGE_HEADERSET )
673 {
674 m_aBspWin.SetHeader( m_xTurnOnBox->get_active() );
675 m_aBspWin.SetHdHeight( GetCoreValue( *m_xHeightEdit, MapUnit::MapTwip ) );
676 m_aBspWin.SetHdDist( GetCoreValue( *m_xDistEdit, MapUnit::MapTwip ) );
677 m_aBspWin.SetHdLeft( GetCoreValue( *m_xLMEdit, MapUnit::MapTwip ) );
678 m_aBspWin.SetHdRight( GetCoreValue( *m_xRMEdit, MapUnit::MapTwip ) );
679 }
680 else
681 {
682 m_aBspWin.SetFooter( m_xTurnOnBox->get_active() );
683 m_aBspWin.SetFtHeight( GetCoreValue( *m_xHeightEdit, MapUnit::MapTwip ) );
684 m_aBspWin.SetFtDist( GetCoreValue( *m_xDistEdit, MapUnit::MapTwip ) );
685 m_aBspWin.SetFtLeft( GetCoreValue( *m_xLMEdit, MapUnit::MapTwip ) );
686 m_aBspWin.SetFtRight( GetCoreValue( *m_xRMEdit, MapUnit::MapTwip ) );
687 }
689}
690
692{
693 sal_uInt16 nWhich(GetWhich(SID_ATTR_PAGE_HEADERSET));
694
695 if (SfxItemState::SET == rSet.GetItemState(nWhich, false))
696 {
697 const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false));
698 const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
699 const SfxBoolItem& rOn = rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON));
700
701 if(rOn.GetValue())
702 {
704
706 {
707 // create FillAttributes directly from DrawingLayer FillStyle entries
708 aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet);
709 }
710 else
711 {
712 nWhich = GetWhich(SID_ATTR_BRUSH);
713
714 if(SfxItemState::SET == rTmpSet.GetItemState(nWhich))
715 {
716 // create FillAttributes from SvxBrushItem
717 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
719
721 aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
722 }
723 }
724
725 m_aBspWin.setHeaderFillAttributes(aHeaderFillAttributes);
726 }
727 }
728
729 nWhich = GetWhich(SID_ATTR_PAGE_FOOTERSET);
730
731 if (SfxItemState::SET == rSet.GetItemState(nWhich, false))
732 {
733 const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false));
734 const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
735 const SfxBoolItem& rOn = rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON));
736
737 if(rOn.GetValue())
738 {
740
742 {
743 // create FillAttributes directly from DrawingLayer FillStyle entries
744 aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet);
745 }
746 else
747 {
748 nWhich = GetWhich(SID_ATTR_BRUSH);
749
750 if(SfxItemState::SET == rTmpSet.GetItemState(nWhich))
751 {
752 // create FillAttributes from SvxBrushItem
753 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
755
757 aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
758 }
759 }
760
761 m_aBspWin.setFooterFillAttributes(aFooterFillAttributes);
762 }
763 }
764
766
768 {
769 // create FillAttributes directly from DrawingLayer FillStyle entries
770 aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rSet);
771 }
772 else
773 {
774 nWhich = GetWhich(SID_ATTR_BRUSH);
775
776 if(rSet.GetItemState(nWhich) >= SfxItemState::DEFAULT)
777 {
778 // create FillAttributes from SvxBrushItem
779 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rSet.Get(nWhich));
781
783 aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
784 }
785 }
786
787 m_aBspWin.setPageFillAttributes(aPageFillAttributes);
788}
789
791{
792 const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_LRSPACE );
793
794 if ( pItem )
795 {
796 // Set left and right margins
797 const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem);
798
799 m_aBspWin.SetLeft( rLRSpace.GetLeft() );
800 m_aBspWin.SetRight( rLRSpace.GetRight() );
801 }
802 else
803 {
804 m_aBspWin.SetLeft( 0 );
805 m_aBspWin.SetRight( 0 );
806 }
807
808 pItem = GetItem( rSet, SID_ATTR_ULSPACE );
809
810 if ( pItem )
811 {
812 // Set top and bottom margins
813 const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(*pItem);
814
815 m_aBspWin.SetTop( rULSpace.GetUpper() );
816 m_aBspWin.SetBottom( rULSpace.GetLower() );
817 }
818 else
819 {
820 m_aBspWin.SetTop( 0 );
821 m_aBspWin.SetBottom( 0 );
822 }
823
825 pItem = GetItem( rSet, SID_ATTR_PAGE );
826
827 if ( pItem )
828 nUsage = static_cast<const SvxPageItem*>(pItem)->GetPageUsage();
829
830 m_aBspWin.SetUsage( nUsage );
831
832 if ( SvxPageUsage::Right == nUsage || SvxPageUsage::Left == nUsage )
833 m_xCntSharedBox->set_sensitive(false);
834 else
835 {
836 m_xCntSharedBox->set_sensitive(true);
837 m_xCntSharedFirstBox->set_sensitive(true);
838 }
839 pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE );
840
841 if ( pItem )
842 {
843 // Orientation and Size from the PageItem
844 const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(*pItem);
845 // if the size is already swapped (Landscape)
846 m_aBspWin.SetSize( rSize.GetSize() );
847 }
848
849 // Evaluate Header attribute
850 const SvxSetItem* pSetItem = nullptr;
851
852 if ( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_PAGE_HEADERSET ),
853 false,
854 reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
855 {
856 const SfxItemSet& rHeaderSet = pSetItem->GetItemSet();
857 const SfxBoolItem& rHeaderOn =
858 rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) );
859
860 if ( rHeaderOn.GetValue() )
861 {
862 const SvxSizeItem& rSize =
863 rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) );
864 const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(
865 rHeaderSet.Get( GetWhich(SID_ATTR_ULSPACE ) ));
866 const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(
867 rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
868 tools::Long nDist = rUL.GetLower();
869
870 m_aBspWin.SetHdHeight( rSize.GetSize().Height() - nDist );
871 m_aBspWin.SetHdDist( nDist );
872 m_aBspWin.SetHdLeft( rLR.GetLeft() );
874 m_aBspWin.SetHeader( true );
875 }
876 else
877 pSetItem = nullptr;
878 }
879
880 if ( !pSetItem )
881 {
882 m_aBspWin.SetHeader( false );
883
884 if ( SID_ATTR_PAGE_HEADERSET == nId )
885 {
886 m_xCntSharedBox->set_sensitive(false);
887 m_xCntSharedFirstBox->set_sensitive(false);
888 }
889 }
890 pSetItem = nullptr;
891
892 if ( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_PAGE_FOOTERSET ),
893 false,
894 reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
895 {
896 const SfxItemSet& rFooterSet = pSetItem->GetItemSet();
897 const SfxBoolItem& rFooterOn =
898 rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) );
899
900 if ( rFooterOn.GetValue() )
901 {
902 const SvxSizeItem& rSize =
903 rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) );
904 const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(
905 rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) ));
906 const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(
907 rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) ));
908 tools::Long nDist = rUL.GetUpper();
909
910 m_aBspWin.SetFtHeight( rSize.GetSize().Height() - nDist );
911 m_aBspWin.SetFtDist( nDist );
912 m_aBspWin.SetFtLeft( rLR.GetLeft() );
914 m_aBspWin.SetFooter( true );
915 }
916 else
917 pSetItem = nullptr;
918 }
919
920 if ( !pSetItem )
921 {
922 m_aBspWin.SetFooter( false );
923
924 if ( SID_ATTR_PAGE_FOOTERSET == nId )
925 {
926 m_xCntSharedBox->set_sensitive(false);
927 m_xCntSharedFirstBox->set_sensitive(false);
928 }
929 }
930
931 pItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 );
932
933 if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
934 {
935 m_aBspWin.SetTable( true );
936 m_aBspWin.SetHorz( pBoolItem->GetValue() );
937 }
938
939 pItem = GetItem( rSet, SID_ATTR_PAGE_EXT2 );
940
941 if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
942 {
943 m_aBspWin.SetTable( true );
944 m_aBspWin.SetVert( pBoolItem->GetValue() );
945 }
947 RangeHdl();
948}
949
951{
952 if ( _pSet )
953 FillItemSet( _pSet );
954 return DeactivateRC::LeavePage;
955}
956
958{
959 UpdateExample();
960 RangeHdl();
961}
962
964{
965 tools::Long nHHeight = m_aBspWin.GetHdHeight();
967
968 tools::Long nFHeight = m_aBspWin.GetFtHeight();
970
971 tools::Long nHeight = std::max(tools::Long(MINBODY),
972 static_cast<tools::Long>(m_xHeightEdit->denormalize(m_xHeightEdit->get_value(FieldUnit::TWIP))));
973 tools::Long nDist = m_xTurnOnBox->get_active() ?
974 static_cast<tools::Long>(m_xDistEdit->denormalize(m_xDistEdit->get_value(FieldUnit::TWIP))) : 0;
975
976 tools::Long nMin;
977 tools::Long nMax;
978
979 if ( nId == SID_ATTR_PAGE_HEADERSET )
980 {
981 nHHeight = nHeight;
982 nHDist = nDist;
983 }
984 else
985 {
986 nFHeight = nHeight;
987 nFDist = nDist;
988 }
989
990 // Current values of the side edges
995
998
999 // Borders
1000 if ( nId == SID_ATTR_PAGE_HEADERSET )
1001 {
1002 // Header
1003 nMin = ( nH - nBB - nBT ) / 5; // 20%
1004 nMax = std::max( nH - nMin - nHDist - nFDist - nFHeight - nBB - nBT,
1005 nMin );
1006 m_xHeightEdit->set_max(m_xHeightEdit->normalize(nMax), FieldUnit::TWIP);
1007 nMin = ( nH - nBB - nBT ) / 5; // 20%
1008 nDist = std::max( nH - nMin - nHHeight - nFDist - nFHeight - nBB - nBT,
1009 tools::Long(0) );
1010 m_xDistEdit->set_max(m_xDistEdit->normalize(nDist), FieldUnit::TWIP);
1011 }
1012 else
1013 {
1014 // Footer
1015 nMin = ( nH - nBT - nBB ) / 5; // 20%
1016 nMax = std::max( nH - nMin - nFDist - nHDist - nHHeight - nBT - nBB,
1017 nMin );
1018 m_xHeightEdit->set_max(m_xHeightEdit->normalize(nMax), FieldUnit::TWIP);
1019 nMin = ( nH - nBT - nBB ) / 5; // 20%
1020 nDist = std::max( nH - nMin - nFHeight - nHDist - nHHeight - nBT - nBB,
1021 tools::Long(0) );
1022 m_xDistEdit->set_max(m_xDistEdit->normalize(nDist), FieldUnit::TWIP);
1023 }
1024
1025 // Limit Indentation
1026 nMax = nW - nBL - nBR -
1027 static_cast<tools::Long>(m_xRMEdit->denormalize(m_xRMEdit->get_value(FieldUnit::TWIP))) - MINBODY;
1028 m_xLMEdit->set_max(m_xLMEdit->normalize(nMax), FieldUnit::TWIP);
1029
1030 nMax = nW - nBL - nBR -
1031 static_cast<tools::Long>(m_xLMEdit->denormalize(m_xLMEdit->get_value(FieldUnit::TWIP))) - MINBODY;
1032 m_xRMEdit->set_max(m_xLMEdit->normalize(nMax), FieldUnit::TWIP);
1033}
1034
1036{
1037 m_xDynSpacingCB->show();
1038}
1039
1041{
1042 const SfxBoolItem* pSupportDrawingLayerFillStyleItem = rSet.GetItem<SfxBoolItem>(SID_DRAWINGLAYER_FILLSTYLES, false);
1043
1044 if (pSupportDrawingLayerFillStyleItem)
1045 {
1046 const bool bNew(pSupportDrawingLayerFillStyleItem->GetValue());
1047
1049 }
1050}
1051
1052/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt16 GetValue() const
bool GetValue() const
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
static bool IsWhich(sal_uInt16 nId)
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void MergeRange(sal_uInt16 nFrom, sal_uInt16 nTo)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
const SfxItemSet & GetItemSet() const
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
const SfxItemSet & GetItemSet() const
void SetExchangeSupport()
static const SfxPoolItem * GetItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
weld::Window * GetFrameWeld() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
constexpr tools::Long Height() const
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
virtual VclPtr< SfxAbstractTabDialog > CreateSvxBorderBackgroundDlg(weld::Window *pParent, const SfxItemSet &rCoreSet, bool bEnableDrawingLayerFillStyles)=0
static SvxAbstractDialogFactory * Create()
Definition: svxdlg.cxx:22
SVX_DLLPRIVATE SvxFooterPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: hdft.cxx:118
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: hdft.cxx:108
virtual void Reset(const SfxItemSet *rSet) override
Definition: hdft.cxx:321
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: hdft.cxx:790
sal_uInt16 nId
Definition: hdft.hxx:60
void UpdateExample()
Definition: hdft.cxx:670
std::unique_ptr< weld::Label > m_xDistFT
Definition: hdft.hxx:74
void InitHandler()
Definition: hdft.cxx:435
std::unique_ptr< weld::Label > m_xPageLbl
Definition: hdft.hxx:66
std::unique_ptr< weld::MetricSpinButton > m_xDistEdit
Definition: hdft.hxx:75
std::unique_ptr< weld::CheckButton > m_xCntSharedBox
Definition: hdft.hxx:68
void EnableDynamicSpacing()
Definition: hdft.cxx:1035
std::unique_ptr< weld::CheckButton > m_xTurnOnBox
Definition: hdft.hxx:67
static const WhichRangesContainer pRanges
Definition: hdft.hxx:53
SVX_DLLPRIVATE void ResetBackground_Impl(const SfxItemSet &rSet)
Definition: hdft.cxx:691
SvxHFPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet, sal_uInt16 nSetId)
Definition: hdft.cxx:123
std::unique_ptr< weld::MetricSpinButton > m_xRMEdit
Definition: hdft.hxx:73
std::unique_ptr< weld::Label > m_xHeightFT
Definition: hdft.hxx:77
void RangeHdl()
Definition: hdft.cxx:963
std::unique_ptr< weld::MetricSpinButton > m_xLMEdit
Definition: hdft.hxx:71
bool mbEnableDrawingLayerFillStyles
Definition: hdft.hxx:63
virtual void PageCreated(const SfxAllItemSet &) override
Definition: hdft.cxx:1040
std::unique_ptr< weld::CheckButton > m_xDynSpacingCB
Definition: hdft.hxx:76
std::unique_ptr< weld::Button > m_xBackgroundBtn
Definition: hdft.hxx:80
std::unique_ptr< weld::CheckButton > m_xHeightDynBtn
Definition: hdft.hxx:79
std::unique_ptr< weld::Label > m_xRMLbl
Definition: hdft.hxx:72
virtual bool FillItemSet(SfxItemSet *rOutSet) override
Definition: hdft.cxx:190
SvxPageWindow m_aBspWin
Definition: hdft.hxx:65
bool mbDisableQueryBox
Definition: hdft.hxx:62
std::unique_ptr< weld::MetricSpinButton > m_xHeightEdit
Definition: hdft.hxx:78
std::unique_ptr< SfxItemSet > pBBSet
Definition: hdft.hxx:61
virtual ~SvxHFPage() override
Definition: hdft.cxx:186
void TurnOn(const weld::Toggleable *pButton)
Definition: hdft.cxx:446
std::unique_ptr< weld::CheckButton > m_xCntSharedFirstBox
Definition: hdft.hxx:69
std::unique_ptr< weld::Label > m_xLMLbl
Definition: hdft.hxx:70
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: hdft.cxx:950
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: hdft.cxx:103
SVX_DLLPRIVATE SvxHeaderPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: hdft.cxx:113
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
tools::Long GetLeft() const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void setHeaderFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
Definition: pagectrl.hxx:81
void SetUsage(SvxPageUsage eU)
Definition: pagectrl.hxx:136
void SetBottom(tools::Long nNew)
Definition: pagectrl.hxx:107
tools::Long GetFtDist() const
Definition: pagectrl.hxx:133
void SetHdLeft(tools::Long nNew)
Definition: pagectrl.hxx:116
const Size & GetSize() const
Definition: pagectrl.hxx:101
tools::Long GetBottom() const
Definition: pagectrl.hxx:112
void SetHdHeight(tools::Long nNew)
Definition: pagectrl.hxx:119
void SetTable(bool bNew)
Definition: pagectrl.hxx:141
void SetHorz(bool bNew)
Definition: pagectrl.hxx:142
tools::Long GetTop() const
Definition: pagectrl.hxx:111
SvxPageUsage GetUsage() const
Definition: pagectrl.hxx:137
void setPageFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
Definition: pagectrl.hxx:89
void SetFtDist(tools::Long nNew)
Definition: pagectrl.hxx:128
void SetSize(const Size &rSize)
Definition: pagectrl.hxx:97
void SetLeft(tools::Long nNew)
Definition: pagectrl.hxx:108
void SetHdDist(tools::Long nNew)
Definition: pagectrl.hxx:118
void SetFtLeft(tools::Long nNew)
Definition: pagectrl.hxx:126
void SetFtRight(tools::Long nNew)
Definition: pagectrl.hxx:127
void SetHdRight(tools::Long nNew)
Definition: pagectrl.hxx:117
void setFooterFillAttributes(const drawinglayer::attribute::SdrAllFillAttributesHelperPtr &rFillAttributes)
Definition: pagectrl.hxx:85
tools::Long GetRight() const
Definition: pagectrl.hxx:114
void SetFooter(bool bNew)
Definition: pagectrl.hxx:140
tools::Long GetLeft() const
Definition: pagectrl.hxx:113
tools::Long GetHdHeight() const
Definition: pagectrl.hxx:124
void SetVert(bool bNew)
Definition: pagectrl.hxx:143
void SetFtHeight(tools::Long nNew)
Definition: pagectrl.hxx:129
tools::Long GetHdDist() const
Definition: pagectrl.hxx:123
void SetHeader(bool bNew)
Definition: pagectrl.hxx:139
tools::Long GetFtHeight() const
Definition: pagectrl.hxx:134
void SetTop(tools::Long nNew)
Definition: pagectrl.hxx:106
void SetRight(tools::Long nNew)
Definition: pagectrl.hxx:109
const Size & GetSize() const
void SetSize(const Size &rSize)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
sal_uInt16 GetUpper() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetLower() const
void EnableRTL(bool bEnable)
virtual short run()
#define DBG_ASSERT(sCon, aError)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
Definition: dlgutil.cxx:31
FieldUnit
static bool GetWhich(const SfxItemSet &rSet, sal_uInt16 nSlot, sal_uInt16 &rWhich)
Definition: fntctrl.cxx:433
TRISTATE_TRUE
IMPL_LINK(SvxHFPage, TurnOnHdl, weld::Toggleable &, rBox, void)
Definition: hdft.cxx:516
IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button &, void)
Definition: hdft.cxx:521
const tools::Long DEF_DIST_WRITER
Definition: hdft.cxx:57
const tools::Long DEF_DIST_CALC
Definition: hdft.cxx:58
constexpr tools::Long MINBODY
Definition: hdft.cxx:54
HTMLMODE_ON
uno_Any a
MapUnit
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr
constexpr auto toTwips(N number, Length from)
static constexpr auto Items
bool ShowBorderBackgroundDlg(weld::Window *pParent, SfxItemSet *pBBSet)
Definition: hdft.cxx:83
long Long
Reference< XNameAccess > m_xContainer
sal_Int16 nId
SvxPageUsage
Definition: pageitem.hxx:33
bool IsInvalidItem(const SfxPoolItem *pItem)
static SfxItemSet & rSet
DeactivateRC
SVT_DLLPUBLIC sal_Int64 GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton &rField, sal_Int64 nCoreValue, MapUnit eUnit)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
RET_OK
RET_YES
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)