[Libreoffice-commits] core.git: 2 commits - filter/source solenv/sanitizers svx/source svx/uiconfig

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 20 08:56:08 UTC 2019


 filter/source/graphicfilter/icgm/class5.cxx         |   14 +
 solenv/sanitizers/ui/svx.suppr                      |    8 
 svx/source/sidebar/graphic/GraphicPropertyPanel.cxx |  197 +++++++++-----------
 svx/source/sidebar/graphic/GraphicPropertyPanel.hxx |   46 +---
 svx/uiconfig/ui/sidebargraphic.ui                   |   91 +++++----
 5 files changed, 169 insertions(+), 187 deletions(-)

New commits:
commit 3e71e97e00be0f337c102beef9755ccbe573103a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Dec 19 16:34:14 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Dec 20 09:54:58 2019 +0100

    ofz#19594 Invalid-enum-value
    
    Change-Id: Iffd708aa30d8dde2badc4748d2adb53b64c376aa
    Reviewed-on: https://gerrit.libreoffice.org/85534
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/filter/source/graphicfilter/icgm/class5.cxx b/filter/source/graphicfilter/icgm/class5.cxx
index 33273adb7cf8..888a9ca1259c 100644
--- a/filter/source/graphicfilter/icgm/class5.cxx
+++ b/filter/source/graphicfilter/icgm/class5.cxx
@@ -19,11 +19,11 @@
 
 //#define VCL_NEED_BASETSD
 
+#include <sal/log.hxx>
 #include "cgm.hxx"
 #include "elements.hxx"
 #include "outact.hxx"
 
