summaryrefslogtreecommitdiff
path: root/vcl/source/app/svmain.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-03 16:19:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-04 14:19:27 +0200
commitb9757f5cfdb62b24e79eeb4c0ef0c8b98056cecf (patch)
tree3eef79200ccbbf509117cc8c44ed4a1b07d645c4 /vcl/source/app/svmain.cxx
parent270946b220692e466b1eaaed85e4b08ea876fee2 (diff)
loplugin:useuniqueptr in vcl/svdata
Change-Id: I4e5c50e2dde40b4047020fed2733a3e47ed4208e Reviewed-on: https://gerrit.libreoffice.org/59950 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/app/svmain.cxx')
-rw-r--r--vcl/source/app/svmain.cxx71
1 files changed, 14 insertions, 57 deletions
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 9e4e3ca1a04a..beed24273e0d 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -359,12 +359,12 @@ bool InitVCL()
// convert path to native file format
OUString aNativeFileName;
osl::FileBase::getSystemPathFromFileURL( aExeFileName, aNativeFileName );
- pSVData->maAppData.mpAppFileName = new OUString( aNativeFileName );
+ pSVData->maAppData.mxAppFileName = aNativeFileName;
// Initialize global data
pSVData->maGDIData.mxScreenFontList.reset(new PhysicalFontCollection);
pSVData->maGDIData.mxScreenFontCache.reset(new ImplFontCache);
- pSVData->maGDIData.mpGrfConverter = new GraphicConverter;
+ pSVData->maGDIData.mpGrfConverter = new GraphicConverter;
g_bIsLeanException = getenv("LO_LEAN_EXCEPTION") != nullptr;
// Set exception handler
@@ -473,29 +473,21 @@ void DeInitVCL()
pExceptionHandler = nullptr;
// free global data
- delete pSVData->maGDIData.mpGrfConverter;
-
- if( pSVData->mpSettingsConfigItem )
+ if (pSVData->maGDIData.mpGrfConverter)
{
- delete pSVData->mpSettingsConfigItem;
- pSVData->mpSettingsConfigItem = nullptr;
+ delete pSVData->maGDIData.mpGrfConverter;
+ pSVData->maGDIData.mpGrfConverter = nullptr;
}
+ pSVData->mpSettingsConfigItem.reset();
+
Scheduler::ImplDeInitScheduler();
pSVData->maWinData.maMsgBoxImgList.clear();
pSVData->maCtrlData.maCheckImgList.clear();
pSVData->maCtrlData.maRadioImgList.clear();
- if ( pSVData->maCtrlData.mpDisclosurePlus )
- {
- delete pSVData->maCtrlData.mpDisclosurePlus;
- pSVData->maCtrlData.mpDisclosurePlus = nullptr;
- }
- if ( pSVData->maCtrlData.mpDisclosureMinus )
- {
- delete pSVData->maCtrlData.mpDisclosureMinus;
- pSVData->maCtrlData.mpDisclosureMinus = nullptr;
- }
+ pSVData->maCtrlData.mpDisclosurePlus.reset();
+ pSVData->maCtrlData.mpDisclosureMinus.reset();
pSVData->mpDefaultWin.disposeAndClear();
#ifndef NDEBUG
@@ -540,56 +532,21 @@ void DeInitVCL()
delete pSVData->maAppData.mpCfgListener;
}
- delete pSVData->maAppData.mpSettings;
- pSVData->maAppData.mpSettings = nullptr;
+ pSVData->maAppData.mpSettings.reset();
}
- if ( pSVData->maAppData.mpAccelMgr )
+ if (pSVData->maAppData.mpAccelMgr)
{
delete pSVData->maAppData.mpAccelMgr;
pSVData->maAppData.mpAccelMgr = nullptr;
}
- if ( pSVData->maAppData.mpAppFileName )
- {
- delete pSVData->maAppData.mpAppFileName;
- pSVData->maAppData.mpAppFileName = nullptr;
- }
- if ( pSVData->maAppData.mpAppName )
- {
- delete pSVData->maAppData.mpAppName;
- pSVData->maAppData.mpAppName = nullptr;
- }
- if ( pSVData->maAppData.mpDisplayName )
- {
- delete pSVData->maAppData.mpDisplayName;
- pSVData->maAppData.mpDisplayName = nullptr;
- }
- if ( pSVData->maAppData.mpToolkitName )
- {
- delete pSVData->maAppData.mpToolkitName;
- pSVData->maAppData.mpToolkitName = nullptr;
- }
- if ( pSVData->maAppData.mpEventListeners )
- {
- delete pSVData->maAppData.mpEventListeners;
- pSVData->maAppData.mpEventListeners = nullptr;
- }
- if ( pSVData->maAppData.mpKeyListeners )
- {
- delete pSVData->maAppData.mpKeyListeners;
- pSVData->maAppData.mpKeyListeners = nullptr;
- }
- if (pSVData->mpBlendFrameCache)
- {
- delete pSVData->mpBlendFrameCache;
- pSVData->mpBlendFrameCache = nullptr;
- }
+ pSVData->maAppData.maKeyListeners.clear();
+ pSVData->mpBlendFrameCache.reset();
ImplDeletePrnQueueList();
// destroy all Sal interfaces before destroying the instance
// and thereby unloading the plugin
- delete pSVData->mpSalSystem;
- pSVData->mpSalSystem = nullptr;
+ pSVData->mpSalSystem.reset();
assert( !pSVData->maSchedCtx.mpSalTimer );
delete pSVData->maSchedCtx.mpSalTimer;
pSVData->maSchedCtx.mpSalTimer = nullptr;