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 = rHeaderSet.Get( GetWhich( SID_ATTR_ULSPACE ) );
354 const SvxLRSpaceItem& rLR = rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) );
355 if (m_xDynSpacingCB->get_visible())
356 {
357 const SfxBoolItem& rDynSpacing =
358 static_cast<const SfxBoolItem&>(rHeaderSet.Get(GetWhich(SID_ATTR_HDFT_DYNAMIC_SPACING)));
359 m_xDynSpacingCB->set_active(rDynSpacing.GetValue());
360 }
361
362
363 if ( nId == SID_ATTR_PAGE_HEADERSET )
364 { // Header
365 SetMetricValue( *m_xDistEdit, rUL.GetLower(), eUnit );
366 SetMetricValue( *m_xHeightEdit, rSize.GetSize().Height() - rUL.GetLower(), eUnit );
367 }
368 else
369 { // Footer
370 SetMetricValue( *m_xDistEdit, rUL.GetUpper(), eUnit );
371 SetMetricValue( *m_xHeightEdit, rSize.GetSize().Height() - rUL.GetUpper(), eUnit );
372 }
373
374 m_xHeightDynBtn->set_active(rDynamic.GetValue());
375 SetMetricValue( *m_xLMEdit, rLR.GetLeft(), eUnit );
376 SetMetricValue( *m_xRMEdit, rLR.GetRight(), eUnit );
377 m_xCntSharedBox->set_active(rShared.GetValue());
378 if (pSharedFirst)
379 m_xCntSharedFirstBox->set_active(pSharedFirst->GetValue());
380 }
381 else
382 pSetItem = nullptr;
383 }
384 else
385 {
386 bool bIsCalc = false;
387 const SfxPoolItem* pExt1 = GetItem(*rSet, SID_ATTR_PAGE_EXT1);
388 const SfxPoolItem* pExt2 = GetItem(*rSet, SID_ATTR_PAGE_EXT2);
389 if (dynamic_cast<const SfxBoolItem*>(pExt1) && dynamic_cast<const SfxBoolItem*>(pExt2) )
390 bIsCalc = true;
391
392 // defaults for distance and height
393 tools::Long nDefaultDist = bIsCalc ? DEF_DIST_CALC : DEF_DIST_WRITER;
394 SetMetricValue( *m_xDistEdit, nDefaultDist, MapUnit::Map100thMM );
395 SetMetricValue( *m_xHeightEdit, 500, MapUnit::Map100thMM );
396 }
397
398 if ( !pSetItem )
399 {
400 m_xTurnOnBox->set_active(false);
401 m_xHeightDynBtn->set_active(true);
402 m_xCntSharedBox->set_active(true);
403 m_xCntSharedFirstBox->set_active(true);
404 }
405
406 TurnOn(nullptr);
407
408 m_xTurnOnBox->save_state();
409 m_xDistEdit->save_value();
410 m_xHeightEdit->save_value();
411 m_xHeightDynBtn->save_state();
412 m_xLMEdit->save_value();
413 m_xRMEdit->save_value();
414 m_xCntSharedBox->save_state();
415 RangeHdl();
416
417 SfxObjectShell* pShell;
418 const SfxUInt16Item* pItem = rSet->GetItemIfSet(SID_HTML_MODE, false);
419 if(pItem ||
420 ( nullptr != (pShell = SfxObjectShell::Current()) &&
421 nullptr != (pItem = pShell->GetItem(SID_HTML_MODE))))
422 {
423 sal_uInt16 nHtmlMode = pItem->GetValue();
424 if (nHtmlMode & HTMLMODE_ON)
425 {
426 m_xCntSharedBox->hide();
427 m_xBackgroundBtn->hide();
428 }
429 }
430
431}
432
434{
435 m_xTurnOnBox->connect_toggled(LINK(this, SvxHFPage, TurnOnHdl));
436 m_xDistEdit->connect_value_changed(LINK(this, SvxHFPage, ValueChangeHdl));
437 m_xHeightEdit->connect_value_changed(LINK(this,SvxHFPage,ValueChangeHdl));
438
439 m_xLMEdit->connect_value_changed(LINK(this, SvxHFPage, ValueChangeHdl));
440 m_xRMEdit->connect_value_changed(LINK(this, SvxHFPage, ValueChangeHdl));
441 m_xBackgroundBtn->connect_clicked(LINK(this,SvxHFPage, BackgroundHdl));
442}
443
445{
446 if (m_xTurnOnBox->get_active())
447 {
448 m_xDistFT->set_sensitive(true);
449 m_xDistEdit->set_sensitive(true);
450 m_xDynSpacingCB->set_sensitive(true);
451 m_xHeightFT->set_sensitive(true);
452 m_xHeightEdit->set_sensitive(true);
453 m_xHeightDynBtn->set_sensitive(true);
454 m_xLMLbl->set_sensitive(true);
455 m_xLMEdit->set_sensitive(true);
456 m_xRMLbl->set_sensitive(true);
457 m_xRMEdit->set_sensitive(true);
458
460
461 if( nUsage == SvxPageUsage::Right || nUsage == SvxPageUsage::Left )
462 m_xCntSharedBox->set_sensitive(false);
463 else
464 {
465 m_xCntSharedBox->set_sensitive(true);
466 m_xCntSharedFirstBox->set_sensitive(true);
467 }
468 m_xBackgroundBtn->set_sensitive(true);
469 }
470 else
471 {
472 bool bDelete = true;
473
474 if (!mbDisableQueryBox && pBox && m_xTurnOnBox->get_saved_state() == TRISTATE_TRUE)
475 {
476 short nResult;
477 if (nId == SID_ATTR_PAGE_HEADERSET)
478 {
480 nResult = aDlg.run();
481 }
482 else
483 {
485 nResult = aDlg.run();
486 }
487 bDelete = nResult == RET_YES;
488 }
489
490 if ( bDelete )
491 {
492 m_xDistFT->set_sensitive(false);
493 m_xDistEdit->set_sensitive(false);
494 m_xDynSpacingCB->set_sensitive(false);
495 m_xHeightFT->set_sensitive(false);
496 m_xHeightEdit->set_sensitive(false);
497 m_xHeightDynBtn->set_sensitive(false);
498
499 m_xLMLbl->set_sensitive(false);
500 m_xLMEdit->set_sensitive(false);
501 m_xRMLbl->set_sensitive(false);
502 m_xRMEdit->set_sensitive(false);
503
504 m_xCntSharedBox->set_sensitive(false);
505 m_xBackgroundBtn->set_sensitive(false);
506 m_xCntSharedFirstBox->set_sensitive(false);
507 }
508 else
509 m_xTurnOnBox->set_active(true);
510 }
512}
513
514IMPL_LINK(SvxHFPage, TurnOnHdl, weld::Toggleable&, rBox, void)
515{
516 TurnOn(&rBox);
517}
518
520{
521 if(!pBBSet)
522 {
523 // Use only the necessary items for border and background
524 const sal_uInt16 nOuter(GetWhich(SID_ATTR_BORDER_OUTER));
525 const sal_uInt16 nInner(GetWhich(SID_ATTR_BORDER_INNER, false));
526 const sal_uInt16 nShadow(GetWhich(SID_ATTR_BORDER_SHADOW));
527
528 if(mbEnableDrawingLayerFillStyles)
529 {
530 pBBSet.reset(new SfxItemSetFixed
531 <XATTR_FILL_FIRST, XATTR_FILL_LAST, // DrawingLayer FillStyle definitions
532 SID_COLOR_TABLE, SID_PATTERN_LIST> // XPropertyLists for Color, Gradient, Hatch and Graphic fills
533 (*GetItemSet().GetPool()));
534 // Keep it valid
535 pBBSet->MergeRange(nOuter, nOuter);
536 pBBSet->MergeRange(nInner, nInner);
537 pBBSet->MergeRange(nShadow, nShadow);
538
539 // copy items for XPropertyList entries from the DrawModel so that
540 // the Area TabPage can access them
541 static const sal_uInt16 nCopyFlags[] = {
542 SID_COLOR_TABLE,
543 SID_GRADIENT_LIST,
544 SID_HATCH_LIST,
545 SID_BITMAP_LIST,
546 SID_PATTERN_LIST,
547 0
548 };
549
550 for(sal_uInt16 a(0); nCopyFlags[a]; a++)
551 {
552 const SfxPoolItem* pItem = GetItemSet().GetItem(nCopyFlags[a]);
553
554 if(pItem)
555 {
556 pBBSet->Put(*pItem);
557 }
558 else
559 {
560 OSL_ENSURE(false, "XPropertyList missing (!)");
561 }
562 }
563 }
564 else
565 {
566 const sal_uInt16 nBrush(GetWhich(SID_ATTR_BRUSH));
567
569 (*GetItemSet().GetPool()) );
570 // Keep it valid
571 pBBSet->MergeRange(nBrush, nBrush);
572 pBBSet->MergeRange(nOuter, nOuter);
573 pBBSet->MergeRange(nInner, nInner);
574 pBBSet->MergeRange(nShadow, nShadow);
575 }
576
577 const SfxPoolItem* pItem;
578
579 if(SfxItemState::SET == GetItemSet().GetItemState(GetWhich(nId), false, &pItem))
580 {
581 // If a SfxItemSet from the SetItem for SID_ATTR_PAGE_HEADERSET or
582 // SID_ATTR_PAGE_FOOTERSET exists, use its content
583 pBBSet->Put(static_cast<const SvxSetItem*>(pItem)->GetItemSet());
584 }
585 else
586 {
587 if(mbEnableDrawingLayerFillStyles)
588 {
589 // The style for header/footer is not yet created, need to reset
590 // XFillStyleItem to drawing::FillStyle_NONE which is the same as in the style
591 // initialization. This needs to be done since the pool default for
592 // XFillStyleItem is drawing::FillStyle_SOLID
593 pBBSet->Put(XFillStyleItem(drawing::FillStyle_NONE));
594 }
595 }
596
597 if(SfxItemState::SET == GetItemSet().GetItemState(nInner, false, &pItem))
598 {
599 // The set InfoItem is always required
600 pBBSet->Put(*pItem);
601 }
602 }
603
605
607 GetFrameWeld(),
608 *pBBSet,
609 mbEnableDrawingLayerFillStyles));
610
611 pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nResult) {
612 if (nResult == RET_OK && pDlg->GetOutputItemSet())
613 {
614 SfxItemIter aIter(*pDlg->GetOutputItemSet());
615
616 for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
617 {
618 if(!IsInvalidItem(pItem))
619 {
620 pBBSet->Put(*pItem);
621 }
622 }
623
624 {
625 drawinglayer::attribute::SdrAllFillAttributesHelperPtr aFillAttributes;
626
627 if (mbEnableDrawingLayerFillStyles)
628 {
629 // create FillAttributes directly from DrawingLayer FillStyle entries
630 aFillAttributes =
631 std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(*pBBSet);
632 }
633 else
634 {
635 const sal_uInt16 nWhich = GetWhich(SID_ATTR_BRUSH);
636
637 if (pBBSet->GetItemState(nWhich) == SfxItemState::SET)
638 {
639 // create FillAttributes from SvxBrushItem
640 const SvxBrushItem& rItem
641 = static_cast<const SvxBrushItem&>(pBBSet->Get(nWhich));
642 SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aTempSet(*pBBSet->GetPool());
643
644 setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
645 aFillAttributes =
646 std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
647 }
648 }
649
650 if (SID_ATTR_PAGE_HEADERSET == nId)
651 {
652 //m_aBspWin.SetHdColor(rItem.GetColor());
653 m_aBspWin.setHeaderFillAttributes(aFillAttributes);
654 }
655 else
656 {
657 //m_aBspWin.SetFtColor(rItem.GetColor());
658 m_aBspWin.setFooterFillAttributes(aFillAttributes);
659 }
660 }
661 }
662 pDlg->disposeOnce();
663 });
664
665 UpdateExample();
666}
667
669{
670 if ( nId == SID_ATTR_PAGE_HEADERSET )
671 {
672 m_aBspWin.SetHeader( m_xTurnOnBox->get_active() );
673 m_aBspWin.SetHdHeight( GetCoreValue( *m_xHeightEdit, MapUnit::MapTwip ) );
674 m_aBspWin.SetHdDist( GetCoreValue( *m_xDistEdit, MapUnit::MapTwip ) );
675 m_aBspWin.SetHdLeft( GetCoreValue( *m_xLMEdit, MapUnit::MapTwip ) );
676 m_aBspWin.SetHdRight( GetCoreValue( *m_xRMEdit, MapUnit::MapTwip ) );
677 }
678 else
679 {
680 m_aBspWin.SetFooter( m_xTurnOnBox->get_active() );
681 m_aBspWin.SetFtHeight( GetCoreValue( *m_xHeightEdit, MapUnit::MapTwip ) );
682 m_aBspWin.SetFtDist( GetCoreValue( *m_xDistEdit, MapUnit::MapTwip ) );
683 m_aBspWin.SetFtLeft( GetCoreValue( *m_xLMEdit, MapUnit::MapTwip ) );
684 m_aBspWin.SetFtRight( GetCoreValue( *m_xRMEdit, MapUnit::MapTwip ) );
685 }
687}
688
690{
691 sal_uInt16 nWhich(GetWhich(SID_ATTR_PAGE_HEADERSET));
692
693 if (SfxItemState::SET == rSet.GetItemState(nWhich, false))
694 {
695 const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false));
696 const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
697 const SfxBoolItem& rOn = rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON));
698
699 if(rOn.GetValue())
700 {
702
704 {
705 // create FillAttributes directly from DrawingLayer FillStyle entries
706 aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet);
707 }
708 else
709 {
710 nWhich = GetWhich(SID_ATTR_BRUSH);
711
712 if(SfxItemState::SET == rTmpSet.GetItemState(nWhich))
713 {
714 // create FillAttributes from SvxBrushItem
715 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
717
719 aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
720 }
721 }
722
723 m_aBspWin.setHeaderFillAttributes(aHeaderFillAttributes);
724 }
725 }
726
727 nWhich = GetWhich(SID_ATTR_PAGE_FOOTERSET);
728
729 if (SfxItemState::SET == rSet.GetItemState(nWhich, false))
730 {
731 const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false));
732 const SfxItemSet& rTmpSet = rSetItem.GetItemSet();
733 const SfxBoolItem& rOn = rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON));
734
735 if(rOn.GetValue())
736 {
738
740 {
741 // create FillAttributes directly from DrawingLayer FillStyle entries
742 aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet);
743 }
744 else
745 {
746 nWhich = GetWhich(SID_ATTR_BRUSH);
747
748 if(SfxItemState::SET == rTmpSet.GetItemState(nWhich))
749 {
750 // create FillAttributes from SvxBrushItem
751 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
753
755 aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
756 }
757 }
758
759 m_aBspWin.setFooterFillAttributes(aFooterFillAttributes);
760 }
761 }
762
764
766 {
767 // create FillAttributes directly from DrawingLayer FillStyle entries
768 aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rSet);
769 }
770 else
771 {
772 nWhich = GetWhich(SID_ATTR_BRUSH);
773
774 if(rSet.GetItemState(nWhich) >= SfxItemState::DEFAULT)
775 {
776 // create FillAttributes from SvxBrushItem
777 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rSet.Get(nWhich));
779
781 aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet);
782 }
783 }
784
785 m_aBspWin.setPageFillAttributes(aPageFillAttributes);
786}
787
789{
790 const SfxPoolItem* pItem = GetItem( rSet, SID_ATTR_LRSPACE );
791
792 if ( pItem )
793 {
794 // Set left and right margins
795 const SvxLRSpaceItem& rLRSpace = static_cast<const SvxLRSpaceItem&>(*pItem);
796
797 m_aBspWin.SetLeft( rLRSpace.GetLeft() );
798 m_aBspWin.SetRight( rLRSpace.GetRight() );
799 }
800 else
801 {
802 m_aBspWin.SetLeft( 0 );
803 m_aBspWin.SetRight( 0 );
804 }
805
806 pItem = GetItem( rSet, SID_ATTR_ULSPACE );
807
808 if ( pItem )
809 {
810 // Set top and bottom margins
811 const SvxULSpaceItem& rULSpace = static_cast<const SvxULSpaceItem&>(*pItem);
812
813 m_aBspWin.SetTop( rULSpace.GetUpper() );
814 m_aBspWin.SetBottom( rULSpace.GetLower() );
815 }
816 else
817 {
818 m_aBspWin.SetTop( 0 );
819 m_aBspWin.SetBottom( 0 );
820 }
821
823 pItem = GetItem( rSet, SID_ATTR_PAGE );
824
825 if ( pItem )
826 nUsage = static_cast<const SvxPageItem*>(pItem)->GetPageUsage();
827
828 m_aBspWin.SetUsage( nUsage );
829
830 if ( SvxPageUsage::Right == nUsage || SvxPageUsage::Left == nUsage )
831 m_xCntSharedBox->set_sensitive(false);
832 else
833 {
834 m_xCntSharedBox->set_sensitive(true);
835 m_xCntSharedFirstBox->set_sensitive(true);
836 }
837 pItem = GetItem( rSet, SID_ATTR_PAGE_SIZE );
838
839 if ( pItem )
840 {
841 // Orientation and Size from the PageItem
842 const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>(*pItem);
843 // if the size is already swapped (Landscape)
844 m_aBspWin.SetSize( rSize.GetSize() );
845 }
846
847 // Evaluate Header attribute
848 const SvxSetItem* pSetItem = nullptr;
849
850 if ( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_PAGE_HEADERSET ),
851 false,
852 reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
853 {
854 const SfxItemSet& rHeaderSet = pSetItem->GetItemSet();
855 const SfxBoolItem& rHeaderOn =
856 rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) );
857
858 if ( rHeaderOn.GetValue() )
859 {
860 const SvxSizeItem& rSize =
861 rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) );
862 const SvxULSpaceItem& rUL = rHeaderSet.Get( GetWhich(SID_ATTR_ULSPACE ) );
863 const SvxLRSpaceItem& rLR = rHeaderSet.Get( GetWhich( SID_ATTR_LRSPACE ) );
864 tools::Long nDist = rUL.GetLower();
865
866 m_aBspWin.SetHdHeight( rSize.GetSize().Height() - nDist );
867 m_aBspWin.SetHdDist( nDist );
868 m_aBspWin.SetHdLeft( rLR.GetLeft() );
870 m_aBspWin.SetHeader( true );
871 }
872 else
873 pSetItem = nullptr;
874 }
875
876 if ( !pSetItem )
877 {
878 m_aBspWin.SetHeader( false );
879
880 if ( SID_ATTR_PAGE_HEADERSET == nId )
881 {
882 m_xCntSharedBox->set_sensitive(false);
883 m_xCntSharedFirstBox->set_sensitive(false);
884 }
885 }
886 pSetItem = nullptr;
887
888 if ( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_PAGE_FOOTERSET ),
889 false,
890 reinterpret_cast<const SfxPoolItem**>(&pSetItem) ) )
891 {
892 const SfxItemSet& rFooterSet = pSetItem->GetItemSet();
893 const SfxBoolItem& rFooterOn =
894 rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) );
895
896 if ( rFooterOn.GetValue() )
897 {
898 const SvxSizeItem& rSize =
899 rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) );
900 const SvxULSpaceItem& rUL = rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) );
901 const SvxLRSpaceItem& rLR = rFooterSet.Get( GetWhich( SID_ATTR_LRSPACE ) );
902 tools::Long nDist = rUL.GetUpper();
903
904 m_aBspWin.SetFtHeight( rSize.GetSize().Height() - nDist );
905 m_aBspWin.SetFtDist( nDist );
906 m_aBspWin.SetFtLeft( rLR.GetLeft() );
908 m_aBspWin.SetFooter( true );
909 }
910 else
911 pSetItem = nullptr;
912 }
913
914 if ( !pSetItem )
915 {
916 m_aBspWin.SetFooter( false );
917
918 if ( SID_ATTR_PAGE_FOOTERSET == nId )
919 {
920 m_xCntSharedBox->set_sensitive(false);
921 m_xCntSharedFirstBox->set_sensitive(false);
922 }
923 }
924
925 pItem = GetItem( rSet, SID_ATTR_PAGE_EXT1 );
926
927 if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
928 {
929 m_aBspWin.SetTable( true );
930 m_aBspWin.SetHorz( pBoolItem->GetValue() );
931 }
932
933 pItem = GetItem( rSet, SID_ATTR_PAGE_EXT2 );
934
935 if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) )
936 {
937 m_aBspWin.SetTable( true );
938 m_aBspWin.SetVert( pBoolItem->GetValue() );
939 }
941 RangeHdl();
942}
943
945{
946 if ( _pSet )
947 FillItemSet( _pSet );
948 return DeactivateRC::LeavePage;
949}
950
952{
953 UpdateExample();
954 RangeHdl();
955}
956
958{
959 tools::Long nHHeight = m_aBspWin.GetHdHeight();
961
962 tools::Long nFHeight = m_aBspWin.GetFtHeight();
964
965 tools::Long nHeight = std::max(tools::Long(MINBODY),
966 static_cast<tools::Long>(m_xHeightEdit->denormalize(m_xHeightEdit->get_value(FieldUnit::TWIP))));
967 tools::Long nDist = m_xTurnOnBox->get_active() ?
968 static_cast<tools::Long>(m_xDistEdit->denormalize(m_xDistEdit->get_value(FieldUnit::TWIP))) : 0;
969
970 tools::Long nMin;
971 tools::Long nMax;
972
973 if ( nId == SID_ATTR_PAGE_HEADERSET )
974 {
975 nHHeight = nHeight;
976 nHDist = nDist;
977 }
978 else
979 {
980 nFHeight = nHeight;
981 nFDist = nDist;
982 }
983
984 // Current values of the side edges
989
992
993 // Borders
994 if ( nId == SID_ATTR_PAGE_HEADERSET )
995 {
996 // Header
997 nMin = ( nH - nBB - nBT ) / 5; // 20%
998 nMax = std::max( nH - nMin - nHDist - nFDist - nFHeight - nBB - nBT,
999 nMin );
1000 m_xHeightEdit->set_max(m_xHeightEdit->normalize(nMax), FieldUnit::TWIP);
1001 nMin = ( nH - nBB - nBT ) / 5; // 20%
1002 nDist = std::max( nH - nMin - nHHeight - nFDist - nFHeight - nBB - nBT,
1003 tools::Long(0) );
1004 m_xDistEdit->set_max(m_xDistEdit->normalize(nDist), FieldUnit::TWIP);
1005 }
1006 else
1007 {
1008 // Footer
1009 nMin = ( nH - nBT - nBB ) / 5; // 20%
1010 nMax = std::max( nH - nMin - nFDist - nHDist - nHHeight - nBT - nBB,
1011 nMin );
1012 m_xHeightEdit->set_max(m_xHeightEdit->normalize(nMax), FieldUnit::TWIP);
1013 nMin = ( nH - nBT - nBB ) / 5; // 20%
1014 nDist = std::max( nH - nMin - nFHeight - nHDist - nHHeight - nBT - nBB,
1015 tools::Long(0) );
1016 m_xDistEdit->set_max(m_xDistEdit->normalize(nDist), FieldUnit::TWIP);
1017 }
1018
1019 // Limit Indentation
1020 nMax = nW - nBL - nBR -
1021 static_cast<tools::Long>(m_xRMEdit->denormalize(m_xRMEdit->get_value(FieldUnit::TWIP))) - MINBODY;
1022 m_xLMEdit->set_max(m_xLMEdit->normalize(nMax), FieldUnit::TWIP);
1023
1024 nMax = nW - nBL - nBR -
1025 static_cast<tools::Long>(m_xLMEdit->denormalize(m_xLMEdit->get_value(FieldUnit::TWIP))) - MINBODY;
1026 m_xRMEdit->set_max(m_xLMEdit->normalize(nMax), FieldUnit::TWIP);
1027}
1028
1030{
1031 m_xDynSpacingCB->show();
1032}
1033
1035{
1036 const SfxBoolItem* pSupportDrawingLayerFillStyleItem = rSet.GetItem<SfxBoolItem>(SID_DRAWINGLAYER_FILLSTYLES, false);
1037
1038 if (pSupportDrawingLayerFillStyleItem)
1039 {
1040 const bool bNew(pSupportDrawingLayerFillStyleItem->GetValue());
1041
1043 }
1044}
1045
1046/* 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:788
sal_uInt16 nId
Definition: hdft.hxx:60
void UpdateExample()
Definition: hdft.cxx:668
std::unique_ptr< weld::Label > m_xDistFT
Definition: hdft.hxx:74
void InitHandler()
Definition: hdft.cxx:433
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:1029
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:689
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:957
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:1034
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:444
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:944
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:514
IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button &, void)
Definition: hdft.cxx:519
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)