From dc9b1ee0a5144ce182407d10466eab682f7da62a Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 14 Nov 2019 11:16:04 +0100 Subject: tdf#130286: jsdialogs: fix CID 1455691 & CID 1455690 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idbb3e70c1a09be7dd7c43747250f3a6368251cd9 Reviewed-on: https://gerrit.libreoffice.org/82662 Tested-by: Jenkins Reviewed-by: Szymon Kłos (cherry picked from commit 77cc0e929ee331af6b97b65e9b6ec5400ef05cd4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87733 Reviewed-by: Miklos Vajna --- sw/source/uibase/shells/drwtxtex.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 519c6a98c2f3..fae34754fe5a 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -651,16 +651,19 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) return; } - std::unique_ptr pNewArgs = pNewAttrs->Clone(); - lcl_convertStringArguments(nSlot, pNewArgs); - - if(nEEWhich && pNewAttrs) + std::unique_ptr pNewArgs = pNewAttrs ? pNewAttrs->Clone() : nullptr; + if (pNewArgs) { - std::unique_ptr pNewItem(pNewArgs->Get(nWhich).CloneSetWhich(nEEWhich)); - pNewArgs->Put(*pNewItem); - } + lcl_convertStringArguments(nSlot, pNewArgs); + + if (nEEWhich) + { + std::unique_ptr pNewItem(pNewArgs->Get(nWhich).CloneSetWhich(nEEWhich)); + pNewArgs->Put(*pNewItem); + } - SetAttrToMarked(*pNewArgs); + SetAttrToMarked(*pNewArgs); + } GetView().GetViewFrame()->GetBindings().InvalidateAll(false); -- cgit