-
 void CGM::ImplDoClass5()
 {
     switch ( mnElementID )
@@ -199,8 +199,16 @@ void CGM::ImplDoClass5()
         break;
         case 0x12 : /*Text Alignment*/
         {
-            pElement->eTextAlignmentH = static_cast<TextAlignmentH>(ImplGetUI16());
-            pElement->eTextAlignmentV = static_cast<TextAlignmentV>(ImplGetUI16());
+            auto nTextAlign = ImplGetUI16();
+            if (nTextAlign > TextAlignmentH::TAH_CONT)
+                SAL_WARN("filter.icgm", "TextAlign out of range");
+            else
+                pElement->eTextAlignmentH = static_cast<TextAlignmentH>(nTextAlign);
+            nTextAlign = ImplGetUI16();
+            if (nTextAlign > TextAlignmentV::TAV_CONT)
+                SAL_WARN("filter.icgm", "TextAlign out of range");
+            else
+                pElement->eTextAlignmentV = static_cast<TextAlignmentV>(nTextAlign);
             pElement->nTextAlignmentHCont = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
             pElement->nTextAlignmentVCont = ImplGetFloat( pElement->eRealPrecision, pElement->nRealSize );
         }
commit 49285e43707eeeb3cf27b9e34b87f9e87dbdaa8e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Dec 19 17:25:51 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Dec 20 09:54:36 2019 +0100

    weld GraphicPropertyPanel
    
    Change-Id: I05293f7421815e7588dcf344fcd221ca337b116d
    Reviewed-on: https://gerrit.libreoffice.org/85550
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/solenv/sanitizers/ui/svx.suppr b/solenv/sanitizers/ui/svx.suppr
index 8aee20b117aa..3cf402908eb4 100644
--- a/solenv/sanitizers/ui/svx.suppr
+++ b/solenv/sanitizers/ui/svx.suppr
@@ -67,14 +67,6 @@ svx/uiconfig/ui/sidebararea.ui://GtkLabel[@id='transparencylabel'] orphan-label
 svx/uiconfig/ui/sidebarshadow.ui://GtkLabel[@id='transparency_label'] orphan-label
 svx/uiconfig/ui/sidebarshadow.ui://GtkSpinButton[@id='FIELD_TRANSPARENCY'] no-labelled-by
 svx/uiconfig/ui/sidebarshadow.ui://GtkScale[@id='transparency_slider'] no-labelled-by
-svx/uiconfig/ui/sidebargraphic.ui://GtkSpinButton[@id='setbrightness:%'] missing-label-for
-svx/uiconfig/ui/sidebargraphic.ui://GtkSpinButton[@id='setbrightness:%'] labelled-by-and-mnemonic
-svx/uiconfig/ui/sidebargraphic.ui://GtkSpinButton[@id='setcontrast:%'] missing-label-for
-svx/uiconfig/ui/sidebargraphic.ui://GtkSpinButton[@id='setcontrast:%'] labelled-by-and-mnemonic
-svx/uiconfig/ui/sidebargraphic.ui://GtkComboBoxText[@id='setcolormode'] missing-label-for
-svx/uiconfig/ui/sidebargraphic.ui://GtkComboBoxText[@id='setcolormode'] labelled-by-and-mnemonic
-svx/uiconfig/ui/sidebargraphic.ui://GtkSpinButton[@id='setgraphtransparency:%'] missing-label-for
-svx/uiconfig/ui/sidebargraphic.ui://GtkSpinButton[@id='setgraphtransparency:%'] labelled-by-and-mnemonic
 svx/uiconfig/ui/sidebarline.ui://GtkLabel[@id='widthlabel'] orphan-label
 svx/uiconfig/ui/sidebarline.ui://GtkLabel[@id='colorlabel'] orphan-label
 svx/uiconfig/ui/sidebarline.ui://GtkLabel[@id='translabel'] orphan-label
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
index 00b5758e65fc..2675016afabb 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
@@ -41,7 +41,7 @@ GraphicPropertyPanel::GraphicPropertyPanel(
     vcl::Window* pParent,
     const css::uno::Reference<css::frame::XFrame>& rxFrame,
     SfxBindings* pBindings)
-:   PanelLayout(pParent, "GraphicPropertyPanel", "svx/ui/sidebargraphic.ui", rxFrame),
+:   PanelLayout(pParent, "GraphicPropertyPanel", "svx/ui/sidebargraphic.ui", rxFrame, true),
     maBrightControl(SID_ATTR_GRAF_LUMINANCE, *pBindings, *this),
     maContrastControl(SID_ATTR_GRAF_CONTRAST, *pBindings, *this),
     maTransparenceControl(SID_ATTR_GRAF_TRANSPARENCE, *pBindings, *this),
@@ -50,17 +50,17 @@ GraphicPropertyPanel::GraphicPropertyPanel(
     maBlueControl(SID_ATTR_GRAF_BLUE, *pBindings, *this),
     maGammaControl(SID_ATTR_GRAF_GAMMA, *pBindings, *this),
     maModeControl(SID_ATTR_GRAF_MODE, *pBindings, *this),
-    mpBindings(pBindings)
+    mpBindings(pBindings),
+    mxMtrBrightness(m_xBuilder->weld_metric_spin_button("setbrightness", FieldUnit::PERCENT)),
+    mxMtrContrast(m_xBuilder->weld_metric_spin_button("setcontrast", FieldUnit::PERCENT)),
+    mxLBColorMode(m_xBuilder->weld_combo_box("setcolormode")),
+    mxMtrTrans(m_xBuilder->weld_metric_spin_button("setgraphtransparency", FieldUnit::PERCENT)),
+    mxMtrRed(m_xBuilder->weld_metric_spin_button("setred", FieldUnit::PERCENT)),
+    mxMtrGreen(m_xBuilder->weld_metric_spin_button("setgreen", FieldUnit::PERCENT)),
+    mxMtrBlue(m_xBuilder->weld_metric_spin_button("setblue", FieldUnit::PERCENT)),
+    mxMtrGamma(m_xBuilder->weld_spin_button("setgamma"))
 {
-    get(mpMtrBrightness, "setbrightness");
-    get(mpMtrContrast, "setcontrast");
-    get(mpLBColorMode, "setcolormode");
-    mpLBColorMode->set_width_request(mpLBColorMode->get_preferred_size().Width());
-    get(mpMtrTrans, "setgraphtransparency");
-    get(mpMtrRed, "setred");
-    get(mpMtrGreen, "setgreen");
-    get(mpMtrBlue, "setblue");
-    get(mpMtrGamma, "setgamma");
+    mxLBColorMode->set_size_request(mxLBColorMode->get_preferred_size().Width(), -1);
     Initialize();
 }
 
@@ -71,14 +71,14 @@ GraphicPropertyPanel::~GraphicPropertyPanel()
 
 void GraphicPropertyPanel::dispose()
 {
-    mpMtrBrightness.clear();
-    mpMtrContrast.clear();
-    mpLBColorMode.clear();
-    mpMtrTrans.clear();
-    mpMtrRed.clear();
-    mpMtrGreen.clear();
-    mpMtrBlue.clear();
-    mpMtrGamma.clear();
+    mxMtrBrightness.reset();
+    mxMtrContrast.reset();
+    mxLBColorMode.reset();
+    mxMtrTrans.reset();
+    mxMtrRed.reset();
+    mxMtrGreen.reset();
+    mxMtrBlue.reset();
+    mxMtrGamma.reset();
 
     maBrightControl.dispose();
     maContrastControl.dispose();
@@ -92,109 +92,90 @@ void GraphicPropertyPanel::dispose()
     PanelLayout::dispose();
 }
 
-
 void GraphicPropertyPanel::Initialize()
 {
-    mpMtrBrightness->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyBrightnessHdl ) );
-    mpMtrContrast->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyContrastHdl ) );
-    mpMtrTrans->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyTransHdl ) );
-
-    mpLBColorMode->InsertEntry(SvxResId(RID_SVXSTR_GRAFMODE_STANDARD));
-    mpLBColorMode->InsertEntry(SvxResId(RID_SVXSTR_GRAFMODE_GREYS));
-    mpLBColorMode->InsertEntry(SvxResId(RID_SVXSTR_GRAFMODE_MONO));
-    mpLBColorMode->InsertEntry(SvxResId(RID_SVXSTR_GRAFMODE_WATERMARK));
-    mpLBColorMode->SetSelectHdl( LINK( this, GraphicPropertyPanel, ClickColorModeHdl ));
-
-    mpMtrRed->SetModifyHdl( LINK( this, GraphicPropertyPanel, RedHdl ) );
-    mpMtrGreen->SetModifyHdl( LINK( this, GraphicPropertyPanel, GreenHdl ) );
-    mpMtrBlue->SetModifyHdl( LINK( this, GraphicPropertyPanel, BlueHdl ) );
-    mpMtrGamma->SetModifyHdl( LINK( this, GraphicPropertyPanel, GammaHdl ) );
-
-    // Fix left position of some controls that may be wrong due to
-    // rounding errors.
-    const sal_Int32 nRight0 (mpLBColorMode->GetPosPixel().X() + mpLBColorMode->GetSizePixel().Width());
-    const sal_Int32 nRight1 (mpMtrTrans->GetPosPixel().X() + mpMtrTrans->GetSizePixel().Width());
-    mpMtrRed->SetPosPixel(Point(
-            nRight0 - mpMtrRed->GetSizePixel().Width(),
-            mpMtrRed->GetPosPixel().Y()));
-    mpMtrBlue->SetPosPixel(Point(
-            nRight0 - mpMtrBlue->GetSizePixel().Width(),
-            mpMtrBlue->GetPosPixel().Y()));
-    mpMtrGreen->SetPosPixel(Point(
-            nRight1 - mpMtrGreen->GetSizePixel().Width(),
-            mpMtrGreen->GetPosPixel().Y()));
-    mpMtrGamma->SetPosPixel(Point(
-            nRight1 - mpMtrGamma->GetSizePixel().Width(),
-            mpMtrGamma->GetPosPixel().Y()));
+    mxMtrBrightness->connect_value_changed( LINK( this, GraphicPropertyPanel, ModifyBrightnessHdl ) );
+    mxMtrContrast->connect_value_changed( LINK( this, GraphicPropertyPanel, ModifyContrastHdl ) );
+    mxMtrTrans->connect_value_changed( LINK( this, GraphicPropertyPanel, ModifyTransHdl ) );
+
+    mxLBColorMode->append_text(SvxResId(RID_SVXSTR_GRAFMODE_STANDARD));
+    mxLBColorMode->append_text(SvxResId(RID_SVXSTR_GRAFMODE_GREYS));
+    mxLBColorMode->append_text(SvxResId(RID_SVXSTR_GRAFMODE_MONO));
+    mxLBColorMode->append_text(SvxResId(RID_SVXSTR_GRAFMODE_WATERMARK));
+    mxLBColorMode->connect_changed( LINK( this, GraphicPropertyPanel, ClickColorModeHdl ));
+
+    mxMtrRed->connect_value_changed( LINK( this, GraphicPropertyPanel, RedHdl ) );
+    mxMtrGreen->connect_value_changed( LINK( this, GraphicPropertyPanel, GreenHdl ) );
+    mxMtrBlue->connect_value_changed( LINK( this, GraphicPropertyPanel, BlueHdl ) );
+    mxMtrGamma->connect_value_changed( LINK( this, GraphicPropertyPanel, GammaHdl ) );
 }
 
