sc/source/ui/view/formatsh.cxx   |   32 +++++++++++++++++++++++++++++---
 sfx2/source/control/unoctitm.cxx |    1 +
 svx/sdi/svx.sdi                  |    2 +-
 3 files changed, 31 insertions(+), 4 deletions(-)

New commits:
commit b50cc9c40ee51500ae21cd092cb2c6d4b056b709
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Thu Aug 14 08:04:49 2025 +0530
Commit:     Pranam Lashkari <lpra...@collabora.com>
CommitDate: Fri Aug 15 11:55:42 2025 +0200

    sc: disable line style button if border is not set
    
    problem:
    sidebar would disable this button as and when needed but
    toolbar was not doing the same
    
    Change-Id: I08ba037f630b64ee9048112282c4fa83835eaf50
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189557
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    (cherry picked from commit a4339162a6ca17f3fffe599086e7db5c9e101c78)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189650
    Tested-by: Jenkins
    Reviewed-by: Pranam Lashkari <lpra...@collabora.com>

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 79270342fd2b..f0d89bd259e3 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1467,6 +1467,8 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet )
                         SvxLineItem aItem(SID_FRAME_LINESTYLE);
                         aItem.SetLine(&aLine);
                         rSet.Put( aItem );
+                        if (!aLine.GetWidth())
+                            rSet.DisableItem(SID_FRAME_LINESTYLE);
                     }
                 }
             }
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 35805da2f5ef..7c4e2bdc72a2 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1385,6 +1385,7 @@ const std::map<std::u16string_view, KitUnoCommand>& 
GetKitUnoCommandList()
         { u"AnimationEffects", { PayloadType::EnabledPayload, true } },
         { u"ExecuteAnimationEffect", { PayloadType::EnabledPayload, true } },
         { u"PasteSlide", { PayloadType::EnabledPayload, true } },
+        { u"LineStyle", { PayloadType::EnabledPayload, true } },
 
         { u"ParaLeftToRight", { PayloadType::ParaDirectionPayload, true } },
         { u"ParaRightToLeft", { PayloadType::ParaDirectionPayload, true } },
commit 49956b7a30916c67a8ca4cad56bf5194033f9e48
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Wed Aug 13 21:55:40 2025 +0530
Commit:     Pranam Lashkari <lpra...@collabora.com>
CommitDate: Fri Aug 15 11:55:30 2025 +0200

    uno: added parameters to LineStyle (SID_FRAME_LINESTYLE)
    
    Change-Id: I0993bd10da42bfc29dedce3d50524889bc7a3447
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189518
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    (cherry picked from commit 0357d749487ad540a3779d2c3af23357c942620b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189649
    Tested-by: Jenkins
    Reviewed-by: Pranam Lashkari <lpra...@collabora.com>

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 25118bf6f54f..79270342fd2b 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1060,9 +1060,32 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
             case SID_FRAME_LINESTYLE:
                 {
                     // Update default line
-                    const ::editeng::SvxBorderLine* pLine =
-                                pNewAttrs->Get( SID_FRAME_LINESTYLE ).
-                                GetLine();
+                    const ::editeng::SvxBorderLine* pLine = new 
::editeng::SvxBorderLine();
+                    const SfxInt16Item* lineStyleItem = 
rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
+
+                    if (lineStyleItem)
+                    {
+                        const SfxInt16Item* InnerLineWidthItem
+                            = rReq.GetArg<SfxInt16Item>(FN_PARAM_2);
+                        const SfxInt16Item* OuterLineWidthItem
+                            = rReq.GetArg<SfxInt16Item>(FN_PARAM_3);
+                        const SfxInt16Item* LineDistanceItem
+                            = rReq.GetArg<SfxInt16Item>(FN_PARAM_4);
+
+                        sal_uInt16 InnerLineWidth, OuterLineWidth, 
LineDistance;
+                        SvxBorderLineStyle lineStyle
+                            = 
static_cast<SvxBorderLineStyle>(lineStyleItem->GetValue());
+                        InnerLineWidth = InnerLineWidthItem ? 
InnerLineWidthItem->GetValue() : 0;
+                        OuterLineWidth = OuterLineWidthItem ? 
OuterLineWidthItem->GetValue() : 0;
+                        LineDistance = LineDistanceItem ? 
LineDistanceItem->GetValue() : 0;
+
+                        
const_cast<::editeng::SvxBorderLine*>(pLine)->GuessLinesWidths(
+                            lineStyle, InnerLineWidth, OuterLineWidth, 
LineDistance);
+                    }
+                    else
+                    {
+                        pLine = pNewAttrs->Get(SID_FRAME_LINESTYLE).GetLine();
+                    }
 
                     if ( pLine )
                     {
@@ -1090,6 +1113,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
                         pTabViewShell->SetDefaultFrameLine( &aDefLine );
                         pTabViewShell->SetSelectionFrameLines( nullptr, false 
);
                     }
+                    rReq.Done();
                 }
                 break;
 
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index b62bf0c38f04..294a99c73628 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -5843,7 +5843,7 @@ SvxULSpaceItem BelowSpacing SID_ATTR_PARA_BELOWSPACE
 
 
 SvxLineItem LineStyle SID_FRAME_LINESTYLE
-
+(SfxInt16Item LineStyle FN_PARAM_1, SfxInt16Item InnerLineWidth FN_PARAM_2, 
SfxInt16Item OuterLineWidth FN_PARAM_3, SfxInt16Item LineDistance FN_PARAM_4)
 [
     AutoUpdate = FALSE,
     FastCall = FALSE,

Reply via email to