[Libreoffice-commits] core.git: 3 commits - vcl/source

Caolán McNamara caolanm at redhat.com
Tue Mar 31 00:50:12 PDT 2015


 vcl/source/gdi/pdfwriter_impl.cxx |    2 +-
 vcl/source/gdi/pdfwriter_impl.hxx |    8 ++++----
 vcl/source/gdi/pngread.cxx        |    7 +++----
 vcl/source/gdi/print3.cxx         |    3 ++-
 4 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit b024e36ddb3b53163d7a01f6f7b5aadb7a858cd9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 31 08:45:24 2015 +0100

    cppcheck: can add explicit to ctor
    
    Change-Id: I9b626a8c5674157033f62f5aff10259136d21a42

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 5e3cc6f..f62fa73 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -12608,7 +12608,7 @@ sal_Int32 PDFWriterImpl::beginStructureElement( PDFWriter::StructElement eType,
     {
         rEle.m_nObject      = createObject();
         // update parent's kids list
-        m_aStructure[ rEle.m_nParentElement ].m_aKids.push_back( rEle.m_nObject );
+        m_aStructure[ rEle.m_nParentElement ].m_aKids.push_back(PDFStructureElementKid(rEle.m_nObject));
     }
     return nNewId;
 }
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index 43bb0c5..1f2ac6b 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -333,7 +333,7 @@ public:
         sal_Int32           m_nFontID;
         FontEmitMapping     m_aMapping;
 
-        FontEmit( sal_Int32 nID ) : m_nFontID( nID ) {}
+        explicit FontEmit( sal_Int32 nID ) : m_nFontID( nID ) {}
     };
     typedef std::list< FontEmit > FontEmitList;
     struct Glyph
@@ -494,12 +494,12 @@ public:
                   nValue( 0 )
         {}
 
-        PDFStructureAttribute( PDFWriter::StructAttributeValue eVal )
+        explicit PDFStructureAttribute( PDFWriter::StructAttributeValue eVal )
                 : eValue( eVal ),
                   nValue( 0 )
         {}
 
-        PDFStructureAttribute( sal_Int32 nVal )
+        explicit PDFStructureAttribute( sal_Int32 nVal )
                 : eValue( PDFWriter::Invalid ),
                   nValue( nVal )
         {}
@@ -513,7 +513,7 @@ public:
                             // else the page object relevant to MCID
         sal_Int32 nMCID;    // an MCID if >= 0
 
-        PDFStructureElementKid( sal_Int32 nObj ) : nObject( nObj ), nMCID( -1 ) {}
+        explicit PDFStructureElementKid( sal_Int32 nObj ) : nObject( nObj ), nMCID( -1 ) {}
         PDFStructureElementKid( sal_Int32 MCID, sal_Int32 nPage ) : nObject( nPage ), nMCID( MCID ) {}
     };
 
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index b4b16f9..519a278 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -155,8 +155,8 @@ private:
 
 public:
 
-                        PNGReaderImpl( SvStream& );
-                        ~PNGReaderImpl();
+    explicit PNGReaderImpl( SvStream& );
+    ~PNGReaderImpl();
 
     BitmapEx            GetBitmapEx( const Size& rPreviewSizeHint );
     const std::vector<vcl::PNGReader::ChunkData>& GetAllChunks();
commit 2ecc29df60ae3ae98605d84dc212a69907d4bfbe
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 31 08:44:56 2015 +0100

    cppcheck: value that is never used
    
    Change-Id: If4707a661a447e5053df83c431ac9f4dab8ff5ae

diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index 62fc45f..b4b16f9 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -349,8 +349,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
     }
 
     // parse the remaining chunks
-    bool bRetFromNextChunk;
-    while( mbStatus && !mbIDAT && (bRetFromNextChunk = ReadNextChunk()) )
+    while (mbStatus && !mbIDAT && ReadNextChunk())
     {
         switch( mnChunkType )
         {
commit f0f0d90ba613f568ffdc1531ce7c9bce23c22bcd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 31 08:43:52 2015 +0100

    cppcheck: scope can be reduced
    
    Change-Id: I62e1c203e5224e69b4864f321287f2fcbe3db08f

diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 3bd9f05..543ab88 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -654,7 +654,7 @@ bool Printer::StartJob( const OUString& i_rJobName, std::shared_ptr<vcl::Printer
 
         for( int nJobIteration = 0; nJobIteration < nJobs; nJobIteration++ )
         {
-            bool bError = false, bAborted = false;
+            bool bError = false;
             if( mpPrinter->StartJob( pPrintFile,
                                      i_rJobName,
                                      Application::GetDisplayName(),
@@ -663,6 +663,7 @@ bool Printer::StartJob( const OUString& i_rJobName, std::shared_ptr<vcl::Printer
                                      i_xController->isDirectPrint(),
                                      maJobSetup.ImplGetConstData() ) )
             {
+                bool bAborted = false;
                 mbJobActive             = true;
                 i_xController->createProgressDialog();
                 const int nPages = i_xController->getFilteredPageCount();


More information about the Libreoffice-commits mailing list