From 7c74443e8522fd0f1db60c2d18f736574e3db5f9 Mon Sep 17 00:00:00 2001 From: Korrawit Pruegsanusak Date: Thu, 17 Nov 2011 16:37:33 +0700 Subject: cppcheck: unused variables also remove commented-out codes --- .../source/win32/customactions/patch/swappatchfiles.cxx | 3 --- .../customactions/shellextensions/completeinstallpath.cxx | 15 --------------- .../customactions/shellextensions/registerextensions.cxx | 3 --- 3 files changed, 21 deletions(-) (limited to 'setup_native') diff --git a/setup_native/source/win32/customactions/patch/swappatchfiles.cxx b/setup_native/source/win32/customactions/patch/swappatchfiles.cxx index 7b7d46c5ff22..c0c6fd278efa 100644 --- a/setup_native/source/win32/customactions/patch/swappatchfiles.cxx +++ b/setup_native/source/win32/customactions/patch/swappatchfiles.cxx @@ -184,8 +184,6 @@ static bool SwapFiles( const std::_tstring& sFileName1, const std::_tstring& sFi //Try to move the original file to a temp file fSuccess = MoveFileExA( sFileName1.c_str(), sTempFileName.c_str(), MOVEFILE_REPLACE_EXISTING); - std::_tstring mystr; - if ( fSuccess ) { fSuccess = MoveFileExA( sFileName2.c_str(), sFileName1.c_str(), MOVEFILE_REPLACE_EXISTING ); @@ -713,7 +711,6 @@ extern "C" UINT __stdcall SetFeatureState( MSIHANDLE handle ) extern "C" UINT __stdcall SetNewFeatureState( MSIHANDLE handle ) { - std::_tstring mystr; std::_tstring sValueName; sValueName = TEXT("gm_o_Onlineupdate"); diff --git a/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx b/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx index 7b7453a1f70e..4c338210517a 100644 --- a/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx +++ b/setup_native/source/win32/customactions/shellextensions/completeinstallpath.cxx @@ -83,8 +83,6 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle ) TCHAR szValue[8192]; DWORD nValueSize = sizeof(szValue); HKEY hKey; - std::_tstring sInstDir; - std::_tstring mystr; // Reading property OFFICEDIRHOSTNAME_, that contains the part of the path behind // the program files folder. @@ -100,8 +98,6 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle ) if ( _tcsstr( sInstallLocation.c_str(), sOfficeDirHostname.c_str() ) ) { pathCompletionRequired = false; // nothing to do - // mystr = "Nothing to do, officedir is included into installlocation"; - // MessageBox( NULL, mystr.c_str(), "It is part of installlocation", MB_OK ); } // If the path INSTALLLOCATION does not end with this string, INSTALLLOCATION is maybe @@ -124,12 +120,6 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle ) std::_tstring sProductKey32 = "Software\\" + sManufacturer + "\\" + sDefinedName + "\\" + "3.2" + "\\" + sUpgradeCode; - // mystr = "ProductKey: " + sProductKey; - // MessageBox( NULL, mystr.c_str(), "ProductKey", MB_OK ); - - // mystr = "Checking registry"; - // MessageBox( NULL, mystr.c_str(), "registry search", MB_OK ); - bool oldVersionExists = false; if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey30.c_str(), &hKey ) ) @@ -169,14 +159,9 @@ extern "C" UINT __stdcall CompleteInstallPath( MSIHANDLE handle ) sInstallLocation = sInstallLocation + sOfficeDirHostname; // Setting the new property value MsiSetProperty(handle, TEXT("INSTALLLOCATION"), sInstallLocation.c_str()); - // mystr = "Setting path to: " + sInstallLocation; - // MessageBox( NULL, mystr.c_str(), "sInstallLocation", MB_OK ); } } - // mystr = "Ending with INSTALLLOCATION: " + sInstallLocation; - // MessageBox( NULL, mystr.c_str(), "END", MB_OK ); - return ERROR_SUCCESS; } diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx index 1e30c4611245..bd5efb7f76c8 100644 --- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx +++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx @@ -170,7 +170,6 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath ) extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle) { - // std::_tstring sInstDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") ); std::_tstring sInstDir = GetMsiProperty( handle, TEXT("CustomActionData") ); std::_tstring sUnoPkgFile = sInstDir + TEXT("program\\unopkg.exe"); std::_tstring mystr; @@ -211,8 +210,6 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle) extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle) { - std::_tstring mystr; - // Finding the product with the help of the propery FINDPRODUCT, // that contains a Windows Registry key, that points to the install location. -- cgit