diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-12-05 04:34:39 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-12-05 15:43:42 +0100 |
commit | 19b2ed4dee1ec33ad55473d43bfcd0bfa194cbee (patch) | |
tree | 84652611e1378794544ce26d653ba3c4f3a33f27 /chart2/source/controller/itemsetwrapper | |
parent | c32a4c2fac32b766a05473d037d73cbcd972dadd (diff) |
related tdf#51671, add UI options for new "hide legend entry" feature
Change-Id: I4a9025e317dbd93fb45e676f266c555c72f4d18b
Reviewed-on: https://gerrit.libreoffice.org/64614
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'chart2/source/controller/itemsetwrapper')
-rw-r--r-- | chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx | 3 | ||||
-rw-r--r-- | chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx index b8c85f61c046..e7c0fca9b855 100644 --- a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx +++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx @@ -130,7 +130,8 @@ const sal_uInt16 nTextLabelWhichPairs[] = SCHATTR_CLOCKWISE,SCHATTR_CLOCKWISE, \ SCHATTR_MISSING_VALUE_TREATMENT,SCHATTR_MISSING_VALUE_TREATMENT, \ SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, \ - SCHATTR_INCLUDE_HIDDEN_CELLS,SCHATTR_INCLUDE_HIDDEN_CELLS + SCHATTR_INCLUDE_HIDDEN_CELLS,SCHATTR_INCLUDE_HIDDEN_CELLS, \ + SCHATTR_HIDE_LEGEND_ENTRY,SCHATTR_HIDE_LEGEND_ENTRY const sal_uInt16 nSeriesOptionsWhichPairs[] = { diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index 7b98478e75b2..b289a16423ae 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -74,6 +74,7 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( , m_nMissingValueTreatment(0) , m_bSupportingPlottingOfHiddenCells(false) , m_bIncludeHiddenCells(true) + , m_bHideLegendEntry(false) { try { @@ -156,6 +157,8 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter( { } } + + m_bHideLegendEntry = !xPropertySet->getPropertyValue("ShowLegendEntry").get<bool>(); } catch( const uno::Exception & ) { @@ -351,6 +354,15 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf } } break; + case SCHATTR_HIDE_LEGEND_ENTRY: + { + bool bHideLegendEntry = static_cast<const SfxBoolItem &>(rItemSet.Get(nWhichId)).GetValue(); + if (bHideLegendEntry != m_bHideLegendEntry) + { + GetPropertySet()->setPropertyValue("ShowLegendEntry", css::uno::makeAny(!bHideLegendEntry)); + } + } + break; } return bChanged; } @@ -422,6 +434,11 @@ void SeriesOptionsItemConverter::FillSpecialItem( rOutItemSet.Put( SfxBoolItem(nWhichId, m_bIncludeHiddenCells) ); break; } + case SCHATTR_HIDE_LEGEND_ENTRY: + { + rOutItemSet.Put(SfxBoolItem(nWhichId, m_bHideLegendEntry)); + break; + } default: break; } |