LibreOffice Module editeng (master) 1
paraitem.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 <com/sun/star/style/TabStop.hpp>
21#include <com/sun/star/style/LineSpacing.hpp>
22#include <com/sun/star/style/LineSpacingMode.hpp>
23#include <com/sun/star/uno/Sequence.hxx>
24#include <libxml/xmlwriter.h>
26#include <osl/diagnose.h>
29#include <tools/mapunit.hxx>
31#include <svl/itempool.hxx>
32#include <svl/memberid.h>
33#include <editeng/editrids.hrc>
34#include <editeng/lspcitem.hxx>
36#include <editeng/orphitem.hxx>
37#include <editeng/widwitem.hxx>
38#include <editeng/tstpitem.hxx>
39#include <editeng/pmdlitem.hxx>
40#include <editeng/spltitem.hxx>
46#include <editeng/pgrditem.hxx>
47#include <rtl/ustring.hxx>
48#include <sal/log.hxx>
49#include <editeng/memberids.h>
50#include <editeng/itemtype.hxx>
51#include <editeng/eerdll.hxx>
52
53using namespace ::com::sun::star;
54
55
65
66namespace {
67
68enum class SvxSpecialLineSpace
69{
70 User,
71 OneLine,
72 OnePointFiveLines,
73 TwoLines,
74 End
75};
76
77}
78
79SvxLineSpacingItem::SvxLineSpacingItem( sal_uInt16 nHeight, const sal_uInt16 nId )
81{
82 nPropLineSpace = 100;
84 nLineHeight = nHeight;
87}
88
89
91{
92 assert(SfxPoolItem::operator==(rAttr));
93
94 const SvxLineSpacingItem& rLineSpace = static_cast<const SvxLineSpacingItem&>(rAttr);
95 return
96 // Same Linespacing Rule?
97 (eLineSpaceRule == rLineSpace.eLineSpaceRule)
98 // For maximum and minimum Linespacing be the size must coincide.
100 nLineHeight == rLineSpace.nLineHeight)
101 // Same Linespacing Rule?
102 && ( eInterLineSpaceRule == rLineSpace.eInterLineSpaceRule )
103 // Either set proportional or additive.
106 && nPropLineSpace == rLineSpace.nPropLineSpace)
108 && (nInterLineSpace == rLineSpace.nInterLineSpace)));
109}
110
111/* Who does still know why the LineSpacingItem is so complicated?
112 We can not use it for UNO since there are only two values:
113 - a sal_uInt16 for the mode
114 - a sal_uInt32 for all values (distance, height, rel. detail)
115*/
117{
118 bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
119 nMemberId &= ~CONVERT_TWIPS;
120
121 style::LineSpacing aLSp;
122 switch( eLineSpaceRule )
123 {
126 {
127 aLSp.Mode = style::LineSpacingMode::LEADING;
128 aLSp.Height = ( bConvert ? static_cast<short>(convertTwipToMm100(nInterLineSpace)) : nInterLineSpace);
129 }
131 {
132 aLSp.Mode = style::LineSpacingMode::PROP;
133 aLSp.Height = 100;
134 }
135 else
136 {
137 aLSp.Mode = style::LineSpacingMode::PROP;
138 aLSp.Height = nPropLineSpace;
139 }
140 break;
143 aLSp.Mode = eLineSpaceRule == SvxLineSpaceRule::Fix ? style::LineSpacingMode::FIX : style::LineSpacingMode::MINIMUM;
144 aLSp.Height = ( bConvert ? static_cast<short>(convertTwipToMm100(nLineHeight)) : nLineHeight );
145 break;
146 default:
147 ;//prevent warning about SvxLineSpaceRule::End
148 }
149
150 switch ( nMemberId )
151 {
152 case 0 : rVal <<= aLSp; break;
153 case MID_LINESPACE : rVal <<= aLSp.Mode; break;
154 case MID_HEIGHT : rVal <<= aLSp.Height; break;
155 default: OSL_FAIL("Wrong MemberId!"); break;
156 }
157
158 return true;
159}
160
161bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
162{
163 bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
164 nMemberId &= ~CONVERT_TWIPS;
165
166 // fill with current data
167 style::LineSpacing aLSp;
168 uno::Any aAny;
169 bool bRet = QueryValue( aAny, bConvert ? CONVERT_TWIPS : 0 ) && ( aAny >>= aLSp );
170
171 // get new data
172 switch ( nMemberId )
173 {
174 case 0 : bRet = (rVal >>= aLSp); break;
175 case MID_LINESPACE : bRet = (rVal >>= aLSp.Mode); break;
176 case MID_HEIGHT : bRet = (rVal >>= aLSp.Height); break;
177 default: OSL_FAIL("Wrong MemberId!"); break;
178 }
179
180 if( bRet )
181 {
182 nLineHeight = aLSp.Height;
183 switch( aLSp.Mode )
184 {
185 case style::LineSpacingMode::LEADING:
186 {
189 nInterLineSpace = aLSp.Height;
190 if(bConvert)
192
193 }
194 break;
195 case style::LineSpacingMode::PROP:
196 {
198 nPropLineSpace = aLSp.Height;
199 if(100 == aLSp.Height)
201 else
203 }
204 break;
205 case style::LineSpacingMode::FIX:
206 case style::LineSpacingMode::MINIMUM:
207 {
209 eLineSpaceRule = aLSp.Mode == style::LineSpacingMode::FIX ? SvxLineSpaceRule::Fix : SvxLineSpaceRule::Min;
210 nLineHeight = aLSp.Height;
211 if(bConvert)
213 }
214 break;
215 }
216 }
217
218 return bRet;
219}
220
222{
223 return new SvxLineSpacingItem( *this );
224}
225
227(
229 MapUnit eCoreUnit,
230 MapUnit ePresUnit,
231 OUString& rText, const IntlWrapper& rIntl
232) const
233{
234 switch ( ePres )
235 {
236 case SfxItemPresentation::Nameless:
237 case SfxItemPresentation::Complete:
238 {
239 switch( GetLineSpaceRule() )
240 {
242 {
244
245 switch( eInter )
246 {
247 // Default single line spacing
249 rText = EditResId(RID_SVXITEMS_LINESPACING_SINGLE);
250 break;
251
252 // Default single line spacing
254 if ( 100 == GetPropLineSpace() )
255 {
256 rText = EditResId(RID_SVXITEMS_LINESPACING_SINGLE);
257 break;
258 }
259 // 1.15 line spacing
260 if ( 115 == GetPropLineSpace() )
261 {
262 rText = EditResId(RID_SVXITEMS_LINESPACING_115);
263 break;
264 }
265 // 1.5 line spacing
266 if ( 150 == GetPropLineSpace() )
267 {
268 rText = EditResId(RID_SVXITEMS_LINESPACING_15);
269 break;
270 }
271 // double line spacing
272 if ( 200 == GetPropLineSpace() )
273 {
274 rText = EditResId(RID_SVXITEMS_LINESPACING_DOUBLE);
275 break;
276 }
277 // the set per cent value
278 rText = EditResId(RID_SVXITEMS_LINESPACING_PROPORTIONAL) + " " + OUString::number(GetPropLineSpace()) + "%";
279 break;
280
282 rText = EditResId(RID_SVXITEMS_LINESPACING_LEADING) +
283 " " + GetMetricText(GetInterLineSpace(), eCoreUnit, ePresUnit, &rIntl) +
284 " " + EditResId(GetMetricId(ePresUnit));
285 break;
286 default: ;//prevent warning
287 }
288 }
289 break;
291 rText = EditResId(RID_SVXITEMS_LINESPACING_FIXED) +
292 " " + GetMetricText(GetLineHeight(), eCoreUnit, ePresUnit, &rIntl) +
293 " " + EditResId(GetMetricId(ePresUnit));
294 break;
295
297 rText = EditResId(RID_SVXITEMS_LINESPACING_MIN) +
298 " " + GetMetricText(GetLineHeight(), eCoreUnit, ePresUnit, &rIntl) +
299 " " + EditResId(GetMetricId(ePresUnit));
300 break;
301 default: ;//prevent warning
302 }
303 }
304 }
305 return true;
306}
307
309{
310 return sal_uInt16(SvxSpecialLineSpace::End); // SvxSpecialLineSpace::TwoLines + 1
311}
312
313
315{
316 SvxSpecialLineSpace nVal;
317 switch ( nPropLineSpace )
318 {
319 case 100: nVal = SvxSpecialLineSpace::OneLine; break;
320 case 150: nVal = SvxSpecialLineSpace::OnePointFiveLines; break;
321 case 200: nVal = SvxSpecialLineSpace::TwoLines; break;
322 default: nVal = SvxSpecialLineSpace::User; break;
323 }
324 return static_cast<sal_uInt16>(nVal);
325}
326
327
328void SvxLineSpacingItem::SetEnumValue( sal_uInt16 nVal )
329{
330 switch ( static_cast<SvxSpecialLineSpace>(nVal) )
331 {
332 case SvxSpecialLineSpace::OneLine: nPropLineSpace = 100; break;
333 case SvxSpecialLineSpace::OnePointFiveLines: nPropLineSpace = 150; break;
334 case SvxSpecialLineSpace::TwoLines: nPropLineSpace = 200; break;
335 default: break;
336 }
337}
338
339// class SvxAdjustItem ---------------------------------------------------
340
341SvxAdjustItem::SvxAdjustItem(const SvxAdjust eAdjst, const sal_uInt16 nId )
343 bOneBlock( false ), bLastCenter( false ), bLastBlock( false )
344{
345 SetAdjust( eAdjst );
346}
347
348
349bool SvxAdjustItem::operator==( const SfxPoolItem& rAttr ) const
350{
351 assert(SfxPoolItem::operator==(rAttr));
352
353 const SvxAdjustItem& rItem = static_cast<const SvxAdjustItem&>(rAttr);
354 return GetAdjust() == rItem.GetAdjust() &&
355 bOneBlock == rItem.bOneBlock &&
356 bLastCenter == rItem.bLastCenter &&
357 bLastBlock == rItem.bLastBlock;
358}
359
360bool SvxAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
361{
362 nMemberId &= ~CONVERT_TWIPS;
363 switch( nMemberId )
364 {
365 case MID_PARA_ADJUST : rVal <<= static_cast<sal_Int16>(GetAdjust()); break;
366 case MID_LAST_LINE_ADJUST : rVal <<= static_cast<sal_Int16>(GetLastBlock()); break;
367 case MID_EXPAND_SINGLE :
368 {
369 rVal <<= bOneBlock;
370 break;
371 }
372 default: ;//prevent warning
373 }
374 return true;
375}
376
377bool SvxAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
378{
379 nMemberId &= ~CONVERT_TWIPS;
380 switch( nMemberId )
381 {
382 case MID_PARA_ADJUST :
384 {
385 sal_Int32 eVal = - 1;
386 ::cppu::enum2int(eVal,rVal);
387 if(eVal >= 0 && eVal <= 4)
388 {
389 SvxAdjust eAdjust = static_cast<SvxAdjust>(eVal);
390 if(MID_LAST_LINE_ADJUST == nMemberId &&
391 eAdjust != SvxAdjust::Left &&
392 eAdjust != SvxAdjust::Block &&
393 eAdjust != SvxAdjust::Center)
394 return false;
395 nMemberId == MID_PARA_ADJUST ? SetAdjust(eAdjust) : SetLastBlock(eAdjust);
396 }
397 }
398 break;
399 case MID_EXPAND_SINGLE :
400 bOneBlock = Any2Bool(rVal);
401 break;
402 }
403 return true;
404}
405
407{
408 return new SvxAdjustItem( *this );
409}
410
412(
414 MapUnit /*eCoreUnit*/,
415 MapUnit /*ePresUnit*/,
416 OUString& rText, const IntlWrapper&
417) const
418{
419 switch ( ePres )
420 {
421 case SfxItemPresentation::Nameless:
422 case SfxItemPresentation::Complete:
423 rText = GetValueTextByPos( static_cast<sal_uInt16>(GetAdjust()) );
424 return true;
425 default: ;//prevent warning
426 }
427 return false;
428}
429
430
432{
433 return sal_uInt16(SvxAdjust::End); // SvxAdjust::BlockLine + 1
434}
435
436OUString SvxAdjustItem::GetValueTextByPos( sal_uInt16 nPos )
437{
438 static TranslateId RID_SVXITEMS_ADJUST[] =
439 {
440 RID_SVXITEMS_ADJUST_LEFT,
441 RID_SVXITEMS_ADJUST_RIGHT,
442 RID_SVXITEMS_ADJUST_BLOCK,
443 RID_SVXITEMS_ADJUST_CENTER,
444 RID_SVXITEMS_ADJUST_BLOCKLINE
445 };
446 static_assert(SAL_N_ELEMENTS(RID_SVXITEMS_ADJUST) - 1 == size_t(SvxAdjust::BlockLine), "unexpected size");
447 assert(nPos <= sal_uInt16(SvxAdjust::BlockLine) && "enum overflow!");
448 return EditResId(RID_SVXITEMS_ADJUST[nPos]);
449}
450
452{
453 return static_cast<sal_uInt16>(GetAdjust());
454}
455
456
457void SvxAdjustItem::SetEnumValue( sal_uInt16 nVal )
458{
459 SetAdjust( static_cast<SvxAdjust>(nVal) );
460}
461
462
463// class SvxWidowsItem ---------------------------------------------------
464
465SvxWidowsItem::SvxWidowsItem(const sal_uInt8 nL, const sal_uInt16 nId ) :
466 SfxByteItem( nId, nL )
467{
468}
469
471{
472 return new SvxWidowsItem( *this );
473}
474
476(
478 MapUnit /*eCoreUnit*/,
479 MapUnit /*ePresUnit*/,
480 OUString& rText, const IntlWrapper&
481) const
482{
483 switch ( ePres )
484 {
485 case SfxItemPresentation::Nameless:
486 {
487 rText = EditResId(RID_SVXITEMS_LINES);
488 break;
489 }
490
491 case SfxItemPresentation::Complete:
492 {
493 rText = EditResId(RID_SVXITEMS_WIDOWS_COMPLETE) + " " + EditResId(RID_SVXITEMS_LINES);
494 break;
495 }
496
497 default:
498 {
499 SAL_WARN( "editeng.items", "SvxWidowsItem::GetPresentation(): unknown SfxItemPresentation" );
500 }
501 }
502
503 rText = rText.replaceFirst( "%1", OUString::number( GetValue() ) );
504 return true;
505}
506
507// class SvxOrphansItem --------------------------------------------------
508
509SvxOrphansItem::SvxOrphansItem(const sal_uInt8 nL, const sal_uInt16 nId ) :
510 SfxByteItem( nId, nL )
511{
512}
513
515{
516 return new SvxOrphansItem( *this );
517}
518
520(
522 MapUnit /*eCoreUnit*/,
523 MapUnit /*ePresUnit*/,
524 OUString& rText, const IntlWrapper&
525) const
526{
527 switch ( ePres )
528 {
529 case SfxItemPresentation::Nameless:
530 {
531 rText = EditResId(RID_SVXITEMS_LINES);
532 break;
533 }
534
535 case SfxItemPresentation::Complete:
536 {
537 rText = EditResId(RID_SVXITEMS_ORPHANS_COMPLETE) + " " + EditResId(RID_SVXITEMS_LINES);
538 break;
539 }
540
541 default:
542 {
543 SAL_WARN( "editeng.items", "SvxOrphansItem::GetPresentation(): unknown SfxItemPresentation" );
544 }
545 }
546
547 rText = rText.replaceFirst( "%1", OUString::number( GetValue() ) );
548 return true;
549}
550
551// class SvxHyphenZoneItem -----------------------------------------------
552
553SvxHyphenZoneItem::SvxHyphenZoneItem( const bool bHyph, const sal_uInt16 nId ) :
554 SfxPoolItem( nId ),
555 bHyphen(bHyph),
556 bPageEnd(true),
557 bNoCapsHyphenation(false),
558 bNoLastWordHyphenation(false),
559 nMinLead(0),
560 nMinTrail(0),
561 nMaxHyphens(255),
562 nMinWordLength(0),
563 nTextHyphenZone(0)
564{
565}
566
567
569{
570 nMemberId &= ~CONVERT_TWIPS;
571 switch(nMemberId)
572 {
573 case MID_IS_HYPHEN:
574 rVal <<= bHyphen;
575 break;
577 rVal <<= static_cast<sal_Int16>(nMinLead);
578 break;
580 rVal <<= static_cast<sal_Int16>(nMinTrail);
581 break;
583 rVal <<= static_cast<sal_Int16>(nMaxHyphens);
584 break;
586 rVal <<= bNoCapsHyphenation;
587 break;
589 rVal <<= bNoLastWordHyphenation;
590 break;
592 rVal <<= static_cast<sal_Int16>(nMinWordLength);
593 break;
594 case MID_HYPHEN_ZONE:
595 rVal <<= static_cast<sal_Int16>(nTextHyphenZone);
596 break;
597 }
598 return true;
599}
600
601bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
602{
603 nMemberId &= ~CONVERT_TWIPS;
604 sal_Int16 nNewVal = 0;
605
606 if( nMemberId != MID_IS_HYPHEN && nMemberId != MID_HYPHEN_NO_CAPS &&
607 nMemberId != MID_HYPHEN_NO_LAST_WORD )
608 {
609 if(!(rVal >>= nNewVal))
610 return false;
611 }
612
613 switch(nMemberId)
614 {
615 case MID_IS_HYPHEN:
616 bHyphen = Any2Bool(rVal);
617 break;
619 nMinLead = static_cast<sal_uInt8>(nNewVal);
620 break;
622 nMinTrail = static_cast<sal_uInt8>(nNewVal);
623 break;
625 nMaxHyphens = static_cast<sal_uInt8>(nNewVal);
626 break;
629 break;
632 break;
634 nMinWordLength = static_cast<sal_uInt8>(nNewVal);
635 break;
636 case MID_HYPHEN_ZONE:
637 nTextHyphenZone = nNewVal;
638 break;
639 }
640 return true;
641}
642
643
645{
646 assert(SfxPoolItem::operator==(rAttr));
647
648 const SvxHyphenZoneItem& rItem = static_cast<const SvxHyphenZoneItem&>(rAttr);
649 return ( rItem.bHyphen == bHyphen
652 && rItem.bPageEnd == bPageEnd
653 && rItem.nMinLead == nMinLead
654 && rItem.nMinTrail == nMinTrail
655 && rItem.nMaxHyphens == nMaxHyphens
657 && rItem.nTextHyphenZone == nTextHyphenZone );
658}
659
661{
662 return new SvxHyphenZoneItem( *this );
663}
664
666(
668 MapUnit eCoreUnit,
669 MapUnit ePresUnit,
670 OUString& rText, const IntlWrapper& rIntl
671) const
672{
673 OUString cpDelimTmp(cpDelim);
674 switch ( ePres )
675 {
676 case SfxItemPresentation::Nameless:
677 {
678 TranslateId pId = RID_SVXITEMS_HYPHEN_FALSE;
679
680 if ( bHyphen )
681 pId = RID_SVXITEMS_HYPHEN_TRUE;
682 rText = EditResId(pId) + cpDelimTmp;
683 pId = RID_SVXITEMS_PAGE_END_FALSE;
684
685 if ( bPageEnd )
686 pId = RID_SVXITEMS_PAGE_END_TRUE;
687 rText += EditResId(pId) + cpDelimTmp +
688 OUString::number( nMinLead ) + cpDelimTmp +
689 OUString::number( nMinTrail ) + cpDelimTmp +
690 OUString::number( nMaxHyphens ) + cpDelimTmp +
691 OUString::number( nMinWordLength ) + cpDelimTmp +
692 GetMetricText( nTextHyphenZone, eCoreUnit, ePresUnit, &rIntl ) +
693 " " + EditResId(GetMetricId(ePresUnit));
694
695 if ( bNoCapsHyphenation )
696 rText += cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_NO_CAPS_TRUE);
697
699 rText += cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_LAST_WORD_TRUE);
700
701 return true;
702 }
703 case SfxItemPresentation::Complete:
704 {
705 TranslateId pId = RID_SVXITEMS_HYPHEN_FALSE;
706
707 if ( bHyphen )
708 pId = RID_SVXITEMS_HYPHEN_TRUE;
709 rText = EditResId(pId) + cpDelimTmp;
710 pId = RID_SVXITEMS_PAGE_END_FALSE;
711
712 if ( bPageEnd )
713 pId = RID_SVXITEMS_PAGE_END_TRUE;
714 rText += EditResId(pId) +
715 cpDelimTmp +
716 EditResId(RID_SVXITEMS_HYPHEN_MINLEAD).replaceAll("%1", OUString::number(nMinLead)) +
717 cpDelimTmp +
718 EditResId(RID_SVXITEMS_HYPHEN_MINTRAIL).replaceAll("%1", OUString::number(nMinTrail)) +
719 cpDelimTmp +
720 EditResId(RID_SVXITEMS_HYPHEN_MAX).replaceAll("%1", OUString::number(nMaxHyphens)) +
721 cpDelimTmp +
722 EditResId(RID_SVXITEMS_HYPHEN_MINWORDLEN).replaceAll("%1", OUString::number(nMinWordLength));
723
724 if ( nTextHyphenZone > 0 )
725 {
726 rText += cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_ZONE) +
727 GetMetricText( nTextHyphenZone, eCoreUnit, ePresUnit, &rIntl ) +
728 " " + EditResId(GetMetricId(ePresUnit));
729 }
730
731 if ( bNoCapsHyphenation )
732 rText += cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_NO_CAPS_TRUE);
733
735 rText += cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_LAST_WORD_TRUE);
736
737 return true;
738 }
739 default: ;//prevent warning
740 }
741 return false;
742}
743
744
745// class SvxTabStop ------------------------------------------------------
746
748{
749 nTabPos = 0;
753}
754
755
756SvxTabStop::SvxTabStop( const sal_Int32 nPos, const SvxTabAdjust eAdjst,
757 const sal_Unicode cDec, const sal_Unicode cFil )
758{
759 nTabPos = nPos;
760 eAdjustment = eAdjst;
761 m_cDecimal = cDec;
762 cFill = cFil;
763}
764
766{
769}
770
772{
773 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxTabStop"));
774 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nTabPos"),
775 BAD_CAST(OString::number(nTabPos).getStr()));
776 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eAdjustment"),
777 BAD_CAST(OString::number(static_cast<int>(eAdjustment)).getStr()));
778 (void)xmlTextWriterEndElement(pWriter);
779}
780
781// class SvxTabStopItem --------------------------------------------------
782
783SvxTabStopItem::SvxTabStopItem( sal_uInt16 _nWhich ) :
784 SfxPoolItem( _nWhich )
785{
786 const sal_uInt16 nTabs = SVX_TAB_DEFCOUNT, nDist = SVX_TAB_DEFDIST;
788
789 for (sal_uInt16 i = 0; i < nTabs; ++i)
790 {
791 SvxTabStop aTab( (i + 1) * nDist, eAdjst );
792 maTabStops.insert( aTab );
793 }
794}
795
796
797SvxTabStopItem::SvxTabStopItem( const sal_uInt16 nTabs,
798 const sal_uInt16 nDist,
799 const SvxTabAdjust eAdjst,
800 sal_uInt16 _nWhich ) :
801 SfxPoolItem( _nWhich )
802{
803 for ( sal_uInt16 i = 0; i < nTabs; ++i )
804 {
805 SvxTabStop aTab( (i + 1) * nDist, eAdjst );
806 maTabStops.insert( aTab );
807 }
808}
809
810
811sal_uInt16 SvxTabStopItem::GetPos( const SvxTabStop& rTab ) const
812{
814 return it != maTabStops.end() ? it - maTabStops.begin() : SVX_TAB_NOTFOUND;
815}
816
817
818sal_uInt16 SvxTabStopItem::GetPos( const sal_Int32 nPos ) const
819{
821 return it != maTabStops.end() ? it - maTabStops.begin() : SVX_TAB_NOTFOUND;
822}
823
824void SvxTabStopItem::SetDefaultDistance(sal_Int32 nDefaultDistance)
825{
826 mnDefaultDistance = nDefaultDistance;
827}
828
830{
831 return mnDefaultDistance;
832}
833
834bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
835{
836 bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
837 nMemberId &= ~CONVERT_TWIPS;
838 switch ( nMemberId )
839 {
840 case MID_TABSTOPS:
841 {
842 sal_uInt16 nCount = Count();
843 uno::Sequence< style::TabStop> aSeq(nCount);
844 style::TabStop* pArr = aSeq.getArray();
845 for(sal_uInt16 i = 0; i < nCount; i++)
846 {
847 const SvxTabStop& rTab = (*this)[i];
848 pArr[i].Position = bConvert ? convertTwipToMm100(rTab.GetTabPos()) : rTab.GetTabPos();
849 switch(rTab.GetAdjustment())
850 {
851 case SvxTabAdjust::Left : pArr[i].Alignment = style::TabAlign_LEFT; break;
852 case SvxTabAdjust::Right : pArr[i].Alignment = style::TabAlign_RIGHT; break;
853 case SvxTabAdjust::Decimal: pArr[i].Alignment = style::TabAlign_DECIMAL; break;
854 case SvxTabAdjust::Center : pArr[i].Alignment = style::TabAlign_CENTER; break;
855 default: //SvxTabAdjust::Default
856 pArr[i].Alignment = style::TabAlign_DEFAULT;
857
858 }
859 pArr[i].DecimalChar = rTab.GetDecimal();
860 pArr[i].FillChar = rTab.GetFill();
861 }
862 rVal <<= aSeq;
863 break;
864 }
865 case MID_STD_TAB:
866 {
867 const SvxTabStop &rTab = maTabStops.front();
868 rVal <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100(rTab.GetTabPos()) : rTab.GetTabPos());
869 break;
870 }
872 {
873 rVal <<= static_cast<sal_Int32>(bConvert ? convertTwipToMm100(mnDefaultDistance) : mnDefaultDistance);
874 break;
875 }
876 }
877 return true;
878}
879
880bool SvxTabStopItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
881{
882 bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
883 nMemberId &= ~CONVERT_TWIPS;
884 switch ( nMemberId )
885 {
886 case MID_TABSTOPS:
887 {
888 uno::Sequence< style::TabStop> aSeq;
889 if(!(rVal >>= aSeq))
890 {
891 uno::Sequence < uno::Sequence < uno::Any > > aAnySeq;
892 if (!(rVal >>= aAnySeq))
893 return false;
894 auto aAnySeqRange = asNonConstRange(aAnySeq);
895 sal_Int32 nLength = aAnySeq.getLength();
896 aSeq.realloc( nLength );
897 auto pSeq = aSeq.getArray();
898 for ( sal_Int32 n=0; n<nLength; n++ )
899 {
900 uno::Sequence < uno::Any >& rAnySeq = aAnySeqRange[n];
901 if ( rAnySeq.getLength() == 4 )
902 {
903 if (!(rAnySeq[0] >>= pSeq[n].Position)) return false;
904 if (!(rAnySeq[1] >>= pSeq[n].Alignment))
905 {
906 sal_Int32 nVal = 0;
907 if (rAnySeq[1] >>= nVal)
908 pSeq[n].Alignment = static_cast<css::style::TabAlign>(nVal);
909 else
910 return false;
911 }
912 if (!(rAnySeq[2] >>= pSeq[n].DecimalChar))
913 {
914 OUString aVal;
915 if ( (rAnySeq[2] >>= aVal) && aVal.getLength() == 1 )
916 pSeq[n].DecimalChar = aVal.toChar();
917 else
918 return false;
919 }
920 if (!(rAnySeq[3] >>= pSeq[n].FillChar))
921 {
922 OUString aVal;
923 if ( (rAnySeq[3] >>= aVal) && aVal.getLength() == 1 )
924 pSeq[n].FillChar = aVal.toChar();
925 else
926 return false;
927 }
928 }
929 else
930 return false;
931 }
932 }
933
935 const style::TabStop* pArr = aSeq.getConstArray();
936 const sal_uInt16 nCount = static_cast<sal_uInt16>(aSeq.getLength());
937 for(sal_uInt16 i = 0; i < nCount ; i++)
938 {
940 switch(pArr[i].Alignment)
941 {
942 case style::TabAlign_LEFT : eAdjust = SvxTabAdjust::Left; break;
943 case style::TabAlign_CENTER : eAdjust = SvxTabAdjust::Center; break;
944 case style::TabAlign_RIGHT : eAdjust = SvxTabAdjust::Right; break;
945 case style::TabAlign_DECIMAL: eAdjust = SvxTabAdjust::Decimal; break;
946 default: ;//prevent warning
947 }
948 sal_Unicode cFill = pArr[i].FillChar;
949 sal_Unicode cDecimal = pArr[i].DecimalChar;
950 SvxTabStop aTab( bConvert ? o3tl::toTwips(pArr[i].Position, o3tl::Length::mm100) : pArr[i].Position,
951 eAdjust,
952 cDecimal,
953 cFill );
954 Insert(aTab);
955 }
956 break;
957 }
958 case MID_STD_TAB:
959 {
960 sal_Int32 nNewPos = 0;
961 if (!(rVal >>= nNewPos) )
962 return false;
963 if (bConvert)
964 nNewPos = o3tl::toTwips(nNewPos, o3tl::Length::mm100);
965 if (nNewPos <= 0)
966 return false;
967 const SvxTabStop& rTab = maTabStops.front();
968 SvxTabStop aNewTab ( nNewPos, rTab.GetAdjustment(), rTab.GetDecimal(), rTab.GetFill() );
969 Remove( 0 );
970 Insert( aNewTab );
971 break;
972 }
974 {
975 sal_Int32 nNewDefaultDistance = 0;
976 if (!(rVal >>= nNewDefaultDistance))
977 return false;
978 if (bConvert)
979 nNewDefaultDistance = o3tl::toTwips(nNewDefaultDistance, o3tl::Length::mm100);
980 if (nNewDefaultDistance < 0)
981 return false;
982 mnDefaultDistance = nNewDefaultDistance;
983 break;
984 }
985 }
986 return true;
987}
988
989
990bool SvxTabStopItem::operator==( const SfxPoolItem& rAttr ) const
991{
992 assert(SfxPoolItem::operator==(rAttr));
993
994 const SvxTabStopItem& rTSI = static_cast<const SvxTabStopItem&>(rAttr);
995
997 return false;
998
999 if ( Count() != rTSI.Count() )
1000 return false;
1001
1002 for ( sal_uInt16 i = 0; i < Count(); ++i )
1003 if( (*this)[i] != rTSI[i] )
1004 return false;
1005 return true;
1006}
1007
1009{
1010 return new SvxTabStopItem( *this );
1011}
1012
1014(
1015 SfxItemPresentation ePres,
1016 MapUnit eCoreUnit,
1017 MapUnit ePresUnit,
1018 OUString& rText, const IntlWrapper& rIntl
1019) const
1020{
1021 rText.clear();
1022 // TODO also consider mnDefaultTabDistance here
1023
1024 bool bComma = false;
1025
1026 for ( sal_uInt16 i = 0; i < Count(); ++i )
1027 {
1028 if ( SvxTabAdjust::Default != ((*this)[i]).GetAdjustment() )
1029 {
1030 if ( bComma )
1031 rText += ",";
1032 rText += GetMetricText(
1033 ((*this)[i]).GetTabPos(), eCoreUnit, ePresUnit, &rIntl );
1034 if ( SfxItemPresentation::Complete == ePres )
1035 {
1036 rText += " " + EditResId(GetMetricId(ePresUnit));
1037 }
1038 bComma = true;
1039 }
1040 }
1041 return true;
1042}
1043
1044
1046{
1047 sal_uInt16 nTabPos = GetPos(rTab);
1048 if(SVX_TAB_NOTFOUND != nTabPos )
1049 Remove(nTabPos);
1050 return maTabStops.insert( rTab ).second;
1051}
1052
1054{
1055 for( sal_uInt16 i = 0; i < pTabs->Count(); i++ )
1056 {
1057 const SvxTabStop& rTab = (*pTabs)[i];
1058 sal_uInt16 nTabPos = GetPos(rTab);
1059 if(SVX_TAB_NOTFOUND != nTabPos)
1060 Remove(nTabPos);
1061 }
1062 for( sal_uInt16 i = 0; i < pTabs->Count(); i++ )
1063 {
1064 maTabStops.insert( (*pTabs)[i] );
1065 }
1066}
1067
1069{
1070 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxTabStopItem"));
1071 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("mnDefaultDistance"),
1072 BAD_CAST(OString::number(mnDefaultDistance).getStr()));
1073 for (const auto& rTabStop : maTabStops)
1074 rTabStop.dumpAsXml(pWriter);
1075 (void)xmlTextWriterEndElement(pWriter);
1076}
1077
1078// class SvxFormatSplitItem -------------------------------------------------
1080{
1081}
1082
1084{
1085 return new SvxFormatSplitItem( *this );
1086}
1087
1089(
1090 SfxItemPresentation /*ePres*/,
1091 MapUnit /*eCoreUnit*/,
1092 MapUnit /*ePresUnit*/,
1093 OUString& rText, const IntlWrapper&
1094) const
1095{
1096 TranslateId pId = RID_SVXITEMS_FMTSPLIT_FALSE;
1097
1098 if ( GetValue() )
1099 pId = RID_SVXITEMS_FMTSPLIT_TRUE;
1100 rText = EditResId(pId);
1101 return true;
1102}
1103
1105{
1106 return new SvxPageModelItem( *this );
1107}
1108
1109bool SvxPageModelItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
1110{
1111 nMemberId &= ~CONVERT_TWIPS;
1112
1113 switch ( nMemberId )
1114 {
1115 case MID_AUTO: rVal <<= bAuto; break;
1116 case MID_NAME: rVal <<= GetValue(); break;
1117 default: OSL_FAIL("Wrong MemberId!"); return false;
1118 }
1119
1120 return true;
1121}
1122
1123bool SvxPageModelItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
1124{
1125 nMemberId &= ~CONVERT_TWIPS;
1126 bool bRet;
1127 OUString aStr;
1128 switch ( nMemberId )
1129 {
1130 case MID_AUTO: bRet = ( rVal >>= bAuto ); break;
1131 case MID_NAME: bRet = ( rVal >>= aStr ); if ( bRet ) SetValue(aStr); break;
1132 default: OSL_FAIL("Wrong MemberId!"); return false;
1133 }
1134
1135 return bRet;
1136}
1137
1139{
1140 return SfxStringItem::operator==(rAttr) &&
1141 bAuto == static_cast<const SvxPageModelItem&>( rAttr ).bAuto;
1142}
1143
1145(
1146 SfxItemPresentation ePres,
1147 MapUnit /*eCoreUnit*/,
1148 MapUnit /*ePresUnit*/,
1149 OUString& rText, const IntlWrapper&
1150) const
1151{
1152 rText.clear();
1153 bool bSet = !GetValue().isEmpty();
1154
1155 switch ( ePres )
1156 {
1157 case SfxItemPresentation::Nameless:
1158 if ( bSet )
1159 rText = GetValue();
1160 return true;
1161
1162 case SfxItemPresentation::Complete:
1163 if ( bSet )
1164 {
1165 rText = EditResId(RID_SVXITEMS_PAGEMODEL_COMPLETE) + GetValue();
1166 }
1167 return true;
1168 default: ;//prevent warning
1169 }
1170 return false;
1171}
1172
1173
1174SvxScriptSpaceItem::SvxScriptSpaceItem( bool bOn, const sal_uInt16 nId )
1175 : SfxBoolItem( nId, bOn )
1176{
1177}
1178
1180{
1181 return new SvxScriptSpaceItem( *this );
1182}
1183
1185 SfxItemPresentation /*ePres*/,
1186 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
1187 OUString &rText, const IntlWrapper& /*rIntl*/ ) const
1188{
1189 rText = EditResId( !GetValue()
1190 ? RID_SVXITEMS_SCRPTSPC_OFF
1191 : RID_SVXITEMS_SCRPTSPC_ON );
1192 return true;
1193}
1194
1195
1197 bool bOn, const sal_uInt16 nId )
1198 : SfxBoolItem( nId, bOn )
1199{
1200}
1201
1203{
1204 return new SvxHangingPunctuationItem( *this );
1205}
1206
1208 SfxItemPresentation /*ePres*/,
1209 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
1210 OUString &rText, const IntlWrapper& /*rIntl*/ ) const
1211{
1212 rText = EditResId( !GetValue()
1213 ? RID_SVXITEMS_HNGPNCT_OFF
1214 : RID_SVXITEMS_HNGPNCT_ON );
1215 return true;
1216}
1217
1218
1220 bool bOn, const sal_uInt16 nId )
1221 : SfxBoolItem( nId, bOn )
1222{
1223}
1224
1226{
1227 return new SvxForbiddenRuleItem( *this );
1228}
1229
1231 SfxItemPresentation /*ePres*/,
1232 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
1233 OUString &rText, const IntlWrapper& /*rIntl*/ ) const
1234{
1235 rText = EditResId( !GetValue()
1236 ? RID_SVXITEMS_FORBIDDEN_RULE_OFF
1237 : RID_SVXITEMS_FORBIDDEN_RULE_ON );
1238 return true;
1239}
1240
1241/*************************************************************************
1242|* class SvxParaVertAlignItem
1243*************************************************************************/
1244
1247 : SfxUInt16Item( nW, static_cast<sal_uInt16>(nValue) )
1248{
1249}
1250
1252{
1253 return new SvxParaVertAlignItem( *this );
1254}
1255
1257 SfxItemPresentation /*ePres*/,
1258 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
1259 OUString &rText, const IntlWrapper& ) const
1260{
1261 TranslateId pTmp;
1262 switch( GetValue() )
1263 {
1264 case Align::Automatic: pTmp = RID_SVXITEMS_PARAVERTALIGN_AUTO; break;
1265 case Align::Top: pTmp = RID_SVXITEMS_PARAVERTALIGN_TOP; break;
1266 case Align::Center: pTmp = RID_SVXITEMS_PARAVERTALIGN_CENTER; break;
1267 case Align::Bottom: pTmp = RID_SVXITEMS_PARAVERTALIGN_BOTTOM; break;
1268 default: pTmp = RID_SVXITEMS_PARAVERTALIGN_BASELINE; break;
1269 }
1270 rText = EditResId(pTmp);
1271 return true;
1272}
1273
1274bool SvxParaVertAlignItem::QueryValue( css::uno::Any& rVal,
1275 sal_uInt8 /*nMemberId*/ ) const
1276{
1277 rVal <<= static_cast<sal_Int16>(GetValue());
1278 return true;
1279}
1280
1281bool SvxParaVertAlignItem::PutValue( const css::uno::Any& rVal,
1282 sal_uInt8 /*nMemberId*/ )
1283{
1284 sal_Int16 nVal = sal_Int16();
1285 if((rVal >>= nVal) && nVal >=0 && nVal <= sal_uInt16(Align::Bottom) )
1286 {
1287 SetValue( static_cast<Align>(nVal) );
1288 return true;
1289 }
1290 else
1291 return false;
1292}
1293
1294SvxParaGridItem::SvxParaGridItem( bool bOn, const sal_uInt16 nId )
1295 : SfxBoolItem( nId, bOn )
1296{
1297}
1298
1300{
1301 return new SvxParaGridItem( *this );
1302}
1303
1305 SfxItemPresentation /*ePres*/,
1306 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
1307 OUString &rText, const IntlWrapper& /*rIntl*/ ) const
1308{
1309 rText = GetValue() ?
1310 EditResId( RID_SVXITEMS_PARASNAPTOGRID_ON ) :
1311 EditResId( RID_SVXITEMS_PARASNAPTOGRID_OFF );
1312
1313 return true;
1314}
1315
1316
1317/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _ADOUser User
constexpr auto convertTwipToMm100(N n)
sal_uInt8 GetValue() const
const OUString & GetValue() const
virtual bool operator==(const SfxPoolItem &rItem) const override
void SetValue(const OUString &rTheValue)
const OUString & getNumDecimalSep() const
bool GetValue() const
const LocaleDataWrapper & GetLocaleData() const
virtual sal_uInt16 GetValueCount() const override
Definition: paraitem.cxx:431
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: paraitem.cxx:360
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: paraitem.cxx:377
SvxAdjust GetLastBlock() const
Definition: adjustitem.hxx:88
virtual bool operator==(const SfxPoolItem &) const override
Definition: paraitem.cxx:349
SvxAdjust GetAdjust() const
Definition: adjustitem.hxx:108
SvxAdjustItem(const SvxAdjust eAdjst, const sal_uInt16 nId)
Definition: paraitem.cxx:341
void SetAdjust(const SvxAdjust eType)
Definition: adjustitem.hxx:80
static SfxPoolItem * CreateDefault()
Definition: paraitem.cxx:57
virtual SvxAdjustItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:406
void SetLastBlock(const SvxAdjust eType)
Definition: adjustitem.hxx:74
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:412
virtual void SetEnumValue(sal_uInt16 nNewVal) override
Definition: paraitem.cxx:457
static OUString GetValueTextByPos(sal_uInt16 nPos)
Definition: paraitem.cxx:436
virtual sal_uInt16 GetEnumValue() const override
Definition: paraitem.cxx:451
SvxForbiddenRuleItem(bool bOn, const sal_uInt16 nId)
Definition: paraitem.cxx:1219
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:1230
virtual SvxForbiddenRuleItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:1225
SvxFormatSplitItem(const bool bSplit, const sal_uInt16 nWh)
Definition: spltitem.hxx:55
virtual ~SvxFormatSplitItem() override
Definition: paraitem.cxx:1079
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:1089
static SfxPoolItem * CreateDefault()
Definition: paraitem.cxx:62
virtual SvxFormatSplitItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:1083
SvxHangingPunctuationItem(bool bOn, const sal_uInt16 nId)
Definition: paraitem.cxx:1196
virtual SvxHangingPunctuationItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:1202
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:1207
virtual SvxHyphenZoneItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:660
static SfxPoolItem * CreateDefault()
Definition: paraitem.cxx:60
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:666
SvxHyphenZoneItem(const bool bHyph, const sal_uInt16 nId)
Definition: paraitem.cxx:553
sal_uInt8 nMinWordLength
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: paraitem.cxx:568
virtual bool operator==(const SfxPoolItem &) const override
Definition: paraitem.cxx:644
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: paraitem.cxx:601
sal_uInt16 nTextHyphenZone
SvxLineSpacingItem(sal_uInt16 nLineHeight, const sal_uInt16 nId)
Definition: paraitem.cxx:79
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: paraitem.cxx:116
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:227
sal_uInt16 nLineHeight
Definition: lspcitem.hxx:37
static SfxPoolItem * CreateDefault()
Definition: paraitem.cxx:56
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: paraitem.cxx:161
SvxInterLineSpaceRule eInterLineSpaceRule
Definition: lspcitem.hxx:40
sal_uInt16 nPropLineSpace
Definition: lspcitem.hxx:38
virtual void SetEnumValue(sal_uInt16 nNewVal) override
Definition: paraitem.cxx:328
sal_uInt16 GetPropLineSpace() const
Definition: lspcitem.hxx:81
virtual SvxLineSpacingItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:221
SvxInterLineSpaceRule GetInterLineSpaceRule() const
Definition: lspcitem.hxx:92
SvxLineSpaceRule GetLineSpaceRule() const
Definition: lspcitem.hxx:89
SvxLineSpaceRule eLineSpaceRule
Definition: lspcitem.hxx:39
sal_uInt16 GetLineHeight() const
Definition: lspcitem.hxx:73
virtual sal_uInt16 GetValueCount() const override
Definition: paraitem.cxx:308
virtual bool operator==(const SfxPoolItem &) const override
Definition: paraitem.cxx:90
short GetInterLineSpace() const
Definition: lspcitem.hxx:65
virtual sal_uInt16 GetEnumValue() const override
Definition: paraitem.cxx:314
An orphan line is a paragraph-starting line that is still on the previous page or column (has future,...
Definition: orphitem.hxx:30
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:520
virtual SvxOrphansItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:514
static SfxPoolItem * CreateDefault()
Definition: paraitem.cxx:59
SvxOrphansItem(const sal_uInt8 nL, const sal_uInt16 nId)
Definition: paraitem.cxx:509
static SfxPoolItem * CreateDefault()
Definition: paraitem.cxx:63
virtual bool operator==(const SfxPoolItem &) const override
Definition: paraitem.cxx:1138
SvxPageModelItem(TypedWhichId< SvxPageModelItem > nWh)
Definition: pmdlitem.hxx:56
virtual SvxPageModelItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:1104
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: paraitem.cxx:1109
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: paraitem.cxx:1123
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:1145
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:1304
SvxParaGridItem(const bool bSnapToGrid, const sal_uInt16 nId)
Definition: paraitem.cxx:1294
virtual SvxParaGridItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:1299
static SfxPoolItem * CreateDefault()
Definition: paraitem.cxx:64
SvxParaVertAlignItem(Align nValue, TypedWhichId< SvxParaVertAlignItem > nId)
Definition: paraitem.cxx:1245
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: paraitem.cxx:1274
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:1256
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: paraitem.cxx:1281
virtual SvxParaVertAlignItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:1251
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:1184
virtual SvxScriptSpaceItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:1179
SvxScriptSpaceItem(bool bOn, const sal_uInt16 nId)
Definition: paraitem.cxx:1174
sal_uInt16 Count() const
Definition: tstpitem.hxx:116
sal_Int32 mnDefaultDistance
Defines default tab width for tabs without dedicated tab stop in the paragraph.
Definition: tstpitem.hxx:96
static SfxPoolItem * CreateDefault()
Definition: paraitem.cxx:61
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: paraitem.cxx:834
virtual bool operator==(const SfxPoolItem &) const override
Definition: paraitem.cxx:990
void SetDefaultDistance(sal_Int32 nDefaultDistancenDefTabSize)
Definition: paraitem.cxx:824
void Remove(const sal_uInt16 nPos, const sal_uInt16 nLen=1)
Definition: tstpitem.hxx:119
virtual SvxTabStopItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:1008
bool Insert(const SvxTabStop &rTab)
Definition: paraitem.cxx:1045
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: paraitem.cxx:1068
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:1014
sal_Int32 GetDefaultDistance() const
Definition: paraitem.cxx:829
sal_uInt16 GetPos(const SvxTabStop &rTab) const
Definition: paraitem.cxx:811
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: paraitem.cxx:880
SvxTabStopItem(sal_uInt16 nWhich)
Definition: paraitem.cxx:783
SvxTabStopArr maTabStops
Definition: tstpitem.hxx:94
sal_Unicode & GetFill()
Definition: tstpitem.hxx:62
sal_Unicode m_cDecimal
Definition: tstpitem.hxx:41
void fillDecimal() const
Definition: paraitem.cxx:765
sal_Int32 & GetTabPos()
Definition: tstpitem.hxx:53
sal_Unicode & GetDecimal()
Definition: tstpitem.hxx:59
sal_Unicode cFill
Definition: tstpitem.hxx:42
SvxTabAdjust eAdjustment
Definition: tstpitem.hxx:39
SvxTabAdjust & GetAdjustment()
Definition: tstpitem.hxx:56
sal_Int32 nTabPos
Definition: tstpitem.hxx:38
void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: paraitem.cxx:771
A widow line is a paragraph-ending line that goes to the following page or column (has past,...
Definition: widwitem.hxx:30
SvxWidowsItem(const sal_uInt8 nL, const sal_uInt16 nId)
Definition: paraitem.cxx:465
static SfxPoolItem * CreateDefault()
Definition: paraitem.cxx:58
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: paraitem.cxx:476
virtual SvxWidowsItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: paraitem.cxx:470
const_iterator begin() const
std::vector< Value >::const_iterator const_iterator
const_iterator find(const Value &x) const
const_iterator end() const
const Value & front() const
std::pair< const_iterator, bool > insert(Value &&x)
int nCount
OUString EditResId(TranslateId aId)
Definition: eerdll.cxx:192
struct _xmlTextWriter * xmlTextWriterPtr
sal_Int16 nValue
OUString GetMetricText(tools::Long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const IntlWrapper *pIntl)
Definition: itemtype.cxx:32
TranslateId GetMetricId(MapUnit eUnit)
Definition: itemtype.cxx:191
constexpr OUStringLiteral cpDelim
Definition: itemtype.hxx:33
sal_Int64 n
sal_uInt16 nPos
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
#define LINE_SPACE_DEFAULT_HEIGHT
Definition: lspcitem.hxx:33
#define SAL_N_ELEMENTS(arr)
MapUnit
#define MID_HEIGHT
#define MID_LINESPACE
Definition: memberids.h:31
#define MID_HYPHEN_MIN_WORD_LENGTH
Definition: memberids.h:52
#define MID_PARA_ADJUST
Definition: memberids.h:61
#define MID_TABSTOPS
Definition: memberids.h:41
#define MID_HYPHEN_ZONE
Definition: memberids.h:53
#define MID_EXPAND_SINGLE
Definition: memberids.h:63
#define MID_STD_TAB
Definition: memberids.h:42
#define MID_AUTO
Definition: memberids.h:38
#define MID_LAST_LINE_ADJUST
Definition: memberids.h:62
#define MID_HYPHEN_MIN_LEAD
Definition: memberids.h:47
#define MID_HYPHEN_MAX_HYPHENS
Definition: memberids.h:49
#define MID_HYPHEN_NO_CAPS
Definition: memberids.h:50
#define MID_NAME
Definition: memberids.h:35
#define MID_IS_HYPHEN
Definition: memberids.h:46
#define MID_TABSTOP_DEFAULT_DISTANCE
Definition: memberids.h:43
#define MID_HYPHEN_MIN_TRAIL
Definition: memberids.h:48
#define MID_HYPHEN_NO_LAST_WORD
Definition: memberids.h:51
aStr
int i
constexpr auto toTwips(N number, Length from)
sal_Int16 nId
SfxItemPresentation
#define CONVERT_TWIPS
bool Any2Bool(const css::uno::Any &rValue)
SvxInterLineSpaceRule
Definition: svxenum.hxx:70
SvxTabAdjust
Definition: svxenum.hxx:53
SvxAdjust
Definition: svxenum.hxx:77
#define SVX_TAB_NOTFOUND
Definition: tstpitem.hxx:31
#define cDfltFillChar
Definition: tstpitem.hxx:33
#define SVX_TAB_DEFDIST
Definition: tstpitem.hxx:30
#define SVX_TAB_DEFCOUNT
Definition: tstpitem.hxx:29
#define cDfltDecimalChar
Definition: tstpitem.hxx:32
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
sal_Int32 nLength