LibreOffice Module cui (master) 1
paragrph.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 <memory>
21#include <osl/diagnose.h>
22#include <svl/style.hxx>
23#include <sfx2/objsh.hxx>
24#include <vcl/mnemonic.hxx>
25#include <vcl/settings.hxx>
26#include <svx/flagsdef.hxx>
27#include <svx/svxids.hrc>
28#include <svx/sdtaitm.hxx>
29
30#include <svl/cjkoptions.hxx>
31#include <editeng/pgrditem.hxx>
32#include <svx/strings.hrc>
33#include <svx/dialmgr.hxx>
34#include <paragrph.hxx>
36#include <editeng/lspcitem.hxx>
38#include <editeng/orphitem.hxx>
39#include <editeng/widwitem.hxx>
40#include <editeng/tstpitem.hxx>
41#include <editeng/pmdlitem.hxx>
42#include <editeng/spltitem.hxx>
44#include <editeng/ulspitem.hxx>
45#include <editeng/lrspitem.hxx>
47#include <editeng/keepitem.hxx>
51#include <svx/dlgutil.hxx>
52#include <sfx2/htmlmode.hxx>
54#include <svl/eitem.hxx>
55#include <svl/intitem.hxx>
56
59 SID_ATTR_PARA_LINESPACE, SID_ATTR_PARA_LINESPACE, // 10033
60 SID_ATTR_PARA_LEFTSPACE, SID_ATTR_PARA_FIRSTLINESPACE,
61 SID_ATTR_LRSPACE, SID_ATTR_ULSPACE, // 10048 - 10049
62 SID_ATTR_PARA_REGISTER, SID_ATTR_PARA_REGISTER // 10413
63 >);
64
66 svl::Items<SID_ATTR_PARA_ADJUST, SID_ATTR_PARA_ADJUST>); // 10027
67
70 SDRATTR_TEXT_VERTADJUST, SDRATTR_TEXT_VERTADJUST, // 1076
71 SID_ATTR_PARA_ADJUST, SID_ATTR_PARA_ADJUST , // 10027
72 SID_ATTR_FRAMEDIRECTION, SID_ATTR_FRAMEDIRECTION // 10944
73 >);
74
76 SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_WIDOWS, // 10037 - 10041
77 SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP // 10065 - 10066
78>);
79
80#define MAX_DURCH 31680 // tdf#68335: 1584 pt for UX interoperability with Word
81#define FIX_DIST_DEF 283 // standard fix distance 0,5 cm
82
83namespace {
84
85enum LineSpaceList
86{
87 LLINESPACE_1 = 0,
89 LLINESPACE_15 = 2,
90 LLINESPACE_2 = 3,
95};
96
97}
98
99static void SetLineSpace_Impl( SvxLineSpacingItem&, int, tools::Long lValue = 0 );
100
102 int eSpace, tools::Long lValue )
103{
104 switch ( eSpace )
105 {
106 case LLINESPACE_1:
107 rLineSpace.SetLineSpaceRule( SvxLineSpaceRule::Auto );
108 rLineSpace.SetInterLineSpaceRule( SvxInterLineSpaceRule::Off );
109 break;
110
111 case LLINESPACE_115:
112 rLineSpace.SetLineSpaceRule( SvxLineSpaceRule::Auto );
113 rLineSpace.SetPropLineSpace( 115 );
114 break;
115
116 case LLINESPACE_15:
117 rLineSpace.SetLineSpaceRule( SvxLineSpaceRule::Auto );
118 rLineSpace.SetPropLineSpace( 150 );
119 break;
120
121 case LLINESPACE_2:
122 rLineSpace.SetLineSpaceRule( SvxLineSpaceRule::Auto );
123 rLineSpace.SetPropLineSpace( 200 );
124 break;
125
126 case LLINESPACE_PROP:
127 rLineSpace.SetLineSpaceRule( SvxLineSpaceRule::Auto );
128 rLineSpace.SetPropLineSpace( static_cast<sal_uInt16>(lValue) );
129 break;
130
131 case LLINESPACE_MIN:
132 rLineSpace.SetLineHeight( static_cast<sal_uInt16>(lValue) );
133 rLineSpace.SetInterLineSpaceRule( SvxInterLineSpaceRule::Off );
134 break;
135
136 case LLINESPACE_DURCH:
137 rLineSpace.SetLineSpaceRule( SvxLineSpaceRule::Auto );
138 rLineSpace.SetInterLineSpace( static_cast<sal_uInt16>(lValue) );
139 break;
140
141 case LLINESPACE_FIX:
142 rLineSpace.SetLineHeight(static_cast<sal_uInt16>(lValue));
143 rLineSpace.SetLineSpaceRule( SvxLineSpaceRule::Fix );
144 rLineSpace.SetInterLineSpaceRule( SvxInterLineSpaceRule::Off );
145 break;
146 }
147}
148
149static sal_uInt16 GetHtmlMode_Impl(const SfxItemSet& rSet)
150{
151 sal_uInt16 nHtmlMode = 0;
152 const SfxUInt16Item* pItem = rSet.GetItemIfSet(SID_HTML_MODE, false);
153 if (!pItem)
154 {
156 pItem = pShell->GetItem(SID_HTML_MODE);
157 }
158 if(pItem)
159 {
160 nHtmlMode = pItem->GetValue();
161 }
162 return nHtmlMode;
163
164}
165
167{
168 SfxItemPool* pPool = GetItemSet().GetPool();
169 DBG_ASSERT( pPool, "Where is the pool?" );
170 FieldUnit eUnit =
171 MapToFieldUnit( pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) ) );
172
173 sal_Int64 nL = m_aLeftIndent.denormalize(m_aLeftIndent.get_value(eUnit));
174 sal_Int64 nR = m_aRightIndent.denormalize(m_aRightIndent.get_value(eUnit));
175 OUString aTmp = m_aFLineIndent.get_text();
176
177 if (m_aLeftIndent.get_min(FieldUnit::NONE) < 0)
178 m_aFLineIndent.set_min(-99999, FieldUnit::MM);
179 else
181
182 // Check only for concrete width (Shell)
183 sal_Int64 nTmp = nWidth - nL - nR - MM50;
185
186 if (aTmp.isEmpty())
187 m_aFLineIndent.set_text(OUString());
188 // maximum left right
189 aTmp = m_aLeftIndent.get_text();
190 nTmp = nWidth - nR - MM50;
192
193 if ( aTmp.isEmpty() )
194 m_aLeftIndent.set_text(OUString());
195 aTmp = m_aRightIndent.get_text();
196 nTmp = nWidth - nL - MM50;
198
199 if ( aTmp.isEmpty() )
200 m_aRightIndent.set_text(OUString());
201
203}
204
206{
207 ELRLoseFocus();
208}
209
210std::unique_ptr<SfxTabPage> SvxStdParagraphTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet)
211{
212 return std::make_unique<SvxStdParagraphTabPage>(pPage, pController, *rSet);
213}
214
216{
217 const SfxPoolItem* pOld = nullptr;
218 SfxItemPool* pPool = rOutSet->GetPool();
219 DBG_ASSERT( pPool, "Where is the pool?" );
220
221 bool bModified = false;
222 sal_uInt16 nWhich;
223 int nPos = m_xLineDist->get_active();
224
225 if ( nPos != -1 &&
227 m_xLineDist->get_value_changed_from_saved() ||
228 m_xLineDistAtPercentBox->get_value_changed_from_saved() ||
229 m_xLineDistAtMetricBox->get_value_changed_from_saved() ) )
230 {
231 nWhich = GetWhich( SID_ATTR_PARA_LINESPACE );
232 MapUnit eUnit = pPool->GetMetric( nWhich );
233 SvxLineSpacingItem aSpacing(
234 static_cast<const SvxLineSpacingItem&>(GetItemSet().Get( nWhich )) );
235
236 switch ( nPos )
237 {
238 case LLINESPACE_1:
239 case LLINESPACE_115:
240 case LLINESPACE_15:
241 case LLINESPACE_2:
242 SetLineSpace_Impl( aSpacing, nPos );
243 break;
244
245 case LLINESPACE_PROP:
246 SetLineSpace_Impl( aSpacing, nPos,
247 static_cast<tools::Long>(m_xLineDistAtPercentBox->denormalize(
248 m_xLineDistAtPercentBox->get_value(FieldUnit::NONE) )) );
249 break;
250
251 case LLINESPACE_MIN:
252 case LLINESPACE_DURCH:
253 case LLINESPACE_FIX:
254 SetLineSpace_Impl( aSpacing, nPos,
256 break;
257
258 default:
259 OSL_FAIL( "unknown LineDist entry" );
260 break;
261 }
262 pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_LINESPACE );
263
264 if ( m_bLineDistToggled ||
265 !pOld || !( *static_cast<const SvxLineSpacingItem*>(pOld) == aSpacing ) ||
266 SfxItemState::DONTCARE == GetItemSet().GetItemState( nWhich ) )
267 {
268 rOutSet->Put( aSpacing );
269 bModified = true;
270 }
271 }
272
274 || m_xContextualCB->get_state_changed_from_saved())
275 {
276 nWhich = GetWhich( SID_ATTR_ULSPACE );
277 MapUnit eUnit = pPool->GetMetric( nWhich );
278 pOld = GetOldItem( *rOutSet, SID_ATTR_ULSPACE );
279 SvxULSpaceItem aMargin( nWhich );
280
281 if ( bRelativeMode )
282 {
283 DBG_ASSERT( GetItemSet().GetParent(), "No ParentSet" );
284
285 const SvxULSpaceItem& rOldItem =
286 static_cast<const SvxULSpaceItem&>(GetItemSet().GetParent()->Get( nWhich ));
287
288 if ( m_aTopDist.IsRelative() )
289 aMargin.SetUpper( rOldItem.GetUpper(),
290 static_cast<sal_uInt16>(m_aTopDist.get_value(FieldUnit::NONE)) );
291 else
292 aMargin.SetUpper( static_cast<sal_uInt16>(m_aTopDist.GetCoreValue(eUnit)) );
293
295 aMargin.SetLower( rOldItem.GetLower(),
296 static_cast<sal_uInt16>(m_aBottomDist.get_value(FieldUnit::NONE)) );
297 else
298 aMargin.SetLower( static_cast<sal_uInt16>(m_aBottomDist.GetCoreValue(eUnit)) );
299
300 }
301 else
302 {
303 aMargin.SetUpper(static_cast<sal_uInt16>(m_aTopDist.GetCoreValue(eUnit)));
304 aMargin.SetLower(static_cast<sal_uInt16>(m_aBottomDist.GetCoreValue(eUnit)));
305 }
306 aMargin.SetContextValue(m_xContextualCB->get_active());
307
308 if ( !pOld || *static_cast<const SvxULSpaceItem*>(pOld) != aMargin ||
309 SfxItemState::DONTCARE == GetItemSet().GetItemState( nWhich ) )
310 {
311 rOutSet->Put( aMargin );
312 bModified = true;
313 }
314 }
315 bool bNullTab = false;
316
318 {
319 nWhich = GetWhich(SID_ATTR_PARA_LEFTSPACE);
320 MapUnit const eUnit = pPool->GetMetric(nWhich);
321 SvxTextLeftMarginItem item(nWhich);
322 pOld = GetOldItem(*rOutSet, SID_ATTR_PARA_LEFTSPACE);
323
324 if (bRelativeMode)
325 {
326 assert(GetItemSet().GetParent());
327
328 const SvxTextLeftMarginItem & rOldItem(
329 static_cast<const SvxTextLeftMarginItem&>(GetItemSet().GetParent()->Get(nWhich)));
330
332 {
333 item.SetTextLeft(rOldItem.GetTextLeft(),
334 static_cast<sal_uInt16>(m_aLeftIndent.get_value(FieldUnit::NONE)));
335 }
336 else
337 {
339 }
340 }
341 else
342 {
344 }
345 if (!pOld || *static_cast<const SvxTextLeftMarginItem*>(pOld) != item
346 || SfxItemState::DONTCARE == GetItemSet().GetItemState(nWhich))
347 {
348 rOutSet->Put(item);
349 bModified = true;
350 }
351 }
352
354 {
355 nWhich = GetWhich(SID_ATTR_PARA_RIGHTSPACE);
356 MapUnit const eUnit = pPool->GetMetric(nWhich);
357 SvxRightMarginItem item(nWhich);
358 pOld = GetOldItem(*rOutSet, SID_ATTR_PARA_RIGHTSPACE);
359
360 if (bRelativeMode)
361 {
362 assert(GetItemSet().GetParent());
363
364 const SvxRightMarginItem & rOldItem(
365 static_cast<const SvxRightMarginItem&>(GetItemSet().GetParent()->Get(nWhich)));
366
368 {
369 item.SetRight(rOldItem.GetRight(),
370 static_cast<sal_uInt16>(m_aRightIndent.get_value(FieldUnit::NONE)));
371 }
372 else
373 {
375 }
376 }
377 else
378 {
380 }
381 if (!pOld || *static_cast<const SvxRightMarginItem*>(pOld) != item
382 || SfxItemState::DONTCARE == GetItemSet().GetItemState(nWhich))
383 {
384 rOutSet->Put(item);
385 bModified = true;
386 }
387 }
388
390 || m_xAutoCB->get_state_changed_from_saved()))
391 {
392 nWhich = GetWhich(SID_ATTR_PARA_FIRSTLINESPACE);
393 MapUnit const eUnit = pPool->GetMetric(nWhich);
394 SvxFirstLineIndentItem item(nWhich);
395 pOld = GetOldItem(*rOutSet, SID_ATTR_PARA_FIRSTLINESPACE);
396
397 if (bRelativeMode)
398 {
399 assert(GetItemSet().GetParent());
400
401 const SvxFirstLineIndentItem & rOldItem(
402 static_cast<const SvxFirstLineIndentItem&>(GetItemSet().GetParent()->Get(nWhich)));
403
405 {
407 static_cast<sal_uInt16>(m_aFLineIndent.get_value(FieldUnit::NONE)));
408 }
409 else
410 {
411 item.SetTextFirstLineOffset(static_cast<sal_uInt16>(m_aFLineIndent.GetCoreValue(eUnit)));
412 }
413 }
414 else
415 {
416 item.SetTextFirstLineOffset(static_cast<sal_uInt16>(m_aFLineIndent.GetCoreValue(eUnit)));
417 }
418 item.SetAutoFirst(m_xAutoCB->get_active());
419 if (item.GetTextFirstLineOffset() < 0)
420 {
421 bNullTab = true;
422 }
423
424 if (!pOld || *static_cast<const SvxFirstLineIndentItem*>(pOld) != item
425 || SfxItemState::DONTCARE == GetItemSet().GetItemState(nWhich))
426 {
427 rOutSet->Put(item);
428 bModified = true;
429 }
430 }
431
432 if (!m_bSplitLRSpace &&
436 m_xAutoCB->get_state_changed_from_saved()))
437 {
438 nWhich = GetWhich( SID_ATTR_LRSPACE );
439 MapUnit eUnit = pPool->GetMetric( nWhich );
440 SvxLRSpaceItem aMargin( nWhich );
441 pOld = GetOldItem( *rOutSet, SID_ATTR_LRSPACE );
442
443 if ( bRelativeMode )
444 {
445 DBG_ASSERT( GetItemSet().GetParent(), "No ParentSet" );
446
447 const SvxLRSpaceItem& rOldItem =
448 static_cast<const SvxLRSpaceItem&>(GetItemSet().GetParent()->Get( nWhich ));
449
451 aMargin.SetTextLeft( rOldItem.GetTextLeft(),
452 static_cast<sal_uInt16>(m_aLeftIndent.get_value(FieldUnit::NONE)) );
453 else
454 aMargin.SetTextLeft(m_aLeftIndent.GetCoreValue(eUnit));
455
457 aMargin.SetRight( rOldItem.GetRight(),
458 static_cast<sal_uInt16>(m_aRightIndent.get_value(FieldUnit::NONE)) );
459 else
460 aMargin.SetRight(m_aRightIndent.GetCoreValue(eUnit));
461
464 static_cast<sal_uInt16>(m_aFLineIndent.get_value(FieldUnit::NONE)) );
465 else
466 aMargin.SetTextFirstLineOffset(static_cast<sal_uInt16>(m_aFLineIndent.GetCoreValue(eUnit)));
467 }
468 else
469 {
470 aMargin.SetTextLeft(m_aLeftIndent.GetCoreValue(eUnit));
471 aMargin.SetRight(m_aRightIndent.GetCoreValue(eUnit));
472 aMargin.SetTextFirstLineOffset(static_cast<sal_uInt16>(m_aFLineIndent.GetCoreValue(eUnit)));
473 }
474 aMargin.SetAutoFirst(m_xAutoCB->get_active());
475 if ( aMargin.GetTextFirstLineOffset() < 0 )
476 bNullTab = true;
477
478 if ( !pOld || *static_cast<const SvxLRSpaceItem*>(pOld) != aMargin ||
479 SfxItemState::DONTCARE == GetItemSet().GetItemState( nWhich ) )
480 {
481 rOutSet->Put( aMargin );
482 bModified = true;
483 }
484 }
485
486 if ( bNullTab )
487 {
488 MapUnit eUnit = pPool->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
489 if ( MapUnit::Map100thMM != eUnit )
490 {
491
492 // negative first line indent -> set null default tabstob if applicable
493 sal_uInt16 _nWhich = GetWhich( SID_ATTR_TABSTOP );
494 const SfxItemSet& rInSet = GetItemSet();
495
496 if ( rInSet.GetItemState( _nWhich ) >= SfxItemState::DEFAULT )
497 {
498 const SvxTabStopItem& rTabItem =
499 static_cast<const SvxTabStopItem&>(rInSet.Get( _nWhich ));
500 SvxTabStopItem aNullTab( rTabItem );
501 SvxTabStop aNull( 0, SvxTabAdjust::Default );
502 aNullTab.Insert( aNull );
503 rOutSet->Put( aNullTab );
504 }
505 }
506 }
507 if (m_xRegisterCB->get_visible())
508 {
509 const SfxBoolItem* pBoolItem = static_cast<const SfxBoolItem*>(GetOldItem(
510 *rOutSet, SID_ATTR_PARA_REGISTER));
511 if (!pBoolItem)
512 return bModified;
513 sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_REGISTER );
514 bool bSet = pBoolItem->GetValue();
515
516 if (m_xRegisterCB->get_active() != bSet)
517 {
518 std::unique_ptr<SfxBoolItem> pRegItem(pBoolItem->Clone());
519 pRegItem->SetValue(!bSet);
520 rOutSet->Put(std::move(pRegItem));
521 bModified = true;
522 }
523 else if ( SfxItemState::DEFAULT == GetItemSet().GetItemState( _nWhich, false ) )
524 rOutSet->ClearItem(_nWhich);
525 }
526
527 return bModified;
528}
529
531{
532 SfxItemPool* pPool = rSet->GetPool();
533 DBG_ASSERT( pPool, "Where is the pool?" );
534
535 // adjust metric
536 FieldUnit eFUnit = GetModuleFieldUnit( *rSet );
537
538 bool bApplyCharUnit = GetApplyCharUnit( *rSet );
539
540 if(SvtCJKOptions::IsAsianTypographyEnabled() && bApplyCharUnit )
541 eFUnit = FieldUnit::CHAR;
542
546 if ( eFUnit == FieldUnit::CHAR )
547 {
548 m_aTopDist.SetFieldUnit(FieldUnit::LINE);
549 m_aBottomDist.SetFieldUnit(FieldUnit::LINE);
550 SetFieldUnit(*m_xLineDistAtMetricBox, FieldUnit::POINT);
551 }
552 else
553 {
554 m_aTopDist.SetFieldUnit(eFUnit);
557 }
558
559 sal_uInt16 const nWhichFL(GetWhich(SID_ATTR_PARA_FIRSTLINESPACE));
560 m_bSplitLRSpace = (nWhichFL != SID_ATTR_PARA_FIRSTLINESPACE);
561 SfxItemState const eItemStateFL(rSet->GetItemState(nWhichFL));
562 sal_uInt16 const nWhichLM(GetWhich(SID_ATTR_PARA_LEFTSPACE));
563 SfxItemState const eItemStateLM(rSet->GetItemState(nWhichLM));
564 sal_uInt16 const nWhichRM(GetWhich(SID_ATTR_PARA_RIGHTSPACE));
565 SfxItemState const eItemStateRM(rSet->GetItemState(nWhichRM));
566
567 if (m_bSplitLRSpace && SfxItemState::DEFAULT <= eItemStateLM)
568 {
569 const SvxTextLeftMarginItem & rOldLeftMargin(
570 static_cast<const SvxTextLeftMarginItem &>(rSet->Get(nWhichLM)));
571
572 MapUnit const eUnit = pPool->GetMetric(nWhichLM);
573
574 if (bRelativeMode)
575 {
576 if (rOldLeftMargin.GetPropLeft() != 100)
577 {
579 m_aLeftIndent.set_value(rOldLeftMargin.GetPropLeft(), FieldUnit::NONE);
580 }
581 else
582 {
585 m_aLeftIndent.SetMetricValue(rOldLeftMargin.GetTextLeft(), eUnit);
586 }
587 }
588 else
589 {
590 m_aLeftIndent.SetMetricValue(rOldLeftMargin.GetTextLeft(), eUnit);
591 }
592 }
593 else if (m_bSplitLRSpace)
594 {
595 m_aLeftIndent.set_text(OUString());
596 }
597
598 if (m_bSplitLRSpace && SfxItemState::DEFAULT <= eItemStateRM)
599 {
600 const SvxRightMarginItem & rOldRightMargin(
601 static_cast<const SvxRightMarginItem &>(rSet->Get(nWhichRM)));
602
603 MapUnit const eUnit = pPool->GetMetric(nWhichRM);
604
605 if (bRelativeMode)
606 {
607 if (rOldRightMargin.GetPropRight() != 100)
608 {
610 m_aRightIndent.set_value(rOldRightMargin.GetPropRight(), FieldUnit::NONE);
611 }
612 else
613 {
616 m_aRightIndent.SetMetricValue(rOldRightMargin.GetRight(), eUnit);
617 }
618 }
619 else
620 {
621 m_aRightIndent.SetMetricValue(rOldRightMargin.GetRight(), eUnit);
622 }
623 }
624 else if (m_bSplitLRSpace)
625 {
626 m_aRightIndent.set_text(OUString());
627 }
628
629 if (m_bSplitLRSpace && SfxItemState::DEFAULT <= eItemStateFL)
630 {
631 const SvxFirstLineIndentItem & rOldFirstLine(
632 static_cast<const SvxFirstLineIndentItem &>(rSet->Get(nWhichFL)));
633
634 MapUnit const eUnit = pPool->GetMetric(nWhichFL);
635
636 if (bRelativeMode)
637 {
638 if (rOldFirstLine.GetPropTextFirstLineOffset() != 100)
639 {
641 m_aFLineIndent.set_value(rOldFirstLine.GetPropTextFirstLineOffset(), FieldUnit::NONE);
642 }
643 else
644 {
646 m_aFLineIndent.set_min(-9999, FieldUnit::NONE);
649 }
650 m_xAutoCB->set_active(rOldFirstLine.IsAutoFirst());
651 }
652 else
653 {
655 m_xAutoCB->set_active(rOldFirstLine.IsAutoFirst());
656 }
657 AutoHdl_Impl(*m_xAutoCB);
658 }
659 else if (m_bSplitLRSpace)
660 {
661 m_aFLineIndent.set_text(OUString());
662 }
663
664 sal_uInt16 _nWhich = GetWhich( SID_ATTR_LRSPACE );
665 SfxItemState eItemState = rSet->GetItemState( _nWhich );
666
667 if (!m_bSplitLRSpace && SfxItemState::DEFAULT <= eItemState)
668 {
669 MapUnit eUnit = pPool->GetMetric( _nWhich );
670
671 if ( bRelativeMode )
672 {
673 const SvxLRSpaceItem& rOldItem =
674 static_cast<const SvxLRSpaceItem&>(rSet->Get( _nWhich ));
675
676 if ( rOldItem.GetPropLeft() != 100 )
677 {
679 m_aLeftIndent.set_value(rOldItem.GetPropLeft(), FieldUnit::NONE);
680 }
681 else
682 {
685 m_aLeftIndent.SetMetricValue(rOldItem.GetTextLeft(), eUnit);
686 }
687
688 if ( rOldItem.GetPropRight() != 100 )
689 {
691 m_aRightIndent.set_value(rOldItem.GetPropRight(), FieldUnit::NONE);
692 }
693 else
694 {
697 m_aRightIndent.SetMetricValue(rOldItem.GetRight(), eUnit);
698 }
699
700 if ( rOldItem.GetPropTextFirstLineOffset() != 100 )
701 {
703 m_aFLineIndent.set_value(rOldItem.GetPropTextFirstLineOffset(), FieldUnit::NONE);
704 }
705 else
706 {
708 m_aFLineIndent.set_min(-9999, FieldUnit::NONE);
711 }
712 m_xAutoCB->set_active(rOldItem.IsAutoFirst());
713 }
714 else
715 {
716 const SvxLRSpaceItem& rSpace =
717 static_cast<const SvxLRSpaceItem&>(rSet->Get( _nWhich ));
718
720 m_aRightIndent.SetMetricValue(rSpace.GetRight(), eUnit);
722 m_xAutoCB->set_active(rSpace.IsAutoFirst());
723 }
724 AutoHdl_Impl(*m_xAutoCB);
725 }
726 else if (!m_bSplitLRSpace)
727 {
728 m_aLeftIndent.set_text(OUString());
729 m_aRightIndent.set_text(OUString());
730 m_aFLineIndent.set_text(OUString());
731 }
732
733 _nWhich = GetWhich( SID_ATTR_ULSPACE );
734 eItemState = rSet->GetItemState( _nWhich );
735
736 if ( eItemState >= SfxItemState::DEFAULT )
737 {
738 MapUnit eUnit = pPool->GetMetric( _nWhich );
739
740 const SvxULSpaceItem& rOldItem =
741 static_cast<const SvxULSpaceItem&>(rSet->Get( _nWhich ));
742 if ( bRelativeMode )
743 {
744
745 if ( rOldItem.GetPropUpper() != 100 )
746 {
747 m_aTopDist.SetRelative( true );
748 m_aTopDist.set_value(rOldItem.GetPropUpper(), FieldUnit::NONE);
749 }
750 else
751 {
752 m_aTopDist.SetRelative(false);
753 if (eFUnit == FieldUnit::CHAR)
754 m_aTopDist.SetFieldUnit(FieldUnit::LINE);
755 else
756 m_aTopDist.SetFieldUnit(eFUnit);
757 m_aTopDist.SetMetricValue(rOldItem.GetUpper(), eUnit);
758 }
759
760 if ( rOldItem.GetPropLower() != 100 )
761 {
763 m_aBottomDist.set_value(rOldItem.GetPropLower(), FieldUnit::NONE);
764 }
765 else
766 {
768 if (eFUnit == FieldUnit::CHAR)
769 m_aBottomDist.SetFieldUnit(FieldUnit::LINE);
770 else
772 m_aBottomDist.SetMetricValue(rOldItem.GetLower(), eUnit);
773 }
774 }
775 else
776 {
777 m_aTopDist.SetMetricValue(rOldItem.GetUpper(), eUnit);
778 m_aBottomDist.SetMetricValue(rOldItem.GetLower(), eUnit);
779 }
780 m_xContextualCB->set_active(rOldItem.GetContext());
781 }
782 else
783 {
784 m_aTopDist.set_text(OUString());
785 m_aBottomDist.set_text(OUString());
786 }
787
788 _nWhich = GetWhich( SID_ATTR_PARA_LINESPACE );
789 eItemState = rSet->GetItemState( _nWhich );
790
791 if ( eItemState >= SfxItemState::DEFAULT )
792 SetLineSpacing_Impl( static_cast<const SvxLineSpacingItem &>(rSet->Get( _nWhich )) );
793 else
794 m_xLineDist->set_active(-1);
795
796 _nWhich = GetWhich( SID_ATTR_PARA_REGISTER );
797 eItemState = rSet->GetItemState( _nWhich );
798
799 if ( eItemState >= SfxItemState::DEFAULT )
800 m_xRegisterCB->set_active( static_cast<const SfxBoolItem &>(rSet->Get( _nWhich )).GetValue());
801 m_xRegisterCB->save_state();
802 sal_uInt16 nHtmlMode = GetHtmlMode_Impl(*rSet);
803 if(nHtmlMode & HTMLMODE_ON)
804 {
805 m_xRegisterCB->hide();
806 m_xAutoCB->hide();
807 }
808
809 // this sets the min/max limits; do this _after_ setting the values,
810 // because for Impress the min of first-line indent depends on value of
811 // left-indent!
812 ELRLoseFocus();
814}
815
817{
821 m_xLineDist->save_value();
822 m_xLineDistAtPercentBox->save_value();
823 m_xLineDistAtMetricBox->save_value();
824 m_xRegisterCB->save_state();
827 m_xContextualCB->save_state();
828 m_xAutoCB->save_state();
829}
830
832{
833 DBG_ASSERT( GetItemSet().GetParent(), "RelativeMode, but no parent-set!" );
834
840 bRelativeMode = true;
841}
842
844{
845 sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
846 SfxItemState eItemState = rSet.GetItemState( _nWhich );
847
848 if ( eItemState < SfxItemState::DEFAULT )
849 return;
850
851 const SvxAdjustItem& rAdj = static_cast<const SvxAdjustItem&>( rSet.Get( _nWhich ) );
852 SvxAdjust eAdjust = rAdj.GetAdjust();
853 if ( eAdjust == SvxAdjust::Center || eAdjust == SvxAdjust::Block )
854 {
855 _nWhich = GetWhich( SID_ATTR_FRAMEDIRECTION );
856 eItemState = rSet.GetItemState( _nWhich );
857
858 if ( eItemState >= SfxItemState::DEFAULT )
859 {
860 const SvxFrameDirectionItem& rFrameDirItem = static_cast<const SvxFrameDirectionItem&>( rSet.Get( _nWhich ) );
861 SvxFrameDirection eFrameDirection = rFrameDirItem.GetValue();
862
863 m_aExampleWin.EnableRTL( SvxFrameDirection::Horizontal_RL_TB == eFrameDirection );
864
865 if ( eAdjust == SvxAdjust::Block )
867 }
868 }
869 else
870 {
871 m_aExampleWin.EnableRTL( eAdjust == SvxAdjust::Right );
872 eAdjust = SvxAdjust::Left; //required for correct preview display
873 m_aExampleWin.SetLastLine( eAdjust );
874 }
875 m_aExampleWin.SetAdjust( eAdjust );
876
878}
879
881{
882 ELRLoseFocus();
883
884 if ( _pSet )
885 FillItemSet( _pSet );
886 return DeactivateRC::LeavePage;
887}
888
890 : SfxTabPage(pPage, pController, "cui/ui/paraindentspacing.ui", "ParaIndentSpacing", &rAttr)
891 , nWidth(11905 /*567 * 50*/)
892 , nMinFixDist(0)
893 , bRelativeMode(false)
894 , m_aLeftIndent(m_xBuilder->weld_metric_spin_button("spinED_LEFTINDENT", FieldUnit::CM))
895 , m_aRightIndent(m_xBuilder->weld_metric_spin_button("spinED_RIGHTINDENT", FieldUnit::CM))
896 , m_xFLineLabel(m_xBuilder->weld_label("labelFT_FLINEINDENT"))
897 , m_aFLineIndent(m_xBuilder->weld_metric_spin_button("spinED_FLINEINDENT", FieldUnit::CM))
898 , m_xAutoCB(m_xBuilder->weld_check_button("checkCB_AUTO"))
899 , m_aTopDist(m_xBuilder->weld_metric_spin_button("spinED_TOPDIST", FieldUnit::CM))
900 , m_aBottomDist(m_xBuilder->weld_metric_spin_button("spinED_BOTTOMDIST", FieldUnit::CM))
901 , m_xContextualCB(m_xBuilder->weld_check_button("checkCB_CONTEXTUALSPACING"))
902 , m_xLineDist(m_xBuilder->weld_combo_box("comboLB_LINEDIST"))
903 , m_xLineDistAtPercentBox(m_xBuilder->weld_metric_spin_button("spinED_LINEDISTPERCENT", FieldUnit::PERCENT))
904 , m_xLineDistAtMetricBox(m_xBuilder->weld_metric_spin_button("spinED_LINEDISTMETRIC", FieldUnit::CM))
905 , m_xLineDistAtPlaceHolderBox(m_xBuilder->weld_metric_spin_button("spinED_BLANK", FieldUnit::CM))
906 , m_xLineDistAtLabel(m_xBuilder->weld_label("labelFT_LINEDIST"))
907 , m_xAbsDist(m_xBuilder->weld_label("labelST_LINEDIST_ABS"))
908 , m_xRegisterCB(m_xBuilder->weld_check_button("checkCB_REGISTER"))
909 , m_xExampleWin(new weld::CustomWeld(*m_xBuilder, "drawingareaWN_EXAMPLE", m_aExampleWin))
910{
911 sAbsDist = m_xAbsDist->get_label();
912
913 // this page needs ExchangeSupport
915
918 m_xLineDistAtPlaceHolderBox->set_text(OUString());
919
920 Init_Impl();
921 m_aFLineIndent.set_min(-9999, FieldUnit::NONE); // is set to 0 on default
922}
923
925{
926}
927
929{
930 m_aLeftIndent.set_min(-9999, FieldUnit::NONE);
931 m_aRightIndent.set_min(-9999, FieldUnit::NONE);
934}
935
937(
938 const SvxLineSpacingItem &rAttr
939)
940{
941 MapUnit eUnit = GetItemSet().GetPool()->GetMetric( rAttr.Which() );
942
943 switch( rAttr.GetLineSpaceRule() )
944 {
945 case SvxLineSpaceRule::Auto:
946 {
948
949 switch( eInter )
950 {
951 // Default single line spacing
952 case SvxInterLineSpaceRule::Off:
953 m_xLineDist->set_active( LLINESPACE_1 );
954 break;
955
956 // Default single line spacing
957 case SvxInterLineSpaceRule::Prop:
958 if ( 100 == rAttr.GetPropLineSpace() )
959 {
960 m_xLineDist->set_active( LLINESPACE_1 );
961 break;
962 }
963 // 1.15 line spacing
964 if ( 115 == rAttr.GetPropLineSpace() )
965 {
966 m_xLineDist->set_active( LLINESPACE_115 );
967 break;
968 }
969 // 1.5 line spacing
970 if ( 150 == rAttr.GetPropLineSpace() )
971 {
972 m_xLineDist->set_active( LLINESPACE_15 );
973 break;
974 }
975 // double line spacing
976 if ( 200 == rAttr.GetPropLineSpace() )
977 {
978 m_xLineDist->set_active( LLINESPACE_2 );
979 break;
980 }
981 // the set per cent value
982 m_xLineDistAtPercentBox->set_value(m_xLineDistAtPercentBox->normalize(rAttr.GetPropLineSpace()), FieldUnit::NONE);
983 m_xLineDist->set_active( LLINESPACE_PROP );
984 break;
985
986 case SvxInterLineSpaceRule::Fix:
988 m_xLineDist->set_active( LLINESPACE_DURCH );
989 break;
990 default: ;//prevent warning
991 }
992 }
993 break;
994 case SvxLineSpaceRule::Fix:
996 m_xLineDist->set_active( LLINESPACE_FIX );
997 break;
998
999 case SvxLineSpaceRule::Min:
1001 m_xLineDist->set_active( LLINESPACE_MIN );
1002 break;
1003 default: ;//prevent warning
1004 }
1005 LineDistHdl_Impl( *m_xLineDist );
1006}
1007
1009{
1010 m_bLineDistToggled = true;
1011}
1012
1013IMPL_LINK(SvxStdParagraphTabPage, LineDistHdl_Impl, weld::ComboBox&, rBox, void)
1014{
1015 switch (rBox.get_active())
1016 {
1017 case LLINESPACE_1:
1018 case LLINESPACE_115:
1019 case LLINESPACE_15:
1020 case LLINESPACE_2:
1021 m_xLineDistAtLabel->set_sensitive(false);
1022 m_xLineDistAtPercentBox->hide();
1023 m_xLineDistAtMetricBox->hide();
1024 m_xLineDistAtPlaceHolderBox->show();
1025 break;
1026
1027 case LLINESPACE_DURCH:
1028 // setting a sensible default?
1029 // limit MS min(10, aPageSize)
1030 m_xLineDistAtMetricBox->set_min(0, FieldUnit::NONE);
1031
1032 if (m_xLineDistAtPlaceHolderBox->get_visible())
1033 m_xLineDistAtMetricBox->set_value(m_xLineDistAtMetricBox->normalize(1), FieldUnit::NONE);
1034 m_xLineDistAtPlaceHolderBox->hide();
1035 m_xLineDistAtPercentBox->hide();
1036 m_xLineDistAtMetricBox->show();
1037 m_xLineDistAtLabel->set_sensitive(true);
1038 break;
1039
1040 case LLINESPACE_MIN:
1041 m_xLineDistAtMetricBox->set_min(0, FieldUnit::NONE);
1042
1043 if (m_xLineDistAtPlaceHolderBox->get_visible())
1044 m_xLineDistAtMetricBox->set_value(m_xLineDistAtMetricBox->normalize(10), FieldUnit::TWIP);
1045 m_xLineDistAtPlaceHolderBox->hide();
1046 m_xLineDistAtPercentBox->hide();
1047 m_xLineDistAtMetricBox->show();
1048 m_xLineDistAtLabel->set_sensitive(true);
1049 break;
1050
1051 case LLINESPACE_PROP:
1052
1053 if (m_xLineDistAtPlaceHolderBox->get_visible())
1054 m_xLineDistAtPercentBox->set_value(m_xLineDistAtPercentBox->normalize(100), FieldUnit::TWIP);
1055 m_xLineDistAtPlaceHolderBox->hide();
1056 m_xLineDistAtMetricBox->hide();
1057 m_xLineDistAtPercentBox->show();
1058 m_xLineDistAtLabel->set_sensitive(true);
1059 break;
1060 case LLINESPACE_FIX:
1061 {
1062 auto nTemp = m_xLineDistAtMetricBox->get_value(FieldUnit::NONE);
1063 m_xLineDistAtMetricBox->set_min(m_xLineDistAtMetricBox->normalize(nMinFixDist), FieldUnit::TWIP);
1064
1065 // if the value has been changed at SetMin,
1066 // it is time for the default
1067 if (m_xLineDistAtMetricBox->get_value(FieldUnit::NONE) != nTemp)
1068 SetMetricValue( *m_xLineDistAtMetricBox, FIX_DIST_DEF, MapUnit::MapTwip ); // fix is only in Writer
1069 m_xLineDistAtPlaceHolderBox->hide();
1070 m_xLineDistAtPercentBox->hide();
1071 m_xLineDistAtMetricBox->show();
1072 m_xLineDistAtLabel->set_sensitive(true);
1073 }
1074 break;
1075 }
1076 UpdateExample_Impl();
1077}
1078
1080{
1081 UpdateExample_Impl();
1082}
1083
1085{
1086 m_xLineDist->connect_popup_toggled(LINK(this, SvxStdParagraphTabPage, LineDistPopupHdl_Impl));
1087 m_xLineDist->connect_changed(LINK(this, SvxStdParagraphTabPage, LineDistHdl_Impl));
1088
1089 Link<weld::MetricSpinButton&,void> aLink2 = LINK(this, SvxStdParagraphTabPage, ELRLoseFocusHdl);
1093
1094 Link<weld::MetricSpinButton&,void> aLink = LINK(this, SvxStdParagraphTabPage, ModifyHdl_Impl);
1097
1098 m_xAutoCB->connect_toggled(LINK(this, SvxStdParagraphTabPage, AutoHdl_Impl));
1099 SfxItemPool* pPool = GetItemSet().GetPool();
1100 DBG_ASSERT( pPool, "Where is the pool?" );
1101 FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) ) );
1102
1105 m_xLineDistAtMetricBox->set_max( m_xLineDistAtMetricBox->normalize( MAX_DURCH ), eUnit );
1106}
1107
1109{
1110 m_aExampleWin.SetFirstLineOffset( static_cast<short>(m_aFLineIndent.denormalize( m_aFLineIndent.get_value( FieldUnit::TWIP ) )) );
1113 m_aExampleWin.SetUpper( static_cast<sal_uInt16>(m_aTopDist.denormalize( m_aTopDist.get_value( FieldUnit::TWIP ) )) );
1114 m_aExampleWin.SetLower( static_cast<sal_uInt16>(m_aBottomDist.denormalize( m_aBottomDist.get_value( FieldUnit::TWIP ) )) );
1115
1116 int nPos = m_xLineDist->get_active();
1117
1118 switch ( nPos )
1119 {
1120 case LLINESPACE_1:
1121 case LLINESPACE_115:
1122 case LLINESPACE_15:
1123 case LLINESPACE_2:
1124 case LLINESPACE_PROP:
1125 case LLINESPACE_MIN:
1126 case LLINESPACE_DURCH:
1127 case LLINESPACE_FIX:
1129 break;
1130 }
1131 m_aExampleWin.Invalidate();
1132}
1133
1135{
1136 m_xRegisterCB->show();
1137}
1138
1140{
1141 m_xContextualCB->show();
1142}
1143
1145{
1146 bool bEnable = !rBox.get_active();
1147 m_xFLineLabel->set_sensitive(bEnable);
1148 m_aFLineIndent.set_sensitive(bEnable);
1149}
1150
1152{
1153 m_xAutoCB->show();
1154}
1155
1157{
1158 m_xLineDist->append_text(sAbsDist);
1159 nMinFixDist = nMinTwip;
1160}
1161
1163{
1164
1165/* different bit represent call to different method of SvxStdParagraphTabPage
1166 0x0001 --->EnableRelativeMode()
1167 0x0002 --->EnableRegisterMode()
1168 0x0004 --->EnableAutoFirstLine()
1169 0x0008 --->EnableNegativeMode()
1170 0x0010 --->EnableContextualMode()
1171 */
1172 const SfxUInt16Item* pPageWidthItem = aSet.GetItem<SfxUInt16Item>(SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH, false);
1173 const SfxUInt32Item* pFlagSetItem = aSet.GetItem<SfxUInt32Item>(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET, false);
1174 const SfxUInt32Item* pLineDistItem = aSet.GetItem<SfxUInt32Item>(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST, false);
1175
1176 if (pPageWidthItem)
1177 nWidth = pPageWidthItem->GetValue();
1178
1179 if (pFlagSetItem )
1180 {
1181 if (( 0x0001 & pFlagSetItem->GetValue())== 0x0001 )
1183
1184 if (( 0x0002 & pFlagSetItem->GetValue())== 0x0002 )
1186
1187 if ( ( 0x0004 & pFlagSetItem->GetValue())== 0x0004 )
1189 }
1190
1191 if(pLineDistItem)
1192 EnableAbsLineDist(pLineDistItem->GetValue());
1193
1194 if (pFlagSetItem)
1195 {
1196 if (( 0x0008 & pFlagSetItem->GetValue()) == 0x0008 )
1198
1199 if (( 0x0010 & pFlagSetItem->GetValue()) == 0x0010 )
1201 }
1202}
1203
1204#define LASTLINEPOS_DEFAULT 0
1205#define LASTLINEPOS_LEFT 1
1206
1207#define LASTLINECOUNT_OLD 3
1208#define LASTLINECOUNT_NEW 4
1209
1211 : SfxTabPage(pPage, pController, "cui/ui/paragalignpage.ui", "ParaAlignPage", &rSet)
1212 , m_bSdrVertAlign(false)
1213 , m_xLeft(m_xBuilder->weld_radio_button("radioBTN_LEFTALIGN"))
1214 , m_xRight(m_xBuilder->weld_radio_button("radioBTN_RIGHTALIGN"))
1215 , m_xCenter(m_xBuilder->weld_radio_button("radioBTN_CENTERALIGN"))
1216 , m_xJustify(m_xBuilder->weld_radio_button("radioBTN_JUSTIFYALIGN"))
1217 , m_xLeftBottom(m_xBuilder->weld_label("labelST_LEFTALIGN_ASIAN"))
1218 , m_xRightTop(m_xBuilder->weld_label("labelST_RIGHTALIGN_ASIAN"))
1219 , m_xLastLineFT(m_xBuilder->weld_label("labelLB_LASTLINE"))
1220 , m_xLastLineLB(m_xBuilder->weld_combo_box("comboLB_LASTLINE"))
1221 , m_xExpandCB(m_xBuilder->weld_check_button("checkCB_EXPAND"))
1222 , m_xSnapToGridCB(m_xBuilder->weld_check_button("checkCB_SNAP"))
1223 , m_xExampleWin(new weld::CustomWeld(*m_xBuilder, "drawingareaWN_EXAMPLE", m_aExampleWin))
1224 , m_xVertAlignFL(m_xBuilder->weld_widget("frameFL_VERTALIGN"))
1225 , m_xVertAlignLB(m_xBuilder->weld_combo_box("comboLB_VERTALIGN"))
1226 , m_xVertAlign(m_xBuilder->weld_label("labelFL_VERTALIGN"))
1227 , m_xVertAlignSdr(m_xBuilder->weld_label("labelST_VERTALIGN_SDR"))
1228 , m_xTextDirectionLB(new svx::FrameDirectionListBox(m_xBuilder->weld_combo_box("comboLB_TEXTDIRECTION")))
1229{
1231
1232 sal_uInt16 nLastLinePos = LASTLINEPOS_DEFAULT;
1233
1235 {
1236 m_xLeft->set_label(m_xLeftBottom->get_label());
1237 m_xRight->set_label(m_xRightTop->get_label());
1238
1239 OUString sLeft(m_xLeft->get_label());
1241
1242 if (m_xLastLineLB->get_count() == LASTLINECOUNT_OLD)
1243 {
1244 m_xLastLineLB->remove(0);
1245 m_xLastLineLB->insert_text(0, sLeft);
1246 }
1247 else
1248 nLastLinePos = LASTLINEPOS_LEFT;
1249 }
1250
1251 // remove "Default" or "Left" entry, depends on CJKOptions
1252 if (m_xLastLineLB->get_count() == LASTLINECOUNT_NEW)
1253 m_xLastLineLB->remove(nLastLinePos);
1254
1255 Link<weld::Toggleable&, void> aLink = LINK( this, SvxParaAlignTabPage, AlignHdl_Impl );
1256 m_xLeft->connect_toggled(aLink);
1257 m_xRight->connect_toggled(aLink);
1258 m_xCenter->connect_toggled(aLink);
1259 m_xJustify->connect_toggled(aLink);
1260 m_xLastLineLB->connect_changed(LINK(this, SvxParaAlignTabPage, LastLineHdl_Impl));
1261 m_xTextDirectionLB->connect_changed(LINK(this, SvxParaAlignTabPage, TextDirectionHdl_Impl));
1262
1263 m_xTextDirectionLB->append(SvxFrameDirection::Environment, SvxResId(RID_SVXSTR_FRAMEDIR_SUPER));
1264 m_xTextDirectionLB->append(SvxFrameDirection::Horizontal_LR_TB, SvxResId(RID_SVXSTR_FRAMEDIR_LTR));
1265 m_xTextDirectionLB->append(SvxFrameDirection::Horizontal_RL_TB, SvxResId(RID_SVXSTR_FRAMEDIR_RTL));
1266}
1267
1269{
1270}
1271
1273{
1274 if ( _pSet )
1275 FillItemSet( _pSet );
1276 return DeactivateRC::LeavePage;
1277}
1278
1279std::unique_ptr<SfxTabPage> SvxParaAlignTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet)
1280{
1281 return std::make_unique<SvxParaAlignTabPage>(pPage, pController, *rSet);
1282}
1283
1285{
1286 bool bModified = false;
1287
1288 bool bAdj = false;
1289 SvxAdjust eAdjust = SvxAdjust::Left;
1290
1291 if (m_xLeft->get_active())
1292 {
1293 eAdjust = SvxAdjust::Left;
1294 bAdj = m_xLeft->get_saved_state() == TRISTATE_FALSE;
1295 }
1296 else if (m_xRight->get_active())
1297 {
1298 eAdjust = SvxAdjust::Right;
1299 bAdj = m_xRight->get_saved_state() == TRISTATE_FALSE;
1300 }
1301 else if (m_xCenter->get_active())
1302 {
1303 eAdjust = SvxAdjust::Center;
1304 bAdj = m_xCenter->get_saved_state() == TRISTATE_FALSE;
1305 }
1306 else if (m_xJustify->get_active())
1307 {
1308 eAdjust = SvxAdjust::Block;
1309 bAdj = m_xJustify->get_saved_state() == TRISTATE_FALSE ||
1310 m_xExpandCB->get_state_changed_from_saved() ||
1311 m_xLastLineLB->get_value_changed_from_saved();
1312 }
1313
1314 sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
1315
1316 if (bAdj)
1317 {
1318 SvxAdjust eOneWord = m_xExpandCB->get_active() ? SvxAdjust::Block : SvxAdjust::Left;
1319
1320 int nLBPos = m_xLastLineLB->get_active();
1321 SvxAdjust eLastBlock = SvxAdjust::Left;
1322 if ( 1 == nLBPos )
1323 eLastBlock = SvxAdjust::Center;
1324 else if ( 2 == nLBPos )
1325 eLastBlock = SvxAdjust::Block;
1326
1327 SvxAdjustItem aAdj( static_cast<const SvxAdjustItem&>(GetItemSet().Get( _nWhich )) );
1328 aAdj.SetAdjust( eAdjust );
1329 aAdj.SetOneWord( eOneWord );
1330 aAdj.SetLastBlock( eLastBlock );
1331 rOutSet->Put( aAdj );
1332 bModified = true;
1333 }
1334
1335 if (m_xSnapToGridCB->get_state_changed_from_saved())
1336 {
1337 rOutSet->Put(SvxParaGridItem(m_xSnapToGridCB->get_active(), GetWhich( SID_ATTR_PARA_SNAPTOGRID )));
1338 bModified = true;
1339 }
1340
1341 if (m_xVertAlignLB->get_value_changed_from_saved())
1342 {
1343 if (m_bSdrVertAlign)
1344 rOutSet->Put(SdrTextVertAdjustItem(static_cast<SdrTextVertAdjust>(m_xVertAlignLB->get_active())));
1345 else
1346 rOutSet->Put(SvxParaVertAlignItem(static_cast<SvxParaVertAlignItem::Align>(m_xVertAlignLB->get_active()), GetWhich( SID_PARA_VERTALIGN )));
1347 bModified = true;
1348 }
1349
1350 if (m_xTextDirectionLB->get_visible())
1351 {
1352 if (m_xTextDirectionLB->get_value_changed_from_saved())
1353 {
1354 SvxFrameDirection eDir = m_xTextDirectionLB->get_active_id();
1355 rOutSet->Put( SvxFrameDirectionItem( eDir, GetWhich( SID_ATTR_FRAMEDIRECTION ) ) );
1356 bModified = true;
1357 }
1358 }
1359
1360 return bModified;
1361}
1362
1364{
1365 Reset( &rSet );
1366}
1367
1369{
1370 sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
1371 SfxItemState eItemState = rSet->GetItemState( _nWhich );
1372
1373 sal_Int32 nLBSelect = 0;
1374 if ( eItemState >= SfxItemState::DEFAULT )
1375 {
1376 const SvxAdjustItem& rAdj = static_cast<const SvxAdjustItem&>(rSet->Get( _nWhich ));
1377
1378 switch ( rAdj.GetAdjust() )
1379 {
1380 case SvxAdjust::Left: m_xLeft->set_active(true); break;
1381
1382 case SvxAdjust::Right: m_xRight->set_active(true); break;
1383
1384 case SvxAdjust::Center: m_xCenter->set_active(true); break;
1385
1386 case SvxAdjust::Block: m_xJustify->set_active(true); break;
1387 default: ; //prevent warning
1388 }
1389 bool bEnable = m_xJustify->get_active();
1390 m_xLastLineFT->set_sensitive(bEnable);
1391 m_xLastLineLB->set_sensitive(bEnable);
1392
1393 switch(rAdj.GetLastBlock())
1394 {
1395 case SvxAdjust::Left: nLBSelect = 0; break;
1396
1397 case SvxAdjust::Center: nLBSelect = 1; break;
1398
1399 case SvxAdjust::Block: nLBSelect = 2; break;
1400 default: ; //prevent warning
1401 }
1402 m_xExpandCB->set_sensitive(bEnable && nLBSelect == 2);
1403 m_xExpandCB->set_active(SvxAdjust::Block == rAdj.GetOneWord());
1404 }
1405 else
1406 {
1407 m_xLeft->set_active(false);
1408 m_xRight->set_active(false);
1409 m_xCenter->set_active(false);
1410 m_xJustify->set_active(false);
1411 }
1412 m_xLastLineLB->set_active(nLBSelect);
1413
1414 sal_uInt16 nHtmlMode = GetHtmlMode_Impl(*rSet);
1415 if(nHtmlMode & HTMLMODE_ON)
1416 {
1417 m_xLastLineLB->hide();
1418 m_xLastLineFT->hide();
1419 m_xExpandCB->hide();
1420 if(!(nHtmlMode & HTMLMODE_FULL_STYLES) )
1421 m_xJustify->set_sensitive(false);
1422 m_xSnapToGridCB->hide();
1423 }
1424 _nWhich = GetWhich(SID_ATTR_PARA_SNAPTOGRID);
1425 eItemState = rSet->GetItemState( _nWhich );
1426 if ( eItemState >= SfxItemState::DEFAULT )
1427 {
1428 const SvxParaGridItem& rSnap = static_cast<const SvxParaGridItem&>(rSet->Get( _nWhich ));
1429 m_xSnapToGridCB->set_active(rSnap.GetValue());
1430 }
1431
1432 _nWhich = m_bSdrVertAlign ? SDRATTR_TEXT_VERTADJUST : GetWhich( SID_PARA_VERTALIGN );
1433 eItemState = rSet->GetItemState( _nWhich );
1434
1435 if ( eItemState >= SfxItemState::DEFAULT )
1436 {
1437 m_xVertAlignFL->show();
1438
1439 if (m_bSdrVertAlign)
1440 {
1441 const SdrTextVertAdjustItem& rAlign = static_cast<const SdrTextVertAdjustItem&>(rSet->Get( _nWhich ));
1442 m_xVertAlignLB->set_active(rAlign.GetValue());
1443 }
1444 else
1445 {
1446 const SvxParaVertAlignItem& rAlign = static_cast<const SvxParaVertAlignItem&>(rSet->Get( _nWhich ));
1447 m_xVertAlignLB->set_active(static_cast<sal_Int32>(rAlign.GetValue()));
1448 }
1449 }
1450
1451 _nWhich = GetWhich( SID_ATTR_FRAMEDIRECTION );
1452 //text direction
1453 if( SfxItemState::DEFAULT <= rSet->GetItemState( _nWhich ) )
1454 {
1455 const SvxFrameDirectionItem& rFrameDirItem = static_cast<const SvxFrameDirectionItem&>( rSet->Get( _nWhich ) );
1456 m_xTextDirectionLB->set_active_id(rFrameDirItem.GetValue());
1457 m_xTextDirectionLB->save_value();
1458 }
1459
1460 m_xSnapToGridCB->save_state();
1461 m_xVertAlignLB->save_value();
1462 m_xLeft->save_state();
1463 m_xRight->save_state();
1464 m_xCenter->save_state();
1465 m_xJustify->save_state();
1466 m_xLastLineLB->save_value();
1467 m_xExpandCB->save_state();
1468
1470}
1471
1473{
1474 m_xTextDirectionLB->save_value();
1475 m_xSnapToGridCB->save_state();
1476 m_xVertAlignLB->save_value();
1477 m_xLeft->save_state();
1478 m_xRight->save_state();
1479 m_xCenter->save_state();
1480 m_xJustify->save_state();
1481 m_xLastLineLB->save_value();
1482 m_xExpandCB->save_state();
1483}
1484
1486{
1487 bool bJustify = m_xJustify->get_active();
1488 m_xLastLineFT->set_sensitive(bJustify);
1489 m_xLastLineLB->set_sensitive(bJustify);
1490 bool bLastLineIsBlock = m_xLastLineLB->get_active() == 2;
1491 m_xExpandCB->set_sensitive(bJustify && bLastLineIsBlock);
1492 //set last line listbox to entry position 0 if not enabled
1493 if (!m_xLastLineLB->get_sensitive())
1494 m_xLastLineLB->set_active(0);
1495 //uncheck 'Expand ... word' when check box is not enabled
1496 if (!m_xExpandCB->get_sensitive())
1497 m_xExpandCB->set_active(false);
1498 UpdateExample_Impl();
1499}
1500
1502{
1503 //fdo#41350 only enable 'Expand last word' if last line is also justified
1504 bool bLastLineIsBlock = m_xLastLineLB->get_active() == 2;
1505 m_xExpandCB->set_sensitive(bLastLineIsBlock);
1506 //uncheck 'Expand ... word' when check box is not enabled
1507 if (!m_xExpandCB->get_sensitive())
1508 m_xExpandCB->set_active(false);
1509 UpdateExample_Impl();
1510}
1511
1513{
1514 UpdateExample_Impl();
1515}
1516
1518{
1519 if (m_xLeft->get_active())
1520 {
1521 m_aExampleWin.EnableRTL(false);
1522 m_aExampleWin.SetAdjust(SvxAdjust::Left);
1523 m_aExampleWin.SetLastLine(SvxAdjust::Left);
1524 }
1525 else if (m_xRight->get_active())
1526 {
1527 m_aExampleWin.EnableRTL(true);
1528 m_aExampleWin.SetAdjust(SvxAdjust::Left);
1529 m_aExampleWin.SetLastLine(SvxAdjust::Left);
1530 }
1531 else
1532 {
1533 SvxFrameDirection eDir = m_xTextDirectionLB->get_active_id();
1534 switch ( eDir )
1535 {
1536 case SvxFrameDirection::Environment :
1537 if ( !m_xRight->get_active() )
1539 break;
1540 case SvxFrameDirection::Horizontal_RL_TB :
1541 if ( !m_xLeft->get_active() )
1542 m_aExampleWin.EnableRTL( true );
1543 break;
1544 case SvxFrameDirection::Horizontal_LR_TB :
1545 if ( !m_xRight->get_active() )
1546 m_aExampleWin.EnableRTL( false );
1547 break;
1548 default: ; //prevent warning
1549 }
1550 if (m_xCenter->get_active())
1551 m_aExampleWin.SetAdjust( SvxAdjust::Center );
1552 else if (m_xJustify->get_active())
1553 {
1554 m_aExampleWin.SetAdjust( SvxAdjust::Block );
1555 int nLBPos = m_xLastLineLB->get_active();
1556 if (nLBPos == 0)
1557 m_aExampleWin.SetLastLine(SvxAdjust::Left);
1558 else if (nLBPos == 1)
1559 m_aExampleWin.SetLastLine(SvxAdjust::Center);
1560 else if (nLBPos == 2)
1561 m_aExampleWin.SetLastLine(SvxAdjust::Block);
1562 }
1563 }
1564
1565 m_aExampleWin.Invalidate();
1566}
1567
1569{
1570 m_xLastLineFT->show();
1571 m_xLastLineLB->show();
1572 m_xExpandCB->show();
1574 m_xSnapToGridCB->show();
1575
1576}
1577
1579{
1580 m_bSdrVertAlign = true;
1581
1582 m_xVertAlignLB->remove_id("0");
1583 m_xVertAlignLB->remove_id("1");
1584 m_xVertAlign->set_label(m_xVertAlignSdr->get_label());
1585}
1586
1588{
1589 const SfxBoolItem* pBoolItem = aSet.GetItem<SfxBoolItem>(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT, false);
1590 if (pBoolItem && pBoolItem->GetValue())
1592}
1593
1594std::unique_ptr<SfxTabPage> SvxExtParagraphTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet)
1595{
1596 return std::make_unique<SvxExtParagraphTabPage>(pPage, pController, *rSet);
1597}
1598
1600{
1601 bool bModified = false;
1602 sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_HYPHENZONE );
1603 const TriState eHyphenState = m_xHyphenBox->get_state();
1604 const SfxPoolItem* pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_HYPHENZONE );
1605
1606 if ( m_xHyphenBox->get_state_changed_from_saved() ||
1607 m_xHyphenNoCapsBox->get_state_changed_from_saved() ||
1608 m_xHyphenNoLastWordBox->get_state_changed_from_saved() ||
1609 m_xExtHyphenBeforeBox->get_value_changed_from_saved() ||
1610 m_xExtHyphenAfterBox->get_value_changed_from_saved() ||
1611 m_xMaxHyphenEdit->get_value_changed_from_saved() ||
1612 m_xMinWordLength->get_value_changed_from_saved() ||
1614 {
1615 SvxHyphenZoneItem aHyphen(
1616 static_cast<const SvxHyphenZoneItem&>(GetItemSet().Get( _nWhich )) );
1617 aHyphen.SetHyphen( eHyphenState == TRISTATE_TRUE );
1618 aHyphen.SetNoCapsHyphenation(m_xHyphenNoCapsBox->get_state() == TRISTATE_TRUE);
1620
1621 if ( eHyphenState == TRISTATE_TRUE )
1622 {
1623 aHyphen.GetMinLead() = static_cast<sal_uInt8>(m_xExtHyphenBeforeBox->get_value());
1624 aHyphen.GetMinTrail() = static_cast<sal_uInt8>(m_xExtHyphenAfterBox->get_value());
1625 aHyphen.GetMinWordLength() = static_cast<sal_uInt8>(m_xMinWordLength->get_value());
1626 }
1627 aHyphen.GetMaxHyphens() = static_cast<sal_uInt8>(m_xMaxHyphenEdit->get_value());
1628
1629 SfxItemPool* pPool = GetItemSet().GetPool();
1630 DBG_ASSERT( pPool, "Where is the pool?" );
1631 MapUnit eUnit = pPool->GetMetric( _nWhich );
1632 aHyphen.GetTextHyphenZone() = static_cast<sal_uInt16>(m_aHyphenZone.GetCoreValue(eUnit));
1633
1634 if ( !pOld ||
1635 *static_cast<const SvxHyphenZoneItem*>(pOld) != aHyphen ||
1636 m_xHyphenBox->get_state_changed_from_saved())
1637 {
1638 rOutSet->Put( aHyphen );
1639 bModified = true;
1640 }
1641 }
1642
1643 if (m_xPageNumBox->get_sensitive()
1644 && (m_xPageNumBox->get_state_changed_from_saved() || m_xPagenumEdit->get_value_changed_from_saved()))
1645 {
1646 pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_PAGENUM );
1647
1648 if (TRISTATE_TRUE == m_xPageNumBox->get_state()
1649 && (!pOld || IsInvalidItem(pOld)
1650 || static_cast<const SfxUInt16Item*>(pOld)->GetValue() != m_xPagenumEdit->get_value()))
1651 {
1652 SfxUInt16Item aPageNum(SID_ATTR_PARA_PAGENUM,
1653 static_cast<sal_uInt16>(m_xPagenumEdit->get_value()));
1654 rOutSet->Put( aPageNum );
1655 bModified = true;
1656 }
1657 else if (TRISTATE_FALSE == m_xPageNumBox->get_state()
1658 && (pOld || IsInvalidItem(pOld)))
1659 {
1660 // need to tell sw to remove the item
1661 rOutSet->DisableItem(SID_ATTR_PARA_PAGENUM);
1662 bModified = true;
1663 }
1664 }
1665
1666 // pagebreak
1667
1668 TriState eState = m_xApplyCollBtn->get_state();
1669 bool bIsPageModel = false;
1670
1671 OUString sPage;
1672 if ( m_xApplyCollBtn->get_state_changed_from_saved() ||
1673 ( TRISTATE_TRUE == eState &&
1674 m_xApplyCollBox->get_value_changed_from_saved() ) )
1675 {
1676 if ( eState == TRISTATE_TRUE )
1677 {
1678 sPage = m_xApplyCollBox->get_active_text();
1679 bIsPageModel = !sPage.isEmpty();
1680 }
1681 pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_MODEL );
1682
1683 if ( !pOld || static_cast<const SvxPageModelItem*>(pOld)->GetValue() != sPage )
1684 {
1685 rOutSet->Put( SvxPageModelItem( sPage, false, SID_ATTR_PARA_MODEL ) );
1686 bModified = true;
1687 }
1688 else
1689 bIsPageModel = false;
1690 }
1691 else if(TRISTATE_TRUE == eState && m_xApplyCollBtn->get_sensitive())
1692 bIsPageModel = true;
1693 else
1694 rOutSet->Put( SvxPageModelItem( sPage, false, SID_ATTR_PARA_MODEL ) );
1695
1696 _nWhich = GetWhich( SID_ATTR_PARA_PAGEBREAK );
1697
1698 if ( bIsPageModel )
1699 // if PageModel is turned on, always turn off PageBreak
1700 rOutSet->Put( SvxFormatBreakItem( SvxBreak::NONE, _nWhich ) );
1701 else
1702 {
1703 eState = m_xPageBreakBox->get_state();
1704 SfxItemState eModelState = GetItemSet().GetItemState(SID_ATTR_PARA_MODEL, false);
1705
1706 if ( (eModelState == SfxItemState::SET && TRISTATE_TRUE == m_xPageBreakBox->get_state()) ||
1707 m_xPageBreakBox->get_state_changed_from_saved() ||
1708 m_xBreakTypeLB->get_value_changed_from_saved() ||
1709 m_xBreakPositionLB->get_value_changed_from_saved() )
1710 {
1711 const SvxFormatBreakItem rOldBreak(
1712 static_cast<const SvxFormatBreakItem&>(GetItemSet().Get( _nWhich )));
1713 SvxFormatBreakItem aBreak(rOldBreak.GetBreak(), rOldBreak.Which());
1714
1715 switch ( eState )
1716 {
1717 case TRISTATE_TRUE:
1718 {
1719 bool bBefore = m_xBreakPositionLB->get_active() == 0;
1720
1721 if (m_xBreakTypeLB->get_active() == 0)
1722 {
1723 if ( bBefore )
1724 aBreak.SetValue( SvxBreak::PageBefore );
1725 else
1726 aBreak.SetValue( SvxBreak::PageAfter );
1727 }
1728 else
1729 {
1730 if ( bBefore )
1731 aBreak.SetValue( SvxBreak::ColumnBefore );
1732 else
1733 aBreak.SetValue( SvxBreak::ColumnAfter );
1734 }
1735 break;
1736 }
1737
1738 case TRISTATE_FALSE:
1739 aBreak.SetValue( SvxBreak::NONE );
1740 break;
1741 default: ; //prevent warning
1742 }
1743 pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_PAGEBREAK );
1744
1745 if ( eState != m_xPageBreakBox->get_saved_state() ||
1746 !pOld || !( *static_cast<const SvxFormatBreakItem*>(pOld) == aBreak ) )
1747 {
1748 bModified = true;
1749 rOutSet->Put( aBreak );
1750 }
1751 }
1752 }
1753
1754 // paragraph split
1755 _nWhich = GetWhich( SID_ATTR_PARA_SPLIT );
1756 eState = m_xKeepTogetherBox->get_state();
1757
1758 if (m_xKeepTogetherBox->get_state_changed_from_saved())
1759 {
1760 pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_SPLIT );
1761
1762 if ( !pOld || static_cast<const SvxFormatSplitItem*>(pOld)->GetValue() !=
1763 ( eState == TRISTATE_FALSE ) )
1764 {
1765 rOutSet->Put( SvxFormatSplitItem( eState == TRISTATE_FALSE, _nWhich ) );
1766 bModified = true;
1767 }
1768 }
1769
1770 // keep paragraphs
1771 _nWhich = GetWhich( SID_ATTR_PARA_KEEP );
1772 eState = m_xKeepParaBox->get_state();
1773
1774 if (m_xKeepParaBox->get_state_changed_from_saved())
1775 {
1776 // if the status has changed, putting is necessary
1777 rOutSet->Put( SvxFormatKeepItem( eState == TRISTATE_TRUE, _nWhich ) );
1778 bModified = true;
1779 }
1780
1781 // widows and orphans
1782 TypedWhichId<SvxWidowsItem> nWidowsWhich = GetWhich( SID_ATTR_PARA_WIDOWS );
1783 eState = m_xWidowBox->get_state();
1784
1785 if ( m_xWidowBox->get_state_changed_from_saved() ||
1786 m_xWidowRowNo->get_value_changed_from_saved() )
1787 {
1788 SvxWidowsItem rItem( eState == TRISTATE_TRUE ?
1789 static_cast<sal_uInt8>(m_xWidowRowNo->get_value()) : 0, nWidowsWhich );
1790 pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_WIDOWS );
1791
1792 if ( m_xWidowBox->get_state_changed_from_saved() || !pOld || !( *static_cast<const SvxWidowsItem*>(pOld) == rItem ) )
1793 {
1794 rOutSet->Put( rItem );
1795 bModified = true;
1796 }
1797 }
1798
1799 TypedWhichId<SvxOrphansItem> nOrphansWhich = GetWhich( SID_ATTR_PARA_ORPHANS );
1800 eState = m_xOrphanBox->get_state();
1801
1802 if ( m_xOrphanBox->get_state_changed_from_saved() ||
1803 m_xOrphanRowNo->get_value_changed_from_saved() )
1804 {
1805 SvxOrphansItem rItem( eState == TRISTATE_TRUE ?
1806 static_cast<sal_uInt8>(m_xOrphanRowNo->get_value()) : 0, nOrphansWhich );
1807 pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_ORPHANS );
1808
1809 if ( m_xOrphanBox->get_state_changed_from_saved() ||
1810 !pOld ||
1811 !( *static_cast<const SvxOrphansItem*>(pOld) == rItem ) )
1812 {
1813 rOutSet->Put( rItem );
1814 bModified = true;
1815 }
1816 }
1817
1818 return bModified;
1819}
1821{
1822 SfxItemPool* pPool = rSet->GetPool();
1823 DBG_ASSERT( pPool, "Where is the pool?" );
1824
1825 // adjust metric
1826 FieldUnit eFUnit = GetModuleFieldUnit( *rSet );
1827
1828 bool bApplyCharUnit = GetApplyCharUnit( *rSet );
1829
1830 if( SvtCJKOptions::IsAsianTypographyEnabled() && bApplyCharUnit )
1831 eFUnit = FieldUnit::CHAR;
1832
1833 sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_HYPHENZONE );
1834 SfxItemState eItemState = rSet->GetItemState( _nWhich );
1835
1836 bool bItemAvailable = eItemState >= SfxItemState::DEFAULT;
1837 bool bIsHyphen = false;
1838 if( !bHtmlMode && bItemAvailable )
1839 {
1840 const SvxHyphenZoneItem& rHyphen =
1841 static_cast<const SvxHyphenZoneItem&>(rSet->Get( _nWhich ));
1843
1844 bIsHyphen = rHyphen.IsHyphen();
1845 m_xHyphenBox->set_state(bIsHyphen ? TRISTATE_TRUE : TRISTATE_FALSE);
1848
1849 m_xExtHyphenBeforeBox->set_value(rHyphen.GetMinLead());
1850 m_xExtHyphenAfterBox->set_value(rHyphen.GetMinTrail());
1851 m_xMaxHyphenEdit->set_value(rHyphen.GetMaxHyphens());
1852 m_xMinWordLength->set_value(rHyphen.GetMinWordLength());
1854 m_aHyphenZone.SetMetricValue(rHyphen.GetTextHyphenZone(), MapUnit::MapTwip);
1855 }
1856 else
1857 {
1858 m_xHyphenBox->set_state(TRISTATE_INDET);
1861 }
1862 bool bEnable = bItemAvailable && bIsHyphen;
1863 m_xHyphenNoCapsBox->set_sensitive(bEnable);
1864 m_xHyphenNoLastWordBox->set_sensitive(bEnable);
1865 m_xExtHyphenBeforeBox->set_sensitive(bEnable);
1866 m_xExtHyphenAfterBox->set_sensitive(bEnable);
1867 m_xBeforeText->set_sensitive(bEnable);
1868 m_xAfterText->set_sensitive(bEnable);
1869 m_xMaxHyphenLabel->set_sensitive(bEnable);
1870 m_xMaxHyphenEdit->set_sensitive(bEnable);
1871 m_xMinWordLabel->set_sensitive(bEnable);
1872 m_xMinWordLength->set_sensitive(bEnable);
1873 m_xHyphenZoneLabel->set_sensitive(bEnable);
1875
1876 switch (rSet->GetItemState(SID_ATTR_PARA_PAGENUM))
1877 {
1878 case SfxItemState::SET:
1879 {
1881 m_xPageNumBox->set_state(TRISTATE_TRUE);
1882 SfxUInt16Item const*const pItem(rSet->GetItem<SfxUInt16Item>(SID_ATTR_PARA_PAGENUM));
1883 const sal_uInt16 nPageNum(pItem->GetValue());
1884 m_xPagenumEdit->set_value(nPageNum);
1885 break;
1886 }
1887 case SfxItemState::DONTCARE:
1888 {
1890 m_xPageNumBox->set_state(TRISTATE_INDET);
1891 break;
1892 }
1893 case SfxItemState::UNKNOWN:
1894 case SfxItemState::DEFAULT:
1895 case SfxItemState::DISABLED:
1896 {
1898 m_xPageNumBox->set_state(TRISTATE_FALSE);
1899 break;
1900 }
1901 default:
1902 assert(false); // unexpected
1903 break;
1904 }
1905
1906 if ( bPageBreak )
1907 {
1908 // first handle PageModel
1909 bool bIsPageModel = false;
1910 eItemState = rSet->GetItemState( SID_ATTR_PARA_MODEL );
1911
1912 if ( eItemState >= SfxItemState::SET )
1913 {
1915
1916 const SvxPageModelItem& rModel = rSet->Get( SID_ATTR_PARA_MODEL );
1917 const OUString& aStr( rModel.GetValue() );
1918
1919 if (!aStr.isEmpty() && m_xApplyCollBox->find_text(aStr) != -1)
1920 {
1921 m_xApplyCollBox->set_active_text(aStr);
1922 m_xApplyCollBtn->set_state(TRISTATE_TRUE);
1923 bIsPageModel = true;
1924
1925 m_xPageBreakBox->set_sensitive(true);
1927 m_xBreakTypeFT->set_sensitive(true);
1928 m_xBreakTypeLB->set_sensitive(true);
1929 m_xBreakPositionFT->set_sensitive(true);
1930 m_xBreakPositionLB->set_sensitive(true);
1931 m_xApplyCollBtn->set_sensitive(false);
1932 m_xPageBreakBox->set_state(TRISTATE_TRUE);
1933
1934 //select page break
1935 m_xBreakTypeLB->set_active(0);
1936 //select break before
1937 m_xBreakPositionLB->set_active(0);
1938 }
1939 else
1940 {
1941 m_xApplyCollBox->set_active(-1);
1942 m_xApplyCollBtn->set_state(TRISTATE_FALSE);
1943 }
1944 }
1945 else if ( SfxItemState::DONTCARE == eItemState )
1946 {
1948 m_xApplyCollBtn->set_state(TRISTATE_INDET);
1949 m_xApplyCollBox->set_active(-1);
1950 }
1951 else
1952 {
1953 m_xApplyCollBtn->set_sensitive(false);
1954 m_xApplyCollBox->set_sensitive(false);
1955 m_xPagenumEdit->set_sensitive(false);
1956 m_xPageNumBox->set_sensitive(false);
1957 }
1958
1959 if ( !bIsPageModel )
1960 {
1961 _nWhich = GetWhich( SID_ATTR_PARA_PAGEBREAK );
1962 eItemState = rSet->GetItemState( _nWhich );
1963
1964 if ( eItemState >= SfxItemState::DEFAULT )
1965 {
1966 const SvxFormatBreakItem& rPageBreak =
1967 static_cast<const SvxFormatBreakItem&>(rSet->Get( _nWhich ));
1968
1969 SvxBreak eBreak = rPageBreak.GetBreak();
1970
1971 // PageBreak not via CTRL-RETURN,
1972 // then CheckBox can be freed
1973 m_xPageBreakBox->set_sensitive(true);
1975 m_xBreakTypeFT->set_sensitive(true);
1976 m_xBreakTypeLB->set_sensitive(true);
1977 m_xBreakPositionFT->set_sensitive(true);
1978 m_xBreakPositionLB->set_sensitive(true);
1979
1980 m_xPageBreakBox->set_state(TRISTATE_TRUE);
1981
1982 bool _bEnable = eBreak != SvxBreak::NONE &&
1983 eBreak != SvxBreak::ColumnBefore &&
1984 eBreak != SvxBreak::ColumnAfter;
1985 m_xApplyCollBtn->set_sensitive(_bEnable);
1986 if (!_bEnable)
1987 {
1988 m_xApplyCollBox->set_sensitive(_bEnable);
1989 m_xPageNumBox->set_sensitive(false);
1990 m_xPagenumEdit->set_sensitive(_bEnable);
1991 }
1992
1993 if ( eBreak == SvxBreak::NONE )
1994 m_xPageBreakBox->set_state(TRISTATE_FALSE);
1995
1996 sal_Int32 nType = 0; // selection position in break type ListBox : Page
1997 sal_Int32 nPosition = 0; // selection position in break position ListBox : Before
1998 switch ( eBreak )
1999 {
2000 case SvxBreak::PageBefore:
2001 break;
2002 case SvxBreak::PageAfter:
2003 nPosition = 1;
2004 break;
2005 case SvxBreak::ColumnBefore:
2006 nType = 1;
2007 break;
2008 case SvxBreak::ColumnAfter:
2009 nType = 1;
2010 nPosition = 1;
2011 break;
2012 default: ;//prevent warning
2013 }
2014 m_xBreakTypeLB->set_active(nType);
2015 m_xBreakPositionLB->set_active(nPosition);
2016 }
2017 else if ( SfxItemState::DONTCARE == eItemState )
2018 m_xPageBreakBox->set_state(TRISTATE_INDET);
2019 else
2020 {
2021 m_xPageBreakBox->set_sensitive(false);
2022 m_xBreakTypeFT->set_sensitive(false);
2023 m_xBreakTypeLB->set_sensitive(false);
2024 m_xBreakPositionFT->set_sensitive(false);
2025 m_xBreakPositionLB->set_sensitive(false);
2026 }
2027 }
2028
2029 PageBreakPosHdl_Impl(*m_xBreakPositionLB);
2030 PageBreakHdl();
2031 }
2032
2033 _nWhich = GetWhich( SID_ATTR_PARA_KEEP );
2034 eItemState = rSet->GetItemState( _nWhich );
2035
2036 if ( eItemState >= SfxItemState::DEFAULT )
2037 {
2039 const SvxFormatKeepItem& rKeep =
2040 static_cast<const SvxFormatKeepItem&>(rSet->Get( _nWhich ));
2041
2042 if ( rKeep.GetValue() )
2043 m_xKeepParaBox->set_state(TRISTATE_TRUE);
2044 else
2045 m_xKeepParaBox->set_state(TRISTATE_FALSE);
2046 }
2047 else if ( SfxItemState::DONTCARE == eItemState )
2048 m_xKeepParaBox->set_state(TRISTATE_INDET);
2049 else
2050 m_xKeepParaBox->set_sensitive(false);
2051
2052 _nWhich = GetWhich( SID_ATTR_PARA_SPLIT );
2053 eItemState = rSet->GetItemState( _nWhich );
2054
2055 if ( eItemState >= SfxItemState::DEFAULT )
2056 {
2057 const SvxFormatSplitItem& rSplit =
2058 static_cast<const SvxFormatSplitItem&>(rSet->Get( _nWhich ));
2060
2061 if ( !rSplit.GetValue() )
2063 else
2064 {
2066 // default widows and orphans to enabled
2067 m_xWidowBox->set_sensitive(true);
2068 m_xOrphanBox->set_sensitive(true);
2069 }
2070
2071 // widows and orphans
2072 _nWhich = GetWhich( SID_ATTR_PARA_WIDOWS );
2073 SfxItemState eTmpState = rSet->GetItemState( _nWhich );
2074
2075 if ( eTmpState >= SfxItemState::DEFAULT )
2076 {
2077 const SvxWidowsItem& rWidow =
2078 static_cast<const SvxWidowsItem&>(rSet->Get( _nWhich ));
2080 const sal_uInt16 nLines = rWidow.GetValue();
2081
2082 bool _bEnable = nLines > 0;
2083 m_xWidowRowNo->set_value(m_xWidowRowNo->normalize(nLines));
2084 m_xWidowBox->set_state(_bEnable ? TRISTATE_TRUE : TRISTATE_FALSE);
2085 m_xWidowRowNo->set_sensitive(_bEnable);
2086 }
2087 else if ( SfxItemState::DONTCARE == eTmpState )
2088 m_xWidowBox->set_state( TRISTATE_INDET );
2089 else
2090 m_xWidowBox->set_sensitive(false);
2091
2092 _nWhich = GetWhich( SID_ATTR_PARA_ORPHANS );
2093 eTmpState = rSet->GetItemState( _nWhich );
2094
2095 if ( eTmpState >= SfxItemState::DEFAULT )
2096 {
2097 const SvxOrphansItem& rOrphan =
2098 static_cast<const SvxOrphansItem&>(rSet->Get( _nWhich ));
2099 const sal_uInt16 nLines = rOrphan.GetValue();
2101
2102 bool _bEnable = nLines > 0;
2103 m_xOrphanBox->set_state(_bEnable ? TRISTATE_TRUE : TRISTATE_FALSE);
2104 m_xOrphanRowNo->set_value(m_xOrphanRowNo->normalize(nLines));
2105 m_xOrphanRowNo->set_sensitive(_bEnable);
2106 m_xOrphanRowLabel->set_sensitive(_bEnable);
2107
2108 }
2109 else if ( SfxItemState::DONTCARE == eTmpState )
2110 m_xOrphanBox->set_state(TRISTATE_INDET);
2111 else
2112 m_xOrphanBox->set_sensitive(false);
2113 aOrphanState.eState = m_xOrphanBox->get_state();
2114 }
2115 else if ( SfxItemState::DONTCARE == eItemState )
2117 else
2118 m_xKeepTogetherBox->set_sensitive(false);
2119
2120 // so that everything is enabled correctly
2122 WidowHdl();
2123 OrphanHdl();
2125}
2127{
2128 m_xHyphenBox->save_state();
2129 m_xHyphenNoCapsBox->save_state();
2130 m_xHyphenNoLastWordBox->save_state();
2131 m_xExtHyphenBeforeBox->set_value(m_xExtHyphenBeforeBox->get_value());
2132 m_xExtHyphenAfterBox->set_value(m_xExtHyphenAfterBox->get_value());
2133 m_xMaxHyphenEdit->set_value(m_xMaxHyphenEdit->get_value());
2134 m_xMinWordLength->set_value(m_xMinWordLength->get_value());
2135 SfxItemPool* pPool = GetItemSet().GetPool();
2136 DBG_ASSERT( pPool, "Where is the pool?" );
2137 FieldUnit eUnit =
2138 MapToFieldUnit( pPool->GetMetric( GetWhich( SID_ATTR_PARA_HYPHENZONE ) ) );
2140 m_xPageBreakBox->save_state();
2141 m_xBreakPositionLB->save_value();
2142 m_xBreakTypeLB->save_value();
2143 m_xApplyCollBtn->save_state();
2144 m_xApplyCollBox->save_value();
2145 m_xPageNumBox->save_state();
2146 m_xPagenumEdit->save_value();
2147 m_xKeepTogetherBox->save_state();
2148 m_xKeepParaBox->save_state();
2149 m_xWidowBox->save_state();
2150 m_xOrphanBox->save_state();
2151 m_xOrphanRowNo->save_value();
2152 m_xWidowRowNo->save_value();
2153}
2154
2156{
2157 if ( _pSet )
2158 FillItemSet( _pSet );
2159 return DeactivateRC::LeavePage;
2160}
2161
2163{
2164 bPageBreak = false;
2165 m_xPageBreakBox->set_sensitive(false);
2166 m_xBreakTypeLB->remove(0);
2167 m_xBreakPositionFT->set_sensitive(false);
2168 m_xBreakPositionLB->set_sensitive(false);
2169 m_xApplyCollBtn->set_sensitive(false);
2170 m_xApplyCollBox->set_sensitive(false);
2171 m_xPageNumBox->set_sensitive(false);
2172 m_xPagenumEdit->set_sensitive(false);
2173}
2174
2176 : SfxTabPage(pPage, pController, "cui/ui/textflowpage.ui", "TextFlowPage", &rAttr)
2177 , bPageBreak(true)
2178 , bHtmlMode(false)
2179 , nStdPos(0)
2180 // Hyphenation
2181 , m_xHyphenBox(m_xBuilder->weld_check_button("checkAuto"))
2182 , m_xHyphenNoCapsBox(m_xBuilder->weld_check_button("checkNoCaps"))
2183 , m_xHyphenNoLastWordBox(m_xBuilder->weld_check_button("checkNoLastWord"))
2184 , m_xBeforeText(m_xBuilder->weld_label("labelLineBegin"))
2185 , m_xExtHyphenBeforeBox(m_xBuilder->weld_spin_button("spinLineEnd"))
2186 , m_xAfterText(m_xBuilder->weld_label("labelLineEnd"))
2187 , m_xExtHyphenAfterBox(m_xBuilder->weld_spin_button("spinLineBegin"))
2188 , m_xMaxHyphenLabel(m_xBuilder->weld_label("labelMaxNum"))
2189 , m_xMaxHyphenEdit(m_xBuilder->weld_spin_button("spinMaxNum"))
2190 , m_xMinWordLabel(m_xBuilder->weld_label("labelMinLen"))
2191 , m_xMinWordLength(m_xBuilder->weld_spin_button("spinMinLen"))
2192 , m_xHyphenZoneLabel(m_xBuilder->weld_label("labelHyphenZone"))
2193 , m_aHyphenZone(m_xBuilder->weld_metric_spin_button("spinHyphenZone", FieldUnit::CM))
2194 //Page break
2195 , m_xPageBreakBox(m_xBuilder->weld_check_button("checkInsert"))
2196 , m_xBreakTypeFT(m_xBuilder->weld_label("labelType"))
2197 , m_xBreakTypeLB(m_xBuilder->weld_combo_box("comboBreakType"))
2198 , m_xBreakPositionFT(m_xBuilder->weld_label("labelPosition"))
2199 , m_xBreakPositionLB(m_xBuilder->weld_combo_box("comboBreakPosition"))
2200 , m_xApplyCollBtn(m_xBuilder->weld_check_button("checkPageStyle"))
2201 , m_xApplyCollBox(m_xBuilder->weld_combo_box("comboPageStyle"))
2202 , m_xPageNumBox(m_xBuilder->weld_check_button("labelPageNum"))
2203 , m_xPagenumEdit(m_xBuilder->weld_spin_button("spinPageNumber"))
2204 // Options
2205 , m_xKeepTogetherBox(m_xBuilder->weld_check_button("checkSplitPara"))
2206 , m_xKeepParaBox(m_xBuilder->weld_check_button("checkKeepPara"))
2207 , m_xOrphanBox(m_xBuilder->weld_check_button("checkOrphan"))
2208 , m_xOrphanRowNo(m_xBuilder->weld_spin_button("spinOrphan"))
2209 , m_xOrphanRowLabel(m_xBuilder->weld_label("labelOrphan"))
2210 , m_xWidowBox(m_xBuilder->weld_check_button("checkWidow"))
2211 , m_xWidowRowNo(m_xBuilder->weld_spin_button("spinWidow"))
2212 , m_xWidowRowLabel(m_xBuilder->weld_label("labelWidow"))
2213{
2214 // this page needs ExchangeSupport
2216
2217 m_xHyphenBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, HyphenClickHdl_Impl));
2218 m_xPageBreakBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, PageBreakHdl_Impl));
2219 m_xKeepTogetherBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, KeepTogetherHdl_Impl));
2220 m_xWidowBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, WidowHdl_Impl));
2221 m_xOrphanBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, OrphanHdl_Impl));
2222 m_xApplyCollBtn->connect_toggled(LINK(this, SvxExtParagraphTabPage, ApplyCollClickHdl_Impl));
2223 m_xBreakTypeLB->connect_changed(LINK(this, SvxExtParagraphTabPage, PageBreakTypeHdl_Impl));
2224 m_xBreakPositionLB->connect_changed(LINK(this, SvxExtParagraphTabPage, PageBreakPosHdl_Impl));
2225 m_xPageNumBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, PageNumBoxClickHdl_Impl));
2226 m_xKeepParaBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, KeepParaBoxClickHdl_Impl));
2227
2229 {
2230 SfxStyleSheetBasePool* pPool = pSh->GetStyleSheetPool();
2231 SfxStyleSheetBase* pStyle = pPool->First(SfxStyleFamily::Page);
2232 OUString aStdName;
2233
2234 // tdf139131 - sort page styles
2235 m_xApplyCollBox->make_sorted();
2236 while( pStyle )
2237 {
2238 if ( aStdName.isEmpty() )
2239 // first style == standard style
2240 aStdName = pStyle->GetName();
2241 m_xApplyCollBox->append_text(pStyle->GetName());
2242 pStyle = pPool->Next();
2243 }
2244 nStdPos = m_xApplyCollBox->find_text(aStdName);
2245 }
2246
2247 sal_uInt16 nHtmlMode = GetHtmlMode_Impl( rAttr );
2248 if ( !(nHtmlMode & HTMLMODE_ON) )
2249 return;
2250
2251 bHtmlMode = true;
2252 m_xHyphenBox->set_sensitive(false);
2253 m_xHyphenNoCapsBox->set_sensitive(false);
2254 m_xHyphenNoLastWordBox->set_sensitive(false);
2255 m_xBeforeText->set_sensitive(false);
2256 m_xExtHyphenBeforeBox->set_sensitive(false);
2257 m_xAfterText->set_sensitive(false);
2258 m_xExtHyphenAfterBox->set_sensitive(false);
2259 m_xMaxHyphenLabel->set_sensitive(false);
2260 m_xMaxHyphenEdit->set_sensitive(false);
2261 m_xMinWordLabel->set_sensitive(false);
2262 m_xMinWordLength->set_sensitive(false);
2263 m_xHyphenZoneLabel->set_sensitive(false);
2265 m_xPageNumBox->set_sensitive(false);
2266 m_xPagenumEdit->set_sensitive(false);
2267 // no column break in HTML
2268 m_xBreakTypeLB->remove(1);
2269}
2270
2272{
2273}
2274
2276{
2277 switch (m_xPageBreakBox->get_state())
2278 {
2279 case TRISTATE_TRUE:
2280 m_xBreakTypeFT->set_sensitive(true);
2281 m_xBreakTypeLB->set_sensitive(true);
2282 m_xBreakPositionFT->set_sensitive(true);
2283 m_xBreakPositionLB->set_sensitive(true);
2284
2285 if (0 == m_xBreakTypeLB->get_active() && 0 == m_xBreakPositionLB->get_active())
2286 {
2287 m_xApplyCollBtn->set_sensitive(true);
2288
2289 bool bEnable = TRISTATE_TRUE == m_xApplyCollBtn->get_state() &&
2290 m_xApplyCollBox->get_count();
2291 m_xApplyCollBox->set_sensitive(bEnable);
2292 if(!bHtmlMode)
2293 {
2294 m_xPageNumBox->set_sensitive(bEnable);
2295 m_xPagenumEdit->set_sensitive(bEnable && m_xPageNumBox->get_state() == TRISTATE_TRUE);
2296 }
2297 }
2298 break;
2299
2300 case TRISTATE_FALSE:
2301 case TRISTATE_INDET:
2302 m_xApplyCollBtn->set_state(TRISTATE_FALSE);
2303 m_xApplyCollBtn->set_sensitive(false);
2304 m_xApplyCollBox->set_sensitive(false);
2305 m_xPageNumBox->set_sensitive(false);
2306 m_xPagenumEdit->set_sensitive(false);
2307 m_xBreakTypeFT->set_sensitive(false);
2308 m_xBreakTypeLB->set_sensitive(false);
2309 m_xBreakPositionFT->set_sensitive(false);
2310 m_xBreakPositionLB->set_sensitive(false);
2311 break;
2312 }
2313}
2314
2315IMPL_LINK(SvxExtParagraphTabPage, PageBreakHdl_Impl, weld::Toggleable&, rToggle, void)
2316{
2317 aPageBreakState.ButtonToggled(rToggle);
2318 PageBreakHdl();
2319}
2320
2322{
2323 bool bEnable = m_xKeepTogetherBox->get_state() == TRISTATE_FALSE;
2324 m_xWidowBox->set_sensitive(bEnable);
2325 m_xOrphanBox->set_sensitive(bEnable);
2326}
2327
2328IMPL_LINK(SvxExtParagraphTabPage, KeepTogetherHdl_Impl, weld::Toggleable&, rToggle, void)
2329{
2330 aKeepTogetherState.ButtonToggled(rToggle);
2331 KeepTogetherHdl();
2332}
2333
2335{
2336 switch (m_xWidowBox->get_state())
2337 {
2338 case TRISTATE_TRUE:
2339 m_xWidowRowNo->set_sensitive(true);
2340 m_xWidowRowLabel->set_sensitive(true);
2341 m_xKeepTogetherBox->set_sensitive(false);
2342 break;
2343 case TRISTATE_FALSE:
2344 if (m_xOrphanBox->get_state() == TRISTATE_FALSE)
2345 m_xKeepTogetherBox->set_sensitive(true);
2346 [[fallthrough]];
2347 case TRISTATE_INDET:
2348 m_xWidowRowNo->set_sensitive(false);
2349 m_xWidowRowLabel->set_sensitive(false);
2350 break;
2351 }
2352}
2353
2354IMPL_LINK(SvxExtParagraphTabPage, WidowHdl_Impl, weld::Toggleable&, rToggle, void)
2355{
2356 aWidowState.ButtonToggled(rToggle);
2357 WidowHdl();
2358}
2359
2360IMPL_LINK(SvxExtParagraphTabPage, OrphanHdl_Impl, weld::Toggleable&, rToggle, void)
2361{
2362 aOrphanState.ButtonToggled(rToggle);
2363 OrphanHdl();
2364}
2365
2367{
2368 switch (m_xOrphanBox->get_state())
2369 {
2370 case TRISTATE_TRUE:
2371 m_xOrphanRowNo->set_sensitive(true);
2372 m_xOrphanRowLabel->set_sensitive(true);
2373 m_xKeepTogetherBox->set_sensitive(false);
2374 break;
2375
2376 case TRISTATE_FALSE:
2377 if (m_xWidowBox->get_state() == TRISTATE_FALSE)
2378 m_xKeepTogetherBox->set_sensitive(true);
2379 [[fallthrough]];
2380 case TRISTATE_INDET:
2381 m_xOrphanRowNo->set_sensitive(false);
2382 m_xOrphanRowLabel->set_sensitive(false);
2383 break;
2384 }
2385}
2386
2388{
2389 bool bEnable = m_xHyphenBox->get_state() == TRISTATE_TRUE;
2390 m_xHyphenNoCapsBox->set_sensitive(bEnable);
2391 m_xHyphenNoLastWordBox->set_sensitive(bEnable);
2392 m_xBeforeText->set_sensitive(bEnable);
2393 m_xExtHyphenBeforeBox->set_sensitive(bEnable);
2394 m_xAfterText->set_sensitive(bEnable);
2395 m_xExtHyphenAfterBox->set_sensitive(bEnable);
2396 m_xMaxHyphenLabel->set_sensitive(bEnable);
2397 m_xMaxHyphenEdit->set_sensitive(bEnable);
2398 m_xMinWordLabel->set_sensitive(bEnable);
2399 m_xMinWordLength->set_sensitive(bEnable);
2400 m_xHyphenZoneLabel->set_sensitive(bEnable);
2402 m_xHyphenBox->set_state(bEnable ? TRISTATE_TRUE : TRISTATE_FALSE);
2403}
2404
2405IMPL_LINK(SvxExtParagraphTabPage, HyphenClickHdl_Impl, weld::Toggleable&, rToggle, void)
2406{
2407 aHyphenState.ButtonToggled(rToggle);
2408 HyphenClickHdl();
2409}
2410
2412{
2413 bool bEnable = false;
2414 if (m_xApplyCollBtn->get_state() == TRISTATE_TRUE && m_xApplyCollBox->get_count())
2415 {
2416 bEnable = true;
2417 m_xApplyCollBox->set_active(nStdPos);
2418 }
2419 else
2420 {
2421 m_xApplyCollBox->set_active(-1);
2422 }
2423 m_xApplyCollBox->set_sensitive(bEnable);
2424 if (!bHtmlMode)
2425 {
2426 m_xPageNumBox->set_sensitive(bEnable);
2427 m_xPagenumEdit->set_sensitive(bEnable && m_xPageNumBox->get_state() == TRISTATE_TRUE);
2428 }
2429}
2430
2431IMPL_LINK(SvxExtParagraphTabPage, ApplyCollClickHdl_Impl, weld::Toggleable&, rToggle, void)
2432{
2433 aApplyCollState.ButtonToggled(rToggle);
2434 ApplyCollClickHdl();
2435}
2436
2437IMPL_LINK(SvxExtParagraphTabPage, PageBreakPosHdl_Impl, weld::ComboBox&, rListBox, void)
2438{
2439 if (0 == rListBox.get_active())
2440 {
2441 m_xApplyCollBtn->set_sensitive(true);
2442
2443 bool bEnable = m_xApplyCollBtn->get_state() == TRISTATE_TRUE && m_xApplyCollBox->get_count();
2444
2445 m_xApplyCollBox->set_sensitive(bEnable);
2446 if (!bHtmlMode)
2447 {
2448 m_xPageNumBox->set_sensitive(bEnable);
2449 m_xPagenumEdit->set_sensitive(bEnable && m_xPageNumBox->get_state() == TRISTATE_TRUE);
2450 }
2451 }
2452 else if (1 == rListBox.get_active())
2453 {
2454 m_xApplyCollBtn->set_state(TRISTATE_FALSE);
2455 m_xApplyCollBtn->set_sensitive(false);
2456 m_xApplyCollBox->set_sensitive(false);
2457 m_xPageNumBox->set_sensitive(false);
2458 m_xPagenumEdit->set_sensitive(false);
2459 }
2460}
2461
2462IMPL_LINK(SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, weld::ComboBox&, rListBox, void)
2463{
2464 //column break or break after
2465 int nBreakPos = m_xBreakPositionLB->get_active();
2466 if (rListBox.get_active() == 1 || 1 == nBreakPos)
2467 {
2468 m_xApplyCollBtn->set_state(TRISTATE_FALSE);
2469 m_xApplyCollBtn->set_sensitive(false);
2470 m_xApplyCollBox->set_sensitive(false);
2471 m_xPageNumBox->set_sensitive(false);
2472 m_xPagenumEdit->set_sensitive(false);
2473 }
2474 else
2475 PageBreakPosHdl_Impl(*m_xBreakPositionLB);
2476}
2477
2479{
2480 m_xPagenumEdit->set_sensitive(m_xPageNumBox->get_state() == TRISTATE_TRUE);
2481}
2482
2483IMPL_LINK(SvxExtParagraphTabPage, PageNumBoxClickHdl_Impl, weld::Toggleable&, rToggle, void)
2484{
2485 aPageNumState.ButtonToggled(rToggle);
2486 PageNumBoxClickHdl();
2487}
2488
2489IMPL_LINK(SvxExtParagraphTabPage, KeepParaBoxClickHdl_Impl, weld::Toggleable&, rToggle, void)
2490{
2491 aKeepParaState.ButtonToggled(rToggle);
2492}
2493
2495{
2496 const SfxBoolItem* pDisablePageBreakItem = aSet.GetItem<SfxBoolItem>(SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK, false);
2497
2498 if (pDisablePageBreakItem)
2499 if ( pDisablePageBreakItem->GetValue())
2501}
2502
2504 : SfxTabPage(pPage, pController, "cui/ui/asiantypography.ui", "AsianTypography", &rSet)
2505 , m_xForbiddenRulesCB(m_xBuilder->weld_check_button("checkForbidList"))
2506 , m_xHangingPunctCB(m_xBuilder->weld_check_button("checkHangPunct"))
2507 , m_xScriptSpaceCB(m_xBuilder->weld_check_button("checkApplySpacing"))
2508{
2509}
2510
2512{
2513}
2514
2515std::unique_ptr<SfxTabPage> SvxAsianTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet)
2516{
2517 return std::make_unique<SvxAsianTabPage>(pPage, pController, *rSet);
2518}
2519
2521{
2522 return WhichRangesContainer(svl::Items<SID_ATTR_PARA_SCRIPTSPACE, SID_ATTR_PARA_FORBIDDEN_RULES>);
2523}
2524
2526{
2527 bool bRet = false;
2528 SfxItemPool* pPool = rSet->GetPool();
2529 if (m_xScriptSpaceCB->get_sensitive() && m_xScriptSpaceCB->get_state_changed_from_saved())
2530 {
2531 std::unique_ptr<SfxBoolItem> pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
2532 pPool->GetWhich(SID_ATTR_PARA_SCRIPTSPACE)).Clone()));
2533 pNewItem->SetValue(m_xScriptSpaceCB->get_active());
2534 rSet->Put(std::move(pNewItem));
2535 bRet = true;
2536 }
2537 if (m_xHangingPunctCB->get_sensitive() && m_xHangingPunctCB->get_state_changed_from_saved())
2538 {
2539 std::unique_ptr<SfxBoolItem> pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
2540 pPool->GetWhich(SID_ATTR_PARA_HANGPUNCTUATION)).Clone()));
2541 pNewItem->SetValue(m_xHangingPunctCB->get_active());
2542 rSet->Put(std::move(pNewItem));
2543 bRet = true;
2544 }
2545 if (m_xForbiddenRulesCB->get_sensitive() && m_xForbiddenRulesCB->get_state_changed_from_saved())
2546 {
2547 std::unique_ptr<SfxBoolItem> pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
2548 pPool->GetWhich(SID_ATTR_PARA_FORBIDDEN_RULES)).Clone()));
2549 pNewItem->SetValue(m_xForbiddenRulesCB->get_active());
2550 rSet->Put(std::move(pNewItem));
2551 bRet = true;
2552 }
2553 return bRet;
2554}
2555
2556static void lcl_SetBox(const SfxItemSet& rSet, sal_uInt16 nSlotId, weld::CheckButton& rBox)
2557{
2558 sal_uInt16 _nWhich = rSet.GetPool()->GetWhich(nSlotId);
2559 SfxItemState eState = rSet.GetItemState(_nWhich);
2560 if( eState == SfxItemState::UNKNOWN || eState == SfxItemState::DISABLED )
2561 rBox.set_sensitive(false);
2562 else if(eState >= SfxItemState::DEFAULT)
2563 rBox.set_active(static_cast<const SfxBoolItem&>(rSet.Get(_nWhich)).GetValue());
2564 else
2566 rBox.save_state();
2567}
2568
2570{
2571 lcl_SetBox(*rSet, SID_ATTR_PARA_FORBIDDEN_RULES, *m_xForbiddenRulesCB );
2572 lcl_SetBox(*rSet, SID_ATTR_PARA_HANGPUNCTUATION, *m_xHangingPunctCB );
2573
2574 //character distance not yet available
2575 lcl_SetBox(*rSet, SID_ATTR_PARA_SCRIPTSPACE, *m_xScriptSpaceCB );
2576}
2577
2579{
2580 m_xForbiddenRulesCB->save_state();
2581 m_xHangingPunctCB->save_state();
2582 m_xScriptSpaceCB->save_state();
2583}
2584
2585/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define LLINESPACE_PROP
#define LLINESPACE_15
#define LLINESPACE_DURCH
#define LLINESPACE_1
#define LLINESPACE_115
#define LLINESPACE_2
#define LLINESPACE_MIN
#define LLINESPACE_FIX
static bool GetLayoutRTL()
sal_uInt16 GetValue() const
static OUString EraseAllMnemonicChars(const OUString &rStr)
bool GetValue() const
virtual SfxBoolItem * Clone(SfxItemPool *=nullptr) const override
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetParent() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
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 DisableItem(sal_uInt16 nWhich)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
SfxStyleSheetBase * Next()
const OUString & GetName() const
const SfxItemSet & GetItemSet() const
void SetExchangeSupport()
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
SvxAdjust GetLastBlock() const
SvxAdjust GetAdjust() const
SvxAdjust GetOneWord() const
void SetAdjust(const SvxAdjust eType)
void SetOneWord(const SvxAdjust eType)
void SetLastBlock(const SvxAdjust eType)
virtual void Reset(const SfxItemSet *rSet) override
Definition: paragrph.cxx:2569
std::unique_ptr< weld::CheckButton > m_xHangingPunctCB
Definition: paragrph.hxx:295
virtual ~SvxAsianTabPage() override
Definition: paragrph.cxx:2511
static WhichRangesContainer GetRanges()
Definition: paragrph.cxx:2520
virtual void ChangesApplied() override
Definition: paragrph.cxx:2578
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: paragrph.cxx:2515
std::unique_ptr< weld::CheckButton > m_xScriptSpaceCB
Definition: paragrph.hxx:296
std::unique_ptr< weld::CheckButton > m_xForbiddenRulesCB
Definition: paragrph.hxx:294
SvxAsianTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: paragrph.cxx:2503
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: paragrph.cxx:2525
std::unique_ptr< weld::SpinButton > m_xWidowRowNo
Definition: paragrph.hxx:267
weld::TriStateEnabled aKeepTogetherState
Definition: paragrph.hxx:222
SvxExtParagraphTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: paragrph.cxx:2175
weld::TriStateEnabled aHyphenState
Definition: paragrph.hxx:218
std::unique_ptr< weld::ComboBox > m_xApplyCollBox
Definition: paragrph.hxx:253
std::unique_ptr< weld::CheckButton > m_xHyphenNoLastWordBox
Definition: paragrph.hxx:234
std::unique_ptr< weld::Label > m_xBreakPositionFT
Definition: paragrph.hxx:250
weld::TriStateEnabled aApplyCollState
Definition: paragrph.hxx:220
std::unique_ptr< weld::CheckButton > m_xWidowBox
Definition: paragrph.hxx:266
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: paragrph.cxx:1594
std::unique_ptr< weld::SpinButton > m_xOrphanRowNo
Definition: paragrph.hxx:263
static const WhichRangesContainer pExtRanges
Definition: paragrph.hxx:198
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: paragrph.cxx:1599
std::unique_ptr< weld::Label > m_xAfterText
Definition: paragrph.hxx:237
SvxRelativeField m_aHyphenZone
Definition: paragrph.hxx:244
std::unique_ptr< weld::Label > m_xHyphenZoneLabel
Definition: paragrph.hxx:243
weld::TriStateEnabled aPageNumState
Definition: paragrph.hxx:221
weld::TriStateEnabled aKeepParaState
Definition: paragrph.hxx:223
std::unique_ptr< weld::CheckButton > m_xKeepTogetherBox
Definition: paragrph.hxx:258
std::unique_ptr< weld::Label > m_xMinWordLabel
Definition: paragrph.hxx:241
std::unique_ptr< weld::ComboBox > m_xBreakPositionLB
Definition: paragrph.hxx:251
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: paragrph.cxx:2494
std::unique_ptr< weld::CheckButton > m_xPageBreakBox
Definition: paragrph.hxx:247
std::unique_ptr< weld::SpinButton > m_xMaxHyphenEdit
Definition: paragrph.hxx:240
weld::TriStateEnabled aPageBreakState
Definition: paragrph.hxx:219
std::unique_ptr< weld::CheckButton > m_xHyphenNoCapsBox
Definition: paragrph.hxx:233
std::unique_ptr< weld::SpinButton > m_xPagenumEdit
Definition: paragrph.hxx:255
weld::TriStateEnabled aWidowState
Definition: paragrph.hxx:225
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: paragrph.cxx:2155
std::unique_ptr< weld::Label > m_xWidowRowLabel
Definition: paragrph.hxx:268
weld::TriStateEnabled aOrphanState
Definition: paragrph.hxx:224
std::unique_ptr< weld::CheckButton > m_xKeepParaBox
Definition: paragrph.hxx:259
std::unique_ptr< weld::CheckButton > m_xOrphanBox
Definition: paragrph.hxx:262
std::unique_ptr< weld::SpinButton > m_xExtHyphenAfterBox
Definition: paragrph.hxx:238
std::unique_ptr< weld::SpinButton > m_xMinWordLength
Definition: paragrph.hxx:242
std::unique_ptr< weld::SpinButton > m_xExtHyphenBeforeBox
Definition: paragrph.hxx:236
std::unique_ptr< weld::CheckButton > m_xHyphenBox
Definition: paragrph.hxx:232
std::unique_ptr< weld::Label > m_xBreakTypeFT
Definition: paragrph.hxx:248
virtual void Reset(const SfxItemSet *rSet) override
Definition: paragrph.cxx:1820
std::unique_ptr< weld::Label > m_xBeforeText
Definition: paragrph.hxx:235
virtual ~SvxExtParagraphTabPage() override
Definition: paragrph.cxx:2271
std::unique_ptr< weld::CheckButton > m_xPageNumBox
Definition: paragrph.hxx:254
std::unique_ptr< weld::ComboBox > m_xBreakTypeLB
Definition: paragrph.hxx:249
std::unique_ptr< weld::Label > m_xOrphanRowLabel
Definition: paragrph.hxx:264
std::unique_ptr< weld::Label > m_xMaxHyphenLabel
Definition: paragrph.hxx:239
std::unique_ptr< weld::CheckButton > m_xApplyCollBtn
Definition: paragrph.hxx:252
virtual void ChangesApplied() override
Definition: paragrph.cxx:2126
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
bool IsAutoFirst() const
sal_uInt16 GetPropTextFirstLineOffset() const
void SetAutoFirst(const bool bNew)
short GetTextFirstLineOffset() const
SvxBreak GetBreak() const
sal_uInt8 & GetMinLead()
bool IsNoLastWordHyphenation() const
sal_uInt16 & GetTextHyphenZone()
sal_uInt8 & GetMinWordLength()
void SetHyphen(const bool bNew)
sal_uInt8 & GetMaxHyphens()
bool IsHyphen() const
void SetNoCapsHyphenation(const bool bNew)
bool IsNoCapsHyphenation() const
void SetNoLastWordHyphenation(const bool bNew)
sal_uInt8 & GetMinTrail()
bool IsAutoFirst() const
sal_uInt16 GetPropLeft() const
sal_uInt16 GetPropRight() const
short GetTextFirstLineOffset() const
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
tools::Long GetTextLeft() const
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
void SetAutoFirst(const bool bNew)
sal_uInt16 GetPropTextFirstLineOffset() const
void SetPropLineSpace(const sal_uInt16 nProp)
void SetInterLineSpaceRule(SvxInterLineSpaceRule e)
sal_uInt16 GetPropLineSpace() const
SvxInterLineSpaceRule GetInterLineSpaceRule() const
SvxLineSpaceRule GetLineSpaceRule() const
sal_uInt16 GetLineHeight() const
void SetLineSpaceRule(SvxLineSpaceRule e)
void SetLineHeight(const sal_uInt16 nHeight)
short GetInterLineSpace() const
void SetInterLineSpace(const short nSpace)
std::unique_ptr< weld::Label > m_xVertAlignSdr
Definition: paragrph.hxx:151
std::unique_ptr< weld::Label > m_xLastLineFT
Definition: paragrph.hxx:139
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: paragrph.cxx:1363
std::unique_ptr< weld::ComboBox > m_xVertAlignLB
Definition: paragrph.hxx:149
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: paragrph.cxx:1587
std::unique_ptr< weld::Label > m_xLeftBottom
Definition: paragrph.hxx:136
std::unique_ptr< svx::FrameDirectionListBox > m_xTextDirectionLB
Definition: paragrph.hxx:153
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: paragrph.cxx:1279
SvxParaPrevWindow m_aExampleWin
Definition: paragrph.hxx:129
std::unique_ptr< weld::RadioButton > m_xCenter
Definition: paragrph.hxx:134
SvxParaAlignTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: paragrph.cxx:1210
virtual void ChangesApplied() override
Definition: paragrph.cxx:1472
virtual ~SvxParaAlignTabPage() override
Definition: paragrph.cxx:1268
std::unique_ptr< weld::Label > m_xVertAlign
Definition: paragrph.hxx:150
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: paragrph.cxx:1284
std::unique_ptr< weld::CheckButton > m_xExpandCB
Definition: paragrph.hxx:141
std::unique_ptr< weld::RadioButton > m_xJustify
Definition: paragrph.hxx:135
std::unique_ptr< weld::RadioButton > m_xLeft
Definition: paragrph.hxx:132
static const WhichRangesContainer pAlignRanges
Definition: paragrph.hxx:125
static const WhichRangesContainer pSdrAlignRanges
Definition: paragrph.hxx:125
virtual void Reset(const SfxItemSet *rSet) override
Definition: paragrph.cxx:1368
std::unique_ptr< weld::RadioButton > m_xRight
Definition: paragrph.hxx:133
std::unique_ptr< weld::Label > m_xRightTop
Definition: paragrph.hxx:137
std::unique_ptr< weld::ComboBox > m_xLastLineLB
Definition: paragrph.hxx:140
std::unique_ptr< weld::Widget > m_xVertAlignFL
Definition: paragrph.hxx:148
std::unique_ptr< weld::CheckButton > m_xSnapToGridCB
Definition: paragrph.hxx:143
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: paragrph.cxx:1272
void SetRightMargin(tools::Long nNew)
void SetLeftMargin(tools::Long nNew)
void SetUpper(sal_uInt16 nNew)
void SetLineSpace(SvxPrevLineSpace eNew)
void SetAdjust(SvxAdjust eNew)
void SetLower(sal_uInt16 nNew)
void SetLastLine(SvxAdjust eNew)
void SetFirstLineOffset(short nNew)
Align GetValue() const
bool get_value_changed_from_saved() const
bool IsRelative() const
void set_text(const OUString &rText)
int normalize(int nValue) const
int GetCoreValue(MapUnit eUnit) const
void SetMetricValue(int lCoreValue, MapUnit eUnit)
void connect_value_changed(const Link< weld::MetricSpinButton &, void > &rLink)
void EnableRelativeMode(sal_uInt16 nMin, sal_uInt16 nMax)
void set_min(int min, FieldUnit eValueUnit)
int denormalize(int nValue) const
void EnableNegativeMode()
int get_min(FieldUnit eValueUnit) const
void SetFieldUnit(FieldUnit eUnit, bool bAll=false)
void set_max(int max, FieldUnit eValueUnit)
int get_value(FieldUnit eDestUnit) const
void set_value(int nValue, FieldUnit eValueUnit)
OUString get_text() const
void set_sensitive(bool sensitive)
void SetRelative(bool bRelative)
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
sal_uInt16 GetPropRight() const
std::unique_ptr< weld::CheckButton > m_xRegisterCB
Definition: paragrph.hxx:77
bool m_bSplitLRSpace
which items to use?
Definition: paragrph.hxx:54
std::unique_ptr< weld::CheckButton > m_xAutoCB
Definition: paragrph.hxx:61
tools::Long nMinFixDist
Definition: paragrph.hxx:47
std::unique_ptr< weld::MetricSpinButton > m_xLineDistAtPlaceHolderBox
Definition: paragrph.hxx:72
SvxRelativeField m_aLeftIndent
Definition: paragrph.hxx:55
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: paragrph.cxx:215
std::unique_ptr< weld::MetricSpinButton > m_xLineDistAtMetricBox
Definition: paragrph.hxx:71
SvxRelativeField m_aRightIndent
Definition: paragrph.hxx:57
virtual ~SvxStdParagraphTabPage() override
Definition: paragrph.cxx:924
SvxRelativeField m_aFLineIndent
Definition: paragrph.hxx:60
virtual void Reset(const SfxItemSet *rSet) override
Definition: paragrph.cxx:530
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: paragrph.cxx:1162
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Definition: paragrph.cxx:210
void SetLineSpacing_Impl(const SvxLineSpacingItem &rAttr)
Definition: paragrph.cxx:937
void EnableAbsLineDist(tools::Long nMinTwip)
Definition: paragrph.cxx:1156
std::unique_ptr< weld::CheckButton > m_xContextualCB
Definition: paragrph.hxx:66
SvxParaPrevWindow m_aExampleWin
Definition: paragrph.hxx:51
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: paragrph.cxx:880
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: paragrph.cxx:843
SvxRelativeField m_aBottomDist
Definition: paragrph.hxx:65
std::unique_ptr< weld::Label > m_xAbsDist
Definition: paragrph.hxx:74
static const WhichRangesContainer pStdRanges
Definition: paragrph.hxx:43
virtual void ChangesApplied() override
Definition: paragrph.cxx:816
SvxRelativeField m_aTopDist
Definition: paragrph.hxx:64
std::unique_ptr< weld::MetricSpinButton > m_xLineDistAtPercentBox
Definition: paragrph.hxx:70
SvxStdParagraphTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Definition: paragrph.cxx:889
tools::Long nWidth
Definition: paragrph.hxx:46
std::unique_ptr< weld::ComboBox > m_xLineDist
Definition: paragrph.hxx:69
bool Insert(const SvxTabStop &rTab)
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
sal_uInt16 GetPropLeft() const
tools::Long GetTextLeft() const
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
sal_uInt16 GetPropLower() const
sal_uInt16 GetUpper() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetLower() const
bool GetContext() const
sal_uInt16 GetPropUpper() const
void SetContextValue(const bool bC)
virtual void set_active(bool active)=0
void set_state(TriState eState)
virtual void set_sensitive(bool sensitive)=0
#define DBG_ASSERT(sCon, aError)
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
virtual tools::Long GetValue() const override
SVXCORE_DLLPUBLIC FieldUnit GetModuleFieldUnit(const SfxItemSet &)
SVXCORE_DLLPUBLIC bool GetApplyCharUnit(const SfxItemSet &)
constexpr tools::Long MM50
FieldUnit
SvxFrameDirection
TriState
TRISTATE_FALSE
TRISTATE_INDET
TRISTATE_TRUE
HTMLMODE_ON
HTMLMODE_FULL_STYLES
sal_uInt16 nPos
MapUnit
aStr
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
bool IsAsianTypographyEnabled()
static constexpr auto Items
long Long
#define FIX_DIST_DEF
Definition: paragrph.cxx:81
static sal_uInt16 GetHtmlMode_Impl(const SfxItemSet &rSet)
Definition: paragrph.cxx:149
#define LASTLINECOUNT_OLD
Definition: paragrph.cxx:1207
#define LASTLINEPOS_LEFT
Definition: paragrph.cxx:1205
IMPL_LINK(SvxStdParagraphTabPage, LineDistHdl_Impl, weld::ComboBox &, rBox, void)
Definition: paragrph.cxx:1013
static void SetLineSpace_Impl(SvxLineSpacingItem &, int, tools::Long lValue=0)
Definition: paragrph.cxx:101
#define LASTLINEPOS_DEFAULT
Definition: paragrph.cxx:1204
static void lcl_SetBox(const SfxItemSet &rSet, sal_uInt16 nSlotId, weld::CheckButton &rBox)
Definition: paragrph.cxx:2556
IMPL_LINK_NOARG(SvxStdParagraphTabPage, ELRLoseFocusHdl, weld::MetricSpinButton &, void)
Definition: paragrph.cxx:205
#define LASTLINECOUNT_NEW
Definition: paragrph.cxx:1208
#define MAX_DURCH
Definition: paragrph.cxx:80
SvxPrevLineSpace
SfxItemState
bool IsInvalidItem(const SfxPoolItem *pItem)
QPRO_FUNC_TYPE nType
SdrTextVertAdjust
static SfxItemSet & rSet
constexpr TypedWhichId< SdrTextVertAdjustItem > SDRATTR_TEXT_VERTADJUST(SDRATTR_MISC_FIRST+8)
SvxInterLineSpaceRule
SvxBreak
SvxAdjust
DeactivateRC
unsigned char sal_uInt8
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)
SVT_DLLPUBLIC FieldUnit MapToFieldUnit(const MapUnit eUnit)
constexpr OUStringLiteral PERCENT(u"Percent")