summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Becker <atayoohoo@googlemail.com>2011-04-28 00:59:28 +0200
committerKatarina Machalkova <kmachalkova@suse.cz>2011-04-28 13:45:46 +0200
commit9ad4eeb4fa413b1a3e084d141c6eb01795f95b7f (patch)
tree031b7ad30c650665210cb5b63d59efe740fd57d1
parent8a9f54bc1283b7137a90506e29dba7962dd73f83 (diff)
fixed cppcheck warnings
-rw-r--r--accessibility/source/standard/vclxaccessibletoolbox.cxx4
-rw-r--r--automation/source/miniapp/testapp.cxx1
-rw-r--r--automation/source/miniapp/testapp.hxx1
-rw-r--r--automation/source/testtool/httprequest.cxx24
-rw-r--r--basctl/source/basicide/basidesh.cxx12
-rw-r--r--crashrep/source/unx/main.cxx8
-rw-r--r--crashrep/source/win32/base64.cpp2
-rw-r--r--cui/source/dialogs/multipat.cxx2
-rw-r--r--cui/source/dialogs/thesdlg.cxx2
-rw-r--r--cui/source/options/dbregister.cxx2
-rw-r--r--cui/source/options/treeopt.cxx4
-rw-r--r--cui/source/tabpages/chardlg.cxx2
-rw-r--r--extensions/source/bibliography/datman.cxx5
-rw-r--r--extensions/source/ole/oleobjw.cxx22
-rw-r--r--extensions/source/ole/oleobjw.hxx2
-rw-r--r--forms/source/component/refvaluecomponent.cxx2
-rw-r--r--package/source/zippackage/ZipPackageStream.cxx4
-rw-r--r--setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx10
-rw-r--r--setup_native/source/win32/customactions/shellextensions/registerextensions.cxx155
-rw-r--r--xmlsecurity/tools/demo/performance.cxx17
20 files changed, 54 insertions, 227 deletions
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index 71ae99652215..33c1d055e7ca 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -391,7 +391,7 @@ void VCLXAccessibleToolBox::UpdateItem_Impl( sal_Int32 _nPos, sal_Bool _bItemAdd
if ( pItem )
{
sal_Int32 nIndex = pItem->getIndexInParent( );
- nIndex += _bItemAdded ? +1 : -1;
+ nIndex += (_bItemAdded ? +1 : -1);
pItem->setIndexInParent( nIndex );
}
}
@@ -400,7 +400,7 @@ void VCLXAccessibleToolBox::UpdateItem_Impl( sal_Int32 _nPos, sal_Bool _bItemAdd
if ( pWindowItem )
{
sal_Int32 nIndex = pWindowItem->getIndexInParent( );
- nIndex += _bItemAdded ? +1 : -1;
+ nIndex += (_bItemAdded ? +1 : -1);
pWindowItem->setIndexInParent( nIndex );
}
}
diff --git a/automation/source/miniapp/testapp.cxx b/automation/source/miniapp/testapp.cxx
index 914b59a6739c..66cbb38365a0 100644
--- a/automation/source/miniapp/testapp.cxx
+++ b/automation/source/miniapp/testapp.cxx
@@ -157,6 +157,7 @@ MyApp aApp;
MyApp::MyApp()
{
pMainWin = NULL;
+ pMyDispatcher = NULL;
}
void MyApp::Property( ApplicationProperty& rProp )
diff --git a/automation/source/miniapp/testapp.hxx b/automation/source/miniapp/testapp.hxx
index 65bfe777d0d1..fd313c9cbd40 100644
--- a/automation/source/miniapp/testapp.hxx
+++ b/automation/source/miniapp/testapp.hxx
@@ -86,7 +86,6 @@ public:
class MyApp : public Application
{
- PopupMenu *MyMenu;
Timer aCommandTimer;
PlugInDispatcher *pMyDispatcher;
diff --git a/automation/source/testtool/httprequest.cxx b/automation/source/testtool/httprequest.cxx
index d10469e0496a..1212d3806486 100644
--- a/automation/source/testtool/httprequest.cxx
+++ b/automation/source/testtool/httprequest.cxx
@@ -45,15 +45,18 @@ void HttpRequest::Init()
}
HttpRequest::HttpRequest()
-: nStatus( HTTP_INIT )
-, nResultId( 0 )
-, pStream( NULL )
-{}
+ : nStatus(HTTP_INIT), nResultId(0),
+ pStream(NULL), pOutSocket(NULL)
+{
+}
HttpRequest::~HttpRequest()
{
delete pStream;
pStream = NULL;
+
+ delete pOutSocket;
+ pOutSocket = NULL;
}
void HttpRequest::SetRequest( ByteString aHost, ByteString aPath, sal_uInt16 nPort )
@@ -95,18 +98,14 @@ sal_Bool HttpRequest::Execute()
aTV.Nanosec = 0;
pOutSocket = new osl::ConnectorSocket();
- if ( pOutSocket->connect( aConnectAddr, &aTV ) == osl_Socket_Ok )
- {
-// pOutSocket->setTcpNoDelay( 1 );
- }
- else
+ if ( pOutSocket->connect( aConnectAddr, &aTV ) != osl_Socket_Ok )
{
delete pOutSocket;
+ pOutSocket = NULL;
nStatus = HTTP_REQUEST_ERROR;
return sal_False;
}
-
SendString( pOutSocket, "GET " );
if ( aProxyHost.Len() )
{
@@ -218,14 +217,11 @@ void HttpRequest::Abort()
if ( pOutSocket )
{
nStatus = HTTP_REQUEST_ERROR;
- pOutSocket->shutdown();
+ pOutSocket->shutdown();
pOutSocket->close();
}
}
-
-
-
SvMemoryStream* HttpRequest::GetBody()
{
return pStream;
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx
index 596e1e973b2f..8814f3538161 100644
--- a/basctl/source/basicide/basidesh.cxx
+++ b/basctl/source/basicide/basidesh.cxx
@@ -998,15 +998,15 @@ void BasicIDEShell::SetCurLib( const ScriptDocument& rDocument, String aLibName,
{
ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() );
- if ( pListener )
- pListener->removeContainerListener( m_aCurDocument, m_aCurLibName );
-
m_aCurDocument = rDocument;
-
- pListener->addContainerListener( m_aCurDocument, aLibName );
-
m_aCurLibName = aLibName;
+ if ( pListener )
+ {
+ pListener->removeContainerListener( m_aCurDocument, m_aCurLibName );
+ pListener->addContainerListener( m_aCurDocument, aLibName );
+ }
+
if ( bUpdateWindows )
UpdateWindows();
diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx
index f0e6630658c5..ed257e17fe81 100644
--- a/crashrep/source/unx/main.cxx
+++ b/crashrep/source/unx/main.cxx
@@ -484,12 +484,9 @@ static void WriteSOAPRequest( FILE *fp )
struct RequestParams
{
- bool success;
- FILE *fpin;
+ FILE *fpin;
const char *pServer;
- unsigned short uPort;
const char *pProxyServer;
- unsigned short uProxyPort;
};
@@ -540,8 +537,7 @@ bool send_crash_report( const boost::unordered_map< string, string >& rSettings
static bool append_file( const char *filename, string& rString )
{
- char buf[1024];
- bool bSuccess = false;
+ char buf[1024];
FILE *fp = fopen( filename, "r" );
if ( fp )
diff --git a/crashrep/source/win32/base64.cpp b/crashrep/source/win32/base64.cpp
index 82d54fb4e16d..bd59350a7f43 100644
--- a/crashrep/source/win32/base64.cpp
+++ b/crashrep/source/win32/base64.cpp
@@ -34,7 +34,6 @@ static const char base64_tab[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst
extern "C" size_t base64_encode( FILE *fin, FILE *fout )
{
- size_t nBytesRead = 0;
size_t nLineLength = 0;
size_t nBytesWritten = 0;
@@ -46,7 +45,6 @@ extern "C" size_t base64_encode( FILE *fin, FILE *fout )
memset( in_buffer, 0, sizeof(in_buffer) );
nBytes = fread( in_buffer, 1, sizeof(in_buffer), fin );
- nBytesRead += nBytes;
if ( nBytes )
{
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index 3e763779b7c8..fb6aea37e4a0 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -294,7 +294,7 @@ void SvxMultiPathDialog::SetPath( const String& rPath )
if ( pImpl->bIsRadioButtonMode )
{
String sEntry( '\t' );
- sEntry += bIsSystemPath ? sSystemPath : sPath;
+ sEntry += (bIsSystemPath ? sSystemPath : sPath);
SvLBoxEntry* pEntry = aRadioLB.InsertEntry( sEntry );
String* pURL = new String( sPath );
pEntry->SetUserData( pURL );
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index ddd77621f322..dde09339cb27 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -398,7 +398,7 @@ void SvxThesaurusDialog_Impl::LookUp_Impl()
aLookUpText = OUString( aText );
if (aLookUpText.getLength() > 0 &&
- (aLookUpHistory.size() == 0 || aLookUpText != aLookUpHistory.top()))
+ (aLookUpHistory.empty() || aLookUpText != aLookUpHistory.top()))
aLookUpHistory.push( aLookUpText );
m_bWordFound = UpdateAlternativesBox_Impl();
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index 8c8562527c51..ff926c5179b6 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -279,7 +279,7 @@ void DbRegistrationOptionsPage::FillUserData()
aUserData += ';';
HeaderBarItemBits nBits = pHeaderBar->GetItemBits( ITEMID_TYPE );
sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW );
- aUserData += bUp ? '1' : '0';
+ aUserData += (bUp ? '1' : '0');
SetUserData( aUserData );
}
// -----------------------------------------------------------------------
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 0953fe83b921..a025fcaf790d 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -2191,7 +2191,7 @@ void OfaTreeOptionsDialog::ResizeTreeLB( void )
while( pEntry )
{
long n = aTreeLB.GetTextWidth( aTreeLB.GetEntryText( static_cast< SvLBoxEntry* >( pEntry ) ) );
- n += ( nDepth == 0 )? nIndent0 : nIndent1;
+ n += ((nDepth == 0) ? nIndent0 : nIndent1);
if( n > nDelta )
nDelta = n;
@@ -2778,4 +2778,4 @@ void ExtensionsTabPage::SavePage()
DispatchAction( C2U("ok") );
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 0ed7caed38e6..8ce4f844dfa9 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -3627,7 +3627,7 @@ sal_Bool SvxCharPositionPage::FillItemSet( SfxItemSet& rSet )
else
{
nEsc = (short)m_aHighLowEdit.Denormalize( m_aHighLowEdit.GetValue() );
- nEsc *= bHigh ? 1 : -1;
+ nEsc *= (bHigh ? 1 : -1);
}
nEscProp = (sal_uInt8)m_aFontSizeEdit.Denormalize( m_aFontSizeEdit.GetValue() );
}
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index b2698154fd03..265496506a90 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -118,14 +118,13 @@ Reference< XConnection > getConnection(const ::rtl::OUString& _rURL)
{
xDataSource = Reference< XDataSource > (Reference< XNamingService > (xNamingContext, UNO_QUERY)->getRegisteredObject(_rURL), UNO_QUERY);
}
- catch(Exception eEx)
+ catch(Exception &)
{
- (void) eEx; // make compiler happy
OSL_FAIL("Exception caught in ODatabaseContext::getRegisteredObject()");
}
}
// build the connection from the data source
- Reference< XConnection > xConn;
+ Reference< XConnection > xConn;
if (xDataSource.is())
{
// need user/pwd for this
diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx
index 6648d1773560..5866eb6a6c91 100644
--- a/extensions/source/ole/oleobjw.cxx
+++ b/extensions/source/ole/oleobjw.cxx
@@ -1366,7 +1366,6 @@ uno::Any SAL_CALL IUnknownWrapper_Impl::directInvoke( const ::rtl::OUString& aNa
scoped_array<CComVariant> ptrRefArgs; // referenced arguments
CComVariant * arArgs = NULL;
CComVariant * arRefArgs = NULL;
- bool bVarargParam = false;
dispparams.cArgs = aParams.getLength();
@@ -1758,8 +1757,6 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
CComVariant * arArgs = NULL;
CComVariant * arRefArgs = NULL;
sal_Int32 revIndex = 0;
- bool bVarargParam = false;
-
//Set the array of DISPIDs for named args if it is a property put operation.
//If there are other named arguments another array is set later on.
@@ -1906,24 +1903,15 @@ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
if ( i < nUnoArgs)
anyArg= Params.getConstArray()[i];
- //Test if the current parameter is a "vararg" parameter.
- if (bVarargParam || (aFuncDesc->cParamsOpt == -1 &&
- aFuncDesc->cParams == (i + 1)))
- { //This parameter is from the variable argument list. There is no
- //type info available, except that it must be a VARIANT
- bVarargParam = true;
- }
-
unsigned short paramFlags = PARAMFLAG_FOPT | PARAMFLAG_FIN;
VARTYPE varType = VT_VARIANT;
- if ( ! bVarargParam)
+ if (aFuncDesc->cParamsOpt != -1 || aFuncDesc->cParams != (i + 1))
{
- paramFlags =
- aFuncDesc->lprgelemdescParam[i].paramdesc.wParamFlags;
- varType = getElementTypeDesc(
- & aFuncDesc->lprgelemdescParam[i].tdesc);
+ paramFlags = aFuncDesc->lprgelemdescParam[i].paramdesc.wParamFlags;
+ varType = getElementTypeDesc(&aFuncDesc->lprgelemdescParam[i].tdesc);
}
- //Make sure that there is a UNO parameter for every
+
+ // Make sure that there is a UNO parameter for every
// expected parameter. If there is no UNO parameter where the
// called function expects one, then it must be optional. Otherwise
// its a UNO programming error.
diff --git a/extensions/source/ole/oleobjw.hxx b/extensions/source/ole/oleobjw.hxx
index 0be19ddc6cff..f2882fc4417d 100644
--- a/extensions/source/ole/oleobjw.hxx
+++ b/extensions/source/ole/oleobjw.hxx
@@ -148,7 +148,7 @@ public:
virtual ::sal_Bool SAL_CALL hasMember( const ::rtl::OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
- Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
+ Any invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
const OUString& sFuncName,
const Sequence< Any >& Params,
Sequence< sal_Int16 >& OutParamIndex,
diff --git a/forms/source/component/refvaluecomponent.cxx b/forms/source/component/refvaluecomponent.cxx
index b586e393ea33..b0cf40ce91d1 100644
--- a/forms/source/component/refvaluecomponent.cxx
+++ b/forms/source/component/refvaluecomponent.cxx
@@ -260,7 +260,7 @@ namespace frm
}
else if ( bStringExchange )
{
- aExternalValue <<= m_bSupportSecondRefValue ? m_sNoCheckReferenceValue : ::rtl::OUString();
+ aExternalValue <<= (m_bSupportSecondRefValue ? m_sNoCheckReferenceValue : ::rtl::OUString());
}
break;
}
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 06a4413492c1..1287067a9f4d 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -750,7 +750,7 @@ Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName )
}
else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "Encrypted" ) ) )
{
- aAny <<= ( m_nStreamMode == PACKAGE_STREAM_RAW ) ? sal_True : bToBeEncrypted;
+ aAny <<= ((m_nStreamMode == PACKAGE_STREAM_RAW) ? sal_True : bToBeEncrypted);
return aAny;
}
else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "WasEncrypted" ) ) )
@@ -765,7 +765,7 @@ Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName )
}
else if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EncryptionKey" ) ) )
{
- aAny <<= !xEncryptionData.is() ? Sequence < sal_Int8 > () : xEncryptionData->aKey;
+ aAny <<= (!xEncryptionData.is() ? Sequence < sal_Int8 > () : xEncryptionData->aKey);
return aAny;
}
else
diff --git a/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx b/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx
index d94b65459d8a..ffa1dfe0d50b 100644
--- a/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/copyextensiondata.cxx
@@ -80,7 +80,6 @@ extern "C" UINT __stdcall copyExtensionData(MSIHANDLE handle) {
std::_tstring sSourceDir = GetMsiProperty( handle, TEXT("SourceDir") );
std::_tstring sExtensionDir = sSourceDir + TEXT("extension\\");
std::_tstring sPattern = sExtensionDir + TEXT("*.oxt");
- // std::_tstring mystr;
// Finding all oxt files in sExtensionDir
@@ -91,7 +90,6 @@ extern "C" UINT __stdcall copyExtensionData(MSIHANDLE handle) {
if ( hFindOxt != INVALID_HANDLE_VALUE )
{
bool fNextFile = false;
- bool fSuccess = true;
bool bFailIfExist = true;
std::_tstring sDestDir = GetMsiProperty( handle, TEXT("INSTALLLOCATION") );
@@ -101,9 +99,9 @@ extern "C" UINT __stdcall copyExtensionData(MSIHANDLE handle) {
std::_tstring sShareDir = sDestDir + TEXT("share");
std::_tstring sExtDir = sShareDir + TEXT("\\extension");
std::_tstring sExtInstDir = sExtDir + TEXT("\\install");
- bool bDir = CreateDirectory(sShareDir.c_str(), NULL);
- bDir = CreateDirectory(sExtDir.c_str(), NULL);
- bDir = CreateDirectory(sExtInstDir.c_str(), NULL);
+ CreateDirectory(sShareDir.c_str(), NULL);
+ CreateDirectory(sExtDir.c_str(), NULL);
+ CreateDirectory(sExtInstDir.c_str(), NULL);
do
{
@@ -112,7 +110,7 @@ extern "C" UINT __stdcall copyExtensionData(MSIHANDLE handle) {
std::_tstring sSourceFile = sExtensionDir + sOxtFile;
std::_tstring sDestFile = sShareInstallDir + sOxtFile;
- fSuccess = CopyFile( sSourceFile.c_str(), sDestFile.c_str(), bFailIfExist );
+ CopyFile( sSourceFile.c_str(), sDestFile.c_str(), bFailIfExist );
fNextFile = FindNextFile( hFindOxt, &aFindFileData );
diff --git a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
index 6b32b33cc881..53066682e397 100644
--- a/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
+++ b/setup_native/source/win32/customactions/shellextensions/registerextensions.cxx
@@ -55,119 +55,6 @@
#include <tchar.h>
#include <string>
-/** creates a temporary folder with a unique name.
-
- The returned string is a file URL.
-*/
-// static std::_tstring createTempFolder()
-// {
-// BOOL bExist = FALSE;
-// TCHAR szTempName[MAX_PATH];
-// do
-// {
-// bExist = FALSE;
-// // Get the temp path.
-// TCHAR lpPathBuffer[MAX_PATH];
-// DWORD dwRetVal = GetTempPath(MAX_PATH, lpPathBuffer);
-// if (dwRetVal > MAX_PATH || (dwRetVal == 0))
-// {
-// //fprintf (stderr, "GetTempPath failed with error %d.\n", GetLastError());
-// return TEXT("");
-// }
-// // Create a temporary file.
-// UINT uRetVal = GetTempFileName(lpPathBuffer, // directory for tmp files
-// "upg", // temp file name prefix
-// 0, // create unique name
-// szTempName); // buffer for name
-// if (uRetVal == 0)
-// {
-// //fprintf (stderr, "GetTempFileName failed with error %d.\n", GetLastError());
-// return TEXT("");
-// }
-// //Delete the file
-// BOOL bDel = DeleteFile(szTempName);
-// if (FALSE == bDel)
-// {
-// //fprintf(stderr, "Could not delete temp file. Error %d.\n", GetLastError());
-// return TEXT("");
-// }
-// // Create the directory
-// BOOL bDir = CreateDirectory(szTempName, NULL);
-// if (FALSE == bDir)
-// {
-// DWORD error =GetLastError();
-// if (ERROR_ALREADY_EXISTS == error)
-// {
-// bExist = TRUE;
-// }
-// else
-// {
-// //fprintf(stderr, "CreateDirectory failed with error %d.\n", error);
-// return TEXT("");
-// }
-// }
-// } while(bExist);
-
-// std::_tstring cur(szTempName);
-// //make a file URL from the path
-// std::_tstring ret(TEXT("file:///"));
-// for (std::_tstring::iterator i = cur.begin(); i != cur.end(); i++)
-// {
-// if (*i == '\\')
-// ret.append(TEXT("/"));
-// else
-// ret.push_back(*i);
-// }
-// // MessageBox(NULL, ret.c_str(), "createTempFolder", MB_OK);
-// return ret.c_str();
-// }
-
-/** deletes the temporary folder.
- The argument must be a file URL.
-*/
-// static void deleteTempFolder(const std::_tstring& sTempFolder)
-// {
-// if (sTempFolder.size() == 0)
-// return;
-// //convert the file URL to a path
-// const std::_tstring path(sTempFolder.substr(8));
-// std::_tstring path2;
-// // MessageBox(NULL, path.c_str(), "del1", MB_OK);
-// for (std::_tstring::const_iterator i = path.begin(); i != path.end(); i++)
-// {
-// if (*i == '/')
-// path2.append(TEXT("\\"));
-// else
-// path2.push_back(*i);
-// }
-
-// //We need a null terminated string with two nulls in the end
-// //for the SHFILEOPSTRUCT
-// const TCHAR * szTemp = path2.c_str();
-// size_t size = path2.size();
-// TCHAR * szTemp2 = new TCHAR[size + 2];
-// ZeroMemory(szTemp2, (size + 2) * sizeof(TCHAR));
-// memcpy(szTemp2, szTemp, size * sizeof(TCHAR));
-
-// // MessageBox(NULL, szTemp2, "del3", MB_OK);
-// SHFILEOPSTRUCT operation =
-// {
-// NULL,
-// FO_DELETE,
-// szTemp2,
-// NULL,
-// FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_NOCONFIRMMKDIR,
-// FALSE,
-// NULL,
-// NULL
-// };
-
-// SHFileOperation( &operation);
-// delete [] szTemp2;
-// }
-
-
-
static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sProperty )
{
std::_tstring result;
@@ -189,8 +76,6 @@ static std::_tstring GetMsiProperty( MSIHANDLE handle, const std::_tstring& sPro
/* creates a child process which is specified in lpCommand.
out_exitCode is the exit code of the child process
-
-
**/
static BOOL ExecuteCommand( LPCTSTR lpCommand, DWORD * out_exitCode)
{
@@ -251,7 +136,6 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
std::_tstring sParentDir = TEXT("..");
mystr = "Current short file: " + sFileName;
- // MessageBox(NULL, mystr.c_str(), "Current Content", MB_OK);
if (( strcmp(sFileName.c_str(),sCurrentDir.c_str()) != 0 ) &&
( strcmp(sFileName.c_str(),sParentDir.c_str()) != 0 ))
@@ -264,12 +148,10 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
if ( fSuccess )
{
mystr = "Successfully removed content of dir " + sCompleteFileName;
- // MessageBox(NULL, mystr.c_str(), "Removed Directory", MB_OK);
}
else
{
mystr = "An error occurred during removing content of " + sCompleteFileName;
- // MessageBox(NULL, mystr.c_str(), "Error removing directory", MB_OK);
}
}
else
@@ -278,12 +160,10 @@ static BOOL RemoveCompleteDirectory( std::_tstring sPath )
if ( fSuccess )
{
mystr = "Successfully removed file " + sCompleteFileName;
- // MessageBox(NULL, mystr.c_str(), "Removed File", MB_OK);
}
else
{
mystr = "An error occurred during removal of file " + sCompleteFileName;
- // MessageBox(NULL, mystr.c_str(), "Error removing file", MB_OK);
}
}
}
@@ -325,7 +205,6 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle)
WIN32_FIND_DATA aFindFileData;
mystr = "unopkg file: " + sUnoPkgFile;
- //MessageBox(NULL, mystr.c_str(), "Command", MB_OK);
// Find unopkg.exe
HANDLE hFindUnopkg = FindFirstFile( sUnoPkgFile.c_str(), &aFindFileData );
@@ -335,29 +214,11 @@ extern "C" UINT __stdcall RegisterExtensions(MSIHANDLE handle)
// unopkg.exe exists in program directory
std::_tstring sCommand = sUnoPkgFile + " sync";
mystr = "Command: " + sCommand;
- //MessageBox(NULL, mystr.c_str(), "Command", MB_OK);
DWORD exitCode = 0;
- bool fSuccess = ExecuteCommand( sCommand.c_str(), & exitCode);
-
-// if ( fSuccess )
-// {
-// mystr = "Executed successfully!";
-// MessageBox(NULL, mystr.c_str(), "Command", MB_OK);
-// }
-// else
-// {
-// mystr = "An error occurred during execution!";
-// MessageBox(NULL, mystr.c_str(), "Command", MB_OK);
-// }
-
+ ExecuteCommand( sCommand.c_str(), & exitCode);
FindClose( hFindUnopkg );
}
-// else
-// {
-// mystr = "Error: Did not find " + sUnoPkgFile;
-// MessageBox(NULL, mystr.c_str(), "Command", MB_OK);
-// }
return ERROR_SUCCESS;
}
@@ -376,7 +237,6 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle)
std::_tstring sInstDir;
std::_tstring sProductKey = GetMsiProperty( handle, TEXT("FINDPRODUCT") );
- //MessageBox( NULL, sProductKey.c_str(), "Titel", MB_OK );
if ( ERROR_SUCCESS == RegOpenKey( HKEY_CURRENT_USER, sProductKey.c_str(), &hKey ) )
{
@@ -403,18 +263,7 @@ extern "C" UINT __stdcall RemoveExtensions(MSIHANDLE handle)
std::_tstring sCacheDir = sInstDir + TEXT("share\\prereg\\bundled");
- bool fSuccess = RemoveCompleteDirectory( sCacheDir );
-
-// if ( fSuccess )
-// {
-// mystr = "Executed successfully!";
-// MessageBox(NULL, mystr.c_str(), "Main methode", MB_OK);
-// }
-// else
-// {
-// mystr = "An error occurred during execution!";
-// MessageBox(NULL, mystr.c_str(), "Main methode", MB_OK);
-// }
+ RemoveCompleteDirectory( sCacheDir );
return ERROR_SUCCESS;
}
diff --git a/xmlsecurity/tools/demo/performance.cxx b/xmlsecurity/tools/demo/performance.cxx
index 582f101957e6..c8ee45907703 100644
--- a/xmlsecurity/tools/demo/performance.cxx
+++ b/xmlsecurity/tools/demo/performance.cxx
@@ -244,7 +244,7 @@ public:
struct AncestorEvent
{
- AncestorEvent( sal_Int32 nAttrNum ):aAttributeList(nAttrNum){};
+ AncestorEvent(sal_Int32 nAttrNum) : aAttributeList(nAttrNum), bIsStartElement(false) {};
bool bIsStartElement;
rtl::OUString ouName;
@@ -357,27 +357,30 @@ private:
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler);
- void XSecTester::sendAncestorStartElementEvent(
+ void sendAncestorStartElementEvent(
const rtl::OUString& ouName,
const com::sun::star::uno::Sequence<
com::sun::star::xml::csax::XMLAttribute >& xAttrList,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler) const;
- void XSecTester::sendAncestorEndElementEvent(
+ void sendAncestorEndElementEvent(
const rtl::OUString& ouName,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler) const;
- std::vector< AncestorEvent* >::const_iterator XSecTester::checkAncestorStartElementEvent(
+ std::vector< AncestorEvent* >::const_iterator checkAncestorStartElementEvent(
const std::vector< AncestorEvent* >::const_iterator& ii,
const com::sun::star::uno::Reference<
com::sun::star::xml::sax::XDocumentHandler >& xDocumentHandler) const;
public:
- XSecTester(const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >& rxMSF)
- :mxMSF( rxMSF ){};
+ XSecTester(const com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory >& rxMSF)
+ : mxMSF(rxMSF), m_bIsExporting(false), m_bIsBlocking(false),
+ m_bIsInsideCollectedElement(false), m_bIsSAXEventKeeperOnTheSAXChain(false)
+ {
+ };
+
virtual ~XSecTester(){};
/* XSignatureCreationResultListener */