[Libreoffice-commits] .: desktop/win32 svx/source sysui/source

Norbert Thiebaud nthiebaud at kemper.freedesktop.org
Mon Oct 18 17:02:21 PDT 2010


 desktop/win32/source/guistdio/guistdio.inc         |    4 ++--
 desktop/win32/source/officeloader/officeloader.cxx |   10 +++++-----
 svx/source/dialog/sendreportw32.cxx                |    5 +++--
 sysui/source/win32/QuickStart/QuickStart.cpp       |    6 +++---
 4 files changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 86ec8c1520e2a2354707445b3182f3371df522ac
Author: Florian Bircher <florian.bi at gmx.net>
Date:   Mon Oct 18 18:54:59 2010 -0500

    use SAL_N_ELEMENTS

diff --git a/desktop/win32/source/guistdio/guistdio.inc b/desktop/win32/source/guistdio/guistdio.inc
index 7009b24..05d462d 100644
--- a/desktop/win32/source/guistdio/guistdio.inc
+++ b/desktop/win32/source/guistdio/guistdio.inc
@@ -411,13 +411,13 @@ int _tmain( int, _TCHAR ** )
 			};
 
  #ifdef UNOPKG       
-        dwWaitResult = WaitForMultipleObjects( elementsof(hObjects), hObjects, TRUE, INFINITE );
+        dwWaitResult = WaitForMultipleObjects( SAL_N_ELEMENTS(hObjects), hObjects, TRUE, INFINITE );
  #else        
 		bool	bDetach = false;
 		int		nOpenPipes = 2;
 		do
 		{
-			dwWaitResult = WaitForMultipleObjects( elementsof(hObjects), hObjects, FALSE, INFINITE );
+			dwWaitResult = WaitForMultipleObjects( SAL_N_ELEMENTS(hObjects), hObjects, FALSE, INFINITE );
 
 			switch ( dwWaitResult )
 			{
diff --git a/desktop/win32/source/officeloader/officeloader.cxx b/desktop/win32/source/officeloader/officeloader.cxx
index c5e34dc..cce56b0 100644
--- a/desktop/win32/source/officeloader/officeloader.cxx
+++ b/desktop/win32/source/officeloader/officeloader.cxx
@@ -230,7 +230,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
             TEXT("FastPipeCommunication"),
             TEXT("0"),
             szKey,
-            elementsof(szKey),
+            SAL_N_ELEMENTS(szKey),
             szPerfTuneIniFile
             );
 
@@ -258,10 +258,10 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
 
                 fSuccess = ConvertSidToStringSid( pSid, &szUserIdent );
 
-                _tcsncpy( szPipeName, PIPE_PREFIX, elementsof(szPipeName) );
-                _tcsncat( szPipeName, szUserIdent, elementsof(szPipeName) - _tcslen(szPipeName) - 1 );
-                _tcsncat( szPipeName, PIPE_POSTFIX, elementsof(szPipeName) - _tcslen(szPipeName) - 1 );
-                _tcsncat( szPipeName, _ultot( SUPD, szSUPD, 10), elementsof(szPipeName) - _tcslen(szPipeName) - 1 );
+                _tcsncpy( szPipeName, PIPE_PREFIX, SAL_N_ELEMENTS(szPipeName) );
+                _tcsncat( szPipeName, szUserIdent, SAL_N_ELEMENTS(szPipeName) - _tcslen(szPipeName) - 1 );
+                _tcsncat( szPipeName, PIPE_POSTFIX, SAL_N_ELEMENTS(szPipeName) - _tcslen(szPipeName) - 1 );
+                _tcsncat( szPipeName, _ultot( SUPD, szSUPD, 10), SAL_N_ELEMENTS(szPipeName) - _tcslen(szPipeName) - 1 );
 
                 LocalFree( szUserIdent );
 
diff --git a/svx/source/dialog/sendreportw32.cxx b/svx/source/dialog/sendreportw32.cxx
index 1eba75c..b50dc0c 100644
--- a/svx/source/dialog/sendreportw32.cxx
+++ b/svx/source/dialog/sendreportw32.cxx
@@ -39,6 +39,7 @@
 #include <tchar.h>
 #include <stdio.h>
 #include <systools/win32/uwinapi.h>
+#include <sal/macros.h>
 
 // need to undef min and max macros from MS headers here to make
 // the std::min and std::max from stl visible again
@@ -199,7 +200,7 @@ namespace svx{
             TCHAR	szTempPath[MAX_PATH];
             TCHAR	szFileName[MAX_PATH];
 
-            GetTempPath( elementsof(szTempPath), szTempPath );
+            GetTempPath( SAL_N_ELEMENTS(szTempPath), szTempPath );
             GetTempFileName( szTempPath, TEXT("DSC"), 0, szFileName );
 
             FILE *fp = _tfopen( szFileName, _T("wb") );
@@ -226,7 +227,7 @@ namespace svx{
                 ZeroMemory( &StartupInfo, sizeof(StartupInfo) );
                 StartupInfo.cb = sizeof(StartupInfo.cb);
 
-                sntprintf( szBuffer, elementsof(szBuffer),
+                sntprintf( szBuffer, SAL_N_ELEMENTS(szBuffer),
                     _T("%s -noui -load -send"),
                     szPath );
 
diff --git a/sysui/source/win32/QuickStart/QuickStart.cpp b/sysui/source/win32/QuickStart/QuickStart.cpp
index 8e37560..204b3d3 100644
--- a/sysui/source/win32/QuickStart/QuickStart.cpp
+++ b/sysui/source/win32/QuickStart/QuickStart.cpp
@@ -102,11 +102,11 @@ void NotifyListener( HWND hWnd )
     nid.cbSize = sizeof(NOTIFYICONDATA); 
     nid.hWnd   = hWnd; 
     nid.uID    = IDM_QUICKSTART; 
-    nid.szTip[elementsof(nid.szTip) - 1] = 0;
+    nid.szTip[SAL_N_ELEMENTS(nid.szTip) - 1] = 0;
 //    nid.hIcon = bTerminateVeto ? hIconActive : hIconInActive;
-//    strncpy(nid.szTip, bTerminateVeto ? STRING_QUICKSTARTACTIVE : STRING_QUICKSTARTINACTIVE, elementsof(nid.szTip) - 1 ); 
+//    strncpy(nid.szTip, bTerminateVeto ? STRING_QUICKSTARTACTIVE : STRING_QUICKSTARTINACTIVE, SAL_N_ELEMENTS(nid.szTip) - 1 );
     nid.hIcon = hIconActive;
-    strncpy(nid.szTip, szTooltipString, elementsof(nid.szTip) - 1); 
+    strncpy(nid.szTip, szTooltipString, SAL_N_ELEMENTS(nid.szTip) - 1);
     nid.uFlags = NIF_TIP|NIF_ICON; 
 
     // update systray


More information about the Libreoffice-commits mailing list