svx/sdi/svx.sdi                   |    6 +++---
 svx/source/tbxctrls/grafctrl.cxx  |   35 ++++++++++++++++++++---------------
 sw/source/uibase/shells/grfsh.cxx |   31 +++++++++++++++++++++++++++----
 3 files changed, 50 insertions(+), 22 deletions(-)

New commits:
commit 87072f393332dad52d7e0614aceffcc180ed392f
Author:     Mohit Marathe <[email protected]>
AuthorDate: Tue Jul 22 16:30:11 2025 +0530
Commit:     Mohit Marathe <[email protected]>
CommitDate: Thu Jul 24 07:48:31 2025 +0200

    sw: handle param of graphic related uno commands
    
    Handles param of GrafLuminance, GrafContrast, GrafMode, and
    GrafTransparence
    
    Signed-off-by: Mohit Marathe <[email protected]>
    Change-Id: I824ddab9ad3efbd5f0739126a1d25ceca3908a83
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188156
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Pranam Lashkari <[email protected]>

diff --git a/sw/source/uibase/shells/grfsh.cxx 
b/sw/source/uibase/shells/grfsh.cxx
index c508b0d4e86c..75c13f0c6765 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <svl/intitem.hxx>
+#include <vcl/GraphicAttributes.hxx>
 #include <cmdid.h>
 #include <hintids.hxx>
 #include <tools/urlobj.hxx>
@@ -609,16 +611,26 @@ void SwGrfShell::ExecAttr( SfxRequest const &rReq )
             break;
 
         case SID_ATTR_GRAF_LUMINANCE:
-            if( pItem )
+        {
+            const SfxInt16Item* pBrightness = 
rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
+            if (pBrightness)
+                aGrfSet.Put( SwLuminanceGrf( pBrightness->GetValue() ) );
+            else if( pItem )
                 aGrfSet.Put( SwLuminanceGrf(
                             static_cast<const 
SfxInt16Item*>(pItem)->GetValue() ));
             break;
+        }
 
         case SID_ATTR_GRAF_CONTRAST:
-            if( pItem )
+        {
+            const SfxInt16Item* pContrast = 
rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
+            if (pContrast)
+                aGrfSet.Put( SwContrastGrf( pContrast->GetValue() ) );
+            else if( pItem )
                 aGrfSet.Put( SwContrastGrf(
                             static_cast<const 
SfxInt16Item*>(pItem)->GetValue() ));
             break;
+        }
 
         case SID_ATTR_GRAF_RED:
             if( pItem )
@@ -647,10 +659,15 @@ void SwGrfShell::ExecAttr( SfxRequest const &rReq )
             break;
 
         case SID_ATTR_GRAF_TRANSPARENCE:
-            if( pItem )
+        {
+            const SfxInt16Item* pTransparence = 
rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
+            if (pTransparence)
+                aGrfSet.Put( SwTransparencyGrf( pTransparence->GetValue() ) );
+            else if( pItem )
                 aGrfSet.Put( SwTransparencyGrf(
                     static_cast< sal_Int8 >( static_cast<const 
SfxUInt16Item*>(pItem )->GetValue() ) ) );
             break;
+        }
 
         case SID_ATTR_GRAF_INVERT:
             if( pItem )
@@ -659,10 +676,16 @@ void SwGrfShell::ExecAttr( SfxRequest const &rReq )
             break;
 
         case SID_ATTR_GRAF_MODE:
-            if( pItem )
+        {
+            const SfxInt16Item* pMode = rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
+            if (pMode)
+                aGrfSet.Put( SwDrawModeGrf(
+                            static_cast<GraphicDrawMode>( pMode->GetValue() ) 
));
+            else if( pItem )
                 aGrfSet.Put( SwDrawModeGrf(
                             static_cast<GraphicDrawMode>(static_cast<const 
SfxUInt16Item*>(pItem)->GetValue()) ));
             break;
+        }
 
         case SID_COLOR_SETTINGS:
         {
commit d64eaa363855a4b5df51010ae804757f5758c56e
Author:     Mohit Marathe <[email protected]>
AuthorDate: Mon Jul 21 13:00:36 2025 +0530
Commit:     Mohit Marathe <[email protected]>
CommitDate: Thu Jul 24 07:48:18 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]>

diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 64fd8003b168..076ea7facb5d 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -3903,7 +3903,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;
 
commit 7cea5f3e961aa1082a84297e66da0b33626155bb
Author:     Mohit Marathe <[email protected]>
AuthorDate: Fri Jul 18 15:16:19 2025 +0530
Commit:     Mohit Marathe <[email protected]>
CommitDate: Thu Jul 24 07:48:11 2025 +0200

    svx lok: .uno:GrafTransparence: add Transparency parameter
    
    To add a Transparency menubutton with pre-canned values, we need to
    send a uno command with a parameter with a particular transparency
    value.
    
    Signed-off-by: Mohit Marathe <[email protected]>
    Change-Id: I888135343032858b64c84e21d2892fe7d5d352c5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188099
    Reviewed-by: Pranam Lashkari <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 7227200f963f..64fd8003b168 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -3941,7 +3941,7 @@ SfxInt16Item GrafRed SID_ATTR_GRAF_RED
 
 
 SfxUInt16Item GrafTransparence SID_ATTR_GRAF_TRANSPARENCE
-
+(SfxInt16Item Transparency FN_PARAM_1)
 [
     AutoUpdate = TRUE,
     FastCall = FALSE,
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 3fa4b6cbedbb..2f7441eba942 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -586,12 +586,13 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& 
rReq, SdrView& rView )
 
         case SID_ATTR_GRAF_TRANSPARENCE:
         {
-            if( pItem )
-            {
+            const SfxInt16Item* pTransparency = 
rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
+            if ( pTransparency )
+                aSet.Put( SdrGrafTransparenceItem( pTransparency->GetValue() 
));
+            else if( pItem )
                 aSet.Put( SdrGrafTransparenceItem( static_cast<const 
SfxUInt16Item*>(pItem)->GetValue() ));
-                if( bUndo )
-                    aUndoStr += SvxResId( RID_SVXSTR_UNDO_GRAFTRANSPARENCY );
-            }
+            if( bUndo && ( pTransparency || pItem ) )
+                aUndoStr += SvxResId( RID_SVXSTR_UNDO_GRAFTRANSPARENCY );
         }
         break;
 
commit 807e017ccf189dcadd26343fed69f35e42f02c9f
Author:     Mohit Marathe <[email protected]>
AuthorDate: Wed Jul 16 15:28:39 2025 +0530
Commit:     Mohit Marathe <[email protected]>
CommitDate: Thu Jul 24 07:48:01 2025 +0200

    svx lok: .uno:GrafContrast: add Contrast parameter
    
    To add a Contrast menubutton with pre-canned values, we need to
    send a uno command with a parameter with a particular contrast
    value.
    
    Signed-off-by: Mohit Marathe <[email protected]>
    Change-Id: I7caa870fd93dd48204458e81e861b5e7375d47e9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187952
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Pranam Lashkari <[email protected]>

diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 38267001956f..7227200f963f 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -3808,7 +3808,7 @@ SfxInt16Item GrafBlue SID_ATTR_GRAF_BLUE
 
 
 SfxInt16Item GrafContrast SID_ATTR_GRAF_CONTRAST
-
+(SfxInt16Item Contrast FN_PARAM_1)
 [
     AutoUpdate = TRUE,
     FastCall = FALSE,
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index a8c0dddec7e4..3fa4b6cbedbb 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -561,12 +561,15 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& 
rReq, SdrView& rView )
 
         case SID_ATTR_GRAF_CONTRAST:
         {
-            if( pItem )
-            {
+            const SfxInt16Item* pContrast = 
rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
+            if (pContrast)
+                aSet.Put( SdrGrafContrastItem( pContrast->GetValue() ) );
+            else if( pItem )
                 aSet.Put( SdrGrafContrastItem( static_cast<const 
SfxInt16Item*>(pItem)->GetValue() ));
-                if( bUndo )
-                    aUndoStr += SvxResId( RID_SVXSTR_UNDO_GRAFCONTRAST );
-            }
+
+            if (bUndo && (pContrast || pItem))
+                aUndoStr += SvxResId( RID_SVXSTR_UNDO_GRAFCONTRAST );
+
         }
         break;
 

Reply via email to