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 )
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 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_DASH20,
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 boost::property_tree::ptree XFillColorItem::dumpAsJSON() const
1920 {
1921  boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
1922 
1923  if (Which() == XATTR_FILLCOLOR)
1924  aTree.put("commandName", ".uno:FillPageColor");
1925 
1926  aTree.put("state", GetColorValue().AsRGBHexString());
1927 
1928  return aTree;
1929 }
1930 
1931 XSecondaryFillColorItem::XSecondaryFillColorItem(const OUString& rName, const Color& rTheColor) :
1932  XColorItem(XATTR_SECONDARYFILLCOLOR, rName, rTheColor)
1933 {
1934 }
1935 
1937 {
1938  return new XSecondaryFillColorItem(*this);
1939 }
1940 
1943  SfxItemPresentation /*ePres*/,
1944  MapUnit /*eCoreUnit*/,
1945  MapUnit /*ePresUnit*/,
1946  OUString& rText, const IntlWrapper&
1947 ) const
1948 {
1949  rText = GetName();
1950  return true;
1951 }
1952 
1953 std::string XGradient::GradientStyleToString(css::awt::GradientStyle eStyle)
1954 {
1955  switch (eStyle)
1956  {
1957  case css::awt::GradientStyle::GradientStyle_LINEAR:
1958  return "LINEAR";
1959 
1960  case css::awt::GradientStyle::GradientStyle_AXIAL:
1961  return "AXIAL";
1962 
1963  case css::awt::GradientStyle::GradientStyle_RADIAL:
1964  return "RADIAL";
1965 
1966  case css::awt::GradientStyle::GradientStyle_ELLIPTICAL:
1967  return "ELLIPTICAL";
1968 
1969  case css::awt::GradientStyle::GradientStyle_SQUARE:
1970  return "SQUARE";
1971 
1972  case css::awt::GradientStyle::GradientStyle_RECT:
1973  return "RECT";
1974 
1975  case css::awt::GradientStyle::GradientStyle_MAKE_FIXED_SIZE:
1976  return "MAKE_FIXED_SIZE";
1977  }
1978 
1979  return "";
1980 }
1981 
1982 namespace
1983 {
1984  css::awt::GradientStyle lcl_getStyleFromString(const OUString& rStyle)
1985  {
1986  if (rStyle == "LINEAR")
1987  return css::awt::GradientStyle_LINEAR;
1988  else if (rStyle == "AXIAL")
1989  return css::awt::GradientStyle_AXIAL;
1990  else if (rStyle == "RADIAL")
1991  return css::awt::GradientStyle_RADIAL;
1992  else if (rStyle == "ELLIPTICAL")
1993  return css::awt::GradientStyle_ELLIPTICAL;
1994  else if (rStyle == "SQUARE")
1995  return css::awt::GradientStyle_SQUARE;
1996  else if (rStyle == "RECT")
1997  return css::awt::GradientStyle_RECT;
1998 
1999  return css::awt::GradientStyle_LINEAR;
2000  }
2001 
2002  StringMap lcl_jsonToStringMap(const OUString& rJSON)
2003  {
2004  StringMap aArgs;
2005  if (rJSON.getLength() && rJSON[0] != '\0')
2006  {
2007  std::stringstream aStream(OUStringToOString(rJSON, RTL_TEXTENCODING_ASCII_US).getStr());
2008  boost::property_tree::ptree aTree;
2009  boost::property_tree::read_json(aStream, aTree);
2010 
2011  for (const auto& rPair : aTree)
2012  {
2013  aArgs[OUString::fromUtf8(rPair.first.c_str())] = OUString::fromUtf8(rPair.second.get_value<std::string>(".").c_str());
2014  }
2015  }
2016  return aArgs;
2017  }
2018 
2019  XGradient lcl_buildGradientFromStringMap(StringMap& rMap)
2020  {
2021  XGradient aGradient;
2022 
2023  aGradient.SetStartColor(rMap["startcolor"].toInt32(16));
2024  aGradient.SetEndColor(rMap["endcolor"].toInt32(16));
2025  aGradient.SetGradientStyle(lcl_getStyleFromString(rMap["style"]));
2026  aGradient.SetAngle(rMap["angle"].toInt32());
2027 
2028  return aGradient;
2029  }
2030 }
2031 
2032 XGradient XGradient::fromJSON(const OUString& rJSON)
2033 {
2034  StringMap aMap(lcl_jsonToStringMap(rJSON));
2035  return lcl_buildGradientFromStringMap(aMap);
2036 }
2037 
2039  eStyle( css::awt::GradientStyle_LINEAR ),
2040  aStartColor( COL_BLACK ),
2041  aEndColor( COL_WHITE ),
2042  nAngle( 0 ),
2043  nBorder( 0 ),
2044  nOfsX( 50 ),
2045  nOfsY( 50 ),
2046  nIntensStart( 100 ),
2047  nIntensEnd( 100 ),
2048  nStepCount( 0 )
2049 {
2050 }
2051 
2052 XGradient::XGradient(const Color& rStart, const Color& rEnd,
2053  css::awt::GradientStyle eTheStyle, long nTheAngle, sal_uInt16 nXOfs,
2054  sal_uInt16 nYOfs, sal_uInt16 nTheBorder,
2055  sal_uInt16 nStartIntens, sal_uInt16 nEndIntens,
2056  sal_uInt16 nSteps) :
2057  eStyle(eTheStyle),
2058  aStartColor(rStart),
2059  aEndColor(rEnd),
2060  nAngle(nTheAngle),
2061  nBorder(nTheBorder),
2062  nOfsX(nXOfs),
2063  nOfsY(nYOfs),
2064  nIntensStart(nStartIntens),
2065  nIntensEnd(nEndIntens),
2066  nStepCount(nSteps)
2067 {
2068 }
2069 
2070 bool XGradient::operator==(const XGradient& rGradient) const
2071 {
2072  return ( eStyle == rGradient.eStyle &&
2073  aStartColor == rGradient.aStartColor &&
2074  aEndColor == rGradient.aEndColor &&
2075  nAngle == rGradient.nAngle &&
2076  nBorder == rGradient.nBorder &&
2077  nOfsX == rGradient.nOfsX &&
2078  nOfsY == rGradient.nOfsY &&
2079  nIntensStart == rGradient.nIntensStart &&
2080  nIntensEnd == rGradient.nIntensEnd &&
2081  nStepCount == rGradient.nStepCount );
2082 }
2083 
2084 boost::property_tree::ptree XGradient::dumpAsJSON() const
2085 {
2086  boost::property_tree::ptree aTree;
2087 
2088  aTree.put("style", XGradient::GradientStyleToString(eStyle));
2089  aTree.put("startcolor",aStartColor.AsRGBHexString());
2090  aTree.put("endcolor", aEndColor.AsRGBHexString());
2091  aTree.put("angle", std::to_string(nAngle));
2092  aTree.put("border", std::to_string(nBorder));
2093  aTree.put("x", std::to_string(nOfsX));
2094  aTree.put("y", std::to_string(nOfsY));
2095  aTree.put("intensstart", std::to_string(nIntensStart));
2096  aTree.put("intensend", std::to_string(nIntensEnd));
2097  aTree.put("stepcount", std::to_string(nStepCount));
2098 
2099  return aTree;
2100 }
2101 
2103 
2105  const XGradient& rTheGradient) :
2107  aGradient(rTheGradient)
2108 {
2109 }
2110 
2112  const XGradient& rTheGradient, sal_uInt16 nWhich)
2113  : NameOrIndex(nWhich, rName)
2114  , aGradient(rTheGradient)
2115 {
2116 }
2117 
2119  NameOrIndex(rItem),
2120  aGradient(rItem.aGradient)
2121 {
2122 }
2123 
2126  aGradient(rTheGradient)
2127 {
2128 }
2129 
2131 {
2132  return new XFillGradientItem(*this);
2133 }
2134 
2136 {
2137  return ( NameOrIndex::operator==(rItem) &&
2138  aGradient == static_cast<const XFillGradientItem&>(rItem).aGradient );
2139 }
2140 
2141 const XGradient& XFillGradientItem::GetGradientValue() const // GetValue -> GetGradientValue
2142 {
2143  if (!IsIndex())
2144  return aGradient;
2145  // ToDo: This should fail. We never called this code with a table so this should always
2146  // have failed. Thus, I'm thinking that XFillGradientItem can't be an Index.
2147  return aGradient;
2148 }
2149 
2152  SfxItemPresentation /*ePres*/,
2153  MapUnit /*eCoreUnit*/,
2154  MapUnit /*ePresUnit*/,
2155  OUString& rText, const IntlWrapper&
2156 ) const
2157 {
2158  rText = GetName();
2159  return true;
2160 }
2161 
2162 bool XFillGradientItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
2163 {
2164  nMemberId &= ~CONVERT_TWIPS;
2165  switch ( nMemberId )
2166  {
2167  case 0:
2168  {
2169  uno::Sequence< beans::PropertyValue > aPropSeq( 2 );
2170 
2171  css::awt::Gradient aGradient2;
2172 
2173  const XGradient& aXGradient = GetGradientValue();
2174  aGradient2.Style = aXGradient.GetGradientStyle();
2175  aGradient2.StartColor = static_cast<sal_Int32>(aXGradient.GetStartColor());
2176  aGradient2.EndColor = static_cast<sal_Int32>(aXGradient.GetEndColor());
2177  aGradient2.Angle = static_cast<short>(aXGradient.GetAngle());
2178  aGradient2.Border = aXGradient.GetBorder();
2179  aGradient2.XOffset = aXGradient.GetXOffset();
2180  aGradient2.YOffset = aXGradient.GetYOffset();
2181  aGradient2.StartIntensity = aXGradient.GetStartIntens();
2182  aGradient2.EndIntensity = aXGradient.GetEndIntens();
2183  aGradient2.StepCount = aXGradient.GetSteps();
2184 
2185  aPropSeq[0].Name = "Name";
2186  aPropSeq[0].Value <<= SvxUnogetApiNameForItem(Which(), GetName());
2187  aPropSeq[1].Name = "FillGradient";
2188  aPropSeq[1].Value <<= aGradient2;
2189  rVal <<= aPropSeq;
2190  break;
2191  }
2192 
2193  case MID_FILLGRADIENT:
2194  {
2195  const XGradient& aXGradient = GetGradientValue();
2196  css::awt::Gradient aGradient2;
2197 
2198  aGradient2.Style = aXGradient.GetGradientStyle();
2199  aGradient2.StartColor = static_cast<sal_Int32>(aXGradient.GetStartColor());
2200  aGradient2.EndColor = static_cast<sal_Int32>(aXGradient.GetEndColor());
2201  aGradient2.Angle = static_cast<short>(aXGradient.GetAngle());
2202  aGradient2.Border = aXGradient.GetBorder();
2203  aGradient2.XOffset = aXGradient.GetXOffset();
2204  aGradient2.YOffset = aXGradient.GetYOffset();
2205  aGradient2.StartIntensity = aXGradient.GetStartIntens();
2206  aGradient2.EndIntensity = aXGradient.GetEndIntens();
2207  aGradient2.StepCount = aXGradient.GetSteps();
2208 
2209  rVal <<= aGradient2;
2210  break;
2211  }
2212 
2213  case MID_NAME:
2214  {
2215  rVal <<= SvxUnogetApiNameForItem(Which(), GetName());
2216  break;
2217  }
2218 
2219  case MID_GRADIENT_STYLE: rVal <<= static_cast<sal_Int16>(GetGradientValue().GetGradientStyle()); break;
2220  case MID_GRADIENT_STARTCOLOR: rVal <<= GetGradientValue().GetStartColor(); break;
2221  case MID_GRADIENT_ENDCOLOR: rVal <<= GetGradientValue().GetEndColor(); break;
2222  case MID_GRADIENT_ANGLE: rVal <<= static_cast<sal_Int16>(GetGradientValue().GetAngle()); break;
2223  case MID_GRADIENT_BORDER: rVal <<= GetGradientValue().GetBorder(); break;
2224  case MID_GRADIENT_XOFFSET: rVal <<= GetGradientValue().GetXOffset(); break;
2225  case MID_GRADIENT_YOFFSET: rVal <<= GetGradientValue().GetYOffset(); break;
2227  case MID_GRADIENT_ENDINTENSITY: rVal <<= GetGradientValue().GetEndIntens(); break;
2228  case MID_GRADIENT_STEPCOUNT: rVal <<= GetGradientValue().GetSteps(); break;
2229 
2230  default: OSL_FAIL("Wrong MemberId!"); return false;
2231  }
2232 
2233  return true;
2234 }
2235 
2236 bool XFillGradientItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
2237 {
2238  nMemberId &= ~CONVERT_TWIPS;
2239 
2240  switch ( nMemberId )
2241  {
2242  case 0:
2243  {
2244  uno::Sequence< beans::PropertyValue > aPropSeq;
2245 
2246  if ( rVal >>= aPropSeq )
2247  {
2248  css::awt::Gradient aGradient2;
2249  OUString aName;
2250  bool bGradient( false );
2251  for ( const auto& rProp : std::as_const(aPropSeq) )
2252  {
2253  if ( rProp.Name == "Name" )
2254  rProp.Value >>= aName;
2255  else if ( rProp.Name == "FillGradient" )
2256  {
2257  if ( rProp.Value >>= aGradient2 )
2258  bGradient = true;
2259  }
2260  }
2261 
2262  SetName( aName );
2263  if ( bGradient )
2264  {
2265  XGradient aXGradient;
2266 
2267  aXGradient.SetGradientStyle( aGradient2.Style );
2268  aXGradient.SetStartColor( Color(aGradient2.StartColor) );
2269  aXGradient.SetEndColor( Color(aGradient2.EndColor) );
2270  aXGradient.SetAngle( aGradient2.Angle );
2271  aXGradient.SetBorder( aGradient2.Border );
2272  aXGradient.SetXOffset( aGradient2.XOffset );
2273  aXGradient.SetYOffset( aGradient2.YOffset );
2274  aXGradient.SetStartIntens( aGradient2.StartIntensity );
2275  aXGradient.SetEndIntens( aGradient2.EndIntensity );
2276  aXGradient.SetSteps( aGradient2.StepCount );
2277 
2278  SetGradientValue( aXGradient );
2279  }
2280 
2281  return true;
2282  }
2283 
2284  return false;
2285  }
2286 
2287  case MID_NAME:
2288  {
2289  OUString aName;
2290  if (!(rVal >>= aName ))
2291  return false;
2292  SetName( aName );
2293  break;
2294  }
2295 
2296  case MID_FILLGRADIENT:
2297  {
2298  css::awt::Gradient aGradient2;
2299  if(!(rVal >>= aGradient2))
2300  return false;
2301 
2302  XGradient aXGradient;
2303 
2304  aXGradient.SetGradientStyle( aGradient2.Style );
2305  aXGradient.SetStartColor( Color(aGradient2.StartColor) );
2306  aXGradient.SetEndColor( Color(aGradient2.EndColor) );
2307  aXGradient.SetAngle( aGradient2.Angle );
2308  aXGradient.SetBorder( aGradient2.Border );
2309  aXGradient.SetXOffset( aGradient2.XOffset );
2310  aXGradient.SetYOffset( aGradient2.YOffset );
2311  aXGradient.SetStartIntens( aGradient2.StartIntensity );
2312  aXGradient.SetEndIntens( aGradient2.EndIntensity );
2313  aXGradient.SetSteps( aGradient2.StepCount );
2314 
2315  SetGradientValue( aXGradient );
2316  break;
2317  }
2318 
2320  case MID_GRADIENT_ENDCOLOR:
2321  {
2322  sal_Int32 nVal = 0;
2323  if(!(rVal >>= nVal ))
2324  return false;
2325 
2326  XGradient aXGradient = GetGradientValue();
2327 
2328  if ( nMemberId == MID_GRADIENT_STARTCOLOR )
2329  aXGradient.SetStartColor( Color(nVal) );
2330  else
2331  aXGradient.SetEndColor( Color(nVal) );
2332  SetGradientValue( aXGradient );
2333  break;
2334  }
2335 
2336  case MID_GRADIENT_STYLE:
2337  case MID_GRADIENT_ANGLE:
2338  case MID_GRADIENT_BORDER:
2342  case MID_GRADIENT_XOFFSET:
2343  case MID_GRADIENT_YOFFSET:
2344  {
2345  sal_Int16 nVal = sal_Int16();
2346  if(!(rVal >>= nVal ))
2347  return false;
2348 
2349  XGradient aXGradient = GetGradientValue();
2350 
2351  switch ( nMemberId )
2352  {
2353  case MID_GRADIENT_STYLE:
2354  aXGradient.SetGradientStyle( static_cast<css::awt::GradientStyle>(nVal) ); break;
2355  case MID_GRADIENT_ANGLE:
2356  aXGradient.SetAngle( nVal ); break;
2357  case MID_GRADIENT_BORDER:
2358  aXGradient.SetBorder( nVal ); break;
2360  aXGradient.SetStartIntens( nVal ); break;
2362  aXGradient.SetEndIntens( nVal ); break;
2364  aXGradient.SetSteps( nVal ); break;
2365  case MID_GRADIENT_XOFFSET:
2366  aXGradient.SetXOffset( nVal ); break;
2367  case MID_GRADIENT_YOFFSET:
2368  aXGradient.SetYOffset( nVal ); break;
2369  }
2370 
2371  SetGradientValue( aXGradient );
2372  break;
2373  }
2374  }
2375 
2376  return true;
2377 }
2378 
2380 {
2381  return static_cast<const XFillGradientItem*>(p1)->GetGradientValue() == static_cast<const XFillGradientItem*>(p2)->GetGradientValue();
2382 }
2383 
2384 std::unique_ptr<XFillGradientItem> XFillGradientItem::checkForUniqueItem( SdrModel* pModel ) const
2385 {
2386  if( pModel )
2387  {
2388  const OUString aUniqueName = NameOrIndex::CheckNamedItem(
2389  this, Which(), &pModel->GetItemPool(),
2390  XFillGradientItem::CompareValueFunc, RID_SVXSTR_GRADIENT,
2392 
2393  // if the given name is not valid, replace it!
2394  if( aUniqueName != GetName() )
2395  return std::make_unique<XFillGradientItem>( aUniqueName, aGradient, Which() );
2396  }
2397 
2398  return nullptr;
2399 }
2400 
2401 boost::property_tree::ptree XFillGradientItem::dumpAsJSON() const
2402 {
2403  boost::property_tree::ptree aTree = SfxPoolItem::dumpAsJSON();
2404 
2405  if (Which() == XATTR_FILLGRADIENT)
2406  aTree.put("commandName", ".uno:FillGradient");
2407 
2408  aTree.push_back(std::make_pair("state", GetGradientValue().dumpAsJSON()));
2409 
2410  return aTree;
2411 }
2412 
2413 
2415 
2417  bEnabled( false )
2418 {
2420 }
2421 
2422 XFillFloatTransparenceItem::XFillFloatTransparenceItem(const OUString& rName, const XGradient& rGradient, bool bEnable ) :
2423  XFillGradientItem ( rName, rGradient ),
2424  bEnabled ( bEnable )
2425 {
2427 }
2428 
2430  XFillGradientItem ( rItem ),
2431  bEnabled ( rItem.bEnabled )
2432 {
2434 }
2435 
2437 : XFillGradientItem ( -1, rTheGradient ),
2438  bEnabled ( bEnable )
2439 {
2441 }
2442 
2444 {
2445  return ( NameOrIndex::operator==(rItem) ) &&
2446  ( GetGradientValue() == static_cast<const XFillGradientItem&>(rItem).GetGradientValue() ) &&
2447  ( bEnabled == static_cast<const XFillFloatTransparenceItem&>(rItem).bEnabled );
2448 }
2449 
2451 {
2452  return new XFillFloatTransparenceItem( *this );
2453 }
2454 
2455 bool XFillFloatTransparenceItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
2456 {
2457  return XFillGradientItem::QueryValue( rVal, nMemberId );
2458 }
2459 
2460 bool XFillFloatTransparenceItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
2461 {
2462  return XFillGradientItem::PutValue( rVal, nMemberId );
2463 }
2464 
2466  MapUnit eCoreUnit, MapUnit ePresUnit,
2467  OUString& rText,
2468  const IntlWrapper& rIntlWrapper ) const
2469 {
2470  return XFillGradientItem::GetPresentation( ePres, eCoreUnit, ePresUnit, rText, rIntlWrapper );
2471 }
2472 
2474 {
2475  return static_cast<const XFillFloatTransparenceItem*>(p1)->IsEnabled() == static_cast<const XFillFloatTransparenceItem*>(p2)->IsEnabled() &&
2476  static_cast<const XFillFloatTransparenceItem*>(p1)->GetGradientValue() == static_cast<const XFillFloatTransparenceItem*>(p2)->GetGradientValue();
2477 }
2478 
2479 std::unique_ptr<XFillFloatTransparenceItem> XFillFloatTransparenceItem::checkForUniqueItem( SdrModel* pModel ) const
2480 {
2481  // #85953# unique name only necessary when enabled
2482  if(IsEnabled())
2483  {
2484  if( pModel )
2485  {
2486  const OUString aUniqueName = NameOrIndex::CheckNamedItem( this,
2488  &pModel->GetItemPool(),
2490  RID_SVXSTR_TRASNGR0,
2491  XPropertyListRef() );
2492 
2493  // if the given name is not valid, replace it!
2494  if( aUniqueName != GetName() )
2495  {
2496  return std::make_unique<XFillFloatTransparenceItem>( aUniqueName, GetGradientValue(), true );
2497  }
2498  }
2499  }
2500  else
2501  {
2502  // #85953# if disabled, force name to empty string
2503  if( !GetName().isEmpty() )
2504  {
2505  return std::make_unique<XFillFloatTransparenceItem>(OUString(), GetGradientValue(), false);
2506  }
2507  }
2508 
2509  return nullptr;
2510 }
2511 
2512 boost::property_tree::ptree XFillFloatTransparenceItem::dumpAsJSON() const
2513 {
2514  boost::property_tree::ptree aTree = XFillGradientItem::dumpAsJSON();
2515  aTree.put("commandName", ".uno:FillFloatTransparence");
2516 
2517  if (!bEnabled)
2518  {
2519  boost::property_tree::ptree& rState = aTree.get_child("state");
2520  // When gradient fill is disabled, the intensity fields contain the
2521  // constant encoded percent-transparency. However we use that here to just
2522  // distinguish between 'None' and 'Solid' types and correct the 'style'
2523  // property appropriately.
2524  if (GetGradientValue().GetStartIntens() == 100)
2525  rState.put("style", "NONE");
2526  else
2527  rState.put("style", "SOLID");
2528  }
2529 
2530  return aTree;
2531 }
2532 
2533 XHatch::XHatch(const Color& rCol, css::drawing::HatchStyle eTheStyle, long nTheDistance,
2534  long nTheAngle) :
2535  eStyle(eTheStyle),
2536  aColor(rCol),
2537  nDistance(nTheDistance),
2538  nAngle(nTheAngle)
2539 {
2540 }
2541 
2542 bool XHatch::operator==(const XHatch& rHatch) const
2543 {
2544  return ( eStyle == rHatch.eStyle &&
2545  aColor == rHatch.aColor &&
2546  nDistance == rHatch.nDistance &&
2547  nAngle == rHatch.nAngle );
2548 }
2549 
2550 
2552 
2553 XFillHatchItem::XFillHatchItem(const OUString& rName,
2554  const XHatch& rTheHatch) :
2555  NameOrIndex(XATTR_FILLHATCH, rName),
2556  aHatch(rTheHatch)
2557 {
2558 }
2559 
2561  NameOrIndex(rItem),
2562  aHatch(rItem.aHatch)
2563 {
2564 }
2565 
2567 : NameOrIndex( XATTR_FILLHATCH, -1 ),
2568  aHatch(rTheHatch)
2569 {
2570 }
2571 
2573 {
2574  return new XFillHatchItem(*this);
2575 }
2576 
2577 bool XFillHatchItem::operator==(const SfxPoolItem& rItem) const
2578 {
2579  return ( NameOrIndex::operator==(rItem) &&
2580  aHatch == static_cast<const XFillHatchItem&>(rItem).aHatch );
2581 }
2582 
2585  SfxItemPresentation /*ePres*/,
2586  MapUnit /*eCoreUnit*/,
2587  MapUnit /*ePresUnit*/,
2588  OUString& rText, const IntlWrapper&
2589 ) const
2590 {
2591  rText = GetName();
2592  return true;
2593 }
2594 
2596 {
2597  return true;
2598 }
2599 
2600 void XFillHatchItem::ScaleMetrics(long nMul, long nDiv)
2601 {
2603 }
2604 
2605 bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const
2606 {
2607  nMemberId &= ~CONVERT_TWIPS;
2608 
2609  switch ( nMemberId )
2610  {
2611  case 0:
2612  {
2613  uno::Sequence< beans::PropertyValue > aPropSeq( 2 );
2614 
2615  css::drawing::Hatch aUnoHatch;
2616 
2617  aUnoHatch.Style = aHatch.GetHatchStyle();
2618  aUnoHatch.Color = sal_Int32(aHatch.GetColor());
2619  aUnoHatch.Distance = aHatch.GetDistance();
2620  aUnoHatch.Angle = aHatch.GetAngle();
2621 
2622  aPropSeq[0].Name = "Name";
2623  aPropSeq[0].Value <<= SvxUnogetApiNameForItem(Which(), GetName());
2624  aPropSeq[1].Name = "FillHatch";
2625  aPropSeq[1].Value <<= aUnoHatch;
2626  rVal <<= aPropSeq;
2627  break;
2628  }
2629 
2630  case MID_FILLHATCH:
2631  {
2632  css::drawing::Hatch aUnoHatch;
2633 
2634  aUnoHatch.Style = aHatch.GetHatchStyle();
2635  aUnoHatch.Color = sal_Int32(aHatch.GetColor());
2636  aUnoHatch.Distance = aHatch.GetDistance();
2637  aUnoHatch.Angle = aHatch.GetAngle();
2638  rVal <<= aUnoHatch;
2639  break;
2640  }
2641 
2642  case MID_NAME:
2643  {
2644  rVal <<= SvxUnogetApiNameForItem(Which(), GetName());
2645  break;
2646  }
2647 
2648  case MID_HATCH_STYLE:
2649  rVal <<= aHatch.GetHatchStyle(); break;
2650  case MID_HATCH_COLOR:
2651  rVal <<= aHatch.GetColor(); break;
2652  case MID_HATCH_DISTANCE:
2653  rVal <<= aHatch.GetDistance(); break;
2654  case MID_HATCH_ANGLE:
2655  rVal <<= aHatch.GetAngle(); break;
2656 
2657  default: OSL_FAIL("Wrong MemberId!"); return false;
2658  }
2659 
2660  return true;
2661 }
2662 
2663 bool XFillHatchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
2664 {
2665  nMemberId &= ~CONVERT_TWIPS;
2666 
2667  switch ( nMemberId )
2668  {
2669  case 0:
2670  {
2671  uno::Sequence< beans::PropertyValue > aPropSeq;
2672  if ( rVal >>= aPropSeq )
2673  {
2674  css::drawing::Hatch aUnoHatch;
2675  OUString aName;
2676  bool bHatch( false );
2677  for ( const auto& rProp : std::as_const(aPropSeq) )
2678  {
2679  if ( rProp.Name == "Name" )
2680  rProp.Value >>= aName;
2681  else if ( rProp.Name == "FillHatch" )
2682  {
2683  if ( rProp.Value >>= aUnoHatch )
2684  bHatch = true;
2685  }
2686  }
2687 
2688  SetName( aName );
2689  if ( bHatch )
2690  {
2691  aHatch.SetHatchStyle( aUnoHatch.Style );
2692  aHatch.SetColor( Color(aUnoHatch.Color) );
2693  aHatch.SetDistance( aUnoHatch.Distance );
2694  aHatch.SetAngle( aUnoHatch.Angle );
2695  }
2696 
2697  return true;
2698  }
2699 
2700  return false;
2701  }
2702 
2703  case MID_FILLHATCH:
2704  {
2705  css::drawing::Hatch aUnoHatch;
2706  if(!(rVal >>= aUnoHatch))
2707  return false;
2708 
2709  aHatch.SetHatchStyle( aUnoHatch.Style );
2710  aHatch.SetColor( Color(aUnoHatch.Color) );
2711  aHatch.SetDistance( aUnoHatch.Distance );
2712  aHatch.SetAngle( aUnoHatch.Angle );
2713  break;
2714  }
2715 
2716  case MID_NAME:
2717  {
2718  OUString aName;
2719  if (!(rVal >>= aName ))
2720  return false;
2721  SetName( aName );
2722  break;
2723  }
2724 
2725  case MID_HATCH_STYLE:
2726  {
2727  sal_Int16 nVal = sal_Int16();
2728  if (!(rVal >>= nVal ))
2729  return false;
2730  aHatch.SetHatchStyle( static_cast<css::drawing::HatchStyle>(nVal) );
2731  break;
2732  }
2733 
2734  case MID_HATCH_COLOR:
2735  case MID_HATCH_DISTANCE:
2736  case MID_HATCH_ANGLE:
2737  {
2738  sal_Int32 nVal = 0;
2739  if (!(rVal >>= nVal ))
2740  return false;
2741 
2742  if ( nMemberId == MID_HATCH_COLOR )
2743  aHatch.SetColor( Color(nVal) );
2744  else if ( nMemberId == MID_HATCH_DISTANCE )
2745  aHatch.SetDistance( nVal );
2746  else
2747  aHatch.SetAngle( nVal );
2748  break;
2749  }
2750 
2751  default: OSL_FAIL("Wrong MemberId!"); return false;
2752  }
2753 
2754  return true;
2755 }
2756 
2758 {
2759  return static_cast<const XFillHatchItem*>(p1)->GetHatchValue() == static_cast<const XFillHatchItem*>(p2)->GetHatchValue();
2760 }
2761 
2762 std::unique_ptr<XFillHatchItem> XFillHatchItem::checkForUniqueItem( SdrModel* pModel ) const
2763 {
2764  if( pModel )
2765  {
2766  const OUString aUniqueName = NameOrIndex::CheckNamedItem(
2767  this, XATTR_FILLHATCH, &pModel->GetItemPool(),
2768  XFillHatchItem::CompareValueFunc, RID_SVXSTR_HATCH10,
2770 
2771  // if the given name is not valid, replace it!
2772  if( aUniqueName != GetName() )
2773  return std::make_unique<XFillHatchItem>( aUniqueName, aHatch );
2774  }
2775 
2776  return nullptr;
2777 }
2778 
2779 // --- form text attributes ---
2780 
2781 
2783 
2785  SfxEnumItem(XATTR_FORMTXTSTYLE, eTheStyle)
2786 {
2787 }
2788 
2790 {
2791  return new XFormTextStyleItem( *this );
2792 }
2793 
2795 {
2796  return 5;
2797 }
2798 
2799 bool XFormTextStyleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2800 {
2801  rVal <<= static_cast<sal_Int32>(GetValue());
2802  return true;
2803 }
2804 
2805 bool XFormTextStyleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2806 {
2807  sal_Int32 nValue = 0;
2808  rVal >>= nValue;
2809  SetValue(static_cast<XFormTextStyle>(nValue));
2810 
2811  return true;
2812 }
2813 
2814 
2816 
2818  SfxEnumItem(XATTR_FORMTXTADJUST, eTheAdjust)
2819 {
2820 }
2821 
2823 {
2824  return new XFormTextAdjustItem( *this );
2825 }
2826 
2828 {
2829  return 4;
2830 }
2831 
2832 bool XFormTextAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2833 {
2834  rVal <<= static_cast<sal_Int32>(GetValue());
2835  return true;
2836 }
2837 
2838 bool XFormTextAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2839 {
2840  sal_Int32 nValue = 0;
2841  rVal >>= nValue;
2842  SetValue(static_cast<XFormTextAdjust>(nValue));
2843 
2844  return true;
2845 }
2846 
2847 
2849 
2852 {
2853 }
2854 
2856 {
2857  return new XFormTextDistanceItem(*this);
2858 }
2859 
2861 
2864 {
2865 }
2866 
2868 {
2869  return new XFormTextStartItem(*this);
2870 }
2871 
2873 
2876 {
2877 }
2878 
2880 {
2881  return new XFormTextMirrorItem(*this);
2882 }
2883 
2885 
2888 {
2889 }
2890 
2892 {
2893  return new XFormTextOutlineItem(*this);
2894 }
2895 
2897 
2899  SfxEnumItem(XATTR_FORMTXTSHADOW, eFormTextShadow)
2900 {
2901 }
2902 
2904 {
2905  return new XFormTextShadowItem( *this );
2906 }
2907 
2909 {
2910  return 3;
2911 }
2912 
2913 bool XFormTextShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
2914 {
2915  rVal <<= static_cast<sal_Int32>(GetValue());
2916  return true;
2917 }
2918 
2919 bool XFormTextShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
2920 {
2921  sal_Int32 nValue = 0;
2922  rVal >>= nValue;
2923  SetValue(static_cast<XFormTextShadow>(nValue));
2924 
2925  return true;
2926 }
2927 
2928 
2930 
2932  const Color& rTheColor) :
2933  XColorItem(XATTR_FORMTXTSHDWCOLOR, rName, rTheColor)
2934 {
2935 }
2936 
2938 {
2939  return new XFormTextShadowColorItem(*this);
2940 }
2941 
2943 
2946 {
2947 }
2948 
2950 {
2951  return new XFormTextShadowXValItem(*this);
2952 }
2953 
2955 
2958 {
2959 }
2960 
2962 {
2963  return new XFormTextShadowYValItem(*this);
2964 }
2965 
2967 
2970 {
2971 }
2972 
2974 {
2975  return new XFormTextHideFormItem(*this);
2976 }
2977 
2978 // --- SetItems ---
2979 
2980 
2982 XLineAttrSetItem::XLineAttrSetItem( std::unique_ptr<SfxItemSet>&& pItemSet ) :
2983  SfxSetItem( XATTRSET_LINE, std::move(pItemSet))
2984 {
2985 }
2986 
2989  std::make_unique<SfxItemSet>( *pItemPool, svl::Items<XATTR_LINE_FIRST, XATTR_LINE_LAST>{}))
2990 {
2991 }
2992 
2994  SfxSetItem( rLineAttr )
2995 {
2996 }
2997 
2999  SfxItemPool* pItemPool) :
3000  SfxSetItem( rLineAttr, pItemPool )
3001 {
3002 }
3003 
3005 {
3006  return new XLineAttrSetItem( *this, pPool );
3007 }
3008 
3010 XFillAttrSetItem::XFillAttrSetItem( std::unique_ptr<SfxItemSet>&& pItemSet ) :
3011  SfxSetItem( XATTRSET_FILL, std::move(pItemSet))
3012 {
3013 }
3014 
3017  std::make_unique<SfxItemSet>( *pItemPool, svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}))
3018 {
3019 }
3020 
3022  SfxSetItem( rFillAttr )
3023 {
3024 }
3025 
3027  SfxItemPool* pItemPool ) :
3028  SfxSetItem( rFillAttr, pItemPool )
3029 {
3030 }
3031 
3033 {
3034  return new XFillAttrSetItem( *this, pPool );
3035 }
3036 
3037 /* 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
constexpr TypedWhichId< XFormTextHideFormItem > XATTR_FORMTXTHIDEFORM(XATTR_TEXT_FIRST+10)
std::unique_ptr< XLineStartItem > checkForUniqueItem(SdrModel *pModel) const
this function searches in both the models pool and the styles pool for XLineStartItem and XLineEndIte...
Definition: xattr.cxx: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
sal_Int32 GetValue() const
virtual XFormTextMirrorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2879
XHatch()
Definition: xhatch.hxx:38
constexpr sal_uInt16 XATTR_LINE_LAST(XATTR_LINECAP)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:2838
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
sal_Int32 nIndex
constexpr TypedWhichId< XLineEndItem > XATTR_LINEEND(XATTR_LINE_FIRST+5)
virtual SVX_DLLPRIVATE bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:1942
XLineEndCenterItem(bool bEndCenter=false)
Definition: xattr.cxx:1694
constexpr TypedWhichId< XLineEndCenterItem > XATTR_LINEENDCENTER(XATTR_LINE_FIRST+9)
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
XFillAttrSetItem(std::unique_ptr< SfxItemSet > &&pItemSet)
fill attribute set item
Definition: xattr.cxx:3010
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:571
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:1865
XFormTextStyle
Definition: xenum.hxx:24
constexpr TypedWhichId< XLineStartItem > XATTR_LINESTART(XATTR_LINE_FIRST+4)
void SetHatchStyle(css::drawing::HatchStyle eNewStyle)
Definition: xhatch.hxx:44
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx: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:2832
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:2151
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:2884
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 MID_NAME
static XGradient fromJSON(const OUString &rJSON)
Definition: xattr.cxx:2032
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:2850
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:2162
sal_uInt32 nDotLen
Definition: xdash.hxx:34
virtual void ScaleMetrics(long nMul, long nDiv) override
Definition: xattr.cxx:2600
constexpr TypedWhichId< XFormTextOutlineItem > XATTR_FORMTXTOUTLINE(XATTR_TEXT_FIRST+5)
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:985
void SetDots(sal_uInt16 nNewDots)
Definition: xdash.hxx:48
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
virtual boost::property_tree::ptree dumpAsJSON() const override
Definition: xattr.cxx:1919
sal_Int32 toInt32(OUString const &rStr)
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)
sal_uInt32 GetDistance() const
Definition: xdash.hxx:59
sal_uInt16 nIntensEnd
Definition: xgrad.hxx:40
XFormTextStartItem(long nStart=0)
Definition: xattr.cxx:2862
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:2595
exports com.sun.star. awt
#define MID_LINEDASH_DOTS
Definition: unomid.hxx:87
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:2135
void SetDashLen(sal_uInt32 nNewDashLen)
Definition: xdash.hxx:51
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2942
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2966
boost::property_tree::ptree dumpAsJSON() const
Definition: xattr.cxx:2084
std::unique_ptr< XFillHatchItem > checkForUniqueItem(SdrModel *pModel) const
Definition: xattr.cxx:2762
void SetEndColor(const Color &rColor)
Definition: xgrad.hxx:57
constexpr sal_uInt16 XATTR_LINE_FIRST(XATTR_START)
#define MID_GRADIENT_STARTINTENSITY
Definition: unomid.hxx:71
static bool CompareValueFunc(const NameOrIndex *p1, const NameOrIndex *p2)
Definition: xattr.cxx:2757
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2414
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
Color aColor
Definition: xcolit.hxx:34
void SetDistance(long nNewDistance)
Definition: xhatch.hxx:46
bool(* SvxCompareValueFunc)(const NameOrIndex *p1, const NameOrIndex *p2)
Definition: xit.hxx:32
virtual XFormTextShadowXValItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2949
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:1951
constexpr TypedWhichId< XLineDashItem > XATTR_LINEDASH(XATTR_LINE_FIRST+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:1628
XFormTextMirrorItem(bool bMirror=false)
Definition: xattr.cxx:2874
#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:2542
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:2102
sal_uInt16 nOfsY
Definition: xgrad.hxx:38
Color GetRGBColor() const
constexpr TypedWhichId< XFormTextDistanceItem > XATTR_FORMTXTDISTANCE(XATTR_TEXT_FIRST+2)
sal_uInt16 GetStartIntens() const
Definition: xgrad.hxx:73
virtual sal_uInt16 GetValueCount() const override
Definition: xattr.cxx:2827
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:2855
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:596
XFormTextStyleItem(XFormTextStyle=XFormTextStyle::NONE)
Definition: xattr.cxx:2784
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
Definition: xattr.cxx:2584
#define MID_LINEDASH_DASHES
Definition: unomid.hxx:89
css::drawing::DashStyle eDash
Definition: xdash.hxx:33
XFormTextAdjustItem(XFormTextAdjust=XFormTextAdjust::Center)
Definition: xattr.cxx:2817
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:2973
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:2479
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:2460
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:2799
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:2455
XLineEndItem(sal_Int32 nIndex=-1)
Definition: xattr.cxx:1284
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx: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:1984
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:334
virtual XFillFloatTransparenceItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2450
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:2443
int nCount
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2860
std::unique_ptr< XLineDashItem > checkForUniqueItem(SdrModel *pModel) const
Definition: xattr.cxx:875
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:2572
sal_uInt16 nBorder
Definition: xgrad.hxx:36
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
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
constexpr TypedWhichId< XLineAttrSetItem > XATTRSET_LINE(XATTR_LINE_LAST+1)
long nAngle
Definition: xhatch.hxx:35
const Color & GetColorValue() const
Definition: xattr.cxx:309
constexpr TypedWhichId< XFormTextStyleItem > XATTR_FORMTXTSTYLE(XATTR_TEXT_FIRST)
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
XFormTextShadowItem(XFormTextShadow=XFormTextShadow::NONE)
Definition: xattr.cxx:2898
#define MID_LINEDASH_DASHLEN
Definition: unomid.hxx:90
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2815
void SetEndIntens(sal_uInt16 nNewIntens)
Definition: xgrad.hxx:63
static bool CompareValueFunc(const NameOrIndex *p1, const NameOrIndex *p2)
Definition: xattr.cxx:2473
const OUString & GetName() const
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:2605
long GetDistance() const
Definition: xhatch.hxx:51
long nAngle
Definition: xgrad.hxx:35
sal_uInt16 GetBorder() const
Definition: xgrad.hxx:70
SfxItemPresentation
virtual boost::property_tree::ptree dumpAsJSON() const
XHatch aHatch
Definition: xflhtit.hxx:34
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:2805
void SetStartColor(const Color &rColor)
Definition: xgrad.hxx:56
constexpr TypedWhichId< XLineStartWidthItem > XATTR_LINESTARTWIDTH(XATTR_LINE_FIRST+6)
bool isClosed() const
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:316
virtual XFormTextStyleItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2789
const XGradient & GetGradientValue() const
Definition: xattr.cxx:2141
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2954
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
constexpr TypedWhichId< XSecondaryFillColorItem > XATTR_SECONDARYFILLCOLOR(XATTR_FILL_FIRST+12)
XGradient()
Definition: xattr.cxx:2038
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
XFormTextShadowXValItem(long nVal=0)
Definition: xattr.cxx:2944
virtual XFormTextOutlineItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2891
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:2903
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
constexpr TypedWhichId< XLineEndWidthItem > XATTR_LINEENDWIDTH(XATTR_LINE_FIRST+7)
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:1015
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2929
virtual XFormTextShadowYValItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2961
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:2982
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:2384
const double SMALLEST_DASH_WIDTH(26.95)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:1901
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &rIntlWrapper) const override
Definition: xattr.cxx:2465
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:2794
XFormTextOutlineItem(bool bOutline=false)
Definition: xattr.cxx:2886
void SetDashStyle(css::drawing::DashStyle eNewStyle)
Definition: xdash.hxx:47
XFormTextHideFormItem(bool bHide=false)
Definition: xattr.cxx:2968
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:374
basegfx::B2DPolyPolygon maPolyPolygon
Definition: xlnstit.hxx:33
XFormTextShadow
Definition: xenum.hxx:26
const XDash & GetDashValue() const
Definition: xlndsit.hxx:57
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:968
virtual XLineEndWidthItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1622
constexpr TypedWhichId< XFormTextShadowXValItem > XATTR_FORMTXTSHDWXVAL(XATTR_TEXT_FIRST+8)
bool IsNeg() const
rtl::Reference< class XPropertyList > XPropertyListRef
Definition: xtable.hxx:143
constexpr TypedWhichId< XFormTextShadowItem > XATTR_FORMTXTSHADOW(XATTR_TEXT_FIRST+6)
#define MID_HATCH_DISTANCE
Definition: unomid.hxx:80
sal_uInt16 nStepCount
Definition: xgrad.hxx:41
constexpr TypedWhichId< XFormTextAdjustItem > XATTR_FORMTXTADJUST(XATTR_TEXT_FIRST+1)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:2919
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
constexpr TypedWhichId< XLineStartCenterItem > XATTR_LINESTARTCENTER(XATTR_LINE_FIRST+8)
virtual sal_uInt16 GetValueCount() const override
Definition: xattr.cxx:2908
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 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:2130
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 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:3032
#define MID_GRADIENT_ANGLE
Definition: unomid.hxx:67
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
void SetStartIntens(sal_uInt16 nNewIntens)
Definition: xgrad.hxx:62
css::awt::GradientStyle GetGradientStyle() const
Definition: xgrad.hxx:66
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:1641
static bool CompareValueFunc(const NameOrIndex *p1, const NameOrIndex *p2)
Definition: xattr.cxx:2379
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
static OUString CheckNamedItem(const NameOrIndex *pCheckItem, const sal_uInt16 nWhich, const SfxItemPool *pPool1, SvxCompareValueFunc pCompareValueFunc, const char *pPrefixResId, const XPropertyListRef &pDefaults)
this static checks if the given NameOrIndex item has a unique name for its value. ...
Definition: xattr.cxx:142
void SetDashes(sal_uInt16 nNewDashes)
Definition: xdash.hxx:50
static std::string GradientStyleToString(css::awt::GradientStyle eStyle)
Definition: xattr.cxx:1953
constexpr TypedWhichId< XFillAttrSetItem > XATTRSET_FILL(XATTR_FILL_LAST+1)
void SetName(const OUString &rName)
Definition: xit.hxx:53
sal_uInt16 nOfsX
Definition: xgrad.hxx:37
constexpr TypedWhichId< XFormTextStartItem > XATTR_FORMTXTSTART(XATTR_TEXT_FIRST+3)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
sal_uInt32 count() const
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
virtual XFormTextAdjustItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2822
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:2070
virtual bool HasMetrics() const override
Definition: xattr.cxx:614
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)
constexpr TypedWhichId< XFormTextShadowYValItem > XATTR_FORMTXTSHDWYVAL(XATTR_TEXT_FIRST+9)
void SetXOffset(sal_uInt16 nNewOffset)
Definition: xgrad.hxx:60
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:2512
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:2956
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2848
#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:2872
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:2663
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
virtual XLineStartWidthItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1584
XLineStartWidthItem(long nWidth=LINE_START_WIDTH_DEFAULT)
Definition: xattr.cxx:1579
constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
long nDistance
Definition: xhatch.hxx:34
virtual XFormTextShadowColorItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2937
char aEntryName[20]
virtual XFormTextStartItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:2867
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
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:314
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2551
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
XSecondaryFillColorItem(const OUString &rName, const Color &rTheColor)
Definition: xattr.cxx:1931
#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
constexpr TypedWhichId< XFormTextMirrorItem > XATTR_FORMTXTMIRROR(XATTR_TEXT_FIRST+4)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:1533
sal_uInt32 GetDashLen() const
Definition: xdash.hxx:58
Color aEndColor
Definition: xgrad.hxx:34
static SfxPoolItem * CreateDefault()
Definition: xattr.cxx:2896
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: xattr.cxx:725
virtual XLineAttrSetItem * Clone(SfxItemPool *pToPool=nullptr) const override
Definition: xattr.cxx:3004
constexpr TypedWhichId< XLineColorItem > XATTR_LINECOLOR(XATTR_LINE_FIRST+3)
virtual bool operator==(const SfxPoolItem &rItem) const override
Definition: xattr.cxx:2577
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:2913
#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:1936
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:2236
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:2782
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
constexpr TypedWhichId< XFormTextShadowColorItem > XATTR_FORMTXTSHDWCOLOR(XATTR_TEXT_FIRST+7)
virtual boost::property_tree::ptree dumpAsJSON() const override
Definition: xattr.cxx:2401
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
virtual XLineStartItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: xattr.cxx:1010