summaryrefslogtreecommitdiff
path: root/sal/workben
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2014-12-19 11:07:02 +0100
committerNoel Grandin <noelgrandin@gmail.com>2014-12-19 13:51:34 +0000
commit2ee336fb556ceb1d7e1ee8017c27539da7fe543b (patch)
tree7332ba839b28f112397104596a601c3506bd5973 /sal/workben
parent5712983f18e7cdec16ea20a9b3d94a1586de543e (diff)
fdo#39440 sal: reduce scope of local variables
This addresses some cppcheck warnings. Change-Id: Id5f90757571e76a2c05a4cbd37020e1f6a6b2033 Reviewed-on: https://gerrit.libreoffice.org/13544 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sal/workben')
-rw-r--r--sal/workben/clipboardwben/testcopy/XTDataObject.cxx3
-rw-r--r--sal/workben/testfile.cxx12
2 files changed, 6 insertions, 9 deletions
diff --git a/sal/workben/clipboardwben/testcopy/XTDataObject.cxx b/sal/workben/clipboardwben/testcopy/XTDataObject.cxx
index ac7b60e27e3e..bd42b0194464 100644
--- a/sal/workben/clipboardwben/testcopy/XTDataObject.cxx
+++ b/sal/workben/clipboardwben/testcopy/XTDataObject.cxx
@@ -105,12 +105,13 @@ STDMETHODIMP CXTDataObject::GetData(LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium
if ( CF_TEXT == pFormatetc->cfFormat )
{
- char buff[] = "Hello World, How are you!";
LPSTREAM lpStream;
hr = CreateStreamOnHGlobal( NULL, FALSE, &lpStream );
if ( SUCCEEDED( hr ) )
{
+ char buff[] = "Hello World, How are you!";
+
hr = lpStream->Write( buff, sizeof( buff ) * sizeof( char ), NULL );
if ( SUCCEEDED( hr ) )
{
diff --git a/sal/workben/testfile.cxx b/sal/workben/testfile.cxx
index 49ec449af3b7..cbe504317197 100644
--- a/sal/workben/testfile.cxx
+++ b/sal/workben/testfile.cxx
@@ -114,7 +114,6 @@ sal_Bool Initialize( void )
rtl::OUString iniFileURL;
File *pFile;
- sal_Unicode *pExeFileCount;
FileBase::RC rc;
@@ -132,7 +131,7 @@ sal_Bool Initialize( void )
if ( ProcessError == osl_Process_E_None)
{
- pExeFileCount=rtl_uString_getStr(strExeFileURL)+rtl_uString_getLength(strExeFileURL);
+ sal_Unicode *pExeFileCount=rtl_uString_getStr(strExeFileURL)+rtl_uString_getLength(strExeFileURL);
// Search for the last slash in the Path
while (*pExeFileCount!=L'/' && pExeFileCount>rtl_uString_getStr(strExeFileURL))
@@ -1748,7 +1747,6 @@ void DirectoryFileStatusTest( void )
{
FileBase::RC rc;
DirectoryItem aItem;
- FileStatus *pStatus;
printf( "--------------------------------------------\n" );
printf( "Directory-FileStatus-Test\n" );
@@ -1765,7 +1763,7 @@ void DirectoryFileStatusTest( void )
if ( rc==FileBase::E_None )
{
- pStatus=new FileStatus( osl_FileStatus_Mask_All );
+ FileStatus *pStatus=new FileStatus( osl_FileStatus_Mask_All );
rc=aItem.getFileStatus( *pStatus );
FileStatusTest( pStatus );
@@ -1785,7 +1783,6 @@ void FileFileStatusTest( void )
{
FileBase::RC rc;
DirectoryItem aItem;
- FileStatus *pStatus;
printf( "--------------------------------------------\n" );
printf( "File-FileStatus-Test\n" );
@@ -1802,7 +1799,7 @@ void FileFileStatusTest( void )
if ( rc==FileBase::E_None )
{
- pStatus=new FileStatus( osl_FileStatus_Mask_All );
+ FileStatus *pStatus=new FileStatus( osl_FileStatus_Mask_All );
rc=aItem.getFileStatus( *pStatus );
FileStatusTest( pStatus );
@@ -1822,7 +1819,6 @@ void VolumeFileStatusTest( void )
{
FileBase::RC rc;
DirectoryItem aItem;
- FileStatus *pStatus;
printf( "--------------------------------------------\n" );
printf( "Volume-FileStatus-Test\n" );
@@ -1839,7 +1835,7 @@ void VolumeFileStatusTest( void )
if ( rc==FileBase::E_None )
{
- pStatus=new FileStatus( osl_FileStatus_Mask_All) ;
+ FileStatus *pStatus=new FileStatus( osl_FileStatus_Mask_All) ;
rc=aItem.getFileStatus( *pStatus );
FileStatusTest( pStatus );