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>
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 69ed9f4..9c5e461 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 42f5a9f..d21856c 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 82617b3..36ec561 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 d654d7d..0e7b9a0 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 c4da9b1..f94536c 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 65911dc..e5d4287 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 e5754ef..4efcb30 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 cb2258c2..b6b184e 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 ad64247..3b01306 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 801e2cc..31c53c0 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 f5de4af..8028cbd 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 17c3f47..7dbd320 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 285838c..d4bc8d5 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>
diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx
index ebfdd98..857ade2 100644
--- a/cui/source/inc/align.hxx
+++ b/cui/source/inc/align.hxx
@@ -79,7 +79,6 @@ private:
    weld::TriStateEnabled m_aHyphenState;
    weld::TriStateEnabled m_aShrinkState;

    DialControl m_aCtrlDial;
    SvtValueSet m_aVsRefEdge;

    std::unique_ptr<weld::ComboBox> m_xLbHorAlign;
@@ -111,7 +110,8 @@ private:
    std::unique_ptr<weld::Widget> m_xPropertiesFrame;

    std::unique_ptr<weld::CustomWeld> m_xVsRefEdge;
    std::unique_ptr<weld::CustomWeld> m_xCtrlDial;
    std::unique_ptr<DialControl> m_xCtrlDial;
    std::unique_ptr<weld::CustomWeld> m_xCtrlDialWin;
};


diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx
index 3c5506e..862baaf 100644
--- a/cui/source/inc/transfrm.hxx
+++ b/cui/source/inc/transfrm.hxx
@@ -174,7 +174,6 @@ private:
    MapUnit             ePoolUnit;
    FieldUnit           eDlgUnit;

    svx::DialControl m_aCtlAngle;
    SvxRectCtl m_aCtlRect;

    std::unique_ptr<weld::Widget> m_xFlPosition;
@@ -183,7 +182,8 @@ private:
    std::unique_ptr<weld::CustomWeld> m_xCtlRect;
    std::unique_ptr<weld::Widget> m_xFlAngle;
    std::unique_ptr<weld::MetricSpinButton> m_xNfAngle;
    std::unique_ptr<weld::CustomWeld> m_xCtlAngle;
    std::unique_ptr<svx::DialControl> m_xCtlAngle;
    std::unique_ptr<weld::CustomWeld> m_xCtlAngleWin;