-
-IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyBrightnessHdl, Edit&, void )
+IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyBrightnessHdl, weld::MetricSpinButton&, void )
 {
-    const sal_Int16 nBright = mpMtrBrightness->GetValue();
+    const sal_Int16 nBright = mxMtrBrightness->get_value(FieldUnit::PERCENT);
     const SfxInt16Item aBrightItem( SID_ATTR_GRAF_LUMINANCE, nBright );
     GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_LUMINANCE,
             SfxCallMode::RECORD, { &aBrightItem });
 }
 
 
-IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyContrastHdl, Edit&, void )
+IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyContrastHdl, weld::MetricSpinButton&, void )
 {
-    const sal_Int16 nContrast = mpMtrContrast->GetValue();
+    const sal_Int16 nContrast = mxMtrContrast->get_value(FieldUnit::PERCENT);
     const SfxInt16Item aContrastItem( SID_ATTR_GRAF_CONTRAST, nContrast );
     GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_CONTRAST,
             SfxCallMode::RECORD, { &aContrastItem });
 }
 
 
-IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyTransHdl, Edit&, void )
+IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyTransHdl, weld::MetricSpinButton&, void )
 {
-    const sal_Int16 nTrans = mpMtrTrans->GetValue();
+    const sal_Int16 nTrans = mxMtrTrans->get_value(FieldUnit::PERCENT);
     const SfxInt16Item aTransItem( SID_ATTR_GRAF_TRANSPARENCE, nTrans );
     GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_TRANSPARENCE,
             SfxCallMode::RECORD, { &aTransItem });
 }
 
 
