diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-17 10:32:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-17 22:06:55 +0100 |
commit | 83057749a921286add0b7e588f67cd3522125665 (patch) | |
tree | 44196c674bedaa29fbe08642339db6f606ea0925 /chart2 | |
parent | df24517ed069092ee34eba77d045cb68b51530b0 (diff) |
Resolves: tdf#130045 dial control frame not hidden along with the control
Change-Id: Idcdf3d748849fbe1ba1a6cce278373e349ba1e5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86967
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/dialogs/res_DataLabel.cxx | 15 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/res_DataLabel.hxx | 5 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_AxisLabel.cxx | 22 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_AxisLabel.hxx | 4 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_PolarOptions.cxx | 12 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_PolarOptions.hxx | 4 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_TitleRotation.cxx | 20 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_TitleRotation.hxx | 4 | ||||
-rw-r--r-- | chart2/uiconfig/ui/dlg_DataLabel.ui | 2 | ||||
-rw-r--r-- | chart2/uiconfig/ui/titlerotationtabpage.ui | 2 | ||||
-rw-r--r-- | chart2/uiconfig/ui/tp_DataLabel.ui | 2 | ||||
-rw-r--r-- | chart2/uiconfig/ui/tp_PolarOptions.ui | 2 | ||||
-rw-r--r-- | chart2/uiconfig/ui/tp_axisLabel.ui | 2 |
13 files changed, 51 insertions, 45 deletions
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx index 69ed9f478746..9c5e4617f662 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.cxx +++ b/chart2/source/controller/dialogs/res_DataLabel.cxx @@ -109,9 +109,10 @@ DataLabelResources::DataLabelResources(weld::Builder* pBuilder, weld::Window* pP , m_xNF_Degrees(pBuilder->weld_metric_spin_button("NF_LABEL_DEGREES", FieldUnit::DEGREE)) , m_xBxTextDirection(pBuilder->weld_widget("boxTXT_DIRECTION")) , m_xLB_TextDirection(new TextDirectionListBox(pBuilder->weld_combo_box("LB_LABEL_TEXTDIR"))) - , m_xDC_Dial(new weld::CustomWeld(*pBuilder, "CT_DIAL", m_aDC_Dial)) + , m_xDC_Dial(new svx::DialControl(pBuilder->weld_scrolled_window("anglepreview"))) + , m_xDC_DialWin(new weld::CustomWeld(*pBuilder, "CT_DIAL", *m_xDC_Dial)) { - m_aDC_Dial.SetText(m_xFT_Dial->get_label()); + m_xDC_Dial->SetText(m_xFT_Dial->get_label()); //fill label placement list std::map< sal_Int32, OUString > aPlacementToStringMap; @@ -153,7 +154,7 @@ DataLabelResources::DataLabelResources(weld::Builder* pBuilder, weld::Window* pP m_xCBPercent->set_sensitive(false); } - m_aDC_Dial.SetLinkedField(m_xNF_Degrees.get()); + m_xDC_Dial->SetLinkedField(m_xNF_Degrees.get()); } DataLabelResources::~DataLabelResources() @@ -293,9 +294,9 @@ void DataLabelResources::FillItemSet( SfxItemSet* rOutAttrs ) const if (m_xLB_TextDirection->get_active() != -1) rOutAttrs->Put( SvxFrameDirectionItem( m_xLB_TextDirection->get_active_id(), EE_PARA_WRITINGDIR ) ); - if( m_aDC_Dial.IsVisible() ) + if( m_xDC_Dial->IsVisible() ) { - sal_Int32 nDegrees = m_aDC_Dial.GetRotation(); + sal_Int32 nDegrees = m_xDC_Dial->GetRotation(); rOutAttrs->Put(SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) ); } } @@ -345,10 +346,10 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs) if( rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, true, &pPoolItem ) == SfxItemState::SET ) { sal_Int32 nDegrees = static_cast< const SfxInt32Item * >( pPoolItem )->GetValue(); - m_aDC_Dial.SetRotation( nDegrees ); + m_xDC_Dial->SetRotation( nDegrees ); } else - m_aDC_Dial.SetRotation( 0 ); + m_xDC_Dial->SetRotation( 0 ); EnableControls(); } diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx index 42f5a9f24e4e..d21856cb4606 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.hxx +++ b/chart2/source/controller/dialogs/res_DataLabel.hxx @@ -59,8 +59,6 @@ private: weld::Window* m_pWindow; SfxItemPool* m_pPool; - svx::DialControl m_aDC_Dial; - std::unique_ptr<weld::CheckButton> m_xCBNumber; std::unique_ptr<weld::Button> m_xPB_NumberFormatForValue; std::unique_ptr<weld::CheckButton> m_xCBPercent; @@ -83,7 +81,8 @@ private: std::unique_ptr<weld::Widget> m_xBxTextDirection; std::unique_ptr<TextDirectionListBox> m_xLB_TextDirection; - std::unique_ptr<weld::CustomWeld> m_xDC_Dial; + std::unique_ptr<svx::DialControl> m_xDC_Dial; + std::unique_ptr<weld::CustomWeld> m_xDC_DialWin; DECL_LINK(NumberFormatDialogHdl, weld::Button&, void ); DECL_LINK(CheckHdl, weld::ToggleButton&, void ); diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx index 82617b346fd2..36ec56178a07 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx +++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx @@ -54,11 +54,12 @@ SchAxisLabelTabPage::SchAxisLabelTabPage(weld::Container* pPage, weld::DialogCon , m_xCbStacked(m_xBuilder->weld_check_button("stackedCB")) , m_xFtTextDirection(m_xBuilder->weld_label("textdirL")) , m_xLbTextDirection(new TextDirectionListBox(m_xBuilder->weld_combo_box("textdirLB"))) - , m_xCtrlDial(new weld::CustomWeld(*m_xBuilder, "dialCtrl", m_aCtrlDial)) + , m_xCtrlDial(new svx::DialControl(m_xBuilder->weld_scrolled_window("anglepreview"))) + , m_xCtrlDialWin(new weld::CustomWeld(*m_xBuilder, "dialCtrl", *m_xCtrlDial)) { - m_aCtrlDial.SetText(m_xFtABCD->get_label()); - m_aCtrlDial.SetLinkedField(m_xNfRotate.get()); - m_xCtrlDial->set_sensitive(true); + m_xCtrlDial->SetText(m_xFtABCD->get_label()); + m_xCtrlDial->SetLinkedField(m_xNfRotate.get()); + m_xCtrlDialWin->set_sensitive(true); m_xNfRotate->set_sensitive(true); m_xCbStacked->set_sensitive(true); m_xFtRotate->set_sensitive(true); @@ -69,6 +70,7 @@ SchAxisLabelTabPage::SchAxisLabelTabPage(weld::Container* pPage, weld::DialogCon SchAxisLabelTabPage::~SchAxisLabelTabPage() { + m_xCtrlDialWin.reset(); m_xCtrlDial.reset(); m_xLbTextDirection.reset(); } @@ -88,9 +90,9 @@ bool SchAxisLabelTabPage::FillItemSet( SfxItemSet* rOutAttrs ) rOutAttrs->Put( SfxBoolItem( SCHATTR_TEXT_STACKED, bStacked ) ); } - if( m_aCtrlDial.HasRotation() ) + if( m_xCtrlDial->HasRotation() ) { - sal_Int32 nDegrees = bStacked ? 0 : m_aCtrlDial.GetRotation(); + sal_Int32 nDegrees = bStacked ? 0 : m_xCtrlDial->GetRotation(); if( !m_bHasInitialDegrees || (nDegrees != m_nInitialDegrees) ) rOutAttrs->Put( SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) ); } @@ -159,9 +161,9 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs ) m_bHasInitialDegrees = aState != SfxItemState::DONTCARE; if( m_bHasInitialDegrees ) - m_aCtrlDial.SetRotation( m_nInitialDegrees ); + m_xCtrlDial->SetRotation( m_nInitialDegrees ); else - m_aCtrlDial.SetNoRotation(); + m_xCtrlDial->SetNoRotation(); // check stacked item m_bInitialStacking = false; @@ -271,8 +273,8 @@ IMPL_LINK_NOARG(SchAxisLabelTabPage, StackedToggleHdl, weld::ToggleButton&, void { bool bActive = m_xCbStacked->get_active() && m_xCbStacked->get_sensitive(); m_xNfRotate->set_sensitive(!bActive); - m_xCtrlDial->set_sensitive(!bActive); - m_aCtrlDial.StyleUpdated(); + m_xCtrlDialWin->set_sensitive(!bActive); + m_xCtrlDial->StyleUpdated(); m_xFtRotate->set_sensitive(!bActive); } diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.hxx b/chart2/source/controller/dialogs/tp_AxisLabel.hxx index d654d7df6e40..0e7b9a097178 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.hxx +++ b/chart2/source/controller/dialogs/tp_AxisLabel.hxx @@ -46,7 +46,6 @@ private: bool m_bHasInitialStacking; /// false = checkbox in tristate bool m_bComplexCategories; - svx::DialControl m_aCtrlDial; std::unique_ptr<weld::CheckButton> m_xCbShowDescription; std::unique_ptr<weld::Label> m_xFlOrder; std::unique_ptr<weld::RadioButton> m_xRbSideBySide; @@ -63,7 +62,8 @@ private: std::unique_ptr<weld::CheckButton> m_xCbStacked; std::unique_ptr<weld::Label> m_xFtTextDirection; std::unique_ptr<TextDirectionListBox> m_xLbTextDirection; - std::unique_ptr<weld::CustomWeld> m_xCtrlDial; + std::unique_ptr<svx::DialControl> m_xCtrlDial; + std::unique_ptr<weld::CustomWeld> m_xCtrlDialWin; DECL_LINK(StackedToggleHdl, weld::ToggleButton&, void); DECL_LINK(ToggleShowLabel, weld::ToggleButton&, void); diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx index c4da9b16f2aa..f94536c2db35 100644 --- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx +++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx @@ -33,13 +33,15 @@ PolarOptionsTabPage::PolarOptionsTabPage(weld::Container* pPage, weld::DialogCon , m_xNF_StartingAngle(m_xBuilder->weld_metric_spin_button("NF_STARTING_ANGLE", FieldUnit::DEGREE)) , m_xFL_PlotOptions(m_xBuilder->weld_frame("framePLOT_OPTIONS")) , m_xCB_IncludeHiddenCells(m_xBuilder->weld_check_button("CB_INCLUDE_HIDDEN_CELLS_POLAR")) - , m_xAngleDial(new weld::CustomWeld(*m_xBuilder, "CT_ANGLE_DIAL", m_aAngleDial)) + , m_xAngleDial(new svx::DialControl(m_xBuilder->weld_scrolled_window("anglepreview"))) + , m_xAngleDialWin(new weld::CustomWeld(*m_xBuilder, "CT_ANGLE_DIAL", *m_xAngleDial)) { - m_aAngleDial.SetLinkedField(m_xNF_StartingAngle.get()); + m_xAngleDial->SetLinkedField(m_xNF_StartingAngle.get()); } PolarOptionsTabPage::~PolarOptionsTabPage() { + m_xAngleDialWin.reset(); m_xAngleDial.reset(); } @@ -50,10 +52,10 @@ std::unique_ptr<SfxTabPage> PolarOptionsTabPage::Create(weld::Container* pPage, bool PolarOptionsTabPage::FillItemSet( SfxItemSet* rOutAttrs ) { - if (m_xAngleDial->get_visible()) + if (m_xAngleDialWin->get_visible()) { rOutAttrs->Put(SfxInt32Item(SCHATTR_STARTING_ANGLE, - static_cast< sal_Int32 >(m_aAngleDial.GetRotation()/100))); + static_cast< sal_Int32 >(m_xAngleDial->GetRotation()/100))); } if( m_xCB_Clockwise->get_visible() ) @@ -72,7 +74,7 @@ void PolarOptionsTabPage::Reset(const SfxItemSet* rInAttrs) if (rInAttrs->GetItemState(SCHATTR_STARTING_ANGLE, true, &pPoolItem) == SfxItemState::SET) { long nTmp = static_cast<long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue()); - m_aAngleDial.SetRotation( nTmp*100 ); + m_xAngleDial->SetRotation( nTmp*100 ); } else { diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hxx b/chart2/source/controller/dialogs/tp_PolarOptions.hxx index 65911dc4eb52..e5d4287cbe3e 100644 --- a/chart2/source/controller/dialogs/tp_PolarOptions.hxx +++ b/chart2/source/controller/dialogs/tp_PolarOptions.hxx @@ -44,13 +44,13 @@ public: virtual void Reset(const SfxItemSet* rInAttrs) override; private: - svx::DialControl m_aAngleDial; std::unique_ptr<weld::CheckButton> m_xCB_Clockwise; std::unique_ptr<weld::Frame> m_xFL_StartingAngle; std::unique_ptr<weld::MetricSpinButton> m_xNF_StartingAngle; std::unique_ptr<weld::Frame> m_xFL_PlotOptions; std::unique_ptr<weld::CheckButton> m_xCB_IncludeHiddenCells; - std::unique_ptr<weld::CustomWeld> m_xAngleDial; + std::unique_ptr<svx::DialControl> m_xAngleDial; + std::unique_ptr<weld::CustomWeld> m_xAngleDialWin; }; } //namespace chart diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx index e5754ef3e94e..4efcb30da2bc 100644 --- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx +++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx @@ -38,20 +38,21 @@ SchAlignmentTabPage::SchAlignmentTabPage(weld::Container* pPage, weld::DialogCon , m_xFtTextDirection(m_xBuilder->weld_label("textdirL")) , m_xFtABCD(m_xBuilder->weld_label("labelABCD")) , m_xLbTextDirection(new TextDirectionListBox(m_xBuilder->weld_combo_box("textdirLB"))) - , m_xCtrlDial(new weld::CustomWeld(*m_xBuilder, "dialCtrl", m_aCtrlDial)) + , m_xCtrlDial(new svx::DialControl(m_xBuilder->weld_scrolled_window("anglepreview"))) + , m_xCtrlDialWin(new weld::CustomWeld(*m_xBuilder, "dialCtrl", *m_xCtrlDial)) { - m_aCtrlDial.SetLinkedField(m_xNfRotate.get()); - m_aCtrlDial.SetText(m_xFtABCD->get_label()); + m_xCtrlDial->SetLinkedField(m_xNfRotate.get()); + m_xCtrlDial->SetText(m_xFtABCD->get_label()); m_xCbStacked->connect_toggled(LINK(this, SchAlignmentTabPage, StackedToggleHdl)); - m_xCtrlDial->set_sensitive(true); + m_xCtrlDialWin->set_sensitive(true); m_xNfRotate->set_sensitive(true); m_xCbStacked->set_sensitive(true); m_xFtRotate->set_sensitive(true); if( !bWithRotation ) { - m_xCtrlDial->hide(); + m_xCtrlDialWin->hide(); m_xNfRotate->hide(); m_xCbStacked->hide(); m_xFtRotate->hide(); @@ -62,13 +63,14 @@ IMPL_LINK_NOARG(SchAlignmentTabPage, StackedToggleHdl, weld::ToggleButton&, void { bool bActive = m_xCbStacked->get_active(); m_xNfRotate->set_sensitive(bActive); - m_xCtrlDial->set_sensitive(bActive); - m_aCtrlDial.StyleUpdated(); + m_xCtrlDialWin->set_sensitive(bActive); + m_xCtrlDial->StyleUpdated(); m_xFtRotate->set_sensitive(bActive); } SchAlignmentTabPage::~SchAlignmentTabPage() { + m_xCtrlDialWin.reset(); m_xCtrlDial.reset(); m_xLbTextDirection.reset(); } @@ -91,7 +93,7 @@ bool SchAlignmentTabPage::FillItemSet(SfxItemSet* rOutAttrs) bool bStacked = m_xCbStacked->get_active(); rOutAttrs->Put( SfxBoolItem( SCHATTR_TEXT_STACKED, bStacked ) ); - sal_Int32 nDegrees = bStacked ? 0 : m_aCtrlDial.GetRotation(); + sal_Int32 nDegrees = bStacked ? 0 : m_xCtrlDial->GetRotation(); rOutAttrs->Put( SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) ); SvxFrameDirection aDirection( m_xLbTextDirection->get_active_id() ); @@ -105,7 +107,7 @@ void SchAlignmentTabPage::Reset(const SfxItemSet* rInAttrs) const SfxPoolItem* pItem = GetItem( *rInAttrs, SCHATTR_TEXT_DEGREES ); sal_Int32 nDegrees = pItem ? static_cast<const SfxInt32Item*>(pItem)->GetValue() : 0; - m_aCtrlDial.SetRotation( nDegrees ); + m_xCtrlDial->SetRotation( nDegrees ); pItem = GetItem( *rInAttrs, SCHATTR_TEXT_STACKED ); bool bStacked = pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue(); diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.hxx b/chart2/source/controller/dialogs/tp_TitleRotation.hxx index cb2258c27d99..b6b184eea775 100644 --- a/chart2/source/controller/dialogs/tp_TitleRotation.hxx +++ b/chart2/source/controller/dialogs/tp_TitleRotation.hxx @@ -37,14 +37,14 @@ namespace chart class SchAlignmentTabPage : public SfxTabPage { private: - svx::DialControl m_aCtrlDial; std::unique_ptr<weld::Label> m_xFtRotate; std::unique_ptr<weld::MetricSpinButton> m_xNfRotate; std::unique_ptr<weld::CheckButton> m_xCbStacked; std::unique_ptr<weld::Label> m_xFtTextDirection; std::unique_ptr<weld::Label> m_xFtABCD; std::unique_ptr<TextDirectionListBox> m_xLbTextDirection; - std::unique_ptr<weld::CustomWeld> m_xCtrlDial; + std::unique_ptr<svx::DialControl> m_xCtrlDial; + std::unique_ptr<weld::CustomWeld> m_xCtrlDialWin; DECL_LINK(StackedToggleHdl, weld::ToggleButton&, void); diff --git a/chart2/uiconfig/ui/dlg_DataLabel.ui b/chart2/uiconfig/ui/dlg_DataLabel.ui index ad6424771569..3b0130674dcd 100644 --- a/chart2/uiconfig/ui/dlg_DataLabel.ui +++ b/chart2/uiconfig/ui/dlg_DataLabel.ui @@ -378,7 +378,7 @@ <property name="can_focus">False</property> <property name="spacing">12</property> <child> - <object class="GtkScrolledWindow"> + <object class="GtkScrolledWindow" id="anglepreview"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hscrollbar_policy">never</property> diff --git a/chart2/uiconfig/ui/titlerotationtabpage.ui b/chart2/uiconfig/ui/titlerotationtabpage.ui index 801e2cce3ca2..31c53c0334e7 100644 --- a/chart2/uiconfig/ui/titlerotationtabpage.ui +++ b/chart2/uiconfig/ui/titlerotationtabpage.ui @@ -82,7 +82,7 @@ </packing> </child> <child> - <object class="GtkScrolledWindow"> + <object class="GtkScrolledWindow" id="anglepreview"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="halign">center</property> diff --git a/chart2/uiconfig/ui/tp_DataLabel.ui b/chart2/uiconfig/ui/tp_DataLabel.ui index f5de4af731a1..8028cbd995fc 100644 --- a/chart2/uiconfig/ui/tp_DataLabel.ui +++ b/chart2/uiconfig/ui/tp_DataLabel.ui @@ -307,7 +307,7 @@ <property name="can_focus">False</property> <property name="spacing">12</property> <child> - <object class="GtkScrolledWindow"> + <object class="GtkScrolledWindow" id="anglepreview"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hscrollbar_policy">never</property> diff --git a/chart2/uiconfig/ui/tp_PolarOptions.ui b/chart2/uiconfig/ui/tp_PolarOptions.ui index 17c3f47fb3dc..7dbd320aa9c2 100644 --- a/chart2/uiconfig/ui/tp_PolarOptions.ui +++ b/chart2/uiconfig/ui/tp_PolarOptions.ui @@ -74,7 +74,7 @@ <property name="can_focus">False</property> <property name="spacing">12</property> <child> - <object class="GtkScrolledWindow"> + <object class="GtkScrolledWindow" id="anglepreview"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="halign">center</property> diff --git a/chart2/uiconfig/ui/tp_axisLabel.ui b/chart2/uiconfig/ui/tp_axisLabel.ui index 285838c6d7e6..d4bc8d5afbef 100644 --- a/chart2/uiconfig/ui/tp_axisLabel.ui +++ b/chart2/uiconfig/ui/tp_axisLabel.ui @@ -299,7 +299,7 @@ </packing> </child> <child> - <object class="GtkScrolledWindow"> + <object class="GtkScrolledWindow" id="anglepreview"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="halign">center</property> |