LibreOffice Module svx (master) 1
xattr.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <utility>
23
24#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
25#include <com/sun/star/drawing/Hatch.hpp>
26#include <com/sun/star/drawing/LineStyle.hpp>
27#include <com/sun/star/drawing/LineDash.hpp>
28#include <com/sun/star/drawing/DashStyle.hpp>
29#include <com/sun/star/drawing/FillStyle.hpp>
30#include <com/sun/star/awt/Gradient2.hpp>
31#include <com/sun/star/uno/Sequence.hxx>
32#include <com/sun/star/beans/PropertyValue.hpp>
33
35#include <o3tl/string_view.hxx>
36#include <o3tl/any.hxx>
37#include <svl/itempool.hxx>
38#include <editeng/memberids.h>
41#include <tools/mapunit.hxx>
43#include <osl/diagnose.h>
44
45#include <svx/unoapi.hxx>
46#include <svl/style.hxx>
47
48#include <tools/bigint.hxx>
49#include <svl/itemset.hxx>
50#include <svx/strings.hrc>
51#include <svx/xfillit0.hxx>
52#include <svx/xflasit.hxx>
53#include <svx/xlineit0.hxx>
54#include <svx/xlnasit.hxx>
55#include <svx/xtextit0.hxx>
56#include <svx/xtable.hxx>
57#include <svx/dialmgr.hxx>
58#include <svx/xflclit.hxx>
59#include <svx/xflgrit.hxx>
60#include <svx/xflftrit.hxx>
61#include <svx/xsflclit.hxx>
62#include <svx/xflhtit.hxx>
63#include <svx/xbtmpit.hxx>
64#include <svx/xlndsit.hxx>
65#include <svx/xlnwtit.hxx>
66#include <svx/xlnclit.hxx>
67#include <svx/xlnstit.hxx>
68#include <svx/xlnedit.hxx>
69#include <svx/xlnstwit.hxx>
70#include <svx/xlnedwit.hxx>
71#include <svx/xlnstcit.hxx>
72#include <svx/xlnedcit.hxx>
73#include <editeng/itemtype.hxx>
74#include <editeng/eerdll.hxx>
75#include <svx/xdef.hxx>
76#include <svx/unomid.hxx>
77#include <svx/svdmodel.hxx>
78#include <svx/xftdiit.hxx>
79#include <svx/xftstit.hxx>
80#include <svx/xftmrit.hxx>
81#include <svx/xftouit.hxx>
82#include <svx/xftshit.hxx>
83#include <svx/xftshcit.hxx>
84#include <svx/xftshxy.hxx>
85#include <svx/xftadit.hxx>
86#include <svx/svddef.hxx>
90#include <string>
91
92#include <boost/property_tree/json_parser.hpp>
93#include <libxml/xmlwriter.h>
94
95using namespace ::com::sun::star;
96
97typedef std::map<OUString, OUString> StringMap;
98
100 SfxStringItem(_nWhich, OUString()),
101 nPalIndex(nIndex)
102{
103}
104
106 SfxStringItem(_nWhich, rName),
107 nPalIndex(-1)
108{
109}
110
112 SfxStringItem(rNameOrIndex),
113 nPalIndex(rNameOrIndex.nPalIndex)
114{
115}
116
117bool NameOrIndex::operator==(const SfxPoolItem& rItem) const
118{
119 return ( SfxStringItem::operator==(rItem) &&
120 static_cast<const NameOrIndex&>(rItem).nPalIndex == nPalIndex );
121}
122
124{
125 return new NameOrIndex(*this);
126}
127
133OUString NameOrIndex::CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uInt16 nWhich, const SfxItemPool* pPool1, SvxCompareValueFunc pCompareValueFunc, TranslateId pPrefixResId, const XPropertyListRef &pDefaults )
134{
135 bool bForceNew = false;
136
137 OUString aUniqueName = SvxUnogetInternalNameForItem(nWhich, pCheckItem->GetName());
138
139 // 2. if we have a name check if there is already an item with the
140 // same name in the documents pool with a different line end or start
141
142 if (!aUniqueName.isEmpty() && pPool1)
143 {
144 for (const SfxPoolItem* pItem : pPool1->GetItemSurrogates(nWhich))
145 {
146 const NameOrIndex *pNameOrIndex = static_cast<const NameOrIndex*>(pItem);
147
148 if( pNameOrIndex->GetName() == pCheckItem->GetName() )
149 {
150 // if there is already an item with the same name and the same
151 // value it's ok to set it
152 if( !pCompareValueFunc( pNameOrIndex, pCheckItem ) )
153 {
154 // same name but different value, we need a new name for this item
155 aUniqueName.clear();
156 bForceNew = true;
157 }
158 break;
159 }
160 }
161 }
162
163 // if we have no name yet, find existing item with same content or
164 // create a unique name
165 if (aUniqueName.isEmpty())
166 {
167 sal_Int32 nUserIndex = 1;
168 const OUString aUser(SvxResId(pPrefixResId) + " ");
169
170 if( pDefaults )
171 {
172 const int nCount = pDefaults->Count();
173 int nIndex;
174 for( nIndex = 0; nIndex < nCount; nIndex++ )
175 {
176 const XPropertyEntry* pEntry = pDefaults->Get(nIndex);
177 if( pEntry )
178 {
179 bool bFound = false;
180
181 switch( nWhich )
182 {
183 case XATTR_FILLBITMAP:
184 {
185 const GraphicObject& rGraphicObjectA(static_cast<const XFillBitmapItem*>(pCheckItem)->GetGraphicObject());
186 const GraphicObject& rGraphicObjectB(static_cast<const XBitmapEntry*>(pEntry)->GetGraphicObject());
187
188 bFound = (rGraphicObjectA == rGraphicObjectB);
189 break;
190 }
191 case XATTR_LINEDASH:
192 bFound = static_cast<const XLineDashItem*>(pCheckItem)->GetDashValue() == static_cast<const XDashEntry*>(pEntry)->GetDash();
193 break;
194 case XATTR_LINESTART:
195 bFound = static_cast<const XLineStartItem*>(pCheckItem)->GetLineStartValue() == static_cast<const XLineEndEntry*>(pEntry)->GetLineEnd();
196 break;
197 case XATTR_LINEEND:
198 bFound = static_cast<const XLineEndItem*>(pCheckItem)->GetLineEndValue() == static_cast<const XLineEndEntry*>(pEntry)->GetLineEnd();
199 break;
201 bFound = static_cast<const XFillGradientItem*>(pCheckItem)->GetGradientValue() == static_cast<const XGradientEntry*>(pEntry)->GetGradient();
202 break;
203 case XATTR_FILLHATCH:
204 bFound = static_cast<const XFillHatchItem*>(pCheckItem)->GetHatchValue() == static_cast<const XHatchEntry*>(pEntry)->GetHatch();
205 break;
206 }
207
208 if( bFound )
209 {
210 aUniqueName = pEntry->GetName();
211 break;
212 }
213 else
214 {
215 const OUString& aEntryName = pEntry->GetName();
216 if(aEntryName.getLength() >= aUser.getLength())
217 {
218 sal_Int32 nThisIndex = o3tl::toInt32(aEntryName.subView( aUser.getLength() ));
219 if( nThisIndex >= nUserIndex )
220 nUserIndex = nThisIndex + 1;
221 }
222 }
223 }
224 }
225 }
226
227 if (aUniqueName.isEmpty() && pPool1)
228 {
229 for (const SfxPoolItem* pItem : pPool1->GetItemSurrogates(nWhich))
230 {
231 const NameOrIndex *pNameOrIndex = static_cast<const NameOrIndex*>(pItem);
232
233 if( !pNameOrIndex->GetName().isEmpty() )
234 {
235 if( !bForceNew && pCompareValueFunc( pNameOrIndex, pCheckItem ) )
236 return pNameOrIndex->GetName();
237
238 if( pNameOrIndex->GetName().startsWith( aUser ) )
239 {
240 sal_Int32 nThisIndex = o3tl::toInt32(pNameOrIndex->GetName().subView( aUser.getLength() ));
241 if( nThisIndex >= nUserIndex )
242 nUserIndex = nThisIndex + 1;
243 }
244 }
245 }
246 aUniqueName = aUser + OUString::number( nUserIndex );
247 }
248 }
249
250 return aUniqueName;
251}
252
254{
255 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("NameOrIndex"));
256 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
257 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("isIndex"), BAD_CAST(OString::boolean(IsIndex()).getStr()));
258 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr()));
259 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"), BAD_CAST(OString::number(nPalIndex).getStr()));
260 (void)xmlTextWriterEndElement(pWriter);
261}
262
264
265XColorItem::XColorItem(TypedWhichId<XColorItem> _nWhich, sal_Int32 nIndex, const Color& rTheColor) :
266 NameOrIndex(_nWhich, nIndex),
267 aColor(rTheColor)
268{
269}
270
271XColorItem::XColorItem(TypedWhichId<XColorItem> _nWhich, const OUString& rName, const Color& rTheColor) :
272 NameOrIndex(_nWhich, rName),
273 aColor(rTheColor)
274{
275}
276
278 : NameOrIndex(_nWhich, OUString())
279 , aColor(rTheColor)
280{
281}
282
284 NameOrIndex(rItem),
285 aColor(rItem.aColor),
286 maComplexColor(rItem.maComplexColor)
287{
288}
289
291{
292 return new XColorItem(*this);
293}
294
295bool XColorItem::operator==(const SfxPoolItem& rItem) const
296{
297 return ( NameOrIndex::operator==(rItem) &&
298 static_cast<const XColorItem&>(rItem).aColor == aColor ) &&
299 static_cast<const XColorItem&>(rItem).maComplexColor == maComplexColor;
300}
301
303{
304 assert(!IsIndex());
305 return aColor;
306
307}
308
309bool XColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId) const
310{
311 nMemberId &= ~CONVERT_TWIPS;
312 switch (nMemberId)
313 {
315 {
317 rVal <<= xComplexColor;
318 break;
319 }
321 {
322 rVal <<= OStringToOUString(model::color::convertToJSON(getComplexColor()), RTL_TEXTENCODING_UTF8);
323 break;
324 }
325 default:
326 {
327 rVal <<= GetColorValue().GetRGBColor();
328 break;
329 }
330 }
331 return true;
332}
333
334bool XColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId)
335{
336 nMemberId &= ~CONVERT_TWIPS;
337 switch (nMemberId)
338 {
340 {
341 css::uno::Reference<css::util::XComplexColor> xComplexColor;
342 if (!(rVal >>= xComplexColor))
343 return false;
345 }
346 break;
348 {
349 OUString sComplexColorJson;
350 if (!(rVal >>= sComplexColorJson))
351 return false;
352
353 if (sComplexColorJson.isEmpty())
354 return false;
355
356 OString aJSON = OUStringToOString(sComplexColorJson, RTL_TEXTENCODING_ASCII_US);
357 model::ComplexColor aComplexColor;
358 model::color::convertFromJSON(aJSON, aComplexColor);
359 setComplexColor(aComplexColor);
360 }
361 break;
362 default:
363 {
365 if(!(rVal >>= nValue ))
366 return false;
367
369
370 }
371 break;
372 }
373 return true;
374}
375
377{
378 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("XColorItem"));
379 if (Which() == SDRATTR_SHADOWCOLOR)
380 {
381 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("SDRATTR_SHADOWCOLOR"));
382 }
383 else if (Which() == XATTR_FILLCOLOR)
384 {
385 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("XATTR_FILLCOLOR"));
386 }
387 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aColor"),
388 BAD_CAST(aColor.AsRGBHexString().toUtf8().getStr()));
389
390 NameOrIndex::dumpAsXml(pWriter);
391
392 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("complex-color"));
393
394 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("scheme-index"),
395 BAD_CAST(OString::number(sal_Int16(maComplexColor.getSchemeType())).getStr()));
396
397 for (auto const& rTransform : maComplexColor.getTransformations())
398 {
399 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("transformation"));
400 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"),
401 BAD_CAST(OString::number(sal_Int16(rTransform.meType)).getStr()));
402 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
403 BAD_CAST(OString::number(rTransform.mnValue).getStr()));
404 (void)xmlTextWriterEndElement(pWriter);
405 }
406
407 (void)xmlTextWriterEndElement(pWriter);
408
409 (void)xmlTextWriterEndElement(pWriter);
410}
411
412// --- line attributes ---
413
414
416
417XLineStyleItem::XLineStyleItem(css::drawing::LineStyle eTheLineStyle) :
418 SfxEnumItem(XATTR_LINESTYLE, eTheLineStyle)
419{
420}
421
423{
424 return new XLineStyleItem( *this );
425}
426
428(
429 SfxItemPresentation /*ePres*/,
430 MapUnit /*eCoreUnit*/,
431 MapUnit /*ePresUnit*/,
432 OUString& rText, const IntlWrapper&
433) const
434{
435 rText.clear();
436
437 TranslateId pId;
438
439 switch( GetValue() )
440 {
441 case css::drawing::LineStyle_NONE:
442 pId = RID_SVXSTR_INVISIBLE;
443 break;
444 case css::drawing::LineStyle_SOLID:
445 pId = RID_SVXSTR_SOLID;
446 break;
447 default: break;
448 }
449
450 if (pId)
451 rText = SvxResId(pId);
452 return true;
453}
454
455bool XLineStyleItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
456{
457 css::drawing::LineStyle eLS = GetValue();
458 rVal <<= eLS;
459 return true;
460}
461
462bool XLineStyleItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
463{
464 css::drawing::LineStyle eLS;
465 if(!(rVal >>= eLS ))
466 {
467 // also try an int (for Basic)
468 sal_Int32 nLS = 0;
469 if(!(rVal >>= nLS))
470 return false;
471 eLS = static_cast<css::drawing::LineStyle>(nLS);
472 }
473
474 SetValue( eLS );
475 return true;
476}
477
479{
480 return 3;
481}
482
483XDash::XDash(css::drawing::DashStyle eTheDash, sal_uInt16 nTheDots, double nTheDotLen,
484 sal_uInt16 nTheDashes, double nTheDashLen, double nTheDistance) :
485 eDash(eTheDash),
486 nDots(nTheDots),
487 nDashes(nTheDashes),
488 nDotLen(nTheDotLen),
489 nDashLen(nTheDashLen),
490 nDistance(nTheDistance)
491{
492}
493
494bool XDash::operator==(const XDash& rDash) const
495{
496 return ( eDash == rDash.eDash &&
497 nDots == rDash.nDots &&
498 nDotLen == rDash.nDotLen &&
499 nDashes == rDash.nDashes &&
500 nDashLen == rDash.nDashLen &&
501 nDistance == rDash.nDistance );
502}
503
504// XDash is translated into an array of doubles which describe the lengths of the
505// dashes, dots and empty passages. It returns the complete length of the full DashDot
506// sequence and fills the given vector of doubles accordingly (also resizing, so deleting it).
507const double SMALLEST_DASH_WIDTH(26.95);
508
509double XDash::CreateDotDashArray(::std::vector< double >& rDotDashArray, double fLineWidth) const
510{
511 double fFullDotDashLen(0.0);
512 const sal_uInt16 nNumDotDashArray = (GetDots() + GetDashes()) * 2;
513 rDotDashArray.resize( nNumDotDashArray, 0.0 );
514 sal_uInt16 a;
515 sal_uInt16 nIns(0);
516 double fDashDotDistance = GetDistance();
517 double fSingleDashLen = GetDashLen();
518 double fSingleDotLen = GetDotLen();
519
520 if (fLineWidth == 0.0)
521 fLineWidth = SMALLEST_DASH_WIDTH;
522
523 if(GetDashStyle() == css::drawing::DashStyle_RECTRELATIVE || GetDashStyle() == css::drawing::DashStyle_ROUNDRELATIVE)
524 {
525 double fFactor = fLineWidth / 100.0;
526
527 if(GetDashes())
528 {
529 if(GetDashLen())
530 {
531 // is a dash
532 fSingleDashLen *= fFactor;
533 }
534 else
535 {
536 // is a dot
537 fSingleDashLen = fLineWidth;
538 }
539 }
540
541 if(GetDots())
542 {
543 if(GetDotLen())
544 {
545 // is a dash
546 fSingleDotLen *= fFactor;
547 }
548 else
549 {
550 // is a dot
551 fSingleDotLen = fLineWidth;
552 }
553 }
554
555 if(GetDashes() || GetDots())
556 {
557 if(GetDistance())
558 {
559 // dash as distance
560 fDashDotDistance *= fFactor;
561 }
562 else
563 {
564 // dot as distance
565 fDashDotDistance = fLineWidth;
566 }
567 }
568 }
569 else
570 {
571 // absolute values
572 if(GetDashes())
573 {
574 if(GetDashLen())
575 {
576 // is a dash
577 if(fSingleDashLen < SMALLEST_DASH_WIDTH)
578 {
579 fSingleDashLen = SMALLEST_DASH_WIDTH;
580 }
581 }
582 else
583 {
584 // is a dot
585 if(fSingleDashLen < fLineWidth)
586 {
587 fSingleDashLen = fLineWidth;
588 }
589 }
590 }
591
592 if(GetDots())
593 {
594 if(GetDotLen())
595 {
596 // is a dash
597 if(fSingleDotLen < SMALLEST_DASH_WIDTH)
598 {
599 fSingleDotLen = SMALLEST_DASH_WIDTH;
600 }
601 }
602 else
603 {
604 // is a dot
605 if(fSingleDotLen < fLineWidth)
606 {
607 fSingleDotLen = fLineWidth;
608 }
609 }
610 }
611
612 if(GetDashes() || GetDots())
613 {
614 if(GetDistance())
615 {
616 // dash as distance
617 if(fDashDotDistance < SMALLEST_DASH_WIDTH)
618 {
619 fDashDotDistance = SMALLEST_DASH_WIDTH;
620 }
621 }
622 else
623 {
624 // dot as distance
625 if(fDashDotDistance < fLineWidth)
626 {
627 fDashDotDistance = fLineWidth;
628 }
629 }
630 }
631 }
632
633 for(a=0;a<GetDots();a++)
634 {
635 rDotDashArray[nIns++] = fSingleDotLen;
636 fFullDotDashLen += fSingleDotLen;
637 rDotDashArray[nIns++] = fDashDotDistance;
638 fFullDotDashLen += fDashDotDistance;
639 }
640
641 for(a=0;a<GetDashes();a++)
642 {
643 rDotDashArray[nIns++] = fSingleDashLen;
644 fFullDotDashLen += fSingleDashLen;
645 rDotDashArray[nIns++] = fDashDotDistance;
646 fFullDotDashLen += fDashDotDistance;
647 }
648
649 return fFullDotDashLen;
650}
651
653
654XLineDashItem::XLineDashItem(const OUString& rName, const XDash& rTheDash) :
656 aDash(rTheDash)
657{
658}
659
661 NameOrIndex(rItem),
662 aDash(rItem.aDash)
663{
664}
665
668 aDash(rTheDash)
669{
670}
671
673{
674 return new XLineDashItem(*this);
675}
676
678{
679 return ( NameOrIndex::operator==(rItem) &&
680 aDash == static_cast<const XLineDashItem&>(rItem).aDash );
681}
682
684(
685 SfxItemPresentation /*ePres*/,
686 MapUnit /*eCoreUnit*/,
687 MapUnit /*ePresUnit*/,
688 OUString& rText, const IntlWrapper&
689) const
690{
691 rText = GetName();
692 return true;
693}
694
696{
697 return true;
698}
699
701{
702 aDash.SetDotLen( BigInt::Scale( aDash.GetDotLen(), nMul, nDiv ) );
703 aDash.SetDashLen( BigInt::Scale( aDash.GetDashLen(), nMul, nDiv ) );
704 aDash.SetDistance( BigInt::Scale( aDash.GetDistance(), nMul, nDiv ) );
705}
706
707bool XLineDashItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
708{
709 nMemberId &= ~CONVERT_TWIPS;
710
711 switch ( nMemberId )
712 {
713 case 0:
714 {
715 css::drawing::LineDash aLineDash;
716
717 const XDash& rXD = GetDashValue();
718 aLineDash.Style = static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(rXD.GetDashStyle()));
719 aLineDash.Dots = rXD.GetDots();
720 aLineDash.DotLen = rXD.GetDotLen();
721 aLineDash.Dashes = rXD.GetDashes();
722 aLineDash.DashLen = rXD.GetDashLen();
723 aLineDash.Distance = rXD.GetDistance();
724
725 uno::Sequence< beans::PropertyValue > aPropSeq{
727 comphelper::makePropertyValue("LineDash", aLineDash)
728 };
729 rVal <<= aPropSeq;
730 break;
731 }
732
733 case MID_NAME:
734 {
736 break;
737 }
738
739 case MID_LINEDASH:
740 {
741 const XDash& rXD = GetDashValue();
742
743 css::drawing::LineDash aLineDash;
744
745 aLineDash.Style = static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(rXD.GetDashStyle()));
746 aLineDash.Dots = rXD.GetDots();
747 aLineDash.DotLen = rXD.GetDotLen();
748 aLineDash.Dashes = rXD.GetDashes();
749 aLineDash.DashLen = rXD.GetDashLen();
750 aLineDash.Distance = rXD.GetDistance();
751
752 rVal <<= aLineDash;
753 break;
754 }
755
757 {
758 const XDash& rXD = GetDashValue();
759 rVal <<= static_cast<css::drawing::DashStyle>(static_cast<sal_Int16>(rXD.GetDashStyle()));
760 break;
761 }
762
764 {
765 const XDash& rXD = GetDashValue();
766 rVal <<= rXD.GetDots();
767 break;
768 }
769
771 {
772 const XDash& rXD = GetDashValue();
773 rVal <<= rXD.GetDotLen();
774 break;
775 }
776
778 {
779 const XDash& rXD = GetDashValue();
780 rVal <<= rXD.GetDashes();
781 break;
782 }
783
785 {
786 const XDash& rXD = GetDashValue();
787 rVal <<= rXD.GetDashLen();
788 break;
789 }
790
792 {
793 const XDash& rXD = GetDashValue();
794 rVal <<= rXD.GetDistance();
795 break;
796 }
797
798 default: OSL_FAIL("Wrong MemberId!"); return false;
799 }
800
801 return true;
802}
803
804bool XLineDashItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
805{
806 nMemberId &= ~CONVERT_TWIPS;
807
808 switch ( nMemberId )
809 {
810 case 0:
811 {
812 uno::Sequence< beans::PropertyValue > aPropSeq;
813
814 if ( rVal >>= aPropSeq )
815 {
816 css::drawing::LineDash aLineDash;
817 OUString aName;
818 bool bLineDash( false );
819 for ( const auto& rProp : std::as_const(aPropSeq) )
820 {
821 if ( rProp.Name == "Name" )
822 rProp.Value >>= aName;
823 else if ( rProp.Name == "LineDash" )
824 {
825 if ( rProp.Value >>= aLineDash )
826 bLineDash = true;
827 }
828 }
829
830 SetName( aName );
831 if ( bLineDash )
832 {
833 XDash aXDash;
834
835 aXDash.SetDashStyle(static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(aLineDash.Style)));
836 aXDash.SetDots(aLineDash.Dots);
837 aXDash.SetDotLen(aLineDash.DotLen);
838 aXDash.SetDashes(aLineDash.Dashes);
839 aXDash.SetDashLen(aLineDash.DashLen);
840 aXDash.SetDistance(aLineDash.Distance);
841
842 if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes()))
843 aXDash.SetDots(1);
844
845 SetDashValue( aXDash );
846 }
847
848 return true;
849 }
850
851 return false;
852 }
853
854 case MID_NAME:
855 {
856 OUString aName;
857 if (!(rVal >>= aName))
858 return false;
859 SetName( aName );
860 break;
861 }
862
863 case MID_LINEDASH:
864 {
865 css::drawing::LineDash aLineDash;
866 if(!(rVal >>= aLineDash))
867 return false;
868
869 XDash aXDash;
870
871 aXDash.SetDashStyle(static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(aLineDash.Style)));
872 aXDash.SetDots(aLineDash.Dots);
873 aXDash.SetDotLen(aLineDash.DotLen);
874 aXDash.SetDashes(aLineDash.Dashes);
875 aXDash.SetDashLen(aLineDash.DashLen);
876 aXDash.SetDistance(aLineDash.Distance);
877
878 if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes()))
879 aXDash.SetDots(1);
880
881 SetDashValue( aXDash );
882 break;
883 }
884
886 {
887 sal_Int16 nVal = sal_Int16();
888 if(!(rVal >>= nVal))
889 return false;
890
891 XDash aXDash = GetDashValue();
892 aXDash.SetDashStyle(static_cast<css::drawing::DashStyle>(static_cast<sal_uInt16>(nVal)));
893
894 if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes()))
895 aXDash.SetDots(1);
896
897 SetDashValue( aXDash );
898
899 break;
900 }
901
904 {
905 sal_Int16 nVal = sal_Int16();
906 if(!(rVal >>= nVal))
907 return false;
908
909 XDash aXDash = GetDashValue();
910 if ( nMemberId == MID_LINEDASH_DOTS )
911 aXDash.SetDots( nVal );
912 else
913 aXDash.SetDashes( nVal );
914
915 if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes()))
916 aXDash.SetDots(1);
917
918 SetDashValue( aXDash );
919 break;
920 }
921
925 {
926 sal_uInt32 nVal = 0;
927 if(!(rVal >>= nVal))
928 return false;
929
930 XDash aXDash = GetDashValue();
931 if ( nMemberId == MID_LINEDASH_DOTLEN )
932 aXDash.SetDotLen( nVal );
933 else if ( nMemberId == MID_LINEDASH_DASHLEN )
934 aXDash.SetDashLen( nVal );
935 else
936 aXDash.SetDistance( nVal );
937
938 if((0 == aXDash.GetDots()) && (0 == aXDash.GetDashes()))
939 aXDash.SetDots(1);
940
941 SetDashValue( aXDash );
942 break;
943 }
944 }
945
946 return true;
947}
948
950{
951 return static_cast<const XLineDashItem*>(p1)->GetDashValue() == static_cast<const XLineDashItem*>(p2)->GetDashValue();
952}
953
954std::unique_ptr<XLineDashItem> XLineDashItem::checkForUniqueItem( SdrModel* pModel ) const
955{
956 if( pModel )
957 {
958 const OUString aUniqueName = NameOrIndex::CheckNamedItem(
959 this, XATTR_LINEDASH, &pModel->GetItemPool(),
960 XLineDashItem::CompareValueFunc, RID_SVXSTR_DASH20,
962
963 // if the given name is not valid, replace it!
964 if( aUniqueName != GetName() )
965 return std::make_unique<XLineDashItem>( aUniqueName, aDash );
966 }
967
968 return nullptr;
969}
970
972
975{
976}
977
979{
980 return new XLineWidthItem(*this);
981}
982
984(
985 SfxItemPresentation /*ePres*/,
986 MapUnit eCoreUnit,
987 MapUnit ePresUnit,
988 OUString& rText, const IntlWrapper& rIntl
989) const
990{
991 rText = GetMetricText( static_cast<tools::Long>(GetValue()),
992 eCoreUnit, ePresUnit, &rIntl) +
993 " " + EditResId( GetMetricId( ePresUnit) );
994 return true;
995}
996
997bool XLineWidthItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
998{
999 sal_Int32 nValue = GetValue();
1000 if( 0 != (nMemberId&CONVERT_TWIPS) )
1002
1003 rVal <<= nValue;
1004 return true;
1005}
1006
1007bool XLineWidthItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
1008{
1009 sal_Int32 nValue = 0;
1010 rVal >>= nValue;
1011 if( 0 != (nMemberId&CONVERT_TWIPS) )
1013
1014 SetValue( nValue );
1015 return true;
1016}
1017
1019
1020XLineColorItem::XLineColorItem(sal_Int32 nIndex, const Color& rTheColor) :
1021 XColorItem(XATTR_LINECOLOR, nIndex, rTheColor)
1022{
1023}
1024
1025XLineColorItem::XLineColorItem(const OUString& rName, const Color& rTheColor) :
1026 XColorItem(XATTR_LINECOLOR, rName, rTheColor)
1027{
1028}
1029
1031{
1032 return new XLineColorItem(*this);
1033}
1034
1036(
1037 SfxItemPresentation /*ePres*/,
1038 MapUnit /*eCoreUnit*/,
1039 MapUnit /*ePresUnit*/,
1040 OUString& rText, const IntlWrapper&
1041) const
1042{
1043 rText = GetName();
1044 return true;
1045}
1046
1047bool XLineColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId) const
1048{
1049 nMemberId &= ~CONVERT_TWIPS;
1050 switch (nMemberId)
1051 {
1052 case MID_COMPLEX_COLOR:
1053 {
1054 auto xComplexColor = model::color::createXComplexColor(getComplexColor());
1055 rVal <<= xComplexColor;
1056 break;
1057 }
1059 {
1060 rVal <<= OStringToOUString(model::color::convertToJSON(getComplexColor()), RTL_TEXTENCODING_UTF8);
1061 break;
1062 }
1063 default:
1064 {
1065 rVal <<= GetColorValue().GetRGBColor();
1066 break;
1067 }
1068 }
1069 return true;
1070}
1071
1072bool XLineColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId)
1073{
1074 nMemberId &= ~CONVERT_TWIPS;
1075 switch(nMemberId)
1076 {
1077 case MID_COMPLEX_COLOR:
1078 {
1079 css::uno::Reference<css::util::XComplexColor> xComplexColor;
1080 if (!(rVal >>= xComplexColor))
1081 return false;
1083 }
1084 break;
1086 {
1087 OUString sComplexColorJson;
1088 if (!(rVal >>= sComplexColorJson))
1089 return false;
1090
1091 if (sComplexColorJson.isEmpty())
1092 return false;
1093 model::ComplexColor aComplexColor;
1094 OString aJSON = OUStringToOString(sComplexColorJson, RTL_TEXTENCODING_ASCII_US);
1095 model::color::convertFromJSON(aJSON, aComplexColor);
1096 setComplexColor(aComplexColor);
1097 }
1098 break;
1099 default:
1100 {
1101 sal_Int32 nValue;
1102 if(!(rVal >>= nValue ))
1103 return false;
1104
1106 break;
1107 }
1108 }
1109 return true;
1110}
1111
1112
1114
1117{
1118}
1119
1122 maPolyPolygon(std::move(aPolyPolygon))
1123{
1124}
1125
1127: NameOrIndex(rItem),
1129{
1130}
1131
1134 maPolyPolygon(std::move(aPolyPolygon))
1135{
1136}
1137
1139{
1140 return new XLineStartItem(*this);
1141}
1142
1144{
1145 return ( NameOrIndex::operator==(rItem) && static_cast<const XLineStartItem&>(rItem).maPolyPolygon == maPolyPolygon );
1146}
1147
1149(
1150 SfxItemPresentation /*ePres*/,
1151 MapUnit /*eCoreUnit*/,
1152 MapUnit /*ePresUnit*/,
1153 OUString& rText, const IntlWrapper&
1154) const
1155{
1156 rText = GetName();
1157 return true;
1158}
1159
1160bool XLineStartItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
1161{
1162 nMemberId &= ~CONVERT_TWIPS;
1163 if( nMemberId == MID_NAME )
1164 {
1165 rVal <<= SvxUnogetApiNameForItem(Which(), GetName());
1166 }
1167 else
1168 {
1169 css::drawing::PolyPolygonBezierCoords aBezier;
1171 rVal <<= aBezier;
1172 }
1173
1174 return true;
1175}
1176
1177bool XLineStartItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
1178{
1179 nMemberId &= ~CONVERT_TWIPS;
1180 if( nMemberId == MID_NAME )
1181 {
1182 return false;
1183 }
1184 else
1185 {
1187
1188 if( rVal.hasValue() )
1189 {
1190 auto pCoords = o3tl::tryAccess<css::drawing::PolyPolygonBezierCoords>(
1191 rVal);
1192 if( !pCoords )
1193 return false;
1194
1195 if( pCoords->Coordinates.getLength() > 0 )
1196 {
1198 // #i72807# close line start/end polygons hard
1199 // maPolyPolygon.setClosed(true);
1200 }
1201 }
1202 }
1203
1204 return true;
1205}
1206
1210std::unique_ptr<XLineStartItem> XLineStartItem::checkForUniqueItem( SdrModel* pModel ) const
1211{
1212 if( pModel )
1213 {
1214 std::unique_ptr<XLineStartItem> pTempItem;
1215 const XLineStartItem* pLineStartItem = this;
1216
1217 OUString aUniqueName( GetName() );
1218
1219 if( !maPolyPolygon.count() )
1220 {
1221 // if the polygon is empty, check if the name is empty
1222 if( aUniqueName.isEmpty() )
1223 return nullptr;
1224
1225 // force empty name for empty polygons
1226 return std::make_unique<XLineStartItem>( "", maPolyPolygon );
1227 }
1228
1229 if( maPolyPolygon.count() > 1 )
1230 {
1231 // check if the polygon is closed
1232 if(!maPolyPolygon.isClosed())
1233 {
1234 // force a closed polygon
1236 aNew.setClosed(true);
1237 pTempItem.reset(new XLineStartItem( aUniqueName, std::move(aNew) ));
1238 pLineStartItem = pTempItem.get();
1239 }
1240 }
1241
1242 bool bForceNew = false;
1243
1244 // 2. if we have a name check if there is already an item with the
1245 // same name in the documents pool with a different line end or start
1246
1247 const SfxItemPool& rPool1 = pModel->GetItemPool();
1248 if (!aUniqueName.isEmpty())
1249 {
1250 for (const SfxPoolItem* p : rPool1.GetItemSurrogates(XATTR_LINESTART))
1251 {
1252 auto pItem = dynamic_cast<const XLineStartItem*>(p);
1253
1254 if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
1255 {
1256 // if there is already an item with the same name and the same
1257 // value it's ok to set it
1258 if( pItem->GetLineStartValue() != pLineStartItem->GetLineStartValue() )
1259 {
1260 // same name but different value, we need a new name for this item
1261 aUniqueName.clear();
1262 bForceNew = true;
1263 }
1264 break;
1265 }
1266 }
1267
1268 if( !bForceNew )
1269 {
1270 for (const SfxPoolItem* p : rPool1.GetItemSurrogates(XATTR_LINEEND))
1271 {
1272 auto pItem = dynamic_cast<const XLineEndItem*>(p);
1273
1274 if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
1275 {
1276 // if there is already an item with the same name and the same
1277 // value it's ok to set it
1278 if( pItem->GetLineEndValue() != pLineStartItem->GetLineStartValue() )
1279 {
1280 // same name but different value, we need a new name for this item
1281 aUniqueName.clear();
1282 bForceNew = true;
1283 }
1284 break;
1285 }
1286 }
1287 }
1288 }
1289
1290 const SfxItemPool* pPool2 = pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : nullptr;
1291 if( !aUniqueName.isEmpty() && pPool2)
1292 {
1293 for (const SfxPoolItem* p : pPool2->GetItemSurrogates(XATTR_LINESTART))
1294 {
1295 auto pItem = dynamic_cast<const XLineStartItem*>(p);
1296
1297 if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
1298 {
1299 // if there is already an item with the same name and the same
1300 // value it's ok to set it
1301 if( pItem->GetLineStartValue() != pLineStartItem->GetLineStartValue() )
1302 {
1303 // same name but different value, we need a new name for this item
1304 aUniqueName.clear();
1305 bForceNew = true;
1306 }
1307 break;
1308 }
1309 }
1310
1311 if( !bForceNew )
1312 {
1313 for (const SfxPoolItem* p : pPool2->GetItemSurrogates(XATTR_LINEEND))
1314 {
1315 auto pItem = dynamic_cast<const XLineEndItem*>(p);
1316
1317 if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
1318 {
1319 // if there is already an item with the same name and the same
1320 // value it's ok to set it
1321 if( pItem->GetLineEndValue() != pLineStartItem->GetLineStartValue() )
1322 {
1323 // same name but different value, we need a new name for this item
1324 aUniqueName.clear();
1325 bForceNew = true;
1326 }
1327 break;
1328 }
1329 }
1330 }
1331 }
1332
1333 // if we have no name yet, find existing item with same content or
1334 // create a unique name
1335 if( aUniqueName.isEmpty() )
1336 {
1337 bool bFoundExisting = false;
1338
1339 sal_Int32 nUserIndex = 1;
1340 const OUString aUser(SvxResId(RID_SVXSTR_LINEEND));
1341
1342 for (const SfxPoolItem* p : rPool1.GetItemSurrogates(XATTR_LINESTART))
1343 {
1344 auto pItem = dynamic_cast<const XLineStartItem*>(p);
1345
1346 if (pItem && !pItem->GetName().isEmpty())
1347 {
1348 if (!bForceNew && pItem->GetLineStartValue() == pLineStartItem->GetLineStartValue())
1349 {
1350 aUniqueName = pItem->GetName();
1351 bFoundExisting = true;
1352 break;
1353 }
1354
1355 if (pItem->GetName().startsWith(aUser))
1356 {
1357 sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
1358 if (nThisIndex >= nUserIndex)
1359 nUserIndex = nThisIndex + 1;
1360 }
1361 }
1362 }
1363
1364 for (const SfxPoolItem* p : rPool1.GetItemSurrogates(XATTR_LINEEND))
1365 {
1366 auto pItem = dynamic_cast<const XLineEndItem*>(p);
1367
1368 if (pItem && !pItem->GetName().isEmpty())
1369 {
1370 if (!bForceNew && pItem->GetLineEndValue() == pLineStartItem->GetLineStartValue())
1371 {
1372 aUniqueName = pItem->GetName();
1373 bFoundExisting = true;
1374 break;
1375 }
1376
1377 if (pItem->GetName().startsWith(aUser))
1378 {
1379 sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
1380 if (nThisIndex >= nUserIndex)
1381 nUserIndex = nThisIndex + 1;
1382 }
1383 }
1384 }
1385
1386 if( !bFoundExisting )
1387 {
1388 aUniqueName = aUser + " " + OUString::number( nUserIndex );
1389 }
1390 }
1391
1392 // if the given name is not valid, replace it!
1393 if( aUniqueName != GetName() || pTempItem )
1394 {
1395 if( pTempItem )
1396 {
1397 pTempItem->SetName( aUniqueName );
1398 return pTempItem;
1399 }
1400 else
1401 {
1402 return std::make_unique<XLineStartItem>( aUniqueName, maPolyPolygon );
1403 }
1404 }
1405 }
1406
1407 return nullptr;
1408}
1409
1411
1414{
1415}
1416
1417XLineEndItem::XLineEndItem(const OUString& rName, basegfx::B2DPolyPolygon aPolyPolygon)
1418: NameOrIndex(XATTR_LINEEND, rName),
1419 maPolyPolygon(std::move(aPolyPolygon))
1420{
1421}
1422
1424: NameOrIndex(rItem),
1426{
1427}
1428
1430: NameOrIndex( XATTR_LINEEND, -1 ),
1431 maPolyPolygon(std::move(aPolyPolygon))
1432{
1433}
1434
1436{
1437 return new XLineEndItem(*this);
1438}
1439
1441{
1442 return ( NameOrIndex::operator==(rItem) && static_cast<const XLineEndItem&>(rItem).maPolyPolygon == maPolyPolygon );
1443}
1444
1445
1449std::unique_ptr<XLineEndItem> XLineEndItem::checkForUniqueItem( SdrModel* pModel ) const
1450{
1451 if( pModel )
1452 {
1453 std::unique_ptr<XLineEndItem> pTempItem;
1454 const XLineEndItem* pLineEndItem = this;
1455
1456 OUString aUniqueName( GetName() );
1457
1458 if( !maPolyPolygon.count() )
1459 {
1460 // if the polygon is empty, check if the name is empty
1461 if( aUniqueName.isEmpty() )
1462 return nullptr;
1463
1464 // force empty name for empty polygons
1465 return std::make_unique<XLineEndItem>( "", maPolyPolygon );
1466 }
1467
1468 if( maPolyPolygon.count() > 1 )
1469 {
1470 // check if the polygon is closed
1471 if(!maPolyPolygon.isClosed())
1472 {
1473 // force a closed polygon
1475 aNew.setClosed(true);
1476 pTempItem.reset(new XLineEndItem( aUniqueName, std::move(aNew) ));
1477 pLineEndItem = pTempItem.get();
1478 }
1479 }
1480
1481 bool bForceNew = false;
1482
1483 // 2. if we have a name check if there is already an item with the
1484 // same name in the documents pool with a different line end or start
1485
1486 const SfxItemPool& rPool1 = pModel->GetItemPool();
1487 if (!aUniqueName.isEmpty())
1488 {
1489 for (const SfxPoolItem* p : rPool1.GetItemSurrogates(XATTR_LINESTART))
1490 {
1491 auto pItem = dynamic_cast<const XLineStartItem*>(p);
1492
1493 if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
1494 {
1495 // if there is already an item with the same name and the same
1496 // value it's ok to set it
1497 if( pItem->GetLineStartValue() != pLineEndItem->GetLineEndValue() )
1498 {
1499 // same name but different value, we need a new name for this item
1500 aUniqueName.clear();
1501 bForceNew = true;
1502 }
1503 break;
1504 }
1505 }
1506
1507 if( !bForceNew )
1508 {
1509 for (const SfxPoolItem* p : rPool1.GetItemSurrogates(XATTR_LINEEND))
1510 {
1511 auto pItem = dynamic_cast<const XLineEndItem*>(p);
1512
1513 if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
1514 {
1515 // if there is already an item with the same name and the same
1516 // value it's ok to set it
1517 if( pItem->GetLineEndValue() != pLineEndItem->GetLineEndValue() )
1518 {
1519 // same name but different value, we need a new name for this item
1520 aUniqueName.clear();
1521 bForceNew = true;
1522 }
1523 break;
1524 }
1525 }
1526 }
1527 }
1528
1529 const SfxItemPool* pPool2 = pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : nullptr;
1530 if( !aUniqueName.isEmpty() && pPool2)
1531 {
1532 for (const SfxPoolItem* p : pPool2->GetItemSurrogates(XATTR_LINESTART))
1533 {
1534 auto pItem = dynamic_cast<const XLineStartItem*>(p);
1535
1536 if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
1537 {
1538 // if there is already an item with the same name and the same
1539 // value it's ok to set it
1540 if( pItem->GetLineStartValue() != pLineEndItem->GetLineEndValue() )
1541 {
1542 // same name but different value, we need a new name for this item
1543 aUniqueName.clear();
1544 bForceNew = true;
1545 }
1546 break;
1547 }
1548 }
1549
1550 if( !bForceNew )
1551 {
1552 for (const SfxPoolItem* p : pPool2->GetItemSurrogates(XATTR_LINEEND))
1553 {
1554 auto pItem = dynamic_cast<const XLineEndItem*>(p);
1555
1556 if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
1557 {
1558 // if there is already an item with the same name and the same
1559 // value it's ok to set it
1560 if( pItem->GetLineEndValue() != pLineEndItem->GetLineEndValue() )
1561 {
1562 // same name but different value, we need a new name for this item
1563 aUniqueName.clear();
1564 bForceNew = true;
1565 }
1566 break;
1567 }
1568 }
1569 }
1570 }
1571
1572 // if we have no name yet, find existing item with same content or
1573 // create a unique name
1574 if( aUniqueName.isEmpty() )
1575 {
1576 bool bFoundExisting = false;
1577
1578 sal_Int32 nUserIndex = 1;
1579 const OUString aUser(SvxResId(RID_SVXSTR_LINEEND));
1580
1581 for (const SfxPoolItem* p : rPool1.GetItemSurrogates(XATTR_LINESTART))
1582 {
1583 auto pItem = dynamic_cast<const XLineStartItem*>(p);
1584
1585 if (pItem && !pItem->GetName().isEmpty())
1586 {
1587 if (!bForceNew && pItem->GetLineStartValue() == pLineEndItem->GetLineEndValue())
1588 {
1589 aUniqueName = pItem->GetName();
1590 bFoundExisting = true;
1591 break;
1592 }
1593
1594 if (pItem->GetName().startsWith(aUser))
1595 {
1596 sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
1597 if (nThisIndex >= nUserIndex)
1598 nUserIndex = nThisIndex + 1;
1599 }
1600 }
1601 }
1602
1603 for (const SfxPoolItem* p : rPool1.GetItemSurrogates(XATTR_LINEEND))
1604 {
1605 auto pItem = dynamic_cast<const XLineEndItem*>(p);
1606
1607 if (pItem && !pItem->GetName().isEmpty())
1608 {
1609 if (!bForceNew && pItem->GetLineEndValue() == pLineEndItem->GetLineEndValue())
1610 {
1611 aUniqueName = pItem->GetName();
1612 bFoundExisting = true;
1613 break;
1614 }
1615
1616 if (pItem->GetName().startsWith(aUser))
1617 {
1618 sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
1619 if (nThisIndex >= nUserIndex)
1620 nUserIndex = nThisIndex + 1;
1621 }
1622 }
1623 }
1624
1625 if( !bFoundExisting )
1626 {
1627 aUniqueName = aUser + " " + OUString::number( nUserIndex );
1628 }
1629 }
1630
1631 // if the given name is not valid, replace it!
1632 if( aUniqueName != GetName() || pTempItem )
1633 {
1634 if( pTempItem )
1635 {
1636 pTempItem->SetName( aUniqueName );
1637 return pTempItem;
1638 }
1639 else
1640 {
1641 return std::make_unique<XLineEndItem>( aUniqueName, maPolyPolygon );
1642 }
1643 }
1644 }
1645
1646 return nullptr;
1647}
1648
1650(
1651 SfxItemPresentation /*ePres*/,
1652 MapUnit /*eCoreUnit*/,
1653 MapUnit /*ePresUnit*/,
1654 OUString& rText, const IntlWrapper&
1655) const
1656{
1657 rText = GetName();
1658 return true;
1659}
1660
1661bool XLineEndItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
1662{
1663 nMemberId &= ~CONVERT_TWIPS;
1664 if( nMemberId == MID_NAME )
1665 {
1666 rVal <<= SvxUnogetApiNameForItem(Which(), GetName());
1667 }
1668 else
1669 {
1670 css::drawing::PolyPolygonBezierCoords aBezier;
1672 rVal <<= aBezier;
1673 }
1674 return true;
1675}
1676
1677bool XLineEndItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
1678{
1679 nMemberId &= ~CONVERT_TWIPS;
1680 if( nMemberId == MID_NAME )
1681 {
1682 return false;
1683 }
1684 else
1685 {
1687
1688 if( rVal.hasValue() )
1689 {
1690 auto pCoords = o3tl::tryAccess<css::drawing::PolyPolygonBezierCoords>(
1691 rVal);
1692 if( !pCoords )
1693 return false;
1694
1695 if( pCoords->Coordinates.getLength() > 0 )
1696 {
1698 // #i72807# close line start/end polygons hard
1699 // maPolyPolygon.setClosed(true);
1700 }
1701 }
1702 }
1703
1704 return true;
1705}
1706
1709{
1710}
1711
1713{
1714 return new XLineStartWidthItem(*this);
1715}
1716
1718(
1719 SfxItemPresentation /*ePres*/,
1720 MapUnit eCoreUnit,
1721 MapUnit ePresUnit,
1722 OUString& rText, const IntlWrapper& rIntl
1723) const
1724{
1725 rText = GetMetricText( static_cast<tools::Long>(GetValue()),
1726 eCoreUnit, ePresUnit, &rIntl) +
1727 " " + EditResId( GetMetricId( ePresUnit) );
1728 return true;
1729}
1730
1731bool XLineStartWidthItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1732{
1733 rVal <<= GetValue();
1734 return true;
1735}
1736
1737bool XLineStartWidthItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1738{
1739 sal_Int32 nValue = 0;
1740 rVal >>= nValue;
1741 SetValue( nValue );
1742 return true;
1743}
1744
1747{
1748}
1749
1751{
1752 return new XLineEndWidthItem(*this);
1753}
1754
1756(
1757 SfxItemPresentation /*ePres*/,
1758 MapUnit eCoreUnit,
1759 MapUnit ePresUnit,
1760 OUString& rText, const IntlWrapper& rIntl
1761) const
1762{
1763 rText = GetMetricText( static_cast<tools::Long>(GetValue()),
1764 eCoreUnit, ePresUnit, &rIntl) +
1765 " " + EditResId( GetMetricId( ePresUnit) );
1766 return true;
1767}
1768
1769bool XLineEndWidthItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1770{
1771 rVal <<= GetValue();
1772 return true;
1773}
1774
1775bool XLineEndWidthItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1776{
1777 sal_Int32 nValue = 0;
1778 rVal >>= nValue;
1779 SetValue( nValue );
1780 return true;
1781}
1782
1784 SfxBoolItem(XATTR_LINESTARTCENTER, bStartCenter)
1785{
1786}
1787
1789{
1790 return new XLineStartCenterItem(*this);
1791}
1792
1794(
1795 SfxItemPresentation /*ePres*/,
1796 MapUnit /*eCoreUnit*/,
1797 MapUnit /*ePresUnit*/,
1798 OUString& rText, const IntlWrapper&
1799) const
1800{
1801 rText = SvxResId(GetValue() ? RID_SVXSTR_CENTERED : RID_SVXSTR_NOTCENTERED);
1802 return true;
1803}
1804
1805bool XLineStartCenterItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1806{
1807 bool bValue = GetValue();
1808 rVal <<= bValue;
1809 return true;
1810}
1811
1812bool XLineStartCenterItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1813{
1814 auto b = o3tl::tryAccess<bool>(rVal);
1815 if( !b )
1816 return false;
1817
1818 SetValue( *b );
1819 return true;
1820}
1821
1823 SfxBoolItem(XATTR_LINEENDCENTER, bEndCenter)
1824{
1825}
1826
1828{
1829 return new XLineEndCenterItem(*this);
1830}
1831
1833(
1834 SfxItemPresentation /*ePres*/,
1835 MapUnit /*eCoreUnit*/,
1836 MapUnit /*ePresUnit*/,
1837 OUString& rText, const IntlWrapper&
1838) const
1839{
1840 rText = SvxResId(GetValue() ? RID_SVXSTR_CENTERED : RID_SVXSTR_NOTCENTERED);
1841 return true;
1842}
1843
1844bool XLineEndCenterItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1845{
1846 bool bValue = GetValue();
1847 rVal <<= bValue;
1848 return true;
1849}
1850
1851bool XLineEndCenterItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1852{
1853 auto b = o3tl::tryAccess<bool>(rVal);
1854 if( !b )
1855 return false;
1856
1857 SetValue( *b );
1858 return true;
1859}
1860
1861// --- fill attributes ---
1862
1863
1865
1866XFillStyleItem::XFillStyleItem(drawing::FillStyle eFillStyle) :
1867 SfxEnumItem(XATTR_FILLSTYLE, eFillStyle)
1868{
1869}
1870
1872{
1873 return new XFillStyleItem( *this );
1874}
1875
1877(
1878 SfxItemPresentation /*ePres*/,
1879 MapUnit /*eCoreUnit*/,
1880 MapUnit /*ePresUnit*/,
1881 OUString& rText, const IntlWrapper&
1882) const
1883{
1884 rText.clear();
1885
1886 TranslateId pId;
1887
1888 switch( GetValue() )
1889 {
1890 case drawing::FillStyle_NONE:
1891 pId = RID_SVXSTR_INVISIBLE;
1892 break;
1893 case drawing::FillStyle_SOLID:
1894 pId = RID_SVXSTR_SOLID;
1895 break;
1896 case drawing::FillStyle_GRADIENT:
1897 pId = RID_SVXSTR_GRADIENT;
1898 break;
1899 case drawing::FillStyle_HATCH:
1900 pId = RID_SVXSTR_HATCH;
1901 break;
1902 case drawing::FillStyle_BITMAP:
1903 pId = RID_SVXSTR_BITMAP;
1904 break;
1905 default: break;
1906 }
1907
1908 if (pId)
1909 rText = SvxResId(pId);
1910 return true;
1911}
1912
1914{
1915 return 5;
1916}
1917
1918bool XFillStyleItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
1919{
1920 css::drawing::FillStyle eFS = GetValue();
1921
1922 rVal <<= eFS;
1923
1924 return true;
1925}
1926
1927bool XFillStyleItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
1928{
1929 css::drawing::FillStyle eFS;
1930 if(!(rVal >>= eFS))
1931 {
1932 // also try an int (for Basic)
1933 sal_Int32 nFS = 0;
1934 if(!(rVal >>= nFS))
1935 return false;
1936 eFS = static_cast<css::drawing::FillStyle>(nFS);
1937 }
1938
1939 SetValue( eFS );
1940
1941 return true;
1942}
1943
1945{
1946 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("XFillStyleItem"));
1947 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
1948 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), BAD_CAST(OString::number(static_cast<sal_Int16>(GetValue())).getStr()));
1949
1950 OUString aPresentation;
1951 IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
1952 GetPresentation(SfxItemPresentation::Nameless, MapUnit::Map100thMM, MapUnit::Map100thMM, aPresentation, aIntlWrapper);
1953 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(aPresentation.toUtf8().getStr()));
1954
1955 (void)xmlTextWriterEndElement(pWriter);
1956}
1957
1958boost::property_tree::ptree XFillStyleItem::dumpAsJSON() const
1959{
1960 boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
1961
1962 if (Which() == XATTR_FILLSTYLE)
1963 aTree.put("commandName", ".uno:FillStyle");
1964
1965 OUString sValue;
1966
1967 switch( GetValue() )
1968 {
1969 case drawing::FillStyle_NONE:
1970 sValue = "NONE";
1971 break;
1972 case drawing::FillStyle_SOLID:
1973 sValue = "SOLID";
1974 break;
1975 case drawing::FillStyle_GRADIENT:
1976 sValue = "GRADIENT";
1977 break;
1978 case drawing::FillStyle_HATCH:
1979 sValue = "HATCH";
1980 break;
1981 case drawing::FillStyle_BITMAP:
1982 sValue = "BITMAP";
1983 break;
1984 default: break;
1985 }
1986
1987 aTree.put("state", sValue);
1988
1989 return aTree;
1990}
1991
1992
1994
1995XFillColorItem::XFillColorItem(sal_Int32 nIndex, const Color& rTheColor) :
1996 XColorItem(XATTR_FILLCOLOR, nIndex, rTheColor)
1997{
1998}
1999
2000XFillColorItem::XFillColorItem(const OUString& rName, const Color& rTheColor) :
2001 XColorItem(XATTR_FILLCOLOR, rName, rTheColor)
2002{
2003}
2004
2006{
2007 return new XFillColorItem(*this);
2008}
2009
2011(
2012 SfxItemPresentation /*ePres*/,
2013 MapUnit /*eCoreUnit*/,
2014 MapUnit /*ePresUnit*/,
2015 OUString& rText, const IntlWrapper&
2016) const
2017{
2018 rText = GetName();
2019 return true;
2020}
2021
2022bool XFillColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
2023{
2024 nMemberId &= ~CONVERT_TWIPS;
2025 switch (nMemberId)
2026 {
2028 {
2029 rVal <<= sal_Int16(getComplexColor().getSchemeType());
2030 break;
2031 }
2032 case MID_COLOR_LUM_MOD:
2033 {
2034 sal_Int16 nValue = 10000;
2035 for (auto const& rTransform : getComplexColor().getTransformations())
2036 {
2037 if (rTransform.meType == model::TransformationType::LumMod)
2038 nValue = rTransform.mnValue;
2039 }
2040 rVal <<= nValue;
2041 break;
2042 }
2043 case MID_COLOR_LUM_OFF:
2044 {
2045 sal_Int16 nValue = 0;
2046 for (auto const& rTransform : getComplexColor().getTransformations())
2047 {
2048 if (rTransform.meType == model::TransformationType::LumOff)
2049 nValue = rTransform.mnValue;
2050 }
2051 rVal <<= nValue;
2052 break;
2053 }
2054 case MID_COMPLEX_COLOR:
2055 {
2056 auto xComplexColor = model::color::createXComplexColor(getComplexColor());
2057 rVal <<= xComplexColor;
2058 break;
2059 }
2061 {
2062 rVal <<= OStringToOUString(model::color::convertToJSON(getComplexColor()), RTL_TEXTENCODING_UTF8);
2063 break;
2064 }
2065 default:
2066 {
2067 rVal <<= GetColorValue().GetRGBColor();
2068 break;
2069 }
2070 }
2071
2072 return true;
2073}
2074
2075bool XFillColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
2076{
2077 nMemberId &= ~CONVERT_TWIPS;
2078 switch(nMemberId)
2079 {
2081 {
2082 sal_Int16 nIndex = -1;
2083 if (!(rVal >>= nIndex))
2084 return false;
2086 }
2087 break;
2088 case MID_COLOR_LUM_MOD:
2089 {
2090 sal_Int16 nLumMod = 10000;
2091 if (!(rVal >>= nLumMod))
2092 return false;
2095 }
2096 break;
2097 case MID_COLOR_LUM_OFF:
2098 {
2099 sal_Int16 nLumOff = 0;
2100 if (!(rVal >>= nLumOff))
2101 return false;
2104 }
2105 break;
2106 case MID_COMPLEX_COLOR:
2107 {
2108 css::uno::Reference<css::util::XComplexColor> xComplexColor;
2109 if (!(rVal >>= xComplexColor))
2110 return false;
2112 }
2113 break;
2115 {
2116 OUString sComplexColorJson;
2117 if (!(rVal >>= sComplexColorJson))
2118 return false;
2119
2120 if (sComplexColorJson.isEmpty())
2121 return false;
2122
2123 OString aJSON = OUStringToOString(sComplexColorJson, RTL_TEXTENCODING_ASCII_US);
2124 model::ComplexColor aComplexColor;
2125 model::color::convertFromJSON(aJSON, aComplexColor);
2126 setComplexColor(aComplexColor);
2127 }
2128 break;
2129 default:
2130 {
2131 Color nValue;
2132 if(!(rVal >>= nValue ))
2133 return false;
2134
2136
2137 }
2138 break;
2139 }
2140 return true;
2141}
2142
2144{
2145 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("XFillColorItem"));
2146 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
2147
2148 XColorItem::dumpAsXml(pWriter);
2149
2150 (void)xmlTextWriterEndElement(pWriter);
2151}
2152
2153boost::property_tree::ptree XFillColorItem::dumpAsJSON() const
2154{
2155 boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
2156
2157 if (Which() == XATTR_FILLCOLOR)
2158 aTree.put("commandName", ".uno:FillPageColor");
2159
2160 aTree.put("state", GetColorValue().AsRGBHexString());
2161
2162 return aTree;
2163}
2164
2165XSecondaryFillColorItem::XSecondaryFillColorItem(const OUString& rName, const Color& rTheColor) :
2166 XColorItem(XATTR_SECONDARYFILLCOLOR, rName, rTheColor)
2167{
2168}
2169
2171{
2172 return new XSecondaryFillColorItem(*this);
2173}
2174
2176(
2177 SfxItemPresentation /*ePres*/,
2178 MapUnit /*eCoreUnit*/,
2179 MapUnit /*ePresUnit*/,
2180 OUString& rText, const IntlWrapper&
2181) const
2182{
2183 rText = GetName();
2184 return true;
2185}
2186
2188
2190 const basegfx::BGradient& rTheGradient) :
2192 aGradient(rTheGradient)
2193{
2194}
2195
2197 const basegfx::BGradient& rTheGradient, TypedWhichId<XFillGradientItem> nWhich)
2198 : NameOrIndex(nWhich, rName)
2199 , aGradient(rTheGradient)
2200{
2201}
2202
2204 NameOrIndex(rItem),
2205 aGradient(rItem.aGradient)
2206{
2207}
2208
2211 aGradient(rTheGradient)
2212{
2213}
2214
2216{
2217 return new XFillGradientItem(*this);
2218}
2219
2221{
2222 return ( NameOrIndex::operator==(rItem) &&
2223 aGradient == static_cast<const XFillGradientItem&>(rItem).aGradient );
2224}
2225
2226const basegfx::BGradient& XFillGradientItem::GetGradientValue() const // GetValue -> GetGradientValue
2227{
2228 if (!IsIndex())
2229 return aGradient;
2230 // ToDo: This should fail. We never called this code with a table so this should always
2231 // have failed. Thus, I'm thinking that XFillGradientItem can't be an Index.
2232 return aGradient;
2233}
2234
2236(
2237 SfxItemPresentation /*ePres*/,
2238 MapUnit /*eCoreUnit*/,
2239 MapUnit /*ePresUnit*/,
2240 OUString& rText, const IntlWrapper&
2241) const
2242{
2243 rText = GetName();
2244 return true;
2245}
2246
2247bool XFillGradientItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
2248{
2249 nMemberId &= ~CONVERT_TWIPS;
2250 switch ( nMemberId )
2251 {
2252 case 0:
2253 {
2254 // fill values
2255 const css::awt::Gradient2 aGradient2(GetGradientValue().getAsGradient2());
2256
2257 // create sequence
2258 uno::Sequence< beans::PropertyValue > aPropSeq{
2260 comphelper::makePropertyValue("FillGradient", aGradient2)
2261 };
2262 rVal <<= aPropSeq;
2263 break;
2264 }
2265
2266 case MID_FILLGRADIENT:
2267 {
2268 // fill values
2269 const css::awt::Gradient2 aGradient2(GetGradientValue().getAsGradient2());
2270
2271 // create sequence
2272 rVal <<= aGradient2;
2273 break;
2274 }
2275
2276 case MID_NAME:
2277 {
2278 rVal <<= SvxUnogetApiNameForItem(Which(), GetName());
2279 break;
2280 }
2281
2283 {
2284 // fill values
2285 const css::awt::ColorStopSequence aColorStopSequence(
2286 GetGradientValue().GetColorStops().getAsColorStopSequence());
2287
2288 // create sequence
2289 rVal <<= aColorStopSequence;
2290 break;
2291 }
2292
2293 case MID_GRADIENT_STYLE: rVal <<= static_cast<sal_Int16>(GetGradientValue().GetGradientStyle()); break;
2294 case MID_GRADIENT_STARTCOLOR: rVal <<= Color(GetGradientValue().GetColorStops().front().getStopColor()); break;
2295 case MID_GRADIENT_ENDCOLOR: rVal <<= Color(GetGradientValue().GetColorStops().back().getStopColor()); break;
2296 case MID_GRADIENT_ANGLE: rVal <<= static_cast<sal_Int16>(GetGradientValue().GetAngle()); break;
2297 case MID_GRADIENT_BORDER: rVal <<= GetGradientValue().GetBorder(); break;
2298 case MID_GRADIENT_XOFFSET: rVal <<= GetGradientValue().GetXOffset(); break;
2299 case MID_GRADIENT_YOFFSET: rVal <<= GetGradientValue().GetYOffset(); break;
2302 case MID_GRADIENT_STEPCOUNT: rVal <<= GetGradientValue().GetSteps(); break;
2303
2304 default: OSL_FAIL("Wrong MemberId!"); return false;
2305 }
2306
2307 return true;
2308}
2309
2310bool XFillGradientItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
2311{
2312 nMemberId &= ~CONVERT_TWIPS;
2313
2314 switch ( nMemberId )
2315 {
2316 case 0:
2317 {
2318 uno::Sequence< beans::PropertyValue > aPropSeq;
2319 css::uno::Any aGradientAny;
2320
2321 if ( rVal >>= aPropSeq )
2322 {
2323 OUString aName;
2324
2325 for ( const auto& rProp : std::as_const(aPropSeq) )
2326 {
2327 if ( rProp.Name == "Name" )
2328 rProp.Value >>= aName;
2329 else if ( rProp.Name == "FillGradient" )
2330 aGradientAny = rProp.Value;
2331 }
2332
2333 SetName( aName );
2334
2335 if (aGradientAny.hasValue() && (aGradientAny.has<css::awt::Gradient>() || aGradientAny.has<css::awt::Gradient2>()))
2336 {
2337 const basegfx::BGradient aBGradient(aGradientAny);
2338 SetGradientValue(aBGradient);
2339 }
2340
2341 return true;
2342 }
2343
2344 return false;
2345 }
2346
2347 case MID_NAME:
2348 {
2349 OUString aName;
2350 if (!(rVal >>= aName ))
2351 return false;
2352 SetName( aName );
2353 break;
2354 }
2355
2356 case MID_FILLGRADIENT:
2357 {
2358 if (rVal.hasValue() && (rVal.has<css::awt::Gradient>() || rVal.has<css::awt::Gradient2>()))
2359 {
2360 const basegfx::BGradient aBGradient(rVal);
2361 SetGradientValue(aBGradient);
2362 }
2363
2364 break;
2365 }
2366
2368 {
2369 // check if we have a awt::ColorStopSequence
2370 if (rVal.hasValue() && rVal.has<css::awt::ColorStopSequence>())
2371 {
2372 const basegfx::BColorStops aColorStops(rVal);
2373
2374 if (!aColorStops.empty())
2375 {
2377 aBGradient.SetColorStops(aColorStops);
2378 SetGradientValue(aBGradient);
2379 }
2380 }
2381 break;
2382 }
2383
2386 {
2387 Color nVal;
2388 if(!(rVal >>= nVal ))
2389 return false;
2390
2392 basegfx::BColorStops aNewColorStops(aBGradient.GetColorStops());
2393
2394 if ( nMemberId == MID_GRADIENT_STARTCOLOR )
2395 {
2396 aNewColorStops.replaceStartColor(nVal.getBColor());
2397 }
2398 else
2399 {
2400 aNewColorStops.replaceEndColor(nVal.getBColor());
2401 }
2402
2403 aBGradient.SetColorStops(aNewColorStops);
2404 SetGradientValue( aBGradient );
2405 break;
2406 }
2407
2408 case MID_GRADIENT_STYLE:
2409 case MID_GRADIENT_ANGLE:
2416 {
2417 sal_Int16 nVal = sal_Int16();
2418 if(!(rVal >>= nVal ))
2419 return false;
2420
2421 basegfx::BGradient aBGradient = GetGradientValue();
2422
2423 switch ( nMemberId )
2424 {
2425 case MID_GRADIENT_STYLE:
2426 aBGradient.SetGradientStyle( static_cast<css::awt::GradientStyle>(nVal) ); break;
2427 case MID_GRADIENT_ANGLE:
2428 aBGradient.SetAngle( Degree10(nVal) ); break;
2430 aBGradient.SetBorder( nVal ); break;
2432 aBGradient.SetStartIntens( nVal ); break;
2434 aBGradient.SetEndIntens( nVal ); break;
2436 aBGradient.SetSteps( nVal ); break;
2438 aBGradient.SetXOffset( nVal ); break;
2440 aBGradient.SetYOffset( nVal ); break;
2441 }
2442
2443 SetGradientValue( aBGradient );
2444 break;
2445 }
2446 }
2447
2448 return true;
2449}
2450
2452{
2453 return static_cast<const XFillGradientItem*>(p1)->GetGradientValue() == static_cast<const XFillGradientItem*>(p2)->GetGradientValue();
2454}
2455
2456std::unique_ptr<XFillGradientItem> XFillGradientItem::checkForUniqueItem( SdrModel* pModel ) const
2457{
2458 if( pModel )
2459 {
2460 const OUString aUniqueName = NameOrIndex::CheckNamedItem(
2461 this, Which(), &pModel->GetItemPool(),
2462 XFillGradientItem::CompareValueFunc, RID_SVXSTR_GRADIENT,
2464
2465 // if the given name is not valid, replace it!
2466 if( aUniqueName != GetName() )
2467 return std::make_unique<XFillGradientItem>( aUniqueName, aGradient, TypedWhichId<XFillGradientItem>(Which()) );
2468 }
2469
2470 return nullptr;
2471}
2472
2473boost::property_tree::ptree XFillGradientItem::dumpAsJSON() const
2474{
2475 boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
2476
2477 if (Which() == XATTR_FILLGRADIENT)
2478 aTree.put("commandName", ".uno:FillGradient");
2479
2480 aTree.push_back(std::make_pair("state", GetGradientValue().dumpAsJSON()));
2481
2482 return aTree;
2483}
2484
2485
2487
2489 bEnabled( false )
2490{
2492}
2493
2494XFillFloatTransparenceItem::XFillFloatTransparenceItem(const OUString& rName, const basegfx::BGradient& rGradient, bool bEnable ) :
2495 XFillGradientItem ( rName, rGradient ),
2496 bEnabled ( bEnable )
2497{
2499}
2500
2502 XFillGradientItem ( rItem ),
2503 bEnabled ( rItem.bEnabled )
2504{
2506}
2507
2509: XFillGradientItem ( -1, rTheGradient ),
2510 bEnabled ( bEnable )
2511{
2513}
2514
2516{
2517 return ( NameOrIndex::operator==(rItem) ) &&
2518 ( GetGradientValue() == static_cast<const XFillGradientItem&>(rItem).GetGradientValue() ) &&
2519 ( bEnabled == static_cast<const XFillFloatTransparenceItem&>(rItem).bEnabled );
2520}
2521
2523{
2524 return new XFillFloatTransparenceItem( *this );
2525}
2526
2527bool XFillFloatTransparenceItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
2528{
2529 if (MID_GRADIENT_STARTINTENSITY == nMemberId
2530 || MID_GRADIENT_ENDINTENSITY == nMemberId
2531 || MID_GRADIENT_STEPCOUNT == nMemberId)
2532 {
2533 // tdf#155913 handle attributes not supported by transparency gradient as error
2534 return false;
2535 }
2536
2537 if (!IsEnabled() && nMemberId == MID_NAME)
2538 {
2539 // make sure that we return empty string in case of query for
2540 // "FillTransparenceGradientName" if the item is disabled
2541 rVal <<= OUString();
2542 return true;
2543 }
2544
2545 return XFillGradientItem::QueryValue( rVal, nMemberId );
2546}
2547
2548bool XFillFloatTransparenceItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
2549{
2550 if (MID_GRADIENT_STARTINTENSITY == nMemberId
2551 || MID_GRADIENT_ENDINTENSITY == nMemberId
2552 || MID_GRADIENT_STEPCOUNT == nMemberId)
2553 {
2554 // tdf#155913 handle attributes not supported by transparency gradient as error
2555 return false;
2556 }
2557
2558 return XFillGradientItem::PutValue( rVal, nMemberId );
2559}
2560
2562 MapUnit eCoreUnit, MapUnit ePresUnit,
2563 OUString& rText,
2564 const IntlWrapper& rIntlWrapper ) const
2565{
2566 return XFillGradientItem::GetPresentation( ePres, eCoreUnit, ePresUnit, rText, rIntlWrapper );
2567}
2568
2570{
2571 return static_cast<const XFillFloatTransparenceItem*>(p1)->IsEnabled() == static_cast<const XFillFloatTransparenceItem*>(p2)->IsEnabled() &&
2572 static_cast<const XFillFloatTransparenceItem*>(p1)->GetGradientValue() == static_cast<const XFillFloatTransparenceItem*>(p2)->GetGradientValue();
2573}
2574
2575std::unique_ptr<XFillFloatTransparenceItem> XFillFloatTransparenceItem::checkForUniqueItem( SdrModel* pModel ) const
2576{
2577 // #85953# unique name only necessary when enabled
2578 if(IsEnabled())
2579 {
2580 if( pModel )
2581 {
2582 const OUString aUniqueName = NameOrIndex::CheckNamedItem( this,
2584 &pModel->GetItemPool(),
2586 RID_SVXSTR_TRASNGR0,
2587 XPropertyListRef() );
2588
2589 // if the given name is not valid, replace it!
2590 if( aUniqueName != GetName() )
2591 {
2592 return std::make_unique<XFillFloatTransparenceItem>( aUniqueName, GetGradientValue(), true );
2593 }
2594 }
2595 }
2596 else
2597 {
2598 // #85953# if disabled, force name to empty string
2599 if( !GetName().isEmpty() )
2600 {
2601 return std::make_unique<XFillFloatTransparenceItem>(OUString(), GetGradientValue(), false);
2602 }
2603 }
2604
2605 return nullptr;
2606}
2607
2608boost::property_tree::ptree XFillFloatTransparenceItem::dumpAsJSON() const
2609{
2610 boost::property_tree::ptree aTree = XFillGradientItem::dumpAsJSON();
2611 aTree.put("commandName", ".uno:FillFloatTransparence");
2612
2613 if (!bEnabled)
2614 {
2615 boost::property_tree::ptree& rState = aTree.get_child("state");
2616 // When gradient fill is disabled, the intensity fields contain the
2617 // constant encoded percent-transparency. However we use that here to just
2618 // distinguish between 'None' and 'Solid' types and correct the 'style'
2619 // property appropriately.
2620 if (GetGradientValue().GetStartIntens() == 100)
2621 rState.put("style", "NONE");
2622 else
2623 rState.put("style", "SOLID");
2624 }
2625
2626 return aTree;
2627}
2628
2629XHatch::XHatch(const Color& rCol, css::drawing::HatchStyle eTheStyle, tools::Long nTheDistance,
2630 Degree10 nTheAngle) :
2631 eStyle(eTheStyle),
2632 aColor(rCol),
2633 nDistance(nTheDistance),
2634 nAngle(nTheAngle)
2635{
2636}
2637
2638bool XHatch::operator==(const XHatch& rHatch) const
2639{
2640 return ( eStyle == rHatch.eStyle &&
2641 aColor == rHatch.aColor &&
2642 nDistance == rHatch.nDistance &&
2643 nAngle == rHatch.nAngle );
2644}
2645
2646
2648
2650 const XHatch& rTheHatch) :
2652 aHatch(rTheHatch)
2653{
2654}
2655
2657 NameOrIndex(rItem),
2658 aHatch(rItem.aHatch)
2659{
2660}
2661
2664 aHatch(rTheHatch)
2665{
2666}
2667
2669{
2670 return new XFillHatchItem(*this);
2671}
2672
2674{
2675 return ( NameOrIndex::operator==(rItem) &&
2676 aHatch == static_cast<const XFillHatchItem&>(rItem).aHatch );
2677}
2678
2680(
2681 SfxItemPresentation /*ePres*/,
2682 MapUnit /*eCoreUnit*/,
2683 MapUnit /*ePresUnit*/,
2684 OUString& rText, const IntlWrapper&
2685) const
2686{
2687 rText = GetName();
2688 return true;
2689}
2690
2692{
2693 return true;
2694}
2695
2697{
2699}
2700
2701bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
2702{
2703 nMemberId &= ~CONVERT_TWIPS;
2704
2705 switch ( nMemberId )
2706 {
2707 case 0:
2708 {
2709 css::drawing::Hatch aUnoHatch;
2710
2711 aUnoHatch.Style = aHatch.GetHatchStyle();
2712 aUnoHatch.Color = sal_Int32(aHatch.GetColor());
2713 aUnoHatch.Distance = aHatch.GetDistance();
2714 aUnoHatch.Angle = aHatch.GetAngle().get();
2715
2716 uno::Sequence< beans::PropertyValue > aPropSeq{
2718 comphelper::makePropertyValue("FillHatch", aUnoHatch)
2719 };
2720 rVal <<= aPropSeq;
2721 break;
2722 }
2723
2724 case MID_FILLHATCH:
2725 {
2726 css::drawing::Hatch aUnoHatch;
2727
2728 aUnoHatch.Style = aHatch.GetHatchStyle();
2729 aUnoHatch.Color = sal_Int32(aHatch.GetColor());
2730 aUnoHatch.Distance = aHatch.GetDistance();
2731 aUnoHatch.Angle = aHatch.GetAngle().get();
2732 rVal <<= aUnoHatch;
2733 break;
2734 }
2735
2736 case MID_NAME:
2737 {
2738 rVal <<= SvxUnogetApiNameForItem(Which(), GetName());
2739 break;
2740 }
2741
2742 case MID_HATCH_STYLE:
2743 rVal <<= aHatch.GetHatchStyle(); break;
2744 case MID_HATCH_COLOR:
2745 rVal <<= aHatch.GetColor(); break;
2746 case MID_HATCH_DISTANCE:
2747 rVal <<= aHatch.GetDistance(); break;
2748 case MID_HATCH_ANGLE:
2749 rVal <<= aHatch.GetAngle().get(); break;
2750
2751 default: OSL_FAIL("Wrong MemberId!"); return false;
2752 }
2753
2754 return true;
2755}
2756
2757bool XFillHatchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
2758{
2759 nMemberId &= ~CONVERT_TWIPS;
2760
2761 switch ( nMemberId )
2762 {
2763 case 0:
2764 {
2765 uno::Sequence< beans::PropertyValue > aPropSeq;
2766 if ( rVal >>= aPropSeq )
2767 {
2768 css::drawing::Hatch aUnoHatch;
2769 OUString aName;
2770 bool bHatch( false );
2771 for ( const auto& rProp : std::as_const(aPropSeq) )
2772 {
2773 if ( rProp.Name == "Name" )
2774 rProp.Value >>= aName;
2775 else if ( rProp.Name == "FillHatch" )
2776 {
2777 if ( rProp.Value >>= aUnoHatch )
2778 bHatch = true;
2779 }
2780 }
2781
2782 SetName( aName );
2783 if ( bHatch )
2784 {
2785 aHatch.SetHatchStyle( aUnoHatch.Style );
2786 aHatch.SetColor( Color(ColorTransparency, aUnoHatch.Color) );
2787 aHatch.SetDistance( aUnoHatch.Distance );
2788 aHatch.SetAngle( Degree10(aUnoHatch.Angle) );
2789 }
2790
2791 return true;
2792 }
2793
2794 return false;
2795 }
2796
2797 case MID_FILLHATCH:
2798 {
2799 css::drawing::Hatch aUnoHatch;
2800 if(!(rVal >>= aUnoHatch))
2801 return false;
2802
2803 aHatch.SetHatchStyle( aUnoHatch.Style );
2804 aHatch.SetColor( Color(ColorTransparency, aUnoHatch.Color) );
2805 aHatch.SetDistance( aUnoHatch.Distance );
2806 aHatch.SetAngle( Degree10(aUnoHatch.Angle) );
2807 break;
2808 }
2809
2810 case MID_NAME:
2811 {
2812 OUString aName;
2813 if (!(rVal >>= aName ))
2814 return false;
2815 SetName( aName );
2816 break;
2817 }
2818
2819 case MID_HATCH_STYLE:
2820 {
2821 sal_Int16 nVal = sal_Int16();
2822 if (!(rVal >>= nVal ))
2823 return false;
2824 aHatch.SetHatchStyle( static_cast<css::drawing::HatchStyle>(nVal) );
2825 break;
2826 }
2827
2828 case MID_HATCH_COLOR:
2829 case MID_HATCH_DISTANCE:
2830 case MID_HATCH_ANGLE:
2831 {
2832 sal_Int32 nVal = 0;
2833 if (!(rVal >>= nVal ))
2834 return false;
2835
2836 if ( nMemberId == MID_HATCH_COLOR )
2838 else if ( nMemberId == MID_HATCH_DISTANCE )
2839 aHatch.SetDistance( nVal );
2840 else
2841 aHatch.SetAngle( Degree10(nVal) );
2842 break;
2843 }
2844
2845 default: OSL_FAIL("Wrong MemberId!"); return false;
2846 }
2847
2848 return true;
2849}
2850
2852{
2853 return static_cast<const XFillHatchItem*>(p1)->GetHatchValue() == static_cast<const XFillHatchItem*>(p2)->GetHatchValue();
2854}
2855
2856std::unique_ptr<XFillHatchItem> XFillHatchItem::checkForUniqueItem( SdrModel* pModel ) const
2857{
2858 if( pModel )
2859 {
2860 const OUString aUniqueName = NameOrIndex::CheckNamedItem(
2861 this, XATTR_FILLHATCH, &pModel->GetItemPool(),
2862 XFillHatchItem::CompareValueFunc, RID_SVXSTR_HATCH10,
2864
2865 // if the given name is not valid, replace it!
2866 if( aUniqueName != GetName() )
2867 return std::make_unique<XFillHatchItem>( aUniqueName, aHatch );
2868 }
2869
2870 return nullptr;
2871}
2872
2873// --- form text attributes ---
2874
2875
2877
2880{
2881}
2882
2884{
2885 return new XFormTextStyleItem( *this );
2886}
2887
2889{
2890 return 5;
2891}
2892
2893bool XFormTextStyleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2894{
2895 rVal <<= static_cast<sal_Int32>(GetValue());
2896 return true;
2897}
2898
2899bool XFormTextStyleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2900{
2901 sal_Int32 nValue = 0;
2902 rVal >>= nValue;
2903 SetValue(static_cast<XFormTextStyle>(nValue));
2904
2905 return true;
2906}
2907
2908
2910
2912 SfxEnumItem(XATTR_FORMTXTADJUST, eTheAdjust)
2913{
2914}
2915
2917{
2918 return new XFormTextAdjustItem( *this );
2919}
2920
2922{
2923 return 4;
2924}
2925
2926bool XFormTextAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2927{
2928 rVal <<= static_cast<sal_Int32>(GetValue());
2929 return true;
2930}
2931
2932bool XFormTextAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2933{
2934 sal_Int32 nValue = 0;
2935 rVal >>= nValue;
2936 SetValue(static_cast<XFormTextAdjust>(nValue));
2937
2938 return true;
2939}
2940
2941
2943
2946{
2947}
2948
2950{
2951 return new XFormTextDistanceItem(*this);
2952}
2953
2955
2958{
2959}
2960
2962{
2963 return new XFormTextStartItem(*this);
2964}
2965
2967
2970{
2971}
2972
2974{
2975 return new XFormTextMirrorItem(*this);
2976}
2977
2979
2982{
2983}
2984
2986{
2987 return new XFormTextOutlineItem(*this);
2988}
2989
2991
2993 SfxEnumItem(XATTR_FORMTXTSHADOW, eFormTextShadow)
2994{
2995}
2996
2998{
2999 return new XFormTextShadowItem( *this );
3000}
3001
3003{
3004 return 3;
3005}
3006
3007bool XFormTextShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
3008{
3009 rVal <<= static_cast<sal_Int32>(GetValue());
3010 return true;
3011}
3012
3013bool XFormTextShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
3014{
3015 sal_Int32 nValue = 0;
3016 rVal >>= nValue;
3017 SetValue(static_cast<XFormTextShadow>(nValue));
3018
3019 return true;
3020}
3021
3022
3024
3026 const Color& rTheColor) :
3027 XColorItem(XATTR_FORMTXTSHDWCOLOR, rName, rTheColor)
3028{
3029}
3030
3032{
3033 return new XFormTextShadowColorItem(*this);
3034}
3035
3037
3040{
3041}
3042
3044{
3045 return new XFormTextShadowXValItem(*this);
3046}
3047
3049
3052{
3053}
3054
3056{
3057 return new XFormTextShadowYValItem(*this);
3058}
3059
3061
3064{
3065}
3066
3068{
3069 return new XFormTextHideFormItem(*this);
3070}
3071
3072// --- SetItems ---
3073
3074
3077 SfxSetItem( XATTRSET_LINE, std::move(pItemSet))
3078{
3079}
3080
3084{
3085}
3086
3088 SfxSetItem( rLineAttr )
3089{
3090}
3091
3093 SfxItemPool* pItemPool) :
3094 SfxSetItem( rLineAttr, pItemPool )
3095{
3096}
3097
3099{
3100 return new XLineAttrSetItem( *this, pPool );
3101}
3102
3105 SfxSetItem( XATTRSET_FILL, std::move(pItemSet))
3106{
3107}
3108
3112{
3113}
3114
3116 SfxSetItem( rFillAttr )
3117{
3118}
3119
3121 SfxItemPool* pItemPool ) :
3122 SfxSetItem( rFillAttr, pItemPool )
3123{
3124}
3125
3127{
3128 return new XFillAttrSetItem( *this, pPool );
3129}
3130
3131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr auto convertTwipToMm100(N n)
static tools::Long Scale(tools::Long nVal, tools::Long nMult, tools::Long nDiv)
sal_Int32 GetValue() const
void SetValue(sal_Int32 nTheValue)
Color GetRGBColor() const
basegfx::BColor getBColor() const
OUString AsRGBHexString() const
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:117
NameOrIndex()
Definition: xit.hxx:45
OUString const & GetName() const
Definition: xit.hxx:53
void SetName(const OUString &rName)
Definition: xit.hxx:54
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: xattr.cxx:253
virtual NameOrIndex * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:123
static OUString CheckNamedItem(const NameOrIndex *pCheckItem, const sal_uInt16 nWhich, const SfxItemPool *pPool1, SvxCompareValueFunc pCompareValueFunc, TranslateId pPrefixResId, const XPropertyListRef &pDefaults)
this static checks if the given NameOrIndex item has a unique name for its value.
Definition: xattr.cxx:133
sal_Int32 nPalIndex
Definition: xit.hxx:39
bool IsIndex() const
Definition: xit.hxx:55
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:318
SfxStyleSheetBasePool * GetStyleSheetPool() const
Definition: svdmodel.hxx:538
const XPropertyListRef & GetPropertyList(XPropertyListType t) const
Definition: svdmodel.hxx:524
void SetValue(bool const bTheValue)
bool GetValue() const
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
sal_uInt16 Which() const
void SetWhich(sal_uInt16 nId)
virtual boost::property_tree::ptree dumpAsJSON() const
SfxItemPool & GetPool()
const model::ComplexColor & getComplexColor() const
Definition: xcolit.hxx:54
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:309
Color aColor
Definition: xcolit.hxx:34
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:263
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:334
XColorItem()
Definition: xcolit.hxx:39
void setComplexColor(model::ComplexColor const &rComplexColor)
Definition: xcolit.hxx:53
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: xattr.cxx:376
virtual XColorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:290
void SetColorValue(const Color &rNew)
Definition: xcolit.hxx:51
const Color & GetColorValue() const
Definition: xattr.cxx:302
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:295
model::ComplexColor maComplexColor
Definition: xcolit.hxx:35
Definition: xdash.hxx:32
void SetDashLen(double nNewDashLen)
Definition: xdash.hxx:51
double nDotLen
Definition: xdash.hxx:36
css::drawing::DashStyle eDash
Definition: xdash.hxx:33
void SetDots(sal_uInt16 nNewDots)
Definition: xdash.hxx:48
double GetDotLen() const
Definition: xdash.hxx:56
css::drawing::DashStyle GetDashStyle() const
Definition: xdash.hxx:54
bool operator==(const XDash &rDash) const
Definition: xattr.cxx:494
void SetDotLen(double nNewDotLen)
Definition: xdash.hxx:49
double nDistance
Definition: xdash.hxx:38
double GetDashLen() const
Definition: xdash.hxx:58
void SetDistance(double nNewDistance)
Definition: xdash.hxx:52
double nDashLen
Definition: xdash.hxx:37
void SetDashes(sal_uInt16 nNewDashes)
Definition: xdash.hxx:50
sal_uInt16 nDashes
Definition: xdash.hxx:35
double GetDistance() const
Definition: xdash.hxx:59
double CreateDotDashArray(::std::vector< double > &rDotDashArray, double fLineWidth) const
Definition: xattr.cxx:509
void SetDashStyle(css::drawing::DashStyle eNewStyle)
Definition: xdash.hxx:47
sal_uInt16 GetDots() const
Definition: xdash.hxx:55
sal_uInt16 nDots
Definition: xdash.hxx:34
XDash(css::drawing::DashStyle eDash=css::drawing::DashStyle_RECT, sal_uInt16 nDots=1, double nDotLen=20, sal_uInt16 nDashes=1, double nDashLen=20, double nDistance=20)
Definition: xattr.cxx:483
sal_uInt16 GetDashes() const
Definition: xdash.hxx:57
virtual XFillAttrSetItem * Clone(SfxItemPool *pToPool=nullptr) const override
Definition: xattr.cxx:3126
XFillAttrSetItem(SfxItemSet &&pItemSet)
fill attribute set item
Definition: xattr.cxx:3104
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:2011
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:1993
virtual XFillColorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2005
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:2022
virtual boost::property_tree::ptree dumpAsJSON() const override
Definition: xattr.cxx:2153
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: xattr.cxx:2143
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:2075
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:2515
static bool CompareValueFunc(const NameOrIndex *p1, const NameOrIndex *p2)
Definition: xattr.cxx:2569
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2486
virtual XFillFloatTransparenceItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2522
virtual boost::property_tree::ptree dumpAsJSON() const override
Definition: xattr.cxx:2608
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:2548
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:2527
std::unique_ptr< XFillFloatTransparenceItem > checkForUniqueItem(SdrModel *pModel) const
Definition: xattr.cxx:2575
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const override
Definition: xattr.cxx:2561
void SetGradientValue(const basegfx::BGradient &rNew)
Definition: xflgrit.hxx:53
virtual XFillGradientItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2215
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:2247
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:2220
const basegfx::BGradient & GetGradientValue() const
Definition: xattr.cxx:2226
std::unique_ptr< XFillGradientItem > checkForUniqueItem(SdrModel *pModel) const
Definition: xattr.cxx:2456
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:2236
basegfx::BGradient aGradient
Definition: xflgrit.hxx:33
static bool CompareValueFunc(const NameOrIndex *p1, const NameOrIndex *p2)
Definition: xattr.cxx:2451
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2187
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:2310
virtual boost::property_tree::ptree dumpAsJSON() const override
Definition: xattr.cxx:2473
const XHatch & GetHatchValue() const
Definition: xflhtit.hxx:55
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:2757
virtual bool HasMetrics() const override
Definition: xattr.cxx:2691
virtual void ScaleMetrics(tools::Long nMul, tools::Long nDiv) override
Definition: xattr.cxx:2696
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2647
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:2673
std::unique_ptr< XFillHatchItem > checkForUniqueItem(SdrModel *pModel) const
Definition: xattr.cxx:2856
static bool CompareValueFunc(const NameOrIndex *p1, const NameOrIndex *p2)
Definition: xattr.cxx:2851
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:2701
virtual XFillHatchItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2668
XHatch aHatch
Definition: xflhtit.hxx:34
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:2680
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:1918
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: xattr.cxx:1944
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:1877
virtual XFillStyleItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1871
XFillStyleItem(css::drawing::FillStyle=css::drawing::FillStyle_SOLID)
Definition: xattr.cxx:1866
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:1927
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:1864
virtual boost::property_tree::ptree dumpAsJSON() const override
Definition: xattr.cxx:1958
virtual sal_uInt16 GetValueCount() const override
Definition: xattr.cxx:1913
XFormTextAdjustItem(XFormTextAdjust=XFormTextAdjust::Center)
Definition: xattr.cxx:2911
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:2926
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2909
virtual sal_uInt16 GetValueCount() const override
Definition: xattr.cxx:2921
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:2932
virtual XFormTextAdjustItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2916
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2942
virtual XFormTextDistanceItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2949
XFormTextDistanceItem(tools::Long nDist=0)
Definition: xattr.cxx:2944
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:3060
virtual XFormTextHideFormItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:3067
XFormTextHideFormItem(bool bHide=false)
Definition: xattr.cxx:3062
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2966
virtual XFormTextMirrorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2973
XFormTextMirrorItem(bool bMirror=false)
Definition: xattr.cxx:2968
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2978
virtual XFormTextOutlineItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2985
XFormTextOutlineItem(bool bOutline=false)
Definition: xattr.cxx:2980
virtual XFormTextShadowColorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:3031
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:3023
virtual sal_uInt16 GetValueCount() const override
Definition: xattr.cxx:3002
virtual XFormTextShadowItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2997
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:3013
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2990
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:3007
XFormTextShadowItem(XFormTextShadow=XFormTextShadow::NONE)
Definition: xattr.cxx:2992
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:3036
XFormTextShadowXValItem(tools::Long nVal=0)
Definition: xattr.cxx:3038
virtual XFormTextShadowXValItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:3043
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:3048
virtual XFormTextShadowYValItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:3055
XFormTextShadowYValItem(tools::Long nVal=0)
Definition: xattr.cxx:3050
virtual XFormTextStartItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2961
XFormTextStartItem(tools::Long nStart=0)
Definition: xattr.cxx:2956
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2954
virtual XFormTextStyleItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2883
virtual sal_uInt16 GetValueCount() const override
Definition: xattr.cxx:2888
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2876
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:2899
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:2893
XFormTextStyleItem(XFormTextStyle=XFormTextStyle::NONE)
Definition: xattr.cxx:2878
css::drawing::HatchStyle eStyle
Definition: xhatch.hxx:34
Degree10 nAngle
Definition: xhatch.hxx:37
const Color & GetColor() const
Definition: xhatch.hxx:52
tools::Long nDistance
Definition: xhatch.hxx:36
tools::Long GetDistance() const
Definition: xhatch.hxx:53
void SetDistance(tools::Long nNewDistance)
Definition: xhatch.hxx:48
Color aColor
Definition: xhatch.hxx:35
bool operator==(const XHatch &rHatch) const
Definition: xattr.cxx:2638
void SetHatchStyle(css::drawing::HatchStyle eNewStyle)
Definition: xhatch.hxx:46
css::drawing::HatchStyle GetHatchStyle() const
Definition: xhatch.hxx:51
void SetColor(const Color &rColor)
Definition: xhatch.hxx:47
Degree10 GetAngle() const
Definition: xhatch.hxx:54
void SetAngle(Degree10 nNewAngle)
Definition: xhatch.hxx:49
XHatch()
Definition: xhatch.hxx:40
XLineAttrSetItem(SfxItemSet &&pItemSet)
a line attribute set item
Definition: xattr.cxx:3076
virtual XLineAttrSetItem * Clone(SfxItemPool *pToPool=nullptr) const override
Definition: xattr.cxx:3098
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:1047
virtual XLineColorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1030
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:1018
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:1072
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:1036
static bool CompareValueFunc(const NameOrIndex *p1, const NameOrIndex *p2)
Definition: xattr.cxx:949
const XDash & GetDashValue() const
Definition: xlndsit.hxx:57
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:652
XDash aDash
Definition: xlndsit.hxx:35
virtual void ScaleMetrics(tools::Long nMul, tools::Long nDiv) override
Definition: xattr.cxx:700
virtual XLineDashItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:672
virtual bool HasMetrics() const override
Definition: xattr.cxx:695
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:684
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:804
std::unique_ptr< XLineDashItem > checkForUniqueItem(SdrModel *pModel) const
Definition: xattr.cxx:954
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:707
void SetDashValue(const XDash &rNew)
Definition: xlndsit.hxx:58
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:677
virtual XLineEndCenterItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1827
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:1851
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:1833
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:1844
XLineEndCenterItem(bool bEndCenter=false)
Definition: xattr.cxx:1822
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:1677
const basegfx::B2DPolyPolygon & GetLineEndValue() const
Definition: xlnedit.hxx:53
virtual XLineEndItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1435
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:1410
basegfx::B2DPolyPolygon maPolyPolygon
Definition: xlnedit.hxx:33
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:1440
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:1661
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:1650
std::unique_ptr< XLineEndItem > checkForUniqueItem(SdrModel *pModel) const
this function searches in both the models pool and the styles pool for XLineStartItem and XLineEndIte...
Definition: xattr.cxx:1449
XLineEndItem(sal_Int32 nIndex=-1)
Definition: xattr.cxx:1412
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:1756
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:1769
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:1775
virtual XLineEndWidthItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1750
XLineEndWidthItem(tools::Long nWidth=LINE_END_WIDTH_DEFAULT)
Definition: xattr.cxx:1745
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:1805
XLineStartCenterItem(bool bStartCenter=false)
Definition: xattr.cxx:1783
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:1794
virtual XLineStartCenterItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1788
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:1812
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:1149
std::unique_ptr< XLineStartItem > checkForUniqueItem(SdrModel *pModel) const
this function searches in both the models pool and the styles pool for XLineStartItem and XLineEndIte...
Definition: xattr.cxx:1210
const basegfx::B2DPolyPolygon & GetLineStartValue() const
Definition: xlnstit.hxx:53
basegfx::B2DPolyPolygon maPolyPolygon
Definition: xlnstit.hxx:33
XLineStartItem(sal_Int32 nIndex=-1)
Definition: xattr.cxx:1115
virtual XLineStartItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1138
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:1160
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:1177
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:1113
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:1143
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:1737
virtual XLineStartWidthItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1712
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:1718
XLineStartWidthItem(tools::Long nWidth=LINE_START_WIDTH_DEFAULT)
Definition: xattr.cxx:1707
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:1731
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:415
virtual XLineStyleItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:422
virtual sal_uInt16 GetValueCount() const override
Definition: xattr.cxx:478
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:455
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:428
XLineStyleItem(css::drawing::LineStyle=css::drawing::LineStyle_SOLID)
Definition: xattr.cxx:417
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:462
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:997
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:984
XLineWidthItem(tools::Long nWidth=0)
Definition: xattr.cxx:973
virtual XLineWidthItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:978
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:1007
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:971
const OUString & GetName() const
virtual SVX_DLLPRIVATE XSecondaryFillColorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2170
XSecondaryFillColorItem(const OUString &rName, const Color &rTheColor)
Definition: xattr.cxx:2165
virtual SVX_DLLPRIVATE bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:2176
void setClosed(bool bNew)
sal_uInt32 count() const
void replaceEndColor(const BColor &rEnd)
void replaceStartColor(const BColor &rStart)
sal_uInt16 GetBorder() const
void SetGradientStyle(css::awt::GradientStyle eNewStyle)
sal_uInt16 GetStartIntens() const
void SetColorStops(const basegfx::BColorStops &rSteps)
sal_uInt16 GetSteps() const
void SetEndIntens(sal_uInt16 nNewIntens)
void SetYOffset(sal_uInt16 nNewOffset)
void SetXOffset(sal_uInt16 nNewOffset)
sal_uInt16 GetXOffset() const
void SetSteps(sal_uInt16 nSteps)
void SetBorder(sal_uInt16 nNewBorder)
const basegfx::BColorStops & GetColorStops() const
sal_uInt16 GetEndIntens() const
void SetStartIntens(sal_uInt16 nNewIntens)
void SetAngle(Degree10 nNewAngle)
sal_uInt16 GetYOffset() const
void setSchemeColor(ThemeColorType eType)
std::vector< Transformation > const & getTransformations() const
void removeTransformations(TransformationType eType)
void addTransformation(Transformation const &rTransform)
ThemeColorType getSchemeType() const
ColorTransparency
int nCount
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
OUString EditResId(TranslateId aId)
struct _xmlTextWriter * xmlTextWriterPtr
sal_Int16 nValue
Definition: fmsrccfg.cxx:81
sal_Int32 nIndex
OUString aName
OUString GetMetricText(tools::Long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const IntlWrapper *pIntl)
TranslateId GetMetricId(MapUnit eUnit)
void * p
uno_Any a
MapUnit
#define MID_COLOR_LUM_MOD
#define MID_COMPLEX_COLOR_JSON
#define MID_COMPLEX_COLOR
#define MID_NAME
#define MID_COLOR_THEME_INDEX
#define MID_COLOR_LUM_OFF
void B2DPolyPolygonToUnoPolyPolygonBezierCoords(const B2DPolyPolygon &rPolyPolygon, css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsRetval)
B2DPolyPolygon UnoPolyPolygonBezierCoordsToB2DPolyPolygon(const css::drawing::PolyPolygonBezierCoords &rPolyPolygonBezierCoordsSource)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
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)
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
constexpr auto toTwips(N number, Length from)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
long Long
SfxItemPresentation
#define CONVERT_TWIPS
basegfx::B2DPolyPolygon maPolyPolygon
the basegfx::B2DPolyPolygon geometry
char aEntryName[20]
UNDERLYING_TYPE get() const
constexpr TypedWhichId< XColorItem > SDRATTR_SHADOWCOLOR(SDRATTR_SHADOW_FIRST+1)
Degree100 GetAngle(const Point &rPnt)
The Y axis points down! The function negates the Y axis, when calculating the angle,...
Definition: svdtrans.cxx:387
unsigned char sal_uInt8
#define MID_HATCH_COLOR
Definition: unomid.hxx:80
#define MID_GRADIENT_ENDINTENSITY
Definition: unomid.hxx:72
#define MID_FILLHATCH
Definition: unomid.hxx:78
#define MID_LINEDASH_DOTLEN
Definition: unomid.hxx:89
#define MID_GRADIENT_ENDCOLOR
Definition: unomid.hxx:66
#define MID_LINEDASH_DOTS
Definition: unomid.hxx:88
#define MID_GRADIENT_ANGLE
Definition: unomid.hxx:67
#define MID_GRADIENT_STEPCOUNT
Definition: unomid.hxx:73
#define MID_GRADIENT_XOFFSET
Definition: unomid.hxx:69
#define MID_GRADIENT_YOFFSET
Definition: unomid.hxx:70
#define MID_GRADIENT_STYLE
Definition: unomid.hxx:64
#define MID_LINEDASH_DASHES
Definition: unomid.hxx:90
#define MID_HATCH_DISTANCE
Definition: unomid.hxx:81
#define MID_FILLGRADIENT
Definition: unomid.hxx:63
#define MID_GRADIENT_STARTINTENSITY
Definition: unomid.hxx:71
#define MID_LINEDASH_DASHLEN
Definition: unomid.hxx:91
#define MID_HATCH_STYLE
Definition: unomid.hxx:79
#define MID_LINEDASH
Definition: unomid.hxx:86
#define MID_LINEDASH_DISTANCE
Definition: unomid.hxx:92
#define MID_LINEDASH_STYLE
Definition: unomid.hxx:87
#define MID_GRADIENT_COLORSTOPSEQUENCE
Definition: unomid.hxx:74
#define MID_GRADIENT_BORDER
Definition: unomid.hxx:68
#define MID_HATCH_ANGLE
Definition: unomid.hxx:82
#define MID_GRADIENT_STARTCOLOR
Definition: unomid.hxx:65
OUString SvxUnogetApiNameForItem(const sal_uInt16 nWhich, const OUString &rInternalName)
if the given name is a predefined name for the current language it is replaced by the corresponding a...
Definition: unoprov.cxx:1991
OUString SvxUnogetInternalNameForItem(const sal_uInt16 nWhich, const OUString &rApiName)
if the given name is a predefined api name it is replaced by the predefined name for the current lang...
Definition: unoprov.cxx:2024
const double SMALLEST_DASH_WIDTH(26.95)
std::map< OUString, OUString > StringMap
Definition: xattr.cxx:97
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillAttrSetItem > XATTRSET_FILL(XATTR_FILL_LAST+1)
constexpr TypedWhichId< XSecondaryFillColorItem > XATTR_SECONDARYFILLCOLOR(XATTR_FILL_FIRST+12)
constexpr TypedWhichId< XFormTextMirrorItem > XATTR_FORMTXTMIRROR(XATTR_TEXT_FIRST+4)
constexpr TypedWhichId< XFormTextStyleItem > XATTR_FORMTXTSTYLE(XATTR_TEXT_FIRST)
constexpr TypedWhichId< XFormTextStartItem > XATTR_FORMTXTSTART(XATTR_TEXT_FIRST+3)
constexpr TypedWhichId< XLineColorItem > XATTR_LINECOLOR(XATTR_LINE_FIRST+3)
constexpr TypedWhichId< XLineStartWidthItem > XATTR_LINESTARTWIDTH(XATTR_LINE_FIRST+6)
constexpr TypedWhichId< XFormTextShadowYValItem > XATTR_FORMTXTSHDWYVAL(XATTR_TEXT_FIRST+9)
constexpr TypedWhichId< XFormTextHideFormItem > XATTR_FORMTXTHIDEFORM(XATTR_TEXT_FIRST+10)
constexpr TypedWhichId< XLineDashItem > XATTR_LINEDASH(XATTR_LINE_FIRST+1)
constexpr TypedWhichId< XFormTextDistanceItem > XATTR_FORMTXTDISTANCE(XATTR_TEXT_FIRST+2)
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)
constexpr TypedWhichId< XLineEndItem > XATTR_LINEEND(XATTR_LINE_FIRST+5)
constexpr TypedWhichId< XFormTextShadowItem > XATTR_FORMTXTSHADOW(XATTR_TEXT_FIRST+6)
constexpr TypedWhichId< XLineStartItem > XATTR_LINESTART(XATTR_LINE_FIRST+4)
constexpr sal_uInt16 XATTR_LINE_FIRST(XATTR_START)
constexpr TypedWhichId< XFormTextOutlineItem > XATTR_FORMTXTOUTLINE(XATTR_TEXT_FIRST+5)
constexpr TypedWhichId< XFormTextShadowXValItem > XATTR_FORMTXTSHDWXVAL(XATTR_TEXT_FIRST+8)
constexpr TypedWhichId< XFormTextShadowColorItem > XATTR_FORMTXTSHDWCOLOR(XATTR_TEXT_FIRST+7)
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr TypedWhichId< XLineEndCenterItem > XATTR_LINEENDCENTER(XATTR_LINE_FIRST+9)
constexpr sal_uInt16 XATTR_LINE_LAST(XATTR_LINECAP)
constexpr TypedWhichId< XLineAttrSetItem > XATTRSET_LINE(XATTR_LINE_LAST+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr TypedWhichId< XLineStartCenterItem > XATTR_LINESTARTCENTER(XATTR_LINE_FIRST+8)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
constexpr TypedWhichId< XFormTextAdjustItem > XATTR_FORMTXTADJUST(XATTR_TEXT_FIRST+1)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
constexpr TypedWhichId< XLineEndWidthItem > XATTR_LINEENDWIDTH(XATTR_LINE_FIRST+7)
XFormTextStyle
Definition: xenum.hxx:24
XFormTextAdjust
Definition: xenum.hxx:25
XFormTextShadow
Definition: xenum.hxx:26
bool(* SvxCompareValueFunc)(const NameOrIndex *p1, const NameOrIndex *p2)
Definition: xit.hxx:33