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