summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-10-10 20:37:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-10-12 09:50:59 +0200
commit56b8703d6f759326f7ac1a84ca0e6d1c9b40aad7 (patch)
tree9e1fab906a20b8b8115519874e6523c35e21e8b8
parent001de7e21d29fccff904fe23de05afd68922fe2e (diff)
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/+/141168 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/uibase/shells/drwtxtex.cxx4
1 files changed, 1 insertions, 3 deletions
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;