[Libreoffice-commits] core.git: 5 commits - animations/source hwpfilter/source sfx2/source sw/source xmlscript/source xmlsecurity/source
Caolán McNamara
caolanm at redhat.com
Mon May 4 12:14:26 PDT 2015
animations/source/animcore/animcore.cxx | 2
hwpfilter/source/hgzip.cxx | 2
hwpfilter/source/hiodev.cxx | 2
hwpfilter/source/hstream.cxx | 24 +---
hwpfilter/source/hstream.h | 57 ---------
hwpfilter/source/hstream.hxx | 58 ++++++++++
hwpfilter/source/hwpfile.cxx | 2
hwpfilter/source/hwpreader.hxx | 2
sfx2/source/doc/objmisc.cxx | 2
sfx2/source/doc/objxtor.cxx | 4
sfx2/source/view/frmload.cxx | 2
sfx2/source/view/impframe.hxx | 2
sfx2/source/view/impviewframe.hxx | 2
sw/source/core/text/guess.cxx | 13 --
xmlscript/source/xmlflat_imexp/xmlbas_export.hxx | 4
xmlscript/source/xmlflat_imexp/xmlbas_import.hxx | 4
xmlscript/source/xmllib_imexp/imp_share.hxx | 4
xmlsecurity/source/framework/signatureengine.hxx | 2
xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx | 2
xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx | 2
xmlsecurity/source/helper/xmlsignaturehelper2.hxx | 2
xmlsecurity/source/helper/xsecctl.hxx | 2
xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx | 2
23 files changed, 88 insertions(+), 110 deletions(-)
New commits:
commit 61231964a2683ffcc6c4ca139eee3fdb28d9ef42
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 4 20:12:22 2015 +0100
drop useless temp debugging strings
Change-Id: I7e9edae135bd8f3b958c2013fe6d944ab3de2100
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 88e975f..6f7008b 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -391,19 +391,6 @@ bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
xHyphWord = aResult.rHyphenatedWord;
nBreakPos += xHyphWord->getHyphenationPos() + 1;
-#if OSL_DEBUG_LEVEL > 1
- // e.g., Schif-fahrt, referes to our string
- const OUString aWord = xHyphWord->getWord();
- // e.g., Schiff-fahrt, referes to the word after hyphenation
- const OUString aHyphenatedWord = xHyphWord->getHyphenatedWord();
- // e.g., Schif-fahrt: 5, referes to our string
- const sal_uInt16 nHyphenationPos = xHyphWord->getHyphenationPos();
- (void)nHyphenationPos;
- // e.g., Schiff-fahrt: 6, referes to the word after hyphenation
- const sal_uInt16 nHyphenPos = xHyphWord->getHyphenPos();
- (void)nHyphenPos;
-#endif
-
// if not in interactive mode, we have to break behind a soft hyphen
if ( ! rInf.IsInterHyph() && rInf.GetIdx() )
{
commit c8a7a67753de4de78b7834f26f5a87a84bcb24f6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 4 17:44:09 2015 +0100
cppcheck: noExplicitConstructor
Change-Id: Icb4273515082bffaeb9d8f3ebcec8d76fa4192ef
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 3aa6521..e66d596 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -146,7 +146,7 @@ private:
bool bAlert;
public:
- SfxHeaderAttributes_Impl( SfxObjectShell* pSh ) :
+ explicit SfxHeaderAttributes_Impl( SfxObjectShell* pSh ) :
SvKeyValueIterator(), pDoc( pSh ),
xIter( pSh->GetMedium()->GetHeaderAttributes_Impl() ),
bAlert( false ) {}
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index bfbe5d3..526f66e 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -151,7 +151,7 @@ class SfxModelListener_Impl : public ::cppu::WeakImplHelper1< ::com::sun::star::
{
SfxObjectShell* mpDoc;
public:
- SfxModelListener_Impl( SfxObjectShell* pDoc ) : mpDoc(pDoc) {};
+ explicit SfxModelListener_Impl( SfxObjectShell* pDoc ) : mpDoc(pDoc) {};
virtual void SAL_CALL queryClosing( const com::sun::star::lang::EventObject& aEvent, sal_Bool bDeliverOwnership )
throw ( com::sun::star::uno::RuntimeException, com::sun::star::util::CloseVetoException, std::exception) SAL_OVERRIDE ;
virtual void SAL_CALL notifyClosing( const com::sun::star::lang::EventObject& aEvent ) throw ( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE ;
@@ -569,7 +569,7 @@ bool SfxObjectShell::IsInPrepareClose() const
struct BoolEnv_Impl
{
SfxObjectShell_Impl* pImp;
- BoolEnv_Impl( SfxObjectShell_Impl* pImpP) : pImp( pImpP )
+ explicit BoolEnv_Impl( SfxObjectShell_Impl* pImpP) : pImp( pImpP )
{ pImpP->bInPrepareClose = true; }
~BoolEnv_Impl() { pImp->bInPrepareClose = false; }
};
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 0f6ea88..2cc886a 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -108,7 +108,7 @@ class SfxFrameLoader_Impl : public ::cppu::WeakImplHelper2< css::frame::XSynchro
css::uno::Reference < css::uno::XComponentContext > m_aContext;
public:
- SfxFrameLoader_Impl( const css::uno::Reference < css::uno::XComponentContext >& _rxContext );
+ explicit SfxFrameLoader_Impl( const css::uno::Reference < css::uno::XComponentContext >& _rxContext );
virtual OUString SAL_CALL getImplementationName()
throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
diff --git a/sfx2/source/view/impframe.hxx b/sfx2/source/view/impframe.hxx
index 271ef70..c3e7228 100644
--- a/sfx2/source/view/impframe.hxx
+++ b/sfx2/source/view/impframe.hxx
@@ -56,7 +56,7 @@ public:
bool bLockResize;
bool bMenuBarOn;
- SfxFrame_Impl( SfxFrame* pAntiImplP )
+ explicit SfxFrame_Impl( SfxFrame* pAntiImplP )
:nType( 0L )
,pCurrentViewFrame( NULL )
,pDescr( NULL )
diff --git a/sfx2/source/view/impviewframe.hxx b/sfx2/source/view/impviewframe.hxx
index 0f8bfdc..9a17941 100644
--- a/sfx2/source/view/impviewframe.hxx
+++ b/sfx2/source/view/impviewframe.hxx
@@ -53,7 +53,7 @@ struct SfxViewFrame_Impl
::boost::optional< bool >
aHasToolPanels;
- SfxViewFrame_Impl(SfxFrame& i_rFrame)
+ explicit SfxViewFrame_Impl(SfxFrame& i_rFrame)
: rFrame(i_rFrame)
, pReloader(0)
, pWindow(0)
commit 24736e724e98a3ed63bad5e1917f40302b1de24e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 4 15:50:42 2015 +0100
cppcheck: memleakOnRealloc
Change-Id: Ibdf762b0d397f798372d9bf882aa82a6e5fd0229
diff --git a/hwpfilter/source/hstream.cxx b/hwpfilter/source/hstream.cxx
index c9bd0d3..6a0d59f 100644
--- a/hwpfilter/source/hstream.cxx
+++ b/hwpfilter/source/hstream.cxx
@@ -21,27 +21,19 @@
#include <stdlib.h>
#include "hstream.hxx"
-HStream::HStream() : size(0), pos(0)
+HStream::HStream()
+ : size(0)
+ , pos(0)
{
- seq = 0;
}
-
-HStream::~HStream()
-{
- if( seq )
- free( seq );
-}
-
-
-void HStream::addData( const byte *buf, int aToAdd)
+void HStream::addData(const byte *buf, int aToAdd)
{
- seq = static_cast<byte *>(realloc( seq, size + aToAdd ));
- memcpy( seq + size, buf, aToAdd );
+ seq.resize(size + aToAdd);
+ memcpy(seq.data() + size, buf, aToAdd);
size += aToAdd;
}
-
int HStream::readBytes(byte * buf, int aToRead)
{
if (aToRead >= (size - pos))
@@ -51,7 +43,6 @@ int HStream::readBytes(byte * buf, int aToRead)
return aToRead;
}
-
int HStream::skipBytes(int aToSkip)
{
if (aToSkip >= (size - pos))
@@ -60,7 +51,6 @@ int HStream::skipBytes(int aToSkip)
return aToSkip;
}
-
int HStream::available() const
{
return size - pos;
diff --git a/hwpfilter/source/hstream.hxx b/hwpfilter/source/hstream.hxx
index 426d396..4374b92 100644
--- a/hwpfilter/source/hstream.hxx
+++ b/hwpfilter/source/hstream.hxx
@@ -20,6 +20,8 @@
#ifndef INCLUDED_HWPFILTER_SOURCE_HSTREAM_H
#define INCLUDED_HWPFILTER_SOURCE_HSTREAM_H
+#include <vector>
+
typedef unsigned char byte;
/**
* Stream class
@@ -28,7 +30,6 @@ class HStream
{
public:
HStream();
- virtual ~HStream();
/**
*
@@ -49,7 +50,7 @@ class HStream
private:
int size;
- byte *seq;
+ std::vector<byte> seq;
int pos;
};
#endif
commit 90911df79efe9a069c7a692d0d1109e67a1da961
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 4 15:47:07 2015 +0100
hstream.h->hstream.hxx
Change-Id: Icc4a3d3661c3d40f9e71215bdc875c6a25f40ac1
diff --git a/hwpfilter/source/hgzip.cxx b/hwpfilter/source/hgzip.cxx
index 9d78c4d..baf3b20 100644
--- a/hwpfilter/source/hgzip.cxx
+++ b/hwpfilter/source/hgzip.cxx
@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <errno.h>
#include "hgzip.h"
-#include "hstream.h"
+#include "hstream.hxx"
#ifndef local
# define local static
diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx
index 03db63e..604c45c 100644
--- a/hwpfilter/source/hiodev.cxx
+++ b/hwpfilter/source/hiodev.cxx
@@ -32,7 +32,7 @@
#include "hgzip.h"
#include "hiodev.h"
#include "hwpfile.h"
-#include "hstream.h"
+#include "hstream.hxx"
const int BUFSIZE = 1024;
static uchar rBuf[BUFSIZE];
diff --git a/hwpfilter/source/hstream.cxx b/hwpfilter/source/hstream.cxx
index e002d346..c9bd0d3 100644
--- a/hwpfilter/source/hstream.cxx
+++ b/hwpfilter/source/hstream.cxx
@@ -19,7 +19,7 @@
#include <string.h>
#include <stdlib.h>
-#include "hstream.h"
+#include "hstream.hxx"
HStream::HStream() : size(0), pos(0)
{
diff --git a/hwpfilter/source/hstream.h b/hwpfilter/source/hstream.hxx
similarity index 100%
rename from hwpfilter/source/hstream.h
rename to hwpfilter/source/hstream.hxx
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx
index b2aff10..db7ed11 100644
--- a/hwpfilter/source/hwpfile.cxx
+++ b/hwpfilter/source/hwpfile.cxx
@@ -32,7 +32,7 @@
#include "hpara.h"
#include "htags.h"
#include "hcode.h"
-#include "hstream.h"
+#include "hstream.hxx"
#include <osl/diagnose.h>
diff --git a/hwpfilter/source/hwpreader.hxx b/hwpfilter/source/hwpreader.hxx
index 93bcc9e..bb4e0d2 100644
--- a/hwpfilter/source/hwpreader.hxx
+++ b/hwpfilter/source/hwpreader.hxx
@@ -60,7 +60,7 @@ using namespace ::com::sun::star::xml::sax;
#include "hcode.h"
#include "hbox.h"
#include "htags.h"
-#include "hstream.h"
+#include "hstream.hxx"
#include "drawdef.h"
#include "attributes.hxx"
commit 869e477484befd0c200c73103ff9bc224d3a47df
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 4 12:03:03 2015 +0100
cppcheck: noExplicitConstructor
Change-Id: Iea5bb0504518b380c3fe7c238d376dc26be8a7ef
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index 6a1d338..429c866 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -354,7 +354,7 @@ private:
class TimeContainerEnumeration : public ::cppu::WeakImplHelper1< XEnumeration >
{
public:
- TimeContainerEnumeration( const ChildList_t &rChildren );
+ explicit TimeContainerEnumeration( const ChildList_t &rChildren );
virtual ~TimeContainerEnumeration();
// Methods
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx
index 86dae1b..f3e92d5 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx
@@ -77,7 +77,7 @@ namespace xmlscript
class XMLBasicExporter : public XMLBasicExporterBase
{
public:
- XMLBasicExporter(
+ explicit XMLBasicExporter(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
virtual ~XMLBasicExporter();
@@ -93,7 +93,7 @@ namespace xmlscript
class XMLOasisBasicExporter : public XMLBasicExporterBase
{
public:
- XMLOasisBasicExporter(
+ explicit XMLOasisBasicExporter(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
virtual ~XMLOasisBasicExporter();
diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx
index 54a9b94..a600e23 100644
--- a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx
+++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx
@@ -272,7 +272,7 @@ namespace xmlscript
class XMLBasicImporter : public XMLBasicImporterBase
{
public:
- XMLBasicImporter(
+ explicit XMLBasicImporter(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
virtual ~XMLBasicImporter();
@@ -288,7 +288,7 @@ namespace xmlscript
class XMLOasisBasicImporter : public XMLBasicImporterBase
{
public:
- XMLOasisBasicImporter(
+ explicit XMLOasisBasicImporter(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
virtual ~XMLOasisBasicImporter();
diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx
index 39ce9d3..4be264a 100644
--- a/xmlscript/source/xmllib_imexp/imp_share.hxx
+++ b/xmlscript/source/xmllib_imexp/imp_share.hxx
@@ -114,7 +114,7 @@ struct LibraryImport
sal_Int32 XMLNS_XLINK_UID;
public:
- LibraryImport( LibDescriptorArray* pLibArray )
+ explicit LibraryImport( LibDescriptorArray* pLibArray )
: mpLibArray(pLibArray)
, mpLibDesc(NULL)
, XMLNS_LIBRARY_UID(0)
@@ -123,7 +123,7 @@ public:
}
// Single library mode
- LibraryImport(LibDescriptor* pLibDesc)
+ explicit LibraryImport(LibDescriptor* pLibDesc)
: mpLibArray(NULL)
, mpLibDesc(pLibDesc)
, XMLNS_LIBRARY_UID(0)
diff --git a/xmlsecurity/source/framework/signatureengine.hxx b/xmlsecurity/source/framework/signatureengine.hxx
index da0e131..23c7cde 100644
--- a/xmlsecurity/source/framework/signatureengine.hxx
+++ b/xmlsecurity/source/framework/signatureengine.hxx
@@ -91,7 +91,7 @@ protected:
com::sun::star::io::XInputStream > > m_vXInputStreams;
protected:
- SignatureEngine( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & xContext);
+ explicit SignatureEngine( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & xContext);
virtual ~SignatureEngine() {};
virtual void tryToPerform( )
diff --git a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx
index dc924be..1900909 100644
--- a/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx
+++ b/xmlsecurity/source/framework/xmlencryptiontemplateimpl.hxx
@@ -45,7 +45,7 @@ class XMLEncryptionTemplateImpl : public ::cppu::WeakImplHelper2<
::com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus;
public :
- XMLEncryptionTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ;
+ explicit XMLEncryptionTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ;
virtual ~XMLEncryptionTemplateImpl() ;
//Methods from XXMLEncryptionTemplate
diff --git a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx
index d8b53bb..6d34bba 100644
--- a/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx
+++ b/xmlsecurity/source/framework/xmlsignaturetemplateimpl.hxx
@@ -47,7 +47,7 @@ class XMLSignatureTemplateImpl : public ::cppu::WeakImplHelper2<
::com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus;
public :
- XMLSignatureTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ;
+ explicit XMLSignatureTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ;
virtual ~XMLSignatureTemplateImpl() ;
//Methods from XXMLSignatureTemplate
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.hxx b/xmlsecurity/source/helper/xmlsignaturehelper2.hxx
index f93aa39..6a705f4 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper2.hxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper2.hxx
@@ -109,7 +109,7 @@ private:
public:
UriBindingHelper();
- UriBindingHelper( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStorage );
+ explicit UriBindingHelper( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStorage );
void SAL_CALL setUriBinding( const OUString& uri, const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& aInputStream )
throw (com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx
index 196c698..7b63ca0 100644
--- a/xmlsecurity/source/helper/xsecctl.hxx
+++ b/xmlsecurity/source/helper/xsecctl.hxx
@@ -388,7 +388,7 @@ private:
sal_Int32 nSecurityId );
public:
- XSecController(const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& rxCtx);
+ explicit XSecController(const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& rxCtx);
virtual ~XSecController();
sal_Int32 getNewSecurityId( );
diff --git a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx
index 8ad1206..57a9af7 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.hxx
@@ -55,7 +55,7 @@ private:
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
public:
- SEInitializer_MSCryptImpl(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > &rxContext);
+ explicit SEInitializer_MSCryptImpl(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > &rxContext);
virtual ~SEInitializer_MSCryptImpl();
/* XSEInitializer */
More information about the Libreoffice-commits
mailing list