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