LibreOffice Module sc (master)  1
condformatuno.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 
10 #include <memory>
11 #include <condformatuno.hxx>
12 
13 #include <document.hxx>
14 #include <conditio.hxx>
15 #include <colorscale.hxx>
16 #include <docsh.hxx>
17 #include <compiler.hxx>
18 #include <tokenarray.hxx>
19 
20 #include <cellsuno.hxx>
21 #include <convuno.hxx>
22 
23 #include <o3tl/safeint.hxx>
24 #include <vcl/svapp.hxx>
25 #include <rtl/ustring.hxx>
26 #include <sal/log.hxx>
27 
28 #include <com/sun/star/sheet/DataBarAxis.hpp>
29 #include <com/sun/star/sheet/IconSetType.hpp>
30 #include <com/sun/star/sheet/ConditionFormatOperator.hpp>
31 #include <com/sun/star/sheet/DataBarEntryType.hpp>
32 #include <com/sun/star/sheet/ColorScaleEntryType.hpp>
33 #include <com/sun/star/sheet/IconSetFormatEntry.hpp>
34 #include <com/sun/star/sheet/ConditionEntryType.hpp>
35 #include <com/sun/star/sheet/DateType.hpp>
36 
37 namespace {
38 
40 {
41  ID,
42  CondFormat_Range
43 };
44 
45 const SfxItemPropertyMapEntry* getCondFormatPropset()
46 {
47  static const SfxItemPropertyMapEntry aCondFormatPropertyMap_Impl[] =
48  {
49  {u"ID", ID, cppu::UnoType<sal_Int32>::get(), 0, 0},
50  {u"Range", CondFormat_Range, cppu::UnoType<sheet::XSheetCellRanges>::get(), 0, 0},
51  {u"", 0, css::uno::Type(), 0, 0}
52  };
53  return aCondFormatPropertyMap_Impl;
54 }
55 
57 {
58  StyleName,
59  Formula1,
60  Formula2,
61  Operator
62 };
63 
64 const SfxItemPropertyMapEntry* getConditionEntryrPropSet()
65 {
66  static const SfxItemPropertyMapEntry aConditionEntryPropertyMap_Impl[] =
67  {
68  {u"StyleName", StyleName, cppu::UnoType<OUString>::get(), 0, 0},
69  {u"Formula1", Formula1, cppu::UnoType<OUString>::get(), 0, 0},
70  {u"Formula2", Formula2, cppu::UnoType<OUString>::get(), 0, 0},
72  {u"", 0, css::uno::Type(), 0, 0}
73  };
74  return aConditionEntryPropertyMap_Impl;
75 }
76 
77 struct ConditionEntryApiMap
78 {
80  sal_Int32 nApiMode;
81 };
82 
83 ConditionEntryApiMap const aConditionEntryMap[] =
84 {
85  {ScConditionMode::Equal, sheet::ConditionFormatOperator::EQUAL},
86  {ScConditionMode::Less, sheet::ConditionFormatOperator::LESS},
87  {ScConditionMode::Greater, sheet::ConditionFormatOperator::GREATER},
88  {ScConditionMode::EqLess, sheet::ConditionFormatOperator::LESS_EQUAL},
89  {ScConditionMode::EqGreater, sheet::ConditionFormatOperator::GREATER_EQUAL},
90  {ScConditionMode::NotEqual, sheet::ConditionFormatOperator::NOT_EQUAL},
91  {ScConditionMode::Between, sheet::ConditionFormatOperator::BETWEEN},
92  {ScConditionMode::NotBetween, sheet::ConditionFormatOperator::NOT_BETWEEN},
93  {ScConditionMode::Duplicate, sheet::ConditionFormatOperator::DUPLICATE},
94  {ScConditionMode::NotDuplicate, sheet::ConditionFormatOperator::UNIQUE},
95  {ScConditionMode::Direct, sheet::ConditionFormatOperator::EXPRESSION},
96  {ScConditionMode::Top10, sheet::ConditionFormatOperator::TOP_N_ELEMENTS},
97  {ScConditionMode::Bottom10, sheet::ConditionFormatOperator::BOTTOM_N_ELEMENTS},
98  {ScConditionMode::TopPercent, sheet::ConditionFormatOperator::TOP_N_PERCENT},
99  {ScConditionMode::BottomPercent, sheet::ConditionFormatOperator::BOTTOM_N_PERCENT},
100  {ScConditionMode::AboveAverage, sheet::ConditionFormatOperator::ABOVE_AVERAGE},
101  {ScConditionMode::BelowAverage, sheet::ConditionFormatOperator::BELOW_AVERAGE},
102  {ScConditionMode::AboveEqualAverage, sheet::ConditionFormatOperator::ABOVE_EQUAL_AVERAGE},
103  {ScConditionMode::BelowEqualAverage, sheet::ConditionFormatOperator::BELOW_EQUAL_AVERAGE},
104  {ScConditionMode::Error, sheet::ConditionFormatOperator::ERROR},
105  {ScConditionMode::NoError, sheet::ConditionFormatOperator::NO_ERROR},
106  {ScConditionMode::BeginsWith, sheet::ConditionFormatOperator::BEGINS_WITH},
107  {ScConditionMode::EndsWith, sheet::ConditionFormatOperator::ENDS_WITH},
108  {ScConditionMode::ContainsText, sheet::ConditionFormatOperator::CONTAINS},
109  {ScConditionMode::NotContainsText, sheet::ConditionFormatOperator::NOT_CONTAINS},
110  {ScConditionMode::NONE, sheet::ConditionFormatOperator::EQUAL},
111 };
112 
114 {
115  ColorScaleEntries
116 };
117 
118 const SfxItemPropertyMapEntry* getColorScalePropSet()
119 {
120  static const SfxItemPropertyMapEntry aColorScalePropertyMap_Impl[] =
121  {
122  {u"ColorScaleEntries", ColorScaleEntries, cppu::UnoType<uno::Sequence< sheet::XColorScaleEntry >>::get(), 0, 0 },
123  {u"", 0, css::uno::Type(), 0, 0}
124  };
125  return aColorScalePropertyMap_Impl;
126 }
127 
128 struct ColorScaleEntryTypeApiMap
129 {
131  sal_Int32 nApiType;
132 };
133 
134 ColorScaleEntryTypeApiMap const aColorScaleEntryTypeMap[] =
135 {
142 };
143 
145 {
146  AxisPosition,
147  UseGradient,
148  UseNegativeColor,
149  DataBar_ShowValue,
150  DataBar_Color,
151  AxisColor,
152  NegativeColor,
153  DataBarEntries,
154  MinimumLength,
155  MaximumLength
156 };
157 
158 const SfxItemPropertyMapEntry* getDataBarPropSet()
159 {
160  static const SfxItemPropertyMapEntry aDataBarPropertyMap_Impl[] =
161  {
162  {u"AxisPosition", AxisPosition, cppu::UnoType<decltype(sheet::DataBarAxis::AXIS_AUTOMATIC)>::get(), 0, 0 },
163  {u"UseGradient", UseGradient, cppu::UnoType<bool>::get(), 0, 0 },
164  {u"UseNegativeColor", UseNegativeColor, cppu::UnoType<bool>::get(), 0, 0 },
165  {u"ShowValue", DataBar_ShowValue, cppu::UnoType<bool>::get(), 0, 0 },
166  {u"Color", DataBar_Color, cppu::UnoType<sal_Int32>::get(), 0, 0},
167  {u"AxisColor", AxisColor, cppu::UnoType<sal_Int32>::get(), 0, 0},
168  {u"NegativeColor", NegativeColor, cppu::UnoType<sal_Int32>::get(), 0, 0},
169  {u"DataBarEntries", DataBarEntries, cppu::UnoType<uno::Sequence< sheet::XDataBarEntry >>::get(), 0, 0 },
170  {u"MinimumLength", MinimumLength, cppu::UnoType<double>::get(), 0, 0 },
171  {u"MaximumLength", MaximumLength, cppu::UnoType<double>::get(), 0, 0 },
172  {u"", 0, css::uno::Type(), 0, 0}
173  };
174  return aDataBarPropertyMap_Impl;
175 }
176 
177 struct DataBarAxisApiMap
178 {
180  sal_Int32 nApiPos;
181 };
182 
183 DataBarAxisApiMap const aDataBarAxisMap[] =
184 {
185  { databar::NONE, sheet::DataBarAxis::AXIS_NONE },
186  { databar::AUTOMATIC, sheet::DataBarAxis::AXIS_AUTOMATIC },
187  { databar::MIDDLE, sheet::DataBarAxis::AXIS_MIDDLE }
188 };
189 
190 struct DataBarEntryTypeApiMap
191 {
193  sal_Int32 nApiType;
194 };
195 
196 DataBarEntryTypeApiMap const aDataBarEntryTypeMap[] =
197 {
198  { COLORSCALE_AUTO, sheet::DataBarEntryType::DATABAR_AUTO },
199  { COLORSCALE_MIN, sheet::DataBarEntryType::DATABAR_MIN },
200  { COLORSCALE_MAX, sheet::DataBarEntryType::DATABAR_MAX },
201  { COLORSCALE_VALUE, sheet::DataBarEntryType::DATABAR_VALUE },
202  { COLORSCALE_FORMULA, sheet::DataBarEntryType::DATABAR_FORMULA },
203  { COLORSCALE_PERCENT, sheet::DataBarEntryType::DATABAR_PERCENT },
204  { COLORSCALE_PERCENTILE, sheet::DataBarEntryType::DATABAR_PERCENTILE }
205 };
206 
208 {
209  Icons,
210  Reverse,
211  ShowValue,
212  IconSetEntries
213 };
214 
215 const SfxItemPropertyMapEntry* getIconSetPropSet()
216 {
217  static const SfxItemPropertyMapEntry aIconSetPropertyMap_Impl[] =
218  {
220  {u"Reverse", Reverse, cppu::UnoType<bool>::get(), 0, 0 },
221  {u"ShowValue", ShowValue, cppu::UnoType<bool>::get(), 0, 0 },
222  {u"IconSetEntries", IconSetEntries, cppu::UnoType<uno::Sequence< sheet::XIconSetEntry >>::get(), 0, 0 },
223  {u"", 0, css::uno::Type(), 0, 0}
224  };
225  return aIconSetPropertyMap_Impl;
226 }
227 
228 struct IconSetTypeApiMap
229 {
231  sal_Int32 nApiType;
232 };
233 
234 const IconSetTypeApiMap aIconSetApiMap[] =
235 {
236  { IconSet_3Arrows, sheet::IconSetType::ICONSET_3ARROWS },
237  { IconSet_3ArrowsGray, sheet::IconSetType::ICONSET_3ARROWS_GRAY },
238  { IconSet_3Flags, sheet::IconSetType::ICONSET_3FLAGS },
239  { IconSet_3TrafficLights1, sheet::IconSetType::ICONSET_3TRAFFICLIGHTS1 },
240  { IconSet_3TrafficLights2, sheet::IconSetType::ICONSET_3TRAFFICLIGHTS2 },
241  { IconSet_3Signs, sheet::IconSetType::ICONSET_3SIGNS },
242  { IconSet_3Symbols, sheet::IconSetType::ICONSET_3SYMBOLS },
243  { IconSet_3Symbols2, sheet::IconSetType::ICONSET_3SYMBOLS2 },
244  { IconSet_3Smilies, sheet::IconSetType::ICONSET_3SMILIES },
245  { IconSet_3ColorSmilies, sheet::IconSetType::ICONSET_3COLOR_SIMILIES },
246  { IconSet_4Arrows, sheet::IconSetType::ICONSET_4ARROWS },
247  { IconSet_4ArrowsGray, sheet::IconSetType::ICONSET_4ARROWS_GRAY },
248  { IconSet_4Rating, sheet::IconSetType::ICONSET_4RATING },
249  { IconSet_4RedToBlack, sheet::IconSetType::ICONSET_4RED_TO_BLACK },
250  { IconSet_4TrafficLights, sheet::IconSetType::ICONSET_4TRAFFICLIGHTS },
251  { IconSet_5Arrows, sheet::IconSetType::ICONSET_5ARROWS },
252  { IconSet_5ArrowsGray, sheet::IconSetType::ICONSET_4ARROWS_GRAY },
253  { IconSet_5Ratings, sheet::IconSetType::ICONSET_5RATINGS },
254  { IconSet_5Quarters, sheet::IconSetType::ICONSET_5QUARTERS },
255 };
256 
257 struct IconSetEntryTypeApiMap
258 {
260  sal_Int32 nApiType;
261 };
262 
263 IconSetEntryTypeApiMap const aIconSetEntryTypeMap[] =
264 {
265  { COLORSCALE_MIN, sheet::IconSetFormatEntry::ICONSET_MIN },
266  { COLORSCALE_VALUE, sheet::IconSetFormatEntry::ICONSET_VALUE },
267  { COLORSCALE_FORMULA, sheet::IconSetFormatEntry::ICONSET_FORMULA },
268  { COLORSCALE_PERCENT, sheet::IconSetFormatEntry::ICONSET_PERCENT },
269  { COLORSCALE_PERCENTILE, sheet::IconSetFormatEntry::ICONSET_PERCENTILE }
270 };
271 
273 {
274  Date_StyleName,
275  DateType
276 };
277 
278 const SfxItemPropertyMapEntry* getCondDatePropSet()
279 {
280  static const SfxItemPropertyMapEntry aCondDatePropertyMap_Impl[] =
281  {
282  {u"StyleName", StyleName, cppu::UnoType<OUString>::get(), 0, 0},
283  {u"DateType", Icons, cppu::UnoType<decltype(sheet::DateType::TODAY)>::get(), 0, 0 },
284  {u"", 0, css::uno::Type(), 0, 0}
285  };
286  return aCondDatePropertyMap_Impl;
287 }
288 
289 struct DateTypeApiMap
290 {
292  sal_Int32 nApiType;
293 };
294 
295 DateTypeApiMap const aDateTypeApiMap[] =
296 {
310 };
311 
312 }
313 
315  mnTab(nTab),
316  mpDocShell(pDocShell)
317 {
318  pDocShell->GetDocument().AddUnoObject(*this);
319 }
320 
322 {
323  if (mpDocShell)
325 }
326 
327 void ScCondFormatsObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
328 {
329  if ( rHint.GetId() == SfxHintId::Dying )
330  {
331  mpDocShell = nullptr;
332  }
333 }
334 
335 sal_Int32 ScCondFormatsObj::createByRange(const uno::Reference< sheet::XSheetCellRanges >& xRanges)
336 {
337  SolarMutexGuard aGuard;
338  if (!mpDocShell)
339  throw lang::IllegalArgumentException();
340 
341  if (!xRanges.is())
342  throw lang::IllegalArgumentException();
343 
344  const uno::Sequence<table::CellRangeAddress> aRanges =
345  xRanges->getRangeAddresses();
346 
347  ScRangeList aCoreRange;
348  for (const auto& rRange : aRanges)
349  {
350  ScRange aRange;
351  ScUnoConversion::FillScRange(aRange, rRange);
352  aCoreRange.Join(aRange);
353  }
354 
355  if (aCoreRange.empty())
356  throw lang::IllegalArgumentException();
357 
358  SCTAB nTab = aCoreRange[0].aStart.Tab();
359 
360  auto pNewFormat = std::make_unique<ScConditionalFormat>(0, &mpDocShell->GetDocument());
361  pNewFormat->SetRange(aCoreRange);
362  return mpDocShell->GetDocument().AddCondFormat(std::move(pNewFormat), nTab);
363 }
364 
365 void ScCondFormatsObj::removeByID(const sal_Int32 nID)
366 {
367  SolarMutexGuard aGuard;
368  ScConditionalFormatList* pFormatList = getCoreObject();
369  pFormatList->erase(nID);
370 }
371 
372 uno::Sequence<uno::Reference<sheet::XConditionalFormat> > ScCondFormatsObj::getConditionalFormats()
373 {
374  SolarMutexGuard aGuard;
375  ScConditionalFormatList* pFormatList = getCoreObject();
376  size_t n = pFormatList->size();
377  uno::Sequence<uno::Reference<sheet::XConditionalFormat> > aCondFormats(n);
378  sal_Int32 i = 0;
379  for (const auto& rFormat : *pFormatList)
380  {
381  uno::Reference<sheet::XConditionalFormat> xCondFormat(new ScCondFormatObj(mpDocShell, this, rFormat->GetKey()));
382  aCondFormats[i] = xCondFormat;
383  ++i;
384  }
385 
386  return aCondFormats;
387 }
388 
390 {
391  SolarMutexGuard aGuard;
392  ScConditionalFormatList* pFormatList = getCoreObject();
393  return pFormatList->size();
394 }
395 
397 {
398  if (!mpDocShell)
399  throw uno::RuntimeException();
400 
402  if (!pList)
403  throw uno::RuntimeException();
404 
405  return pList;
406 }
407 
408 namespace {
409 
410 uno::Reference<beans::XPropertySet> createConditionEntry(const ScFormatEntry* pEntry,
411  rtl::Reference<ScCondFormatObj> const & xParent)
412 {
413  switch (pEntry->GetType())
414  {
417  return new ScConditionEntryObj(xParent,
418  static_cast<const ScCondFormatEntry*>(pEntry));
419  break;
421  return new ScColorScaleFormatObj(xParent,
422  static_cast<const ScColorScaleFormat*>(pEntry));
423  break;
425  return new ScDataBarFormatObj(xParent,
426  static_cast<const ScDataBarFormat*>(pEntry));
427  break;
429  return new ScIconSetFormatObj(xParent,
430  static_cast<const ScIconSetFormat*>(pEntry));
431  break;
433  return new ScCondDateFormatObj(xParent,
434  static_cast<const ScCondDateFormatEntry*>(pEntry));
435  break;
436  default:
437  break;
438  }
439  return uno::Reference<beans::XPropertySet>();
440 }
441 
442 }
443 
445  sal_Int32 nKey):
446  mxCondFormatList(xCondFormats),
447  mpDocShell(pDocShell),
448  maPropSet(getCondFormatPropset()),
449  mnKey(nKey)
450 {
451 }
452 
454 {
455 }
456 
458 {
459  ScConditionalFormatList* pList = mxCondFormatList->getCoreObject();
460  ScConditionalFormat* pFormat = pList->GetFormat(mnKey);
461  if (!pFormat)
462  throw uno::RuntimeException();
463 
464  return pFormat;
465 }
466 
468 {
469  return mpDocShell;
470 }
471 
472 void ScCondFormatObj::createEntry(const sal_Int32 nType, const sal_Int32 nPos)
473 {
474  SolarMutexGuard aGuard;
475  ScConditionalFormat* pFormat = getCoreObject();
476  if (nPos > sal_Int32(pFormat->size()))
477  throw lang::IllegalArgumentException();
478 
479  ScFormatEntry* pNewEntry = nullptr;
480  ScDocument& rDoc = mpDocShell->GetDocument();
481  switch (nType)
482  {
484  pNewEntry = new ScCondFormatEntry(ScConditionMode::Equal, "", "",
485  rDoc, pFormat->GetRange().GetTopLeftCorner(), "");
486  break;
488  pNewEntry = new ScColorScaleFormat(&rDoc);
489  static_cast<ScColorScaleFormat*>(pNewEntry)->EnsureSize();
490  break;
492  pNewEntry = new ScDataBarFormat(&rDoc);
493  static_cast<ScDataBarFormat*>(pNewEntry)->EnsureSize();
494  break;
496  pNewEntry = new ScIconSetFormat(&rDoc);
497  static_cast<ScIconSetFormat*>(pNewEntry)->EnsureSize();
498  break;
500  pNewEntry = new ScCondDateFormatEntry(&rDoc);
501  break;
502  default:
503  SAL_WARN("sc", "unknown conditional format type");
504  throw lang::IllegalArgumentException();
505  }
506 
507  pFormat->AddEntry(pNewEntry);
508 }
509 
510 void ScCondFormatObj::removeByIndex(const sal_Int32 nIndex)
511 {
512  SolarMutexGuard aGuard;
513  if (getCoreObject()->size() >= o3tl::make_unsigned(nIndex))
514  throw lang::IllegalArgumentException();
515 
516  getCoreObject()->RemoveEntry(nIndex);
517 }
518 
520 {
522 }
523 
525 {
526  SolarMutexGuard aGuard;
527  ScConditionalFormat* pFormat = getCoreObject();
528  return !pFormat->IsEmpty();
529 }
530 
532 {
533  SolarMutexGuard aGuard;
534  ScConditionalFormat* pFormat = getCoreObject();
535 
536  return pFormat->size();
537 }
538 
540 {
541  SolarMutexGuard aGuard;
542  if (getCoreObject()->size() <= o3tl::make_unsigned(nIndex))
543  throw lang::IllegalArgumentException();
544 
545  const ScFormatEntry* pEntry = getCoreObject()->GetEntry(nIndex);
546  uno::Reference<beans::XPropertySet> xCondEntry =
547  createConditionEntry(pEntry, this);
548  return uno::Any(xCondEntry);
549 }
550 
551 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCondFormatObj::getPropertySetInfo()
552 {
553  SolarMutexGuard aGuard;
554  static uno::Reference<beans::XPropertySetInfo> aRef(
556  return aRef;
557 }
558 
560  const OUString& aPropertyName, const uno::Any& aValue )
561 {
562  SolarMutexGuard aGuard;
563 
564  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
565  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
566  if ( !pEntry )
567  throw beans::UnknownPropertyException(aPropertyName);
568 
569  switch(pEntry->nWID)
570  {
571  case ID:
572  throw lang::IllegalArgumentException();
573  break;
574  case CondFormat_Range:
575  {
576  uno::Reference<sheet::XSheetCellRanges> xRange;
577  if (aValue >>= xRange)
578  {
579  ScConditionalFormat* pFormat = getCoreObject();
580  const uno::Sequence<table::CellRangeAddress> aRanges =
581  xRange->getRangeAddresses();
582  ScRangeList aTargetRange;
583  for (const auto& rRange : aRanges)
584  {
585  ScRange aRange;
586  ScUnoConversion::FillScRange(aRange, rRange);
587  aTargetRange.Join(aRange);
588  }
589  pFormat->SetRange(aTargetRange);
590  }
591  }
592  break;
593  default:
594  SAL_WARN("sc", "unknown property");
595  }
596 }
597 
598 uno::Any SAL_CALL ScCondFormatObj::getPropertyValue( const OUString& aPropertyName )
599 {
600  SolarMutexGuard aGuard;
601 
602  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
603  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
604  if ( !pEntry )
605  throw beans::UnknownPropertyException(aPropertyName);
606 
607  uno::Any aAny;
608  switch(pEntry->nWID)
609  {
610  case ID:
611  aAny <<= sal_Int32(getCoreObject()->GetKey());
612  break;
613  case CondFormat_Range:
614  {
615  const ScRangeList& rRange = getCoreObject()->GetRange();
616  uno::Reference<sheet::XSheetCellRanges> xRange;
617  xRange.set(new ScCellRangesObj(mpDocShell, rRange));
618  aAny <<= xRange;
619  }
620  break;
621  default:
622  SAL_WARN("sc", "unknown property");
623  }
624  return aAny;
625 }
626 
627 void SAL_CALL ScCondFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
628  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
629 {
630  SAL_WARN("sc", "not implemented");
631 }
632 
633 void SAL_CALL ScCondFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
634  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
635 {
636  SAL_WARN("sc", "not implemented");
637 }
638 
639 void SAL_CALL ScCondFormatObj::addVetoableChangeListener( const OUString&,
640  const uno::Reference<beans::XVetoableChangeListener>&)
641 {
642  SAL_WARN("sc", "not implemented");
643 }
644 
645 void SAL_CALL ScCondFormatObj::removeVetoableChangeListener( const OUString&,
646  const uno::Reference<beans::XVetoableChangeListener>&)
647 {
648  SAL_WARN("sc", "not implemented");
649 }
650 
651 namespace {
652 
653 bool isObjectStillAlive(const ScConditionalFormat* pFormat, const ScFormatEntry* pEntry)
654 {
655  for(size_t i = 0, n= pFormat->size(); i < n; ++i)
656  {
657  if (pFormat->GetEntry(i) == pEntry)
658  return true;
659  }
660  return false;
661 }
662 
663 }
664 
666  const ScCondFormatEntry* pFormat):
667  mpDocShell(xParent->getDocShell()),
668  mxParent(xParent),
669  maPropSet(getConditionEntryrPropSet()),
670  mpFormat(pFormat)
671 {
672 }
673 
675 {
676 }
677 
679 {
680  ScConditionalFormat* pFormat = mxParent->getCoreObject();
681  if (isObjectStillAlive(pFormat, mpFormat))
682  return const_cast<ScCondFormatEntry*>(mpFormat);
683 
684  throw lang::IllegalArgumentException();
685 }
686 
688 {
690 }
691 
692 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScConditionEntryObj::getPropertySetInfo()
693 {
694  static uno::Reference<beans::XPropertySetInfo> aRef(
696  return aRef;
697 }
698 
700  const OUString& aPropertyName, const uno::Any& aValue )
701 {
702  SolarMutexGuard aGuard;
703 
704  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
705  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
706  if ( !pEntry )
707  throw beans::UnknownPropertyException(aPropertyName);
708 
709  switch(pEntry->nWID)
710  {
711  case StyleName:
712  {
713  OUString aStyleName;
714  if ((aValue >>= aStyleName) && !aStyleName.isEmpty())
715  getCoreObject()->UpdateStyleName(aStyleName);
716  }
717  break;
718  case Formula1:
719  {
720  OUString aFormula;
721  if ((aValue >>= aFormula) && !aFormula.isEmpty())
722  {
725  std::unique_ptr<ScTokenArray> pArr(aComp.CompileString(aFormula));
726  getCoreObject()->SetFormula1(*pArr);
727  }
728  }
729  break;
730  case Formula2:
731  {
732  OUString aFormula;
733  if ((aValue >>= aFormula) && !aFormula.isEmpty())
734  {
737  std::unique_ptr<ScTokenArray> pArr(aComp.CompileString(aFormula));
738  getCoreObject()->SetFormula2(*pArr);
739  }
740  }
741  break;
742  case Operator:
743  {
744  sal_Int32 nVal;
745  if (aValue >>= nVal)
746  {
747  for (ConditionEntryApiMap const & rEntry : aConditionEntryMap)
748  {
749  if (rEntry.nApiMode == nVal)
750  {
751  getCoreObject()->SetOperation(rEntry.eMode);
752  break;
753  }
754  }
755  }
756  }
757  break;
758  default:
759  SAL_WARN("sc", "unsupported property");
760  }
761 }
762 
763 uno::Any SAL_CALL ScConditionEntryObj::getPropertyValue( const OUString& aPropertyName )
764 {
765  SolarMutexGuard aGuard;
766 
767  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
768  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
769  if ( !pEntry )
770  throw beans::UnknownPropertyException(aPropertyName);
771 
772  uno::Any aAny;
773  switch(pEntry->nWID)
774  {
775  case StyleName:
776  aAny <<= getCoreObject()->GetStyle();
777  break;
778  case Formula1:
779  {
780  ScAddress aCursor = getCoreObject()->GetSrcPos();
781  OUString aFormula = getCoreObject()->GetExpression(aCursor, 0);
782  aAny <<= aFormula;
783  }
784  break;
785  case Formula2:
786  {
787  ScAddress aCursor = getCoreObject()->GetSrcPos();
788  OUString aFormula = getCoreObject()->GetExpression(aCursor, 1);
789  aAny <<= aFormula;
790  }
791  break;
792  case Operator:
793  {
795  for (ConditionEntryApiMap const & rEntry : aConditionEntryMap)
796  {
797  if (rEntry.eMode == eMode)
798  {
799  aAny <<= rEntry.nApiMode;
800  break;
801  }
802  }
803  }
804  break;
805  default:
806  SAL_WARN("sc", "unsupported property");
807  }
808  return aAny;
809 }
810 
811 void SAL_CALL ScConditionEntryObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
812  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
813 {
814  SAL_WARN("sc", "not implemented");
815 }
816 
817 void SAL_CALL ScConditionEntryObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
818  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
819 {
820  SAL_WARN("sc", "not implemented");
821 }
822 
823 void SAL_CALL ScConditionEntryObj::addVetoableChangeListener( const OUString&,
824  const uno::Reference<beans::XVetoableChangeListener>&)
825 {
826  SAL_WARN("sc", "not implemented");
827 }
828 
830  const uno::Reference<beans::XVetoableChangeListener>&)
831 {
832  SAL_WARN("sc", "not implemented");
833 }
834 
836  const ScColorScaleFormat* pFormat):
837  mxParent(xParent),
838  maPropSet(getColorScalePropSet()),
839  mpFormat(pFormat)
840 {
841 }
842 
844 {
845 }
846 
848 {
849  ScConditionalFormat* pFormat = mxParent->getCoreObject();
850  if (isObjectStillAlive(pFormat, mpFormat))
851  return const_cast<ScColorScaleFormat*>(mpFormat);
852 
853  throw lang::IllegalArgumentException();
854 }
855 
857 {
859 }
860 
861 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScColorScaleFormatObj::getPropertySetInfo()
862 {
863  static uno::Reference<beans::XPropertySetInfo> aRef(
865  return aRef;
866 }
867 
868 namespace {
869 
870 void setColorScaleEntry(ScColorScaleEntry* pEntry, uno::Reference<sheet::XColorScaleEntry> const & xEntry)
871 {
873  sal_Int32 nApiType = xEntry->getType();
874  bool bFound = false;
875  for (ColorScaleEntryTypeApiMap const & rEntry : aColorScaleEntryTypeMap)
876  {
877  if (rEntry.nApiType == nApiType)
878  {
879  eType = rEntry.eType;
880  bFound = true;
881  break;
882  }
883  }
884 
885  if (!bFound)
886  throw lang::IllegalArgumentException();
887 
888  pEntry->SetType(eType);
889  pEntry->SetColor(Color(ColorTransparency, xEntry->getColor()));
890  switch (eType)
891  {
892  case COLORSCALE_FORMULA:
893  // TODO: Implement
894  break;
895  default:
896  {
897  double nVal = xEntry->getFormula().toDouble();
898  pEntry->SetValue(nVal);
899  }
900  break;
901  }
902 }
903 
904 }
905 
907  const OUString& aPropertyName, const uno::Any& aValue )
908 {
909  SolarMutexGuard aGuard;
910 
911  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
912  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
913  if ( !pEntry )
914  throw beans::UnknownPropertyException(aPropertyName);
915 
916  switch(pEntry->nWID)
917  {
918  case ColorScaleEntries:
919  {
920  uno::Sequence<uno::Reference<sheet::XColorScaleEntry> > aEntries;
921  if (!(aValue >>= aEntries))
922  throw lang::IllegalArgumentException();
923 
924  if (aEntries.getLength() < 2)
925  throw lang::IllegalArgumentException();
926 
927  // TODO: we need to make sure that there are enough entries
928  size_t n = size_t(aEntries.getLength());
929  for (size_t i = 0; i < n; ++i)
930  {
931  setColorScaleEntry(getCoreObject()->GetEntry(i), aEntries[i]);
932  }
933 
934  }
935  break;
936  default:
937  SAL_WARN("sc", "unknown property");
938  }
939 }
940 
941 uno::Any SAL_CALL ScColorScaleFormatObj::getPropertyValue( const OUString& aPropertyName )
942 {
943  SolarMutexGuard aGuard;
944 
945  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
946  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
947  if ( !pEntry )
948  throw beans::UnknownPropertyException(aPropertyName);
949 
950  uno::Any aAny;
951 
952  switch(pEntry->nWID)
953  {
954  case ColorScaleEntries:
955  {
956  uno::Sequence<uno::Reference<sheet::XColorScaleEntry> > aEntries(getCoreObject()->size());
957  for (size_t i = 0; i < getCoreObject()->size(); ++i)
958  {
959  aEntries[i] = new ScColorScaleEntryObj(this, i);
960  }
961  aAny <<= aEntries;
962  }
963  break;
964  default:
965  SAL_WARN("sc", "unknown property");
966  }
967 
968  return aAny;
969 }
970 
971 void SAL_CALL ScColorScaleFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
972  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
973 {
974  SAL_WARN("sc", "not implemented");
975 }
976 
977 void SAL_CALL ScColorScaleFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
978  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
979 {
980  SAL_WARN("sc", "not implemented");
981 }
982 
984  const uno::Reference<beans::XVetoableChangeListener>&)
985 {
986  SAL_WARN("sc", "not implemented");
987 }
988 
990  const uno::Reference<beans::XVetoableChangeListener>&)
991 {
992  SAL_WARN("sc", "not implemented");
993 }
994 
996  size_t nPos):
997  mxParent(xParent),
998  mnPos(nPos)
999 {
1000 }
1001 
1003 {
1004 }
1005 
1007 {
1008  ScColorScaleFormat* pFormat = mxParent->getCoreObject();
1009  if (pFormat->size() <= mnPos)
1010  throw lang::IllegalArgumentException();
1011 
1012  return pFormat->GetEntry(mnPos);
1013 }
1014 
1016 {
1017  Color aColor = getCoreObject()->GetColor();
1018  return sal_Int32(aColor);
1019 }
1020 
1021 void ScColorScaleEntryObj::setColor(sal_Int32 aColor)
1022 {
1024 }
1025 
1027 {
1028  ScColorScaleEntry* pEntry = getCoreObject();
1029  for (ColorScaleEntryTypeApiMap const & rEntry : aColorScaleEntryTypeMap)
1030  {
1031  if (rEntry.eType == pEntry->GetType())
1032  {
1033  return rEntry.nApiType;
1034  }
1035  }
1036 
1037  throw lang::IllegalArgumentException();
1038 }
1039 
1041 {
1042  ScColorScaleEntry* pEntry = getCoreObject();
1043  for (ColorScaleEntryTypeApiMap const & rEntry : aColorScaleEntryTypeMap)
1044  {
1045  if (rEntry.nApiType == nType)
1046  {
1047  pEntry->SetType(rEntry.eType);
1048  return;
1049  }
1050  }
1051  throw lang::IllegalArgumentException();
1052 }
1053 
1055 {
1056  ScColorScaleEntry* pEntry = getCoreObject();
1057  switch (pEntry->GetType())
1058  {
1059  case COLORSCALE_FORMULA:
1060  // TODO: Implement
1061  break;
1062  default:
1063  return OUString::number(pEntry->GetValue());
1064  }
1065 
1066  return OUString();
1067 }
1068 
1069 void ScColorScaleEntryObj::setFormula(const OUString& rFormula)
1070 {
1071  ScColorScaleEntry* pEntry = getCoreObject();
1072  switch (pEntry->GetType())
1073  {
1074  case COLORSCALE_FORMULA:
1075  // TODO: Implement
1076  // pEntry->SetFormula(rFormula);
1077  break;
1078  default:
1079  pEntry->SetValue(rFormula.toDouble());
1080  break;
1081  }
1082 }
1083 
1084 
1086  const ScDataBarFormat* pFormat):
1087  mxParent(xParent),
1088  maPropSet(getDataBarPropSet()),
1089  mpFormat(pFormat)
1090 {
1091 }
1092 
1094 {
1095 }
1096 
1098 {
1099  ScConditionalFormat* pFormat = mxParent->getCoreObject();
1100  if (isObjectStillAlive(pFormat, mpFormat))
1101  return const_cast<ScDataBarFormat*>(mpFormat);
1102 
1103  throw lang::IllegalArgumentException();
1104 }
1105 
1107 {
1109 }
1110 
1111 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDataBarFormatObj::getPropertySetInfo()
1112 {
1113  SolarMutexGuard aGuard;
1114  static uno::Reference<beans::XPropertySetInfo> aRef(
1116  return aRef;
1117 }
1118 
1119 namespace {
1120 
1121 void setDataBarEntry(ScColorScaleEntry* pEntry, uno::Reference<sheet::XDataBarEntry> const & xEntry)
1122 {
1124  sal_Int32 nApiType = xEntry->getType();
1125  bool bFound = false;
1126  for (DataBarEntryTypeApiMap const & rEntry : aDataBarEntryTypeMap)
1127  {
1128  if (rEntry.nApiType == nApiType)
1129  {
1130  eType = rEntry.eType;
1131  bFound = true;
1132  break;
1133  }
1134  }
1135 
1136  if (!bFound)
1137  throw lang::IllegalArgumentException();
1138 
1139  pEntry->SetType(eType);
1140  switch (eType)
1141  {
1142  case COLORSCALE_FORMULA:
1143  // TODO: Implement
1144  break;
1145  default:
1146  {
1147  double nVal = xEntry->getFormula().toDouble();
1148  pEntry->SetValue(nVal);
1149  }
1150  break;
1151  }
1152 }
1153 
1154 }
1155 
1157  const OUString& aPropertyName, const uno::Any& aValue )
1158 {
1159  SolarMutexGuard aGuard;
1160 
1161  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1162  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1163  if ( !pEntry )
1164  throw beans::UnknownPropertyException(aPropertyName);
1165 
1166  switch(pEntry->nWID)
1167  {
1168  case AxisPosition:
1169  {
1170  sal_Int32 nVal;
1171  if (aValue >>= nVal)
1172  {
1173  for (DataBarAxisApiMap const & rEntry : aDataBarAxisMap)
1174  {
1175  if (rEntry.nApiPos == nVal)
1176  {
1178  rEntry.ePos;
1179  break;
1180  }
1181  }
1182  }
1183  }
1184  break;
1185  case UseGradient:
1186  {
1187  bool bUseGradient = true;
1188  if (aValue >>= bUseGradient)
1189  {
1190  getCoreObject()->GetDataBarData()->mbGradient = bUseGradient;
1191  }
1192  }
1193  break;
1194  case UseNegativeColor:
1195  {
1196  bool bUseNegativeColor = false;
1197  if (aValue >>= bUseNegativeColor)
1198  {
1199  getCoreObject()->GetDataBarData()->mbNeg = bUseNegativeColor;
1200  if (bUseNegativeColor && !getCoreObject()->GetDataBarData()->mxNegativeColor)
1201  {
1203  }
1204  }
1205  }
1206  break;
1207  case DataBar_ShowValue:
1208  {
1209  bool bShowValue = true;
1210  if (aValue >>= bShowValue)
1211  {
1212  getCoreObject()->GetDataBarData()->mbOnlyBar = !bShowValue;
1213  }
1214  }
1215  break;
1216  case DataBar_Color:
1217  {
1218  Color nColor = COL_AUTO;
1219  if (aValue >>= nColor)
1220  {
1222  }
1223  }
1224  break;
1225  case AxisColor:
1226  {
1227  Color nAxisColor = COL_AUTO;
1228  if (aValue >>= nAxisColor)
1229  {
1230  getCoreObject()->GetDataBarData()->maAxisColor = nAxisColor;
1231  }
1232  }
1233  break;
1234  case NegativeColor:
1235  {
1236  Color nNegativeColor = COL_AUTO;
1237  if (!(aValue >>= nNegativeColor) || !getCoreObject()->GetDataBarData()->mbNeg)
1238  throw lang::IllegalArgumentException();
1239 
1240  getCoreObject()->GetDataBarData()->mxNegativeColor = nNegativeColor;
1241 
1242  }
1243  break;
1244  case DataBarEntries:
1245  {
1246  uno::Sequence<uno::Reference<sheet::XDataBarEntry> > aEntries;
1247  if (!(aValue >>= aEntries))
1248  throw lang::IllegalArgumentException();
1249 
1250  if (aEntries.getLength() != 2)
1251  throw lang::IllegalArgumentException();
1252 
1253  setDataBarEntry(getCoreObject()->GetDataBarData()->mpLowerLimit.get(),
1254  aEntries[0]);
1255  setDataBarEntry(getCoreObject()->GetDataBarData()->mpUpperLimit.get(),
1256  aEntries[1]);
1257 
1258  }
1259  break;
1260  case MinimumLength:
1261  {
1262  double nLength = 0;
1263  if (!(aValue >>= nLength) || nLength >= 100 || nLength < 0)
1264  throw lang::IllegalArgumentException();
1265  getCoreObject()->GetDataBarData()->mnMinLength = nLength;
1266 
1267  }
1268  break;
1269  case MaximumLength:
1270  {
1271  double nLength = 0;
1272  if (!(aValue >>= nLength) || nLength > 100 || nLength <= 0)
1273  throw lang::IllegalArgumentException();
1274  getCoreObject()->GetDataBarData()->mnMaxLength = nLength;
1275 
1276  }
1277  break;
1278  }
1279 }
1280 
1281 uno::Any SAL_CALL ScDataBarFormatObj::getPropertyValue( const OUString& aPropertyName )
1282 {
1283  SolarMutexGuard aGuard;
1284 
1285  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1286  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1287  if ( !pEntry )
1288  throw beans::UnknownPropertyException(aPropertyName);
1289 
1290  uno::Any aAny;
1291  switch(pEntry->nWID)
1292  {
1293  case AxisPosition:
1294  {
1296  sal_Int32 nApiPos = sheet::DataBarAxis::AXIS_NONE;
1297  for (DataBarAxisApiMap const & rEntry : aDataBarAxisMap)
1298  {
1299  if (rEntry.ePos == ePos)
1300  {
1301  nApiPos = rEntry.nApiPos;
1302  }
1303  }
1304 
1305  aAny <<= nApiPos;
1306  }
1307  break;
1308  case UseGradient:
1309  {
1310  aAny <<= getCoreObject()->GetDataBarData()->mbGradient;
1311  }
1312  break;
1313  case UseNegativeColor:
1314  {
1315  aAny <<= getCoreObject()->GetDataBarData()->mbNeg;
1316  }
1317  break;
1318  case DataBar_ShowValue:
1319  {
1320  aAny <<= !getCoreObject()->GetDataBarData()->mbOnlyBar;
1321  }
1322  break;
1323  case DataBar_Color:
1324  {
1326  }
1327  break;
1328  case AxisColor:
1329  {
1330  aAny <<= getCoreObject()->GetDataBarData()->maAxisColor;
1331  }
1332  break;
1333  case NegativeColor:
1334  {
1335  if (getCoreObject()->GetDataBarData()->mbNeg && getCoreObject()->GetDataBarData()->mxNegativeColor)
1336  {
1338  }
1339  }
1340  break;
1341  case DataBarEntries:
1342  {
1343  uno::Sequence<uno::Reference<sheet::XDataBarEntry> > aEntries
1344  {
1345  new ScDataBarEntryObj(this, 0),
1346  new ScDataBarEntryObj(this, 1)
1347  };
1348  aAny <<= aEntries;
1349  }
1350  break;
1351  }
1352  return aAny;
1353 }
1354 
1355 void SAL_CALL ScDataBarFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
1356  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1357 {
1358  SAL_WARN("sc", "not implemented");
1359 }
1360 
1361 void SAL_CALL ScDataBarFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
1362  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1363 {
1364  SAL_WARN("sc", "not implemented");
1365 }
1366 
1367 void SAL_CALL ScDataBarFormatObj::addVetoableChangeListener( const OUString&,
1368  const uno::Reference<beans::XVetoableChangeListener>&)
1369 {
1370  SAL_WARN("sc", "not implemented");
1371 }
1372 
1374  const uno::Reference<beans::XVetoableChangeListener>&)
1375 {
1376  SAL_WARN("sc", "not implemented");
1377 }
1378 
1380  size_t nPos):
1381  mxParent(xParent),
1382  mnPos(nPos)
1383 {
1384 }
1385 
1387 {
1388 }
1389 
1391 {
1392  ScDataBarFormat* pFormat = mxParent->getCoreObject();
1393  ScColorScaleEntry* pEntry;
1394  if (mnPos == 0)
1395  pEntry = pFormat->GetDataBarData()->mpLowerLimit.get();
1396  else
1397  pEntry = pFormat->GetDataBarData()->mpUpperLimit.get();
1398 
1399  return pEntry;
1400 }
1401 
1403 {
1404  ScColorScaleEntry* pEntry = getCoreObject();
1405  for (DataBarEntryTypeApiMap const & rEntry : aDataBarEntryTypeMap)
1406  {
1407  if (rEntry.eType == pEntry->GetType())
1408  {
1409  return rEntry.nApiType;
1410  }
1411  }
1412 
1413  throw lang::IllegalArgumentException();
1414 }
1415 
1417 {
1418  ScColorScaleEntry* pEntry = getCoreObject();
1419  for (DataBarEntryTypeApiMap const & rEntry : aDataBarEntryTypeMap)
1420  {
1421  if (rEntry.nApiType == nType)
1422  {
1423  pEntry->SetType(rEntry.eType);
1424  return;
1425  }
1426  }
1427  throw lang::IllegalArgumentException();
1428 }
1429 
1431 {
1432  ScColorScaleEntry* pEntry = getCoreObject();
1433  switch (pEntry->GetType())
1434  {
1435  case COLORSCALE_FORMULA:
1436  // TODO: Implement
1437  break;
1438  default:
1439  return OUString::number(pEntry->GetValue());
1440  }
1441 
1442  return OUString();
1443 }
1444 
1445 void ScDataBarEntryObj::setFormula(const OUString& rFormula)
1446 {
1447  ScColorScaleEntry* pEntry = getCoreObject();
1448  switch (pEntry->GetType())
1449  {
1450  case COLORSCALE_FORMULA:
1451  // TODO: Implement
1452  // pEntry->SetFormula(rFormula);
1453  break;
1454  default:
1455  pEntry->SetValue(rFormula.toDouble());
1456  break;
1457  }
1458 }
1459 
1460 
1462  const ScIconSetFormat* pFormat):
1463  mxParent(xParent),
1464  maPropSet(getIconSetPropSet()),
1465  mpFormat(pFormat)
1466 {
1467 }
1468 
1470 {
1471 }
1472 
1474 {
1475  ScConditionalFormat* pFormat = mxParent->getCoreObject();
1476  if (isObjectStillAlive(pFormat, mpFormat))
1477  return const_cast<ScIconSetFormat*>(mpFormat);
1478 
1479  throw lang::IllegalArgumentException();
1480 }
1481 
1483 {
1485 }
1486 
1487 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScIconSetFormatObj::getPropertySetInfo()
1488 {
1489  SolarMutexGuard aGuard;
1490  static uno::Reference<beans::XPropertySetInfo> aRef(
1492  return aRef;
1493 }
1494 
1495 namespace {
1496 
1497 void setIconSetEntry(ScIconSetFormat* pFormat, uno::Reference<sheet::XIconSetEntry> const & xEntry, size_t nPos)
1498 {
1501  sal_Int32 nApiType = xEntry->getType();
1502  bool bFound = false;
1503  for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap)
1504  {
1505  if (rEntry.nApiType == nApiType)
1506  {
1507  eType = rEntry.eType;
1508  bFound = true;
1509  break;
1510  }
1511  }
1512 
1513  if (!bFound)
1514  throw lang::IllegalArgumentException();
1515 
1516  pData->m_Entries[nPos]->SetType(eType);
1517  switch (eType)
1518  {
1519  case COLORSCALE_FORMULA:
1520  // TODO: Implement
1521  break;
1522  default:
1523  {
1524  double nVal = xEntry->getFormula().toDouble();
1525  pData->m_Entries[nPos]->SetValue(nVal);
1526  }
1527  break;
1528  }
1529 }
1530 
1531 }
1532 
1534  const OUString& aPropertyName, const uno::Any& aValue )
1535 {
1536  SolarMutexGuard aGuard;
1537 
1538  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1539  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1540  if ( !pEntry )
1541  throw beans::UnknownPropertyException(aPropertyName);
1542 
1543  switch(pEntry->nWID)
1544  {
1545  case ShowValue:
1546  {
1547  bool bShowValue = true;
1548  aValue >>= bShowValue;
1549  getCoreObject()->GetIconSetData()->mbShowValue = bShowValue;
1550  }
1551  break;
1552  case Reverse:
1553  {
1554  bool bReverse = false;
1555  aValue >>= bReverse;
1556  getCoreObject()->GetIconSetData()->mbReverse = bReverse;
1557  }
1558  break;
1559  case Icons:
1560  {
1561  sal_Int32 nApiType = -1;
1562  aValue >>= nApiType;
1564  bool bFound = false;
1565  for (const IconSetTypeApiMap & rEntry : aIconSetApiMap)
1566  {
1567  if (rEntry.nApiType == nApiType)
1568  {
1569  eType = rEntry.eType;
1570  bFound = true;
1571  break;
1572  }
1573  }
1574 
1575  if (!bFound)
1576  {
1577  throw lang::IllegalArgumentException();
1578  }
1579 
1580  // TODO: we need to make sure that there are enough entries
1582  }
1583  break;
1584  case IconSetEntries:
1585  {
1586  uno::Sequence<uno::Reference<sheet::XIconSetEntry> > aEntries;
1587  if (!(aValue >>= aEntries))
1588  throw lang::IllegalArgumentException();
1589 
1590  // TODO: we need to check that the number of entries
1591  // corresponds to the icon type
1592  sal_Int32 nLength = aEntries.getLength();
1593  for (size_t i = 0; i < o3tl::make_unsigned(nLength); ++i)
1594  {
1595  setIconSetEntry(getCoreObject(), aEntries[i], i);
1596  }
1597 
1598  }
1599  break;
1600  default:
1601  break;
1602  }
1603 }
1604 
1605 uno::Any SAL_CALL ScIconSetFormatObj::getPropertyValue( const OUString& aPropertyName )
1606 {
1607  SolarMutexGuard aGuard;
1608 
1609  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1610  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1611  if ( !pEntry )
1612  throw beans::UnknownPropertyException(aPropertyName);
1613 
1614  uno::Any aAny;
1615 
1616  switch(pEntry->nWID)
1617  {
1618  case ShowValue:
1619  aAny <<= getCoreObject()->GetIconSetData()->mbShowValue;
1620  break;
1621  case Reverse:
1622  aAny <<= getCoreObject()->GetIconSetData()->mbReverse;
1623  break;
1624  case Icons:
1625  {
1627  for (const IconSetTypeApiMap & rEntry : aIconSetApiMap)
1628  {
1629  if (rEntry.eType == eType)
1630  {
1631  aAny <<= rEntry.nApiType;
1632  break;
1633  }
1634  }
1635  }
1636  break;
1637  case IconSetEntries:
1638  {
1639  size_t nSize = getCoreObject()->size();
1640  uno::Sequence<uno::Reference<sheet::XIconSetEntry> > aEntries(nSize);
1641  for (size_t i = 0; i < nSize; ++i)
1642  {
1643  aEntries[i] = new ScIconSetEntryObj(this, i);
1644  }
1645  aAny <<= aEntries;
1646  }
1647  break;
1648  default:
1649  SAL_WARN("sc", "unknown property");
1650  }
1651  return aAny;
1652 }
1653 
1654 void SAL_CALL ScIconSetFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
1655  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1656 {
1657  SAL_WARN("sc", "not implemented");
1658 }
1659 
1660 void SAL_CALL ScIconSetFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
1661  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1662 {
1663  SAL_WARN("sc", "not implemented");
1664 }
1665 
1666 void SAL_CALL ScIconSetFormatObj::addVetoableChangeListener( const OUString&,
1667  const uno::Reference<beans::XVetoableChangeListener>&)
1668 {
1669  SAL_WARN("sc", "not implemented");
1670 }
1671 
1673  const uno::Reference<beans::XVetoableChangeListener>&)
1674 {
1675  SAL_WARN("sc", "not implemented");
1676 }
1677 
1679  size_t nPos):
1680  mxParent(xParent),
1681  mnPos(nPos)
1682 {
1683 }
1684 
1686 {
1687 }
1688 
1690 {
1691  ScIconSetFormat* pFormat = mxParent->getCoreObject();
1692  if (pFormat->GetIconSetData()->m_Entries.size() <= mnPos)
1693  throw lang::IllegalArgumentException();
1694 
1695  return pFormat->GetIconSetData()->m_Entries[mnPos].get();
1696 }
1697 
1699 {
1700  ScColorScaleEntry* pEntry = getCoreObject();
1701  // the first entry always is minimum
1702  if (mnPos == 0)
1703  return sheet::IconSetFormatEntry::ICONSET_MIN;
1704 
1705  for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap)
1706  {
1707  if (rEntry.eType == pEntry->GetType())
1708  {
1709  return rEntry.nApiType;
1710  }
1711  }
1712 
1713  throw lang::IllegalArgumentException();
1714 }
1715 
1717 {
1718  // first entry is always MIN
1719  if (mnPos == 0)
1720  return;
1721 
1722  ScColorScaleEntry* pEntry = getCoreObject();
1723  for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap)
1724  {
1725  if (rEntry.nApiType == nType)
1726  {
1727  pEntry->SetType(rEntry.eType);
1728  return;
1729  }
1730  }
1731  throw lang::IllegalArgumentException();
1732 }
1733 
1735 {
1736  ScColorScaleEntry* pEntry = getCoreObject();
1737  switch (pEntry->GetType())
1738  {
1739  case COLORSCALE_FORMULA:
1740  // TODO: Implement
1741  break;
1742  default:
1743  return OUString::number(pEntry->GetValue());
1744  }
1745 
1746  return OUString();
1747 }
1748 
1749 void ScIconSetEntryObj::setFormula(const OUString& rFormula)
1750 {
1751  ScColorScaleEntry* pEntry = getCoreObject();
1752  switch (pEntry->GetType())
1753  {
1754  case COLORSCALE_FORMULA:
1755  // TODO: Implement
1756  // pEntry->SetFormula(rFormula);
1757  break;
1758  default:
1759  pEntry->SetValue(rFormula.toDouble());
1760  break;
1761  }
1762 }
1763 
1765  const ScCondDateFormatEntry* pFormat):
1766  mxParent(xParent),
1767  maPropSet(getCondDatePropSet()),
1768  mpFormat(pFormat)
1769 {
1770 }
1771 
1773 {
1774 }
1775 
1777 {
1778  ScConditionalFormat* pFormat = mxParent->getCoreObject();
1779  if (isObjectStillAlive(pFormat, mpFormat))
1780  return const_cast<ScCondDateFormatEntry*>(mpFormat);
1781 
1782  throw lang::IllegalArgumentException();
1783 }
1784 
1786 {
1788 }
1789 
1790 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCondDateFormatObj::getPropertySetInfo()
1791 {
1792  SolarMutexGuard aGuard;
1793  static uno::Reference<beans::XPropertySetInfo> aRef(
1795  return aRef;
1796 }
1797 
1799  const OUString& aPropertyName, const uno::Any& aValue )
1800 {
1801  SolarMutexGuard aGuard;
1802 
1803  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1804  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1805  if ( !pEntry )
1806  throw beans::UnknownPropertyException(aPropertyName);
1807 
1808  switch(pEntry->nWID)
1809  {
1810  case Date_StyleName:
1811  {
1812  OUString aStyleName;
1813  if (!(aValue >>= aStyleName))
1814  throw lang::IllegalArgumentException();
1815 
1816  getCoreObject()->SetStyleName(aStyleName);
1817 
1818  }
1819  break;
1820  case DateType:
1821  {
1822  sal_Int32 nApiType = -1;
1823  if (!(aValue >>= nApiType))
1824  throw lang::IllegalArgumentException();
1825 
1826  for (DateTypeApiMap const & rEntry : aDateTypeApiMap)
1827  {
1828  if (rEntry.nApiType == nApiType)
1829  {
1830  getCoreObject()->SetDateType(rEntry.eType);
1831  break;
1832  }
1833  }
1834  }
1835  break;
1836  default:
1837  break;
1838  }
1839 }
1840 
1841 uno::Any SAL_CALL ScCondDateFormatObj::getPropertyValue( const OUString& aPropertyName )
1842 {
1843  SolarMutexGuard aGuard;
1844 
1845  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1846  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1847  if ( !pEntry )
1848  throw beans::UnknownPropertyException(aPropertyName);
1849 
1850  uno::Any aAny;
1851 
1852  switch(pEntry->nWID)
1853  {
1854  case Date_StyleName:
1855  {
1856  OUString aStyleName = getCoreObject()->GetStyleName();
1857  aAny <<= aStyleName;
1858  }
1859  break;
1860  case DateType:
1861  {
1863  for (DateTypeApiMap const & rEntry : aDateTypeApiMap)
1864  {
1865  if (rEntry.eType == eType)
1866  {
1867  aAny <<= rEntry.nApiType;
1868  break;
1869  }
1870  }
1871  }
1872  break;
1873  default:
1874  SAL_WARN("sc", "unknown property");
1875  }
1876  return aAny;
1877 }
1878 
1879 void SAL_CALL ScCondDateFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
1880  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1881 {
1882  SAL_WARN("sc", "not implemented");
1883 }
1884 
1885 void SAL_CALL ScCondDateFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
1886  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1887 {
1888  SAL_WARN("sc", "not implemented");
1889 }
1890 
1891 void SAL_CALL ScCondDateFormatObj::addVetoableChangeListener( const OUString&,
1892  const uno::Reference<beans::XVetoableChangeListener>&)
1893 {
1894  SAL_WARN("sc", "not implemented");
1895 }
1896 
1898  const uno::Reference<beans::XVetoableChangeListener>&)
1899 {
1900  SAL_WARN("sc", "not implemented");
1901 }
1902 
1903 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
double mnMaxLength
Maximal length of a databar in percent of cell length Value has to be in the range (0...
Definition: colorscale.hxx:177
void SetOperation(ScConditionMode eMode)
Definition: conditio.cxx:336
virtual void SAL_CALL setFormula(const OUString &rString) override
size_t size() const
Definition: colorscale.cxx:695
ScIconSetEntryObj(rtl::Reference< ScIconSetFormatObj > const &xParent, size_t nPos)
ScDataBarEntryObj(rtl::Reference< ScDataBarFormatObj > const &xParent, size_t nPos)
const ScDataBarFormat * mpFormat
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
ScCondFormatsObj(ScDocShell *pDocShell, SCTAB nTab)
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
void SetGrammar(const formula::FormulaGrammar::Grammar eGrammar)
Definition: compiler.cxx:228
rtl::Reference< ScColorScaleFormatObj > mxParent
virtual sal_Int32 SAL_CALL getType() override
void AddEntry(ScFormatEntry *pNew)
Definition: conditio.cxx:1748
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual ~ScCondDateFormatObj() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
ScColorScaleEntry * GetEntry(size_t nPos)
Definition: colorscale.cxx:679
std::unique_ptr< ContentProperties > pData
const ScCondFormatEntry * mpFormat
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual sal_Bool SAL_CALL hasElements() override
virtual ~ScDataBarEntryObj() override
bool mbReverse
Specifies whether the icons should be shown in reverse order.
Definition: colorscale.hxx:338
ScCondFormatEntry * getCoreObject()
void SetFormula1(const ScTokenArray &rArray)
Definition: conditio.cxx:469
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
WeakReference< XInterface > mxParent
double mnMinLength
Minimal length of a databar in percent of cell length Value has to be in the range [0...
Definition: colorscale.hxx:172
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
ScColorScaleFormat * getCoreObject()
sal_Int64 n
ScColorScaleEntry * getCoreObject()
const OUString & GetStyle() const
Definition: conditio.hxx:473
ScDataBarFormat * getCoreObject()
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
condformat::ScCondFormatDateType GetDateType() const
Definition: conditio.hxx:512
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
bool mbOnlyBar
If TRUE we only show the bar and not the value.
Definition: colorscale.hxx:182
SC_DLLPUBLIC sal_uLong AddCondFormat(std::unique_ptr< ScConditionalFormat > pNew, SCTAB nTab)
Definition: documen4.cxx:716
Reverse
void SetValue(double nValue)
Definition: colorscale.cxx:250
virtual sal_Int32 SAL_CALL getType() override
virtual sal_Int32 SAL_CALL getCount() override
ScCondFormatDateType
Definition: conditio.hxx:484
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:983
IconSetProperties
ScConditionEntryObj(rtl::Reference< ScCondFormatObj > const &xParent, const ScCondFormatEntry *pFormat)
ScConditionalFormat * GetFormat(sal_uInt32 nKey)
Definition: conditio.cxx:2070
SfxItemPropertySet maPropSet
ScConditionMode GetOperation() const
Definition: conditio.hxx:369
css::chart::ChartAxisLabelPosition ePos
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
std::optional< Color > mxNegativeColor
Specifies the color for negative values.
Definition: colorscale.hxx:140
ScColorScaleEntryObj(rtl::Reference< ScColorScaleFormatObj > const &xParent, size_t nPos)
SfxHintId GetId() const
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
SfxItemPropertySet maPropSet
const SfxItemPropertyMapEntry * getByName(std::u16string_view rName) const
SfxItemPropertySet maPropSet
const ScRangeList & GetRange() const
Definition: conditio.hxx:559
ScCondFormatObj(ScDocShell *pDocShell, rtl::Reference< ScCondFormatsObj > const &xCondFormats, sal_Int32 nKey)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
SC_DLLPUBLIC ScConditionalFormatList * GetCondFormList(SCTAB nTab) const
Definition: documen4.cxx:868
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual ~ScIconSetEntryObj() override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual uno::Sequence< uno::Reference< sheet::XConditionalFormat > > SAL_CALL getConditionalFormats() override
ScDocShell * getDocShell()
ScConditionalFormat * getCoreObject()
void SetColor(const Color &)
Definition: colorscale.cxx:310
ScIconSetType eIconSetType
Definition: colorscale.hxx:333
ScColorScaleEntryType GetType() const
Definition: colorscale.hxx:76
ScConditionMode
Definition: conditio.hxx:60
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Mode eMode
ScDocShell * mpDocShell
virtual void SAL_CALL removeByID(const sal_Int32 nID) override
ColorScaleProperties
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
size_t size() const
Definition: conditio.cxx:1768
ScColorScaleEntry * getCoreObject()
rtl::Reference< ScCondFormatsObj > mxCondFormatList
DateProperties
CondFormatProperties
Color maPositiveColor
Color for all Positive Values and if mbNeg == false also for negative ones.
Definition: colorscale.hxx:134
ScAddress GetTopLeftCorner() const
Definition: rangelst.cxx:1154
bool empty() const
Definition: rangelst.hxx:88
Color maAxisColor
Color of the axis if used Default color is black.
Definition: colorscale.hxx:145
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
DocumentType eType
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
void SetRange(const ScRangeList &rRanges)
Definition: conditio.cxx:1742
const ScFormatEntry * GetEntry(sal_uInt16 nPos) const
Definition: conditio.cxx:1782
virtual ~ScColorScaleFormatObj() override
ScColorScaleEntryType
Definition: colorscale.hxx:31
ScDocShell * getDocShell(const css::uno::Reference< css::frame::XModel > &xModel)
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
SfxItemPropertySet maPropSet
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
int i
const Color & GetColor() const
Definition: colorscale.hxx:61
const ScCondDateFormatEntry * mpFormat
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
ScCondDateFormatObj(rtl::Reference< ScCondFormatObj > const &xParent, const ScCondDateFormatEntry *pFormat)
OUString GetExpression(const ScAddress &rCursor, sal_uInt16 nPos, sal_uInt32 nNumFmt=0, const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT) const
Definition: conditio.cxx:1236
ScDocShell * mpDocShell
SfxItemPropertySet maPropSet
bool mbGradient
Paint the bars with gradient.
Definition: colorscale.hxx:152
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
size_t size() const
Definition: conditio.cxx:2254
ScConditionalFormatList * getCoreObject()
rtl::Reference< ScCondFormatObj > mxParent
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
virtual sal_Int32 SAL_CALL createByRange(const uno::Reference< sheet::XSheetCellRanges > &xRanges) override
float u
unsigned char sal_Bool
virtual void SAL_CALL setColor(sal_Int32 aColor) override
const SfxItemPropertyMap & getPropertyMap() const
const ScIconSetFormatData * GetIconSetData() const
virtual sal_Int32 SAL_CALL getColor() override
ScColorScaleFormatObj(rtl::Reference< ScCondFormatObj > const &xParent, const ScColorScaleFormat *pFormat)
void RemoveEntry(size_t nIndex)
Definition: conditio.cxx:1754
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
DataBarProperties
size
virtual sal_Int32 SAL_CALL getType() override
ScIconSetFormatObj(rtl::Reference< ScCondFormatObj > const &xParent, const ScIconSetFormat *pFormat)
css::uno::Type const & get()
virtual ~ScIconSetFormatObj() override
ColorTransparency
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
void SetFormula2(const ScTokenArray &rArray)
Definition: conditio.cxx:481
void UpdateStyleName(const OUString &rNew)
Definition: conditio.hxx:474
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
rtl::Reference< ScCondFormatObj > mxParent
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
const ScAddress & GetSrcPos() const
Definition: conditio.hxx:374
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
const ScColorScaleFormat * mpFormat
virtual void SAL_CALL setFormula(const OUString &rString) override
ConditionEntryProperties
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:898
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual ~ScCondFormatsObj() override
virtual sal_Int32 SAL_CALL getType() override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual ~ScConditionEntryObj() override
rtl::Reference< ScIconSetFormatObj > mxParent
virtual void SAL_CALL createEntry(const sal_Int32 nType, const sal_Int32 nPos) override
size_t size() const
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
databar::ScAxisPosition meAxisPosition
Paint negative values into the same direction as positive values If false we will set the mid point a...
Definition: colorscale.hxx:167
rtl::Reference< ScCondFormatObj > mxParent
void Join(const ScRange &, bool bIsInList=false)
Definition: rangelst.cxx:164
SfxItemPropertySet maPropSet
std::unique_ptr< ScColorScaleEntry, o3tl::default_delete< ScColorScaleEntry > > mpUpperLimit
Definition: colorscale.hxx:184
virtual OUString SAL_CALL getFormula() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
const OUString & GetStyleName() const
Definition: conditio.hxx:514
ScDocShell * mpDocShell
virtual void SAL_CALL setType(sal_Int32 nType) override
const ScIconSetFormat * mpFormat
virtual sal_Int32 SAL_CALL getType() override
virtual void SAL_CALL removeByIndex(const sal_Int32 nIndex) override
virtual void SAL_CALL setFormula(const OUString &rString) override
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:906
void SetDateType(condformat::ScCondFormatDateType eType)
Definition: conditio.cxx:1673
virtual OUString SAL_CALL getFormula() override
ScDataBarFormatObj(rtl::Reference< ScCondFormatObj > const &xParent, const ScDataBarFormat *pFormat)
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:398
const ScDocument & GetDocument() const
Definition: docsh.hxx:216
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
ScIconSetFormat * getCoreObject()
const ScDataBarFormatData * GetDataBarData() const
Definition: colorscale.cxx:735
ScCondDateFormatEntry * getCoreObject()
ScIconSetType
Definition: colorscale.hxx:188
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
virtual void SAL_CALL setType(sal_Int32 nType) override
virtual Type GetType() const =0
virtual ~ScCondFormatObj() override
void erase(sal_uLong nIndex)
Definition: conditio.cxx:2264
ScXMLEditAttributeMap::Entry const aEntries[]
virtual sal_Int32 SAL_CALL getType() override
ScColorScaleEntry * getCoreObject()
virtual ~ScColorScaleEntryObj() override
#define SAL_WARN(area, stream)
virtual uno::Type SAL_CALL getElementType() override
void SetType(ScColorScaleEntryType eType)
Definition: colorscale.cxx:323
sal_Int32 nLength
std::unique_ptr< ScColorScaleEntry, o3tl::default_delete< ScColorScaleEntry > > mpLowerLimit
Definition: colorscale.hxx:185
virtual ~ScDataBarFormatObj() override
virtual void SAL_CALL setType(sal_Int32 nType) override
rtl::Reference< ScCondFormatObj > mxParent
static void FillScRange(ScRange &rScRange, const css::table::CellRangeAddress &rApiRange)
Definition: convuno.hxx:79
bool IsEmpty() const
Definition: conditio.cxx:1763
virtual OUString SAL_CALL getFormula() override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual sal_Int32 SAL_CALL getType() override
virtual sal_Int32 SAL_CALL getType() override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
double GetValue() const
Definition: colorscale.cxx:236
void SetStyleName(const OUString &rStyleName)
Definition: conditio.cxx:1678
bool mbNeg
Use different color for negative values.
Definition: colorscale.hxx:159
sal_Int16 SCTAB
Definition: types.hxx:22
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
rtl::Reference< ScDataBarFormatObj > mxParent
rtl::Reference< ScCondFormatObj > mxParent
virtual sal_Int32 SAL_CALL getLength() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override