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