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 <sal/config.h>
11 
12 #include <algorithm>
13 #include <memory>
14 #include <condformatuno.hxx>
15 
16 #include <document.hxx>
17 #include <conditio.hxx>
18 #include <colorscale.hxx>
19 #include <docsh.hxx>
20 #include <compiler.hxx>
21 #include <tokenarray.hxx>
22 
23 #include <cellsuno.hxx>
24 #include <convuno.hxx>
25 
26 #include <o3tl/safeint.hxx>
27 #include <vcl/svapp.hxx>
28 #include <rtl/ustring.hxx>
29 #include <sal/log.hxx>
30 
31 #include <com/sun/star/sheet/DataBarAxis.hpp>
32 #include <com/sun/star/sheet/IconSetType.hpp>
33 #include <com/sun/star/sheet/ConditionFormatOperator.hpp>
34 #include <com/sun/star/sheet/DataBarEntryType.hpp>
35 #include <com/sun/star/sheet/ColorScaleEntryType.hpp>
36 #include <com/sun/star/sheet/IconSetFormatEntry.hpp>
37 #include <com/sun/star/sheet/ConditionEntryType.hpp>
38 #include <com/sun/star/sheet/DateType.hpp>
39 
40 namespace {
41 
43 {
44  ID,
45  CondFormat_Range
46 };
47 
48 const SfxItemPropertyMapEntry* getCondFormatPropset()
49 {
50  static const SfxItemPropertyMapEntry aCondFormatPropertyMap_Impl[] =
51  {
52  {u"ID", ID, cppu::UnoType<sal_Int32>::get(), 0, 0},
53  {u"Range", CondFormat_Range, cppu::UnoType<sheet::XSheetCellRanges>::get(), 0, 0},
54  {u"", 0, css::uno::Type(), 0, 0}
55  };
56  return aCondFormatPropertyMap_Impl;
57 }
58 
60 {
61  StyleName,
62  Formula1,
63  Formula2,
64  Operator
65 };
66 
67 const SfxItemPropertyMapEntry* getConditionEntryrPropSet()
68 {
69  static const SfxItemPropertyMapEntry aConditionEntryPropertyMap_Impl[] =
70  {
71  {u"StyleName", StyleName, cppu::UnoType<OUString>::get(), 0, 0},
72  {u"Formula1", Formula1, cppu::UnoType<OUString>::get(), 0, 0},
73  {u"Formula2", Formula2, cppu::UnoType<OUString>::get(), 0, 0},
75  {u"", 0, css::uno::Type(), 0, 0}
76  };
77  return aConditionEntryPropertyMap_Impl;
78 }
79 
80 struct ConditionEntryApiMap
81 {
83  sal_Int32 nApiMode;
84 };
85 
86 ConditionEntryApiMap const aConditionEntryMap[] =
87 {
88  {ScConditionMode::Equal, sheet::ConditionFormatOperator::EQUAL},
89  {ScConditionMode::Less, sheet::ConditionFormatOperator::LESS},
90  {ScConditionMode::Greater, sheet::ConditionFormatOperator::GREATER},
91  {ScConditionMode::EqLess, sheet::ConditionFormatOperator::LESS_EQUAL},
92  {ScConditionMode::EqGreater, sheet::ConditionFormatOperator::GREATER_EQUAL},
93  {ScConditionMode::NotEqual, sheet::ConditionFormatOperator::NOT_EQUAL},
94  {ScConditionMode::Between, sheet::ConditionFormatOperator::BETWEEN},
95  {ScConditionMode::NotBetween, sheet::ConditionFormatOperator::NOT_BETWEEN},
96  {ScConditionMode::Duplicate, sheet::ConditionFormatOperator::DUPLICATE},
97  {ScConditionMode::NotDuplicate, sheet::ConditionFormatOperator::UNIQUE},
98  {ScConditionMode::Direct, sheet::ConditionFormatOperator::EXPRESSION},
99  {ScConditionMode::Top10, sheet::ConditionFormatOperator::TOP_N_ELEMENTS},
100  {ScConditionMode::Bottom10, sheet::ConditionFormatOperator::BOTTOM_N_ELEMENTS},
101  {ScConditionMode::TopPercent, sheet::ConditionFormatOperator::TOP_N_PERCENT},
102  {ScConditionMode::BottomPercent, sheet::ConditionFormatOperator::BOTTOM_N_PERCENT},
103  {ScConditionMode::AboveAverage, sheet::ConditionFormatOperator::ABOVE_AVERAGE},
104  {ScConditionMode::BelowAverage, sheet::ConditionFormatOperator::BELOW_AVERAGE},
105  {ScConditionMode::AboveEqualAverage, sheet::ConditionFormatOperator::ABOVE_EQUAL_AVERAGE},
106  {ScConditionMode::BelowEqualAverage, sheet::ConditionFormatOperator::BELOW_EQUAL_AVERAGE},
107  {ScConditionMode::Error, sheet::ConditionFormatOperator::ERROR},
108  {ScConditionMode::NoError, sheet::ConditionFormatOperator::NO_ERROR},
109  {ScConditionMode::BeginsWith, sheet::ConditionFormatOperator::BEGINS_WITH},
110  {ScConditionMode::EndsWith, sheet::ConditionFormatOperator::ENDS_WITH},
111  {ScConditionMode::ContainsText, sheet::ConditionFormatOperator::CONTAINS},
112  {ScConditionMode::NotContainsText, sheet::ConditionFormatOperator::NOT_CONTAINS},
113  {ScConditionMode::NONE, sheet::ConditionFormatOperator::EQUAL},
114 };
115 
117 {
118  ColorScaleEntries
119 };
120 
121 const SfxItemPropertyMapEntry* getColorScalePropSet()
122 {
123  static const SfxItemPropertyMapEntry aColorScalePropertyMap_Impl[] =
124  {
125  {u"ColorScaleEntries", ColorScaleEntries, cppu::UnoType<uno::Sequence< sheet::XColorScaleEntry >>::get(), 0, 0 },
126  {u"", 0, css::uno::Type(), 0, 0}
127  };
128  return aColorScalePropertyMap_Impl;
129 }
130 
131 struct ColorScaleEntryTypeApiMap
132 {
134  sal_Int32 nApiType;
135 };
136 
137 ColorScaleEntryTypeApiMap const aColorScaleEntryTypeMap[] =
138 {
145 };
146 
148 {
149  AxisPosition,
150  UseGradient,
151  UseNegativeColor,
152  DataBar_ShowValue,
153  DataBar_Color,
154  AxisColor,
155  NegativeColor,
156  DataBarEntries,
157  MinimumLength,
158  MaximumLength
159 };
160 
161 const SfxItemPropertyMapEntry* getDataBarPropSet()
162 {
163  static const SfxItemPropertyMapEntry aDataBarPropertyMap_Impl[] =
164  {
165  {u"AxisPosition", AxisPosition, cppu::UnoType<decltype(sheet::DataBarAxis::AXIS_AUTOMATIC)>::get(), 0, 0 },
166  {u"UseGradient", UseGradient, cppu::UnoType<bool>::get(), 0, 0 },
167  {u"UseNegativeColor", UseNegativeColor, cppu::UnoType<bool>::get(), 0, 0 },
168  {u"ShowValue", DataBar_ShowValue, cppu::UnoType<bool>::get(), 0, 0 },
169  {u"Color", DataBar_Color, cppu::UnoType<sal_Int32>::get(), 0, 0},
170  {u"AxisColor", AxisColor, cppu::UnoType<sal_Int32>::get(), 0, 0},
171  {u"NegativeColor", NegativeColor, cppu::UnoType<sal_Int32>::get(), 0, 0},
172  {u"DataBarEntries", DataBarEntries, cppu::UnoType<uno::Sequence< sheet::XDataBarEntry >>::get(), 0, 0 },
173  {u"MinimumLength", MinimumLength, cppu::UnoType<double>::get(), 0, 0 },
174  {u"MaximumLength", MaximumLength, cppu::UnoType<double>::get(), 0, 0 },
175  {u"", 0, css::uno::Type(), 0, 0}
176  };
177  return aDataBarPropertyMap_Impl;
178 }
179 
180 struct DataBarAxisApiMap
181 {
183  sal_Int32 nApiPos;
184 };
185 
186 DataBarAxisApiMap const aDataBarAxisMap[] =
187 {
188  { databar::NONE, sheet::DataBarAxis::AXIS_NONE },
189  { databar::AUTOMATIC, sheet::DataBarAxis::AXIS_AUTOMATIC },
190  { databar::MIDDLE, sheet::DataBarAxis::AXIS_MIDDLE }
191 };
192 
193 struct DataBarEntryTypeApiMap
194 {
196  sal_Int32 nApiType;
197 };
198 
199 DataBarEntryTypeApiMap const aDataBarEntryTypeMap[] =
200 {
201  { COLORSCALE_AUTO, sheet::DataBarEntryType::DATABAR_AUTO },
202  { COLORSCALE_MIN, sheet::DataBarEntryType::DATABAR_MIN },
203  { COLORSCALE_MAX, sheet::DataBarEntryType::DATABAR_MAX },
204  { COLORSCALE_VALUE, sheet::DataBarEntryType::DATABAR_VALUE },
205  { COLORSCALE_FORMULA, sheet::DataBarEntryType::DATABAR_FORMULA },
206  { COLORSCALE_PERCENT, sheet::DataBarEntryType::DATABAR_PERCENT },
207  { COLORSCALE_PERCENTILE, sheet::DataBarEntryType::DATABAR_PERCENTILE }
208 };
209 
211 {
212  Icons,
213  Reverse,
214  ShowValue,
215  IconSetEntries
216 };
217 
218 const SfxItemPropertyMapEntry* getIconSetPropSet()
219 {
220  static const SfxItemPropertyMapEntry aIconSetPropertyMap_Impl[] =
221  {
223  {u"Reverse", Reverse, cppu::UnoType<bool>::get(), 0, 0 },
224  {u"ShowValue", ShowValue, cppu::UnoType<bool>::get(), 0, 0 },
225  {u"IconSetEntries", IconSetEntries, cppu::UnoType<uno::Sequence< sheet::XIconSetEntry >>::get(), 0, 0 },
226  {u"", 0, css::uno::Type(), 0, 0}
227  };
228  return aIconSetPropertyMap_Impl;
229 }
230 
231 struct IconSetTypeApiMap
232 {
234  sal_Int32 nApiType;
235 };
236 
237 const IconSetTypeApiMap aIconSetApiMap[] =
238 {
239  { IconSet_3Arrows, sheet::IconSetType::ICONSET_3ARROWS },
240  { IconSet_3ArrowsGray, sheet::IconSetType::ICONSET_3ARROWS_GRAY },
241  { IconSet_3Flags, sheet::IconSetType::ICONSET_3FLAGS },
242  { IconSet_3TrafficLights1, sheet::IconSetType::ICONSET_3TRAFFICLIGHTS1 },
243  { IconSet_3TrafficLights2, sheet::IconSetType::ICONSET_3TRAFFICLIGHTS2 },
244  { IconSet_3Signs, sheet::IconSetType::ICONSET_3SIGNS },
245  { IconSet_3Symbols, sheet::IconSetType::ICONSET_3SYMBOLS },
246  { IconSet_3Symbols2, sheet::IconSetType::ICONSET_3SYMBOLS2 },
247  { IconSet_3Smilies, sheet::IconSetType::ICONSET_3SMILIES },
248  { IconSet_3ColorSmilies, sheet::IconSetType::ICONSET_3COLOR_SIMILIES },
249  { IconSet_4Arrows, sheet::IconSetType::ICONSET_4ARROWS },
250  { IconSet_4ArrowsGray, sheet::IconSetType::ICONSET_4ARROWS_GRAY },
251  { IconSet_4Rating, sheet::IconSetType::ICONSET_4RATING },
252  { IconSet_4RedToBlack, sheet::IconSetType::ICONSET_4RED_TO_BLACK },
253  { IconSet_4TrafficLights, sheet::IconSetType::ICONSET_4TRAFFICLIGHTS },
254  { IconSet_5Arrows, sheet::IconSetType::ICONSET_5ARROWS },
255  { IconSet_5ArrowsGray, sheet::IconSetType::ICONSET_4ARROWS_GRAY },
256  { IconSet_5Ratings, sheet::IconSetType::ICONSET_5RATINGS },
257  { IconSet_5Quarters, sheet::IconSetType::ICONSET_5QUARTERS },
258 };
259 
260 struct IconSetEntryTypeApiMap
261 {
263  sal_Int32 nApiType;
264 };
265 
266 IconSetEntryTypeApiMap const aIconSetEntryTypeMap[] =
267 {
268  { COLORSCALE_MIN, sheet::IconSetFormatEntry::ICONSET_MIN },
269  { COLORSCALE_VALUE, sheet::IconSetFormatEntry::ICONSET_VALUE },
270  { COLORSCALE_FORMULA, sheet::IconSetFormatEntry::ICONSET_FORMULA },
271  { COLORSCALE_PERCENT, sheet::IconSetFormatEntry::ICONSET_PERCENT },
272  { COLORSCALE_PERCENTILE, sheet::IconSetFormatEntry::ICONSET_PERCENTILE }
273 };
274 
276 {
277  Date_StyleName,
278  DateType
279 };
280 
281 const SfxItemPropertyMapEntry* getCondDatePropSet()
282 {
283  static const SfxItemPropertyMapEntry aCondDatePropertyMap_Impl[] =
284  {
285  {u"StyleName", StyleName, cppu::UnoType<OUString>::get(), 0, 0},
286  {u"DateType", Icons, cppu::UnoType<decltype(sheet::DateType::TODAY)>::get(), 0, 0 },
287  {u"", 0, css::uno::Type(), 0, 0}
288  };
289  return aCondDatePropertyMap_Impl;
290 }
291 
292 struct DateTypeApiMap
293 {
295  sal_Int32 nApiType;
296 };
297 
298 DateTypeApiMap const aDateTypeApiMap[] =
299 {
313 };
314 
315 }
316 
318  mnTab(nTab),
319  mpDocShell(pDocShell)
320 {
321  pDocShell->GetDocument().AddUnoObject(*this);
322 }
323 
325 {
326  if (mpDocShell)
328 }
329 
330 void ScCondFormatsObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
331 {
332  if ( rHint.GetId() == SfxHintId::Dying )
333  {
334  mpDocShell = nullptr;
335  }
336 }
337 
338 sal_Int32 ScCondFormatsObj::createByRange(const uno::Reference< sheet::XSheetCellRanges >& xRanges)
339 {
340  SolarMutexGuard aGuard;
341  if (!mpDocShell)
342  throw lang::IllegalArgumentException();
343 
344  if (!xRanges.is())
345  throw lang::IllegalArgumentException();
346 
347  const uno::Sequence<table::CellRangeAddress> aRanges =
348  xRanges->getRangeAddresses();
349 
350  ScRangeList aCoreRange;
351  for (const auto& rRange : aRanges)
352  {
353  ScRange aRange;
354  ScUnoConversion::FillScRange(aRange, rRange);
355  aCoreRange.Join(aRange);
356  }
357 
358  if (aCoreRange.empty())
359  throw lang::IllegalArgumentException();
360 
361  SCTAB nTab = aCoreRange[0].aStart.Tab();
362 
363  auto pNewFormat = std::make_unique<ScConditionalFormat>(0, &mpDocShell->GetDocument());
364  pNewFormat->SetRange(aCoreRange);
365  return mpDocShell->GetDocument().AddCondFormat(std::move(pNewFormat), nTab);
366 }
367 
368 void ScCondFormatsObj::removeByID(const sal_Int32 nID)
369 {
370  SolarMutexGuard aGuard;
371  ScConditionalFormatList* pFormatList = getCoreObject();
372  pFormatList->erase(nID);
373 }
374 
375 uno::Sequence<uno::Reference<sheet::XConditionalFormat> > ScCondFormatsObj::getConditionalFormats()
376 {
377  SolarMutexGuard aGuard;
378  ScConditionalFormatList* pFormatList = getCoreObject();
379  size_t n = pFormatList->size();
380  uno::Sequence<uno::Reference<sheet::XConditionalFormat> > aCondFormats(n);
381  std::transform(pFormatList->begin(), pFormatList->end(), aCondFormats.getArray(),
382  [this](const auto& rFormat)
383  { return uno::Reference(new ScCondFormatObj(mpDocShell, this, rFormat->GetKey())); });
384 
385  return aCondFormats;
386 }
387 
389 {
390  SolarMutexGuard aGuard;
391  ScConditionalFormatList* pFormatList = getCoreObject();
392  return pFormatList->size();
393 }
394 
396 {
397  if (!mpDocShell)
398  throw uno::RuntimeException();
399 
401  if (!pList)
402  throw uno::RuntimeException();
403 
404  return pList;
405 }
406 
407 namespace {
408 
409 uno::Reference<beans::XPropertySet> createConditionEntry(const ScFormatEntry* pEntry,
410  rtl::Reference<ScCondFormatObj> const & xParent)
411 {
412  switch (pEntry->GetType())
413  {
416  return new ScConditionEntryObj(xParent,
417  static_cast<const ScCondFormatEntry*>(pEntry));
418  break;
420  return new ScColorScaleFormatObj(xParent,
421  static_cast<const ScColorScaleFormat*>(pEntry));
422  break;
424  return new ScDataBarFormatObj(xParent,
425  static_cast<const ScDataBarFormat*>(pEntry));
426  break;
428  return new ScIconSetFormatObj(xParent,
429  static_cast<const ScIconSetFormat*>(pEntry));
430  break;
432  return new ScCondDateFormatObj(xParent,
433  static_cast<const ScCondDateFormatEntry*>(pEntry));
434  break;
435  default:
436  break;
437  }
438  return uno::Reference<beans::XPropertySet>();
439 }
440 
441 }
442 
444  sal_Int32 nKey):
445  mxCondFormatList(xCondFormats),
446  mpDocShell(pDocShell),
447  maPropSet(getCondFormatPropset()),
448  mnKey(nKey)
449 {
450 }
451 
453 {
454 }
455 
457 {
458  ScConditionalFormatList* pList = mxCondFormatList->getCoreObject();
459  ScConditionalFormat* pFormat = pList->GetFormat(mnKey);
460  if (!pFormat)
461  throw uno::RuntimeException();
462 
463  return pFormat;
464 }
465 
467 {
468  return mpDocShell;
469 }
470 
471 void ScCondFormatObj::createEntry(const sal_Int32 nType, const sal_Int32 nPos)
472 {
473  SolarMutexGuard aGuard;
474  ScConditionalFormat* pFormat = getCoreObject();
475  if (nPos > sal_Int32(pFormat->size()))
476  throw lang::IllegalArgumentException();
477 
478  ScFormatEntry* pNewEntry = nullptr;
479  ScDocument& rDoc = mpDocShell->GetDocument();
480  switch (nType)
481  {
483  pNewEntry = new ScCondFormatEntry(ScConditionMode::Equal, "", "",
484  rDoc, pFormat->GetRange().GetTopLeftCorner(), "");
485  break;
487  pNewEntry = new ScColorScaleFormat(&rDoc);
488  static_cast<ScColorScaleFormat*>(pNewEntry)->EnsureSize();
489  break;
491  pNewEntry = new ScDataBarFormat(&rDoc);
492  static_cast<ScDataBarFormat*>(pNewEntry)->EnsureSize();
493  break;
495  pNewEntry = new ScIconSetFormat(&rDoc);
496  static_cast<ScIconSetFormat*>(pNewEntry)->EnsureSize();
497  break;
499  pNewEntry = new ScCondDateFormatEntry(&rDoc);
500  break;
501  default:
502  SAL_WARN("sc", "unknown conditional format type");
503  throw lang::IllegalArgumentException();
504  }
505 
506  pFormat->AddEntry(pNewEntry);
507 }
508 
509 void ScCondFormatObj::removeByIndex(const sal_Int32 nIndex)
510 {
511  SolarMutexGuard aGuard;
512  if (getCoreObject()->size() >= o3tl::make_unsigned(nIndex))
513  throw lang::IllegalArgumentException();
514 
515  getCoreObject()->RemoveEntry(nIndex);
516 }
517 
519 {
521 }
522 
524 {
525  SolarMutexGuard aGuard;
526  ScConditionalFormat* pFormat = getCoreObject();
527  return !pFormat->IsEmpty();
528 }
529 
531 {
532  SolarMutexGuard aGuard;
533  ScConditionalFormat* pFormat = getCoreObject();
534 
535  return pFormat->size();
536 }
537 
539 {
540  SolarMutexGuard aGuard;
541  if (getCoreObject()->size() <= o3tl::make_unsigned(nIndex))
542  throw lang::IllegalArgumentException();
543 
544  const ScFormatEntry* pEntry = getCoreObject()->GetEntry(nIndex);
545  uno::Reference<beans::XPropertySet> xCondEntry =
546  createConditionEntry(pEntry, this);
547  return uno::Any(xCondEntry);
548 }
549 
550 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCondFormatObj::getPropertySetInfo()
551 {
552  SolarMutexGuard aGuard;
553  static uno::Reference<beans::XPropertySetInfo> aRef(
555  return aRef;
556 }
557 
559  const OUString& aPropertyName, const uno::Any& aValue )
560 {
561  SolarMutexGuard aGuard;
562 
563  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
564  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
565  if ( !pEntry )
566  throw beans::UnknownPropertyException(aPropertyName);
567 
568  switch(pEntry->nWID)
569  {
570  case ID:
571  throw lang::IllegalArgumentException();
572  break;
573  case CondFormat_Range:
574  {
575  uno::Reference<sheet::XSheetCellRanges> xRange;
576  if (aValue >>= xRange)
577  {
578  ScConditionalFormat* pFormat = getCoreObject();
579  const uno::Sequence<table::CellRangeAddress> aRanges =
580  xRange->getRangeAddresses();
581  ScRangeList aTargetRange;
582  for (const auto& rRange : aRanges)
583  {
584  ScRange aRange;
585  ScUnoConversion::FillScRange(aRange, rRange);
586  aTargetRange.Join(aRange);
587  }
588  pFormat->SetRange(aTargetRange);
589  }
590  }
591  break;
592  default:
593  SAL_WARN("sc", "unknown property");
594  }
595 }
596 
597 uno::Any SAL_CALL ScCondFormatObj::getPropertyValue( const OUString& aPropertyName )
598 {
599  SolarMutexGuard aGuard;
600 
601  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
602  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
603  if ( !pEntry )
604  throw beans::UnknownPropertyException(aPropertyName);
605 
606  uno::Any aAny;
607  switch(pEntry->nWID)
608  {
609  case ID:
610  aAny <<= sal_Int32(getCoreObject()->GetKey());
611  break;
612  case CondFormat_Range:
613  {
614  const ScRangeList& rRange = getCoreObject()->GetRange();
615  uno::Reference<sheet::XSheetCellRanges> xRange;
616  xRange.set(new ScCellRangesObj(mpDocShell, rRange));
617  aAny <<= xRange;
618  }
619  break;
620  default:
621  SAL_WARN("sc", "unknown property");
622  }
623  return aAny;
624 }
625 
626 void SAL_CALL ScCondFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
627  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
628 {
629  SAL_WARN("sc", "not implemented");
630 }
631 
632 void SAL_CALL ScCondFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
633  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
634 {
635  SAL_WARN("sc", "not implemented");
636 }
637 
638 void SAL_CALL ScCondFormatObj::addVetoableChangeListener( const OUString&,
639  const uno::Reference<beans::XVetoableChangeListener>&)
640 {
641  SAL_WARN("sc", "not implemented");
642 }
643 
644 void SAL_CALL ScCondFormatObj::removeVetoableChangeListener( const OUString&,
645  const uno::Reference<beans::XVetoableChangeListener>&)
646 {
647  SAL_WARN("sc", "not implemented");
648 }
649 
650 namespace {
651 
652 bool isObjectStillAlive(const ScConditionalFormat* pFormat, const ScFormatEntry* pEntry)
653 {
654  for(size_t i = 0, n= pFormat->size(); i < n; ++i)
655  {
656  if (pFormat->GetEntry(i) == pEntry)
657  return true;
658  }
659  return false;
660 }
661 
662 }
663 
665  const ScCondFormatEntry* pFormat):
666  mpDocShell(xParent->getDocShell()),
667  mxParent(xParent),
668  maPropSet(getConditionEntryrPropSet()),
669  mpFormat(pFormat)
670 {
671 }
672 
674 {
675 }
676 
678 {
679  ScConditionalFormat* pFormat = mxParent->getCoreObject();
680  if (isObjectStillAlive(pFormat, mpFormat))
681  return const_cast<ScCondFormatEntry*>(mpFormat);
682 
683  throw lang::IllegalArgumentException();
684 }
685 
687 {
689 }
690 
691 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScConditionEntryObj::getPropertySetInfo()
692 {
693  static uno::Reference<beans::XPropertySetInfo> aRef(
695  return aRef;
696 }
697 
699  const OUString& aPropertyName, const uno::Any& aValue )
700 {
701  SolarMutexGuard aGuard;
702 
703  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
704  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
705  if ( !pEntry )
706  throw beans::UnknownPropertyException(aPropertyName);
707 
708  switch(pEntry->nWID)
709  {
710  case StyleName:
711  {
712  OUString aStyleName;
713  if ((aValue >>= aStyleName) && !aStyleName.isEmpty())
714  getCoreObject()->UpdateStyleName(aStyleName);
715  }
716  break;
717  case Formula1:
718  {
719  OUString aFormula;
720  if ((aValue >>= aFormula) && !aFormula.isEmpty())
721  {
724  std::unique_ptr<ScTokenArray> pArr(aComp.CompileString(aFormula));
725  getCoreObject()->SetFormula1(*pArr);
726  }
727  }
728  break;
729  case Formula2:
730  {
731  OUString aFormula;
732  if ((aValue >>= aFormula) && !aFormula.isEmpty())
733  {
736  std::unique_ptr<ScTokenArray> pArr(aComp.CompileString(aFormula));
737  getCoreObject()->SetFormula2(*pArr);
738  }
739  }
740  break;
741  case Operator:
742  {
743  sal_Int32 nVal;
744  if (aValue >>= nVal)
745  {
746  for (ConditionEntryApiMap const & rEntry : aConditionEntryMap)
747  {
748  if (rEntry.nApiMode == nVal)
749  {
750  getCoreObject()->SetOperation(rEntry.eMode);
751  break;
752  }
753  }
754  }
755  }
756  break;
757  default:
758  SAL_WARN("sc", "unsupported property");
759  }
760 }
761 
762 uno::Any SAL_CALL ScConditionEntryObj::getPropertyValue( const OUString& aPropertyName )
763 {
764  SolarMutexGuard aGuard;
765 
766  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
767  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
768  if ( !pEntry )
769  throw beans::UnknownPropertyException(aPropertyName);
770 
771  uno::Any aAny;
772  switch(pEntry->nWID)
773  {
774  case StyleName:
775  aAny <<= getCoreObject()->GetStyle();
776  break;
777  case Formula1:
778  {
779  ScAddress aCursor = getCoreObject()->GetSrcPos();
780  OUString aFormula = getCoreObject()->GetExpression(aCursor, 0);
781  aAny <<= aFormula;
782  }
783  break;
784  case Formula2:
785  {
786  ScAddress aCursor = getCoreObject()->GetSrcPos();
787  OUString aFormula = getCoreObject()->GetExpression(aCursor, 1);
788  aAny <<= aFormula;
789  }
790  break;
791  case Operator:
792  {
794  for (ConditionEntryApiMap const & rEntry : aConditionEntryMap)
795  {
796  if (rEntry.eMode == eMode)
797  {
798  aAny <<= rEntry.nApiMode;
799  break;
800  }
801  }
802  }
803  break;
804  default:
805  SAL_WARN("sc", "unsupported property");
806  }
807  return aAny;
808 }
809 
810 void SAL_CALL ScConditionEntryObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
811  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
812 {
813  SAL_WARN("sc", "not implemented");
814 }
815 
816 void SAL_CALL ScConditionEntryObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
817  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
818 {
819  SAL_WARN("sc", "not implemented");
820 }
821 
822 void SAL_CALL ScConditionEntryObj::addVetoableChangeListener( const OUString&,
823  const uno::Reference<beans::XVetoableChangeListener>&)
824 {
825  SAL_WARN("sc", "not implemented");
826 }
827 
829  const uno::Reference<beans::XVetoableChangeListener>&)
830 {
831  SAL_WARN("sc", "not implemented");
832 }
833 
835  const ScColorScaleFormat* pFormat):
836  mxParent(xParent),
837  maPropSet(getColorScalePropSet()),
838  mpFormat(pFormat)
839 {
840 }
841 
843 {
844 }
845 
847 {
848  ScConditionalFormat* pFormat = mxParent->getCoreObject();
849  if (isObjectStillAlive(pFormat, mpFormat))
850  return const_cast<ScColorScaleFormat*>(mpFormat);
851 
852  throw lang::IllegalArgumentException();
853 }
854 
856 {
858 }
859 
860 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScColorScaleFormatObj::getPropertySetInfo()
861 {
862  static uno::Reference<beans::XPropertySetInfo> aRef(
864  return aRef;
865 }
866 
867 namespace {
868 
869 void setColorScaleEntry(ScColorScaleEntry* pEntry, uno::Reference<sheet::XColorScaleEntry> const & xEntry)
870 {
872  sal_Int32 nApiType = xEntry->getType();
873  bool bFound = false;
874  for (ColorScaleEntryTypeApiMap const & rEntry : aColorScaleEntryTypeMap)
875  {
876  if (rEntry.nApiType == nApiType)
877  {
878  eType = rEntry.eType;
879  bFound = true;
880  break;
881  }
882  }
883 
884  if (!bFound)
885  throw lang::IllegalArgumentException();
886 
887  pEntry->SetType(eType);
888  pEntry->SetColor(Color(ColorTransparency, xEntry->getColor()));
889  switch (eType)
890  {
891  case COLORSCALE_FORMULA:
892  // TODO: Implement
893  break;
894  default:
895  {
896  double nVal = xEntry->getFormula().toDouble();
897  pEntry->SetValue(nVal);
898  }
899  break;
900  }
901 }
902 
903 }
904 
906  const OUString& aPropertyName, const uno::Any& aValue )
907 {
908  SolarMutexGuard aGuard;
909 
910  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
911  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
912  if ( !pEntry )
913  throw beans::UnknownPropertyException(aPropertyName);
914 
915  switch(pEntry->nWID)
916  {
917  case ColorScaleEntries:
918  {
919  uno::Sequence<uno::Reference<sheet::XColorScaleEntry> > aEntries;
920  if (!(aValue >>= aEntries))
921  throw lang::IllegalArgumentException();
922 
923  if (aEntries.getLength() < 2)
924  throw lang::IllegalArgumentException();
925 
926  // TODO: we need to make sure that there are enough entries
927  size_t n = size_t(aEntries.getLength());
928  for (size_t i = 0; i < n; ++i)
929  {
930  setColorScaleEntry(getCoreObject()->GetEntry(i), aEntries[i]);
931  }
932 
933  }
934  break;
935  default:
936  SAL_WARN("sc", "unknown property");
937  }
938 }
939 
940 uno::Any SAL_CALL ScColorScaleFormatObj::getPropertyValue( const OUString& aPropertyName )
941 {
942  SolarMutexGuard aGuard;
943 
944  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
945  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
946  if ( !pEntry )
947  throw beans::UnknownPropertyException(aPropertyName);
948 
949  uno::Any aAny;
950 
951  switch(pEntry->nWID)
952  {
953  case ColorScaleEntries:
954  {
955  uno::Sequence<uno::Reference<sheet::XColorScaleEntry> > aEntries(getCoreObject()->size());
956  auto aEntriesRange = asNonConstRange(aEntries);
957  for (size_t i = 0; i < getCoreObject()->size(); ++i)
958  {
959  aEntriesRange[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  auto aEntriesRange = asNonConstRange(aEntries);
1642  for (size_t i = 0; i < nSize; ++i)
1643  {
1644  aEntriesRange[i] = new ScIconSetEntryObj(this, i);
1645  }
1646  aAny <<= aEntries;
1647  }
1648  break;
1649  default:
1650  SAL_WARN("sc", "unknown property");
1651  }
1652  return aAny;
1653 }
1654 
1655 void SAL_CALL ScIconSetFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
1656  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1657 {
1658  SAL_WARN("sc", "not implemented");
1659 }
1660 
1661 void SAL_CALL ScIconSetFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
1662  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1663 {
1664  SAL_WARN("sc", "not implemented");
1665 }
1666 
1667 void SAL_CALL ScIconSetFormatObj::addVetoableChangeListener( const OUString&,
1668  const uno::Reference<beans::XVetoableChangeListener>&)
1669 {
1670  SAL_WARN("sc", "not implemented");
1671 }
1672 
1674  const uno::Reference<beans::XVetoableChangeListener>&)
1675 {
1676  SAL_WARN("sc", "not implemented");
1677 }
1678 
1680  size_t nPos):
1681  mxParent(xParent),
1682  mnPos(nPos)
1683 {
1684 }
1685 
1687 {
1688 }
1689 
1691 {
1692  ScIconSetFormat* pFormat = mxParent->getCoreObject();
1693  if (pFormat->GetIconSetData()->m_Entries.size() <= mnPos)
1694  throw lang::IllegalArgumentException();
1695 
1696  return pFormat->GetIconSetData()->m_Entries[mnPos].get();
1697 }
1698 
1700 {
1701  ScColorScaleEntry* pEntry = getCoreObject();
1702  // the first entry always is minimum
1703  if (mnPos == 0)
1704  return sheet::IconSetFormatEntry::ICONSET_MIN;
1705 
1706  for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap)
1707  {
1708  if (rEntry.eType == pEntry->GetType())
1709  {
1710  return rEntry.nApiType;
1711  }
1712  }
1713 
1714  throw lang::IllegalArgumentException();
1715 }
1716 
1718 {
1719  // first entry is always MIN
1720  if (mnPos == 0)
1721  return;
1722 
1723  ScColorScaleEntry* pEntry = getCoreObject();
1724  for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap)
1725  {
1726  if (rEntry.nApiType == nType)
1727  {
1728  pEntry->SetType(rEntry.eType);
1729  return;
1730  }
1731  }
1732  throw lang::IllegalArgumentException();
1733 }
1734 
1736 {
1737  ScColorScaleEntry* pEntry = getCoreObject();
1738  switch (pEntry->GetType())
1739  {
1740  case COLORSCALE_FORMULA:
1741  // TODO: Implement
1742  break;
1743  default:
1744  return OUString::number(pEntry->GetValue());
1745  }
1746 
1747  return OUString();
1748 }
1749 
1750 void ScIconSetEntryObj::setFormula(const OUString& rFormula)
1751 {
1752  ScColorScaleEntry* pEntry = getCoreObject();
1753  switch (pEntry->GetType())
1754  {
1755  case COLORSCALE_FORMULA:
1756  // TODO: Implement
1757  // pEntry->SetFormula(rFormula);
1758  break;
1759  default:
1760  pEntry->SetValue(rFormula.toDouble());
1761  break;
1762  }
1763 }
1764 
1766  const ScCondDateFormatEntry* pFormat):
1767  mxParent(xParent),
1768  maPropSet(getCondDatePropSet()),
1769  mpFormat(pFormat)
1770 {
1771 }
1772 
1774 {
1775 }
1776 
1778 {
1779  ScConditionalFormat* pFormat = mxParent->getCoreObject();
1780  if (isObjectStillAlive(pFormat, mpFormat))
1781  return const_cast<ScCondDateFormatEntry*>(mpFormat);
1782 
1783  throw lang::IllegalArgumentException();
1784 }
1785 
1787 {
1789 }
1790 
1791 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCondDateFormatObj::getPropertySetInfo()
1792 {
1793  SolarMutexGuard aGuard;
1794  static uno::Reference<beans::XPropertySetInfo> aRef(
1796  return aRef;
1797 }
1798 
1800  const OUString& aPropertyName, const uno::Any& aValue )
1801 {
1802  SolarMutexGuard aGuard;
1803 
1804  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1805  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1806  if ( !pEntry )
1807  throw beans::UnknownPropertyException(aPropertyName);
1808 
1809  switch(pEntry->nWID)
1810  {
1811  case Date_StyleName:
1812  {
1813  OUString aStyleName;
1814  if (!(aValue >>= aStyleName))
1815  throw lang::IllegalArgumentException();
1816 
1817  getCoreObject()->SetStyleName(aStyleName);
1818 
1819  }
1820  break;
1821  case DateType:
1822  {
1823  sal_Int32 nApiType = -1;
1824  if (!(aValue >>= nApiType))
1825  throw lang::IllegalArgumentException();
1826 
1827  for (DateTypeApiMap const & rEntry : aDateTypeApiMap)
1828  {
1829  if (rEntry.nApiType == nApiType)
1830  {
1831  getCoreObject()->SetDateType(rEntry.eType);
1832  break;
1833  }
1834  }
1835  }
1836  break;
1837  default:
1838  break;
1839  }
1840 }
1841 
1842 uno::Any SAL_CALL ScCondDateFormatObj::getPropertyValue( const OUString& aPropertyName )
1843 {
1844  SolarMutexGuard aGuard;
1845 
1846  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1847  const SfxItemPropertyMapEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1848  if ( !pEntry )
1849  throw beans::UnknownPropertyException(aPropertyName);
1850 
1851  uno::Any aAny;
1852 
1853  switch(pEntry->nWID)
1854  {
1855  case Date_StyleName:
1856  {
1857  OUString aStyleName = getCoreObject()->GetStyleName();
1858  aAny <<= aStyleName;
1859  }
1860  break;
1861  case DateType:
1862  {
1864  for (DateTypeApiMap const & rEntry : aDateTypeApiMap)
1865  {
1866  if (rEntry.eType == eType)
1867  {
1868  aAny <<= rEntry.nApiType;
1869  break;
1870  }
1871  }
1872  }
1873  break;
1874  default:
1875  SAL_WARN("sc", "unknown property");
1876  }
1877  return aAny;
1878 }
1879 
1880 void SAL_CALL ScCondDateFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
1881  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1882 {
1883  SAL_WARN("sc", "not implemented");
1884 }
1885 
1886 void SAL_CALL ScCondDateFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
1887  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1888 {
1889  SAL_WARN("sc", "not implemented");
1890 }
1891 
1892 void SAL_CALL ScCondDateFormatObj::addVetoableChangeListener( const OUString&,
1893  const uno::Reference<beans::XVetoableChangeListener>&)
1894 {
1895  SAL_WARN("sc", "not implemented");
1896 }
1897 
1899  const uno::Reference<beans::XVetoableChangeListener>&)
1900 {
1901  SAL_WARN("sc", "not implemented");
1902 }
1903 
1904 /* 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:694
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:1752
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:678
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:471
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:715
Reverse
void SetValue(double nValue)
Definition: colorscale.cxx:249
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:984
IconSetProperties
ScConditionEntryObj(rtl::Reference< ScCondFormatObj > const &xParent, const ScCondFormatEntry *pFormat)
ScConditionalFormat * GetFormat(sal_uInt32 nKey)
Definition: conditio.cxx:2074
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:867
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:309
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:1772
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:1162
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:1746
const ScFormatEntry * GetEntry(sal_uInt16 nPos) const
Definition: conditio.cxx:1786
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:1240
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:2258
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:1758
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:483
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:897
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:905
void SetDateType(condformat::ScCondFormatDateType eType)
Definition: conditio.cxx:1677
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:220
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:734
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:2268
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:322
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:1767
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:235
void SetStyleName(const OUString &rStyleName)
Definition: conditio.cxx:1682
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