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