[Libreoffice-commits] core.git: 2 commits - cppcanvas/source dbaccess/source desktop/qa desktop/source desktop/unx drawinglayer/qa drawinglayer/source jvmfwk/plugins l10ntools/inc l10ntools/source libreofficekit/source linguistic/source mysqlc/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Jun 23 06:59:41 UTC 2017


 cppcanvas/source/mtfrenderer/implrenderer.cxx                |    4 
 dbaccess/source/core/api/RowSet.cxx                          |    8 
 dbaccess/source/core/dataaccess/connection.cxx               |    3 
 dbaccess/source/core/dataaccess/databasedocument.cxx         |    3 
 dbaccess/source/core/dataaccess/databaseregistrations.cxx    |   20 -
 dbaccess/source/ui/app/AppController.cxx                     |    5 
 dbaccess/source/ui/app/AppDetailView.cxx                     |    3 
 dbaccess/source/ui/browser/unodatbr.cxx                      |    3 
 dbaccess/source/ui/control/TableGrantCtrl.cxx                |    4 
 dbaccess/source/ui/control/dbtreelistbox.cxx                 |    3 
 dbaccess/source/ui/dlg/CollectionView.cxx                    |    7 
 dbaccess/source/ui/dlg/DriverSettings.cxx                    |   14 -
 dbaccess/source/ui/dlg/TextConnectionHelper.cxx              |    2 
 dbaccess/source/ui/dlg/dbfindex.cxx                          |    4 
 dbaccess/source/ui/dlg/textconnectionsettings.cxx            |    3 
 dbaccess/source/ui/misc/UITools.cxx                          |    3 
 dbaccess/source/ui/misc/WCopyTable.cxx                       |    4 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx        |    4 
 dbaccess/source/ui/querydesign/querycontainerwindow.cxx      |    3 
 dbaccess/source/ui/tabledesign/TableController.cxx           |    2 
 dbaccess/source/ui/tabledesign/TableDesignControl.cxx        |    4 
 dbaccess/source/ui/tabledesign/TableDesignView.cxx           |    3 
 dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx         |    3 
 dbaccess/source/ui/uno/ColumnPeer.cxx                        |    2 
 desktop/qa/desktop_lib/test_desktop_lib.cxx                  |   13 
 desktop/source/app/app.cxx                                   |   12 
 desktop/source/app/check_ext_deps.cxx                        |    5 
 desktop/source/app/dispatchwatcher.cxx                       |    9 
 desktop/source/deployment/dp_persmap.cxx                     |    2 
 desktop/source/deployment/manager/dp_commandenvironments.cxx |    9 
 desktop/source/deployment/registry/help/dp_help.cxx          |    6 
 desktop/source/migration/migration.cxx                       |    5 
 desktop/unx/source/splashx.c                                 |    6 
 drawinglayer/qa/unit/border.cxx                              |   32 +-
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx   |  144 ++++-------
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx                   |    8 
 l10ntools/inc/lngmerge.hxx                                   |    1 
 l10ntools/source/lngmerge.cxx                                |    9 
 libreofficekit/source/gtk/lokdocview.cxx                     |    1 
 libreofficekit/source/gtk/tilebuffer.hxx                     |    6 
 linguistic/source/convdic.cxx                                |    4 
 linguistic/source/convdic.hxx                                |    1 
 linguistic/source/convdicxml.cxx                             |    6 
 mysqlc/source/mysqlc_connection.cxx                          |    2 
 mysqlc/source/mysqlc_connection.hxx                          |    2 
 mysqlc/source/mysqlc_databasemetadata.cxx                    |    4 
 mysqlc/source/mysqlc_databasemetadata.hxx                    |    1 
 47 files changed, 147 insertions(+), 255 deletions(-)

New commits:
commit 58ae5fb5ff69a5581cffa583a57ad9381140fa9a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Jun 22 16:05:11 2017 +0200

    loplugin:oncevar in cppcanvas..drawinglayer
    
    Change-Id: I5456aad61fb0dfe6830eae62b91d1a6399d6343f
    Reviewed-on: https://gerrit.libreoffice.org/39128
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 10c8d875d22e..95b431e09322 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -1004,8 +1004,6 @@ namespace cppcanvas
                         pStrikeoutCharWidths[ i ] += pStrikeoutCharWidths[ i-1 ];
                     }
 
