sc/source/ui/view/formatsh.cxx |   30 +++++++++---------------------
 svx/sdi/svx.sdi                |    7 ++++++-
 2 files changed, 15 insertions(+), 22 deletions(-)

New commits:
commit dbd528e05fd71080a0f12d42b3204e607ff02f43
Author:     Xisco Fauli <[email protected]>
AuthorDate: Wed Jan 14 13:05:43 2026 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Jan 16 12:00:57 2026 +0100

    tdf#168438: fix parameters in LineStyle (SID_FRAME_LINESTYLE)
    
    after
    commit 49956b7a30916c67a8ca4cad56bf5194033f9e48
    Author: Pranam Lashkari <[email protected]>
    Date:   Wed Aug 13 21:55:40 2025 +0530
    
        uno: added parameters to LineStyle (SID_FRAME_LINESTYLE)
    
    SID_FRAME_LINESTYLE was removed from the list of parameters,
    so add it back and remove the duplicated SfxInt16Item LineStyle FN_PARAM_1
    parameter
    Also simplify the code in ScFormatShell::ExecuteAttr by using HasItem
    
    Change-Id: I16025ac37a4f1cf2842356ed86b411eba2fa1bf6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197270
    Tested-by: Jenkins
    Reviewed-by: Pranam Lashkari <[email protected]>

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 32ab6afdff17..a7f21b68b548 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1092,34 +1092,22 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
                 {
                     // Update default line
                     ::editeng::SvxBorderLine aLine;
-                    const ::editeng::SvxBorderLine* pLine = nullptr;
-                    const SfxInt16Item* lineStyleItem = 
rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
+                    const ::editeng::SvxBorderLine* pLine = 
pNewAttrs->Get(SID_FRAME_LINESTYLE).GetLine();
 
-                    if (lineStyleItem)
+                    const SfxPoolItem *pItem1, *pItem2, *pItem3;
+                    if (pNewAttrs->HasItem(FN_PARAM_1, &pItem1) &&
+                            pNewAttrs->HasItem(FN_PARAM_2, &pItem2) &&
+                            pNewAttrs->HasItem(FN_PARAM_3, &pItem3))
                     {
-                        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;
+                        sal_uInt16 nInnerLineWidth = static_cast<const 
SfxUInt16Item*>(pItem1)->GetValue();
+                        sal_uInt16 nOuterLineWidth = static_cast<const 
SfxUInt16Item*>(pItem2)->GetValue();
+                        sal_uInt16 nLineDistanceItem = static_cast<const 
SfxUInt16Item*>(pItem3)->GetValue();
 
                         aLine.GuessLinesWidths(
-                            lineStyle, InnerLineWidth, OuterLineWidth, 
LineDistance);
+                            pLine->GetBorderLineStyle(), nInnerLineWidth, 
nOuterLineWidth, nLineDistanceItem);
 
                         pLine = &aLine;
                     }
-                    else
-                    {
-                        pLine = pNewAttrs->Get(SID_FRAME_LINESTYLE).GetLine();
-                    }
 
                     if ( pLine )
                     {
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index cd0a9ab59ac1..3a0a67b95b11 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -5914,7 +5914,12 @@ 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)
+(
+    SvxLineItem LineStyle SID_FRAME_LINESTYLE,
+    SfxInt16Item InnerLineWidth FN_PARAM_1,
+    SfxInt16Item OuterLineWidth FN_PARAM_2,
+    SfxInt16Item LineDistance FN_PARAM_3
+)
 [
     AutoUpdate = FALSE,
     FastCall = FALSE,

Reply via email to