[Libreoffice-commits] core.git: dbaccess/source editeng/source hwpfilter/source libreofficekit/qa

Gökhan Gurbetoğlu gokhan.gurbetoglu at pardus.org.tr
Tue Apr 17 06:16:07 UTC 2018


 dbaccess/source/ui/querydesign/QueryDesignView.cxx |    4 +---
 editeng/source/misc/svxacorr.cxx                   |    3 +--
 hwpfilter/source/hwpreader.cxx                     |    3 +--
 libreofficekit/qa/tilebench/tilebench.cxx          |   12 ++++++------
 4 files changed, 9 insertions(+), 13 deletions(-)

New commits:
commit 0f166ef5240ee155bf2544e6bc3c985b1e3bf646
Author: Gökhan Gurbetoğlu <gokhan.gurbetoglu at pardus.org.tr>
Date:   Mon Apr 16 15:33:03 2018 +0300

    cppcheck - fix variableScope in some files
    
    Reduced the scope of some variables in source.
    
    Change-Id: Ib3b521ca5df8b9b254b51eab5f1d7040d6cfd846
    Reviewed-on: https://gerrit.libreoffice.org/52974
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index e3ca3e8af707..077376b66ceb 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -640,13 +640,11 @@ namespace
                     {
                         // we have to look if we have alias.* here but before we have to check if the column doesn't already exist
                         OTableFieldDescRef  aInfo = new OTableFieldDesc();
-                        bool bFound = false;
                         for (auto const& table : rTabList)
                         {
                             OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(table.second.get());
 
-                            bFound = pTabWin->ExistsField( rFieldName, aInfo );
-                            if ( bFound )
+                            if ( pTabWin->ExistsField( rFieldName, aInfo ) )
                             {
                                 rFieldName = aInfo->GetField();
                                 break;
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 9ba2b3152618..8d4d9d7cc0b0 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2569,14 +2569,13 @@ void SvxAutoCorrectLanguageLists::PutText( const OUString& rShort,
 
     MakeUserStorage_Impl();
 
-    bool bRet = false;
     OUString sLong;
     try
     {
         uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetStorageFromURL( sUserAutoCorrFile, embed::ElementModes::READWRITE );
-        bRet = rAutoCorrect.PutText( xStg, sUserAutoCorrFile, rShort, rShell, sLong );
         xStg = nullptr;
 
+        bool bRet = rAutoCorrect.PutText( xStg, sUserAutoCorrFile, rShort, rShell, sLong );
         // Update the word list
         if( bRet )
         {
diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx
index d20c1b8ea783..2b5e5145ae5b 100644
--- a/hwpfilter/source/hwpreader.cxx
+++ b/hwpfilter/source/hwpreader.cxx
@@ -122,11 +122,10 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportHWP(SvStream &rStream)
     {
         std::unique_ptr<HStream> stream(new HStream);
         byte aData[32768];
-        std::size_t nRead;
 
         while (true)
         {
-            nRead = rStream.ReadBytes(aData, 32768);
+            std::size_t nRead = rStream.ReadBytes(aData, 32768);
             if (nRead == 0)
                 break;
             stream->addData(aData, static_cast<int>(nRead));
diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx
index ed3d57d05b3f..3c62e2e36838 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -104,12 +104,6 @@ int main( int argc, char* argv[] )
         return 1;
     }
 
-    // Use realistic dimensions, similar to the Online client.
-    long nTilePixelWidth = 512;
-    long nTilePixelHeight = 512;
-    long nTileTwipWidth = 3840;
-    long nTileTwipHeight = 3840;
-
     aTimes.emplace_back("initialization");
     // coverity[tainted_string] - build time test tool
     Office *pOffice = lok_cpp_init(argv[1]);
@@ -153,6 +147,12 @@ int main( int argc, char* argv[] )
         }
         aTimes.emplace_back();
 
+        // Use realistic dimensions, similar to the Online client.
+        long nTilePixelWidth = 512;
+        long nTilePixelHeight = 512;
+        long nTileTwipWidth = 3840;
+        long nTileTwipHeight = 3840;
+
         // Estimate the maximum tiles based on the number of parts requested, if Writer.
         if (pDocument->getDocumentType() == LOK_DOCTYPE_TEXT)
             max_tiles = static_cast<int>(ceil(max_parts * 16128. / nTilePixelHeight)) * ceil(static_cast<double>(nWidth) / nTilePixelWidth);


More information about the Libreoffice-commits mailing list