[Libreoffice-commits] core.git: bridges/source bridges/test canvas/source dtrans/source dtrans/test

Caolán McNamara caolanm at redhat.com
Thu Jan 7 01:12:14 PST 2016


 bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx |    2 +-
 bridges/test/performance/testperformance.cxx        |   16 ++++++++--------
 bridges/test/testcomp.cxx                           |    2 +-
 bridges/test/testcomp.h                             |    2 +-
 canvas/source/directx/dx_textlayout_drawhelper.hxx  |    2 +-
 dtrans/source/win32/dnd/idroptarget.hxx             |    2 +-
 dtrans/source/win32/dnd/source.hxx                  |    2 +-
 dtrans/source/win32/dnd/target.hxx                  |    2 +-
 dtrans/source/win32/dnd/targetdragcontext.hxx       |    2 +-
 dtrans/source/win32/dnd/targetdropcontext.hxx       |    2 +-
 dtrans/source/win32/dtobj/APNDataObject.hxx         |    4 ++--
 dtrans/source/win32/dtobj/DTransHelper.hxx          |    6 +++---
 dtrans/source/win32/dtobj/DataFmtTransl.hxx         |    2 +-
 dtrans/source/win32/dtobj/Fetc.hxx                  |    2 +-
 dtrans/source/win32/dtobj/XTDataObject.cxx          |    8 +++++---
 dtrans/source/win32/ftransl/ftransl.hxx             |    2 +-
 dtrans/source/win32/workbench/XTDo.hxx              |    2 +-
 dtrans/test/win32/dnd/atlwindow.hxx                 |    2 +-
 dtrans/test/win32/dnd/targetlistener.hxx            |    2 +-
 dtrans/test/win32/dnd/transferable.hxx              |    2 +-
 20 files changed, 34 insertions(+), 32 deletions(-)

New commits:
commit 5ee8e22a26f522302d6b8e2bb8ce7a1815b61af7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jan 6 12:17:04 2016 +0000

    cppcheck: noExplicitConstructor
    
    Change-Id: I94db78ca12e0f3389f00ea5c557f0b64d452f613
    Reviewed-on: https://gerrit.libreoffice.org/21150
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index 7d1c1fa..ebec49e 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -578,7 +578,7 @@ struct RaiseInfo
     unsigned char *        _code;
     sal_uInt64         _codeBase;
 
-    RaiseInfo( typelib_TypeDescription * pTD ) throw ();
+    explicit RaiseInfo(typelib_TypeDescription * pTD) throw ();
 
     ~RaiseInfo() throw ();
 };
diff --git a/bridges/test/performance/testperformance.cxx b/bridges/test/performance/testperformance.cxx
index 3aec05d..aa48e85 100644
--- a/bridges/test/performance/testperformance.cxx
+++ b/bridges/test/performance/testperformance.cxx
@@ -72,15 +72,15 @@ static inline sal_uInt32 getSystemTicks()
 class MyTimer
 {
 public:
-    MyTimer(  const OString &descString ) :
-        nStart( getSystemTicks() ),
-        m_descString( descString )
-        {
-        }
+    explicit MyTimer(const OString &descString)
+        : nStart(getSystemTicks())
+        , m_descString(descString)
+    {
+    }
     ~MyTimer( )
-        {
-            printf( "%f s : %s\n", (getSystemTicks() -nStart) / 1000., m_descString.getStr() );
-        }
+    {
+        printf( "%f s : %s\n", (getSystemTicks() -nStart) / 1000., m_descString.getStr() );
+    }
 private:
     sal_uInt32 nStart;
     OString m_descString;
diff --git a/bridges/test/testcomp.cxx b/bridges/test/testcomp.cxx
index 78918ecd..fb33907 100644
--- a/bridges/test/testcomp.cxx
+++ b/bridges/test/testcomp.cxx
@@ -112,7 +112,7 @@ public:
     ServiceImpl()
         : _nRef( 0 )
         {}
-    ServiceImpl( const Reference< XMultiServiceFactory > & /* xMgr */)
+    explicit ServiceImpl( const Reference< XMultiServiceFactory > & /* xMgr */)
         : _nRef( 0 )
         {}
 
diff --git a/bridges/test/testcomp.h b/bridges/test/testcomp.h
index 75bd05e..5f6fdd0 100644
--- a/bridges/test/testcomp.h
+++ b/bridges/test/testcomp.h
@@ -124,7 +124,7 @@ class OInstanceProvider :
 {
 public:
     OInstanceProvider( ){}
-    OInstanceProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & r ) :
+    explicit OInstanceProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & r ) :
         m_rSMgr( r )
         {}
     ~OInstanceProvider(){ printf( "instance provider dies\n" );}