-IMPL_LINK_NOARG( GraphicPropertyPanel, ClickColorModeHdl, ListBox&, void )
+IMPL_LINK_NOARG( GraphicPropertyPanel, ClickColorModeHdl, weld::ComboBox&, void )
 {
-    const sal_Int16 nTrans = mpLBColorMode->GetSelectedEntryPos();
+    const sal_Int16 nTrans = mxLBColorMode->get_active();
     const SfxInt16Item aTransItem( SID_ATTR_GRAF_MODE, nTrans );
     GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_MODE,
             SfxCallMode::RECORD, { &aTransItem });
 }
 
 
-IMPL_LINK_NOARG( GraphicPropertyPanel, RedHdl, Edit&, void )
+IMPL_LINK_NOARG( GraphicPropertyPanel, RedHdl, weld::MetricSpinButton&, void )
 {
-    const sal_Int16 nRed = mpMtrRed->GetValue();
+    const sal_Int16 nRed = mxMtrRed->get_value(FieldUnit::PERCENT);
     const SfxInt16Item aRedItem( SID_ATTR_GRAF_RED, nRed );
     GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_RED,
             SfxCallMode::RECORD, { &aRedItem });
 }
 
 
-IMPL_LINK_NOARG( GraphicPropertyPanel, GreenHdl, Edit&, void )
+IMPL_LINK_NOARG( GraphicPropertyPanel, GreenHdl, weld::MetricSpinButton&, void )
 {
-    const sal_Int16 nGreen = mpMtrGreen->GetValue();
+    const sal_Int16 nGreen = mxMtrGreen->get_value(FieldUnit::PERCENT);
     const SfxInt16Item aGreenItem( SID_ATTR_GRAF_GREEN, nGreen );
     GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_GREEN,
             SfxCallMode::RECORD, { &aGreenItem });
 }
 
 
-IMPL_LINK_NOARG(GraphicPropertyPanel, BlueHdl, Edit&, void)
+IMPL_LINK_NOARG(GraphicPropertyPanel, BlueHdl, weld::MetricSpinButton&, void)
 {
-    const sal_Int16 nBlue = mpMtrBlue->GetValue();
+    const sal_Int16 nBlue = mxMtrBlue->get_value(FieldUnit::PERCENT);
     const SfxInt16Item aBlueItem( SID_ATTR_GRAF_BLUE, nBlue );
     GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_BLUE,
             SfxCallMode::RECORD, { &aBlueItem });
 }
 
 
-IMPL_LINK_NOARG(GraphicPropertyPanel, GammaHdl, Edit&, void)
+IMPL_LINK_NOARG(GraphicPropertyPanel, GammaHdl, weld::SpinButton&, void)
 {
-    const sal_Int32 nGamma = mpMtrGamma->GetValue();
+    const sal_Int32 nGamma = mxMtrGamma->get_value();
     const SfxInt32Item nGammaItem( SID_ATTR_GRAF_GAMMA, nGamma );
     GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_GAMMA,
             SfxCallMode::RECORD, { &nGammaItem });
