sd/source/ui/view/drviews2.cxx |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 6df85675378a5a90b0d89d712015e010f6893c9f
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Mar 1 13:45:09 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue Mar 1 17:53:43 2022 +0100

    fix assert when changing fill on impress shape
    
    reverts part of
        commit 31e7845339b30a69f06a04619660398fe4267268
        Author: Noel Grandin <noel.gran...@collabora.co.uk>
        Date:   Thu Feb 17 12:19:49 2022 +0200
        use more SfxItemSet::CloneAsValue
    
    Change-Id: I5f385525adcdb73199a6eb4b057e275341fb85b8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130765
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 1cd427e8b6f8..bef73c1726d3 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -543,12 +543,12 @@ public:
     }
 };
 
-    void lcl_convertStringArguments(sal_uInt16 nSlot, SfxItemSet& rArgs)
+    void lcl_convertStringArguments(sal_uInt16 nSlot, const 
std::unique_ptr<SfxItemSet>& pArgs)
     {
         Color aColor;
         const SfxPoolItem* pItem = nullptr;
 
-        if (SfxItemState::SET == rArgs.GetItemState(SID_ATTR_LINE_WIDTH_ARG, 
false, &pItem))
+        if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_LINE_WIDTH_ARG, 
false, &pItem))
         {
             double fValue = static_cast<const 
SvxDoubleItem*>(pItem)->GetValue();
             // FIXME: different units...
@@ -556,9 +556,9 @@ public:
             int nValue = fValue * nPow;
 
             XLineWidthItem aItem(nValue);
-            rArgs.Put(aItem);
+            pArgs->Put(aItem);
         }
-        if (SfxItemState::SET == rArgs.GetItemState(SID_ATTR_COLOR_STR, false, 
&pItem))
+        if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, 
false, &pItem))
         {
             OUString sColor = static_cast<const 
SfxStringItem*>(pItem)->GetValue();
 
@@ -572,26 +572,26 @@ public:
                 case SID_ATTR_LINE_COLOR:
                 {
                     XLineColorItem aLineColorItem(OUString(), aColor);
-                    rArgs.Put(aLineColorItem);
+                    pArgs->Put(aLineColorItem);
                     break;
                 }
 
                 case SID_ATTR_FILL_COLOR:
                 {
                     XFillColorItem aFillColorItem(OUString(), aColor);
-                    rArgs.Put(aFillColorItem);
+                    pArgs->Put(aFillColorItem);
                     break;
                 }
             }
         }
-        if (SfxItemState::SET == rArgs.GetItemState(SID_FILL_GRADIENT_JSON, 
false, &pItem))
+        if (SfxItemState::SET == pArgs->GetItemState(SID_FILL_GRADIENT_JSON, 
false, &pItem))
         {
             const SfxStringItem* pJSON = static_cast<const 
SfxStringItem*>(pItem);
             if (pJSON)
             {
                 XGradient aGradient = XGradient::fromJSON(pJSON->GetValue());
                 XFillGradientItem aItem(aGradient);
-                rArgs.Put(aItem);
+                pArgs->Put(aItem);
             }
         }
     }
@@ -683,9 +683,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         {
             if( rReq.GetArgs() )
             {
-                SfxItemSet aNewArgs = rReq.GetArgs()->CloneAsValue();
-                lcl_convertStringArguments(rReq.GetSlot(), aNewArgs);
-                mpDrawView->SetAttributes(aNewArgs);
+                std::unique_ptr<SfxItemSet> pNewArgs = rReq.GetArgs()->Clone();
+                lcl_convertStringArguments(rReq.GetSlot(), pNewArgs);
+                mpDrawView->SetAttributes(*pNewArgs);
                 rReq.Done();
             }
             else

Reply via email to