diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-13 20:42:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-14 10:13:46 +0200 |
commit | 8e39ef66928a3e37c618d3a70a631e71266db274 (patch) | |
tree | 8cab0264e58c885ae7d78a77d90fd041bcdbe15d /vcl/source/window/winproc.cxx | |
parent | d7e06e46acc2ee17101cef63e59b9f5efcbfab14 (diff) |
extend loplugin useuniqueptr to POD types
Change-Id: I6ff24f048bd8f75bf87a78b718f37b57855d4781
Reviewed-on: https://gerrit.libreoffice.org/39932
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/window/winproc.cxx')
-rw-r--r-- | vcl/source/window/winproc.cxx | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 9cfb68742127..e7621bb58a40 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1140,11 +1140,7 @@ static bool ImplHandleExtTextInput( vcl::Window* pWindow, { pChild->ImplGetWindowImpl()->mbExtTextInput = true; pWinData->mpExtOldText = new OUString; - if ( pWinData->mpExtOldAttrAry ) - { - delete [] pWinData->mpExtOldAttrAry; - pWinData->mpExtOldAttrAry = nullptr; - } + pWinData->mpExtOldAttrAry.reset(); pSVData->maWinData.mpExtTextInputWin = pChild; ImplCallCommand( pChild, CommandEventId::StartExtTextInput ); } @@ -1190,15 +1186,11 @@ static bool ImplHandleExtTextInput( vcl::Window* pWindow, nCursorPos, nCursorFlags, bOnlyCursor ); *pWinData->mpExtOldText = rText; - if ( pWinData->mpExtOldAttrAry ) - { - delete [] pWinData->mpExtOldAttrAry; - pWinData->mpExtOldAttrAry = nullptr; - } + pWinData->mpExtOldAttrAry.reset(); if ( pTextAttr ) { - pWinData->mpExtOldAttrAry = new ExtTextInputAttr[rText.getLength()]; - memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.getLength()*sizeof( ExtTextInputAttr ) ); + pWinData->mpExtOldAttrAry.reset( new ExtTextInputAttr[rText.getLength()] ); + memcpy( pWinData->mpExtOldAttrAry.get(), pTextAttr, rText.getLength()*sizeof( ExtTextInputAttr ) ); } return !ImplCallCommand( pChild, CommandEventId::ExtTextInput, &aData ); } @@ -1219,11 +1211,7 @@ static bool ImplHandleEndExtTextInput() delete pWinData->mpExtOldText; pWinData->mpExtOldText = nullptr; } - if ( pWinData->mpExtOldAttrAry ) - { - delete [] pWinData->mpExtOldAttrAry; - pWinData->mpExtOldAttrAry = nullptr; - } + pWinData->mpExtOldAttrAry.reset(); bRet = !ImplCallCommand( pChild, CommandEventId::EndExtTextInput ); } |