include/svx/compressgraphicdialog.hxx       |    1 +
 svx/source/dialog/compressgraphicdialog.cxx |   16 +++++++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 79018bac2ed73fbfaacf661ae1272086e3ddd342
Author:     Heiko Tietze <tietze.he...@gmail.com>
AuthorDate: Thu Jan 4 14:45:13 2024 +0100
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Fri Jan 5 07:36:33 2024 +0100

    Resolves tdf#158780 - Disable resolution controls initially
    
    Change-Id: I80e620085868925643d4b7561cd7aeff2d9c930f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161620
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/include/svx/compressgraphicdialog.hxx 
b/include/svx/compressgraphicdialog.hxx
index 088d0b6fd45e..d46220d17a1f 100644
--- a/include/svx/compressgraphicdialog.hxx
+++ b/include/svx/compressgraphicdialog.hxx
@@ -79,6 +79,7 @@ private:
     DECL_DLLPRIVATE_LINK( OkayClickHdl, weld::Button&, void );
 
     void Update();
+    void UpdateSensitivity(const bool bSensitive);
     void UpdateNewWidthMF();
     void UpdateNewHeightMF();
     void UpdateResolutionLB();
diff --git a/svx/source/dialog/compressgraphicdialog.cxx 
b/svx/source/dialog/compressgraphicdialog.cxx
index 35899bec2f5f..df1d3a8c3db6 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -108,6 +108,8 @@ void CompressGraphicsDialog::recallParameter()
     m_xQualitySlider->set_value( memp.QualityMF );
 
     m_xInterpolationCombo->set_active( memp.InterpolationCombo );
+
+    UpdateSensitivity(m_xReduceResolutionCB->get_active());
 }
 
 void CompressGraphicsDialog::Initialize()
@@ -207,6 +209,14 @@ void CompressGraphicsDialog::Update()
     m_xFixedText6->set_label("??");
 }
 
+void CompressGraphicsDialog::UpdateSensitivity(const bool bSensitive)
+{
+    m_xMFNewWidth->set_sensitive(bSensitive);
+    m_xMFNewHeight->set_sensitive(bSensitive);
+    m_xResolutionLB->set_sensitive(bSensitive);
+    m_xInterpolationCombo->set_sensitive(bSensitive);
+}
+
 void CompressGraphicsDialog::UpdateNewWidthMF()
 {
     int nPixelX = static_cast<sal_Int32>( GetViewWidthInch() * m_dResolution );
@@ -353,11 +363,7 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, 
ToggleCompressionRB, weld::Toggleable&,
 
 IMPL_LINK_NOARG( CompressGraphicsDialog, ToggleReduceResolutionRB, 
weld::Toggleable&, void )
 {
-    bool choice = m_xReduceResolutionCB->get_active();
-    m_xMFNewWidth->set_sensitive(choice);
-    m_xMFNewHeight->set_sensitive(choice);
-    m_xResolutionLB->set_sensitive(choice);
-    m_xInterpolationCombo->set_sensitive(choice);
+    UpdateSensitivity(m_xReduceResolutionCB->get_active());
     Update();
 }
 

Reply via email to