starmath/source/view.cxx | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-)
New commits: commit e0394fe4c0fe0900b502d5db266991464697cfd3 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Oct 23 01:20:55 2024 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Oct 23 09:23:49 2024 +0200 tdf#163486: PVS: Expression is always true V547 Expression 'pWin' is always true. Change-Id: Ib7f302c06f1bbfded89d97767197447788ffdd71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175462 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 13bc165e3a54..70ed1dbb8cb6 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1508,28 +1508,22 @@ void SmViewShell::Execute(SfxRequest& rReq) break; } - bool bCallExec = nullptr == pWin; - if( !bCallExec ) + if( pWin ) { - if (pWin) + TransferableDataHelper aDataHelper( + TransferableDataHelper::CreateFromClipboard( + pWin->GetClipboard())); + + if( aDataHelper.GetTransferable().is() && + aDataHelper.HasFormat( SotClipboardFormatId::STRING )) + pWin->Paste(); + else { - TransferableDataHelper aDataHelper( - TransferableDataHelper::CreateFromClipboard( - pWin->GetClipboard())); - - if( aDataHelper.GetTransferable().is() && - aDataHelper.HasFormat( SotClipboardFormatId::STRING )) - pWin->Paste(); - else - bCallExec = true; + GetViewFrame().GetDispatcher()->ExecuteList( + SID_PASTEOBJECT, SfxCallMode::RECORD, + { new SfxVoidItem(SID_PASTEOBJECT) }); } } - if( bCallExec ) - { - GetViewFrame().GetDispatcher()->ExecuteList( - SID_PASTEOBJECT, SfxCallMode::RECORD, - { new SfxVoidItem(SID_PASTEOBJECT) }); - } } break;