summaryrefslogtreecommitdiff
path: root/vcl/win/window
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-10-15 01:57:12 +0300
committerStephan Bergmann <sbergman@redhat.com>2019-10-17 09:53:42 +0200
commitd51db77c8d87f210785a8a8c6dd875f7bacddb3c (patch)
treefd1ab208d49e85371fc9bb321539ce137bdaf719 /vcl/win/window
parentc8eaadb5d70f42723517bb028f363e37726be256 (diff)
Remove some memset calls
Replace them with default initialization or calloc Change-Id: I747f53c2ced2d0473fd5a5ede4f8520a0633dcc1 Reviewed-on: https://gerrit.libreoffice.org/80805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/win/window')
-rw-r--r--vcl/win/window/salframe.cxx22
-rw-r--r--vcl/win/window/salmenu.cxx6
2 files changed, 8 insertions, 20 deletions
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 73028b8a48ec..e021bfd216e9 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -868,10 +868,6 @@ WinSalFrame::WinSalFrame()
mnDisplay = 0;
mbPropertiesStored = false;
- memset( &maState, 0, sizeof( SalFrameState ) );
-
- memset( &maGeometry, 0, sizeof( maGeometry ) );
-
// get data, when making 1st frame
if ( !pSalData->mpFirstFrame )
{
@@ -4341,8 +4337,7 @@ static bool ImplHandleMinMax( HWND hWnd, LPARAM lParam )
// if bByPosition is false then nPos denotes a menu id instead of a position
static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, bool bByPosition=true )
{
- MENUITEMINFOW mi;
- memset(&mi, 0, sizeof(mi));
+ MENUITEMINFOW mi = {};
mi.cbSize = sizeof( mi );
mi.fMask = MIIM_DATA;
if( !GetMenuItemInfoW( hMenu, nPos, bByPosition, &mi) )
@@ -4354,8 +4349,7 @@ static WinSalMenuItem* ImplGetSalMenuItem( HMENU hMenu, UINT nPos, bool bByPosit
// returns the index of the currently selected item if any or -1
static int ImplGetSelectedIndex( HMENU hMenu )
{
- MENUITEMINFOW mi;
- memset(&mi, 0, sizeof(mi));
+ MENUITEMINFOW mi = {};
mi.cbSize = sizeof( mi );
mi.fMask = MIIM_STATE;
int n = GetMenuItemCount( hMenu );
@@ -4430,8 +4424,7 @@ static LRESULT ImplMeasureItem( HWND hWnd, WPARAM wParam, LPARAM lParam )
HDC hdc = GetDC( hWnd );
SIZE strSize;
- NONCLIENTMETRICSW ncm;
- memset( &ncm, 0, sizeof(ncm) );
+ NONCLIENTMETRICSW ncm = {};
ncm.cbSize = sizeof( ncm );
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
@@ -4569,8 +4562,7 @@ static LRESULT ImplDrawItem(HWND, WPARAM wParam, LPARAM lParam )
x += bmpSize.Width() + 3;
aRect.left = x;
- NONCLIENTMETRICSW ncm;
- memset( &ncm, 0, sizeof(ncm) );
+ NONCLIENTMETRICSW ncm = {};
ncm.cbSize = sizeof( ncm );
SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
@@ -4703,8 +4695,7 @@ static bool ImplHandleMenuSelect( HWND hWnd, WPARAM wParam, LPARAM lParam )
{
// submenu selected
// wParam now carries an index instead of an id -> retrieve id
- MENUITEMINFOW mi;
- memset(&mi, 0, sizeof(mi));
+ MENUITEMINFOW mi = {};
mi.cbSize = sizeof( mi );
mi.fMask = MIIM_ID;
if( GetMenuItemInfoW( hMenu, LOWORD(wParam), TRUE, &mi) )
@@ -4892,8 +4883,7 @@ static void ImplHandleInputLangChange( HWND hWnd, WPARAM, LPARAM lParam )
static void ImplUpdateIMECursorPos( WinSalFrame* pFrame, HIMC hIMC )
{
- COMPOSITIONFORM aForm;
- memset( &aForm, 0, sizeof( aForm ) );
+ COMPOSITIONFORM aForm = {};
// get cursor position and from it calculate default position
// for the composition window
diff --git a/vcl/win/window/salmenu.cxx b/vcl/win/window/salmenu.cxx
index 9466d0cf8052..190f50730474 100644
--- a/vcl/win/window/salmenu.cxx
+++ b/vcl/win/window/salmenu.cxx
@@ -179,8 +179,7 @@ void WinSalMenu::RemoveItem( unsigned nPos )
{
WinSalMenuItem *pSalMenuItem = nullptr;
- MENUITEMINFOW mi;
- memset( &mi, 0, sizeof(mi) );
+ MENUITEMINFOW mi = {};
mi.cbSize = sizeof( mi );
mi.fMask = MIIM_DATA;
if( !GetMenuItemInfoW( mhMenu, nPos, TRUE, &mi) )
@@ -206,8 +205,7 @@ static void ImplRemoveItemById( WinSalMenu *pSalMenu, unsigned nItemId )
WinSalMenuItem *pSalMenuItem = nullptr;
- MENUITEMINFOW mi;
- memset( &mi, 0, sizeof(mi) );
+ MENUITEMINFOW mi = {};
mi.cbSize = sizeof( mi );
mi.fMask = MIIM_DATA;
if( !GetMenuItemInfoW( pSalMenu->mhMenu, nItemId, FALSE, &mi) )