summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-12 14:17:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-13 09:28:44 +0200
commit639df4d76d545ca23021f69a9d738a9a92c148cd (patch)
tree87b20ea1518f6a878102a367c211cb6f93c554fd /vcl/win
parent9dce6f74b1b43293b40217c1163c8d4285251e97 (diff)
use more std::make_unique
Change-Id: I7d85cbc9105c5e0c4a8d9a69c4ac9d6dfc07eabd Reviewed-on: https://gerrit.libreoffice.org/70663 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/gdi/salprn.cxx2
-rw-r--r--vcl/win/window/salframe.cxx4
2 files changed, 3 insertions, 3 deletions
diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx
index 9f729a14bdde..8119bad8cdb7 100644
--- a/vcl/win/gdi/salprn.cxx
+++ b/vcl/win/gdi/salprn.cxx
@@ -1205,7 +1205,7 @@ OUString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sal
DWORD nBins = ImplDeviceCaps( this, DC_BINNAMES, nullptr, pSetupData );
if ( (nPaperBin < nBins) && (nBins != GDI_ERROR) )
{
- auto pBuffer = std::unique_ptr<sal_Unicode[]>(new sal_Unicode[nBins*24]);
+ auto pBuffer = std::make_unique<sal_Unicode[]>(nBins*24);
DWORD nRet = ImplDeviceCaps( this, DC_BINNAMES, reinterpret_cast<BYTE*>(pBuffer.get()), pSetupData );
if ( nRet && (nRet != GDI_ERROR) )
aPaperBinName = OUString( pBuffer.get() + (nPaperBin*24) );
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 16cdf0e8579f..bf2c15bca26d 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -4967,7 +4967,7 @@ static bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
LONG nTextLen = ImmGetCompositionStringW( hIMC, GCS_RESULTSTR, nullptr, 0 ) / sizeof( WCHAR );
if ( nTextLen >= 0 )
{
- auto pTextBuf = std::unique_ptr<WCHAR[]>(new WCHAR[nTextLen]);
+ auto pTextBuf = std::make_unique<WCHAR[]>(nTextLen);
ImmGetCompositionStringW( hIMC, GCS_RESULTSTR, pTextBuf.get(), nTextLen*sizeof( WCHAR ) );
aEvt.maText = OUString( o3tl::toU(pTextBuf.get()), static_cast<sal_Int32>(nTextLen) );
}
@@ -4993,7 +4993,7 @@ static bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
if ( nTextLen > 0 )
{
{
- auto pTextBuf = std::unique_ptr<WCHAR[]>(new WCHAR[nTextLen]);
+ auto pTextBuf = std::make_unique<WCHAR[]>(nTextLen);
ImmGetCompositionStringW( hIMC, GCS_COMPSTR, pTextBuf.get(), nTextLen*sizeof( WCHAR ) );
aEvt.maText = OUString( o3tl::toU(pTextBuf.get()), static_cast<sal_Int32>(nTextLen) );
}