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 SfxItemPropertySimpleEntry* 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 SfxItemPropertySimpleEntry* 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 SfxItemPropertySimpleEntry* 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 SfxItemPropertySimpleEntry* 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(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 SfxItemPropertySimpleEntry* 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 SfxItemPropertySimpleEntry* 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 {
1023  getCoreObject()->SetColor(Color(aColor));
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 SfxItemPropertySimpleEntry* 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()->mpNegativeColor)
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()->mpNegativeColor) = 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 SfxItemPropertySimpleEntry* 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()->mpNegativeColor)
1336  {
1338  }
1339  }
1340  break;
1341  case DataBarEntries:
1342  {
1343  uno::Sequence<uno::Reference<sheet::XDataBarEntry> > aEntries(2);
1344  aEntries[0] = new ScDataBarEntryObj(this, 0);
1345  aEntries[1] = new ScDataBarEntryObj(this, 1);
1346  aAny <<= aEntries;
1347  }
1348  break;
1349  }
1350  return aAny;
1351 }
1352 
1353 void SAL_CALL ScDataBarFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
1354  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1355 {
1356  SAL_WARN("sc", "not implemented");
1357 }
1358 
1359 void SAL_CALL ScDataBarFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
1360  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1361 {
1362  SAL_WARN("sc", "not implemented");
1363 }
1364 
1365 void SAL_CALL ScDataBarFormatObj::addVetoableChangeListener( const OUString&,
1366  const uno::Reference<beans::XVetoableChangeListener>&)
1367 {
1368  SAL_WARN("sc", "not implemented");
1369 }
1370 
1372  const uno::Reference<beans::XVetoableChangeListener>&)
1373 {
1374  SAL_WARN("sc", "not implemented");
1375 }
1376 
1378  size_t nPos):
1379  mxParent(xParent),
1380  mnPos(nPos)
1381 {
1382 }
1383 
1385 {
1386 }
1387 
1389 {
1390  ScDataBarFormat* pFormat = mxParent->getCoreObject();
1391  ScColorScaleEntry* pEntry;
1392  if (mnPos == 0)
1393  pEntry = pFormat->GetDataBarData()->mpLowerLimit.get();
1394  else
1395  pEntry = pFormat->GetDataBarData()->mpUpperLimit.get();
1396 
1397  return pEntry;
1398 }
1399 
1401 {
1402  ScColorScaleEntry* pEntry = getCoreObject();
1403  for (DataBarEntryTypeApiMap const & rEntry : aDataBarEntryTypeMap)
1404  {
1405  if (rEntry.eType == pEntry->GetType())
1406  {
1407  return rEntry.nApiType;
1408  }
1409  }
1410 
1411  throw lang::IllegalArgumentException();
1412 }
1413 
1415 {
1416  ScColorScaleEntry* pEntry = getCoreObject();
1417  for (DataBarEntryTypeApiMap const & rEntry : aDataBarEntryTypeMap)
1418  {
1419  if (rEntry.nApiType == nType)
1420  {
1421  pEntry->SetType(rEntry.eType);
1422  return;
1423  }
1424  }
1425  throw lang::IllegalArgumentException();
1426 }
1427 
1429 {
1430  ScColorScaleEntry* pEntry = getCoreObject();
1431  switch (pEntry->GetType())
1432  {
1433  case COLORSCALE_FORMULA:
1434  // TODO: Implement
1435  break;
1436  default:
1437  return OUString::number(pEntry->GetValue());
1438  }
1439 
1440  return OUString();
1441 }
1442 
1443 void ScDataBarEntryObj::setFormula(const OUString& rFormula)
1444 {
1445  ScColorScaleEntry* pEntry = getCoreObject();
1446  switch (pEntry->GetType())
1447  {
1448  case COLORSCALE_FORMULA:
1449  // TODO: Implement
1450  // pEntry->SetFormula(rFormula);
1451  break;
1452  default:
1453  pEntry->SetValue(rFormula.toDouble());
1454  break;
1455  }
1456 }
1457 
1458 
1460  const ScIconSetFormat* pFormat):
1461  mxParent(xParent),
1462  maPropSet(getIconSetPropSet()),
1463  mpFormat(pFormat)
1464 {
1465 }
1466 
1468 {
1469 }
1470 
1472 {
1473  ScConditionalFormat* pFormat = mxParent->getCoreObject();
1474  if (isObjectStillAlive(pFormat, mpFormat))
1475  return const_cast<ScIconSetFormat*>(mpFormat);
1476 
1477  throw lang::IllegalArgumentException();
1478 }
1479 
1481 {
1483 }
1484 
1485 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScIconSetFormatObj::getPropertySetInfo()
1486 {
1487  SolarMutexGuard aGuard;
1488  static uno::Reference<beans::XPropertySetInfo> aRef(
1490  return aRef;
1491 }
1492 
1493 namespace {
1494 
1495 void setIconSetEntry(ScIconSetFormat* pFormat, uno::Reference<sheet::XIconSetEntry> const & xEntry, size_t nPos)
1496 {
1499  sal_Int32 nApiType = xEntry->getType();
1500  bool bFound = false;
1501  for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap)
1502  {
1503  if (rEntry.nApiType == nApiType)
1504  {
1505  eType = rEntry.eType;
1506  bFound = true;
1507  break;
1508  }
1509  }
1510 
1511  if (!bFound)
1512  throw lang::IllegalArgumentException();
1513 
1514  pData->m_Entries[nPos]->SetType(eType);
1515  switch (eType)
1516  {
1517  case COLORSCALE_FORMULA:
1518  // TODO: Implement
1519  break;
1520  default:
1521  {
1522  double nVal = xEntry->getFormula().toDouble();
1523  pData->m_Entries[nPos]->SetValue(nVal);
1524  }
1525  break;
1526  }
1527 }
1528 
1529 }
1530 
1532  const OUString& aPropertyName, const uno::Any& aValue )
1533 {
1534  SolarMutexGuard aGuard;
1535 
1536  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1537  const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1538  if ( !pEntry )
1539  throw beans::UnknownPropertyException(aPropertyName);
1540 
1541  switch(pEntry->nWID)
1542  {
1543  case ShowValue:
1544  {
1545  bool bShowValue = true;
1546  aValue >>= bShowValue;
1547  getCoreObject()->GetIconSetData()->mbShowValue = bShowValue;
1548  }
1549  break;
1550  case Reverse:
1551  {
1552  bool bReverse = false;
1553  aValue >>= bReverse;
1554  getCoreObject()->GetIconSetData()->mbReverse = bReverse;
1555  }
1556  break;
1557  case Icons:
1558  {
1559  sal_Int32 nApiType = -1;
1560  aValue >>= nApiType;
1562  bool bFound = false;
1563  for (const IconSetTypeApiMap & rEntry : aIconSetApiMap)
1564  {
1565  if (rEntry.nApiType == nApiType)
1566  {
1567  eType = rEntry.eType;
1568  bFound = true;
1569  break;
1570  }
1571  }
1572 
1573  if (!bFound)
1574  {
1575  throw lang::IllegalArgumentException();
1576  }
1577 
1578  // TODO: we need to make sure that there are enough entries
1580  }
1581  break;
1582  case IconSetEntries:
1583  {
1584  uno::Sequence<uno::Reference<sheet::XIconSetEntry> > aEntries;
1585  if (!(aValue >>= aEntries))
1586  throw lang::IllegalArgumentException();
1587 
1588  // TODO: we need to check that the number of entries
1589  // corresponds to the icon type
1590  sal_Int32 nLength = aEntries.getLength();
1591  for (size_t i = 0; i < o3tl::make_unsigned(nLength); ++i)
1592  {
1593  setIconSetEntry(getCoreObject(), aEntries[i], i);
1594  }
1595 
1596  }
1597  break;
1598  default:
1599  break;
1600  }
1601 }
1602 
1603 uno::Any SAL_CALL ScIconSetFormatObj::getPropertyValue( const OUString& aPropertyName )
1604 {
1605  SolarMutexGuard aGuard;
1606 
1607  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1608  const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1609  if ( !pEntry )
1610  throw beans::UnknownPropertyException(aPropertyName);
1611 
1612  uno::Any aAny;
1613 
1614  switch(pEntry->nWID)
1615  {
1616  case ShowValue:
1617  aAny <<= getCoreObject()->GetIconSetData()->mbShowValue;
1618  break;
1619  case Reverse:
1620  aAny <<= getCoreObject()->GetIconSetData()->mbReverse;
1621  break;
1622  case Icons:
1623  {
1625  for (const IconSetTypeApiMap & rEntry : aIconSetApiMap)
1626  {
1627  if (rEntry.eType == eType)
1628  {
1629  aAny <<= rEntry.nApiType;
1630  break;
1631  }
1632  }
1633  }
1634  break;
1635  case IconSetEntries:
1636  {
1637  size_t nSize = getCoreObject()->size();
1638  uno::Sequence<uno::Reference<sheet::XIconSetEntry> > aEntries(nSize);
1639  for (size_t i = 0; i < nSize; ++i)
1640  {
1641  aEntries[i] = new ScIconSetEntryObj(this, i);
1642  }
1643  aAny <<= aEntries;
1644  }
1645  break;
1646  default:
1647  SAL_WARN("sc", "unknown property");
1648  }
1649  return aAny;
1650 }
1651 
1652 void SAL_CALL ScIconSetFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
1653  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1654 {
1655  SAL_WARN("sc", "not implemented");
1656 }
1657 
1658 void SAL_CALL ScIconSetFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
1659  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1660 {
1661  SAL_WARN("sc", "not implemented");
1662 }
1663 
1664 void SAL_CALL ScIconSetFormatObj::addVetoableChangeListener( const OUString&,
1665  const uno::Reference<beans::XVetoableChangeListener>&)
1666 {
1667  SAL_WARN("sc", "not implemented");
1668 }
1669 
1671  const uno::Reference<beans::XVetoableChangeListener>&)
1672 {
1673  SAL_WARN("sc", "not implemented");
1674 }
1675 
1677  size_t nPos):
1678  mxParent(xParent),
1679  mnPos(nPos)
1680 {
1681 }
1682 
1684 {
1685 }
1686 
1688 {
1689  ScIconSetFormat* pFormat = mxParent->getCoreObject();
1690  if (pFormat->GetIconSetData()->m_Entries.size() <= mnPos)
1691  throw lang::IllegalArgumentException();
1692 
1693  return pFormat->GetIconSetData()->m_Entries[mnPos].get();
1694 }
1695 
1697 {
1698  ScColorScaleEntry* pEntry = getCoreObject();
1699  // the first entry always is minimum
1700  if (mnPos == 0)
1701  return sheet::IconSetFormatEntry::ICONSET_MIN;
1702 
1703  for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap)
1704  {
1705  if (rEntry.eType == pEntry->GetType())
1706  {
1707  return rEntry.nApiType;
1708  }
1709  }
1710 
1711  throw lang::IllegalArgumentException();
1712 }
1713 
1715 {
1716  // first entry is always MIN
1717  if (mnPos == 0)
1718  return;
1719 
1720  ScColorScaleEntry* pEntry = getCoreObject();
1721  for (IconSetEntryTypeApiMap const & rEntry : aIconSetEntryTypeMap)
1722  {
1723  if (rEntry.nApiType == nType)
1724  {
1725  pEntry->SetType(rEntry.eType);
1726  return;
1727  }
1728  }
1729  throw lang::IllegalArgumentException();
1730 }
1731 
1733 {
1734  ScColorScaleEntry* pEntry = getCoreObject();
1735  switch (pEntry->GetType())
1736  {
1737  case COLORSCALE_FORMULA:
1738  // TODO: Implement
1739  break;
1740  default:
1741  return OUString::number(pEntry->GetValue());
1742  }
1743 
1744  return OUString();
1745 }
1746 
1747 void ScIconSetEntryObj::setFormula(const OUString& rFormula)
1748 {
1749  ScColorScaleEntry* pEntry = getCoreObject();
1750  switch (pEntry->GetType())
1751  {
1752  case COLORSCALE_FORMULA:
1753  // TODO: Implement
1754  // pEntry->SetFormula(rFormula);
1755  break;
1756  default:
1757  pEntry->SetValue(rFormula.toDouble());
1758  break;
1759  }
1760 }
1761 
1763  const ScCondDateFormatEntry* pFormat):
1764  mxParent(xParent),
1765  maPropSet(getCondDatePropSet()),
1766  mpFormat(pFormat)
1767 {
1768 }
1769 
1771 {
1772 }
1773 
1775 {
1776  ScConditionalFormat* pFormat = mxParent->getCoreObject();
1777  if (isObjectStillAlive(pFormat, mpFormat))
1778  return const_cast<ScCondDateFormatEntry*>(mpFormat);
1779 
1780  throw lang::IllegalArgumentException();
1781 }
1782 
1784 {
1786 }
1787 
1788 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCondDateFormatObj::getPropertySetInfo()
1789 {
1790  SolarMutexGuard aGuard;
1791  static uno::Reference<beans::XPropertySetInfo> aRef(
1793  return aRef;
1794 }
1795 
1797  const OUString& aPropertyName, const uno::Any& aValue )
1798 {
1799  SolarMutexGuard aGuard;
1800 
1801  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1802  const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1803  if ( !pEntry )
1804  throw beans::UnknownPropertyException(aPropertyName);
1805 
1806  switch(pEntry->nWID)
1807  {
1808  case Date_StyleName:
1809  {
1810  OUString aStyleName;
1811  if (!(aValue >>= aStyleName))
1812  throw lang::IllegalArgumentException();
1813 
1814  getCoreObject()->SetStyleName(aStyleName);
1815 
1816  }
1817  break;
1818  case DateType:
1819  {
1820  sal_Int32 nApiType = -1;
1821  if (!(aValue >>= nApiType))
1822  throw lang::IllegalArgumentException();
1823 
1824  for (DateTypeApiMap const & rEntry : aDateTypeApiMap)
1825  {
1826  if (rEntry.nApiType == nApiType)
1827  {
1828  getCoreObject()->SetDateType(rEntry.eType);
1829  break;
1830  }
1831  }
1832  }
1833  break;
1834  default:
1835  break;
1836  }
1837 }
1838 
1839 uno::Any SAL_CALL ScCondDateFormatObj::getPropertyValue( const OUString& aPropertyName )
1840 {
1841  SolarMutexGuard aGuard;
1842 
1843  const SfxItemPropertyMap& rPropertyMap = maPropSet.getPropertyMap(); // from derived class
1844  const SfxItemPropertySimpleEntry* pEntry = rPropertyMap.getByName( aPropertyName );
1845  if ( !pEntry )
1846  throw beans::UnknownPropertyException(aPropertyName);
1847 
1848  uno::Any aAny;
1849 
1850  switch(pEntry->nWID)
1851  {
1852  case Date_StyleName:
1853  {
1854  OUString aStyleName = getCoreObject()->GetStyleName();
1855  aAny <<= aStyleName;
1856  }
1857  break;
1858  case DateType:
1859  {
1861  for (DateTypeApiMap const & rEntry : aDateTypeApiMap)
1862  {
1863  if (rEntry.eType == eType)
1864  {
1865  aAny <<= rEntry.nApiType;
1866  break;
1867  }
1868  }
1869  }
1870  break;
1871  default:
1872  SAL_WARN("sc", "unknown property");
1873  }
1874  return aAny;
1875 }
1876 
1877 void SAL_CALL ScCondDateFormatObj::addPropertyChangeListener( const OUString& /* aPropertyName */,
1878  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1879 {
1880  SAL_WARN("sc", "not implemented");
1881 }
1882 
1883 void SAL_CALL ScCondDateFormatObj::removePropertyChangeListener( const OUString& /* aPropertyName */,
1884  const uno::Reference<beans::XPropertyChangeListener>& /* aListener */)
1885 {
1886  SAL_WARN("sc", "not implemented");
1887 }
1888 
1889 void SAL_CALL ScCondDateFormatObj::addVetoableChangeListener( const OUString&,
1890  const uno::Reference<beans::XVetoableChangeListener>&)
1891 {
1892  SAL_WARN("sc", "not implemented");
1893 }
1894 
1896  const uno::Reference<beans::XVetoableChangeListener>&)
1897 {
1898  SAL_WARN("sc", "not implemented");
1899 }
1900 
1901 /* 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:178
void SetOperation(ScConditionMode eMode)
Definition: conditio.cxx:335
virtual void SAL_CALL setFormula(const OUString &rString) override
size_t size() const
Definition: colorscale.cxx:696
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:231
rtl::Reference< ScColorScaleFormatObj > mxParent
virtual sal_Int32 SAL_CALL getType() override
void AddEntry(ScFormatEntry *pNew)
Definition: conditio.cxx:1747
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual ~ScCondDateFormatObj() override
#define ID
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:680
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:339
ScCondFormatEntry * getCoreObject()
void SetFormula1(const ScTokenArray &rArray)
Definition: conditio.cxx:468
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:173
ScColorScaleFormat * getCoreObject()
sal_Int64 n
ScColorScaleEntry * getCoreObject()
const OUString & GetStyle() const
Definition: conditio.hxx:474
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:513
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:183
SC_DLLPUBLIC sal_uLong AddCondFormat(std::unique_ptr< ScConditionalFormat > pNew, SCTAB nTab)
Definition: documen4.cxx:705
Reverse
void SetValue(double nValue)
Definition: colorscale.cxx:251
virtual sal_Int32 SAL_CALL getType() override
virtual sal_Int32 SAL_CALL getCount() override
ScCondFormatDateType
Definition: conditio.hxx:485
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
Definition: document.hxx:985
IconSetProperties
ScConditionEntryObj(rtl::Reference< ScCondFormatObj > const &xParent, const ScCondFormatEntry *pFormat)
ScConditionalFormat * GetFormat(sal_uInt32 nKey)
Definition: conditio.cxx:2069
SfxItemPropertySet maPropSet
ScConditionMode GetOperation() const
Definition: conditio.hxx:370
css::chart::ChartAxisLabelPosition ePos
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
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
SfxItemPropertySet maPropSet
constexpr::Color COL_AUTO(0xFF, 0xFF, 0xFF, 0xFF)
const ScRangeList & GetRange() const
Definition: conditio.hxx:560
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:857
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:311
ScIconSetType eIconSetType
Definition: colorscale.hxx:334
ScColorScaleEntryType GetType() const
Definition: colorscale.hxx:76
ScConditionMode
Definition: conditio.hxx:61
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:1767
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:135
ScAddress GetTopLeftCorner() const
Definition: rangelst.cxx:1157
bool empty() const
Definition: rangelst.hxx:89
Color maAxisColor
Color of the axis if used Default color is black.
Definition: colorscale.hxx:146
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:1741
const ScFormatEntry * GetEntry(sal_uInt16 nPos) const
Definition: conditio.cxx:1781
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:1235
ScDocShell * mpDocShell
SfxItemPropertySet maPropSet
bool mbGradient
Paint the bars with gradient.
Definition: colorscale.hxx:153
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:2253
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:1753
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
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
void SetFormula2(const ScTokenArray &rArray)
Definition: conditio.cxx:480
void UpdateStyleName(const OUString &rNew)
Definition: conditio.hxx:475
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:375
const SfxItemPropertySimpleEntry * getByName(const OUString &rName) const
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:893
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:168
rtl::Reference< ScCondFormatObj > mxParent
void Join(const ScRange &, bool bIsInList=false)
Definition: rangelst.cxx:166
SfxItemPropertySet maPropSet
std::unique_ptr< Color > mpNegativeColor
Specifies the color for negative values.
Definition: colorscale.hxx:141
std::unique_ptr< ScColorScaleEntry, o3tl::default_delete< ScColorScaleEntry > > mpUpperLimit
Definition: colorscale.hxx:185
virtual OUString SAL_CALL getFormula() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
const OUString & GetStyleName() const
Definition: conditio.hxx:515
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:901
void SetDateType(condformat::ScCondFormatDateType eType)
Definition: conditio.cxx:1672
virtual OUString SAL_CALL getFormula() override
ScDataBarFormatObj(rtl::Reference< ScCondFormatObj > const &xParent, const ScDataBarFormat *pFormat)
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:401
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:736
ScCondDateFormatEntry * getCoreObject()
ScIconSetType
Definition: colorscale.hxx:189
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:2263
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:324
sal_Int32 nLength
std::unique_ptr< ScColorScaleEntry, o3tl::default_delete< ScColorScaleEntry > > mpLowerLimit
Definition: colorscale.hxx:186
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:80
bool IsEmpty() const
Definition: conditio.cxx:1762
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:237
void SetStyleName(const OUString &rStyleName)
Definition: conditio.cxx:1677
bool mbNeg
Use different color for negative values.
Definition: colorscale.hxx:160
sal_Int16 SCTAB
Definition: types.hxx:23
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