diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-12 14:17:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-13 09:28:44 +0200 |
commit | 639df4d76d545ca23021f69a9d738a9a92c148cd (patch) | |
tree | 87b20ea1518f6a878102a367c211cb6f93c554fd /vcl | |
parent | 9dce6f74b1b43293b40217c1163c8d4285251e97 (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')
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx | 2 | ||||
-rw-r--r-- | vcl/source/image/ImplImageTree.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5SalFrame.cxx | 2 | ||||
-rw-r--r-- | vcl/win/gdi/salprn.cxx | 2 | ||||
-rw-r--r-- | vcl/win/window/salframe.cxx | 4 |
6 files changed, 7 insertions, 7 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 4f5d18c7eb85..93c37f7a426f 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -971,7 +971,7 @@ void Qt5Frame::UpdateSettings(AllSettings& rSettings) style.SetCursorBlinkTime(flash_time != 0 ? flash_time / 2 : STYLE_CURSOR_NOBLINKTIME); // Menu - std::unique_ptr<QMenuBar> pMenuBar = std::unique_ptr<QMenuBar>(new QMenuBar()); + std::unique_ptr<QMenuBar> pMenuBar = std::make_unique<QMenuBar>(); QPalette qMenuCG = pMenuBar->palette(); // Menu text and background color, theme specific diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx index 075408df88c8..67f82f782195 100644 --- a/vcl/source/image/ImplImageTree.cxx +++ b/vcl/source/image/ImplImageTree.cxx @@ -520,7 +520,7 @@ ImplImageTree::IconCache &ImplImageTree::getIconCache(const ImageRequestParamete auto it = rSet.maScaledIconCaches.find(rParameters.mnScalePercentage); if ( it != rSet.maScaledIconCaches.end() ) return *it->second.get(); - rSet.maScaledIconCaches[rParameters.mnScalePercentage] = std::unique_ptr<IconCache>(new IconCache); + rSet.maScaledIconCaches[rParameters.mnScalePercentage] = std::make_unique<IconCache>(); return *rSet.maScaledIconCaches[rParameters.mnScalePercentage].get(); } diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx b/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx index a2ea6b7bbefd..47289d49cf27 100644 --- a/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx +++ b/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx @@ -214,7 +214,7 @@ FilePickerIpc::FilePickerIpc(KDE5FilePicker* filePicker, QObject* parent) // read IPC commands and their args in a separate thread, so this does not block everything else; // 'commandReceived' signal is emitted every time a command and its args have been read; // thread will run until the filepicker process is terminated - m_ipcReaderThread = std::unique_ptr<std::thread>{ new std::thread(readCommands, this) }; + m_ipcReaderThread = std::make_unique<std::thread>{ readCommands, this }; } FilePickerIpc::~FilePickerIpc() diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx index d3a13968237f..cae8bd843423 100644 --- a/vcl/unx/kde5/KDE5SalFrame.cxx +++ b/vcl/unx/kde5/KDE5SalFrame.cxx @@ -194,7 +194,7 @@ void KDE5SalFrame::UpdateSettings(AllSettings& rSettings) style.SetCursorBlinkTime(flash_time != 0 ? flash_time / 2 : STYLE_CURSOR_NOBLINKTIME); // Menu - std::unique_ptr<QMenuBar> pMenuBar = std::unique_ptr<QMenuBar>(new QMenuBar()); + std::unique_ptr<QMenuBar> pMenuBar = std::make_unique<QMenuBar>(); aFont = toFont(pMenuBar->font(), rSettings.GetUILanguageTag().getLocale()); style.SetMenuFont(aFont); 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) ); } |