@@ -237,23 +218,23 @@ void GraphicPropertyPanel::NotifyItemUpdate(
         {
             if(eState >= SfxItemState::DEFAULT)
             {
-                mpMtrBrightness->Enable();
+                mxMtrBrightness->set_sensitive(true);
                 const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
 
                 if(pItem)
                 {
                     const sal_Int64 nBright = pItem->GetValue();
-                    mpMtrBrightness->SetValue(nBright);
+                    mxMtrBrightness->set_value(nBright, FieldUnit::PERCENT);
                 }
             }
             else if(SfxItemState::DISABLED == eState)
             {
-                mpMtrBrightness->Disable();
+                mxMtrBrightness->set_sensitive(false);
             }
             else
             {
-                mpMtrBrightness->Enable();
-                mpMtrBrightness->SetText(OUString());
+                mxMtrBrightness->set_sensitive(true);
+                mxMtrBrightness->set_text(OUString());
             }
             break;
         }
@@ -261,23 +242,23 @@ void GraphicPropertyPanel::NotifyItemUpdate(
         {
             if(eState >= SfxItemState::DEFAULT)
             {
-                mpMtrContrast->Enable();
+                mxMtrContrast->set_sensitive(true);
                 const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
 
                 if(pItem)
                 {
                     const sal_Int64 nContrast = pItem->GetValue();
-                    mpMtrContrast->SetValue(nContrast);
+                    mxMtrContrast->set_value(nContrast, FieldUnit::PERCENT);
                 }
             }
             else if(SfxItemState::DISABLED == eState)
             {
-                mpMtrContrast->Disable();
+                mxMtrContrast->set_sensitive(false);
             }
             else
             {
-                mpMtrContrast->Enable();
-                mpMtrContrast->SetText(OUString());
+                mxMtrContrast->set_sensitive(true);
+                mxMtrContrast->set_text(OUString());
             }
             break;
         }
@@ -285,23 +266,23 @@ void GraphicPropertyPanel::NotifyItemUpdate(
         {
             if(eState >= SfxItemState::DEFAULT)
             {
-                mpMtrTrans->Enable();
+                mxMtrTrans->set_sensitive(true);
                 const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
 
                 if(pItem)
                 {
                     const sal_Int64 nTrans = pItem->GetValue();
-                    mpMtrTrans->SetValue(nTrans);
+                    mxMtrTrans->set_value(nTrans, FieldUnit::PERCENT);
                 }
             }
             else if(SfxItemState::DISABLED == eState)
             {
-                mpMtrTrans->Disable();
+                mxMtrTrans->set_sensitive(false);
             }
             else
             {
-                mpMtrTrans->Enable();
-                mpMtrTrans->SetText(OUString());
+                mxMtrTrans->set_sensitive(true);
+                mxMtrTrans->set_text(OUString());
             }
             break;
         }
@@ -309,23 +290,23 @@ void GraphicPropertyPanel::NotifyItemUpdate(
         {
             if(eState >= SfxItemState::DEFAULT)
             {
-                mpLBColorMode->Enable();
+                mxLBColorMode->set_sensitive(true);
                 const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
 
                 if(pItem)
                 {
                     const sal_Int64 nTrans = pItem->GetValue();
-                    mpLBColorMode->SelectEntryPos(nTrans);
+                    mxLBColorMode->set_active(nTrans);
                 }
             }
             else if(SfxItemState::DISABLED == eState)
             {
-                mpLBColorMode->Disable();
+                mxLBColorMode->set_sensitive(false);
             }
             else
             {
-                mpLBColorMode->Enable();
-                mpLBColorMode->SetNoSelection();
+                mxLBColorMode->set_sensitive(true);
+                mxLBColorMode->set_active(-1);
             }
             break;
         }
@@ -333,23 +314,23 @@ void GraphicPropertyPanel::NotifyItemUpdate(
         {
             if(eState >= SfxItemState::DEFAULT)
             {
-                mpMtrRed->Enable();
+                mxMtrRed->set_sensitive(true);
                 const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
 
                 if(pItem)
                 {
                     const sal_Int64 nRed = pItem->GetValue();
-                    mpMtrRed->SetValue( nRed );
+                    mxMtrRed->set_value(nRed, FieldUnit::PERCENT);
                 }
             }
             else if(SfxItemState::DISABLED == eState)
             {
-                mpMtrRed->Disable();
+                mxMtrRed->set_sensitive(false);
             }
             else
             {
-                mpMtrRed->Enable();
-                mpMtrRed->SetText(OUString());
+                mxMtrRed->set_sensitive(true);
+                mxMtrRed->set_text(OUString());
             }
             break;
         }
@@ -357,23 +338,23 @@ void GraphicPropertyPanel::NotifyItemUpdate(
         {
             if(eState >= SfxItemState::DEFAULT)
             {
-                mpMtrGreen->Enable();
+                mxMtrGreen->set_sensitive(true);
                 const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
 
                 if(pItem)
                 {
                     const sal_Int64 nGreen = pItem->GetValue();
-                    mpMtrGreen->SetValue( nGreen );
+                    mxMtrGreen->set_value(nGreen, FieldUnit::PERCENT);
                 }
             }
             else if(SfxItemState::DISABLED == eState)
             {
-                mpMtrGreen->Disable();
+                mxMtrGreen->set_sensitive(false);
             }
             else
             {
-                mpMtrGreen->Enable();
-                mpMtrGreen->SetText(OUString());
+                mxMtrGreen->set_sensitive(true);
+                mxMtrGreen->set_text(OUString());
             }
             break;
         }
@@ -381,23 +362,23 @@ void GraphicPropertyPanel::NotifyItemUpdate(
         {
             if(eState >= SfxItemState::DEFAULT)
             {
-                mpMtrBlue->Enable();
+                mxMtrBlue->set_sensitive(true);
                 const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
 
                 if(pItem)
                 {
                     const sal_Int64 nBlue = pItem->GetValue();
-                    mpMtrBlue->SetValue( nBlue );
+                    mxMtrBlue->set_value(nBlue, FieldUnit::PERCENT);
                 }
             }
             else if(SfxItemState::DISABLED == eState)
             {
-                mpMtrBlue->Disable();
+                mxMtrBlue->set_sensitive(false);
             }
             else
             {
-                mpMtrBlue->Enable();
-                mpMtrBlue->SetText(OUString());
+                mxMtrBlue->set_sensitive(true);
+                mxMtrBlue->set_text(OUString());
             }
             break;
         }
@@ -405,23 +386,23 @@ void GraphicPropertyPanel::NotifyItemUpdate(
         {
             if(eState >= SfxItemState::DEFAULT)
             {
-                mpMtrGamma->Enable();
+                mxMtrGamma->set_sensitive(true);
                 const SfxUInt32Item* pItem = dynamic_cast< const SfxUInt32Item* >(pState);
 
                 if(pItem)
                 {
                     const sal_Int64 nGamma = pItem->GetValue();
-                    mpMtrGamma->SetValue( nGamma );
+                    mxMtrGamma->set_value( nGamma );
                 }
             }
             else if(SfxItemState::DISABLED == eState)
             {
-                mpMtrGamma->Disable();
+                mxMtrGamma->set_sensitive(false);
             }
             else
             {
-                mpMtrGamma->Enable();
-                mpMtrGamma->SetText(OUString());
+                mxMtrGamma->set_sensitive(true);
+                mxMtrGamma->set_text(OUString());
             }
             break;
         }
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
index 459d203deb62..519d0e275349 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
@@ -19,17 +19,10 @@
 #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_GRAPHIC_GRAPHICPROPERTYPANEL_HXX
 #define INCLUDED_SVX_SOURCE_SIDEBAR_GRAPHIC_GRAPHICPROPERTYPANEL_HXX
 
-#include <vcl/ctrl.hxx>
 #include <sfx2/sidebar/SidebarPanelBase.hxx>
 #include <sfx2/sidebar/ControllerItem.hxx>
 #include <svx/sidebar/PanelLayout.hxx>
-#include <vcl/fixed.hxx>
-
-class FixedText;
-class MetricField;
-class ListBox;
-class FloatingWindow;
-
+#include <vcl/weld.hxx>
 
 namespace svx { namespace sidebar {
 
@@ -63,16 +56,6 @@ public:
         SfxBindings* pBindings);
 
 private:
-    //ui controls
-    VclPtr<MetricField>                                        mpMtrBrightness;
-    VclPtr<MetricField>                                        mpMtrContrast;
-    VclPtr<ListBox>                                            mpLBColorMode;
-    VclPtr<MetricField>                                        mpMtrTrans;
-    VclPtr<MetricField>                                        mpMtrRed;
-    VclPtr<MetricField>                                        mpMtrGreen;
-    VclPtr<MetricField>                                        mpMtrBlue;
-    VclPtr<MetricField>                                        mpMtrGamma;
-
     ::sfx2::sidebar::ControllerItem                     maBrightControl;
     ::sfx2::sidebar::ControllerItem                     maContrastControl;
     ::sfx2::sidebar::ControllerItem                     maTransparenceControl;
@@ -84,19 +67,28 @@ private:
 
     SfxBindings* const                                  mpBindings;
 
-    DECL_LINK( ModifyBrightnessHdl, Edit&, void );
-    DECL_LINK( ModifyContrastHdl, Edit&, void );
-    DECL_LINK( ModifyTransHdl, Edit&, void );
-    DECL_LINK( ClickColorModeHdl, ListBox&, void );
-    DECL_LINK( RedHdl, Edit&, void );
-    DECL_LINK( GreenHdl, Edit&, void );
-    DECL_LINK( BlueHdl, Edit&, void );
-    DECL_LINK( GammaHdl, Edit&, void );
+    //ui controls
+    std::unique_ptr<weld::MetricSpinButton> mxMtrBrightness;
+    std::unique_ptr<weld::MetricSpinButton> mxMtrContrast;
+    std::unique_ptr<weld::ComboBox> mxLBColorMode;
+    std::unique_ptr<weld::MetricSpinButton> mxMtrTrans;
+    std::unique_ptr<weld::MetricSpinButton> mxMtrRed;
+    std::unique_ptr<weld::MetricSpinButton> mxMtrGreen;
+    std::unique_ptr<weld::MetricSpinButton> mxMtrBlue;
+    std::unique_ptr<weld::SpinButton> mxMtrGamma;
+
+    DECL_LINK( ModifyBrightnessHdl, weld::MetricSpinButton&, void );
+    DECL_LINK( ModifyContrastHdl, weld::MetricSpinButton&, void );
+    DECL_LINK( ModifyTransHdl, weld::MetricSpinButton&, void );
+    DECL_LINK( ClickColorModeHdl, weld::ComboBox&, void );
+    DECL_LINK( RedHdl, weld::MetricSpinButton&, void );
+    DECL_LINK( GreenHdl, weld::MetricSpinButton&, void );
+    DECL_LINK( BlueHdl, weld::MetricSpinButton&, void );
+    DECL_LINK( GammaHdl, weld::SpinButton&, void );
 
     void Initialize();
 };
 
-
 } } // end of namespace svx::sidebar
 
 #endif
diff --git a/svx/uiconfig/ui/sidebargraphic.ui b/svx/uiconfig/ui/sidebargraphic.ui
index 6adf1aad5d74..2407f973a050 100644
--- a/svx/uiconfig/ui/sidebargraphic.ui
+++ b/svx/uiconfig/ui/sidebargraphic.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="svx">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkAdjustment" id="0to100adjustment">
@@ -20,6 +20,30 @@
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
+  <object class="GtkAdjustment" id="plusminus100adjustment1">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="plusminus100adjustment2">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="plusminus100adjustment3">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="plusminus100adjustment4">
+    <property name="lower">-100</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <object class="GtkGrid" id="GraphicPropertyPanel">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -45,7 +69,7 @@
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes" context="sidebargraphic|brightnesslabel">_Brightness:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">setbrightness:%</property>
+                <property name="mnemonic_widget">setbrightness</property>
                 <property name="xalign">0</property>
               </object>
               <packing>
@@ -54,17 +78,14 @@
               </packing>
             </child>
             <child>
-              <object class="GtkSpinButton" id="setbrightness:%">
+              <object class="GtkSpinButton" id="setbrightness">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="has_tooltip">True</property>
                 <property name="tooltip_text" translatable="yes" context="sidebargraphic|setbrightness|tooltip_text">Specify the luminance of the graphic.</property>
                 <property name="adjustment">plusminus100adjustment</property>
-                <accessibility>
-                  <relation type="labelled-by" target="brightnesslabel"/>
-                </accessibility>
                 <child internal-child="accessible">
-                  <object class="AtkObject" id="setbrightness:%-atkobject">
+                  <object class="AtkObject" id="setbrightness-atkobject">
                     <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setbrightness-atkobject">Brightness</property>
                   </object>
                 </child>
@@ -80,7 +101,7 @@
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes" context="sidebargraphic|contrastlabel">_Contrast:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">setcontrast:%</property>
+                <property name="mnemonic_widget">setcontrast</property>
                 <property name="xalign">0</property>
               </object>
               <packing>
@@ -89,17 +110,14 @@
               </packing>
             </child>
             <child>
-              <object class="GtkSpinButton" id="setcontrast:%">
+              <object class="GtkSpinButton" id="setcontrast">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="has_tooltip">True</property>
                 <property name="tooltip_text" translatable="yes" context="sidebargraphic|setcontrast|tooltip_text">Specify the degree of difference between the lightest and darkest parts of the graphic.</property>
-                <property name="adjustment">plusminus100adjustment</property>
-                <accessibility>
-                  <relation type="labelled-by" target="contrastlabel"/>
-                </accessibility>
+                <property name="adjustment">plusminus100adjustment1</property>
                 <child internal-child="accessible">
-                  <object class="AtkObject" id="setcontrast:%-atkobject">
+                  <object class="AtkObject" id="setcontrast-atkobject">
                     <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setcontrast-atkobject">Contrast</property>
                   </object>
                 </child>
@@ -127,9 +145,6 @@
               <object class="GtkComboBoxText" id="setcolormode">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <accessibility>
-                  <relation type="labelled-by" target="colorlmodelabel"/>
-                </accessibility>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="setcolormode-atkobject">
                     <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setcolormode-atkobject">Color mode</property>
@@ -147,7 +162,7 @@
                 <property name="can_focus">False</property>
                 <property name="label" translatable="yes" context="sidebargraphic|transparencylabel">_Transparency:</property>
                 <property name="use_underline">True</property>
-                <property name="mnemonic_widget">setgraphtransparency:%</property>
+                <property name="mnemonic_widget">setgraphtransparency</property>
                 <property name="xalign">0</property>
               </object>
               <packing>
@@ -156,17 +171,14 @@
               </packing>
             </child>
             <child>
-              <object class="GtkSpinButton" id="setgraphtransparency:%">
+              <object class="GtkSpinButton" id="setgraphtransparency">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="has_tooltip">True</property>
                 <property name="tooltip_text" translatable="yes" context="sidebargraphic|setgraphtransparency|tooltip_text">Specify the percentage of transparency; 0% is fully opaque and 100% is fully transparent.</property>
                 <property name="adjustment">0to100adjustment</property>
-                <accessibility>
-                  <relation type="labelled-by" target="transparencylabel"/>
-                </accessibility>
                 <child internal-child="accessible">
-                  <object class="AtkObject" id="setgraphtransparency:%-atkobject">
+                  <object class="AtkObject" id="setgraphtransparency-atkobject">
                     <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setgraphtransparency-atkobject">Transparency</property>
                   </object>
                 </child>
@@ -187,7 +199,7 @@
                     <property name="can_focus">False</property>
                     <property name="halign">center</property>
                     <property name="valign">center</property>
-                    <property name="pixbuf">svx/res/symphony/AdjustColorRed_16x16.png</property>
+                    <property name="icon_name">svx/res/symphony/AdjustColorRed_16x16.png</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -196,14 +208,14 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkSpinButton" id="setred:%">
+                  <object class="GtkSpinButton" id="setred">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="has_tooltip">True</property>
                     <property name="tooltip_text" translatable="yes" context="sidebargraphic|setred|tooltip_text">Red</property>
-                    <property name="adjustment">plusminus100adjustment</property>
+                    <property name="adjustment">plusminus100adjustment2</property>
                     <child internal-child="accessible">
-                      <object class="AtkObject" id="setred:%-atkobject">
+                      <object class="AtkObject" id="setred-atkobject">
                         <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setred-atkobject">Red</property>
                       </object>
                     </child>
@@ -231,7 +243,7 @@
                     <property name="can_focus">False</property>
                     <property name="halign">center</property>
                     <property name="valign">center</property>
-                    <property name="pixbuf">svx/res/symphony/AdjustColorGreen_16x16.png</property>
+                    <property name="icon_name">svx/res/symphony/AdjustColorGreen_16x16.png</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -240,14 +252,14 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkSpinButton" id="setgreen:%">
+                  <object class="GtkSpinButton" id="setgreen">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="has_tooltip">True</property>
                     <property name="tooltip_text" translatable="yes" context="sidebargraphic|setgreen|tooltip_text">Green</property>
-                    <property name="adjustment">plusminus100adjustment</property>
+                    <property name="adjustment">plusminus100adjustment3</property>
                     <child internal-child="accessible">
-                      <object class="AtkObject" id="setgreen:%-atkobject">
+                      <object class="AtkObject" id="setgreen-atkobject">
                         <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setgreen-atkobject">Green</property>
                       </object>
                     </child>
@@ -276,7 +288,7 @@
                     <property name="can_focus">False</property>
                     <property name="halign">center</property>
                     <property name="valign">center</property>
-                    <property name="pixbuf">svx/res/symphony/AdjustColorBlue_16x16.png</property>
+                    <property name="icon_name">svx/res/symphony/AdjustColorBlue_16x16.png</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -285,14 +297,14 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkSpinButton" id="setblue:%">
+                  <object class="GtkSpinButton" id="setblue">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="has_tooltip">True</property>
                     <property name="tooltip_text" translatable="yes" context="sidebargraphic|setblue|tooltip_text">Blue</property>
-                    <property name="adjustment">plusminus100adjustment</property>
+                    <property name="adjustment">plusminus100adjustment4</property>
                     <child internal-child="accessible">
-                      <object class="AtkObject" id="setblue:%-atkobject">
+                      <object class="AtkObject" id="setblue-atkobject">
                         <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setblue-atkobject">Blue</property>
                       </object>
                     </child>
@@ -320,7 +332,7 @@
                     <property name="can_focus">False</property>
                     <property name="halign">center</property>
                     <property name="valign">center</property>
-                    <property name="pixbuf">svx/res/symphony/AdjustColorGamma_16x16.png</property>
+                    <property name="icon_name">svx/res/symphony/AdjustColorGamma_16x16.png</property>
                   </object>
                   <packing>
                     <property name="expand">False</property>
@@ -329,18 +341,15 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkSpinButton" id="setgamma:0">
+                  <object class="GtkSpinButton" id="setgamma">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="has_tooltip">True</property>
                     <property name="tooltip_text" translatable="yes" context="sidebargraphic|setgamma|tooltip_text">Specify the gamma value that affects the brightness of the midtone values.</property>
                     <property name="adjustment">gammaadjustment</property>
                     <property name="digits">2</property>
-                    <accessibility>
-                        <relation target="image4"/>
-                    </accessibility>
                     <child internal-child="accessible">
-                      <object class="AtkObject" id="setgamma:0-atkobject">
+                      <object class="AtkObject" id="setgamma-atkobject">
                         <property name="AtkObject::accessible-name" translatable="yes" context="sidebargraphic|setgamma-atkobject">Gamma value</property>
                       </object>
                     </child>


More information about the Libreoffice-commits mailing list