public:
    SvxAngleTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs);
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 9c08860..efa1b35 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -132,10 +132,11 @@ AlignmentTabPage::AlignmentTabPage(weld::Container* pPage, weld::DialogControlle
    , m_xOrientFrame(m_xBuilder->weld_widget("orientation"))
    , m_xPropertiesFrame(m_xBuilder->weld_widget("properties"))
    , m_xVsRefEdge(new weld::CustomWeld(*m_xBuilder, "references", m_aVsRefEdge))
    , m_xCtrlDial(new weld::CustomWeld(*m_xBuilder, "dialcontrol", m_aCtrlDial))
    , m_xCtrlDial(new DialControl(m_xBuilder->weld_scrolled_window("anglepreview")))
    , m_xCtrlDialWin(new weld::CustomWeld(*m_xBuilder, "dialcontrol", *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());

    InitVsRefEgde();

@@ -160,6 +161,7 @@ AlignmentTabPage::AlignmentTabPage(weld::Container* pPage, weld::DialogControlle

AlignmentTabPage::~AlignmentTabPage()
{
    m_xCtrlDialWin.reset();
    m_xCtrlDial.reset();
    m_xVsRefEdge.reset();
    m_xLbFrameDir.reset();
@@ -258,7 +260,7 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
                                            *rSet, SID_ATTR_ALIGN_DEGREES));
        assert(pAngleItem);
        std::unique_ptr<SdrAngleItem> pNewAngleItem(pAngleItem->Clone());
        pNewAngleItem->SetValue(m_aCtrlDial.GetRotation());
        pNewAngleItem->SetValue(m_xCtrlDial->GetRotation());
        rSet->Put(*pNewAngleItem);
        bChanged = true;
    }
@@ -538,21 +540,21 @@ void AlignmentTabPage::Reset(const SfxItemSet* pCoreAttrs)
    {
        case SfxItemState::UNKNOWN:
            m_xNfRotate->hide();
            m_xCtrlDial->hide();
            m_xCtrlDialWin->hide();
            break;
        case SfxItemState::DISABLED:
        case SfxItemState::READONLY:
            m_xNfRotate->set_sensitive(false);
            m_xCtrlDial->set_sensitive(false);
            m_xCtrlDialWin->set_sensitive(false);
            break;
        case SfxItemState::DONTCARE:
            m_aCtrlDial.SetNoRotation();
            m_xCtrlDial->SetNoRotation();
            break;
        case SfxItemState::DEFAULT:
        case SfxItemState::SET:
        {
            const SdrAngleItem& rAlignItem = static_cast<const SdrAngleItem&>(pCoreAttrs->Get(nWhich));
            m_aCtrlDial.SetRotation(rAlignItem.GetValue());
            m_xCtrlDial->SetRotation(rAlignItem.GetValue());
            break;
        }
    }
@@ -694,7 +696,7 @@ void AlignmentTabPage::UpdateEnableControls()
    // visibility of frames
    m_xAlignmentFrame->set_visible(m_xLbHorAlign->get_visible() || m_xEdIndent->get_visible() ||
        m_xLbVerAlign->get_visible());
    m_xOrientFrame->set_visible(m_xCtrlDial->get_visible() || m_xVsRefEdge->get_visible() ||
    m_xOrientFrame->set_visible(m_xCtrlDialWin->get_visible() || m_xVsRefEdge->get_visible() ||
        m_xCbStacked->get_visible() || m_xCbAsianMode->get_visible());
    m_xPropertiesFrame->set_visible(m_xBtnWrap->get_visible() || m_xBtnHyphen->get_visible() ||
        m_xBtnShrink->get_visible() || m_xLbFrameDir->get_visible());
@@ -707,7 +709,7 @@ void AlignmentTabPage::UpdateEnableControls()
    // windows to be disabled, if stacked text is turned OFF
    m_xCbAsianMode->set_sensitive(bStackedText);
    // rotation/stacked disabled for fill alignment/stacked
    m_xCtrlDial->set_sensitive(!bHorFill && !bStackedText);
    m_xCtrlDialWin->set_sensitive(!bHorFill && !bStackedText);
    m_xNfRotate->set_sensitive(!bHorFill && !bStackedText);
}

diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index aad88fb..90def10 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -177,14 +177,15 @@ SvxAngleTabPage::SvxAngleTabPage(weld::Container* pPage, weld::DialogController*
    , m_xCtlRect(new weld::CustomWeld(*m_xBuilder, "CTL_RECT", m_aCtlRect))
    , m_xFlAngle(m_xBuilder->weld_widget("FL_ANGLE"))
    , m_xNfAngle(m_xBuilder->weld_metric_spin_button("NF_ANGLE", FieldUnit::DEGREE))
    , m_xCtlAngle(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", m_aCtlAngle))
    , m_xCtlAngle(new svx::DialControl(m_xBuilder->weld_scrolled_window("anglepreview")))
    , m_xCtlAngleWin(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", *m_xCtlAngle))
{
    // calculate PoolUnit
    SfxItemPool* pPool = rOutAttrs.GetPool();
    DBG_ASSERT( pPool, "no pool (!)" );
    ePoolUnit = pPool->GetMetric(SID_ATTR_TRANSFORM_POS_X);

    m_aCtlAngle.SetLinkedField(m_xNfAngle.get(), 2);
    m_xCtlAngle->SetLinkedField(m_xNfAngle.get(), 2);
}

SvxAngleTabPage::~SvxAngleTabPage()
@@ -243,13 +244,13 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet)
{
    bool bModified = false;

    if (m_aCtlAngle.IsValueModified() || m_xMtrPosX->get_value_changed_from_saved() || m_xMtrPosY->get_value_changed_from_saved())
    if (m_xCtlAngle->IsValueModified() || m_xMtrPosX->get_value_changed_from_saved() || m_xMtrPosY->get_value_changed_from_saved())
    {
        const double fUIScale(double(pView->GetModel()->GetUIScale()));
        const double fTmpX((GetCoreValue(*m_xMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale);
        const double fTmpY((GetCoreValue(*m_xMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale);

        rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_aCtlAngle.GetRotation()));
        rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_xCtlAngle->GetRotation()));
        rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), basegfx::fround(fTmpX)));
        rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), basegfx::fround(fTmpY)));

