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