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