@@ -289,13 +290,13 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
    pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ANGLE );
    if(pItem)
    {
        m_aCtlAngle.SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue());
        m_xCtlAngle->SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue());
    }
    else
    {
        m_aCtlAngle.SetRotation(0);
        m_xCtlAngle->SetRotation(0);
    }
    m_aCtlAngle.SaveValue();
    m_xCtlAngle->SaveValue();
    m_xMtrPosX->save_value();
    m_xMtrPosY->save_value();
}
diff --git a/cui/uiconfig/ui/rotationtabpage.ui b/cui/uiconfig/ui/rotationtabpage.ui
index a36cbf0..a4f1b0e 100644
--- a/cui/uiconfig/ui/rotationtabpage.ui
+++ b/cui/uiconfig/ui/rotationtabpage.ui
@@ -270,7 +270,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/include/svx/dialcontrol.hxx b/include/svx/dialcontrol.hxx
index 70d1071..fffcf6a 100644
--- a/include/svx/dialcontrol.hxx
+++ b/include/svx/dialcontrol.hxx
@@ -75,6 +75,7 @@ private:
class SAL_WARN_UNUSED SVX_DLLPUBLIC DialControl final : public weld::CustomWidgetController
{
public:
    DialControl(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow);
    virtual void        SetDrawingArea(weld::DrawingArea* pDrawingArea) override;

    virtual void        Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override;
@@ -86,6 +87,8 @@ public:
    virtual bool        MouseButtonUp( const MouseEvent& rMEvt ) override;
    virtual bool        KeyInput(const KeyEvent& rKEvt) override;
    virtual void        LoseFocus() override;
    virtual void        Show() override;
    virtual void        Hide() override;

    virtual void        Resize() override;

@@ -118,6 +121,14 @@ public:
    void                SetModifyHdl( const Link<DialControl&,void>& rLink );

    void                Init( const Size& rWinSize );

    void                set_visible(bool bVisible)
    {
        if (bVisible)
            Show();
        else
            Hide();
    }
private:
    struct DialControl_Impl
    {
@@ -141,6 +152,7 @@ private:
        void                Init( const Size& rWinSize, const vcl::Font& rWinFont );
        void                SetSize( const Size& rWinSize );
    };
    std::unique_ptr<weld::ScrolledWindow> mxScrolledWindow;
    std::unique_ptr< DialControl_Impl > mpImpl;

    void                HandleMouseEvent( const Point& rPos, bool bInitial );
diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx
index 7faf0d9..244ceb4 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -253,6 +253,23 @@ void DialControl::DialControl_Impl::SetSize( const Size& rWinSize )
    mxBmpBuffered->SetSize( maWinSize );
}

DialControl::DialControl(std::unique_ptr<weld::ScrolledWindow> xScrolledWindow)
    : mxScrolledWindow(std::move(xScrolledWindow))
{
}

void DialControl::Show()
{
    mxScrolledWindow->show();
    weld::CustomWidgetController::Show();
}

void DialControl::Hide()
{
    weld::CustomWidgetController::Hide();
    mxScrolledWindow->hide();
}

