LibreOffice Module editeng (master) 1
textitem.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/CaseMap.hpp>
21#include <com/sun/star/awt/FontDescriptor.hpp>
22#include <com/sun/star/frame/status/FontHeight.hpp>
23#include <math.h>
24#include <sal/log.hxx>
25#include <o3tl/safeint.hxx>
26#include <osl/diagnose.h>
27#include <unotools/fontdefs.hxx>
30#include <utility>
31#include <vcl/outdev.hxx>
32#include <vcl/unohelp.hxx>
33#include <svtools/unitconv.hxx>
34
35#include <editeng/editids.hrc>
36#include <editeng/editrids.hrc>
37#include <tools/bigint.hxx>
38#include <tools/mapunit.hxx>
40
41#include <rtl/math.hxx>
42#include <rtl/ustring.hxx>
44#include <svl/itemset.hxx>
45
46#include <svtools/langtab.hxx>
47#include <svl/itempool.hxx>
48#include <svtools/ctrltool.hxx>
49#include <com/sun/star/awt/FontSlant.hpp>
50#include <com/sun/star/lang/Locale.hpp>
51#include <com/sun/star/text/FontEmphasis.hpp>
52#include <editeng/rsiditem.hxx>
53#include <editeng/memberids.h>
54#include <editeng/flstitem.hxx>
55#include <editeng/fontitem.hxx>
56#include <editeng/postitem.hxx>
57#include <editeng/wghtitem.hxx>
58#include <editeng/fhgtitem.hxx>
59#include <editeng/udlnitem.hxx>
61#include <editeng/shdditem.hxx>
63#include <editeng/wrlmitem.hxx>
65#include <editeng/colritem.hxx>
66#include <editeng/kernitem.hxx>
67#include <editeng/cmapitem.hxx>
69#include <editeng/langitem.hxx>
70#include <editeng/nhypitem.hxx>
71#include <editeng/blinkitem.hxx>
78#include <editeng/itemtype.hxx>
79#include <editeng/eerdll.hxx>
83#include <libxml/xmlwriter.h>
84
85using namespace ::com::sun::star;
86using namespace ::com::sun::star::text;
87
108
109
110// class SvxFontListItem -------------------------------------------------
111
113 const sal_uInt16 nId ) :
114 SfxPoolItem( nId ),
115 pFontList( pFontLst )
116{
117 if ( pFontList )
118 {
119 sal_Int32 nCount = pFontList->GetFontNameCount();
120 aFontNameSeq.realloc( nCount );
121 auto pFontNameSeq = aFontNameSeq.getArray();
122
123 for ( sal_Int32 i = 0; i < nCount; i++ )
124 pFontNameSeq[i] = pFontList->GetFontName(i).GetFamilyName();
125 }
126}
127
129{
130 return new SvxFontListItem( *this );
131}
132
133bool SvxFontListItem::operator==( const SfxPoolItem& rAttr ) const
134{
135 assert(SfxPoolItem::operator==(rAttr));
136
137 return( pFontList == static_cast<const SvxFontListItem&>(rAttr).pFontList );
138}
139
140bool SvxFontListItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
141{
142 rVal <<= aFontNameSeq;
143 return true;
144}
145
146
148(
149 SfxItemPresentation /*ePres*/,
150 MapUnit /*eCoreUnit*/,
151 MapUnit /*ePresUnit*/,
152 OUString& rText, const IntlWrapper& /*rIntl*/
153) const
154{
155 rText.clear();
156 return false;
157}
158
159// class SvxFontItem -----------------------------------------------------
160
161namespace
162{
163sal_Int32 CompareTo(sal_Int32 nA, sal_Int32 nB)
164{
165 if (nA < nB)
166 {
167 return -1;
168 }
169
170 if (nA > nB)
171 {
172 return 1;
173 }
174
175 return 0;
176}
177}
178
179SvxFontItem::SvxFontItem( const sal_uInt16 nId ) :
181{
184 eTextEncoding = RTL_TEXTENCODING_DONTKNOW;
185}
186
187
188SvxFontItem::SvxFontItem( const FontFamily eFam, OUString aName,
189 OUString aStName, const FontPitch eFontPitch,
190 const rtl_TextEncoding eFontTextEncoding, const sal_uInt16 nId ) :
191
192 SfxPoolItem( nId ),
193
194 aFamilyName(std::move(aName)),
195 aStyleName(std::move(aStName))
196{
197 eFamily = eFam;
198 ePitch = eFontPitch;
199 eTextEncoding = eFontTextEncoding;
200}
201
202
203bool SvxFontItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
204{
205 nMemberId &= ~CONVERT_TWIPS;
206 switch(nMemberId)
207 {
208 case 0:
209 {
210 css::awt::FontDescriptor aFontDescriptor;
211 aFontDescriptor.Name = aFamilyName;
212 aFontDescriptor.StyleName = aStyleName;
213 aFontDescriptor.Family = static_cast<sal_Int16>(eFamily);
214 aFontDescriptor.CharSet = static_cast<sal_Int16>(eTextEncoding);
215 aFontDescriptor.Pitch = static_cast<sal_Int16>(ePitch);
216 rVal <<= aFontDescriptor;
217 }
218 break;
220 rVal <<= aFamilyName;
221 break;
223 rVal <<= aStyleName;
224 break;
225 case MID_FONT_FAMILY : rVal <<= static_cast<sal_Int16>(eFamily); break;
226 case MID_FONT_CHAR_SET : rVal <<= static_cast<sal_Int16>(eTextEncoding); break;
227 case MID_FONT_PITCH : rVal <<= static_cast<sal_Int16>(ePitch); break;
228 }
229 return true;
230}
231
232bool SvxFontItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId)
233{
234 nMemberId &= ~CONVERT_TWIPS;
235 switch(nMemberId)
236 {
237 case 0:
238 {
239 css::awt::FontDescriptor aFontDescriptor;
240 if ( !( rVal >>= aFontDescriptor ))
241 return false;
242
243 aFamilyName = aFontDescriptor.Name;
244 aStyleName = aFontDescriptor.StyleName;
245 eFamily = static_cast<FontFamily>(aFontDescriptor.Family);
246 eTextEncoding = static_cast<rtl_TextEncoding>(aFontDescriptor.CharSet);
247 ePitch = static_cast<FontPitch>(aFontDescriptor.Pitch);
248 }
249 break;
251 {
252 OUString aStr;
253 if(!(rVal >>= aStr))
254 return false;
256 }
257 break;
259 {
260 OUString aStr;
261 if(!(rVal >>= aStr))
262 return false;
264 }
265 break;
266 case MID_FONT_FAMILY :
267 {
268 sal_Int16 nFamily = sal_Int16();
269 if(!(rVal >>= nFamily))
270 return false;
271 eFamily = static_cast<FontFamily>(nFamily);
272 }
273 break;
274 case MID_FONT_CHAR_SET :
275 {
276 sal_Int16 nSet = sal_Int16();
277 if(!(rVal >>= nSet))
278 return false;
279 eTextEncoding = static_cast<rtl_TextEncoding>(nSet);
280 }
281 break;
282 case MID_FONT_PITCH :
283 {
284 sal_Int16 nPitch = sal_Int16();
285 if(!(rVal >>= nPitch))
286 return false;
287 ePitch = static_cast<FontPitch>(nPitch);
288 }
289 break;
290 }
291 return true;
292}
293
294
295bool SvxFontItem::operator==( const SfxPoolItem& rAttr ) const
296{
297 assert(SfxPoolItem::operator==(rAttr));
298
299 const SvxFontItem& rItem = static_cast<const SvxFontItem&>(rAttr);
300
301 bool bRet = ( eFamily == rItem.eFamily &&
302 aFamilyName == rItem.aFamilyName &&
303 aStyleName == rItem.aStyleName );
304
305 if ( bRet )
306 {
307 if ( ePitch != rItem.ePitch || eTextEncoding != rItem.eTextEncoding )
308 {
309 bRet = false;
310 SAL_INFO( "editeng.items", "FontItem::operator==(): only pitch or rtl_TextEncoding different ");
311 }
312 }
313 return bRet;
314}
315
316bool SvxFontItem::operator<(const SfxPoolItem& rCmp) const
317{
318 const auto& rOther = static_cast<const SvxFontItem&>(rCmp);
319 sal_Int32 nRet = GetFamilyName().compareTo(rOther.GetFamilyName());
320 if (nRet != 0)
321 {
322 return nRet < 0;
323 }
324
325 nRet = GetStyleName().compareTo(rOther.GetStyleName());
326 if (nRet != 0)
327 {
328 return nRet < 0;
329 }
330
331 nRet = CompareTo(GetFamily(), rOther.GetFamily());
332 if (nRet != 0)
333 {
334 return nRet < 0;
335 }
336
337 nRet = CompareTo(GetPitch(), rOther.GetPitch());
338 if (nRet != 0)
339 {
340 return nRet < 0;
341 }
342
343 return GetCharSet() < rOther.GetCharSet();
344}
345
347{
348 return new SvxFontItem( *this );
349}
350
352(
353 SfxItemPresentation /*ePres*/,
354 MapUnit /*eCoreUnit*/,
355 MapUnit /*ePresUnit*/,
356 OUString& rText, const IntlWrapper& /*rIntl*/
357) const
358{
359 rText = aFamilyName;
360 return true;
361}
362
363
365{
366 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxFontItem"));
367 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
368 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("familyName"), BAD_CAST(aFamilyName.toUtf8().getStr()));
369 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("styleName"), BAD_CAST(aStyleName.toUtf8().getStr()));
370 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("family"), BAD_CAST(OString::number(eFamily).getStr()));
371 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("pitch"), BAD_CAST(OString::number(ePitch).getStr()));
372 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("textEncoding"), BAD_CAST(OString::number(eTextEncoding).getStr()));
373 (void)xmlTextWriterEndElement(pWriter);
374}
375
376// class SvxPostureItem --------------------------------------------------
377
378SvxPostureItem::SvxPostureItem( const FontItalic ePosture, const sal_uInt16 nId ) :
379 SfxEnumItem( nId, ePosture )
380{
381}
382
384{
385 return new SvxPostureItem( *this );
386}
387
389{
390 return ITALIC_NORMAL + 1; // ITALIC_NONE also belongs here
391}
392
393
395(
396 SfxItemPresentation /*ePres*/,
397 MapUnit /*eCoreUnit*/,
398 MapUnit /*ePresUnit*/,
399 OUString& rText, const IntlWrapper& /*rIntl*/
400) const
401{
402 rText = GetValueTextByPos( GetValue() );
403 return true;
404}
405
406
407OUString SvxPostureItem::GetValueTextByPos( sal_uInt16 nPos )
408{
409 DBG_ASSERT( nPos <= sal_uInt16(ITALIC_NORMAL), "enum overflow!" );
410
411 FontItalic eItalic = static_cast<FontItalic>(nPos);
412 TranslateId pId;
413
414 switch ( eItalic )
415 {
416 case ITALIC_NONE: pId = RID_SVXITEMS_ITALIC_NONE; break;
417 case ITALIC_OBLIQUE: pId = RID_SVXITEMS_ITALIC_OBLIQUE; break;
418 case ITALIC_NORMAL: pId = RID_SVXITEMS_ITALIC_NORMAL; break;
419 default: ;//prevent warning
420 }
421
422 return pId ? EditResId(pId) : OUString();
423}
424
425bool SvxPostureItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
426{
427 nMemberId &= ~CONVERT_TWIPS;
428 switch( nMemberId )
429 {
430 case MID_ITALIC:
431 rVal <<= GetBoolValue();
432 break;
433 case MID_POSTURE:
435 break;
436 }
437 return true;
438}
439
440bool SvxPostureItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
441{
442 nMemberId &= ~CONVERT_TWIPS;
443 switch( nMemberId )
444 {
445 case MID_ITALIC:
446 SetBoolValue(Any2Bool(rVal));
447 break;
448 case MID_POSTURE:
449 {
450 awt::FontSlant eSlant;
451 if(!(rVal >>= eSlant))
452 {
453 sal_Int32 nValue = 0;
454 if(!(rVal >>= nValue))
455 return false;
456
457 eSlant = static_cast<awt::FontSlant>(nValue);
458 }
460 }
461 }
462 return true;
463}
464
466{
467 return true;
468}
469
471{
472 return ( GetValue() >= ITALIC_OBLIQUE );
473}
474
476{
478}
479
481{
482 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxPostureItem"));
483 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which());
484 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("value"), "%d", GetValue());
485 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(GetValueTextByPos(GetValue()).toUtf8().getStr()));
486 (void)xmlTextWriterEndElement(pWriter);
487}
488
489// class SvxWeightItem ---------------------------------------------------
490
491SvxWeightItem::SvxWeightItem( const FontWeight eWght, const sal_uInt16 nId ) :
492 SfxEnumItem( nId, eWght )
493{
494}
495
496
498{
499 return true;
500}
501
502
504{
505 return GetValue() >= WEIGHT_BOLD;
506}
507
508
510{
512}
513
514
516{
517 return WEIGHT_BLACK; // WEIGHT_DONTKNOW does not belong
518}
519
521{
522 return new SvxWeightItem( *this );
523}
524
526(
527 SfxItemPresentation /*ePres*/,
528 MapUnit /*eCoreUnit*/,
529 MapUnit /*ePresUnit*/,
530 OUString& rText, const IntlWrapper& /*rIntl*/
531) const
532{
533 rText = GetValueTextByPos( GetValue() );
534 return true;
535}
536
537OUString SvxWeightItem::GetValueTextByPos( sal_uInt16 nPos )
538{
539 static TranslateId RID_SVXITEMS_WEIGHTS[] =
540 {
541 RID_SVXITEMS_WEIGHT_DONTKNOW,
542 RID_SVXITEMS_WEIGHT_THIN,
543 RID_SVXITEMS_WEIGHT_ULTRALIGHT,
544 RID_SVXITEMS_WEIGHT_LIGHT,
545 RID_SVXITEMS_WEIGHT_SEMILIGHT,
546 RID_SVXITEMS_WEIGHT_NORMAL,
547 RID_SVXITEMS_WEIGHT_MEDIUM,
548 RID_SVXITEMS_WEIGHT_SEMIBOLD,
549 RID_SVXITEMS_WEIGHT_BOLD,
550 RID_SVXITEMS_WEIGHT_ULTRABOLD,
551 RID_SVXITEMS_WEIGHT_BLACK
552 };
553
554 static_assert(SAL_N_ELEMENTS(RID_SVXITEMS_WEIGHTS) - 1 == WEIGHT_BLACK, "must match");
555 assert(nPos <= sal_uInt16(WEIGHT_BLACK) && "enum overflow!" );
556 return EditResId(RID_SVXITEMS_WEIGHTS[nPos]);
557}
558
559bool SvxWeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
560{
561 nMemberId &= ~CONVERT_TWIPS;
562 switch( nMemberId )
563 {
564 case MID_BOLD :
565 rVal <<= GetBoolValue();
566 break;
567 case MID_WEIGHT:
568 {
570 }
571 break;
572 }
573 return true;
574}
575
576bool SvxWeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
577{
578 nMemberId &= ~CONVERT_TWIPS;
579 switch( nMemberId )
580 {
581 case MID_BOLD :
582 SetBoolValue(Any2Bool(rVal));
583 break;
584 case MID_WEIGHT:
585 {
586 double fValue = 0;
587 if(!(rVal >>= fValue))
588 {
589 sal_Int32 nValue = 0;
590 if(!(rVal >>= nValue))
591 return false;
592 fValue = static_cast<float>(nValue);
593 }
594 SetValue( vcl::unohelper::ConvertFontWeight(static_cast<float>(fValue)) );
595 }
596 break;
597 }
598 return true;
599}
600
602{
603 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxWeightItem"));
604 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which());
605 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("value"), "%d", GetValue());
606 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(GetValueTextByPos(GetValue()).toUtf8().getStr()));
607 (void)xmlTextWriterEndElement(pWriter);
608}
609
610// class SvxFontHeightItem -----------------------------------------------
611
613 const sal_uInt16 nPrp,
614 const sal_uInt16 nId ) :
616{
617 SetHeight( nSz,nPrp ); // calculate in percentage
618}
619
621{
622 return new SvxFontHeightItem( *this );
623}
624
626{
627 assert(SfxPoolItem::operator==(rItem));
628 return GetHeight() == static_cast<const SvxFontHeightItem&>(rItem).GetHeight() &&
629 GetProp() == static_cast<const SvxFontHeightItem&>(rItem).GetProp() &&
630 GetPropUnit() == static_cast<const SvxFontHeightItem&>(rItem).GetPropUnit();
631}
632
634{
635 // In StarOne is the uno::Any always 1/100mm. Through the MemberId it is
636 // controlled if the value in the Item should be 1/100mm or Twips.
637
638 bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
639 nMemberId &= ~CONVERT_TWIPS;
640 switch( nMemberId )
641 {
642 case 0:
643 {
644 css::frame::status::FontHeight aFontHeight;
645
646 // Point (i.e. Twips) is asked for, thus re-calculate if
647 // CONVERT_TWIPS is not set.
648 if( bConvert )
649 {
650 aFontHeight.Height = o3tl::convert<double>(nHeight, o3tl::Length::twip, o3tl::Length::pt);
651 }
652 else
653 {
654 double fPoints = o3tl::convert<double>(nHeight, o3tl::Length::mm100, o3tl::Length::pt);
655 aFontHeight.Height = rtl::math::round(fPoints, 1);
656 }
657
658 aFontHeight.Prop = MapUnit::MapRelative == ePropUnit ? nProp : 100;
659
660 float fRet = nProp;
661 switch( ePropUnit )
662 {
663 case MapUnit::MapRelative:
664 fRet = 0.;
665 break;
666 case MapUnit::Map100thMM:
668 break;
669 case MapUnit::MapPoint:
670
671 break;
672 case MapUnit::MapTwip:
674 break;
675 default: ;//prevent warning
676 }
677 aFontHeight.Diff = fRet;
678 rVal <<= aFontHeight;
679 }
680 break;
681 case MID_FONTHEIGHT:
682 {
683 // Point (i.e. Twips) is asked for, thus re-calculate if
684 // CONVERT_TWIPS is not set.
685 if( bConvert )
686 {
687 rVal <<= static_cast<float>(o3tl::convert<double>(nHeight, o3tl::Length::twip, o3tl::Length::pt));
688 }
689 else
690 {
691 double fPoints = o3tl::convert<double>(nHeight, o3tl::Length::mm100, o3tl::Length::pt);
692 rVal <<= static_cast<float>(::rtl::math::round(fPoints, 1));
693 }
694 }
695 break;
697 rVal <<= static_cast<sal_Int16>(MapUnit::MapRelative == ePropUnit ? nProp : 100);
698 break;
700 {
701 float fRet = nProp;
702 switch( ePropUnit )
703 {
704 case MapUnit::MapRelative:
705 fRet = 0.;
706 break;
707 case MapUnit::Map100thMM:
709 break;
710 case MapUnit::MapPoint:
711
712 break;
713 case MapUnit::MapTwip:
715 break;
716 default: ;//prevent warning
717 }
718 rVal <<= fRet;
719 }
720 break;
721 }
722 return true;
723}
724
725// Try to reconstruct the original height input value from the modified height
726// and the prop data; this seems somewhat futile given the various ways how the
727// modified height is calculated (with and without conversion between twips and
728// 100th mm; with an additional eCoreMetric input in one of the SetHeight
729// overloads), and indeed known to occasionally produce nRet values that would
730// be negative, so just guard against negative results here and throw the hands
731// up in despair:
732static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, MapUnit eProp, bool bCoreInTwip)
733{
734 sal_uInt32 nRet = nHeight;
735 short nDiff = 0;
736 switch( eProp )
737 {
738 case MapUnit::MapRelative:
739 if (nProp)
740 {
741 nRet *= 100;
742 nRet /= nProp;
743 }
744 break;
745 case MapUnit::MapPoint:
746 {
747 short nTemp = static_cast<short>(nProp);
748 nDiff = nTemp * 20;
749 if(!bCoreInTwip)
750 nDiff = static_cast<short>(convertTwipToMm100(static_cast<tools::Long>(nDiff)));
751 break;
752 }
753 case MapUnit::Map100thMM:
754 //then the core is surely also in 1/100 mm
755 nDiff = static_cast<short>(nProp);
756 break;
757 case MapUnit::MapTwip:
758 // Here surely TWIP
759 nDiff = static_cast<short>(nProp);
760 break;
761 default:
762 break;
763 }
764 nRet = (nDiff < 0 || nRet >= o3tl::make_unsigned(nDiff))
765 ? nRet - nDiff : 0;
766 //TODO: overflow in case nDiff < 0 and nRet - nDiff > SAL_MAX_UINT32
767
768 return nRet;
769}
770
771bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
772{
773 bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
774 nMemberId &= ~CONVERT_TWIPS;
775 switch( nMemberId )
776 {
777 case 0:
778 {
779 css::frame::status::FontHeight aFontHeight;
780 if ( rVal >>= aFontHeight )
781 {
782 // Height
783 ePropUnit = MapUnit::MapRelative;
784 nProp = 100;
785 double fPoint = aFontHeight.Height;
786 if( fPoint < 0. || fPoint > 10000. )
787 return false;
788
789 nHeight = static_cast<tools::Long>( fPoint * 20.0 + 0.5 ); // Twips
790 if (!bConvert)
791 nHeight = convertTwipToMm100(nHeight); // Convert, if the item contains 1/100mm
792
793 nProp = aFontHeight.Prop;
794 }
795 else
796 return false;
797 }
798 break;
799 case MID_FONTHEIGHT:
800 {
801 ePropUnit = MapUnit::MapRelative;
802 nProp = 100;
803 double fPoint = 0;
804 if(!(rVal >>= fPoint))
805 {
806 sal_Int32 nValue = 0;
807 if(!(rVal >>= nValue))
808 return false;
809 fPoint = static_cast<float>(nValue);
810 }
811 if(fPoint < 0. || fPoint > 10000.)
812 return false;
813
814 nHeight = static_cast<tools::Long>( fPoint * 20.0 + 0.5 ); // Twips
815 if (!bConvert)
816 nHeight = convertTwipToMm100(nHeight); // Convert, if the item contains 1/100mm
817 }
818 break;
820 {
821 sal_Int16 nNew = sal_Int16();
822 if(!(rVal >>= nNew))
823 return true;
824
826
827 nHeight *= nNew;
828 nHeight /= 100;
829 nProp = nNew;
830 ePropUnit = MapUnit::MapRelative;
831 }
832 break;
834 {
836 float fValue = 0;
837 if(!(rVal >>= fValue))
838 {
839 sal_Int32 nValue = 0;
840 if(!(rVal >>= nValue))
841 return false;
842 fValue = static_cast<float>(nValue);
843 }
844 sal_Int16 nCoreDiffValue = static_cast<sal_Int16>(fValue * 20.);
845 nHeight += bConvert ? nCoreDiffValue : convertTwipToMm100(nCoreDiffValue);
846 nProp = static_cast<sal_uInt16>(static_cast<sal_Int16>(fValue));
847 ePropUnit = MapUnit::MapPoint;
848 }
849 break;
850 }
851 return true;
852}
853
854
856(
857 SfxItemPresentation /*ePres*/,
858 MapUnit eCoreUnit,
859 MapUnit /*ePresUnit*/,
860 OUString& rText, const IntlWrapper& rIntl
861) const
862{
863 if( MapUnit::MapRelative != ePropUnit )
864 {
865 rText = OUString::number( static_cast<short>(nProp) ) +
866 " " + EditResId( GetMetricId( ePropUnit ) );
867 if( 0 <= static_cast<short>(nProp) )
868 rText = "+" + rText;
869 }
870 else if( 100 == nProp )
871 {
872 rText = GetMetricText( static_cast<tools::Long>(nHeight),
873 eCoreUnit, MapUnit::MapPoint, &rIntl ) +
874 " " + EditResId(GetMetricId(MapUnit::MapPoint));
875 }
876 else
877 rText = OUString::number( nProp ) + "%";
878 return true;
879}
880
881
883{
884 nHeight = static_cast<sal_uInt32>(BigInt::Scale( nHeight, nMult, nDiv ));
885}
886
887
889{
890 return true;
891}
892
893void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, const sal_uInt16 nNewProp,
894 MapUnit eUnit )
895{
896 DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
897
898 if( MapUnit::MapRelative != eUnit )
899 nHeight = nNewHeight + ::ItemToControl( short(nNewProp), eUnit,
900 FieldUnit::TWIP );
901 else if( 100 != nNewProp )
902 nHeight = sal_uInt32(( nNewHeight * nNewProp ) / 100 );
903 else
904 nHeight = nNewHeight;
905
906 nProp = nNewProp;
907 ePropUnit = eUnit;
908}
909
910void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, sal_uInt16 nNewProp,
911 MapUnit eMetric, MapUnit eCoreMetric )
912{
913 DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" );
914
915 if( MapUnit::MapRelative != eMetric )
916 nHeight = nNewHeight +
917 ::ControlToItem( ::ItemToControl(static_cast<short>(nNewProp), eMetric,
918 FieldUnit::TWIP ), FieldUnit::TWIP,
919 eCoreMetric );
920 else if( 100 != nNewProp )
921 nHeight = sal_uInt32(( nNewHeight * nNewProp ) / 100 );
922 else
923 nHeight = nNewHeight;
924
925 nProp = nNewProp;
926 ePropUnit = eMetric;
927}
928
930{
931 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxFontHeightItem"));
932 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
933 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("height"), BAD_CAST(OString::number(nHeight).getStr()));
934 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("prop"), BAD_CAST(OString::number(nProp).getStr()));
935 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("propUnit"), BAD_CAST(OString::number(static_cast<int>(ePropUnit)).getStr()));
936 (void)xmlTextWriterEndElement(pWriter);
937}
938
939// class SvxTextLineItem ------------------------------------------------
940
941SvxTextLineItem::SvxTextLineItem( const FontLineStyle eSt, const sal_uInt16 nId )
942 : SfxEnumItem(nId, eSt)
944{
945}
946
947
949{
950 return true;
951}
952
953
955{
956 return GetValue() != LINESTYLE_NONE;
957}
958
959
961{
963}
964
966{
967 return new SvxTextLineItem( *this );
968}
969
971{
972 return LINESTYLE_DOTTED + 1; // LINESTYLE_NONE also belongs here
973}
974
975
977(
978 SfxItemPresentation /*ePres*/,
979 MapUnit /*eCoreUnit*/,
980 MapUnit /*ePresUnit*/,
981 OUString& rText, const IntlWrapper& /*rIntl*/
982) const
983{
984 rText = GetValueTextByPos( GetValue() );
985 if( !maColor.IsTransparent() )
986 rText += cpDelim + ::GetColorString(maColor);
987 return true;
988}
989
990
991OUString SvxTextLineItem::GetValueTextByPos( sal_uInt16 /*nPos*/ ) const
992{
993 OSL_FAIL("SvxTextLineItem::GetValueTextByPos: Pure virtual method");
994 return OUString();
995}
996
997bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
998{
999 nMemberId &= ~CONVERT_TWIPS;
1000 switch(nMemberId)
1001 {
1002 case MID_TEXTLINED:
1003 rVal <<= GetBoolValue();
1004 break;
1005 case MID_TL_STYLE:
1006 rVal <<= static_cast<sal_Int16>(GetValue());
1007 break;
1008 case MID_TL_COLOR:
1009 rVal <<= maColor;
1010 break;
1012 {
1014 rVal <<= xComplexColor;
1015 break;
1016 }
1017 case MID_TL_HASCOLOR:
1018 rVal <<= maColor.GetAlpha() == 255;
1019 break;
1020 }
1021 return true;
1022}
1023
1024bool SvxTextLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1025{
1026 nMemberId &= ~CONVERT_TWIPS;
1027 bool bRet = true;
1028 switch(nMemberId)
1029 {
1030 case MID_TEXTLINED:
1031 SetBoolValue(Any2Bool(rVal));
1032 break;
1033 case MID_TL_STYLE:
1034 {
1035 sal_Int32 nValue = 0;
1036 if(!(rVal >>= nValue))
1037 bRet = false;
1038 else
1039 SetValue(static_cast<FontLineStyle>(nValue));
1040 }
1041 break;
1042 case MID_TL_COLOR:
1043 {
1044 Color nCol;
1045 if( !( rVal >>= nCol ) )
1046 bRet = false;
1047 else
1048 {
1049 // Keep transparence, because it contains the information
1050 // whether the font color or the stored color should be used
1051 sal_uInt8 nAlpha = maColor.GetAlpha();
1052 maColor = nCol;
1053 maColor.SetAlpha( nAlpha );
1054 }
1055 }
1056 break;
1058 {
1059 css::uno::Reference<css::util::XComplexColor> xComplexColor;
1060 if (!(rVal >>= xComplexColor))
1061 return false;
1062
1063 if (xComplexColor.is())
1065 }
1066 break;
1067 case MID_TL_HASCOLOR:
1068 maColor.SetAlpha( Any2Bool( rVal ) ? 255 : 0 );
1069 break;
1070 }
1071 return bRet;
1072}
1073
1075{
1076 return SfxEnumItem::operator==( rItem ) &&
1077 maColor == static_cast<const SvxTextLineItem&>(rItem).maColor &&
1078 maComplexColor == static_cast<const SvxTextLineItem&>(rItem).maComplexColor;
1079}
1080
1081// class SvxUnderlineItem ------------------------------------------------
1082
1083
1084SvxUnderlineItem::SvxUnderlineItem( const FontLineStyle eSt, const sal_uInt16 nId )
1085 : SvxTextLineItem( eSt, nId )
1086{
1087}
1088
1090{
1091 return new SvxUnderlineItem( *this );
1092}
1093
1094OUString SvxUnderlineItem::GetValueTextByPos( sal_uInt16 nPos ) const
1095{
1096 static TranslateId RID_SVXITEMS_UL[] =
1097 {
1098 RID_SVXITEMS_UL_NONE,
1099 RID_SVXITEMS_UL_SINGLE,
1100 RID_SVXITEMS_UL_DOUBLE,
1101 RID_SVXITEMS_UL_DOTTED,
1102 RID_SVXITEMS_UL_DONTKNOW,
1103 RID_SVXITEMS_UL_DASH,
1104 RID_SVXITEMS_UL_LONGDASH,
1105 RID_SVXITEMS_UL_DASHDOT,
1106 RID_SVXITEMS_UL_DASHDOTDOT,
1107 RID_SVXITEMS_UL_SMALLWAVE,
1108 RID_SVXITEMS_UL_WAVE,
1109 RID_SVXITEMS_UL_DOUBLEWAVE,
1110 RID_SVXITEMS_UL_BOLD,
1111 RID_SVXITEMS_UL_BOLDDOTTED,
1112 RID_SVXITEMS_UL_BOLDDASH,
1113 RID_SVXITEMS_UL_BOLDLONGDASH,
1114 RID_SVXITEMS_UL_BOLDDASHDOT,
1115 RID_SVXITEMS_UL_BOLDDASHDOTDOT,
1116 RID_SVXITEMS_UL_BOLDWAVE
1117 };
1118 static_assert(SAL_N_ELEMENTS(RID_SVXITEMS_UL) - 1 == LINESTYLE_BOLDWAVE, "must match");
1119 assert(nPos <= sal_uInt16(LINESTYLE_BOLDWAVE) && "enum overflow!");
1120 return EditResId(RID_SVXITEMS_UL[nPos]);
1121}
1122
1123// class SvxOverlineItem ------------------------------------------------
1124
1125SvxOverlineItem::SvxOverlineItem( const FontLineStyle eSt, const sal_uInt16 nId )
1126 : SvxTextLineItem( eSt, nId )
1127{
1128}
1129
1131{
1132 return new SvxOverlineItem( *this );
1133}
1134
1135OUString SvxOverlineItem::GetValueTextByPos( sal_uInt16 nPos ) const
1136{
1137 static TranslateId RID_SVXITEMS_OL[] =
1138 {
1139 RID_SVXITEMS_OL_NONE,
1140 RID_SVXITEMS_OL_SINGLE,
1141 RID_SVXITEMS_OL_DOUBLE,
1142 RID_SVXITEMS_OL_DOTTED,
1143 RID_SVXITEMS_OL_DONTKNOW,
1144 RID_SVXITEMS_OL_DASH,
1145 RID_SVXITEMS_OL_LONGDASH,
1146 RID_SVXITEMS_OL_DASHDOT,
1147 RID_SVXITEMS_OL_DASHDOTDOT,
1148 RID_SVXITEMS_OL_SMALLWAVE,
1149 RID_SVXITEMS_OL_WAVE,
1150 RID_SVXITEMS_OL_DOUBLEWAVE,
1151 RID_SVXITEMS_OL_BOLD,
1152 RID_SVXITEMS_OL_BOLDDOTTED,
1153 RID_SVXITEMS_OL_BOLDDASH,
1154 RID_SVXITEMS_OL_BOLDLONGDASH,
1155 RID_SVXITEMS_OL_BOLDDASHDOT,
1156 RID_SVXITEMS_OL_BOLDDASHDOTDOT,
1157 RID_SVXITEMS_OL_BOLDWAVE
1158 };
1159 static_assert(SAL_N_ELEMENTS(RID_SVXITEMS_OL) - 1 == LINESTYLE_BOLDWAVE, "must match");
1160 assert(nPos <= sal_uInt16(LINESTYLE_BOLDWAVE) && "enum overflow!");
1161 return EditResId(RID_SVXITEMS_OL[nPos]);
1162}
1163
1164// class SvxCrossedOutItem -----------------------------------------------
1165
1166SvxCrossedOutItem::SvxCrossedOutItem( const FontStrikeout eSt, const sal_uInt16 nId )
1167 : SfxEnumItem( nId, eSt )
1168{
1169}
1170
1171
1173{
1174 return true;
1175}
1176
1177
1179{
1180 return GetValue() != STRIKEOUT_NONE;
1181}
1182
1183
1185{
1187}
1188
1189
1191{
1192 return STRIKEOUT_DOUBLE + 1; // STRIKEOUT_NONE belongs also here
1193}
1194
1196{
1197 return new SvxCrossedOutItem( *this );
1198}
1199
1201(
1202 SfxItemPresentation /*ePres*/,
1203 MapUnit /*eCoreUnit*/,
1204 MapUnit /*ePresUnit*/,
1205 OUString& rText, const IntlWrapper& /*rIntl*/
1206) const
1207{
1208 rText = GetValueTextByPos( GetValue() );
1209 return true;
1210}
1211
1212OUString SvxCrossedOutItem::GetValueTextByPos( sal_uInt16 nPos )
1213{
1214 static TranslateId RID_SVXITEMS_STRIKEOUT[] =
1215 {
1216 RID_SVXITEMS_STRIKEOUT_NONE,
1217 RID_SVXITEMS_STRIKEOUT_SINGLE,
1218 RID_SVXITEMS_STRIKEOUT_DOUBLE,
1219 RID_SVXITEMS_STRIKEOUT_DONTKNOW,
1220 RID_SVXITEMS_STRIKEOUT_BOLD,
1221 RID_SVXITEMS_STRIKEOUT_SLASH,
1222 RID_SVXITEMS_STRIKEOUT_X
1223 };
1224 static_assert(SAL_N_ELEMENTS(RID_SVXITEMS_STRIKEOUT) - 1 == STRIKEOUT_X, "must match");
1225 assert(nPos <= sal_uInt16(STRIKEOUT_X) && "enum overflow!");
1226 return EditResId(RID_SVXITEMS_STRIKEOUT[nPos]);
1227}
1228
1230{
1231 nMemberId &= ~CONVERT_TWIPS;
1232 switch(nMemberId)
1233 {
1234 case MID_CROSSED_OUT:
1235 rVal <<= GetBoolValue();
1236 break;
1237 case MID_CROSS_OUT:
1238 rVal <<= static_cast<sal_Int16>(GetValue());
1239 break;
1240 }
1241 return true;
1242}
1243
1244bool SvxCrossedOutItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1245{
1246 nMemberId &= ~CONVERT_TWIPS;
1247 switch(nMemberId)
1248 {
1249 case MID_CROSSED_OUT:
1250 SetBoolValue(Any2Bool(rVal));
1251 break;
1252 case MID_CROSS_OUT:
1253 {
1254 sal_Int32 nValue = 0;
1255 if(!(rVal >>= nValue))
1256 return false;
1257 SetValue(static_cast<FontStrikeout>(nValue));
1258 }
1259 break;
1260 }
1261 return true;
1262}
1263// class SvxShadowedItem -------------------------------------------------
1264
1265SvxShadowedItem::SvxShadowedItem( const bool bShadowed, const sal_uInt16 nId ) :
1266 SfxBoolItem( nId, bShadowed )
1267{
1268}
1269
1271{
1272 return new SvxShadowedItem( *this );
1273}
1274
1276(
1277 SfxItemPresentation /*ePres*/,
1278 MapUnit /*eCoreUnit*/,
1279 MapUnit /*ePresUnit*/,
1280 OUString& rText, const IntlWrapper& /*rIntl*/
1281) const
1282{
1283 TranslateId pId = RID_SVXITEMS_SHADOWED_FALSE;
1284
1285 if ( GetValue() )
1286 pId = RID_SVXITEMS_SHADOWED_TRUE;
1287 rText = EditResId(pId);
1288 return true;
1289}
1290
1291// class SvxAutoKernItem -------------------------------------------------
1292
1293SvxAutoKernItem::SvxAutoKernItem( const bool bAutoKern, const sal_uInt16 nId ) :
1294 SfxBoolItem( nId, bAutoKern )
1295{
1296}
1297
1299{
1300 return new SvxAutoKernItem( *this );
1301}
1302
1304(
1305 SfxItemPresentation /*ePres*/,
1306 MapUnit /*eCoreUnit*/,
1307 MapUnit /*ePresUnit*/,
1308 OUString& rText, const IntlWrapper& /*rIntl*/
1309) const
1310{
1311 TranslateId pId = RID_SVXITEMS_AUTOKERN_FALSE;
1312
1313 if ( GetValue() )
1314 pId = RID_SVXITEMS_AUTOKERN_TRUE;
1315 rText = EditResId(pId);
1316 return true;
1317}
1318
1319// class SvxWordLineModeItem ---------------------------------------------
1320
1322 const sal_uInt16 nId ) :
1323 SfxBoolItem( nId, bWordLineMode )
1324{
1325}
1326
1328{
1329 return new SvxWordLineModeItem( *this );
1330}
1331
1333(
1334 SfxItemPresentation /*ePres*/,
1335 MapUnit /*eCoreUnit*/,
1336 MapUnit /*ePresUnit*/,
1337 OUString& rText, const IntlWrapper& /*rIntl*/
1338) const
1339{
1340 TranslateId pId = RID_SVXITEMS_WORDLINE_FALSE;
1341
1342 if ( GetValue() )
1343 pId = RID_SVXITEMS_WORDLINE_TRUE;
1344 rText = EditResId(pId);
1345 return true;
1346}
1347
1348// class SvxContourItem --------------------------------------------------
1349
1350SvxContourItem::SvxContourItem( const bool bContoured, const sal_uInt16 nId ) :
1351 SfxBoolItem( nId, bContoured )
1352{
1353}
1354
1356{
1357 return new SvxContourItem( *this );
1358}
1359
1361(
1362 SfxItemPresentation /*ePres*/,
1363 MapUnit /*eCoreUnit*/,
1364 MapUnit /*ePresUnit*/,
1365 OUString& rText, const IntlWrapper& /*rIntl*/
1366) const
1367{
1368 TranslateId pId = RID_SVXITEMS_CONTOUR_FALSE;
1369
1370 if ( GetValue() )
1371 pId = RID_SVXITEMS_CONTOUR_TRUE;
1372 rText = EditResId(pId);
1373 return true;
1374}
1375
1376// class SvxColorItem ----------------------------------------------------
1377SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
1379 mColor( COL_BLACK )
1380{
1381}
1382
1383SvxColorItem::SvxColorItem( const Color& rCol, const sal_uInt16 nId ) :
1384 SfxPoolItem( nId ),
1385 mColor( rCol )
1386{
1387}
1388
1389SvxColorItem::SvxColorItem(Color const& rColor, model::ComplexColor const& rComplexColor, const sal_uInt16 nId)
1390 : SfxPoolItem(nId)
1391 , mColor(rColor)
1392 , maComplexColor(rComplexColor)
1393{
1394}
1395
1397{
1398}
1399
1400bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) const
1401{
1402 assert(SfxPoolItem::operator==(rAttr));
1403 const SvxColorItem& rColorItem = static_cast<const SvxColorItem&>(rAttr);
1404
1405 return mColor == rColorItem.mColor &&
1406 maComplexColor == rColorItem.maComplexColor;
1407}
1408
1409bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1410{
1411 nMemberId &= ~CONVERT_TWIPS;
1412 switch (nMemberId)
1413 {
1414 case MID_COLOR_ALPHA:
1415 {
1416 auto fTransparency = static_cast<double>(255 - mColor.GetAlpha()) * 100 / 255;
1417 rVal <<= static_cast<sal_Int16>(basegfx::fround(fTransparency));
1418 break;
1419 }
1421 {
1422 rVal <<= mColor.GetAlpha() == 0;
1423 break;
1424 }
1426 {
1427 rVal <<= sal_Int16(maComplexColor.meSchemeType);
1428 break;
1429 }
1431 {
1432 sal_Int16 nValue = 0;
1433 for (auto const& rTransform : maComplexColor.getTransformations())
1434 {
1435 if (rTransform.meType == model::TransformationType::Tint)
1436 nValue = rTransform.mnValue;
1437 else if (rTransform.meType == model::TransformationType::Shade)
1438 nValue = -rTransform.mnValue;
1439 }
1440 rVal <<= nValue;
1441 break;
1442 }
1443 case MID_COLOR_LUM_MOD:
1444 {
1445 sal_Int16 nValue = 10000;
1446 for (auto const& rTransform : maComplexColor.getTransformations())
1447 {
1448 if (rTransform.meType == model::TransformationType::LumMod)
1449 nValue = rTransform.mnValue;
1450 }
1451 rVal <<= nValue;
1452 break;
1453 }
1454 case MID_COLOR_LUM_OFF:
1455 {
1456 sal_Int16 nValue = 0;
1457 for (auto const& rTransform : maComplexColor.getTransformations())
1458 {
1459 if (rTransform.meType == model::TransformationType::LumOff)
1460 nValue = rTransform.mnValue;
1461 }
1462 rVal <<= nValue;
1463 break;
1464 }
1466 {
1467 rVal <<= OStringToOUString(model::color::convertToJSON(maComplexColor), RTL_TEXTENCODING_UTF8);
1468 break;
1469 }
1470 case MID_COMPLEX_COLOR:
1471 {
1473 rVal <<= xComplexColor;
1474 break;
1475 }
1476 case MID_COLOR_RGB:
1477 default:
1478 {
1479 rVal <<= mColor;
1480 break;
1481 }
1482 }
1483 return true;
1484}
1485
1486bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1487{
1488 nMemberId &= ~CONVERT_TWIPS;
1489 switch(nMemberId)
1490 {
1491 case MID_COLOR_ALPHA:
1492 {
1493 sal_Int16 nTransparency = 0;
1494 bool bRet = rVal >>= nTransparency;
1495 if (bRet)
1496 {
1497 auto fTransparency = static_cast<double>(nTransparency) * 255 / 100;
1498 mColor.SetAlpha(255 - static_cast<sal_uInt8>(basegfx::fround(fTransparency)));
1499 }
1500 return bRet;
1501 }
1503 {
1504 mColor.SetAlpha( Any2Bool( rVal ) ? 0 : 255 );
1505 return true;
1506 }
1508 {
1509 sal_Int16 nIndex = -1;
1510 if (!(rVal >>= nIndex))
1511 return false;
1513 }
1514 break;
1516 {
1517 sal_Int16 nTintShade = 0;
1518 if (!(rVal >>= nTintShade))
1519 return false;
1520
1523
1524 if (nTintShade > 0)
1526 else if (nTintShade < 0)
1527 {
1528 sal_Int16 nShade = o3tl::narrowing<sal_Int16>(-nTintShade);
1530 }
1531 }
1532 break;
1533 case MID_COLOR_LUM_MOD:
1534 {
1535 sal_Int16 nLumMod = 10000;
1536 if (!(rVal >>= nLumMod))
1537 return false;
1540 }
1541 break;
1542 case MID_COLOR_LUM_OFF:
1543 {
1544 sal_Int16 nLumOff = 0;
1545 if (!(rVal >>= nLumOff))
1546 return false;
1549 }
1550 break;
1552 {
1553 OUString sComplexColorJson;
1554 if (!(rVal >>= sComplexColorJson))
1555 return false;
1556
1557 if (sComplexColorJson.isEmpty())
1558 return false;
1559
1560 OString aJSON = OUStringToOString(sComplexColorJson, RTL_TEXTENCODING_ASCII_US);
1562 return false;
1563 }
1564 break;
1565 case MID_COMPLEX_COLOR:
1566 {
1567 css::uno::Reference<css::util::XComplexColor> xComplexColor;
1568 if (!(rVal >>= xComplexColor))
1569 return false;
1570
1571 if (xComplexColor.is())
1573 }
1574 break;
1575 case MID_COLOR_RGB:
1576 default:
1577 {
1578 if (!(rVal >>= mColor))
1579 return false;
1580 }
1581 break;
1582 }
1583 return true;
1584}
1585
1587{
1588 return new SvxColorItem( *this );
1589}
1590
1592(
1593 SfxItemPresentation /*ePres*/,
1594 MapUnit /*eCoreUnit*/,
1595 MapUnit /*ePresUnit*/,
1596 OUString& rText, const IntlWrapper& /*rIntl*/
1597) const
1598{
1599 rText = ::GetColorString( mColor );
1600 return true;
1601}
1602
1604{
1605 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxColorItem"));
1606 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1607
1608 std::stringstream ss;
1609 ss << mColor;
1610 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(ss.str().c_str()));
1611
1612 OUString aStr;
1613 IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
1614 GetPresentation( SfxItemPresentation::Complete, MapUnit::Map100thMM, MapUnit::Map100thMM, aStr, aIntlWrapper);
1615 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8).getStr()));
1616
1617 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("complex-color"));
1618
1619 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"),
1620 BAD_CAST(OString::number(sal_Int16(maComplexColor.meType)).getStr()));
1621
1622 for (auto const& rTransform : maComplexColor.getTransformations())
1623 {
1624 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("transformation"));
1625 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"),
1626 BAD_CAST(OString::number(sal_Int16(rTransform.meType)).getStr()));
1627 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
1628 BAD_CAST(OString::number(rTransform.mnValue).getStr()));
1629 (void)xmlTextWriterEndElement(pWriter);
1630 }
1631
1632 (void)xmlTextWriterEndElement(pWriter);
1633
1634 (void)xmlTextWriterEndElement(pWriter);
1635}
1636
1637// class SvxKerningItem --------------------------------------------------
1638
1639SvxKerningItem::SvxKerningItem( const short nKern, const sal_uInt16 nId ) :
1640 SfxInt16Item( nId, nKern )
1641{
1642}
1643
1645{
1646 return new SvxKerningItem( *this );
1647}
1648
1650{
1651 SetValue( static_cast<sal_Int16>(BigInt::Scale( GetValue(), nMult, nDiv )) );
1652}
1653
1654
1656{
1657 return true;
1658}
1659
1660
1662(
1663 SfxItemPresentation ePres,
1664 MapUnit eCoreUnit,
1665 MapUnit /*ePresUnit*/,
1666 OUString& rText, const IntlWrapper& rIntl
1667) const
1668{
1669 switch ( ePres )
1670 {
1671 case SfxItemPresentation::Nameless:
1672 rText = GetMetricText( static_cast<tools::Long>(GetValue()), eCoreUnit, MapUnit::MapPoint, &rIntl ) +
1673 " " + EditResId(GetMetricId(MapUnit::MapPoint));
1674 return true;
1675 case SfxItemPresentation::Complete:
1676 {
1677 rText = EditResId(RID_SVXITEMS_KERNING_COMPLETE);
1678 TranslateId pId;
1679
1680 if ( GetValue() > 0 )
1681 pId = RID_SVXITEMS_KERNING_EXPANDED;
1682 else if ( GetValue() < 0 )
1683 pId = RID_SVXITEMS_KERNING_CONDENSED;
1684
1685 if (pId)
1686 rText += EditResId(pId);
1687 rText += GetMetricText( static_cast<tools::Long>(GetValue()), eCoreUnit, MapUnit::MapPoint, &rIntl ) +
1688 " " + EditResId(GetMetricId(MapUnit::MapPoint));
1689 return true;
1690 }
1691 default: ; //prevent warning
1692 }
1693 return false;
1694}
1695
1696bool SvxKerningItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1697{
1698 sal_Int16 nVal = GetValue();
1699 if(nMemberId & CONVERT_TWIPS)
1700 nVal = static_cast<sal_Int16>(convertTwipToMm100(nVal));
1701 rVal <<= nVal;
1702 return true;
1703}
1704
1705bool SvxKerningItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId)
1706{
1707 sal_Int16 nVal = sal_Int16();
1708 if(!(rVal >>= nVal))
1709 return false;
1710 if(nMemberId & CONVERT_TWIPS)
1711 nVal = o3tl::toTwips(nVal, o3tl::Length::mm100);
1712 SetValue(nVal);
1713 return true;
1714}
1715
1716// class SvxCaseMapItem --------------------------------------------------
1717
1718SvxCaseMapItem::SvxCaseMapItem( const SvxCaseMap eMap, const sal_uInt16 nId ) :
1719 SfxEnumItem( nId, eMap )
1720{
1721}
1722
1724{
1725 return sal_uInt16(SvxCaseMap::End); // SvxCaseMap::SmallCaps + 1
1726}
1727
1729{
1730 return new SvxCaseMapItem( *this );
1731}
1732
1734(
1735 SfxItemPresentation /*ePres*/,
1736 MapUnit /*eCoreUnit*/,
1737 MapUnit /*ePresUnit*/,
1738 OUString& rText, const IntlWrapper& /*rIntl*/
1739) const
1740{
1741 rText = GetValueTextByPos( static_cast<sal_uInt16>(GetValue()) );
1742 return true;
1743}
1744
1745OUString SvxCaseMapItem::GetValueTextByPos( sal_uInt16 nPos )
1746{
1747 static TranslateId RID_SVXITEMS_CASEMAP[] =
1748 {
1749 RID_SVXITEMS_CASEMAP_NONE,
1750 RID_SVXITEMS_CASEMAP_UPPERCASE,
1751 RID_SVXITEMS_CASEMAP_LOWERCASE,
1752 RID_SVXITEMS_CASEMAP_TITLE,
1753 RID_SVXITEMS_CASEMAP_SMALLCAPS
1754 };
1755
1756 static_assert(SAL_N_ELEMENTS(RID_SVXITEMS_CASEMAP) == size_t(SvxCaseMap::End), "must match");
1757 assert(nPos < sal_uInt16(SvxCaseMap::End) && "enum overflow!");
1758 return EditResId(RID_SVXITEMS_CASEMAP[nPos]);
1759}
1760
1761bool SvxCaseMapItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
1762{
1763 sal_Int16 nRet = style::CaseMap::NONE;
1764 switch( GetValue() )
1765 {
1766 case SvxCaseMap::Uppercase : nRet = style::CaseMap::UPPERCASE; break;
1767 case SvxCaseMap::Lowercase : nRet = style::CaseMap::LOWERCASE; break;
1768 case SvxCaseMap::Capitalize : nRet = style::CaseMap::TITLE ; break;
1769 case SvxCaseMap::SmallCaps: nRet = style::CaseMap::SMALLCAPS; break;
1770 default: break;
1771 }
1772 rVal <<= nRet;
1773 return true;
1774}
1775
1776bool SvxCaseMapItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
1777{
1778 sal_uInt16 nVal = sal_uInt16();
1779 if(!(rVal >>= nVal))
1780 return false;
1781
1782 SvxCaseMap eVal;
1783 switch( nVal )
1784 {
1785 case style::CaseMap::NONE : eVal = SvxCaseMap::NotMapped; break;
1786 case style::CaseMap::UPPERCASE: eVal = SvxCaseMap::Uppercase; break;
1787 case style::CaseMap::LOWERCASE: eVal = SvxCaseMap::Lowercase; break;
1788 case style::CaseMap::TITLE : eVal = SvxCaseMap::Capitalize; break;
1789 case style::CaseMap::SMALLCAPS: eVal = SvxCaseMap::SmallCaps; break;
1790 default: return false;
1791 }
1792 SetValue(eVal);
1793 return true;
1794}
1795
1796// class SvxEscapementItem -----------------------------------------------
1797
1800
1801 nEsc ( 0 ),
1802 nProp ( 100 )
1803{
1804}
1805
1806
1808 const sal_uInt16 nId ) :
1810 nProp( 100 )
1811{
1812 SetEscapement( eEscape );
1813 if( nEsc )
1815}
1816
1817
1819 const sal_uInt8 _nProp,
1820 const sal_uInt16 nId ) :
1822 nEsc ( _nEsc ),
1823 nProp ( _nProp )
1824{
1825}
1826
1827
1829{
1830 assert(SfxPoolItem::operator==(rAttr));
1831
1832 return( nEsc == static_cast<const SvxEscapementItem&>(rAttr).nEsc &&
1833 nProp == static_cast<const SvxEscapementItem&>(rAttr).nProp );
1834}
1835
1837{
1838 return new SvxEscapementItem( *this );
1839}
1840
1842{
1843 return sal_uInt16(SvxEscapement::End); // SvxEscapement::Subscript + 1
1844}
1845
1846
1848(
1849 SfxItemPresentation /*ePres*/,
1850 MapUnit /*eCoreUnit*/,
1851 MapUnit /*ePresUnit*/,
1852 OUString& rText, const IntlWrapper& /*rIntl*/
1853) const
1854{
1855 rText = GetValueTextByPos( GetEnumValue() );
1856
1857 if ( nEsc != 0 )
1858 {
1860 rText += EditResId(RID_SVXITEMS_ESCAPEMENT_AUTO);
1861 else
1862 rText += OUString::number( nEsc ) + "%";
1863 }
1864 return true;
1865}
1866
1867OUString SvxEscapementItem::GetValueTextByPos( sal_uInt16 nPos )
1868{
1869 static TranslateId RID_SVXITEMS_ESCAPEMENT[] =
1870 {
1871 RID_SVXITEMS_ESCAPEMENT_OFF,
1872 RID_SVXITEMS_ESCAPEMENT_SUPER,
1873 RID_SVXITEMS_ESCAPEMENT_SUB
1874 };
1875
1876 static_assert(SAL_N_ELEMENTS(RID_SVXITEMS_ESCAPEMENT) == size_t(SvxEscapement::End), "must match");
1877 assert(nPos < sal_uInt16(SvxEscapement::End) && "enum overflow!");
1878 return EditResId(RID_SVXITEMS_ESCAPEMENT[nPos]);
1879}
1880
1882{
1883 if ( nEsc < 0 )
1884 return sal_uInt16(SvxEscapement::Subscript);
1885 else if ( nEsc > 0 )
1886 return sal_uInt16(SvxEscapement::Superscript);
1887 return sal_uInt16(SvxEscapement::Off);
1888}
1889
1890
1891void SvxEscapementItem::SetEnumValue( sal_uInt16 nVal )
1892{
1893 SetEscapement( static_cast<SvxEscapement>(nVal) );
1894}
1895
1897{
1898 nMemberId &= ~CONVERT_TWIPS;
1899 switch(nMemberId)
1900 {
1901 case MID_ESC:
1902 rVal <<= static_cast<sal_Int16>(nEsc);
1903 break;
1904 case MID_ESC_HEIGHT:
1905 rVal <<= static_cast<sal_Int8>(nProp);
1906 break;
1907 case MID_AUTO_ESC:
1908 rVal <<= (DFLT_ESC_AUTO_SUB == nEsc || DFLT_ESC_AUTO_SUPER == nEsc);
1909 break;
1910 }
1911 return true;
1912}
1913
1914bool SvxEscapementItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
1915{
1916 nMemberId &= ~CONVERT_TWIPS;
1917 switch(nMemberId)
1918 {
1919 case MID_ESC:
1920 {
1921 sal_Int16 nVal = sal_Int16();
1922 if( (rVal >>= nVal) && (std::abs(nVal) <= MAX_ESC_POS+1))
1923 nEsc = nVal;
1924 else
1925 return false;
1926 }
1927 break;
1928 case MID_ESC_HEIGHT:
1929 {
1930 sal_Int8 nVal = sal_Int8();
1931 if( (rVal >>= nVal) && (nVal <= 100))
1932 nProp = nVal;
1933 else
1934 return false;
1935 }
1936 break;
1937 case MID_AUTO_ESC:
1938 {
1939 bool bVal = Any2Bool(rVal);
1940 if(bVal)
1941 {
1942 if(nEsc < 0)
1944 else
1946 }
1947 else
1949 --nEsc;
1950 else if(DFLT_ESC_AUTO_SUB == nEsc)
1951 ++nEsc;
1952 }
1953 break;
1954 }
1955 return true;
1956}
1957
1958// class SvxLanguageItem -------------------------------------------------
1959
1960SvxLanguageItem::SvxLanguageItem( const LanguageType eLang, const sal_uInt16 nId )
1961 : SvxLanguageItem_Base( nId , eLang )
1962{
1963}
1964
1965
1967{
1968 // #i50205# got rid of class International
1969 SAL_WARN( "editeng.items", "SvxLanguageItem::GetValueCount: supposed to return a count of what?");
1970 // Could be SvtLanguageTable::GetEntryCount() (all locales with resource string)?
1971 // Could be LocaleDataWrapper::getInstalledLanguageTypes() (all locales with locale data)?
1972 return 0;
1973}
1974
1976{
1977 return new SvxLanguageItem( *this );
1978}
1979
1981(
1982 SfxItemPresentation /*ePres*/,
1983 MapUnit /*eCoreUnit*/,
1984 MapUnit /*ePresUnit*/,
1985 OUString& rText, const IntlWrapper& /*rIntl*/
1986) const
1987{
1989 return true;
1990}
1991
1992bool SvxLanguageItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
1993{
1994 nMemberId &= ~CONVERT_TWIPS;
1995 switch(nMemberId)
1996 {
1997 case MID_LANG_INT: // for basic conversions!
1998 rVal <<= static_cast<sal_Int16>(static_cast<sal_uInt16>(GetValue()));
1999 break;
2000 case MID_LANG_LOCALE:
2001 lang::Locale aRet( LanguageTag::convertToLocale( GetValue(), false));
2002 rVal <<= aRet;
2003 break;
2004 }
2005 return true;
2006}
2007
2008bool SvxLanguageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
2009{
2010 nMemberId &= ~CONVERT_TWIPS;
2011 switch(nMemberId)
2012 {
2013 case MID_LANG_INT: // for basic conversions!
2014 {
2015 sal_Int32 nValue = 0;
2016 if(!(rVal >>= nValue))
2017 return false;
2018
2020 }
2021 break;
2022 case MID_LANG_LOCALE:
2023 {
2024 lang::Locale aLocale;
2025 if(!(rVal >>= aLocale))
2026 return false;
2027
2029 }
2030 break;
2031 }
2032 return true;
2033}
2034
2035// class SvxNoHyphenItem -------------------------------------------------
2036
2037SvxNoHyphenItem::SvxNoHyphenItem( const sal_uInt16 nId ) :
2038 SfxBoolItem( nId , true )
2039{
2040}
2041
2043{
2044 return new SvxNoHyphenItem( *this );
2045}
2046
2048(
2049 SfxItemPresentation /*ePres*/,
2050 MapUnit /*eCoreUnit*/,
2051 MapUnit /*ePresUnit*/,
2052 OUString& rText, const IntlWrapper& /*rIntl*/
2053) const
2054{
2055 rText.clear();
2056 return false;
2057}
2058
2059/*
2060 * Dummy item for ToolBox controls:
2061 *
2062 */
2063
2064
2065// class SvxBlinkItem -------------------------------------------------
2066
2067
2068SvxBlinkItem::SvxBlinkItem( const bool bBlink, const sal_uInt16 nId ) :
2069 SfxBoolItem( nId, bBlink )
2070{
2071}
2072
2074{
2075 return new SvxBlinkItem( *this );
2076}
2077
2079(
2080 SfxItemPresentation /*ePres*/,
2081 MapUnit /*eCoreUnit*/,
2082 MapUnit /*ePresUnit*/,
2083 OUString& rText, const IntlWrapper& /*rIntl*/
2084) const
2085{
2086 TranslateId pId = RID_SVXITEMS_BLINK_FALSE;
2087
2088 if ( GetValue() )
2089 pId = RID_SVXITEMS_BLINK_TRUE;
2090 rText = EditResId(pId);
2091 return true;
2092}
2093
2094// class SvxEmphaisMarkItem ---------------------------------------------------
2095
2098 : SfxUInt16Item( nId, static_cast<sal_uInt16>(nValue) )
2099{
2100}
2101
2103{
2104 return new SvxEmphasisMarkItem( *this );
2105}
2106
2108(
2109 SfxItemPresentation /*ePres*/,
2110 MapUnit /*eCoreUnit*/,
2111 MapUnit /*ePresUnit*/,
2112 OUString& rText,
2113 const IntlWrapper& /*rIntl*/
2114) const
2115{
2116 static TranslateId RID_SVXITEMS_EMPHASIS[] =
2117 {
2118 RID_SVXITEMS_EMPHASIS_NONE_STYLE,
2119 RID_SVXITEMS_EMPHASIS_DOT_STYLE,
2120 RID_SVXITEMS_EMPHASIS_CIRCLE_STYLE,
2121 RID_SVXITEMS_EMPHASIS_DISC_STYLE,
2122 RID_SVXITEMS_EMPHASIS_ACCENT_STYLE
2123 };
2124
2126 rText = EditResId(RID_SVXITEMS_EMPHASIS[
2127 static_cast<sal_uInt16>(static_cast<FontEmphasisMark>( nVal & FontEmphasisMark::Style ))]);
2128 TranslateId pId = ( FontEmphasisMark::PosAbove & nVal )
2129 ? RID_SVXITEMS_EMPHASIS_ABOVE_POS
2130 : ( FontEmphasisMark::PosBelow & nVal )
2131 ? RID_SVXITEMS_EMPHASIS_BELOW_POS
2132 : TranslateId();
2133 if( pId )
2134 rText += EditResId( pId );
2135 return true;
2136}
2137
2139{
2140 nMemberId &= ~CONVERT_TWIPS;
2141 switch( nMemberId )
2142 {
2143 case MID_EMPHASIS:
2144 {
2146 sal_Int16 nRet = 0;
2147 switch(nValue & FontEmphasisMark::Style)
2148 {
2149 case FontEmphasisMark::NONE : nRet = FontEmphasis::NONE; break;
2150 case FontEmphasisMark::Dot : nRet = FontEmphasis::DOT_ABOVE; break;
2151 case FontEmphasisMark::Circle : nRet = FontEmphasis::CIRCLE_ABOVE; break;
2152 case FontEmphasisMark::Disc : nRet = FontEmphasis::DISK_ABOVE; break;
2153 case FontEmphasisMark::Accent : nRet = FontEmphasis::ACCENT_ABOVE; break;
2154 default: break;
2155 }
2156 if(nRet && nValue & FontEmphasisMark::PosBelow)
2157 nRet += 10;
2158 rVal <<= nRet;
2159 }
2160 break;
2161 }
2162 return true;
2163}
2164
2166{
2167 nMemberId &= ~CONVERT_TWIPS;
2168 switch( nMemberId )
2169 {
2170 case MID_EMPHASIS:
2171 {
2172 sal_Int32 nValue = -1;
2173 rVal >>= nValue;
2174 FontEmphasisMark nMark;
2175 switch(nValue)
2176 {
2177 case FontEmphasis::NONE : nMark = FontEmphasisMark::NONE; break;
2178 case FontEmphasis::DOT_ABOVE : nMark = FontEmphasisMark::Dot|FontEmphasisMark::PosAbove; break;
2179 case FontEmphasis::CIRCLE_ABOVE: nMark = FontEmphasisMark::Circle|FontEmphasisMark::PosAbove; break;
2180 case FontEmphasis::DISK_ABOVE : nMark = FontEmphasisMark::Disc|FontEmphasisMark::PosAbove; break;
2181 case FontEmphasis::ACCENT_ABOVE: nMark = FontEmphasisMark::Accent|FontEmphasisMark::PosAbove; break;
2182 case FontEmphasis::DOT_BELOW : nMark = FontEmphasisMark::Dot|FontEmphasisMark::PosBelow; break;
2183 case FontEmphasis::CIRCLE_BELOW: nMark = FontEmphasisMark::Circle|FontEmphasisMark::PosBelow; break;
2184 case FontEmphasis::DISK_BELOW : nMark = FontEmphasisMark::Disc|FontEmphasisMark::PosBelow; break;
2185 case FontEmphasis::ACCENT_BELOW: nMark = FontEmphasisMark::Accent|FontEmphasisMark::PosBelow; break;
2186 default: return false;
2187 }
2188 SetValue( static_cast<sal_Int16>(nMark) );
2189 }
2190 break;
2191 }
2192 return true;
2193}
2194
2195/*************************************************************************
2196|* class SvxTwoLinesItem
2197*************************************************************************/
2198
2200 sal_Unicode nEndBracket, sal_uInt16 nW )
2201 : SfxPoolItem( nW ),
2202 cStartBracket( nStartBracket ), cEndBracket( nEndBracket ), bOn( bFlag )
2203{
2204}
2205
2207{
2208}
2209
2211{
2212 assert(SfxPoolItem::operator==(rAttr));
2213 return bOn == static_cast<const SvxTwoLinesItem&>(rAttr).bOn &&
2214 cStartBracket == static_cast<const SvxTwoLinesItem&>(rAttr).cStartBracket &&
2215 cEndBracket == static_cast<const SvxTwoLinesItem&>(rAttr).cEndBracket;
2216}
2217
2219{
2220 return new SvxTwoLinesItem( *this );
2221}
2222
2223bool SvxTwoLinesItem::QueryValue( css::uno::Any& rVal,
2224 sal_uInt8 nMemberId ) const
2225{
2226 nMemberId &= ~CONVERT_TWIPS;
2227 bool bRet = true;
2228 switch( nMemberId )
2229 {
2230 case MID_TWOLINES:
2231 rVal <<= bOn;
2232 break;
2233 case MID_START_BRACKET:
2234 {
2235 OUString s;
2236 if( cStartBracket )
2237 s = OUString( cStartBracket );
2238 rVal <<= s;
2239 }
2240 break;
2241 case MID_END_BRACKET:
2242 {
2243 OUString s;
2244 if( cEndBracket )
2245 s = OUString( cEndBracket );
2246 rVal <<= s;
2247 }
2248 break;
2249 default:
2250 bRet = false;
2251 break;
2252 }
2253 return bRet;
2254}
2255
2256bool SvxTwoLinesItem::PutValue( const css::uno::Any& rVal,
2257 sal_uInt8 nMemberId )
2258{
2259 nMemberId &= ~CONVERT_TWIPS;
2260 bool bRet = false;
2261 OUString s;
2262 switch( nMemberId )
2263 {
2264 case MID_TWOLINES:
2265 bOn = Any2Bool( rVal );
2266 bRet = true;
2267 break;
2268 case MID_START_BRACKET:
2269 if( rVal >>= s )
2270 {
2271 cStartBracket = s.isEmpty() ? 0 : s[ 0 ];
2272 bRet = true;
2273 }
2274 break;
2275 case MID_END_BRACKET:
2276 if( rVal >>= s )
2277 {
2278 cEndBracket = s.isEmpty() ? 0 : s[ 0 ];
2279 bRet = true;
2280 }
2281 break;
2282 }
2283 return bRet;
2284}
2285
2287 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
2288 OUString &rText, const IntlWrapper& /*rIntl*/ ) const
2289{
2290 if( !GetValue() )
2291 rText = EditResId( RID_SVXITEMS_TWOLINES_OFF );
2292 else
2293 {
2294 rText = EditResId( RID_SVXITEMS_TWOLINES );
2295 if( GetStartBracket() )
2296 rText = OUStringChar(GetStartBracket()) + rText;
2297 if( GetEndBracket() )
2298 rText += OUStringChar(GetEndBracket());
2299 }
2300 return true;
2301}
2302
2303
2304/*************************************************************************
2305|* class SvxTextRotateItem
2306*************************************************************************/
2307
2309 : SfxUInt16Item(nW, nValue.get())
2310{
2311}
2312
2314{
2315 return new SvxTextRotateItem(*this);
2316}
2317
2319 SfxItemPresentation /*ePres*/,
2320 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
2321 OUString &rText, const IntlWrapper&) const
2322{
2323 if (!GetValue())
2324 rText = EditResId(RID_SVXITEMS_TEXTROTATE_OFF);
2325 else
2326 {
2327 rText = EditResId(RID_SVXITEMS_TEXTROTATE);
2328 rText = rText.replaceFirst("$(ARG1)",
2329 OUString::number(toDegrees(GetValue())));
2330 }
2331 return true;
2332}
2333
2334bool SvxTextRotateItem::QueryValue(css::uno::Any& rVal,
2335 sal_uInt8 nMemberId) const
2336{
2337 nMemberId &= ~CONVERT_TWIPS;
2338 bool bRet = true;
2339 switch (nMemberId)
2340 {
2341 case MID_ROTATE:
2342 rVal <<= static_cast<sal_Int16>(GetValue());
2343 break;
2344 default:
2345 bRet = false;
2346 break;
2347 }
2348 return bRet;
2349}
2350
2351bool SvxTextRotateItem::PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId)
2352{
2353 nMemberId &= ~CONVERT_TWIPS;
2354 bool bRet = true;
2355 switch (nMemberId)
2356 {
2357 case MID_ROTATE:
2358 {
2359 sal_Int16 nVal = 0;
2360 if ((rVal >>= nVal) && (0 == nVal || 900 == nVal || 2700 == nVal))
2361 SetValue(Degree10(nVal));
2362 else
2363 bRet = false;
2364 break;
2365 }
2366 default:
2367 bRet = false;
2368 }
2369 return bRet;
2370}
2371
2373{
2374 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxTextRotateItem"));
2375 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
2376 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue().get()).getStr()));
2377 (void)xmlTextWriterEndElement(pWriter);
2378}
2379
2380
2381/*************************************************************************
2382|* class SvxCharRotateItem
2383*************************************************************************/
2384
2386 bool bFitIntoLine,
2388 : SvxTextRotateItem(nValue, nW), bFitToLine( bFitIntoLine )
2389{
2390}
2391
2393{
2394 return new SvxCharRotateItem( *this );
2395}
2396
2398 SfxItemPresentation /*ePres*/,
2399 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
2400 OUString &rText, const IntlWrapper&) const
2401{
2402 if( !GetValue() )
2403 rText = EditResId( RID_SVXITEMS_CHARROTATE_OFF );
2404 else
2405 {
2406 rText = EditResId( RID_SVXITEMS_CHARROTATE );
2407 rText = rText.replaceFirst( "$(ARG1)",
2408 OUString::number( toDegrees(GetValue()) ));
2409 if( IsFitToLine() )
2410 rText += EditResId( RID_SVXITEMS_CHARROTATE_FITLINE );
2411 }
2412 return true;
2413}
2414
2415bool SvxCharRotateItem::QueryValue( css::uno::Any& rVal,
2416 sal_uInt8 nMemberId ) const
2417{
2418 bool bRet = true;
2419 switch(nMemberId & ~CONVERT_TWIPS)
2420 {
2421 case MID_ROTATE:
2422 SvxTextRotateItem::QueryValue(rVal, nMemberId);
2423 break;
2424 case MID_FITTOLINE:
2425 rVal <<= IsFitToLine();
2426 break;
2427 default:
2428 bRet = false;
2429 break;
2430 }
2431 return bRet;
2432}
2433
2434bool SvxCharRotateItem::PutValue( const css::uno::Any& rVal,
2435 sal_uInt8 nMemberId )
2436{
2437 bool bRet = true;
2438 switch(nMemberId & ~CONVERT_TWIPS)
2439 {
2440 case MID_ROTATE:
2441 {
2442 bRet = SvxTextRotateItem::PutValue(rVal, nMemberId);
2443 break;
2444 }
2445
2446 case MID_FITTOLINE:
2447 SetFitToLine( Any2Bool( rVal ) );
2448 break;
2449 default:
2450 bRet = false;
2451 }
2452 return bRet;
2453}
2454
2456{
2457 assert(SfxPoolItem::operator==(rItem));
2458 return SvxTextRotateItem::operator==( rItem ) &&
2459 IsFitToLine() == static_cast<const SvxCharRotateItem&>(rItem).IsFitToLine();
2460}
2461
2463{
2464 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxCharRotateItem"));
2465 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
2466 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(GetValue().get()).getStr()));
2467 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("fitToLine"), BAD_CAST(OString::boolean(IsFitToLine()).getStr()));
2468 (void)xmlTextWriterEndElement(pWriter);
2469}
2470
2471/*************************************************************************
2472|* class SvxCharScaleItem
2473*************************************************************************/
2474
2477 : SfxUInt16Item( nW, nValue )
2478{
2479}
2480
2482{
2483 return new SvxCharScaleWidthItem( *this );
2484}
2485
2487 SfxItemPresentation /*ePres*/,
2488 MapUnit /*eCoreMetric*/, MapUnit /*ePresMetric*/,
2489 OUString &rText, const IntlWrapper&) const
2490{
2491 if( !GetValue() )
2492 rText = EditResId( RID_SVXITEMS_CHARSCALE_OFF );
2493 else
2494 {
2495 rText = EditResId( RID_SVXITEMS_CHARSCALE );
2496 rText = rText.replaceFirst( "$(ARG1)",
2497 OUString::number( GetValue() ));
2498 }
2499 return true;
2500}
2501
2502bool SvxCharScaleWidthItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
2503{
2504 // SfxUInt16Item::QueryValue returns sal_Int32 in Any now... (srx642w)
2505 // where we still want this to be a sal_Int16
2506 sal_Int16 nValue = sal_Int16();
2507 if (rVal >>= nValue)
2508 {
2509 SetValue( static_cast<sal_uInt16>(nValue) );
2510 return true;
2511 }
2512
2513 SAL_WARN("editeng.items", "SvxCharScaleWidthItem::PutValue - Wrong type!" );
2514 return false;
2515}
2516
2517bool SvxCharScaleWidthItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
2518{
2519 // SfxUInt16Item::QueryValue returns sal_Int32 in Any now... (srx642w)
2520 // where we still want this to be a sal_Int16
2521 rVal <<= static_cast<sal_Int16>(GetValue());
2522 return true;
2523}
2524
2525/*************************************************************************
2526|* class SvxCharReliefItem
2527*************************************************************************/
2528
2530 const sal_uInt16 nId )
2531 : SfxEnumItem( nId, eValue )
2532{
2533}
2534
2536{
2537 return new SvxCharReliefItem( *this );
2538}
2539
2541{
2542 RID_SVXITEMS_RELIEF_NONE,
2543 RID_SVXITEMS_RELIEF_EMBOSSED,
2544 RID_SVXITEMS_RELIEF_ENGRAVED
2545};
2546
2548{
2549 assert(nPos < SAL_N_ELEMENTS(RID_SVXITEMS_RELIEF) && "enum overflow");
2551}
2552
2554{
2556}
2557
2559(
2560 SfxItemPresentation /*ePres*/,
2561 MapUnit /*eCoreUnit*/,
2562 MapUnit /*ePresUnit*/,
2563 OUString& rText, const IntlWrapper& /*rIntl*/
2564) const
2565{
2566 rText = GetValueTextByPos( static_cast<sal_uInt16>(GetValue()) );
2567 return true;
2568}
2569
2570bool SvxCharReliefItem::PutValue( const css::uno::Any& rVal,
2571 sal_uInt8 nMemberId )
2572{
2573 nMemberId &= ~CONVERT_TWIPS;
2574 bool bRet = true;
2575 switch( nMemberId )
2576 {
2577 case MID_RELIEF:
2578 {
2579 sal_Int16 nVal = -1;
2580 rVal >>= nVal;
2581 if(nVal >= 0 && nVal <= sal_Int16(FontRelief::Engraved))
2582 SetValue( static_cast<FontRelief>(nVal) );
2583 else
2584 bRet = false;
2585 }
2586 break;
2587 default:
2588 bRet = false;
2589 break;
2590 }
2591 return bRet;
2592}
2593
2594bool SvxCharReliefItem::QueryValue( css::uno::Any& rVal,
2595 sal_uInt8 nMemberId ) const
2596{
2597 nMemberId &= ~CONVERT_TWIPS;
2598 bool bRet = true;
2599 switch( nMemberId )
2600 {
2601 case MID_RELIEF:
2602 rVal <<= static_cast<sal_Int16>(GetValue());
2603 break;
2604 default:
2605 bRet = false;
2606 break;
2607 }
2608 return bRet;
2609}
2610
2611/*************************************************************************
2612|* class SvxScriptSetItem
2613*************************************************************************/
2614
2616 : SfxSetItem( nSlotId, SfxItemSet( rPool,
2617 svl::Items<SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONT> ))
2618{
2619 sal_uInt16 nLatin, nAsian, nComplex;
2620 GetWhichIds( nLatin, nAsian, nComplex );
2621 GetItemSet().MergeRange( nLatin, nLatin );
2622 GetItemSet().MergeRange( nAsian, nAsian );
2623 GetItemSet().MergeRange( nComplex, nComplex );
2624}
2625
2627{
2628 SvxScriptSetItem* p = new SvxScriptSetItem( Which(), *GetItemSet().GetPool() );
2629 p->GetItemSet().Put( GetItemSet(), false );
2630 return p;
2631}
2632
2634 const SfxItemSet& rSet, sal_uInt16 nId )
2635{
2636 const SfxPoolItem* pI;
2637 SfxItemState eSt = rSet.GetItemState( nId, false, &pI );
2638 if( SfxItemState::SET != eSt )
2639 pI = SfxItemState::DEFAULT == eSt ? &rSet.Get( nId ) : nullptr;
2640 return pI;
2641}
2642
2643const SfxPoolItem* SvxScriptSetItem::GetItemOfScript( sal_uInt16 nSlotId, const SfxItemSet& rSet, SvtScriptType nScript )
2644{
2645 sal_uInt16 nLatin, nAsian, nComplex;
2646 GetWhichIds( nSlotId, rSet, nLatin, nAsian, nComplex );
2647
2648 const SfxPoolItem *pRet, *pAsn, *pCmplx;
2649 if (nScript == SvtScriptType::ASIAN)
2650 {
2651 pRet = GetItemOfScriptSet( rSet, nAsian );
2652 } else if (nScript == SvtScriptType::COMPLEX)
2653 {
2654 pRet = GetItemOfScriptSet( rSet, nComplex );
2655 } else if (nScript == (SvtScriptType::LATIN|SvtScriptType::ASIAN))
2656 {
2657 if( nullptr == (pRet = GetItemOfScriptSet( rSet, nLatin )) ||
2658 nullptr == (pAsn = GetItemOfScriptSet( rSet, nAsian )) ||
2659 *pRet != *pAsn )
2660 pRet = nullptr;
2661 } else if (nScript == (SvtScriptType::LATIN|SvtScriptType::COMPLEX))
2662 {
2663 if( nullptr == (pRet = GetItemOfScriptSet( rSet, nLatin )) ||
2664 nullptr == (pCmplx = GetItemOfScriptSet( rSet, nComplex )) ||
2665 *pRet != *pCmplx )
2666 pRet = nullptr;
2667 } else if (nScript == (SvtScriptType::ASIAN|SvtScriptType::COMPLEX))
2668 {
2669 if( nullptr == (pRet = GetItemOfScriptSet( rSet, nAsian )) ||
2670 nullptr == (pCmplx = GetItemOfScriptSet( rSet, nComplex )) ||
2671 *pRet != *pCmplx )
2672 pRet = nullptr;
2673 } else if (nScript == (SvtScriptType::LATIN|SvtScriptType::ASIAN|SvtScriptType::COMPLEX))
2674 {
2675 if( nullptr == (pRet = GetItemOfScriptSet( rSet, nLatin )) ||
2676 nullptr == (pAsn = GetItemOfScriptSet( rSet, nAsian )) ||
2677 nullptr == (pCmplx = GetItemOfScriptSet( rSet, nComplex )) ||
2678 *pRet != *pAsn || *pRet != *pCmplx )
2679 pRet = nullptr;
2680 } else {
2681 //no one valid -> match to latin
2682 pRet = GetItemOfScriptSet( rSet, nLatin );
2683 }
2684 return pRet;
2685}
2686
2688{
2689 return GetItemOfScript( Which(), GetItemSet(), nScript );
2690}
2691
2693 const SfxPoolItem& rItem )
2694{
2695 sal_uInt16 nLatin, nAsian, nComplex;
2696 GetWhichIds( nLatin, nAsian, nComplex );
2697
2698 if( SvtScriptType::LATIN & nScriptType )
2699 {
2700 GetItemSet().Put( rItem.CloneSetWhich(nLatin) );
2701 }
2702 if( SvtScriptType::ASIAN & nScriptType )
2703 {
2704 GetItemSet().Put( rItem.CloneSetWhich(nAsian) );
2705 }
2706 if( SvtScriptType::COMPLEX & nScriptType )
2707 {
2708 GetItemSet().Put( rItem.CloneSetWhich(nComplex) );
2709 }
2710}
2711
2712void SvxScriptSetItem::GetWhichIds( sal_uInt16 nSlotId, const SfxItemSet& rSet, sal_uInt16& rLatin, sal_uInt16& rAsian, sal_uInt16& rComplex )
2713{
2714 const SfxItemPool& rPool = *rSet.GetPool();
2715 GetSlotIds( nSlotId, rLatin, rAsian, rComplex );
2716 rLatin = rPool.GetWhich( rLatin );
2717 rAsian = rPool.GetWhich( rAsian );
2718 rComplex = rPool.GetWhich( rComplex );
2719}
2720
2721void SvxScriptSetItem::GetWhichIds( sal_uInt16& rLatin, sal_uInt16& rAsian,
2722 sal_uInt16& rComplex ) const
2723{
2724 GetWhichIds( Which(), GetItemSet(), rLatin, rAsian, rComplex );
2725}
2726
2727void SvxScriptSetItem::GetSlotIds( sal_uInt16 nSlotId, sal_uInt16& rLatin,
2728 sal_uInt16& rAsian, sal_uInt16& rComplex )
2729{
2730 switch( nSlotId )
2731 {
2732 default:
2733 SAL_WARN( "editeng.items", "wrong SlotId for class SvxScriptSetItem" );
2734 [[fallthrough]]; // default to font - Id Range !!
2735
2736 case SID_ATTR_CHAR_FONT:
2737 rLatin = SID_ATTR_CHAR_FONT;
2738 rAsian = SID_ATTR_CHAR_CJK_FONT;
2739 rComplex = SID_ATTR_CHAR_CTL_FONT;
2740 break;
2741 case SID_ATTR_CHAR_FONTHEIGHT:
2742 rLatin = SID_ATTR_CHAR_FONTHEIGHT;
2743 rAsian = SID_ATTR_CHAR_CJK_FONTHEIGHT;
2744 rComplex = SID_ATTR_CHAR_CTL_FONTHEIGHT;
2745 break;
2746 case SID_ATTR_CHAR_WEIGHT:
2747 rLatin = SID_ATTR_CHAR_WEIGHT;
2748 rAsian = SID_ATTR_CHAR_CJK_WEIGHT;
2749 rComplex = SID_ATTR_CHAR_CTL_WEIGHT;
2750 break;
2751 case SID_ATTR_CHAR_POSTURE:
2752 rLatin = SID_ATTR_CHAR_POSTURE;
2753 rAsian = SID_ATTR_CHAR_CJK_POSTURE;
2754 rComplex = SID_ATTR_CHAR_CTL_POSTURE;
2755 break;
2756 case SID_ATTR_CHAR_LANGUAGE:
2757 rLatin = SID_ATTR_CHAR_LANGUAGE;
2758 rAsian = SID_ATTR_CHAR_CJK_LANGUAGE;
2759 rComplex = SID_ATTR_CHAR_CTL_LANGUAGE;
2760 break;
2761 case SID_ATTR_CHAR_SHADOWED:
2762 rLatin = SID_ATTR_CHAR_SHADOWED;
2763 rAsian = SID_ATTR_CHAR_SHADOWED;
2764 rComplex = SID_ATTR_CHAR_SHADOWED;
2765 break;
2766 case SID_ATTR_CHAR_STRIKEOUT:
2767 rLatin = SID_ATTR_CHAR_STRIKEOUT;
2768 rAsian = SID_ATTR_CHAR_STRIKEOUT;
2769 rComplex = SID_ATTR_CHAR_STRIKEOUT;
2770 break;
2771 }
2772}
2773
2774void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rComplex )
2775{
2776 const sal_uInt16 nItemCnt = 3;
2777
2778 static struct
2779 {
2780 DefaultFontType nFontType;
2781 LanguageType nLanguage;
2782 }
2783 const aOutTypeArr[ nItemCnt ] =
2784 {
2785 { DefaultFontType::LATIN_TEXT, LANGUAGE_ENGLISH_US },
2786 { DefaultFontType::CJK_TEXT, LANGUAGE_ENGLISH_US },
2787 { DefaultFontType::CTL_TEXT, LANGUAGE_ARABIC_SAUDI_ARABIA }
2788 };
2789
2790 SvxFontItem* aItemArr[ nItemCnt ] = { &rLatin, &rAsian, &rComplex };
2791
2792 for ( sal_uInt16 n = 0; n < nItemCnt; ++n )
2793 {
2794 vcl::Font aFont( OutputDevice::GetDefaultFont( aOutTypeArr[ n ].nFontType,
2795 aOutTypeArr[ n ].nLanguage,
2796 GetDefaultFontFlags::OnlyOne ) );
2797 SvxFontItem* pItem = aItemArr[ n ];
2798 pItem->SetFamily( aFont.GetFamilyType() );
2799 pItem->SetFamilyName( aFont.GetFamilyName() );
2800 pItem->SetStyleName( OUString() );
2801 pItem->SetPitch( aFont.GetPitch());
2802 pItem->SetCharSet(aFont.GetCharSet());
2803 }
2804}
2805
2806
2808{
2809 rVal <<= GetValue();
2810 return true;
2811}
2812
2814{
2815 sal_uInt32 nRsid = 0;
2816 if( !( rVal >>= nRsid ) )
2817 return false;
2818
2819 SetValue( nRsid );
2820 return true;
2821}
2822
2824{
2825 return new SvxRsidItem( *this );
2826}
2827
2829(
2830 SfxItemPresentation /*ePres*/,
2831 MapUnit /*eCoreUnit*/,
2832 MapUnit /*ePresUnit*/,
2833 OUString& rText, const IntlWrapper& /*rIntl*/
2834) const
2835{
2836 rText.clear();
2837 return false;
2838}
2839
2841{
2842 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxRsidItem"));
2843 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which());
2844 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("value"), "%" SAL_PRIuUINT32, GetValue());
2845 (void)xmlTextWriterEndElement(pWriter);
2846}
2847
2848/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
basegfx::BColor maColor
constexpr auto convertTwipToMm100(N n)
static tools::Long Scale(tools::Long nVal, tools::Long nMult, tools::Long nDiv)
sal_uInt16 GetValue() const
virtual bool operator==(const SfxPoolItem &rItem) const override
void SetValue(sal_uInt16 nTheValue)
void SetValue(sal_uInt32 nTheValue)
sal_uInt32 GetValue() const
sal_uInt8 GetAlpha() const
bool IsTransparent() const
void SetAlpha(sal_uInt8 nAlpha)
size_t GetFontNameCount() const
const FontMetric & GetFontName(size_t nFont) const
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
bool GetValue() const
void SetValue(EnumT nTheValue)
virtual bool operator==(SfxPoolItem const &other) const override
sal_Int16 GetValue() const
void SetValue(sal_Int16 nTheValue)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void MergeRange(sal_uInt16 nFrom, sal_uInt16 nTo)
sal_uInt32 GetRefCount() const
sal_uInt16 Which() const
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
const SfxItemSet & GetItemSet() const
static OUString GetLanguageString(const LanguageType eType)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:1304
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:96
SvxAutoKernItem(const bool bAutoKern, const sal_uInt16 nId)
Definition: textitem.cxx:1293
virtual SvxAutoKernItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1298
SvxBlinkItem(const bool bBlink, const sal_uInt16 nId)
Definition: textitem.cxx:2068
virtual SvxBlinkItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:2073
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:2079
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:1734
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:101
virtual sal_uInt16 GetValueCount() const override
Definition: textitem.cxx:1723
SvxCaseMapItem(const SvxCaseMap eMap, const sal_uInt16 nId)
Definition: textitem.cxx:1718
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:1776
static OUString GetValueTextByPos(sal_uInt16 nPos)
Definition: textitem.cxx:1745
virtual SvxCaseMapItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1728
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:1761
virtual sal_uInt16 GetValueCount() const override
Definition: textitem.cxx:2553
virtual SvxCharReliefItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:2535
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:107
static OUString GetValueTextByPos(sal_uInt16 nPos)
Definition: textitem.cxx:2547
SvxCharReliefItem(FontRelief eValue, const sal_uInt16 nId)
Definition: textitem.cxx:2529
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:2570
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:2559
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:2594
virtual SvxCharRotateItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:2392
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: textitem.cxx:2462
bool IsFitToLine() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:2415
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:2397
void SetFitToLine(bool b)
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:105
SvxCharRotateItem(Degree10 nValue, bool bFitIntoLine, TypedWhichId< SvxCharRotateItem > nId)
Definition: textitem.cxx:2385
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:2434
virtual bool operator==(const SfxPoolItem &) const override
Definition: textitem.cxx:2455
virtual SvxCharScaleWidthItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:2481
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:2486
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:106
SvxCharScaleWidthItem(sal_uInt16 nValue, TypedWhichId< SvxCharScaleWidthItem > nId)
Definition: textitem.cxx:2475
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:2502
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:2517
SvxColorItem item describes a color.
Definition: colritem.hxx:32
SvxColorItem(const sal_uInt16 nId)
Definition: textitem.cxx:1377
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const override
Definition: textitem.cxx:1592
virtual SvxColorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1586
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:1486
virtual bool operator==(const SfxPoolItem &rPoolItem) const override
Definition: textitem.cxx:1400
Color mColor
Definition: colritem.hxx:34
virtual ~SvxColorItem() override
Definition: textitem.cxx:1396
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:99
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:1409
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: textitem.cxx:1603
model::ComplexColor maComplexColor
Definition: colritem.hxx:35
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:1361
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:98
virtual SvxContourItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1355
SvxContourItem(const bool bContoured, const sal_uInt16 nId)
Definition: textitem.cxx:1350
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:94
virtual sal_uInt16 GetValueCount() const override
Definition: textitem.cxx:1190
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:1201
void SetValue(EnumT nTheValue)
virtual SvxCrossedOutItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1195
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:1229
static OUString GetValueTextByPos(sal_uInt16 nPos)
Definition: textitem.cxx:1212
virtual bool GetBoolValue() const override
Definition: textitem.cxx:1178
virtual void SetBoolValue(bool bVal) override
Definition: textitem.cxx:1184
virtual bool HasBoolValue() const override
Definition: textitem.cxx:1172
SvxCrossedOutItem(const FontStrikeout eSt, const sal_uInt16 nId)
Definition: textitem.cxx:1166
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:1244
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:2108
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:2138
SvxEmphasisMarkItem(const FontEmphasisMark eVal, TypedWhichId< SvxEmphasisMarkItem > nId)
Definition: textitem.cxx:2096
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:104
FontEmphasisMark GetEmphasisMark() const
virtual SvxEmphasisMarkItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:2102
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:2165
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:1896
void SetEscapement(const SvxEscapement eNew)
virtual void SetEnumValue(sal_uInt16 nNewVal) override
Definition: textitem.cxx:1891
virtual bool operator==(const SfxPoolItem &) const override
Definition: textitem.cxx:1828
static OUString GetValueTextByPos(sal_uInt16 nPos)
Definition: textitem.cxx:1867
virtual SvxEscapementItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1836
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:1914
SvxEscapementItem(const sal_uInt16 nId)
Definition: textitem.cxx:1798
virtual sal_uInt16 GetValueCount() const override
Definition: textitem.cxx:1841
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:102
virtual sal_uInt16 GetEnumValue() const override
Definition: textitem.cxx:1881
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:1848
sal_uInt32 GetHeight() const
Definition: fhgtitem.hxx:74
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:91
MapUnit GetPropUnit() const
Definition: fhgtitem.hxx:85
SvxFontHeightItem(const sal_uInt32 nSz, const sal_uInt16 nPropHeight, const sal_uInt16 nId)
Definition: textitem.cxx:612
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:856
sal_uInt32 nHeight
Definition: fhgtitem.hxx:40
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:633
sal_uInt16 GetProp() const
Definition: fhgtitem.hxx:83
void SetHeight(sal_uInt32 nNewHeight, const sal_uInt16 nNewProp=100, MapUnit eUnit=MapUnit::MapRelative)
Definition: textitem.cxx:893
virtual bool operator==(const SfxPoolItem &) const override
Definition: textitem.cxx:625
sal_uInt16 nProp
Definition: fhgtitem.hxx:41
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:771
virtual SvxFontHeightItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:620
virtual void ScaleMetrics(tools::Long nMult, tools::Long nDiv) override
Definition: textitem.cxx:882
MapUnit ePropUnit
Definition: fhgtitem.hxx:42
virtual bool HasMetrics() const override
Definition: textitem.cxx:888
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: textitem.cxx:929
This item describes a Font.
Definition: fontitem.hxx:30
void SetStyleName(const OUString &rStyleName)
Definition: fontitem.hxx:68
FontFamily GetFamily() const
Definition: fontitem.hxx:81
FontPitch GetPitch() const
Definition: fontitem.hxx:90
void SetFamily(FontFamily _eFamily)
Definition: fontitem.hxx:77
OUString aStyleName
Definition: fontitem.hxx:32
void SetPitch(FontPitch _ePitch)
Definition: fontitem.hxx:86
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:88
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: textitem.cxx:364
const OUString & GetStyleName() const
Definition: fontitem.hxx:72
FontPitch ePitch
Definition: fontitem.hxx:34
void SetFamilyName(const OUString &rFamilyName)
Definition: fontitem.hxx:59
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:352
rtl_TextEncoding GetCharSet() const
Definition: fontitem.hxx:99
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:203
bool operator<(const SfxPoolItem &rCmp) const override
Definition: textitem.cxx:316
virtual SvxFontItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:346
FontFamily eFamily
Definition: fontitem.hxx:33
SvxFontItem(const sal_uInt16 nId)
Definition: textitem.cxx:179
OUString aFamilyName
Definition: fontitem.hxx:31
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: textitem.cxx:295
const OUString & GetFamilyName() const
Definition: fontitem.hxx:63
void SetCharSet(rtl_TextEncoding _eEncoding)
Definition: fontitem.hxx:95
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:232
rtl_TextEncoding eTextEncoding
Definition: fontitem.hxx:35
const FontList * pFontList
Definition: flstitem.hxx:41
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:140
SvxFontListItem(const FontList *pFontLst, const sal_uInt16 nId)
Definition: textitem.cxx:112
css::uno::Sequence< OUString > aFontNameSeq
Definition: flstitem.hxx:42
virtual SvxFontListItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:128
virtual bool operator==(const SfxPoolItem &) const override
Definition: textitem.cxx:133
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:148
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:100
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:1696
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:1662
virtual SvxKerningItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1644
SvxKerningItem(const short nKern, const sal_uInt16 nId)
Definition: textitem.cxx:1639
virtual bool HasMetrics() const override
Definition: textitem.cxx:1655
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:1705
virtual void ScaleMetrics(tools::Long nMult, tools::Long nDiv) override
Definition: textitem.cxx:1649
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:1981
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:2008
SvxLanguageItem(const LanguageType eLang, const sal_uInt16 nId)
Definition: textitem.cxx:1960
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:103
virtual sal_uInt16 GetValueCount() const override
Definition: textitem.cxx:1966
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:1992
virtual SvxLanguageItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1975
SvxNoHyphenItem(const sal_uInt16 nId)
Definition: textitem.cxx:2037
virtual SvxNoHyphenItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:2042
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:2048
virtual OUString GetValueTextByPos(sal_uInt16 nPos) const override
Definition: textitem.cxx:1135
SvxOverlineItem(const FontLineStyle eSt, const sal_uInt16 nId)
Definition: textitem.cxx:1125
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:93
virtual SvxOverlineItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1130
virtual void SetBoolValue(bool bVal) override
Definition: textitem.cxx:475
virtual sal_uInt16 GetValueCount() const override
Definition: textitem.cxx:388
virtual bool GetBoolValue() const override
Definition: textitem.cxx:470
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:89
virtual SvxPostureItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:383
virtual bool HasBoolValue() const override
Definition: textitem.cxx:465
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:425
SvxPostureItem(const FontItalic ePost, const sal_uInt16 nId)
Definition: textitem.cxx:378
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: textitem.cxx:480
static OUString GetValueTextByPos(sal_uInt16 nPos)
Definition: textitem.cxx:407
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:440
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:395
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:2807
virtual SvxRsidItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:2823
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:2829
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: textitem.cxx:2840
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:2813
SvxRsidItem(sal_uInt32 nRsid, sal_uInt16 nId)
Definition: rsiditem.hxx:22
static void GetSlotIds(sal_uInt16 nSlotId, sal_uInt16 &rLatin, sal_uInt16 &rAsian, sal_uInt16 &rComplex)
Definition: textitem.cxx:2727
static const SfxPoolItem * GetItemOfScript(sal_uInt16 nSlotId, const SfxItemSet &rSet, SvtScriptType nScript)
Definition: textitem.cxx:2643
static void GetWhichIds(sal_uInt16 nSlotId, const SfxItemSet &rSet, sal_uInt16 &rLatin, sal_uInt16 &rAsian, sal_uInt16 &rComplex)
Definition: textitem.cxx:2712
void PutItemForScriptType(SvtScriptType nScriptType, const SfxPoolItem &rItem)
Definition: textitem.cxx:2692
SvxScriptSetItem(sal_uInt16 nSlotId, SfxItemPool &rPool)
Definition: textitem.cxx:2615
static const SfxPoolItem * GetItemOfScriptSet(const SfxItemSet &rSet, sal_uInt16 nWhich)
Definition: textitem.cxx:2633
virtual SvxScriptSetItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:2626
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:95
virtual SvxShadowedItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1270
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:1276
SvxShadowedItem(const bool bShadowed, const sal_uInt16 nId)
Definition: textitem.cxx:1265
virtual bool operator==(const SfxPoolItem &) const override
Definition: textitem.cxx:1074
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:997
model::ComplexColor maComplexColor
Definition: udlnitem.hxx:34
SvxTextLineItem(const FontLineStyle eSt, const sal_uInt16 nId)
Definition: textitem.cxx:941
void SetValue(EnumT nTheValue)
virtual void SetBoolValue(bool bVal) override
Definition: textitem.cxx:960
virtual SvxTextLineItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:965
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:977
virtual bool HasBoolValue() const override
Definition: textitem.cxx:948
virtual OUString GetValueTextByPos(sal_uInt16 nPos) const
Definition: textitem.cxx:991
virtual sal_uInt16 GetValueCount() const override
Definition: textitem.cxx:970
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:1024
virtual bool GetBoolValue() const override
Definition: textitem.cxx:954
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:2351
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:2318
SvxTextRotateItem(Degree10 nValue, TypedWhichId< SvxTextRotateItem > nId)
Definition: textitem.cxx:2308
virtual SvxTextRotateItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:2313
Degree10 GetValue() const
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: textitem.cxx:2372
void SetValue(Degree10 val)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:2334
virtual SvxTwoLinesItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:2218
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:2256
sal_Unicode GetStartBracket() const
sal_Unicode cEndBracket
bool GetValue() const
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntl) const override
Definition: textitem.cxx:2286
SvxTwoLinesItem(bool bOn, sal_Unicode nStartBracket, sal_Unicode nEndBracket, sal_uInt16 nId)
Definition: textitem.cxx:2199
virtual ~SvxTwoLinesItem() override
Definition: textitem.cxx:2206
sal_Unicode GetEndBracket() const
virtual bool operator==(const SfxPoolItem &) const override
Definition: textitem.cxx:2210
sal_Unicode cStartBracket
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:2223
SvxUnderlineItem(const FontLineStyle eSt, const sal_uInt16 nId)
Definition: textitem.cxx:1084
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:92
virtual SvxUnderlineItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1089
virtual OUString GetValueTextByPos(sal_uInt16 nPos) const override
Definition: textitem.cxx:1094
virtual bool HasBoolValue() const override
Definition: textitem.cxx:497
virtual bool GetBoolValue() const override
Definition: textitem.cxx:503
static OUString GetValueTextByPos(sal_uInt16 nPos)
Definition: textitem.cxx:537
SvxWeightItem(const FontWeight eWght, const sal_uInt16 nId)
Definition: textitem.cxx:491
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: textitem.cxx:559
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: textitem.cxx:601
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:526
virtual SvxWeightItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:520
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:90
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: textitem.cxx:576
virtual void SetBoolValue(bool bVal) override
Definition: textitem.cxx:509
virtual sal_uInt16 GetValueCount() const override
Definition: textitem.cxx:515
SvxWordLineModeItem(const bool bWordLineMode, const sal_uInt16 nId)
Definition: textitem.cxx:1321
virtual SvxWordLineModeItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: textitem.cxx:1327
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: textitem.cxx:1333
static SfxPoolItem * CreateDefault()
Definition: textitem.cxx:97
ThemeColorType meSchemeType
void setSchemeColor(ThemeColorType eType)
std::vector< Transformation > const & getTransformations() const
void removeTransformations(TransformationType eType)
void addTransformation(Transformation const &rTransform)
FontFamily GetFamilyType()
const OUString & GetFamilyName() const
FontPitch GetPitch()
rtl_TextEncoding GetCharSet() const
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
int nCount
#define DBG_ASSERT(sCon, aError)
double toDegrees(D x)
OUString EditResId(TranslateId aId)
Definition: eerdll.cxx:192
#define DFLT_ESC_PROP
#define MAX_ESC_POS
#define DFLT_ESC_AUTO_SUB
#define DFLT_ESC_AUTO_SUPER
struct _xmlTextWriter * xmlTextWriterPtr
sal_Int16 nValue
FontRelief
DefaultFontType
FontLineStyle
LINESTYLE_SINGLE
LINESTYLE_BOLDWAVE
LINESTYLE_NONE
LINESTYLE_DOTTED
FontStrikeout
STRIKEOUT_DOUBLE
STRIKEOUT_SINGLE
STRIKEOUT_X
STRIKEOUT_NONE
FontPitch
PITCH_VARIABLE
FontItalic
ITALIC_NORMAL
ITALIC_NONE
ITALIC_OBLIQUE
FontEmphasisMark
FontFamily
FAMILY_SWISS
WEIGHT_BOLD
WEIGHT_NORMAL
WEIGHT_BLACK
sal_Int32 nIndex
OUString aName
OUString GetColorString(const Color &rCol)
Definition: itemtype.cxx:137
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
void * p
sal_Int64 n
#define LANGUAGE_ARABIC_SAUDI_ARABIA
#define LANGUAGE_GERMAN
#define LANGUAGE_ENGLISH_US
SvtScriptType
sal_uInt16 nPos
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
#define SAL_N_ELEMENTS(arr)
MapUnit
#define MID_TL_HASCOLOR
Definition: memberids.h:94
#define MID_LANG_LOCALE
Definition: memberids.h:111
#define MID_ESC
Definition: memberids.h:81
#define MID_RELIEF
Definition: memberids.h:74
#define MID_EMPHASIS
Definition: memberids.h:114
#define MID_FONT_PITCH
Definition: memberids.h:71
#define MID_TEXTLINED
Definition: memberids.h:91
#define MID_BOLD
Definition: memberids.h:106
#define MID_ITALIC
Definition: memberids.h:102
#define MID_FONT_CHAR_SET
Definition: memberids.h:70
#define MID_START_BRACKET
Definition: memberids.h:118
#define MID_POSTURE
Definition: memberids.h:103
#define MID_FONTHEIGHT
Definition: memberids.h:86
#define MID_COLOR_RGB
Definition: memberids.h:191
#define MID_COLOR_ALPHA
Definition: memberids.h:192
#define MID_COLOR_LUM_MOD
Definition: memberids.h:196
#define MID_TWOLINES
Definition: memberids.h:117
#define MID_FONT_FAMILY
Definition: memberids.h:69
#define MID_COMPLEX_COLOR_JSON
Definition: memberids.h:198
#define MID_ROTATE
Definition: memberids.h:77
#define MID_CROSSED_OUT
Definition: memberids.h:98
#define MID_COMPLEX_COLOR
Definition: memberids.h:199
#define MID_FONTHEIGHT_DIFF
Definition: memberids.h:88
#define MID_LANG_INT
Definition: memberids.h:110
#define MID_TL_COMPLEX_COLOR
Definition: memberids.h:95
#define MID_WEIGHT
Definition: memberids.h:107
#define MID_COLOR_TINT_OR_SHADE
Definition: memberids.h:195
#define MID_FITTOLINE
Definition: memberids.h:78
#define MID_AUTO_ESC
Definition: memberids.h:83
#define MID_TL_STYLE
Definition: memberids.h:92
#define MID_COLOR_THEME_INDEX
Definition: memberids.h:194
#define MID_GRAPHIC_TRANSPARENT
Definition: memberids.h:169
#define MID_ESC_HEIGHT
Definition: memberids.h:82
#define MID_END_BRACKET
Definition: memberids.h:119
#define MID_TL_COLOR
Definition: memberids.h:93
#define MID_COLOR_LUM_OFF
Definition: memberids.h:197
#define MID_FONTHEIGHT_PROP
Definition: memberids.h:87
#define MID_CROSS_OUT
Definition: memberids.h:99
#define MID_FONT_FAMILY_NAME
Definition: memberids.h:67
#define MID_FONT_STYLE_NAME
Definition: memberids.h:68
aStr
B2IRange fround(const B2DRange &rRange)
int i
model::ComplexColor getFromXComplexColor(uno::Reference< util::XComplexColor > const &rxColor)
bool convertFromJSON(OString const &rJsonString, model::ComplexColor &rComplexColor)
OString convertToJSON(model::ComplexColor const &rComplexColor)
uno::Reference< util::XComplexColor > createXComplexColor(model::ComplexColor const &rColor)
constexpr ThemeColorType convertToThemeColorType(sal_Int32 nIndex)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
constexpr auto toTwips(N number, Length from)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
FontWeight
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
long Long
VCL_DLLPUBLIC css::awt::FontSlant ConvertFontSlant(FontItalic eWeight)
VCL_DLLPUBLIC float ConvertFontWeight(FontWeight eWeight)
sal_Int16 nId
SfxItemPresentation
#define CONVERT_TWIPS
SfxItemState
bool Any2Bool(const css::uno::Any &rValue)
static SfxItemSet & rSet
SvxEscapement
Definition: svxenum.hxx:35
SvxCaseMap
Definition: svxenum.hxx:25
void GetDefaultFonts(SvxFontItem &rLatin, SvxFontItem &rAsian, SvxFontItem &rComplex)
Definition: textitem.cxx:2774
static TranslateId RID_SVXITEMS_RELIEF[]
Definition: textitem.cxx:2540
static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, MapUnit eProp, bool bCoreInTwip)
Definition: textitem.cxx:732
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
signed char sal_Int8