include/svx/svxids.hrc                              |    4 ++--
 svx/source/sidebar/graphic/GraphicPropertyPanel.cxx |    9 ++++-----
 2 files changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 895a1e89e2b3e37eb1a2fd0dd494ddd385bd0456
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Feb 2 13:24:47 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Feb 3 08:15:31 2022 +0100

    SID_ATTR_GRAF_TRANSPARENCE and SID_ATTR_GRAF_MODE have conflicting types
    
    Meant to be SfxUInt16Item, until the below commit accidentally
    introduced SfxInt16Item usage.
    
    commit 4d814ec1518c98d2ca251a5a10287f40a427ea6e
        Author: Armin Le Grand <a...@apache.org>
        Date:   Wed Apr 24 09:50:54 2013 +0000
        Related: #i122111# Adapted pState usages in NotifyItemUpdate methods
    
    Change-Id: I2aff5cc1eea9257186b4da12a73f928503bc233c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129353
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index fb974d2af8b4..07d10bb1ee97 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -712,9 +712,9 @@ class XFillGradientItem;
 #define SID_ATTR_GRAF_GREEN                             ( SID_SVX_START + 866 )
 #define SID_ATTR_GRAF_BLUE                              ( SID_SVX_START + 867 )
 #define SID_ATTR_GRAF_GAMMA                             ( SID_SVX_START + 868 )
-#define SID_ATTR_GRAF_TRANSPARENCE                      ( SID_SVX_START + 869 )
+#define SID_ATTR_GRAF_TRANSPARENCE                      
TypedWhichId<SfxUInt16Item>( SID_SVX_START + 869 )
 #define SID_ATTR_GRAF_INVERT                            ( SID_SVX_START + 870 )
-#define SID_ATTR_GRAF_MODE                              ( SID_SVX_START + 871 )
+#define SID_ATTR_GRAF_MODE                              
TypedWhichId<SfxUInt16Item>( SID_SVX_START + 871 )
 
 // CAUTION! Range <877 .. 877> used by EditEngine (!)
 
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx 
b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
index 5fb1e4448c71..5503649551e6 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
@@ -108,7 +108,7 @@ IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyContrastHdl, 
weld::MetricSpinButton
 IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyTransHdl, 
weld::MetricSpinButton&, void )
 {
     const sal_Int16 nTrans = mxMtrTrans->get_value(FieldUnit::PERCENT);
-    const SfxInt16Item aTransItem( SID_ATTR_GRAF_TRANSPARENCE, nTrans );
+    const SfxUInt16Item aTransItem( SID_ATTR_GRAF_TRANSPARENCE, nTrans );
     GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_TRANSPARENCE,
             SfxCallMode::RECORD, { &aTransItem });
 }
@@ -117,7 +117,7 @@ IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyTransHdl, 
weld::MetricSpinButton&,
 IMPL_LINK_NOARG( GraphicPropertyPanel, ClickColorModeHdl, weld::ComboBox&, 
void )
 {
     const sal_Int16 nTrans = mxLBColorMode->get_active();
-    const SfxInt16Item aTransItem( SID_ATTR_GRAF_MODE, nTrans );
+    const SfxUInt16Item aTransItem( SID_ATTR_GRAF_MODE, nTrans );
     GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_MODE,
             SfxCallMode::RECORD, { &aTransItem });
 }
@@ -218,11 +218,10 @@ void GraphicPropertyPanel::NotifyItemUpdate(
             if(eState >= SfxItemState::DEFAULT)
             {
                 mxLBColorMode->set_sensitive(true);
-                const SfxUInt16Item* pItem = dynamic_cast< const 
SfxUInt16Item* >(pState);
 
-                if(pItem)
+                if(pState)
                 {
-                    const sal_Int64 nTrans = pItem->GetValue();
+                    const sal_uInt16 nTrans = static_cast< const 
SfxUInt16Item* >(pState)->GetValue();
                     mxLBColorMode->set_active(nTrans);
                 }
             }

Reply via email to