sw/source/uibase/shells/drwtxtex.cxx |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 9cab1cc8d37b0116eec36d09738186f291af3766
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Oct 10 20:37:59 2022 +0100
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Oct 12 10:12:39 2022 +0200

    assert from SfxItemSet::CloneAsValue with SfxAllItemSet
    
    in writer with insert, shape, add some text, change its
    text color.
    
    so like:
    
    commit fe2ec505786bacc6f3baca3292367903644ac99b
    Date:   Fri Feb 18 10:56:56 2022 +0200
    
        improve the SfxItemSet::CloneAsValue check
    
        to prevent object slicing.
    
    revert the asserting hunk.
    
    Change-Id: Iea2b118a9072eccf930c61eb85c1684149aa9e02
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141187
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index 1a5f3a8665d4..9f23ed7e6b7d 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -128,9 +128,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
     const sal_uInt16 nSlot = rReq.GetSlot();
 
     const sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
-    std::optional<SfxItemSet> pNewAttrs;
-    if (rReq.GetArgs())
-        pNewAttrs.emplace(rReq.GetArgs()->CloneAsValue());
+    std::unique_ptr<SfxItemSet> pNewAttrs(rReq.GetArgs() ? 
rReq.GetArgs()->Clone() : nullptr);
 
     bool bRestoreSelection = false;
     ESelection aOldSelection;

Reply via email to