diff --git a/canvas/source/directx/dx_textlayout_drawhelper.hxx b/canvas/source/directx/dx_textlayout_drawhelper.hxx
index 41f293f..4bb82ec 100644
--- a/canvas/source/directx/dx_textlayout_drawhelper.hxx
+++ b/canvas/source/directx/dx_textlayout_drawhelper.hxx
@@ -43,7 +43,7 @@ namespace dxcanvas
     class TextLayoutDrawHelper
     {
     public:
-        TextLayoutDrawHelper(
+        explicit TextLayoutDrawHelper(
             const css::uno::Reference< css::rendering::XGraphicDevice >& xGraphicDevice);
         ~TextLayoutDrawHelper();
 
diff --git a/dtrans/source/win32/dnd/idroptarget.hxx b/dtrans/source/win32/dnd/idroptarget.hxx
index 19f7974..c7843a3 100644
--- a/dtrans/source/win32/dnd/idroptarget.hxx
+++ b/dtrans/source/win32/dnd/idroptarget.hxx
@@ -31,7 +31,7 @@ class IDropTargetImpl: public IDropTarget
     IDropTargetImpl( const IDropTargetImpl& );
     IDropTargetImpl& operator=( const IDropTargetImpl& );
 public:
-    IDropTargetImpl( DropTarget& pTarget);
+    explicit IDropTargetImpl(DropTarget& rTarget);
 
        // IDropTarget
     virtual HRESULT STDMETHODCALLTYPE QueryInterface(
diff --git a/dtrans/source/win32/dnd/source.hxx b/dtrans/source/win32/dnd/source.hxx
index 02fa41d..146df44 100644
--- a/dtrans/source/win32/dnd/source.hxx
+++ b/dtrans/source/win32/dnd/source.hxx
@@ -86,7 +86,7 @@ public:
     sal_Int8 m_sourceActions;
 
 public:
-    DragSource(const Reference<XComponentContext>& rxContext);
+    explicit DragSource(const Reference<XComponentContext>& rxContext);
     virtual ~DragSource();
 
   // XInitialization
diff --git a/dtrans/source/win32/dnd/target.hxx b/dtrans/source/win32/dnd/target.hxx
index 5011dfa..065e6d5 100644
--- a/dtrans/source/win32/dnd/target.hxx
+++ b/dtrans/source/win32/dnd/target.hxx
@@ -111,7 +111,7 @@ private:
     DropTarget &operator= (DropTarget&);
 
 public:
-    DropTarget(const Reference<XComponentContext>& rxContext);
+    explicit DropTarget(const Reference<XComponentContext>& rxContext);
     virtual ~DropTarget();
 
     // Overrides WeakComponentImplHelper::disposing which is called by
diff --git a/dtrans/source/win32/dnd/targetdragcontext.hxx b/dtrans/source/win32/dnd/targetdragcontext.hxx
index a271d61..ed329c0 100644
--- a/dtrans/source/win32/dnd/targetdragcontext.hxx
+++ b/dtrans/source/win32/dnd/targetdragcontext.hxx
@@ -41,7 +41,7 @@ class TargetDragContext: public WeakImplHelper<XDropTargetDragContext>
     TargetDragContext( const TargetDragContext&);
     TargetDragContext &operator= ( const TargetDragContext&);
 public:
-    TargetDragContext( DropTarget* pTarget);
+    explicit TargetDragContext(DropTarget* pTarget);
     ~TargetDragContext();
 
     virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation )
diff --git a/dtrans/source/win32/dnd/targetdropcontext.hxx b/dtrans/source/win32/dnd/targetdropcontext.hxx
index 488137b..a7ae0e6 100644
--- a/dtrans/source/win32/dnd/targetdropcontext.hxx
+++ b/dtrans/source/win32/dnd/targetdropcontext.hxx
@@ -40,7 +40,7 @@ class TargetDropContext: public WeakImplHelper<XDropTargetDropContext>
     TargetDropContext( const TargetDropContext&);
     TargetDropContext &operator= ( const TargetDropContext&);
 public:
-    TargetDropContext( DropTarget* pTarget);
+    explicit TargetDropContext(DropTarget* pTarget);
     ~TargetDropContext();
 
     // XDropTargetDragContext
diff --git a/dtrans/source/win32/dtobj/APNDataObject.hxx b/dtrans/source/win32/dtobj/APNDataObject.hxx
index 9522aae..86dd355 100644
--- a/dtrans/source/win32/dtobj/APNDataObject.hxx
+++ b/dtrans/source/win32/dtobj/APNDataObject.hxx
@@ -32,8 +32,8 @@
 class CAPNDataObject : public IDataObject
 {
 public:
-    CAPNDataObject( IDataObjectPtr rIDataObject );
-    virtual ~CAPNDataObject( );
+    explicit CAPNDataObject(IDataObjectPtr rIDataObject);
+    virtual ~CAPNDataObject();
 
     //IUnknown interface methods
 
diff --git a/dtrans/source/win32/dtobj/DTransHelper.hxx b/dtrans/source/win32/dtobj/DTransHelper.hxx
index 7754ec3..ce0e3b4 100644
--- a/dtrans/source/win32/dtobj/DTransHelper.hxx
+++ b/dtrans/source/win32/dtobj/DTransHelper.hxx
@@ -43,7 +43,7 @@ public:
     {
     public:
         HRESULT m_hr;
-        CStgTransferException( HRESULT hr ) : m_hr( hr ) {};
+        explicit CStgTransferException( HRESULT hr ) : m_hr( hr ) {};
     };
 
 public:
@@ -95,7 +95,7 @@ public:
 
     // ctor
 
-    CRawHGlobalPtr( HGLOBAL hGlob ) :
+    explicit CRawHGlobalPtr( HGLOBAL hGlob ) :
         m_hGlob( hGlob ),
         m_bIsLocked( FALSE ),
         m_pGlobMem( NULL )
@@ -104,7 +104,7 @@ public:
 
     // ctor
 
-    CRawHGlobalPtr( const CStgTransferHelper& theHGlobalHelper ) :
+    explicit CRawHGlobalPtr( const CStgTransferHelper& theHGlobalHelper ) :
         m_hGlob( theHGlobalHelper.getHGlobal( ) ),
         m_bIsLocked( FALSE ),
         m_pGlobMem( NULL )
diff --git a/dtrans/source/win32/dtobj/DataFmtTransl.hxx b/dtrans/source/win32/dtobj/DataFmtTransl.hxx
index f3a00cd..716d96e 100644
--- a/dtrans/source/win32/dtobj/DataFmtTransl.hxx
+++ b/dtrans/source/win32/dtobj/DataFmtTransl.hxx
@@ -41,7 +41,7 @@ class CFormatEtc;
 class CDataFormatTranslator
 {
 public:
-    CDataFormatTranslator( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+    explicit CDataFormatTranslator( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
 
     CFormatEtc getFormatEtcFromDataFlavor( const css::datatransfer::DataFlavor& aDataFlavor ) const;
     css::datatransfer::DataFlavor getDataFlavorFromFormatEtc(
diff --git a/dtrans/source/win32/dtobj/Fetc.hxx b/dtrans/source/win32/dtobj/Fetc.hxx
index 4f86c69..86edb83 100644
--- a/dtrans/source/win32/dtobj/Fetc.hxx
+++ b/dtrans/source/win32/dtobj/Fetc.hxx
@@ -42,7 +42,7 @@ class CFormatEtc
 {
 public:
     CFormatEtc( );
-    CFormatEtc( const FORMATETC& aFormatEtc );
+    explicit CFormatEtc( const FORMATETC& aFormatEtc );
     CFormatEtc( CLIPFORMAT cf, DWORD tymed = TYMED_HGLOBAL, DVTARGETDEVICE* ptd = NULL, DWORD dwAspect = DVASPECT_CONTENT, LONG lindex = -1 );
     CFormatEtc( const CFormatEtc& theOther );
 
diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/dtrans/source/win32/dtobj/XTDataObject.cxx
index 3c8a937..7f3a46c 100644
--- a/dtrans/source/win32/dtobj/XTDataObject.cxx
+++ b/dtrans/source/win32/dtobj/XTDataObject.cxx
@@ -58,7 +58,7 @@ class CInvalidFormatEtcException
 {
 public:
     HRESULT m_hr;
-    CInvalidFormatEtcException( HRESULT hr ) : m_hr( hr ) {};
+    explicit CInvalidFormatEtcException( HRESULT hr ) : m_hr( hr ) {};
 };
 
 // ctor
@@ -137,7 +137,8 @@ STDMETHODIMP CXTDataObject::GetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium
     {
         HRESULT hr = DV_E_FORMATETC;
 
-        if ( m_FormatRegistrar.isSynthesizeableFormat( *pFormatetc ) )
+        CFormatEtc aFormatetc(*pFormatetc);
+        if (m_FormatRegistrar.isSynthesizeableFormat(aFormatetc))
             hr = renderSynthesizedFormatAndSetupStgMedium( *pFormatetc, *pmedium );
 
         return hr;
@@ -479,7 +480,8 @@ STDMETHODIMP CXTDataObject::QueryGetData( LPFORMATETC pFormatetc )
 
     InitializeFormatEtcContainer( );
 
-    return m_FormatEtcContainer.hasFormatEtc( *pFormatetc ) ? S_OK : S_FALSE;
+    CFormatEtc aFormatetc(*pFormatetc);
+    return m_FormatEtcContainer.hasFormatEtc(aFormatetc) ? S_OK : S_FALSE;
 }
 
 // IDataObject->GetDataHere
diff --git a/dtrans/source/win32/ftransl/ftransl.hxx b/dtrans/source/win32/ftransl/ftransl.hxx
index 8863ffc..936377d 100644
--- a/dtrans/source/win32/ftransl/ftransl.hxx
+++ b/dtrans/source/win32/ftransl/ftransl.hxx
@@ -47,7 +47,7 @@ class CDataFormatTranslator : public
 {
 
 public:
-    CDataFormatTranslator( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+    explicit CDataFormatTranslator( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
 
     // XDataFormatTranslator
 
diff --git a/dtrans/source/win32/workbench/XTDo.hxx b/dtrans/source/win32/workbench/XTDo.hxx
index 336ba19..61b1499 100644
--- a/dtrans/source/win32/workbench/XTDo.hxx
+++ b/dtrans/source/win32/workbench/XTDo.hxx
@@ -88,7 +88,7 @@ private:
 class CEnumFormatEtc : public IEnumFORMATETC
 {
 public:
-    CEnumFormatEtc( LPUNKNOWN pUnkDataObj );
+    explicit CEnumFormatEtc( LPUNKNOWN pUnkDataObj );
 
     // IUnknown
     STDMETHODIMP           QueryInterface( REFIID iid, LPVOID* ppvObject );
diff --git a/dtrans/test/win32/dnd/atlwindow.hxx b/dtrans/test/win32/dnd/atlwindow.hxx
index 0dbb0f5..692b8be 100644
--- a/dtrans/test/win32/dnd/atlwindow.hxx
+++ b/dtrans/test/win32/dnd/atlwindow.hxx
@@ -52,7 +52,7 @@ class AWindow: public CWindowImpl<AWindow, CWindow,
     CDTransObjFactory m_aDataConverter;
 
 public:
-    AWindow(LPCTSTR strName)
+    explicit AWindow(LPCTSTR strName)
     {
         RECT rcPos= {0,0,200,200};
         Create(0, rcPos, strName);
diff --git a/dtrans/test/win32/dnd/targetlistener.hxx b/dtrans/test/win32/dnd/targetlistener.hxx
index 5064dc7..153dc64 100644
--- a/dtrans/test/win32/dnd/targetlistener.hxx
+++ b/dtrans/test/win32/dnd/targetlistener.hxx
@@ -44,7 +44,7 @@ class DropTargetListener: public WeakImplHelper<XDropTargetListener>
     // this is a window where dropped data are shown as text (only text)
     HWND m_hEdit;
 public:
-    DropTargetListener( HWND hEdit);
+    explicit DropTargetListener(HWND hEdit);
     ~DropTargetListener();
 
     virtual void SAL_CALL disposing( const EventObject& Source )
diff --git a/dtrans/test/win32/dnd/transferable.hxx b/dtrans/test/win32/dnd/transferable.hxx
index 428c9f7..1afafea 100644
--- a/dtrans/test/win32/dnd/transferable.hxx
+++ b/dtrans/test/win32/dnd/transferable.hxx
@@ -70,7 +70,7 @@ class CTransferable : public WeakImplHelper< XClipboardOwner, XTransferable >
 {
 public:
     CTransferable( ){};
-    CTransferable( wchar_t* dataString);
+    explicit CTransferable( wchar_t* dataString);
 
     // XTransferable
 


More information about the Libreoffice-commits mailing list