sc/inc/SparklineGroup.hxx | 7 sc/inc/document.hxx | 7 sc/qa/unit/SparklineImportExportTest.cxx | 4 sc/qa/unit/SparklineTest.cxx | 11 sc/source/core/data/column2.cxx | 7 sc/source/core/data/column4.cxx | 7 sc/source/core/data/document.cxx | 16 sc/source/filter/excel/export/SparklineExt.cxx | 2 sc/source/filter/oox/SparklineFragment.cxx | 5 sc/source/filter/xml/SparklineGroupsExport.cxx | 7 sc/source/filter/xml/SparklineGroupsImportContext.cxx | 4 sc/source/ui/dialogs/SparklineDialog.cxx | 174 ++ sc/source/ui/inc/SparklineDialog.hxx | 18 sc/source/ui/sparklines/SparklineGroup.cxx | 7 sc/uiconfig/scalc/ui/sparklinedialog.ui | 1095 ++++++++++++------ 15 files changed, 990 insertions(+), 381 deletions(-)
New commits: commit fc2930165ac59a0ccb11c18a2dce27a642f63a5c Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Tue Mar 29 09:31:08 2022 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Tue Apr 12 08:23:59 2022 +0200 sc: edit all sparkline attributes in SparklineDialog Change-Id: I6ca9e3436e0dd807b30585576ae2067076c3b7ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132516 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit d97d1f2643d30ebcab149854137cd3c4f46004d2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132848 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sc/source/ui/dialogs/SparklineDialog.cxx b/sc/source/ui/dialogs/SparklineDialog.cxx index ba01a64912c6..59068077b969 100644 --- a/sc/source/ui/dialogs/SparklineDialog.cxx +++ b/sc/source/ui/dialogs/SparklineDialog.cxx @@ -16,6 +16,7 @@ #include <docfunc.hxx> #include <svx/colorbox.hxx> +#include <vcl/formatter.hxx> namespace sc { @@ -56,9 +57,20 @@ SparklineDialog::SparklineDialog(SfxBindings* pBindings, SfxChildWindow* pChildW , mxCheckButtonLow(m_xBuilder->weld_check_button("check-low")) , mxCheckButtonFirst(m_xBuilder->weld_check_button("check-first")) , mxCheckButtonLast(m_xBuilder->weld_check_button("check-last")) + , mxSpinLineWidth(m_xBuilder->weld_spin_button("spin-line-width")) , mxRadioLine(m_xBuilder->weld_radio_button("line-radiobutton")) , mxRadioColumn(m_xBuilder->weld_radio_button("column-radiobutton")) , mxRadioStacked(m_xBuilder->weld_radio_button("stacked-radiobutton")) + , mxCheckDisplayXAxis(m_xBuilder->weld_check_button("check-display-x-axis")) + , mxCheckDisplayHidden(m_xBuilder->weld_check_button("check-display-hidden")) + , mxCheckRightToLeft(m_xBuilder->weld_check_button("check-right-to-left")) + , mxRadioDisplayEmptyGap(m_xBuilder->weld_radio_button("display-empty-radiobutton-gap")) + , mxRadioDisplayEmptyZero(m_xBuilder->weld_radio_button("display-empty-radiobutton-zero")) + , mxRadioDisplayEmptySpan(m_xBuilder->weld_radio_button("display-empty-radiobutton-span")) + , mxComboMinAxisType(m_xBuilder->weld_combo_box("combo-min-axis-type")) + , mxComboMaxAxisType(m_xBuilder->weld_combo_box("combo-max-axis-type")) + , mxSpinCustomMin(m_xBuilder->weld_formatted_spin_button("spin-custom-min")) + , mxSpinCustomMax(m_xBuilder->weld_formatted_spin_button("spin-custom-max")) , mbEditMode(false) { mxInputRangeEdit->SetReferences(this, mxInputRangeLabel.get()); @@ -94,6 +106,9 @@ SparklineDialog::SparklineDialog(SfxBindings* pBindings, SfxChildWindow* pChildW mxRadioLine->connect_toggled(aRadioButtonLink); mxRadioColumn->connect_toggled(aRadioButtonLink); mxRadioStacked->connect_toggled(aRadioButtonLink); + mxRadioDisplayEmptyGap->connect_toggled(aRadioButtonLink); + mxRadioDisplayEmptyZero->connect_toggled(aRadioButtonLink); + mxRadioDisplayEmptySpan->connect_toggled(aRadioButtonLink); Link<weld::Toggleable&, void> aLink = LINK(this, SparklineDialog, ToggleHandler); mxCheckButtonNegative->connect_toggled(aLink); @@ -102,6 +117,26 @@ SparklineDialog::SparklineDialog(SfxBindings* pBindings, SfxChildWindow* pChildW mxCheckButtonLow->connect_toggled(aLink); mxCheckButtonFirst->connect_toggled(aLink); mxCheckButtonLast->connect_toggled(aLink); + mxCheckDisplayXAxis->connect_toggled(aLink); + mxCheckDisplayHidden->connect_toggled(aLink); + mxCheckRightToLeft->connect_toggled(aLink); + + mxSpinLineWidth->connect_value_changed(LINK(this, SparklineDialog, SpinLineWidthChanged)); + + mxComboMinAxisType->connect_changed(LINK(this, SparklineDialog, ComboValueChanged)); + mxComboMaxAxisType->connect_changed(LINK(this, SparklineDialog, ComboValueChanged)); + + mxSpinCustomMin->connect_value_changed(LINK(this, SparklineDialog, SpinCustomChanged)); + Formatter& rSpinCustomMinFormatter = mxSpinCustomMin->GetFormatter(); + rSpinCustomMinFormatter.ClearMinValue(); + rSpinCustomMinFormatter.ClearMaxValue(); + rSpinCustomMinFormatter.UseInputStringForFormatting(); + + mxSpinCustomMax->connect_value_changed(LINK(this, SparklineDialog, SpinCustomChanged)); + Formatter& rSpinCustomMaxFormatter = mxSpinCustomMax->GetFormatter(); + rSpinCustomMaxFormatter.ClearMinValue(); + rSpinCustomMaxFormatter.ClearMaxValue(); + rSpinCustomMaxFormatter.UseInputStringForFormatting(); setupValues(); @@ -145,7 +180,7 @@ void SparklineDialog::setupValues() setInputSelection(); - auto& rAttribute = mpLocalSparklineGroup->getAttributes(); + auto const& rAttribute = mpLocalSparklineGroup->getAttributes(); switch (rAttribute.getType()) { @@ -160,6 +195,19 @@ void SparklineDialog::setupValues() break; } + switch (rAttribute.getDisplayEmptyCellsAs()) + { + case sc::DisplayEmptyCellsAs::Gap: + mxRadioDisplayEmptyGap->set_active(true); + break; + case sc::DisplayEmptyCellsAs::Zero: + mxRadioDisplayEmptyZero->set_active(true); + break; + case sc::DisplayEmptyCellsAs::Span: + mxRadioDisplayEmptySpan->set_active(true); + break; + } + mxColorSeries->SelectEntry(rAttribute.getColorSeries()); mxColorNegative->SelectEntry(rAttribute.getColorNegative()); mxColorMarker->SelectEntry(rAttribute.getColorMarkers()); @@ -174,6 +222,48 @@ void SparklineDialog::setupValues() mxCheckButtonLow->set_active(rAttribute.isLow()); mxCheckButtonFirst->set_active(rAttribute.isFirst()); mxCheckButtonLast->set_active(rAttribute.isLast()); + + mxSpinLineWidth->set_value(sal_Int64(rAttribute.getLineWeight() * 100.0)); + + mxCheckDisplayXAxis->set_active(rAttribute.shouldDisplayXAxis()); + mxCheckDisplayHidden->set_active(rAttribute.shouldDisplayHidden()); + mxCheckRightToLeft->set_active(rAttribute.isRightToLeft()); + + switch (rAttribute.getMinAxisType()) + { + case sc::AxisType::Individual: + mxComboMinAxisType->set_active(0); + mxSpinCustomMin->GetFormatter().SetValue(0.0); + break; + case sc::AxisType::Group: + mxComboMinAxisType->set_active(1); + mxSpinCustomMin->GetFormatter().SetValue(0.0); + break; + case sc::AxisType::Custom: + mxComboMinAxisType->set_active(2); + if (rAttribute.getManualMin()) + mxSpinCustomMin->GetFormatter().SetValue(*rAttribute.getManualMin()); + break; + } + ComboValueChanged(*mxComboMinAxisType); + + switch (rAttribute.getMaxAxisType()) + { + case sc::AxisType::Individual: + mxComboMaxAxisType->set_active(0); + mxSpinCustomMax->GetFormatter().SetValue(0.0); + break; + case sc::AxisType::Group: + mxComboMaxAxisType->set_active(1); + mxSpinCustomMax->GetFormatter().SetValue(0.0); + break; + case sc::AxisType::Custom: + mxComboMaxAxisType->set_active(2); + if (rAttribute.getManualMin()) + mxSpinCustomMax->GetFormatter().SetValue(*rAttribute.getManualMax()); + break; + } + ComboValueChanged(*mxComboMaxAxisType); } void SparklineDialog::Close() { DoClose(sc::SparklineDialogWrapper::GetChildWindowId()); } @@ -329,6 +419,12 @@ IMPL_LINK(SparklineDialog, ToggleHandler, weld::Toggleable&, rToggle, void) rAttribute.setFirst(mxCheckButtonFirst->get_active()); if (mxCheckButtonLast.get() == &rToggle) rAttribute.setLast(mxCheckButtonLast->get_active()); + if (mxCheckDisplayXAxis.get() == &rToggle) + rAttribute.setDisplayXAxis(mxCheckDisplayXAxis->get_active()); + if (mxCheckDisplayHidden.get() == &rToggle) + rAttribute.setDisplayHidden(mxCheckDisplayHidden->get_active()); + if (mxCheckRightToLeft.get() == &rToggle) + rAttribute.setRightToLeft(mxCheckRightToLeft->get_active()); } IMPL_LINK_NOARG(SparklineDialog, SelectSparklineType, weld::Toggleable&, void) @@ -341,6 +437,82 @@ IMPL_LINK_NOARG(SparklineDialog, SelectSparklineType, weld::Toggleable&, void) rAttribute.setType(sc::SparklineType::Column); else if (mxRadioStacked->get_active()) rAttribute.setType(sc::SparklineType::Stacked); + + if (mxRadioDisplayEmptyGap->get_active()) + rAttribute.setDisplayEmptyCellsAs(sc::DisplayEmptyCellsAs::Gap); + else if (mxRadioDisplayEmptyZero->get_active()) + rAttribute.setDisplayEmptyCellsAs(sc::DisplayEmptyCellsAs::Zero); + else if (mxRadioDisplayEmptySpan->get_active()) + rAttribute.setDisplayEmptyCellsAs(sc::DisplayEmptyCellsAs::Span); +} + +IMPL_LINK_NOARG(SparklineDialog, SpinLineWidthChanged, weld::SpinButton&, void) +{ + auto& rAttribute = mpLocalSparklineGroup->getAttributes(); + + double value = mxSpinLineWidth->get_value() / 100.0; + rAttribute.setLineWeight(value); +} + +IMPL_LINK(SparklineDialog, SpinCustomChanged, weld::FormattedSpinButton&, rFormatted, void) +{ + auto& rAttribute = mpLocalSparklineGroup->getAttributes(); + + if (mxSpinCustomMin.get() == &rFormatted) + { + rAttribute.setManualMin(rFormatted.GetFormatter().GetValue()); + } + else if (mxSpinCustomMax.get() == &rFormatted) + { + rAttribute.setManualMax(rFormatted.GetFormatter().GetValue()); + } +} + +IMPL_LINK(SparklineDialog, ComboValueChanged, weld::ComboBox&, rComboBox, void) +{ + auto& rAttribute = mpLocalSparklineGroup->getAttributes(); + int nActive = rComboBox.get_active(); + + if (mxComboMinAxisType.get() == &rComboBox) + { + switch (nActive) + { + case 0: + rAttribute.setMinAxisType(sc::AxisType::Individual); + mxSpinCustomMin->set_sensitive(false); + break; + case 1: + rAttribute.setMinAxisType(sc::AxisType::Group); + mxSpinCustomMin->set_sensitive(false); + break; + case 2: + rAttribute.setMinAxisType(sc::AxisType::Custom); + mxSpinCustomMin->set_sensitive(true); + break; + default: + break; + } + } + else if (mxComboMaxAxisType.get() == &rComboBox) + { + switch (nActive) + { + case 0: + rAttribute.setMaxAxisType(sc::AxisType::Individual); + mxSpinCustomMax->set_sensitive(false); + break; + case 1: + rAttribute.setMaxAxisType(sc::AxisType::Group); + mxSpinCustomMax->set_sensitive(false); + break; + case 2: + rAttribute.setMaxAxisType(sc::AxisType::Custom); + mxSpinCustomMax->set_sensitive(true); + break; + default: + break; + } + } } bool SparklineDialog::checkValidInputOutput() diff --git a/sc/source/ui/inc/SparklineDialog.hxx b/sc/source/ui/inc/SparklineDialog.hxx index 4af25a861df5..ce8b7cf36118 100644 --- a/sc/source/ui/inc/SparklineDialog.hxx +++ b/sc/source/ui/inc/SparklineDialog.hxx @@ -57,10 +57,25 @@ private: std::unique_ptr<weld::CheckButton> mxCheckButtonFirst; std::unique_ptr<weld::CheckButton> mxCheckButtonLast; + std::unique_ptr<weld::SpinButton> mxSpinLineWidth; std::unique_ptr<weld::RadioButton> mxRadioLine; std::unique_ptr<weld::RadioButton> mxRadioColumn; std::unique_ptr<weld::RadioButton> mxRadioStacked; + std::unique_ptr<weld::CheckButton> mxCheckDisplayXAxis; + std::unique_ptr<weld::CheckButton> mxCheckDisplayHidden; + std::unique_ptr<weld::CheckButton> mxCheckRightToLeft; + + std::unique_ptr<weld::RadioButton> mxRadioDisplayEmptyGap; + std::unique_ptr<weld::RadioButton> mxRadioDisplayEmptyZero; + std::unique_ptr<weld::RadioButton> mxRadioDisplayEmptySpan; + + std::unique_ptr<weld::ComboBox> mxComboMinAxisType; + std::unique_ptr<weld::ComboBox> mxComboMaxAxisType; + + std::unique_ptr<weld::FormattedSpinButton> mxSpinCustomMin; + std::unique_ptr<weld::FormattedSpinButton> mxSpinCustomMax; + DECL_LINK(ButtonClicked, weld::Button&, void); DECL_LINK(EditFocusHandler, formula::RefEdit&, void); DECL_LINK(ButtonFocusHandler, formula::RefButton&, void); @@ -69,6 +84,9 @@ private: DECL_LINK(RefInputModifyHandler, formula::RefEdit&, void); DECL_LINK(ToggleHandler, weld::Toggleable&, void); DECL_LINK(SelectSparklineType, weld::Toggleable&, void); + DECL_LINK(ComboValueChanged, weld::ComboBox&, void); + DECL_LINK(SpinLineWidthChanged, weld::SpinButton&, void); + DECL_LINK(SpinCustomChanged, weld::FormattedSpinButton&, void); std::shared_ptr<sc::SparklineGroup> mpLocalSparklineGroup; diff --git a/sc/uiconfig/scalc/ui/sparklinedialog.ui b/sc/uiconfig/scalc/ui/sparklinedialog.ui index f295023877bf..8b3ee15a0ad5 100644 --- a/sc/uiconfig/scalc/ui/sparklinedialog.ui +++ b/sc/uiconfig/scalc/ui/sparklinedialog.ui @@ -2,13 +2,25 @@ <!-- Generated with glade 3.38.2 --> <interface domain="sc"> <requires lib="gtk+" version="3.20"/> + <object class="GtkAdjustment" id="adjustment-custom-max"> + <property name="step-increment">1</property> + <property name="page-increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustment-custom-min"> + <property name="step-increment">1</property> + <property name="page-increment">10</property> + </object> + <object class="GtkAdjustment" id="adjustment-line-width"> + <property name="lower">0.5</property> + <property name="upper">8</property> + <property name="value">1</property> + <property name="step-increment">0.25</property> + <property name="page-increment">1</property> + </object> <object class="GtkDialog" id="SparklineDialog"> <property name="can-focus">False</property> <property name="border-width">6</property> <property name="title" translatable="yes" context="SparklineDialog">Sparkline Dialog</property> - <property name="resizable">False</property> - <property name="default-width">0</property> - <property name="default-height">0</property> <property name="type-hint">dialog</property> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> @@ -214,7 +226,7 @@ <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=6 n-rows=5 --> + <!-- n-columns=1 n-rows=6 --> <object class="GtkGrid"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -225,377 +237,538 @@ <property name="row-spacing">6</property> <property name="column-spacing">6</property> <child> - <object class="GtkLabel" id="label-series"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="SparklineDialog|label-series">Series:</property> - <property name="xalign">0</property> - <accessibility> - <relation type="label-for" target="color-button-series"/> - </accessibility> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label-negative"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes" context="SparklineDialog|label-negative">Negative Points:</property> - <property name="xalign">0</property> - <accessibility> - <relation type="label-for" target="color-button-negative"/> - <relation type="label-for" target="check-negative"/> - </accessibility> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">2</property> - </packing> - </child> - <child> - <object class="GtkMenuButton" id="color-button-series"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="draw-indicator">True</property> + <property name="hexpand">True</property> + <property name="spacing">6</property> <child> - <placeholder/> + <object class="GtkLabel" id="label-type"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-type">Type:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="line-radiobutton"/> + <relation type="label-for" target="column-radiobutton"/> + <relation type="label-for" target="stacked-radiobutton"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-series"/> - </accessibility> - </object> - <packing> - <property name="left-attach">2</property> - <property name="top-attach">1</property> - </packing> - </child> - <child> - <object class="GtkMenuButton" id="color-button-negative"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="draw-indicator">True</property> <child> - <placeholder/> + <object class="GtkRadioButton" id="line-radiobutton"> + <property name="label" translatable="yes" context="SparklineDialog|line-radiobutton">Line</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="hexpand">True</property> + <property name="active">True</property> + <property name="draw-indicator">True</property> + <accessibility> + <relation type="labelled-by" target="label-type"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-negative"/> - </accessibility> - </object> - <packing> - <property name="left-attach">2</property> - <property name="top-attach">2</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="check-negative"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="image-position">right</property> - <property name="always-show-image">True</property> - <property name="draw-indicator">True</property> <child> - <placeholder/> + <object class="GtkRadioButton" id="column-radiobutton"> + <property name="label" translatable="yes" context="SparklineDialog|column-radiobutton">Column</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="hexpand">True</property> + <property name="draw-indicator">True</property> + <property name="group">line-radiobutton</property> + <accessibility> + <relation type="labelled-by" target="label-type"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-negative"/> - </accessibility> - </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">2</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label-low"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="SparklineDialog|label-low">Low Points:</property> - <property name="xalign">0</property> - <accessibility> - <relation type="label-for" target="color-button-low"/> - <relation type="label-for" target="check-low"/> - </accessibility> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">4</property> - </packing> - </child> - <child> - <object class="GtkMenuButton" id="color-button-high"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="draw-indicator">True</property> <child> - <placeholder/> + <object class="GtkRadioButton" id="stacked-radiobutton"> + <property name="label" translatable="yes" context="SparklineDialog|stacked-radiobutton">Stacked</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="hexpand">True</property> + <property name="draw-indicator">True</property> + <property name="group">line-radiobutton</property> + <accessibility> + <relation type="labelled-by" target="label-type"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-high"/> - </accessibility> </object> <packing> - <property name="left-attach">2</property> - <property name="top-attach">3</property> + <property name="left-attach">0</property> + <property name="top-attach">0</property> </packing> </child> <child> - <object class="GtkMenuButton" id="color-button-low"> + <!-- n-columns=6 n-rows=4 --> + <object class="GtkGrid"> <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="draw-indicator">True</property> + <property name="can-focus">False</property> + <property name="hexpand">True</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> <child> - <placeholder/> + <object class="GtkLabel" id="label-series"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-series">Series:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="color-button-series"/> + </accessibility> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + <property name="width">2</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-low"/> - </accessibility> - </object> - <packing> - <property name="left-attach">2</property> - <property name="top-attach">4</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="check-low"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="image-position">right</property> - <property name="always-show-image">True</property> - <property name="draw-indicator">True</property> <child> - <placeholder/> + <object class="GtkMenuButton" id="color-button-series"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="hexpand">False</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-series"/> + </accessibility> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">0</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-low"/> - </accessibility> - </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">4</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label-high"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="SparklineDialog|label-high">High Points:</property> - <property name="xalign">0</property> - <accessibility> - <relation type="label-for" target="color-button-high"/> - <relation type="label-for" target="check-high"/> - </accessibility> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">3</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="check-high"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="image-position">right</property> - <property name="always-show-image">True</property> - <property name="draw-indicator">True</property> <child> - <placeholder/> + <object class="GtkLabel" id="label-negative"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="hexpand">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-negative">Negative Points:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="check-negative"/> + <relation type="label-for" target="color-button-negative"/> + </accessibility> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-high"/> - </accessibility> - </object> - <packing> - <property name="left-attach">1</property> - <property name="top-attach">3</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label-marker"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="SparklineDialog|label-marker">Marker:</property> - <property name="xalign">0</property> - <accessibility> - <relation type="label-for" target="check-marker"/> - <relation type="label-for" target="color-button-marker"/> - </accessibility> - </object> - <packing> - <property name="left-attach">3</property> - <property name="top-attach">2</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="check-marker"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="image-position">right</property> - <property name="always-show-image">True</property> - <property name="draw-indicator">True</property> <child> - <placeholder/> + <object class="GtkLabel" id="label-high"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-high">High Points:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="check-high"/> + <relation type="label-for" target="color-button-high"/> + </accessibility> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">2</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-marker"/> - </accessibility> - </object> - <packing> - <property name="left-attach">4</property> - <property name="top-attach">2</property> - </packing> - </child> - <child> - <object class="GtkMenuButton" id="color-button-marker"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="draw-indicator">True</property> <child> - <placeholder/> + <object class="GtkCheckButton" id="check-negative"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="image-position">right</property> + <property name="always-show-image">True</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-negative"/> + </accessibility> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">1</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-marker"/> - </accessibility> - </object> - <packing> - <property name="left-attach">5</property> - <property name="top-attach">2</property> - </packing> - </child> - <child> - <object class="GtkMenuButton" id="color-button-first"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="draw-indicator">True</property> <child> - <placeholder/> - </child> - <accessibility> - <relation type="labelled-by" target="label-first"/> - </accessibility> - </object> - <packing> - <property name="left-attach">5</property> - <property name="top-attach">3</property> - </packing> - </child> - <child> - <object class="GtkMenuButton" id="color-button-last"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="draw-indicator">True</property> + <object class="GtkCheckButton" id="check-high"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="image-position">right</property> + <property name="always-show-image">True</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-high"/> + </accessibility> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">2</property> + </packing> + </child> <child> - <placeholder/> + <object class="GtkMenuButton" id="color-button-negative"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="hexpand">True</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-negative"/> + </accessibility> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">1</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-last"/> - </accessibility> - </object> - <packing> - <property name="left-attach">5</property> - <property name="top-attach">4</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="check-first"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="image-position">right</property> - <property name="always-show-image">True</property> - <property name="draw-indicator">True</property> <child> - <placeholder/> + <object class="GtkMenuButton" id="color-button-high"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-high"/> + </accessibility> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">2</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-first"/> - </accessibility> - </object> - <packing> - <property name="left-attach">4</property> - <property name="top-attach">3</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="check-last"> - <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="image-position">right</property> - <property name="always-show-image">True</property> - <property name="draw-indicator">True</property> <child> - <placeholder/> + <object class="GtkLabel" id="label-low"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-low">Low Points:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="check-low"/> + <relation type="label-for" target="color-button-low"/> + </accessibility> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">3</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check-low"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="image-position">right</property> + <property name="always-show-image">True</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-low"/> + </accessibility> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">3</property> + </packing> + </child> + <child> + <object class="GtkMenuButton" id="color-button-low"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-low"/> + </accessibility> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">3</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label-last"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-last">Last Points:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="check-last"/> + <relation type="label-for" target="color-button-last"/> + </accessibility> + </object> + <packing> + <property name="left-attach">3</property> + <property name="top-attach">3</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label-first"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-first">First Points:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="check-first"/> + <relation type="label-for" target="color-button-first"/> + </accessibility> + </object> + <packing> + <property name="left-attach">3</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label-marker"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="hexpand">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-marker">Marker:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="check-marker"/> + <relation type="label-for" target="color-button-marker"/> + </accessibility> + </object> + <packing> + <property name="left-attach">3</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check-marker"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="image-position">right</property> + <property name="always-show-image">True</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-marker"/> + </accessibility> + </object> + <packing> + <property name="left-attach">4</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check-first"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="image-position">right</property> + <property name="always-show-image">True</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-first"/> + </accessibility> + </object> + <packing> + <property name="left-attach">4</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check-last"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="image-position">right</property> + <property name="always-show-image">True</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-last"/> + </accessibility> + </object> + <packing> + <property name="left-attach">4</property> + <property name="top-attach">3</property> + </packing> + </child> + <child> + <object class="GtkMenuButton" id="color-button-marker"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="hexpand">True</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-marker"/> + </accessibility> + </object> + <packing> + <property name="left-attach">5</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkMenuButton" id="color-button-first"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-first"/> + </accessibility> + </object> + <packing> + <property name="left-attach">5</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkMenuButton" id="color-button-last"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="draw-indicator">True</property> + <child> + <placeholder/> + </child> + <accessibility> + <relation type="labelled-by" target="label-last"/> + </accessibility> + </object> + <packing> + <property name="left-attach">5</property> + <property name="top-attach">3</property> + </packing> + </child> + <child> + <object class="GtkFixed"> + <property name="visible">True</property> + <property name="can-focus">False</property> + </object> + <packing> + <property name="left-attach">3</property> + <property name="top-attach">0</property> + <property name="width">3</property> + </packing> </child> - <accessibility> - <relation type="labelled-by" target="label-last"/> - </accessibility> - </object> - <packing> - <property name="left-attach">4</property> - <property name="top-attach">4</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label-first"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="SparklineDialog|label-first">First Points:</property> - <property name="xalign">0</property> - <accessibility> - <relation type="label-for" target="color-button-first"/> - <relation type="label-for" target="check-first"/> - </accessibility> - </object> - <packing> - <property name="left-attach">3</property> - <property name="top-attach">3</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label-last"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="SparklineDialog|label-last">Last Points:</property> - <property name="xalign">0</property> - <accessibility> - <relation type="label-for" target="color-button-last"/> - <relation type="label-for" target="check-last"/> - </accessibility> </object> <packing> - <property name="left-attach">3</property> - <property name="top-attach">4</property> + <property name="left-attach">0</property> + <property name="top-attach">1</property> </packing> </child> <child> - <object class="GtkLabel" id="label-type"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes" context="SparklineDialog|label-type">Type:</property> - <property name="xalign">0</property> - <accessibility> - <relation type="label-for" target="line-radiobutton"/> - <relation type="label-for" target="column-radiobutton"/> - <relation type="label-for" target="stacked-radiobutton"/> - </accessibility> + <property name="hexpand">True</property> + <property name="spacing">6</property> + <child> + <object class="GtkCheckButton" id="check-display-x-axis"> + <property name="label" translatable="yes" context="SparklineDialog|check-display-x-axis">Display X Axis</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="image-position">right</property> + <property name="always-show-image">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check-display-hidden"> + <property name="label" translatable="yes" context="SparklineDialog|check-display-hidden">Display Hidden</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="image-position">right</property> + <property name="always-show-image">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="check-right-to-left"> + <property name="label" translatable="yes" context="SparklineDialog|check-right-to-left">Right To Left</property> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="receives-default">False</property> + <property name="image-position">right</property> + <property name="always-show-image">True</property> + <property name="draw-indicator">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> <packing> <property name="left-attach">0</property> - <property name="top-attach">0</property> + <property name="top-attach">3</property> </packing> </child> <child> @@ -604,8 +777,26 @@ <property name="can-focus">False</property> <property name="spacing">6</property> <child> - <object class="GtkRadioButton" id="line-radiobutton"> - <property name="label" translatable="yes" context="SparklineDialog|line-radiobutton">Line</property> + <object class="GtkLabel" id="label-display-empty-cells-as"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-type">Display Empty Cells As:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="display-empty-radiobutton-gap"/> + <relation type="label-for" target="display-empty-radiobutton-zero"/> + <relation type="label-for" target="display-empty-radiobutton-span"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="display-empty-radiobutton-gap"> + <property name="label" translatable="yes" context="SparklineDialog|line-radiobutton">Gap</property> <property name="visible">True</property> <property name="can-focus">True</property> <property name="receives-default">False</property> @@ -613,71 +804,246 @@ <property name="active">True</property> <property name="draw-indicator">True</property> <accessibility> - <relation type="labelled-by" target="label-type"/> + <relation type="labelled-by" target="label-display-empty-cells-as"/> </accessibility> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> <child> - <object class="GtkRadioButton" id="column-radiobutton"> - <property name="label" translatable="yes" context="SparklineDialog|column-radiobutton">Column</property> + <object class="GtkRadioButton" id="display-empty-radiobutton-zero"> + <property name="label" translatable="yes" context="SparklineDialog|line-radiobutton">Zero</property> <property name="visible">True</property> <property name="can-focus">True</property> <property name="receives-default">False</property> <property name="hexpand">True</property> + <property name="active">True</property> <property name="draw-indicator">True</property> - <property name="group">line-radiobutton</property> + <property name="group">display-empty-radiobutton-gap</property> <accessibility> - <relation type="labelled-by" target="label-type"/> + <relation type="labelled-by" target="label-display-empty-cells-as"/> </accessibility> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> <child> - <object class="GtkRadioButton" id="stacked-radiobutton"> - <property name="label" translatable="yes" context="SparklineDialog|stacked-radiobutton">Stacked</property> + <object class="GtkRadioButton" id="display-empty-radiobutton-span"> + <property name="label" translatable="yes" context="SparklineDialog|line-radiobutton">Span</property> <property name="visible">True</property> <property name="can-focus">True</property> <property name="receives-default">False</property> <property name="hexpand">True</property> + <property name="active">True</property> <property name="draw-indicator">True</property> - <property name="group">line-radiobutton</property> + <property name="group">display-empty-radiobutton-gap</property> <accessibility> - <relation type="labelled-by" target="label-type"/> + <relation type="labelled-by" target="label-display-empty-cells-as"/> </accessibility> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">3</property> </packing> </child> </object> <packing> - <property name="left-attach">1</property> - <property name="top-attach">0</property> - <property name="width">5</property> + <property name="left-attach">0</property> + <property name="top-attach">4</property> </packing> </child> <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> + <object class="GtkExpander"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="expanded">True</property> + <property name="label-fill">True</property> + <property name="resize-toplevel">True</property> + <child> + <!-- n-columns=3 n-rows=2 --> + <object class="GtkGrid"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="row-spacing">6</property> + <property name="column-spacing">6</property> + <child> + <object class="GtkLabel" id="label-minimum"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="xpad">12</property> + <property name="label" translatable="yes" context="SparklineDialog|label-series">Minimum Value:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="combo-min-axis-type"/> + <relation type="label-for" target="spin-custom-min"/> + </accessibility> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label-maximum"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="xpad">12</property> + <property name="label" translatable="yes" context="SparklineDialog|label-series">Maximum Value:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="combo-max-axis-type"/> + <relation type="label-for" target="spin-custom-max"/> + </accessibility> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="combo-min-axis-type"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="active">0</property> + <items> + <item id="0" translatable="yes" context="SparklineDialog|combo-min-axis-type_0">Individual</item> + <item id="1" translatable="yes" context="SparklineDialog|combo-min-axis-type_1">Group</item> + <item id="2" translatable="yes" context="SparklineDialog|combo-min-axis-type_2">Custom</item> + </items> + <accessibility> + <relation type="labelled-by" target="label-minimum"/> + </accessibility> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="combo-max-axis-type"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="active">0</property> + <items> + <item id="0" translatable="yes" context="SparklineDialog|combo-max-axis-type_0">Individual</item> + <item id="1" translatable="yes" context="SparklineDialog|combo-max-axis-type_1">Group</item> + <item id="2" translatable="yes" context="SparklineDialog|combo-max-axis-type_2">Custom</item> + </items> + <accessibility> + <relation type="labelled-by" target="label-maximum"/> + </accessibility> + </object> + <packing> + <property name="left-attach">1</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="spin-custom-min"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="activates-default">True</property> + <property name="width-chars">10</property> + <property name="truncate-multiline">True</property> + <property name="adjustment">adjustment-custom-min</property> + <accessibility> + <relation type="labelled-by" target="label-minimum"/> + </accessibility> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="spin-custom-max"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="activates-default">True</property> + <property name="width-chars">10</property> + <property name="truncate-multiline">True</property> + <property name="adjustment">adjustment-custom-max</property> + <accessibility> + <relation type="labelled-by" target="label-maximum"/> + </accessibility> + </object> + <packing> + <property name="left-attach">2</property> + <property name="top-attach">1</property> + </packing> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-vertical-axis">Vertical Axis</property> + </object> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">5</property> + </packing> </child> <child> - <placeholder/> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <child> + <object class="GtkLabel" id="label-line-width"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="label" translatable="yes" context="SparklineDialog|label-line-width">Line Width:</property> + <property name="xalign">0</property> + <accessibility> + <relation type="label-for" target="spin-line-width"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="spin-line-width"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="hexpand">True</property> + <property name="input-purpose">number</property> + <property name="adjustment">adjustment-line-width</property> + <property name="climb-rate">0.25</property> + <property name="digits">2</property> + <property name="snap-to-ticks">True</property> + <property name="numeric">True</property> + <property name="value">1</property> + <accessibility> + <relation type="labelled-by" target="label-line-width"/> + </accessibility> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">2</property> + </packing> </child> </object> </child> @@ -706,4 +1072,19 @@ <action-widget response="-11">help</action-widget> </action-widgets> </object> + <object class="GtkSizeGroup"> + <widgets> + <widget name="cell-range-label"/> + <widget name="output-range-label"/> + <widget name="label-type"/> + <widget name="label-series"/> + <widget name="label-negative"/> + <widget name="label-high"/> + <widget name="label-low"/> + <widget name="label-display-empty-cells-as"/> + <widget name="label-minimum"/> + <widget name="label-maximum"/> + <widget name="label-line-width"/> + </widgets> + </object> </interface> commit df9ecb77ea0623d87155a77394462996744acb98 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Mon Mar 28 22:51:08 2022 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Tue Apr 12 08:23:51 2022 +0200 sc: use GUID for the SparklineGroup ID and use that This adds tools::Guid as the SparklineGroup ID. At import the Guid is parsed by tools::Guid and later it is used to identify the SparklineGroup. This is useful when copying sparklines so we can preserve to which group it belongs, when that is desired. Change-Id: I4f2b560d5ea74552e8add57bb05469be57cf4a69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132515 Tested-by: Tomaž Vajngerl <qui...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 5ff13a0866fe5c408f9e9c7441a9d052b383d99c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132847 diff --git a/sc/inc/SparklineGroup.hxx b/sc/inc/SparklineGroup.hxx index 5a3bda62b6ab..c5e917f059f3 100644 --- a/sc/inc/SparklineGroup.hxx +++ b/sc/inc/SparklineGroup.hxx @@ -13,6 +13,7 @@ #include "scdllapi.h" #include "SparklineAttributes.hxx" #include <tools/color.hxx> +#include <tools/Guid.hxx> #include <optional> namespace sc @@ -22,15 +23,15 @@ class SC_DLLPUBLIC SparklineGroup { private: SparklineAttributes m_aAttributes; - OUString m_sUID; + tools::Guid m_aGUID; public: SparklineAttributes& getAttributes() { return m_aAttributes; } SparklineAttributes const& getAttributes() const { return m_aAttributes; } - OUString getID() { return m_sUID; } + tools::Guid& getID() { return m_aGUID; } - void setID(OUString const& rID) { m_sUID = rID; } + void setID(tools::Guid const& rGuid) { m_aGUID = rGuid; } SparklineGroup(); SparklineGroup(SparklineGroup const& pOtherSparkline); diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 23ffc1e9ec9c..6653d34358c5 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -67,12 +67,12 @@ enum class EEHorizontalTextDirection; namespace editeng { class SvxBorderLine; } namespace formula { struct VectorRefArray; } namespace svl { - class SharedString; class SharedStringPool; - } +namespace tools { class Guid; } + namespace sc { struct FormulaGroupContext; @@ -206,6 +206,7 @@ typedef o3tl::sorted_vector<sal_uInt32> ScCondFormatIndexes; struct ScSheetLimits; struct ScDataAreaExtras; + namespace sc { typedef std::map<OUString, BitmapEx> IconSetBitmapMap; @@ -1247,6 +1248,8 @@ public: SC_DLLPUBLIC sc::SparklineList* GetSparklineList(SCTAB nTab); SC_DLLPUBLIC bool DeleteSparkline(ScAddress const& rPosition); SC_DLLPUBLIC bool HasOneSparklineGroup(ScRange const& rRange); + SC_DLLPUBLIC std::shared_ptr<sc::SparklineGroup> SearchSparklineGroup(tools::Guid const& rGuid); + /** Notes **/ SC_DLLPUBLIC ScPostIt* GetNote(const ScAddress& rPos); SC_DLLPUBLIC ScPostIt* GetNote(SCCOL nCol, SCROW nRow, SCTAB nTab); diff --git a/sc/qa/unit/SparklineImportExportTest.cxx b/sc/qa/unit/SparklineImportExportTest.cxx index 6da76fb2dcfb..7060a120c49a 100644 --- a/sc/qa/unit/SparklineImportExportTest.cxx +++ b/sc/qa/unit/SparklineImportExportTest.cxx @@ -69,8 +69,8 @@ void checkSparklines(ScDocument& rDocument) { auto pSparkline = rDocument.GetSparkline(ScAddress(0, 1, 0)); // A2 CPPUNIT_ASSERT(pSparkline); - CPPUNIT_ASSERT_EQUAL(OUString("{1C5C5DE0-3C09-4CB3-A3EC-9E763301EC82}"), - pSparkline->getSparklineGroup()->getID()); + CPPUNIT_ASSERT_EQUAL(OString("{1C5C5DE0-3C09-4CB3-A3EC-9E763301EC82}"), + pSparkline->getSparklineGroup()->getID().getString()); auto& rAttributes = pSparkline->getSparklineGroup()->getAttributes(); CPPUNIT_ASSERT_EQUAL(sc::SparklineType::Line, rAttributes.getType()); diff --git a/sc/qa/unit/SparklineTest.cxx b/sc/qa/unit/SparklineTest.cxx index ac9c0996ac59..6e203131e9c5 100644 --- a/sc/qa/unit/SparklineTest.cxx +++ b/sc/qa/unit/SparklineTest.cxx @@ -153,6 +153,7 @@ void SparklineTest::testCopyPasteSparkline() ScRange aSourceRange(0, 6, 0, 0, 6, 0); auto pSparkline = rDocument.GetSparkline(aSourceRange.aStart); + auto const& pOriginalGroup = pSparkline->getSparklineGroup(); CPPUNIT_ASSERT(pSparkline); CPPUNIT_ASSERT_EQUAL(SCCOL(0), pSparkline->getColumn()); @@ -177,6 +178,11 @@ void SparklineTest::testCopyPasteSparkline() CPPUNIT_ASSERT_EQUAL(SCCOL(0), pSparklineCopy->getColumn()); CPPUNIT_ASSERT_EQUAL(SCROW(7), pSparklineCopy->getRow()); + + auto const& pCopyGroup = pSparklineCopy->getSparklineGroup(); + + CPPUNIT_ASSERT_EQUAL(pOriginalGroup->getID(), pCopyGroup->getID()); + CPPUNIT_ASSERT_EQUAL(pOriginalGroup.get(), pCopyGroup.get()); } // Copy / Paste with a ClipDoc @@ -198,6 +204,11 @@ void SparklineTest::testCopyPasteSparkline() CPPUNIT_ASSERT_EQUAL(SCCOL(0), pSparklineCopy->getColumn()); CPPUNIT_ASSERT_EQUAL(SCROW(8), pSparklineCopy->getRow()); + + auto const& pCopyGroup = pSparklineCopy->getSparklineGroup(); + + CPPUNIT_ASSERT_EQUAL(pOriginalGroup->getID(), pCopyGroup->getID()); + CPPUNIT_ASSERT_EQUAL(pOriginalGroup.get(), pCopyGroup.get()); } xDocSh->DoClose(); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index a99bb4260cc7..2bde1b82a8bc 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -2037,9 +2037,10 @@ public: auto const& pSparkline = pCell->getSparkline(); auto const& pGroup = pCell->getSparklineGroup(); - auto pNewSparklineGroup = std::make_shared<sc::SparklineGroup>(*pGroup); // Copy the group - auto pNewSparkline = std::make_shared<sc::Sparkline>(mrDestColumn.GetCol(), nDestRow, pNewSparklineGroup); - + auto pDestinationGroup = mrDestColumn.GetDoc().SearchSparklineGroup(pGroup->getID()); + if (!pDestinationGroup) + pDestinationGroup = std::make_shared<sc::SparklineGroup>(*pGroup); // Copy the group + auto pNewSparkline = std::make_shared<sc::Sparkline>(mrDestColumn.GetCol(), nDestRow, pDestinationGroup); pNewSparkline->setInputRange(pSparkline->getInputRange()); miDestPosition = mrDestSparkline.set(miDestPosition, nDestRow, new sc::SparklineCell(pNewSparkline)); diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index c2dc4a63085b..455e4b96d33d 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -375,12 +375,15 @@ void ScColumn::duplicateSparkline(sc::CopyFromClipContext& rContext, sc::ColumnB { auto const& pSparklineGroup = pSparkline->getSparklineGroup(); + auto pDuplicatedGroup = GetDoc().SearchSparklineGroup(pSparklineGroup->getID()); + if (!pDuplicatedGroup) + pDuplicatedGroup = std::make_shared<sc::SparklineGroup>(*pSparklineGroup); + std::vector<sc::SparklineCell*> aSparklines(nDestSize, nullptr); ScAddress aCurrentPosition = aDestPosition; for (size_t i = 0; i < nDestSize; ++i) { - auto pNewSparklineGroup = std::make_shared<sc::SparklineGroup>(*pSparklineGroup); - auto pNewSparkline = std::make_shared<sc::Sparkline>(aCurrentPosition.Col(), aCurrentPosition.Row(), pNewSparklineGroup); + auto pNewSparkline = std::make_shared<sc::Sparkline>(aCurrentPosition.Col(), aCurrentPosition.Row(), pDuplicatedGroup); pNewSparkline->setInputRange(pSparkline->getInputRange()); aSparklines[i] = new sc::SparklineCell(pNewSparkline); aCurrentPosition.IncRow(); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 7d856c394dd4..036c76062d94 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -86,6 +86,7 @@ #include <tokenstringcontext.hxx> #include <compressedarray.hxx> #include <recursionhelper.hxx> +#include <SparklineGroup.hxx> #include <formula/vectortoken.hxx> @@ -6634,6 +6635,21 @@ bool ScDocument::HasOneSparklineGroup(ScRange const& rRange) return true; } +std::shared_ptr<sc::SparklineGroup> ScDocument::SearchSparklineGroup(tools::Guid const& rGuid) +{ + for (auto const& rTable : maTabs) + { + for (auto const& pSparkline : rTable->GetSparklineList().getSparklines()) + { + auto const& pGroup = pSparkline->getSparklineGroup(); + if (pGroup->getID() == rGuid) + return pGroup; + } + } + + return std::shared_ptr<sc::SparklineGroup>(); +} + // Notes ScPostIt* ScDocument::GetNote(const ScAddress& rPos) diff --git a/sc/source/filter/excel/export/SparklineExt.cxx b/sc/source/filter/excel/export/SparklineExt.cxx index 549365dcb003..b4614dd59ea3 100644 --- a/sc/source/filter/excel/export/SparklineExt.cxx +++ b/sc/source/filter/excel/export/SparklineExt.cxx @@ -189,7 +189,7 @@ void SparklineExt::addSparklineGroup(XclExpXmlStream& rStream, sc::SparklineGrou auto pAttrList = sax_fastparser::FastSerializerHelper::createAttrList(); // Write ID - OString sUID = OUStringToOString(rSparklineGroup.getID(), RTL_TEXTENCODING_UTF8); + OString sUID = rSparklineGroup.getID().getString(); pAttrList->addNS(XML_xr2, XML_uid, sUID); // Write attributes diff --git a/sc/source/filter/oox/SparklineFragment.cxx b/sc/source/filter/oox/SparklineFragment.cxx index 94fefc37949f..bb341d4a88bc 100644 --- a/sc/source/filter/oox/SparklineFragment.cxx +++ b/sc/source/filter/oox/SparklineFragment.cxx @@ -173,8 +173,9 @@ ContextHandlerRef SparklineGroupsContext::onCreateContext(sal_Int32 nElement, auto& rLastGroup = m_aSparklineGroups.emplace_back(); auto& rSparklineAttributes = rLastGroup.getSparklineGroup()->getAttributes(); addAttributesToSparklineAttributes(rSparklineAttributes, rAttribs); - OUString sUID = rAttribs.getString(XR2_TOKEN(uid), OUString()); - rLastGroup.getSparklineGroup()->setID(sUID); + OUString sGUID = rAttribs.getString(XR2_TOKEN(uid), OUString()); + tools::Guid aGuid(OUStringToOString(sGUID, RTL_TEXTENCODING_ASCII_US)); + rLastGroup.getSparklineGroup()->setID(aGuid); return this; } case XLS14_TOKEN(colorSeries): diff --git a/sc/source/filter/xml/SparklineGroupsExport.cxx b/sc/source/filter/xml/SparklineGroupsExport.cxx index 6be8a616a423..4de56fcfaf58 100644 --- a/sc/source/filter/xml/SparklineGroupsExport.cxx +++ b/sc/source/filter/xml/SparklineGroupsExport.cxx @@ -187,11 +187,8 @@ void SparklineGroupsExport::addSparklineGroup(SparklineGroup* pSparklineGroup) { auto const& rAttributes = pSparklineGroup->getAttributes(); - OUString sID = pSparklineGroup->getID(); - if (!sID.isEmpty()) - { - m_rExport.AddAttribute(XML_NAMESPACE_CALC_EXT, XML_ID, sID); - } + OUString sID = pSparklineGroup->getID().getOUString(); + m_rExport.AddAttribute(XML_NAMESPACE_CALC_EXT, XML_ID, sID); addSparklineGroupAttributes(rAttributes); diff --git a/sc/source/filter/xml/SparklineGroupsImportContext.cxx b/sc/source/filter/xml/SparklineGroupsImportContext.cxx index 87acbd047cf9..5720ca8f3382 100644 --- a/sc/source/filter/xml/SparklineGroupsImportContext.cxx +++ b/sc/source/filter/xml/SparklineGroupsImportContext.cxx @@ -70,7 +70,9 @@ void SparklineGroupsImportContext::fillSparklineGroupID( { case XML_ELEMENT(CALC_EXT, XML_ID): { - m_pCurrentSparklineGroup->setID(rIter.toString()); + OString aString = OUStringToOString(rIter.toString(), RTL_TEXTENCODING_ASCII_US); + tools::Guid aGuid(aString); + m_pCurrentSparklineGroup->setID(aGuid); break; } } diff --git a/sc/source/ui/sparklines/SparklineGroup.cxx b/sc/source/ui/sparklines/SparklineGroup.cxx index 55f52ff4665f..9ef2c7044ab0 100644 --- a/sc/source/ui/sparklines/SparklineGroup.cxx +++ b/sc/source/ui/sparklines/SparklineGroup.cxx @@ -12,11 +12,14 @@ namespace sc { -SparklineGroup::SparklineGroup() {} +SparklineGroup::SparklineGroup() + : m_aGUID(tools::Guid::Generate) +{ +} SparklineGroup::SparklineGroup(SparklineGroup const& pOtherSparkline) : m_aAttributes(pOtherSparkline.m_aAttributes) - , m_sUID(pOtherSparkline.m_sUID) + , m_aGUID(pOtherSparkline.m_aGUID) { }