void DialControl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
{
    CustomWidgetController::SetDrawingArea(pDrawingArea);
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 1e83702..5ff2f53 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -73,7 +73,7 @@ PosSizePropertyPanel::PosSizePropertyPanel(
    mxCbxScale(m_xBuilder->weld_check_button("ratio")),
    mxFtAngle(m_xBuilder->weld_label("rotationlabel")),
    mxMtrAngle(m_xBuilder->weld_metric_spin_button("rotation", FieldUnit::DEGREE)),
    mxCtrlDial(new DialControl),
    mxCtrlDial(new DialControl(m_xBuilder->weld_scrolled_window("anglepreview"))),
    mxDial(new weld::CustomWeld(*m_xBuilder, "orientationcontrol", *mxCtrlDial)),
    mxFtFlip(m_xBuilder->weld_label("fliplabel")),
    mxFlipTbx(m_xBuilder->weld_toolbar("selectrotationtype")),
@@ -330,7 +330,7 @@ void PosSizePropertyPanel::HandleContextChange(
    // Rotation
    mxFtAngle->set_visible(bShowAngle);
    mxMtrAngle->set_visible(bShowAngle);
    mxDial->set_visible(bShowAngle);
    mxCtrlDial->set_visible(bShowAngle);

    // Flip
    mxFtFlip->set_visible(bShowFlip);
diff --git a/svx/uiconfig/ui/sidebarpossize.ui b/svx/uiconfig/ui/sidebarpossize.ui
index 30967e3..e13b811 100644
--- a/svx/uiconfig/ui/sidebarpossize.ui
+++ b/svx/uiconfig/ui/sidebarpossize.ui
@@ -225,7 +225,7 @@
              </packing>
            </child>
            <child>
              <object class="GtkScrolledWindow" id="preview">
              <object class="GtkScrolledWindow" id="anglepreview">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="halign">start</property>
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 7bb7c04..480611b 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2316,12 +2316,13 @@ SwGrfExtPage::SwGrfExtPage(weld::Container* pPage, weld::DialogController* pCont
    // RotGrfFlyFrame: Need Angle and RotateControls now
    , m_xFlAngle(m_xBuilder->weld_frame("FL_ANGLE"))
    , m_xNfAngle(m_xBuilder->weld_metric_spin_button("NF_ANGLE", FieldUnit::DEGREE))
    , m_xCtlAngle(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", m_aCtlAngle))
    , m_xCtlAngle(new svx::DialControl(m_xBuilder->weld_scrolled_window("anglepreview")))
    , m_xCtlAngleWin(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", *m_xCtlAngle))
    , m_xBmpWin(new weld::CustomWeld(*m_xBuilder, "preview", m_aBmpWin))
{
    m_aBmpWin.SetBitmapEx(BitmapEx(RID_BMP_PREVIEW_FALLBACK));

    m_aCtlAngle.SetLinkedField(m_xNfAngle.get(), 2);
    m_xCtlAngle->SetLinkedField(m_xNfAngle.get(), 2);

    SetExchangeSupport();
    m_xMirrorHorzBox->connect_toggled(LINK(this, SwGrfExtPage, MirrorHdl));
@@ -2332,6 +2333,7 @@ SwGrfExtPage::SwGrfExtPage(weld::Container* pPage, weld::DialogController* pCont
SwGrfExtPage::~SwGrfExtPage()
{
    m_xBmpWin.reset();
    m_xCtlAngleWin.reset();
    m_xCtlAngle.reset();
    m_xGrfDlg.reset();
}
@@ -2357,13 +2359,13 @@ void SwGrfExtPage::Reset(const SfxItemSet *rSet)
    // RotGrfFlyFrame: Get RotationAngle and set at control
    if(SfxItemState::SET == rSet->GetItemState( SID_ATTR_TRANSFORM_ANGLE, false, &pItem))
    {
        m_aCtlAngle.SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue());
        m_xCtlAngle->SetRotation(static_cast<const SfxInt32Item*>(pItem)->GetValue());
    }
    else
    {
        m_aCtlAngle.SetRotation(0);
        m_xCtlAngle->SetRotation(0);
    }
    m_aCtlAngle.SaveValue();
    m_xCtlAngle->SaveValue();

    ActivatePage(*rSet);
}
@@ -2496,9 +2498,9 @@ bool SwGrfExtPage::FillItemSet( SfxItemSet *rSet )
    }

    // RotGrfFlyFrame: Safe rotation if modified
    if(m_aCtlAngle.IsValueModified())
    if(m_xCtlAngle->IsValueModified())
    {
        rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_aCtlAngle.GetRotation()));
        rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_xCtlAngle->GetRotation()));
        bModified = true;
    }

diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx
index a5c57aa..6aba31a 100644
--- a/sw/source/uibase/inc/frmpage.hxx
+++ b/sw/source/uibase/inc/frmpage.hxx
@@ -203,7 +203,6 @@ class SwGrfExtPage : public SfxTabPage

    // mirror
    BmpWindow m_aBmpWin;
    svx::DialControl m_aCtlAngle;
    std::unique_ptr<weld::Widget> m_xMirror;
    std::unique_ptr<weld::CheckButton> m_xMirrorVertBox;
    std::unique_ptr<weld::CheckButton> m_xMirrorHorzBox;
@@ -218,7 +217,8 @@ class SwGrfExtPage : public SfxTabPage
    // RotGrfFlyFrame: Need Angle and RotateControls now
    std::unique_ptr<weld::Frame> m_xFlAngle;
    std::unique_ptr<weld::MetricSpinButton> m_xNfAngle;
    std::unique_ptr<weld::CustomWeld> m_xCtlAngle;
    std::unique_ptr<svx::DialControl> m_xCtlAngle;
    std::unique_ptr<weld::CustomWeld> m_xCtlAngleWin;
    std::unique_ptr<weld::CustomWeld> m_xBmpWin;


diff --git a/sw/uiconfig/swriter/ui/picturepage.ui b/sw/uiconfig/swriter/ui/picturepage.ui
index 0c38fbf..a5045dc 100644
--- a/sw/uiconfig/swriter/ui/picturepage.ui
+++ b/sw/uiconfig/swriter/ui/picturepage.ui
@@ -2,7 +2,6 @@
<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
  <requires lib="gtk+" version="3.18"/>
  <requires lib="LibreOffice" version="1.0"/>
  <object class="GtkGrid" id="PicturePage">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
@@ -311,7 +310,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>