svx/sdi/svx.sdi                  |    2 +-
 svx/source/tbxctrls/grafctrl.cxx |   11 ++++++-----
 2 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit eaa6757c5cb7865435367f0b80f13a8170f125a8
Author:     Mohit Marathe <[email protected]>
AuthorDate: Mon Jul 21 13:00:36 2025 +0530
Commit:     Mohit Marathe <[email protected]>
CommitDate: Wed Sep 24 15:12:54 2025 +0200

    svx lok: .uno:GrafMode: add ColorMode parameter
    
    To add a Color Mode menubutton with pre-canned values, we need to
    send a uno command with a parameter with a particular color mode
    
    Signed-off-by: Mohit Marathe <[email protected]>
    Change-Id: Ic03e75d4e6431ebc6d071fa2dfbeb911e5a6d661
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188100
    Reviewed-by: Pranam Lashkari <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit d64eaa363855a4b5df51010ae804757f5758c56e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191436
    Tested-by: Jenkins

diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 6cfdf2d0e732..84e08899c853 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -3921,7 +3921,7 @@ SfxInt16Item GrafLuminance SID_ATTR_GRAF_LUMINANCE
 
 
 SfxUInt16Item GrafMode SID_ATTR_GRAF_MODE
-
+(SfxInt16Item ColorMode FN_PARAM_1)
 [
     AutoUpdate = TRUE,
     FastCall = FALSE,
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 2f7441eba942..87046c0f5191 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -598,12 +598,13 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& 
rReq, SdrView& rView )
 
         case SID_ATTR_GRAF_MODE:
         {
-            if( pItem )
-            {
+            const SfxInt16Item* pMode = rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
+            if ( pMode )
+                aSet.Put( SdrGrafModeItem( static_cast<GraphicDrawMode>( 
pMode->GetValue() ) ) );
+            else if( pItem )
                 aSet.Put( SdrGrafModeItem( 
static_cast<GraphicDrawMode>(static_cast<const 
SfxUInt16Item*>(pItem)->GetValue()) ));
-                if( bUndo )
-                    aUndoStr += SvxResId( RID_SVXSTR_UNDO_GRAFMODE );
-            }
+            if( bUndo && ( pMode || pItem ) )
+                aUndoStr += SvxResId( RID_SVXSTR_UNDO_GRAFMODE );
         }
         break;
 

Reply via email to