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