-                    sal_Int32 nStartPos = 0;
-
                     pStrikeoutTextAction =
                         TextActionFactory::createTextAction(
                             rStartPoint,
@@ -1014,7 +1012,7 @@ namespace cppcanvas
                             aShadowOffset,
                             aShadowColor,
                             aStrikeoutText,
-                            nStartPos,
+                            0/*nStartPos*/,
                             aStrikeoutText.getLength(),
                             pStrikeoutCharWidths,
                             rParms.mrVDev,
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 573f9cf14157..2d23d0c19e8f 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -166,9 +166,9 @@ ORowSet::ORowSet( const Reference< css::uno::XComponentContext >& _rxContext )
     m_pMySelf = this;
     m_aActiveConnection <<= m_xActiveConnection;
 
-    sal_Int32 nRBT  = PropertyAttribute::READONLY   | PropertyAttribute::BOUND      | PropertyAttribute::TRANSIENT;
-    sal_Int32 nRT   = PropertyAttribute::READONLY   | PropertyAttribute::TRANSIENT;
-    sal_Int32 nBT   = PropertyAttribute::BOUND      | PropertyAttribute::TRANSIENT;
+    sal_Int32 const nRBT = PropertyAttribute::READONLY   | PropertyAttribute::BOUND      | PropertyAttribute::TRANSIENT;
+    sal_Int32 const nRT  = PropertyAttribute::READONLY   | PropertyAttribute::TRANSIENT;
+    sal_Int32 const nBT  = PropertyAttribute::BOUND      | PropertyAttribute::TRANSIENT;
 
     m_aPrematureParamValues->get().resize( 0 );
 
@@ -2850,7 +2850,7 @@ ORowSetClone::ORowSetClone( const Reference<XComponentContext>& _rContext, ORowS
     m_pColumns = new ORowSetDataColumns(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers(),
                                         aColumns,*this,m_aMutex,aNames);
 
-    sal_Int32 nRT   = PropertyAttribute::READONLY   | PropertyAttribute::TRANSIENT;
+    sal_Int32 const nRT = PropertyAttribute::READONLY   | PropertyAttribute::TRANSIENT;
 
     // sdb.RowSet Properties
     registerMayBeVoidProperty(PROPERTY_ACTIVE_CONNECTION,PROPERTY_ID_ACTIVE_CONNECTION, PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY,   &rParent.m_aActiveConnection,   cppu::UnoType<XConnection>::get());
diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx
index accc80ac7e56..95a53242d9b2 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -319,12 +319,11 @@ OConnection::OConnection(ODatabaseSource& _rDB
             Reference<XResultSet> xRes = xMeta->getTableTypes();
             if(xRes.is())
             {
-                OUString sView("VIEW");
                 Reference<XRow> xRow(xRes,UNO_QUERY);
                 while(xRes->next())
                 {
                     OUString sValue = xRow->getString(1);
-                    if( !xRow->wasNull() && sValue == sView)
+                    if( !xRow->wasNull() && sValue == "VIEW")
                     {
                         m_bSupportsViews = true;
                         break;
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index cb2bbea06c2a..ee3109b5e2b4 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1742,13 +1742,12 @@ Reference< XUIConfigurationManager2 > const & ODatabaseDocument::getUIConfigurat
         xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, ElementModes::READWRITE );
         if ( xConfigStorage.is() )
         {
-            OUString aUIConfigMediaType( "application/vnd.sun.xml.ui.configuration" );
             OUString aMediaType;
             Reference< XPropertySet > xPropSet( xConfigStorage, UNO_QUERY );
             Any a = xPropSet->getPropertyValue( INFO_MEDIATYPE );
             if ( !( a >>= aMediaType ) ||  aMediaType.isEmpty() )
             {
-                a <<= aUIConfigMediaType;
+                a <<= OUString("application/vnd.sun.xml.ui.configuration");
                 xPropSet->setPropertyValue( INFO_MEDIATYPE, a );
             }
         }
diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
index 2ce22ba32448..6734c2e7dc57 100644
--- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx
+++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
@@ -184,23 +184,11 @@ namespace dbaccess
         if (aNodeForName.isValid())
             throw ElementExistException( _rName, *this );
 
-        OUString sNewNodeName;
+        // make unique
+        OUString sNewNodeName = "org.openoffice." + _rName;
+        while ( m_aConfigurationRoot.hasByName( sNewNodeName ) )
         {
-            OUStringBuffer aNewNodeName;
-            aNewNodeName.append( "org.openoffice." );
-            aNewNodeName.append( _rName );
-
-            // make unique
-            OUStringBuffer aReset( aNewNodeName );
-            sNewNodeName = aNewNodeName.makeStringAndClear();
-            sal_Int32 i=2;
-            while ( m_aConfigurationRoot.hasByName( sNewNodeName ) )
-            {
-                aNewNodeName = aReset;
-                aNewNodeName.append( " " );
-                aNewNodeName.append( i );
-                sNewNodeName = aNewNodeName.makeStringAndClear();
-            }
+            sNewNodeName = "org.openoffice." + _rName + " 2";
         }
 
         ::utl::OConfigurationNode aNewNode( m_aConfigurationRoot.createNode( sNewNodeName ) );
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index b271d29ddcff..9532e54bd133 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -2134,9 +2134,8 @@ void OApplicationController::renameEntry()
                         }
                         catch(const ElementExistException& e)
                         {
-                            OUString sStatus("S1000");
-                            OUString sMsg = OUString( ModuleRes( STR_NAME_ALREADY_EXISTS ) );
-                            showError(SQLExceptionInfo(SQLException(sMsg.replaceAll("#", e.Message), e.Context, sStatus, 0, Any())));
+                            OUString sMsg( ModuleRes( STR_NAME_ALREADY_EXISTS ) );
+                            showError(SQLExceptionInfo(SQLException(sMsg.replaceAll("#", e.Message), e.Context, "S1000", 0, Any())));
                         }
                         catch(const Exception& )
                         {
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index 08af0e8e7fd4..eecaa2a59cdd 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -76,8 +76,7 @@ OCreationList::OCreationList( OTasksWindow& _rParent )
     ,m_pMouseDownEntry( nullptr )
     ,m_pLastActiveEntry( nullptr )
 {
-    sal_uInt16 nSize = SPACEBETWEENENTRIES;
-    SetSpaceBetweenEntries(nSize);
+    SetSpaceBetweenEntries(SPACEBETWEENENTRIES);
     SetSelectionMode( SelectionMode::NONE );
     SetExtendedWinBits( EWB_NO_AUTO_CURENTRY );
     SetNodeDefaultImages( );
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 0517b4382832..241fa9aa19ad 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -3413,7 +3413,6 @@ void SbaTableQueryBrowser::implAdministrate( SvTreeListEntry* _pApplyTo )
     try
     {
         // get the desktop object
-        sal_Int32 nFrameSearchFlag = FrameSearchFlag::ALL | FrameSearchFlag::GLOBAL ;
         Reference< XDesktop2 > xFrameLoader = Desktop::create( getORB() );
 
         // the initial selection
@@ -3443,7 +3442,7 @@ void SbaTableQueryBrowser::implAdministrate( SvTreeListEntry* _pApplyTo )
             xFrameLoader->loadComponentFromURL(
                 xDocumentModel->getURL(),
                 "_default",
-                nFrameSearchFlag,
+                FrameSearchFlag::ALL | FrameSearchFlag::GLOBAL,
                 aLoadArgPV
             );
         }
diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx
index 08a16e8761e5..91cd2b3c64b3 100644
--- a/dbaccess/source/ui/control/TableGrantCtrl.cxx
+++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx
@@ -137,8 +137,8 @@ void OTableGrantControl::Init()
 
     UpdateTables();
     // set browser mode
-    BrowserMode nMode = BrowserMode::COLUMNSELECTION | BrowserMode::HLINES | BrowserMode::VLINES |
-                        BrowserMode::HIDECURSOR      | BrowserMode::HIDESELECT;
+    BrowserMode const nMode = BrowserMode::COLUMNSELECTION | BrowserMode::HLINES | BrowserMode::VLINES |
+                              BrowserMode::HIDECURSOR      | BrowserMode::HIDESELECT;
 
     SetMode(nMode);
 }
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index 8b768662079f..07fcb331ce65 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -65,8 +65,7 @@ DBTreeListBox::DBTreeListBox( vcl::Window* pParent, WinBits nWinStyle )
 
 void DBTreeListBox::init()
 {
-    sal_uInt16 nSize = SPACEBETWEENENTRIES;
-    SetSpaceBetweenEntries(nSize);
+    SetSpaceBetweenEntries(SPACEBETWEENENTRIES);
 
     m_aTimer.SetTimeout(900);
     m_aTimer.SetInvokeHandler(LINK(this, DBTreeListBox, OnTimeOut));
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index 7084019c5d5d..019cb59cabf7 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -157,10 +157,9 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click, Button*, void)
                     aValue.Value <<= OUString("folder");
                     aValues[1] <<= aValue;
 
-                    InteractionClassification eClass = InteractionClassification_ERROR;
-                    css::ucb::IOErrorCode eError = IOErrorCode_NOT_EXISTING_PATH;
-                    OUString sTemp;
-                    InteractiveAugmentedIOException aException(sTemp,Reference<XInterface>(),eClass,eError,aValues);
+                    InteractiveAugmentedIOException aException(OUString(),Reference<XInterface>(),
+                                                               InteractionClassification_ERROR,
+                                                               IOErrorCode_NOT_EXISTING_PATH,aValues);
 
                     Reference<XInteractionHandler2> xHandler(
                         InteractionHandler::createWithParent(m_xContext, VCLUnoHelper::GetInterface( this )));
diff --git a/dbaccess/source/ui/dlg/DriverSettings.cxx b/dbaccess/source/ui/dlg/DriverSettings.cxx
index b553697a88f0..549ec62b9b9c 100644
--- a/dbaccess/source/ui/dlg/DriverSettings.cxx
+++ b/dbaccess/source/ui/dlg/DriverSettings.cxx
@@ -53,20 +53,6 @@ void ODriversSettings::getSupportedIndirectSettings( const OUString& _sURLPrefix
 
     ::connectivity::DriversConfig aDriverConfig(_xContext);
     const ::comphelper::NamedValueCollection& aProperties = aDriverConfig.getProperties(_sURLPrefix);
-#if OSL_DEBUG_LEVEL > 0
-    {
-        Sequence< NamedValue > aNamedValues;
-        aProperties >>= aNamedValues;
-        for (   const NamedValue* loop = aNamedValues.getConstArray();
-                loop != aNamedValues.getConstArray() + aNamedValues.getLength();
-                ++loop
-            )
-        {
-            int dummy = 0;
-            (void)dummy;
-        }
-    }
-#endif
     typedef std::pair<sal_uInt16, OUString> TProperties;
     TProperties aProps[] = { TProperties(DSID_SHOWDELETEDROWS,OUString("ShowDeleted"))
                             ,TProperties(DSID_CHARSET,OUString("CharSet"))
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index 6e8316400133..88a777396536 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -401,7 +401,7 @@ namespace dbaui
 
     OUString OTextConnectionHelper::GetSeparator( const ComboBox& rBox, const OUString& rList )
     {
-        sal_Unicode nTok = '\t';
+        sal_Unicode const nTok = '\t';
         sal_Int32 nPos(rBox.GetEntryPos( rBox.GetText() ));
 
         if( nPos == COMBOBOX_ENTRY_NOTFOUND )
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index 79f10f3ca6fa..76c7160d5ac5 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -297,8 +297,8 @@ void ODbaseIndexDialog::Init()
 
     Sequence< OUString> aFolderContent( ::utl::LocalFileHelper::GetFolderContents(m_aDSN,bFolder));
 
-    OUString aIndexExt("ndx");
-    OUString aTableExt("dbf");
+    OUString const aIndexExt("ndx");
+    OUString const aTableExt("dbf");
 
     std::vector< OUString > aUsedIndexes;
 
diff --git a/dbaccess/source/ui/dlg/textconnectionsettings.cxx b/dbaccess/source/ui/dlg/textconnectionsettings.cxx
index af6d70529a5e..6c741ad71424 100644
--- a/dbaccess/source/ui/dlg/textconnectionsettings.cxx
+++ b/dbaccess/source/ui/dlg/textconnectionsettings.cxx
@@ -71,8 +71,7 @@ namespace dbaui
     {
         if ( m_pTextConnectionHelper->prepareLeave() )
         {
-            bool bUnused = false;
-            m_pTextConnectionHelper->FillItemSet( m_rItems, bUnused );
+            m_pTextConnectionHelper->FillItemSet( m_rItems, false/*bUnused*/ );
             EndDialog( RET_OK );
         }
     }
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index da48f4bcb9fc..5e3861764afe 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -843,8 +843,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
 
     if (!bText)
     {
-        double dPreviewVal = 1234.56789;
-        SvxNumberInfoItem aFormatter(_pFormatter, dPreviewVal, SID_ATTR_NUMBERFORMAT_INFO);
+        SvxNumberInfoItem aFormatter(_pFormatter, 1234.56789, SID_ATTR_NUMBERFORMAT_INFO);
         pFormatDescriptor->Put(aFormatter);
     }
 
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 1457bea1227c..d66e4c7bd02c 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -1035,7 +1035,7 @@ void OCopyTableWizard::loadData(  const ICopyTableSourceObject& _rSourceObject,
     _rColumns.clear();
 
     OFieldDescription* pActFieldDescr = nullptr;
-    OUString sCreateParam("x");
+    OUString const sCreateParam("x");
     // ReadOnly-Flag
     // On drop no line must be editable.
     // On add only empty lines must be editable.
@@ -1509,7 +1509,7 @@ TOTypeInfoSP OCopyTableWizard::convertType(const TOTypeInfoSP& _pType, bool& _bN
         if ( !pType.get() )
         {
             _bNotConvert = false;
-            OUString sCreate("x");
+            OUString const sCreate("x");
             pType = ::dbaui::getTypeInfoFromType(m_aDestTypeInfo,DataType::VARCHAR,_pType->aTypeName,sCreate,50,0,false,bForce);
             if ( !pType.get() )
                 pType = m_pTypeInfo;
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 80e8cd603343..9b25e3f9bd95 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -2080,7 +2080,7 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const
 {
     sal_Int32 nErg(0);
     // only the first 11 row are interesting
-    sal_Int32 nSize = SAL_N_ELEMENTS(nVisibleRowMask);
+    sal_Int32 const nSize = SAL_N_ELEMENTS(nVisibleRowMask);
     for(sal_Int32 i=0;i<nSize;i++)
     {
         if(!m_bVisibleRow[i])
@@ -2092,7 +2092,7 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const
 void OSelectionBrowseBox::SetNoneVisbleRow(long nRows)
 {
     // only the first 11 row are interesting
-    sal_Int32 nSize = SAL_N_ELEMENTS(nVisibleRowMask);
+    sal_Int32 const nSize = SAL_N_ELEMENTS(nVisibleRowMask);
     for(sal_Int32 i=0;i< nSize;i++)
         m_bVisibleRow[i] = !(nRows & nVisibleRowMask[i]);
 }
diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
index edc491324117..f6d30e1e3c32 100644
--- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
+++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx
@@ -157,7 +157,6 @@ namespace dbaui
     }
     bool OQueryContainerWindow::PreNotify( NotifyEvent& rNEvt )
     {
-        bool bHandled = false;
         if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS && m_pViewSwitch)
         {
             OJoinController& rController = m_pViewSwitch->getDesignView()->getController();
@@ -165,7 +164,7 @@ namespace dbaui
             rController.InvalidateFeature(SID_COPY);
             rController.InvalidateFeature(SID_PASTE);
         }
-        return bHandled || ODataView::PreNotify(rNEvt);
+        return ODataView::PreNotify(rNEvt);
     }
     void OQueryContainerWindow::showPreview(const Reference<XFrame>& _xFrame)
     {
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index a3264d3cb609..b300210f2d18 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -825,7 +825,7 @@ void OTableController::loadData()
             pTabEdRow->SetReadOnly(!bIsAlterAllowed);
             // search for type
             bool bForce;
-            OUString sCreate("x");
+            OUString const sCreate("x");
             TOTypeInfoSP pTypeInfo = ::dbaui::getTypeInfoFromType(m_aTypeInfo,nType,sTypeName,sCreate,nPrecision,nScale,bIsAutoIncrement,bForce);
             if ( !pTypeInfo.get() )
                 pTypeInfo = m_pTypeInfo;
diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
index 7478afbab513..604314e1a6f2 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
@@ -64,8 +64,8 @@ void OTableRowView::Init()
     // set up HandleColumn for at maximum 5 digits
     InsertHandleColumn(static_cast<sal_uInt16>(GetTextWidth(OUString('0')) * 4)/*, sal_True */);
 
-    BrowserMode nMode = BrowserMode::COLUMNSELECTION | BrowserMode::MULTISELECTION | BrowserMode::KEEPHIGHLIGHT |
-                        BrowserMode::HLINES | BrowserMode::VLINES | BrowserMode::AUTOSIZE_LASTCOL;
+    BrowserMode const nMode = BrowserMode::COLUMNSELECTION | BrowserMode::MULTISELECTION | BrowserMode::KEEPHIGHLIGHT |
+                              BrowserMode::HLINES | BrowserMode::VLINES | BrowserMode::AUTOSIZE_LASTCOL;
 
     SetMode(nMode);
 }
diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
index 19c48c2b457d..f6a7953214b2 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
@@ -213,7 +213,6 @@ void OTableDesignView::resizeDocumentView(tools::Rectangle& _rPlayground)
 
 bool OTableDesignView::PreNotify( NotifyEvent& rNEvt )
 {
-    bool bHandled = false;
     if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS)
     {
         if( GetDescWin() && GetDescWin()->HasChildPathFocus() )
@@ -224,7 +223,7 @@ bool OTableDesignView::PreNotify( NotifyEvent& rNEvt )
             m_eChildFocus = NONE;
     }
 
-    return bHandled || ODataView::PreNotify(rNEvt);
+    return ODataView::PreNotify(rNEvt);
 }
 
 IClipboardTest* OTableDesignView::getActiveChild() const
diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
index cce951ac698b..2b674638efd4 100644
--- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
+++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx
@@ -262,7 +262,6 @@ void OTableFieldDescWin::LoseFocus()
 
 bool OTableFieldDescWin::PreNotify( NotifyEvent& rNEvt )
 {
-    bool bHandled = false;
     if (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS)
     {
         if( getGenPage() && getGenPage()->HasChildPathFocus() )
@@ -270,7 +269,7 @@ bool OTableFieldDescWin::PreNotify( NotifyEvent& rNEvt )
         else
             m_eChildFocus = HELP;
     }
-    return bHandled || TabPage::PreNotify(rNEvt);
+    return TabPage::PreNotify(rNEvt);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/uno/ColumnPeer.cxx b/dbaccess/source/ui/uno/ColumnPeer.cxx
index 3700aa5d7637..1e7bae1ca536 100644
--- a/dbaccess/source/ui/uno/ColumnPeer.cxx
+++ b/dbaccess/source/ui/uno/ColumnPeer.cxx
@@ -86,7 +86,7 @@ void OColumnPeer::setColumn(const Reference< XPropertySet>& _xColumn)
 
             m_pActFieldDescr = new OFieldDescription(_xColumn,true);
             // search for type
-            OUString sCreateParam("x");
+            OUString const sCreateParam("x");
             bool bForce;
             TOTypeInfoSP pTypeInfo = ::dbaui::getTypeInfoFromType(*pFieldControl->getTypeInfo(),nType,sTypeName,sCreateParam,nPrecision,nScale,bAutoIncrement,bForce);
             if ( !pTypeInfo.get() )
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index b7b32544878d..0152bfa4aa05 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -688,8 +688,8 @@ void DesktopLOKTest::testHiddenRowHeaders()
 
     pDocument->pClass->initializeForRendering(pDocument, nullptr);
 
-    long nX = 0;
-    long nY = 0;
+    long const nX = 0;
+    long const nY = 0;
     long nWidth = 0;
     long nHeight = 0;
     pDocument->m_pDocumentClass->getDocumentSize(pDocument, &nWidth, &nHeight);
@@ -881,8 +881,8 @@ void DesktopLOKTest::testSheetSelections()
     // Values in twips
     int row5 = 1150;
     int col1 = 1100;
-    int col2 = 2200;
-    int col3 = 3300;
+    int const col2 = 2200;
+    int const col3 = 3300;
     int col4 = 4400;
     int col5 = 5500;
 
@@ -932,7 +932,7 @@ void DesktopLOKTest::testSheetSelections()
     /*
      * Check if clicking inside the selection deselects the whole selection
      */
-    int row10 = 2400;
+    int const row10 = 2400;
     // Select starting from row5, col1 to row10, col5
     pDocument->pClass->postMouseEvent(pDocument,
                                       LOK_MOUSEEVENT_MOUSEBUTTONDOWN,
@@ -1845,8 +1845,7 @@ void DesktopLOKTest::testGetFontSubset()
         rtl_UriEncodeKeepEscapes,
         RTL_TEXTENCODING_UTF8
     );
-    OUString aUnoFontSubset(".uno:FontSubset&name=");
-    OString aCommand = OUStringToOString(aUnoFontSubset + aFontName, RTL_TEXTENCODING_UTF8);
+    OString aCommand = OUStringToOString(".uno:FontSubset&name=" + aFontName, RTL_TEXTENCODING_UTF8);
     boost::property_tree::ptree aTree;
     char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, aCommand.getStr());
     std::stringstream aStream(pJSON);
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 0e7f37fe0c48..bbf8ccdd0e86 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1537,9 +1537,8 @@ int Desktop::Main()
 
 #ifdef DBG_UTIL
         //include buildid in non product builds
-        OUString aDefault("development");
         aTitle += " [";
-        aTitle += utl::Bootstrap::getBuildIdData(aDefault);
+        aTitle += utl::Bootstrap::getBuildIdData("development");
         aTitle += "]";
 #endif
 
@@ -1672,7 +1671,6 @@ int Desktop::Main()
     if ( !pExecGlobals->bRestartRequested )
     {
         Application::SetFilterHdl( LINK( this, Desktop, ImplInitFilterHdl ) );
-        bool bTerminateRequested = false;
 
         // Preload function depends on an initialized sfx application!
         SetSplashScreenProgress(75);
@@ -1682,7 +1680,7 @@ int Desktop::Main()
 
         SetSplashScreenProgress(80);
 
-        if ( !bTerminateRequested && !rCmdLineArgs.IsInvisible() &&
+        if ( !rCmdLineArgs.IsInvisible() &&
              !rCmdLineArgs.IsNoQuickstart() )
             InitializeQuickstartMode( xContext );
 
@@ -2072,8 +2070,7 @@ IMPL_LINK_NOARG(Desktop, OpenClients_Impl, void*, void)
         if (pExitPostStartup && *pExitPostStartup)
             new ExitTimer();
     } catch (const css::uno::Exception &e) {
-        OUString a( "UNO exception during client open:\n"  );
-        Application::Abort( a + e.Message );
+        Application::Abort( "UNO exception during client open: " + e.Message );
     }
 }
 
@@ -2598,9 +2595,8 @@ void Desktop::OpenSplashScreen()
         if ( rCmdLine.HasSplashPipe() )
             aSplashService = "com.sun.star.office.PipeSplashScreen";
 
-        bool bVisible = true;
         Sequence< Any > aSeq( 2 );
-        aSeq[0] <<= bVisible;
+        aSeq[0] <<= true; // bVisible
         aSeq[1] <<= aAppName;
         css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
         m_rSplashScreen.set(
diff --git a/desktop/source/app/check_ext_deps.cxx b/desktop/source/app/check_ext_deps.cxx
index 9c7a300f01eb..6440786317e1 100644
--- a/desktop/source/app/check_ext_deps.cxx
+++ b/desktop/source/app/check_ext_deps.cxx
@@ -258,9 +258,10 @@ static bool impl_checkDependencies( const uno::Reference< uno::XComponentContext
         throw uno::RuntimeException( e.Message, e.Context );
     }
 
-    sal_Int32 nMax = 2;
 #ifdef DEBUG
-    nMax = 3;
+    sal_Int32 const nMax = 3;
+#else
+    sal_Int32 const nMax = 2;
 #endif
 
     for ( sal_Int32 i = 0; i < xAllPackages.getLength(); ++i )
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 242e73a625fc..7d7f8fac8401 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -288,7 +288,6 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
     Reference< XDesktop2 > xDesktop = css::frame::Desktop::create( ::comphelper::getProcessComponentContext() );
 
     std::vector< DispatchHolder >   aDispatches;
-    OUString                 aAsTemplateArg( "AsTemplate" );
     bool                     bSetInputFilter = false;
     OUString                 aForcedInputFilter;
 
@@ -343,13 +342,11 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
             aArgs[1].Name = "InteractionHandler";
             aArgs[1].Value <<= xInteraction;
 
-            sal_Int16 nMacroExecMode = css::document::MacroExecMode::USE_CONFIG;
             aArgs[2].Name = "MacroExecutionMode";
-            aArgs[2].Value <<= nMacroExecMode;
+            aArgs[2].Value <<= css::document::MacroExecMode::USE_CONFIG;
 
-            sal_Int16 nUpdateDoc = css::document::UpdateDocMode::ACCORDING_TO_CONFIG;
             aArgs[3].Name = "UpdateDocMode";
-            aArgs[3].Value <<= nUpdateDoc;
+            aArgs[3].Value <<= css::document::UpdateDocMode::ACCORDING_TO_CONFIG;
         }
 
         if ( !aDispatchRequest.aPreselectedFactory.isEmpty() )
@@ -475,7 +472,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
             {
                 sal_Int32 nIndex = aArgs.getLength();
                 aArgs.realloc( nIndex+1 );
-                aArgs[nIndex].Name = aAsTemplateArg;
+                aArgs[nIndex].Name = "AsTemplate";
                 if ( aDispatchRequest.aRequestType == REQUEST_FORCENEW )
                     aArgs[nIndex].Value <<= true;
                 else
diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx
index 78f5b42d0824..d52aa38d89b8 100644
--- a/desktop/source/deployment/dp_persmap.cxx
+++ b/desktop/source/deployment/dp_persmap.cxx
@@ -139,7 +139,7 @@ static OString decodeString( const sal_Char* pEncChars, int nLen)
 void PersistentMap::open()
 {
     // open the existing file
-    sal_uInt32 nOpenFlags = osl_File_OpenFlag_Read | osl_File_OpenFlag_Write;
+    sal_uInt32 const nOpenFlags = osl_File_OpenFlag_Read | osl_File_OpenFlag_Write;
 
     const osl::File::RC rcOpen = m_MapFile.open( nOpenFlags);
     m_bIsOpen = (rcOpen == osl::File::E_None);
diff --git a/desktop/source/deployment/manager/dp_commandenvironments.cxx b/desktop/source/deployment/manager/dp_commandenvironments.cxx
index cd93931e6de0..732c479d9036 100644
--- a/desktop/source/deployment/manager/dp_commandenvironments.cxx
+++ b/desktop/source/deployment/manager/dp_commandenvironments.cxx
@@ -150,7 +150,6 @@ void TmpRepositoryCommandEnv::handle(
     deployment::InstallException instExc;
 
     bool approve = false;
-    bool abort = false;
 
     if ((request >>= verExc)
         || (request >>= licExc)
@@ -159,7 +158,7 @@ void TmpRepositoryCommandEnv::handle(
         approve = true;
     }
 
-    handle_(approve, abort, xRequest);
+    handle_(approve, false/*abort*/, xRequest);
 }
 
 
@@ -181,7 +180,6 @@ void LicenseCommandEnv::handle(
     deployment::LicenseException licExc;
 
     bool approve = false;
-    bool abort = false;
 
     if (request >>= licExc)
     {
@@ -197,7 +195,7 @@ void LicenseCommandEnv::handle(
         }
     }
 
-    handle_(approve, abort, xRequest);
+    handle_(approve, false/*abort*/, xRequest);
 }
 
 
@@ -216,13 +214,12 @@ void NoLicenseCommandEnv::handle(
     deployment::LicenseException licExc;
 
     bool approve = false;
-    bool abort = false;
 
     if (request >>= licExc)
     {
         approve = true;
     }
-    handle_(approve, abort, xRequest);
+    handle_(approve, false/*abort*/, xRequest);
 }
 
 SilentCheckPrerequisitesCommandEnv::SilentCheckPrerequisitesCommandEnv()
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index 0a1b81dc4ed6..6ccdd07b07c3 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -473,9 +473,7 @@ void BackendImpl::implProcessHelp(
                             else
                                 aLang = "en";
 
-                            OUString aMod("help");
-
-                            HelpIndexer aIndexer(aLang, aMod, langFolderDestExpanded, langFolderDestExpanded);
+                            HelpIndexer aIndexer(aLang, "help", langFolderDestExpanded, langFolderDestExpanded);
                             aIndexer.indexDocuments();
                         }
 
@@ -496,7 +494,7 @@ void BackendImpl::implProcessHelp(
 
                                 // Remove CR/LF
                                 OUString aErrMsg( aErrorInfo.m_aErrorMsg );
-                                sal_Unicode nCR = 13, nLF = 10;
+                                sal_Unicode const nCR = 13, nLF = 10;
                                 sal_Int32 nSearchCR = aErrMsg.indexOf( nCR );
                                 sal_Int32 nSearchLF = aErrMsg.indexOf( nLF );
                                 sal_Int32 nCopy;
diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index d0291d73290b..56fcbd58d481 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -164,7 +164,7 @@ OUString mapModuleShortNameToIdentifier(const OUString& sShortName)
 
 bool MigrationImpl::alreadyMigrated()
 {
-    OUString MIGRATION_STAMP_NAME("/MIGRATED4");
+    OUString const MIGRATION_STAMP_NAME("/MIGRATED4");
     OUString aStr = m_aInfo.userdata + MIGRATION_STAMP_NAME;
     File aFile(aStr);
     // create migration stamp, and/or check its existence
@@ -391,8 +391,7 @@ migrations_vr MigrationImpl::readMigrationSteps(const OUString& rMigrationName)
 
     // get migration description from org.openoffice.Setup/Migration
     // and build vector of migration steps
-    OUString aMigrationSteps( "MigrationSteps" );
-    uno::Reference< XNameAccess > theNameAccess(xMigrationData->getByName(aMigrationSteps), uno::UNO_QUERY_THROW);
+    uno::Reference< XNameAccess > theNameAccess(xMigrationData->getByName("MigrationSteps"), uno::UNO_QUERY_THROW);
     uno::Sequence< OUString > seqMigrations = theNameAccess->getElementNames();
     uno::Reference< XNameAccess > tmpAccess;
     uno::Sequence< OUString > tmpSeq;
diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c
index 74c071157f00..aa01d44b6c61 100644
--- a/desktop/unx/source/splashx.c
+++ b/desktop/unx/source/splashx.c
@@ -216,7 +216,6 @@ static void create_pixmap(struct splash* splash)
 {
     Pixmap pixmap;
     GC pixmap_gc;
-    unsigned long value_mask = 0;
     XGCValues values;
 
     if ( !splash->bitmap_rows )
@@ -225,7 +224,7 @@ static void create_pixmap(struct splash* splash)
     }
     pixmap = XCreatePixmap( splash->display, splash->win, splash->width, splash->height, splash->depth );
 
-    pixmap_gc = XCreateGC( splash->display, pixmap, value_mask, &values );
+    pixmap_gc = XCreateGC( splash->display, pixmap, 0/*value_mask*/, &values );
 
     if ( splash->visual->class == TrueColor )
     {
@@ -469,7 +468,6 @@ static int splash_init_display( struct splash* splash, int argc, char** argv )
 static int splash_create_window(struct splash* splash)
 {
     Window root_win;
-    unsigned long value_mask = 0;
     XGCValues values;
     const char* name = "LibreOffice";
     const char* icon = "icon"; // FIXME
@@ -495,7 +493,7 @@ static int splash_create_window(struct splash* splash)
     XAllocColor( splash->display, splash->color_map, &(splash->framecolor) );
 
     // not resizable, no decorations, etc.
-    splash->gc = XCreateGC( splash->display, splash->win, value_mask, &values );
+    splash->gc = XCreateGC( splash->display, splash->win, 0/*value_mask*/, &values );
 
     size_hints.flags = PPosition | PSize | PMinSize | PMaxSize;
     size_hints.x = splash->display_x_pos;
diff --git a/drawinglayer/qa/unit/border.cxx b/drawinglayer/qa/unit/border.cxx
index 9df6f23d57df..25264c46ee51 100644
--- a/drawinglayer/qa/unit/border.cxx
+++ b/drawinglayer/qa/unit/border.cxx
@@ -49,17 +49,17 @@ void DrawinglayerBorderTest::testDoubleDecompositionSolid()
     basegfx::B2DPoint aStart(0, 20);
     basegfx::B2DPoint aEnd(100, 20);
     double fLeftWidth = 1.47;
-    double fDistance = 1.47;
-    double fRightWidth = 1.47;
-    double fExtendLeftStart = 0;
-    double fExtendLeftEnd = 0;
-    double fExtendRightStart = 0;
-    double fExtendRightEnd = 0;
+    double const fDistance = 1.47;
+    double const fRightWidth = 1.47;
+    double const fExtendLeftStart = 0;
+    double const fExtendLeftEnd = 0;
+    double const fExtendRightStart = 0;
+    double const fExtendRightEnd = 0;
     basegfx::BColor aColorRight;
     basegfx::BColor aColorLeft;
     basegfx::BColor aColorGap;
-    bool bHasGapColor = false;
-    SvxBorderLineStyle nStyle = SvxBorderLineStyle::DOUBLE;
+    bool const bHasGapColor = false;
+    SvxBorderLineStyle const nStyle = SvxBorderLineStyle::DOUBLE;
     rtl::Reference<drawinglayer::primitive2d::BorderLinePrimitive2D> aBorder(new drawinglayer::primitive2d::BorderLinePrimitive2D(aStart, aEnd, fLeftWidth, fDistance, fRightWidth, fExtendLeftStart, fExtendLeftEnd, fExtendRightStart, fExtendRightEnd, aColorRight, aColorLeft, aColorGap, bHasGapColor, nStyle));
 
     // Decompose it into polygons.
@@ -98,18 +98,18 @@ void DrawinglayerBorderTest::testDoublePixelProcessing()
     // 1.47 pixels is 0.03cm at 130% zoom and 96 DPI.
     basegfx::B2DPoint aStart(0, 20);
     basegfx::B2DPoint aEnd(100, 20);
-    double fLeftWidth = 1.47;
-    double fDistance = 1.47;
+    double const fLeftWidth = 1.47;
+    double const fDistance = 1.47;
     double fRightWidth = 1.47;
-    double fExtendLeftStart = 0;
-    double fExtendLeftEnd = 0;
-    double fExtendRightStart = 0;
-    double fExtendRightEnd = 0;
+    double const fExtendLeftStart = 0;
+    double const fExtendLeftEnd = 0;
+    double const fExtendRightStart = 0;
+    double const fExtendRightEnd = 0;
     basegfx::BColor aColorRight;
     basegfx::BColor aColorLeft;
     basegfx::BColor aColorGap;
-    bool bHasGapColor = false;
-    SvxBorderLineStyle nStyle = SvxBorderLineStyle::DOUBLE;
+    bool const bHasGapColor = false;
+    SvxBorderLineStyle const nStyle = SvxBorderLineStyle::DOUBLE;
     rtl::Reference<drawinglayer::primitive2d::BorderLinePrimitive2D> xBorder(new drawinglayer::primitive2d::BorderLinePrimitive2D(aStart, aEnd, fLeftWidth, fDistance, fRightWidth, fExtendLeftStart, fExtendLeftEnd, fExtendRightStart, fExtendRightEnd, aColorRight, aColorLeft, aColorGap, bHasGapColor, nStyle));
     drawinglayer::primitive2d::Primitive2DContainer aPrimitives;
     aPrimitives.push_back(drawinglayer::primitive2d::Primitive2DReference(xBorder.get()));
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 99d9e700e390..38c196f53b8f 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -118,9 +118,8 @@ namespace
     }
 
     // #112245# helper to evtl. split filled polygons to maximum metafile point count
-    bool fillPolyPolygonNeededToBeSplit(basegfx::B2DPolyPolygon& rPolyPolygon)
+    void fillPolyPolygonNeededToBeSplit(basegfx::B2DPolyPolygon& rPolyPolygon)
     {
-        bool bRetval(false);
         const sal_uInt32 nPolyCount(rPolyPolygon.count());
 
         if(nPolyCount)
@@ -204,8 +203,6 @@ namespace
                 rPolyPolygon = aSplitted;
             }
         }
-
-        return bRetval;
     }
 
     /** Filter input polypolygon for effectively empty sub-fills
@@ -1365,81 +1362,70 @@ namespace drawinglayer
                     const primitive2d::PolyPolygonGraphicPrimitive2D& rBitmapCandidate = static_cast< const primitive2d::PolyPolygonGraphicPrimitive2D& >(rCandidate);
                     basegfx::B2DPolyPolygon aLocalPolyPolygon(rBitmapCandidate.getB2DPolyPolygon());
 
-                    if(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
-                    {
-                        // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
-                        // per polygon. If there are more use the splitted polygon and call recursively
-                        rtl::Reference< primitive2d::PolyPolygonGraphicPrimitive2D > xSplitted(new primitive2d::PolyPolygonGraphicPrimitive2D(
-                            aLocalPolyPolygon,
-                            rBitmapCandidate.getFillGraphic()));
+                    fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon);
 
-                        processBasePrimitive2D(*xSplitted.get());
-                    }
-                    else
+                    SvtGraphicFill* pSvtGraphicFill = nullptr;
+
+                    if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())
                     {
-                        SvtGraphicFill* pSvtGraphicFill = nullptr;
+                        // #121194# Changed implementation and checked usages fo convert to metafile,
+                        // presentation start (uses SvtGraphicFill) and printing.
 
-                        if(!mnSvtGraphicFillCount && aLocalPolyPolygon.count())
-                        {
-                            // #121194# Changed implementation and checked usages fo convert to metafile,
-                            // presentation start (uses SvtGraphicFill) and printing.
-
-                            // calculate transformation. Get real object size, all values in FillGraphicAttribute
-                            // are relative to the unified object
-                            aLocalPolyPolygon.transform(maCurrentTransformation);
-                            const basegfx::B2DVector aOutlineSize(aLocalPolyPolygon.getB2DRange().getRange());
-
-                            // the scaling needs scale from pixel to logic coordinate system
-                            const attribute::FillGraphicAttribute& rFillGraphicAttribute = rBitmapCandidate.getFillGraphic();
-                            const Size aBmpSizePixel(rFillGraphicAttribute.getGraphic().GetSizePixel());
-
-                            // setup transformation like in impgrfll. Multiply with aOutlineSize
-                            // to get from unit coordinates in rFillGraphicAttribute.getGraphicRange()
-                            // to object coordinates with object's top left being at (0,0). Divide
-                            // by pixel size so that scale from pixel to logic will work in SvtGraphicFill.
-                            const basegfx::B2DVector aTransformScale(
-                                rFillGraphicAttribute.getGraphicRange().getRange() /
-                                basegfx::B2DVector(
-                                    std::max(1.0, double(aBmpSizePixel.Width())),
-                                    std::max(1.0, double(aBmpSizePixel.Height()))) *
-                                aOutlineSize);
-                            const basegfx::B2DPoint aTransformPosition(
-                                rFillGraphicAttribute.getGraphicRange().getMinimum() * aOutlineSize);
-
-                            // setup transformation like in impgrfll
-                            SvtGraphicFill::Transform aTransform;
-
-                            // scale values are divided by bitmap pixel sizes
-                            aTransform.matrix[0] = aTransformScale.getX();
-                            aTransform.matrix[4] = aTransformScale.getY();
-
-                            // translates are absolute
-                            aTransform.matrix[2] = aTransformPosition.getX();
-                            aTransform.matrix[5] = aTransformPosition.getY();
-
-                            pSvtGraphicFill = new SvtGraphicFill(
-                                getFillPolyPolygon(aLocalPolyPolygon),
-                                Color(),
-                                0.0,
-                                SvtGraphicFill::fillEvenOdd,
-                                SvtGraphicFill::fillTexture,
-                                aTransform,
-                                rFillGraphicAttribute.getTiling(),
-                                SvtGraphicFill::hatchSingle,
-                                Color(),
-                                SvtGraphicFill::GradientType::Linear,
-                                Color(),
-                                Color(),
-                                0,
-                                rFillGraphicAttribute.getGraphic());
-                        }
+                        // calculate transformation. Get real object size, all values in FillGraphicAttribute
+                        // are relative to the unified object
+                        aLocalPolyPolygon.transform(maCurrentTransformation);
+                        const basegfx::B2DVector aOutlineSize(aLocalPolyPolygon.getB2DRange().getRange());
+
+                        // the scaling needs scale from pixel to logic coordinate system
+                        const attribute::FillGraphicAttribute& rFillGraphicAttribute = rBitmapCandidate.getFillGraphic();
+                        const Size aBmpSizePixel(rFillGraphicAttribute.getGraphic().GetSizePixel());
+
+                        // setup transformation like in impgrfll. Multiply with aOutlineSize
+                        // to get from unit coordinates in rFillGraphicAttribute.getGraphicRange()
+                        // to object coordinates with object's top left being at (0,0). Divide
+                        // by pixel size so that scale from pixel to logic will work in SvtGraphicFill.
+                        const basegfx::B2DVector aTransformScale(
+                            rFillGraphicAttribute.getGraphicRange().getRange() /
+                            basegfx::B2DVector(
+                                std::max(1.0, double(aBmpSizePixel.Width())),
+                                std::max(1.0, double(aBmpSizePixel.Height()))) *
+                            aOutlineSize);
+                        const basegfx::B2DPoint aTransformPosition(
+                            rFillGraphicAttribute.getGraphicRange().getMinimum() * aOutlineSize);
+
+                        // setup transformation like in impgrfll
+                        SvtGraphicFill::Transform aTransform;
 
-                        // Do use decomposition; encapsulate with SvtGraphicFill
-                        impStartSvtGraphicFill(pSvtGraphicFill);
-                        process(rCandidate);
-                        impEndSvtGraphicFill(pSvtGraphicFill);
+                        // scale values are divided by bitmap pixel sizes
+                        aTransform.matrix[0] = aTransformScale.getX();
+                        aTransform.matrix[4] = aTransformScale.getY();
+
+                        // translates are absolute
+                        aTransform.matrix[2] = aTransformPosition.getX();
+                        aTransform.matrix[5] = aTransformPosition.getY();
+
+                        pSvtGraphicFill = new SvtGraphicFill(
+                            getFillPolyPolygon(aLocalPolyPolygon),
+                            Color(),
+                            0.0,
+                            SvtGraphicFill::fillEvenOdd,
+                            SvtGraphicFill::fillTexture,
+                            aTransform,
+                            rFillGraphicAttribute.getTiling(),
+                            SvtGraphicFill::hatchSingle,
+                            Color(),
+                            SvtGraphicFill::GradientType::Linear,
+                            Color(),
+                            Color(),
+                            0,
+                            rFillGraphicAttribute.getGraphic());
                     }
 
+                    // Do use decomposition; encapsulate with SvtGraphicFill
+                    impStartSvtGraphicFill(pSvtGraphicFill);
+                    process(rCandidate);
+                    impEndSvtGraphicFill(pSvtGraphicFill);
+
                     break;
                 }
                 case PRIMITIVE2D_ID_POLYPOLYGONHATCHPRIMITIVE2D :
@@ -1460,8 +1446,7 @@ namespace drawinglayer
 
                     // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
                     // per polygon. Split polygon until there are less than that
-                    while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
-                        ;
+                    fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon);
 
                     if(rFillHatchAttribute.isFillBackground())
                     {
@@ -1597,8 +1582,7 @@ namespace drawinglayer
 
                         // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
                         // per polygon. Split polygon until there are less than that
-                        while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
-                            ;
+                        fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon);
 
                         // for support of MetaCommentActions of the form XGRAD_SEQ_BEGIN, XGRAD_SEQ_END
                         // it is safest to use the VCL OutputDevice::DrawGradient method which creates those.
@@ -1672,8 +1656,7 @@ namespace drawinglayer
 
                     // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
                     // per polygon. Split polygon until there are less than that
-                    while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
-                        ;
+                    fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon);
 
                     const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rPolygonCandidate.getBColor()));
                     aLocalPolyPolygon.transform(maCurrentTransformation);
@@ -1850,8 +1833,7 @@ namespace drawinglayer
 
                                 // #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
                                 // per polygon. Split polygon until there are less than that
-                                while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
-                                    ;
+                                fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon);
 
                                 // now transform
                                 aLocalPolyPolygon.transform(maCurrentTransformation);
commit cb37c5f0f3de7b545231a53d46a5271058af76ad
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Jun 22 11:38:31 2017 +0200

    loplugin:unusedfields in jvmfwk..mysqlc
    
    Change-Id: If9c7a3239fceba9a2db3a5905ccaa7fa9adadb08
    Reviewed-on: https://gerrit.libreoffice.org/39099
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 5e3c8f58494a..ceffbfea6930 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -316,8 +316,6 @@ class AsynchReader: public salhelper::Thread
     size_t  m_nDataSize;
     std::unique_ptr<sal_Char[]> m_arData;
 
-    bool m_bError;
-    bool m_bDone;
     FileHandleGuard m_aGuard;
 
     virtual ~AsynchReader() override {}
@@ -336,8 +334,8 @@ public:
 };
 
 AsynchReader::AsynchReader(oslFileHandle & rHandle):
-    Thread("jvmfwkAsyncReader"), m_nDataSize(0), m_bError(false),
-    m_bDone(false), m_aGuard(rHandle)
+    Thread("jvmfwkAsyncReader"), m_nDataSize(0),
+    m_aGuard(rHandle)
 {
 }
 
@@ -363,13 +361,11 @@ void AsynchReader::execute()
         case osl_File_E_None:
             break;
         default:
-            m_bError = true;
             return;
         }
 
         if (nRead == 0)
         {
-            m_bDone = true;
             break;
         }
         else if (nRead <= BUFFER_SIZE)
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index beab0c937360..6d47bfcaf199 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -43,7 +43,6 @@ typedef std::vector< OString* > LngLineList;
 class LngParser
 {
 private:
-    sal_uInt16 nError;
     LngLineList *pLines;
     OString sSource;
     std::vector<OString> aLanguages;
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 513c36e13e56..540110f99822 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -49,8 +49,7 @@ void lcl_RemoveUTF8ByteOrderMarker( OString &rString )
 // class LngParser
 
 LngParser::LngParser(const OString &rLngFile)
-    : nError( LNG_OK )
-    , pLines( nullptr )
+    : pLines( nullptr )
     , sSource( rLngFile )
 {
     pLines = new LngLineList;
@@ -76,8 +75,6 @@ LngParser::LngParser(const OString &rLngFile)
         }
         pLines->push_back( new OString() );
     }
-    else
-        nError = LNG_COULD_NOT_OPEN;
 }
 
 LngParser::~LngParser()
@@ -166,10 +163,6 @@ bool LngParser::Merge(
 {
     std::ofstream aDestination(
         rDestinationFile.getStr(), std::ios_base::out | std::ios_base::trunc);
-    if (!aDestination.is_open()) {
-        nError = LNG_COULD_NOT_OPEN;
-    }
-    nError = LNG_OK;
 
     MergeDataFile aMergeDataFile( rPOFile, sSource, false, true );
     if( rLanguage.equalsIgnoreAsciiCase("ALL") )
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index ca15aca4bfc7..c484fea98bc6 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -3282,7 +3282,6 @@ lok_doc_view_open_document (LOKDocView* pDocView,
     GError* error = nullptr;
 
     LOEvent* pLOEvent = new LOEvent(LOK_LOAD_DOC);
-    pLOEvent->m_pPath = pPath;
 
     priv->m_aDocPath = pPath;
     if (pRenderingArguments)
diff --git a/libreofficekit/source/gtk/tilebuffer.hxx b/libreofficekit/source/gtk/tilebuffer.hxx
index 0d98cc26f899..88961cc1f44d 100644
--- a/libreofficekit/source/gtk/tilebuffer.hxx
+++ b/libreofficekit/source/gtk/tilebuffer.hxx
@@ -180,11 +180,6 @@ struct LOEvent
     gboolean m_bNotifyWhenFinished;
     ///@}
 
-    /// @name open_document parameter
-    ///@{
-    const gchar* m_pPath;
-    ///@}
-
     /// set_edit parameter
     gboolean m_bEdit;
 
@@ -240,7 +235,6 @@ struct LOEvent
         , m_pCommand(nullptr)
         , m_pArguments(nullptr)
         , m_bNotifyWhenFinished(false)
-        , m_pPath(nullptr)
         , m_bEdit(false)
         , m_nPartMode(0)
         , m_nPart(0)
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index 0e952a516843..ca0304fa4480 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -179,12 +179,11 @@ ConvDic::ConvDic(
 
     bNeedEntries = true;
     bIsModified  = bIsActive = false;
-    bIsReadonly = false;
 
     if( !rMainURL.isEmpty() )
     {
         bool bExists = false;
-        bIsReadonly = IsReadOnly( rMainURL, &bExists );
+        IsReadOnly( rMainURL, &bExists );
 
         if( !bExists )  // new empty dictionary
         {
@@ -193,7 +192,6 @@ ConvDic::ConvDic(
             //! that could be found by the dictionary-list implementation
             // (Note: empty dictionaries are not just empty files!)
             Save();
-            bIsReadonly = IsReadOnly( rMainURL );   // will be sal_False if Save was successful
         }
     }
     else
diff --git a/linguistic/source/convdic.hxx b/linguistic/source/convdic.hxx
index 53167b7123a7..6c41586df6da 100644
--- a/linguistic/source/convdic.hxx
+++ b/linguistic/source/convdic.hxx
@@ -77,7 +77,6 @@ protected:
     bool            bNeedEntries;
     bool            bIsModified;
     bool            bIsActive;
-    bool            bIsReadonly;
 
     // disallow copy-constructor and assignment-operator for now
     ConvDic(const ConvDic &);
diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx
index e5ac95339348..7829d2c891f4 100644
--- a/linguistic/source/convdicxml.cxx
+++ b/linguistic/source/convdicxml.cxx
@@ -125,14 +125,12 @@ class ConvDicXMLEntryTextContext_Impl :
     public ConvDicXMLImportContext
 {
     OUString    aLeftText;
-    sal_Int16   nPropertyType;  // used for Chinese simplified/traditional conversion
 
 public:
     ConvDicXMLEntryTextContext_Impl(
             ConvDicXMLImport &rImport,
             sal_uInt16 nPrefix, const OUString& rLName ) :
-        ConvDicXMLImportContext( rImport, nPrefix, rLName ),
-        nPropertyType( ConversionPropertyType::NOT_DEFINED )
+        ConvDicXMLImportContext( rImport, nPrefix, rLName )
     {
     }
 
@@ -256,8 +254,6 @@ void ConvDicXMLEntryTextContext_Impl::StartElement(
 
         if ( nPrefix == XML_NAMESPACE_TCD && aLocalName == "left-text" )
             aLeftText = aValue;
-        if ( nPrefix == XML_NAMESPACE_TCD && aLocalName == "property-type" )
-            nPropertyType = (sal_Int16) aValue.toInt32();
     }
 }
 
diff --git a/mysqlc/source/mysqlc_connection.cxx b/mysqlc/source/mysqlc_connection.cxx
index 8725f67bb08d..42dbe1a65af3 100644
--- a/mysqlc/source/mysqlc_connection.cxx
+++ b/mysqlc/source/mysqlc_connection.cxx
@@ -67,7 +67,6 @@ OConnection::OConnection(MysqlCDriver& _rDriver, sql::Driver * _cppDriver)
     ,m_xMetaData(nullptr)
     ,m_rDriver(_rDriver)
     ,cppDriver(_cppDriver)
-    ,m_bClosed(false)
 {
     m_rDriver.acquire();
 }
@@ -507,7 +506,6 @@ void OConnection::disposing()
     }
     m_aStatements.clear();
 
-    m_bClosed   = true;
     m_xMetaData = WeakReference< XDatabaseMetaData >();
 
     dispose_ChildImpl();
diff --git a/mysqlc/source/mysqlc_connection.hxx b/mysqlc/source/mysqlc_connection.hxx
index 0afae7d4ae64..82887251d340 100644
--- a/mysqlc/source/mysqlc_connection.hxx
+++ b/mysqlc/source/mysqlc_connection.hxx
@@ -108,8 +108,6 @@ namespace connectivity
             MysqlCDriver&   m_rDriver;      // Pointer to the owning driver object
             sql::Driver*    cppDriver;
 
-            bool    m_bClosed;
-
         public:
             /// @throws SQLException
             /// @throws RuntimeException
diff --git a/mysqlc/source/mysqlc_databasemetadata.cxx b/mysqlc/source/mysqlc_databasemetadata.cxx
index b64c87c99f72..17b845b2b03b 100644
--- a/mysqlc/source/mysqlc_databasemetadata.cxx
+++ b/mysqlc/source/mysqlc_databasemetadata.cxx
@@ -78,13 +78,9 @@ void lcl_setRows_throw(const Reference< XResultSet >& _xResultSet,sal_Int32 _nTy
 
 ODatabaseMetaData::ODatabaseMetaData(OConnection& _rCon)
     :m_rConnection(_rCon)
-    ,m_bUseCatalog(true)
     ,meta(_rCon.getConnectionSettings().cppConnection->getMetaData())
     ,identifier_quote_string_set(false)
 {
-    osl_atomic_increment(&m_refCount);
-    m_bUseCatalog = !(usesLocalFiles() || usesLocalFilePerTable());
-    osl_atomic_decrement(&m_refCount);
 }
 
 ODatabaseMetaData::~ODatabaseMetaData()
diff --git a/mysqlc/source/mysqlc_databasemetadata.hxx b/mysqlc/source/mysqlc_databasemetadata.hxx
index b8011763c5a4..172c5ee364bd 100644
--- a/mysqlc/source/mysqlc_databasemetadata.hxx
+++ b/mysqlc/source/mysqlc_databasemetadata.hxx
@@ -42,7 +42,6 @@ namespace connectivity
         class ODatabaseMetaData : public ODatabaseMetaData_BASE
         {
             OConnection&    m_rConnection;
-            bool            m_bUseCatalog;
         protected:
             sql::DatabaseMetaData * meta;
             rtl::OUString           identifier_quote_string;


More information about the Libreoffice-commits mailing list