Kaydet (Commit) 19b2ed4d authored tarafından Markus Mohrhard's avatar Markus Mohrhard

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: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst c32a4c2f
......@@ -53,6 +53,7 @@ SchOptionTabPage::SchOptionTabPage(TabPageParent pWindow,const SfxItemSet& rInAt
, m_xRB_AssumeZero(m_xBuilder->weld_radio_button("RB_ASSUME_ZERO"))
, m_xRB_ContinueLine(m_xBuilder->weld_radio_button("RB_CONTINUE_LINE"))
, m_xCBIncludeHiddenCells(m_xBuilder->weld_check_button("CB_INCLUDE_HIDDEN_CELLS"))
, m_xCBHideLegendEntry(m_xBuilder->weld_check_button("CB_LEGEND_ENTRY_HIDDEN"))
{
m_xRbtAxis1->connect_toggled(LINK(this, SchOptionTabPage, EnableHdl));
m_xRbtAxis2->connect_toggled(LINK(this, SchOptionTabPage, EnableHdl));
......@@ -108,6 +109,9 @@ bool SchOptionTabPage::FillItemSet(SfxItemSet* rOutAttrs)
if (m_xCBIncludeHiddenCells->get_visible())
rOutAttrs->Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_xCBIncludeHiddenCells->get_active()));
if(m_xCBHideLegendEntry->get_visible())
rOutAttrs->Put(SfxBoolItem(SCHATTR_HIDE_LEGEND_ENTRY, m_xCBHideLegendEntry->get_active()));
return true;
}
......@@ -215,6 +219,12 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
m_xGrpPlotOptions->show(false);
}
if (rInAttrs->GetItemState(SCHATTR_HIDE_LEGEND_ENTRY, true, &pPoolItem) == SfxItemState::SET)
{
bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
m_xCBHideLegendEntry->set_active(bVal);
}
AdaptControlPositionsAndVisibility();
}
......
......@@ -70,6 +70,7 @@ private: //member
std::unique_ptr<weld::RadioButton> m_xRB_AssumeZero;
std::unique_ptr<weld::RadioButton> m_xRB_ContinueLine;
std::unique_ptr<weld::CheckButton> m_xCBIncludeHiddenCells;
std::unique_ptr<weld::CheckButton> m_xCBHideLegendEntry;
};
} //namespace chart
......
......@@ -74,6 +74,8 @@ private:
bool m_bSupportingPlottingOfHiddenCells;
bool m_bIncludeHiddenCells;
bool m_bHideLegendEntry;
};
} // namespace wrapper
......
......@@ -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[] =
{
......
......@@ -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;
}
......
......@@ -152,8 +152,9 @@
#define SCHATTR_MISSING_VALUE_TREATMENT TypedWhichId<SfxInt32Item>(SCHATTR_CHARTTYPE_START + 9)
#define SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS TypedWhichId<SfxIntegerListItem>(SCHATTR_CHARTTYPE_START + 10)
#define SCHATTR_INCLUDE_HIDDEN_CELLS TypedWhichId<SfxBoolItem>(SCHATTR_CHARTTYPE_START + 11)
#define SCHATTR_HIDE_LEGEND_ENTRY TypedWhichId<SfxBoolItem>(SCHATTR_CHARTTYPE_START + 12)
#define SCHATTR_CHARTTYPE_END SCHATTR_INCLUDE_HIDDEN_CELLS
#define SCHATTR_CHARTTYPE_END SCHATTR_HIDE_LEGEND_ENTRY
// items for transporting information to dialogs
#define SCHATTR_MISC_START (SCHATTR_CHARTTYPE_END + 1)
......
......@@ -143,6 +143,7 @@ ChartItemPool::ChartItemPool():
rPoolDefaults[SCHATTR_MISSING_VALUE_TREATMENT - SCHATTR_START] = new SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT, 0);
rPoolDefaults[SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, std::vector < sal_Int32 >() );
rPoolDefaults[SCHATTR_INCLUDE_HIDDEN_CELLS - SCHATTR_START] = new SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, true);
rPoolDefaults[SCHATTR_HIDE_LEGEND_ENTRY - SCHATTR_START] = new SfxBoolItem(SCHATTR_HIDE_LEGEND_ENTRY, false);
rPoolDefaults[SCHATTR_AXIS_FOR_ALL_SERIES - SCHATTR_START] = new SfxInt32Item(SCHATTR_AXIS_FOR_ALL_SERIES, 0);
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<!-- Generated with glade 3.20.4 -->
<interface domain="chart">
<requires lib="gtk+" version="3.18"/>
<object class="GtkAdjustment" id="adjustmentGAP">
......@@ -363,5 +363,56 @@
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkFrame" id="frameLegend">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="CB_LEGEND_ENTRY_HIDDEN">
<property name="label" translatable="yes" context="tp_SeriesToAxis|CB_LEGEND_ENTRY_HIDDEN">Hide legend entry</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes" context="tp_SeriesToAxis|label4">Legend Entry</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment