UnoControls/source/base/basecontrol.cxx | 12 + chart2/source/model/template/StockDataInterpreter.cxx | 21 +- comphelper/source/misc/string.cxx | 2 compilerplugins/clang/commaoperator.cxx | 75 ++++++++++ connectivity/source/drivers/jdbc/JConnection.cxx | 3 cui/source/dialogs/colorpicker.cxx | 10 + cui/source/dialogs/cuigrfflt.cxx | 18 +- cui/source/dialogs/linkdlg.cxx | 5 cui/source/inc/page.hxx | 2 cui/source/tabpages/autocdlg.cxx | 2 cui/source/tabpages/numpages.cxx | 2 cui/source/tabpages/textattr.cxx | 2 cui/source/tabpages/tparea.cxx | 2 dbaccess/source/core/dataaccess/databasedocument.cxx | 3 dbaccess/source/core/recovery/subcomponentloader.cxx | 3 desktop/source/app/app.cxx | 6 desktop/unx/source/file_image_unx.c | 9 - editeng/source/editeng/eertfpar.cxx | 3 editeng/source/misc/svxacorr.cxx | 15 +- editeng/source/rtf/rtfitem.cxx | 10 - editeng/source/rtf/svxrtf.cxx | 4 extensions/source/resource/oooresourceloader.cxx | 3 forms/source/component/propertybaghelper.cxx | 6 formula/source/core/api/FormulaCompiler.cxx | 3 formula/source/ui/dlg/FormulaHelper.cxx | 5 i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 2 i18npool/source/localedata/LocaleNode.cxx | 10 + i18npool/source/search/textsearch.cxx | 12 + idl/source/objects/slot.cxx | 35 +++- include/editeng/escapementitem.hxx | 15 +- include/editeng/outliner.hxx | 6 include/registry/registry.hxx | 3 include/vcl/salbtype.hxx | 4 oox/source/export/vmlexport.cxx | 9 - registry/source/regkey.cxx | 9 - rsc/source/tools/rscchar.cxx | 6 sal/osl/unx/file.cxx | 57 +++++-- sal/osl/unx/file_misc.cxx | 3 sal/rtl/alloc_arena.cxx | 9 - sal/rtl/alloc_cache.cxx | 27 ++- sal/rtl/alloc_global.cxx | 3 sal/rtl/alloc_impl.hxx | 50 +++++- sal/rtl/cipher.cxx | 9 - sd/source/filter/eppt/epptso.cxx | 15 +- sd/source/filter/ppt/pptin.cxx | 3 sd/source/filter/ppt/pptinanimations.cxx | 2 sd/source/ui/app/sdmod.cxx | 6 sd/source/ui/app/sdxfer.cxx | 12 + sdext/source/minimizer/pppoptimizerdialog.cxx | 3 sdext/source/pdfimport/pdfparse/pdfentries.cxx | 5 sdext/source/pdfimport/tree/drawtreevisiting.cxx | 5 sdext/source/pdfimport/tree/writertreevisiting.cxx | 5 sfx2/source/appl/appquit.cxx | 3 sfx2/source/appl/module.cxx | 3 sfx2/source/bastyp/mieclip.cxx | 5 sfx2/source/dialog/filedlghelper.cxx | 2 sfx2/source/doc/sfxbasemodel.cxx | 3 soltools/mkdepend/main.c | 9 - sot/source/sdstor/stgavl.cxx | 5 sot/source/sdstor/stgcache.cxx | 8 - sot/source/sdstor/stgdir.cxx | 14 + sot/source/sdstor/stgelem.cxx | 40 ++++- sot/source/sdstor/stgio.cxx | 5 sot/source/sdstor/stgstrms.cxx | 23 ++- store/source/lockbyte.cxx | 11 + store/source/storbase.cxx | 11 + store/source/storbios.cxx | 12 + store/source/storcach.cxx | 40 ++++- store/source/storpage.cxx | 3 svl/source/items/itemset.cxx | 3 svtools/source/brwbox/brwbox2.cxx | 10 + svtools/source/contnr/imivctl2.cxx | 6 svtools/source/filter/exportdialog.cxx | 6 svtools/source/graphic/grfcache.cxx | 24 ++- svtools/source/graphic/grfmgr.cxx | 26 ++- svtools/source/graphic/grfmgr2.cxx | 30 ++-- svtools/source/misc/embedhlp.cxx | 12 + svtools/source/misc/transfer.cxx | 15 +- svtools/source/svhtml/parhtml.cxx | 29 ++- svx/source/accessibility/AccessibleShapeTreeInfo.cxx | 2 svx/source/gallery2/gallery1.cxx | 3 svx/source/gallery2/galmisc.cxx | 14 + svx/source/items/grfitem.cxx | 14 + svx/source/tbxctrls/grafctrl.cxx | 13 + svx/source/unodraw/unoshape.cxx | 3 svx/source/xml/xmlgrhlp.cxx | 6 toolkit/source/controls/geometrycontrolmodel.cxx | 4 tools/source/generic/poly.cxx | 15 +- tools/source/memtools/mempool.cxx | 3 tools/source/stream/stream.cxx | 5 ucb/source/ucp/file/bc.cxx | 17 +- ucb/source/ucp/ftp/ftpurl.cxx | 3 ucbhelper/source/provider/fd_inputstream.cxx | 5 unotools/source/config/configpaths.cxx | 3 unotools/source/misc/componentresmodule.cxx | 3 xmlhelp/source/cxxhelp/provider/databases.cxx | 4 xmloff/source/core/xmltoken.cxx | 3 97 files changed, 757 insertions(+), 272 deletions(-)
New commits: commit c45d3badc96481db093560b94d8bf51ead6bd17c Author: Noel Grandin <n...@peralex.com> Date: Wed Feb 17 13:14:50 2016 +0200 new loplugin: commaoperator Change-Id: I03f24e61f696b7619855e3c7010aa0d874e5a4ff diff --git a/UnoControls/source/base/basecontrol.cxx b/UnoControls/source/base/basecontrol.cxx index d4ce153..f689ed2 100644 --- a/UnoControls/source/base/basecontrol.cxx +++ b/UnoControls/source/base/basecontrol.cxx @@ -397,22 +397,26 @@ void SAL_CALL BaseControl::setPosSize( sal_Int32 nX , if ( nFlags & PosSize::X ) { - bChanged |= m_nX != nX, m_nX = nX; + bChanged |= m_nX != nX; + m_nX = nX; } if ( nFlags & PosSize::Y ) { - bChanged |= m_nY != nY, m_nY = nY; + bChanged |= m_nY != nY; + m_nY = nY; } if ( nFlags & PosSize::WIDTH ) { - bChanged |= m_nWidth != nWidth, m_nWidth = nWidth; + bChanged |= m_nWidth != nWidth; + m_nWidth = nWidth; } if ( nFlags & PosSize::HEIGHT ) { - bChanged |= m_nHeight != nHeight, m_nHeight = nHeight; + bChanged |= m_nHeight != nHeight; + m_nHeight = nHeight; } if ( bChanged && m_xPeerWindow.is() ) diff --git a/chart2/source/model/template/StockDataInterpreter.cxx b/chart2/source/model/template/StockDataInterpreter.cxx index 364800c..8f4e558 100644 --- a/chart2/source/model/template/StockDataInterpreter.cxx +++ b/chart2/source/model/template/StockDataInterpreter.cxx @@ -146,7 +146,8 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource( aSequences[nCandleStickGroupIndex][nLabeledSeqIdx][nSeqIdx].set( aData[nSourceIndex] ); if( aData[nSourceIndex].is()) SetRole( aData[nSourceIndex]->getValues(), "values-first"); - ++nSourceIndex, ++nSeqIdx; + ++nSourceIndex; + ++nSeqIdx; } else aSequences[nCandleStickGroupIndex][nLabeledSeqIdx].realloc( 3 ); @@ -154,17 +155,20 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource( aSequences[nCandleStickGroupIndex][nLabeledSeqIdx][nSeqIdx].set( aData[nSourceIndex] ); if( aData[nSourceIndex].is()) SetRole( aData[nSourceIndex]->getValues(), "values-min"); - ++nSourceIndex, ++nSeqIdx; + ++nSourceIndex; + ++nSeqIdx; aSequences[nCandleStickGroupIndex][nLabeledSeqIdx][nSeqIdx].set( aData[nSourceIndex] ); if( aData[nSourceIndex].is()) SetRole( aData[nSourceIndex]->getValues(), "values-max"); - ++nSourceIndex, ++nSeqIdx; + ++nSourceIndex; + ++nSeqIdx; aSequences[nCandleStickGroupIndex][nLabeledSeqIdx][nSeqIdx].set( aData[nSourceIndex] ); if( aData[nSourceIndex].is()) SetRole( aData[nSourceIndex]->getValues(), "values-last"); - ++nSourceIndex, ++nSeqIdx; + ++nSourceIndex; + ++nSeqIdx; } // 3. create series with remaining sequences @@ -194,7 +198,8 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource( aSequences[nCandleStickGroupIndex][nSeriesIndex][nSeqIdx].set( aData[nSourceIndex] ); if( aData[nSourceIndex].is()) SetRole( aData[nSourceIndex]->getValues(), "values-min"); - ++nSourceIndex, ++nSeqIdx; + ++nSourceIndex; + ++nSeqIdx; // 2. high if( nSeqIdx < nRemaining ) @@ -202,7 +207,8 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource( aSequences[nCandleStickGroupIndex][nSeriesIndex][nSeqIdx].set( aData[nSourceIndex] ); if( aData[nSourceIndex].is()) SetRole( aData[nSourceIndex]->getValues(), "values-max"); - ++nSourceIndex, ++nSeqIdx; + ++nSourceIndex; + ++nSeqIdx; } // 3. close @@ -212,7 +218,8 @@ InterpretedData SAL_CALL StockDataInterpreter::interpretDataSource( aSequences[nCandleStickGroupIndex][nSeriesIndex][nSeqIdx].set( aData[nSourceIndex] ); if( aData[nSourceIndex].is()) SetRole( aData[nSourceIndex]->getValues(), "values-last"); - ++nSourceIndex, ++nSeqIdx; + ++nSourceIndex; + ++nSeqIdx; } // 4. open diff --git a/comphelper/source/misc/string.cxx b/comphelper/source/misc/string.cxx index aee1cd0..2dbbc0c 100644 --- a/comphelper/source/misc/string.cxx +++ b/comphelper/source/misc/string.cxx @@ -432,7 +432,7 @@ OUString setToken(const OUString& rIn, sal_Int32 nToken, sal_Unicode cTok, break; } - ++pStr, + ++pStr; ++i; } diff --git a/compilerplugins/clang/commaoperator.cxx b/compilerplugins/clang/commaoperator.cxx new file mode 100644 index 0000000..4df9cea --- /dev/null +++ b/compilerplugins/clang/commaoperator.cxx @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <cassert> +#include <string> +#include <iostream> +#include <fstream> +#include <set> +#include "plugin.hxx" +#include "compat.hxx" + +/** +the comma operator is best used sparingly +*/ + +namespace { + +class CommaOperator: + public RecursiveASTVisitor<CommaOperator>, public loplugin::Plugin +{ +public: + explicit CommaOperator(InstantiationData const & data): Plugin(data) {} + + virtual void run() override + { + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + } + + bool VisitBinaryOperator(const BinaryOperator* ); +}; + +bool CommaOperator::VisitBinaryOperator(const BinaryOperator* binaryOp) +{ + if (ignoreLocation(binaryOp)) { + return true; + } + if (binaryOp->getOpcode() != BO_Comma) { + return true; + } + const Stmt* parent = parentStmt(binaryOp); + if (isa<ParenExpr>(parent)) { + return true; + } + if (isa<BinaryOperator>(parent)) { + return true; + } + if (isa<ForStmt>(parent)) { + return true; + } + if (isa<ExprWithCleanups>(parent)) { + const Stmt* parent2 = parentStmt(parent); + if (isa<ForStmt>(parent2)) { + return true; + } + } +// parent->dump(); + report( + DiagnosticsEngine::Warning, "comma operator hides code", + binaryOp->getSourceRange().getBegin()) + << binaryOp->getSourceRange(); + return true; +} + + +loplugin::Plugin::Registration< CommaOperator > X("commaoperator", true); + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx index 5d86c60..2ecd3ca1 100644 --- a/connectivity/source/drivers/jdbc/JConnection.cxx +++ b/connectivity/source/drivers/jdbc/JConnection.cxx @@ -845,7 +845,8 @@ bool java_sql_Connection::construct(const OUString& url, { ContextClassLoaderScope ccl( t.env(), getDriverClassLoader(), getLogger(), *this ); out = t.pEnv->CallObjectMethod( m_pDriverobject, mID, args[0].l,args[1].l ); - delete pProps, pProps = nullptr; + delete pProps; + pProps = nullptr; ThrowLoggedSQLException( m_aLogger, t.pEnv, *this ); } diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 6c8d015..e991a13 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -389,7 +389,10 @@ void ColorFieldControl::UpdateBitmap() const Size aSize(GetOutputSizePixel()); if (mpBitmap && mpBitmap->GetSizePixel() != aSize) - delete mpBitmap, mpBitmap = nullptr; + { + delete mpBitmap; + mpBitmap = nullptr; + } const sal_Int32 nWidth = aSize.Width(); const sal_Int32 nHeight = aSize.Height(); @@ -783,7 +786,10 @@ void ColorSliderControl::UpdateBitmap() Size aSize(1, GetOutputSizePixel().Height()); if (mpBitmap && mpBitmap->GetSizePixel() != aSize) - delete mpBitmap, mpBitmap = nullptr; + { + delete mpBitmap; + mpBitmap = nullptr; + } if (!mpBitmap) mpBitmap = new Bitmap(aSize, 24); diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 2a9964b..6a6af45 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -573,15 +573,15 @@ Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic, double { default: OSL_FAIL("svx::GraphicFilterEmboss::GetFilteredGraphic(), unknown Reference Point!" ); /* Fall through */ - case( RP_LT ): nAzim = 4500, nElev = 4500; break; - case( RP_MT ): nAzim = 9000, nElev = 4500; break; - case( RP_RT ): nAzim = 13500, nElev = 4500; break; - case( RP_LM ): nAzim = 0, nElev = 4500; break; - case( RP_MM ): nAzim = 0, nElev = 9000; break; - case( RP_RM ): nAzim = 18000, nElev = 4500; break; - case( RP_LB ): nAzim = 31500, nElev = 4500; break; - case( RP_MB ): nAzim = 27000, nElev = 4500; break; - case( RP_RB ): nAzim = 22500, nElev = 4500; break; + case( RP_LT ): nAzim = 4500; nElev = 4500; break; + case( RP_MT ): nAzim = 9000; nElev = 4500; break; + case( RP_RT ): nAzim = 13500; nElev = 4500; break; + case( RP_LM ): nAzim = 0; nElev = 4500; break; + case( RP_MM ): nAzim = 0; nElev = 9000; break; + case( RP_RM ): nAzim = 18000; nElev = 4500; break; + case( RP_LB ): nAzim = 31500; nElev = 4500; break; + case( RP_MB ): nAzim = 27000; nElev = 4500; break; + case( RP_RB ): nAzim = 22500; nElev = 4500; break; } BmpFilterParam aParam( nAzim, nElev ); diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index 3a4981c..98064ce 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -225,7 +225,10 @@ IMPL_LINK_TYPED( SvBaseLinksDlg, LinksSelectHdl, SvTreeListBox *, pSvTabListBox, m_pRbManual->Check(); m_pRbManual->Disable(); if( OBJECT_CLIENT_GRF == pLink->GetObjType() ) - pLinkNm = nullptr, pFilter = &sLink; + { + pLinkNm = nullptr; + pFilter = &sLink; + } } else { diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx index 81a76b6..d2ec71b 100644 --- a/cui/source/inc/page.hxx +++ b/cui/source/inc/page.hxx @@ -202,7 +202,7 @@ public: void SetMode( SvxModeType eMType ) { eMode = eMType; } void SetPaperFormatRanges( Paper eStart, Paper eEnd ) - { ePaperStart = eStart, ePaperEnd = eEnd; } + { ePaperStart = eStart; ePaperEnd = eEnd; } void SetCollectionList(const std::vector<OUString> &aList); virtual void PageCreated(const SfxAllItemSet& aSet) override; diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 66a7fa4..33c6d4c 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -1838,7 +1838,7 @@ OfaQuoteTabPage::OfaQuoteTabPage(vcl::Window* pParent, const SfxItemSet& rSet) aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); pListContainer->set_width_request(aControlSize.Width()); pListContainer->set_height_request(aControlSize.Height()); - m_pSwCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pListContainer), + m_pSwCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pListContainer); get(m_pSingleTypoCB, "singlereplace"); get(m_pSglStartQuotePB, "startsingle"); diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 2312f37..7361c98 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -385,7 +385,7 @@ SvxBulletPickTabPage::SvxBulletPickTabPage(vcl::Window* pParent, { SetExchangeSupport(); get(m_pExamplesVS, "valueset"); - m_pExamplesVS->init(NumberingPageType::BULLET), + m_pExamplesVS->init(NumberingPageType::BULLET); m_pExamplesVS->SetSelectHdl(LINK(this, SvxBulletPickTabPage, NumSelectHdl_Impl)); m_pExamplesVS->SetDoubleClickHdl(LINK(this, SvxBulletPickTabPage, DoubleClickHdl_Impl)); } diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx index 50cbcb5..9dcbb2f 100644 --- a/cui/source/tabpages/textattr.cxx +++ b/cui/source/tabpages/textattr.cxx @@ -77,7 +77,7 @@ SvxTextAttrPage::SvxTextAttrPage(vcl::Window* pWindow, const SfxItemSet& rInAttr get(m_pMtrFldBottom,"MTR_FLD_BOTTOM"); get(m_pFlPosition,"FL_POSITION"); get(m_pCtlPosition,"CTL_POSITION"); - m_pCtlPosition->SetControlSettings(RP_MM, 240, 100), + m_pCtlPosition->SetControlSettings(RP_MM, 240, 100); get(m_pTsbFullWidth,"TSB_FULL_WIDTH"); diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index 266d8a0..6dac434 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -270,7 +270,7 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(vcl::Window* pParent, const SfxIt get(m_pMtrTrgrCenterX,"MTR_TRGR_CENTER_X"); get(m_pFtTrgrCenterY,"FT_TRGR_CENTER_Y"); get(m_pMtrTrgrCenterY,"MTR_TRGR_CENTER_Y"); - get(m_pFtTrgrAngle,"FT_TRGR_ANGLE"), + get(m_pFtTrgrAngle,"FT_TRGR_ANGLE"); get(m_pMtrTrgrAngle,"MTR_TRGR_ANGLE"); get(m_pMtrTrgrBorder,"MTR_TRGR_BORDER"); get(m_pMtrTrgrStartValue,"MTR_TRGR_START_VALUE"); diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 51541d1..5941d43 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -198,7 +198,8 @@ ODatabaseDocument::~ODatabaseDocument() dispose(); } - delete m_pEventContainer, m_pEventContainer = nullptr; + delete m_pEventContainer; + m_pEventContainer = nullptr; } Any SAL_CALL ODatabaseDocument::queryInterface( const Type& _rType ) throw (RuntimeException, std::exception) diff --git a/dbaccess/source/core/recovery/subcomponentloader.cxx b/dbaccess/source/core/recovery/subcomponentloader.cxx index 625ca22..c5290ff 100644 --- a/dbaccess/source/core/recovery/subcomponentloader.cxx +++ b/dbaccess/source/core/recovery/subcomponentloader.cxx @@ -131,7 +131,8 @@ namespace dbaccess SubComponentLoader::~SubComponentLoader() { - delete m_pData, m_pData = nullptr; + delete m_pData; + m_pData = nullptr; } void SAL_CALL SubComponentLoader::windowResized( const WindowEvent& i_rEvent ) throw (RuntimeException, std::exception) diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 107639d..cc69bbb 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1661,7 +1661,8 @@ int Desktop::doShutdown() pExecGlobals->xGlobalBroadcaster->documentEventOccured(aEvent); } - delete pResMgr, pResMgr = nullptr; + delete pResMgr; + pResMgr = nullptr; // Restore old value const CommandLineArgs& rCmdLineArgs = GetCommandLineArgs(); if ( rCmdLineArgs.IsHeadless() || rCmdLineArgs.IsEventTesting() ) @@ -1703,7 +1704,8 @@ int Desktop::doShutdown() pExecGlobals->pPathOptions.reset( nullptr ); bool bRR = pExecGlobals->bRestartRequested; - delete pExecGlobals, pExecGlobals = nullptr; + delete pExecGlobals; + pExecGlobals = nullptr; if ( bRR ) { diff --git a/desktop/unx/source/file_image_unx.c b/desktop/unx/source/file_image_unx.c index c73e30b..522c491 100644 --- a/desktop/unx/source/file_image_unx.c +++ b/desktop/unx/source/file_image_unx.c @@ -42,7 +42,8 @@ int file_image_open (file_image * image, const char * filename) if (image == NULL) return EINVAL; - image->m_base = MAP_FAILED, image->m_size = 0; + image->m_base = MAP_FAILED; + image->m_size = 0; if ((fd = open (filename, O_RDONLY)) == -1) return errno; @@ -60,7 +61,8 @@ int file_image_open (file_image * image, const char * filename) goto cleanup_and_leave; } - image->m_base = p, image->m_size = st.st_size; + image->m_base = p; + image->m_size = st.st_size; cleanup_and_leave: close (fd); @@ -118,7 +120,8 @@ int file_image_close (file_image * image) if (munmap (image->m_base, image->m_size) == -1) return errno; - image->m_base = NULL, image->m_size = 0; + image->m_base = NULL; + image->m_size = 0; return 0; } diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 65ea358..210181c 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -39,9 +39,8 @@ using namespace com::sun::star; ImportInfo::ImportInfo( ImportState eSt, SvParser* pPrsrs, const ESelection& rSel ) : aSelection( rSel ) { - pParser = pPrsrs, + pParser = pPrsrs; eState = eSt; - nToken = 0; nTokenValue = 0; pAttrs = nullptr; diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 7aacec2..3d98c2d 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1936,11 +1936,20 @@ bool SvxAutoCorrectLanguageLists::IsFileChanged_Imp() bRet = true; // then remove all the lists fast! if( CplSttLstLoad & nFlags && pCplStt_ExcptLst ) - delete pCplStt_ExcptLst, pCplStt_ExcptLst = nullptr; + { + delete pCplStt_ExcptLst; + pCplStt_ExcptLst = nullptr; + } if( WrdSttLstLoad & nFlags && pWrdStt_ExcptLst ) - delete pWrdStt_ExcptLst, pWrdStt_ExcptLst = nullptr; + { + delete pWrdStt_ExcptLst; + pWrdStt_ExcptLst = nullptr; + } if( ChgWordLstLoad & nFlags && pAutocorr_List ) - delete pAutocorr_List, pAutocorr_List = nullptr; + { + delete pAutocorr_List; + pAutocorr_List = nullptr; + } nFlags &= ~(CplSttLstLoad | WrdSttLstLoad | ChgWordLstLoad ); } aLastCheckTime = tools::Time( tools::Time::SYSTEM ); diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index 56ac073..ae2eadd 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -1027,11 +1027,11 @@ ATTR_SETEMPHASIS: sal_Unicode cStt, cEnd; switch ( nTokenValue ) { - case 1: cStt = '(', cEnd = ')'; break; - case 2: cStt = '[', cEnd = ']'; break; - case 3: cStt = '<', cEnd = '>'; break; - case 4: cStt = '{', cEnd = '}'; break; - default: cStt = 0, cEnd = 0; break; + case 1: cStt = '('; cEnd = ')'; break; + case 2: cStt = '['; cEnd = ']'; break; + case 3: cStt = '<'; cEnd = '>'; break; + case 4: cStt = '{'; cEnd = '}'; break; + default: cStt = 0; cEnd = 0; break; } pSet->Put( SvxTwoLinesItem( true, cStt, cEnd, diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 35f2844..592eb4a 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -432,7 +432,9 @@ void SvxRTFParser::ReadColorTable() sal_uInt8(-1) == nRed && sal_uInt8(-1) == nGreen && sal_uInt8(-1) == nBlue ) pColor->SetColor( COL_AUTO ); aColorTbl.push_back( pColor ); - nRed = 0, nGreen = 0, nBlue = 0; + nRed = 0; + nGreen = 0; + nBlue = 0; // Color has been completely read, // so this is still a stable status diff --git a/extensions/source/resource/oooresourceloader.cxx b/extensions/source/resource/oooresourceloader.cxx index cb973bc..a79bfc4 100644 --- a/extensions/source/resource/oooresourceloader.cxx +++ b/extensions/source/resource/oooresourceloader.cxx @@ -183,7 +183,8 @@ namespace extensions { namespace resource if ( !m_pResourceManager->IsValid() ) { - delete m_pResourceManager, m_pResourceManager = nullptr; + delete m_pResourceManager; + m_pResourceManager = nullptr; throw MissingResourceException(); } diff --git a/forms/source/component/propertybaghelper.cxx b/forms/source/component/propertybaghelper.cxx index dfcc458..0c02677 100644 --- a/forms/source/component/propertybaghelper.cxx +++ b/forms/source/component/propertybaghelper.cxx @@ -80,7 +80,8 @@ namespace frm PropertyBagHelper::~PropertyBagHelper() { - delete m_pPropertyArrayHelper, m_pPropertyArrayHelper = nullptr; + delete m_pPropertyArrayHelper; + m_pPropertyArrayHelper = nullptr; } @@ -99,7 +100,8 @@ namespace frm void PropertyBagHelper::impl_nts_invalidatePropertySetInfo() { - delete m_pPropertyArrayHelper, m_pPropertyArrayHelper = nullptr; + delete m_pPropertyArrayHelper; + m_pPropertyArrayHelper = nullptr; } diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index a17d9ee..6b0eb35 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -1732,7 +1732,8 @@ bool FormulaCompiler::MergeRangeReference( FormulaToken * * const pCode1, Formul p1->DecRef(); p2->DecRef(); *pCode1 = p.get(); - --pCode, --pc; + --pCode; + --pc; return true; } diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 7e1e8e8..73a5dd6 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -146,7 +146,10 @@ void FormulaHelper::FillArgStrings( const OUString& rFormula, if ( nEnd != nStart ) _rArgs.push_back(rFormula.copy( nStart, nEnd-1-nStart )); else - _rArgs.push_back(OUString()), bLast = true; + { + _rArgs.push_back(OUString()); + bLast = true; + } } else { diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 40fb536..aa7ad1d 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -979,7 +979,7 @@ DefaultNumberingProvider::isScriptFlagEnabled(const OUString& aName) throw(Runti Sequence< Any > aArgs(1); beans::PropertyValue aPath; aPath.Name = "nodepath"; - aPath.Value <<= OUString("/org.openoffice.Office.Common/I18N"), + aPath.Value <<= OUString("/org.openoffice.Office.Common/I18N"); aArgs[0] <<= aPath; Reference<XInterface> xInterface = xConfigProvider->createInstanceWithArguments( diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 098c392..a811fb2 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -452,11 +452,17 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const ++nSavErr; // format codes not affected } if (aTimeSep == aTime100Sep) - ++nWarn, fprintf( stderr, "Warning: %s\n", + { + ++nWarn; + fprintf( stderr, "Warning: %s\n", "Time100SecSeparator equals TimeSeparator, this is probably an error."); + } if (aDecSep != aTime100Sep) - ++nWarn, fprintf( stderr, "Warning: %s\n", + { + ++nWarn; + fprintf( stderr, "Warning: %s\n", "Time100SecSeparator is different from DecimalSeparator, this may be correct or not. Intended?"); + } if (nSavErr != nError || nWarn) fprintf( stderr, "Warning: %s\n", "Don't forget to adapt corresponding FormatCode elements when changing separators."); diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index 90bced1..9d00002 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -136,10 +136,14 @@ void TextSearch::setOptions2( const SearchOptions2& rOptions ) throw( RuntimeExc { aSrchPara = rOptions; - delete pRegexMatcher, pRegexMatcher = nullptr; - delete pWLD, pWLD = nullptr; - delete pJumpTable, pJumpTable = nullptr; - delete pJumpTable2, pJumpTable2 = nullptr; + delete pRegexMatcher; + pRegexMatcher = nullptr; + delete pWLD; + pWLD = nullptr; + delete pJumpTable; + pJumpTable = nullptr; + delete pJumpTable2; + pJumpTable2 = nullptr; maWildcardReversePattern.clear(); maWildcardReversePattern2.clear(); diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index 894d316..35920f9 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -249,21 +249,42 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase, bOk |= aExport.ReadSvIdl( SvHash_Export(), rInStm ); if( aToggle.ReadSvIdl( SvHash_Toggle(), rInStm ) ) - SetToggle( aToggle ), bOk = true; + { + SetToggle( aToggle ); + bOk = true; + } if( aAutoUpdate.ReadSvIdl( SvHash_AutoUpdate(), rInStm ) ) - SetAutoUpdate( aAutoUpdate ), bOk = true; + { + SetAutoUpdate( aAutoUpdate ); + bOk = true; + } if( aAsynchron.ReadSvIdl( SvHash_Asynchron(), rInStm ) ) - SetAsynchron( aAsynchron ), bOk = true; + { + SetAsynchron( aAsynchron ); + bOk = true; + } if( aRecordAbsolute.ReadSvIdl( SvHash_RecordAbsolute(), rInStm ) ) - SetRecordAbsolute( aRecordAbsolute), bOk = true; + { + SetRecordAbsolute( aRecordAbsolute); + bOk = true; + } if( aRecordPerItem.ReadSvIdl( SvHash_RecordPerItem(), rInStm ) ) - SetRecordPerItem( aRecordPerItem ), bOk = true; + { + SetRecordPerItem( aRecordPerItem ); + bOk = true; + } if( aRecordPerSet.ReadSvIdl( SvHash_RecordPerSet(), rInStm ) ) - SetRecordPerSet( aRecordPerSet ), bOk = true; + { + SetRecordPerSet( aRecordPerSet ); + bOk = true; + } if( aNoRecord.ReadSvIdl( SvHash_NoRecord(), rInStm ) ) - SetNoRecord( aNoRecord ), bOk = true; + { + SetNoRecord( aNoRecord ); + bOk = true; + } bOk |= aPseudoPrefix.ReadSvIdl( SvHash_PseudoPrefix(), rInStm ); bOk |= aMenuConfig.ReadSvIdl( SvHash_MenuConfig(), rInStm ); diff --git a/include/editeng/escapementitem.hxx b/include/editeng/escapementitem.hxx index ad422d8..516fd8a 100644 --- a/include/editeng/escapementitem.hxx +++ b/include/editeng/escapementitem.hxx @@ -68,12 +68,21 @@ public: inline void SetEscapement( const SvxEscapement eNew ) { if( SVX_ESCAPEMENT_OFF == eNew ) - nEsc = 0, nProp = 100; + { + nEsc = 0; + nProp = 100; + } else if( SVX_ESCAPEMENT_SUPERSCRIPT == eNew ) - nEsc = DFLT_ESC_SUPER, nProp = DFLT_ESC_PROP; + { + nEsc = DFLT_ESC_SUPER; + nProp = DFLT_ESC_PROP; + } else - nEsc = DFLT_ESC_SUB, nProp = DFLT_ESC_PROP; + { + nEsc = DFLT_ESC_SUB; + nProp = DFLT_ESC_PROP; + } } inline SvxEscapement GetEscapement() const { return static_cast< SvxEscapement >( GetEnumValue() ); } diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 5512026..f95a292 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -171,7 +171,7 @@ struct ParaRange sal_Int32 nStartPara; sal_Int32 nEndPara; - ParaRange( sal_Int32 nS, sal_Int32 nE ) { nStartPara = nS, nEndPara = nE; } + ParaRange( sal_Int32 nS, sal_Int32 nE ) : nStartPara(nS), nEndPara(nE) {} void Adjust(); }; @@ -180,9 +180,7 @@ inline void ParaRange::Adjust() { if ( nStartPara > nEndPara ) { - sal_Int32 nTmp = nStartPara; - nStartPara = nEndPara; - nEndPara = nTmp; + std::swap(nStartPara, nEndPara); } } diff --git a/include/registry/registry.hxx b/include/registry/registry.hxx index 8b75a5e..e9cbff8 100644 --- a/include/registry/registry.hxx +++ b/include/registry/registry.hxx @@ -828,7 +828,8 @@ inline void RegistryKey::releaseKey() { if (m_registry.isValid() && (m_hImpl != nullptr)) { - m_registry.m_pApi->releaseKey(m_hImpl), m_hImpl = nullptr; + m_registry.m_pApi->releaseKey(m_hImpl); + m_hImpl = nullptr; } } diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx index 2940dda..9476c03 100644 --- a/include/vcl/salbtype.hxx +++ b/include/vcl/salbtype.hxx @@ -391,7 +391,9 @@ inline sal_uInt8 BitmapColor::GetBlueOrIndex() const inline BitmapColor& BitmapColor::Invert() { DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" ); - mcBlueOrIndex = ~mcBlueOrIndex, mcGreen = ~mcGreen, mcRed = ~mcRed; + mcBlueOrIndex = ~mcBlueOrIndex; + mcGreen = ~mcGreen; + mcRed = ~mcRed; return *this; } diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index d62675b..1055b2b 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -75,9 +75,12 @@ void VMLExport::SetFS( ::sax_fastparser::FSHelperPtr pSerializer ) VMLExport::~VMLExport() { - delete mpOutStrm, mpOutStrm = nullptr; - delete m_pShapeStyle, m_pShapeStyle = nullptr; - delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = nullptr; + delete mpOutStrm; + mpOutStrm = nullptr; + delete m_pShapeStyle; + m_pShapeStyle = nullptr; + delete[] m_pShapeTypeWritten; + m_pShapeTypeWritten = nullptr; } void VMLExport::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance ) diff --git a/registry/source/regkey.cxx b/registry/source/regkey.cxx index 4da6875..bc97dff 100644 --- a/registry/source/regkey.cxx +++ b/registry/source/regkey.cxx @@ -456,7 +456,8 @@ RegError REGISTRY_CALLTYPE getLongListValue(RegKeyHandle hKey, sal_uInt32* pLen) { assert((pValueList != nullptr) && (pLen != nullptr) && "registry::getLongListValue(): invalid parameter"); - *pValueList = nullptr, *pLen = 0; + *pValueList = nullptr; + *pLen = 0; ORegKey* pKey = static_cast< ORegKey* >(hKey); if (!pKey) @@ -495,7 +496,8 @@ RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle hKey, sal_uInt32* pLen) { OSL_PRECOND((pValueList != nullptr) && (pLen != nullptr), "registry::getStringListValue(): invalid parameter"); - *pValueList = nullptr, *pLen = 0; + *pValueList = nullptr; + *pLen = 0; ORegKey* pKey = static_cast< ORegKey* >(hKey); if (!pKey) @@ -532,7 +534,8 @@ RegError REGISTRY_CALLTYPE getUnicodeListValue(RegKeyHandle hKey, sal_uInt32* pLen) { assert((pValueList != nullptr) && (pLen != nullptr) && "registry::getUnicodeListValue(): invalid parameter"); - *pValueList = nullptr, *pLen = 0; + *pValueList = nullptr; + *pLen = 0; ORegKey* pKey = static_cast< ORegKey* >(hKey); if (!pKey) diff --git a/rsc/source/tools/rscchar.cxx b/rsc/source/tools/rscchar.cxx index b458822..b00d61f 100644 --- a/rsc/source/tools/rscchar.cxx +++ b/rsc/source/tools/rscchar.cxx @@ -147,7 +147,8 @@ char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding ) &nSrcCvtBytes ); rtl_destroyTextToUnicodeConverter( hConv ); - delete[] pOrgStr, pOrgStr = nullptr; + delete[] pOrgStr; + pOrgStr = nullptr; hConv = rtl_createUnicodeToTextConverter( RTL_TEXTENCODING_UTF8 ); // factor of 6 is the maximum size of an UNICODE character as utf8 @@ -162,7 +163,8 @@ char * RscChar::MakeUTF8( char * pStr, sal_uInt16 nTextEncoding ) &nSrcCvtBytes ); rtl_destroyTextToUnicodeConverter( hConv ); - delete[] pUniCode, pUniCode = nullptr; + delete[] pUniCode; + pUniCode = nullptr; return pUtf8; }; diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 0824011..3f44a10 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -202,14 +202,18 @@ FileHandle_Impl::Allocator::Allocator() } FileHandle_Impl::Allocator::~Allocator() { - rtl_cache_destroy (m_cache), m_cache = nullptr; + rtl_cache_destroy (m_cache); + m_cache = nullptr; } void FileHandle_Impl::Allocator::allocate (sal_uInt8 ** ppBuffer, size_t * pnSize) { OSL_PRECOND((nullptr != ppBuffer) && (nullptr != pnSize), "FileHandle_Impl::Allocator::allocate(): contract violation"); if ((nullptr != ppBuffer) && (nullptr != pnSize)) - *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache)), *pnSize = m_bufsiz; + { + *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache)); + *pnSize = m_bufsiz; + } } void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer) { @@ -253,8 +257,12 @@ FileHandle_Impl::FileHandle_Impl (int fd, enum Kind kind, char const * path) FileHandle_Impl::~FileHandle_Impl() { if (m_kind == KIND_FD) - Allocator::get().deallocate (m_buffer), m_buffer = nullptr; - rtl_string_release (m_strFilePath), m_strFilePath = nullptr; + { + Allocator::get().deallocate (m_buffer); + m_buffer = nullptr; + } + rtl_string_release (m_strFilePath); + m_strFilePath = nullptr; (void) pthread_mutex_destroy(&m_mutex); // ignoring EBUSY ... } @@ -441,7 +449,8 @@ oslFileError FileHandle_Impl::readFileAt ( oslFileError result = syncFile(); if (result != osl_File_E_None) return result; - m_bufptr = -1, m_buflen = 0; + m_bufptr = -1; + m_buflen = 0; if (nBytesRequested >= m_bufsiz) { @@ -460,7 +469,8 @@ oslFileError FileHandle_Impl::readFileAt ( result = readAt (bufptr, m_buffer, m_bufsiz, &uDone); if (result != osl_File_E_None) return result; - m_bufptr = bufptr, m_buflen = uDone; + m_bufptr = bufptr; + m_buflen = uDone; } if (bufpos >= m_buflen) { @@ -472,7 +482,9 @@ oslFileError FileHandle_Impl::readFileAt ( SAL_INFO("sal.file", "FileHandle_Impl::readFileAt(" << m_fd << ", " << nOffset << ", " << bytes << ")"); memcpy (&(buffer[*pBytesRead]), &(m_buffer[bufpos]), bytes); - nBytesRequested -= bytes, *pBytesRead += bytes, nOffset += bytes; + nBytesRequested -= bytes; + *pBytesRead += bytes; + nOffset += bytes; } return osl_File_E_None; } @@ -511,7 +523,8 @@ oslFileError FileHandle_Impl::writeFileAt ( oslFileError result = syncFile(); if (result != osl_File_E_None) return result; - m_bufptr = -1, m_buflen = 0; + m_bufptr = -1; + m_buflen = 0; if (nBytesToWrite >= m_bufsiz) { @@ -532,14 +545,17 @@ oslFileError FileHandle_Impl::writeFileAt ( result = readAt (bufptr, m_buffer, m_bufsiz, &uDone); if (result != osl_File_E_None) return result; - m_bufptr = bufptr, m_buflen = uDone; + m_bufptr = bufptr; + m_buflen = uDone; } size_t const bytes = std::min (m_bufsiz - bufpos, nBytesToWrite); SAL_INFO("sal.file", "FileHandle_Impl::writeFileAt(" << m_fd << ", " << nOffset << ", " << bytes << ")"); memcpy (&(m_buffer[bufpos]), &(buffer[*pBytesWritten]), bytes); - nBytesToWrite -= bytes, *pBytesWritten += bytes, nOffset += bytes; + nBytesToWrite -= bytes; + *pBytesWritten += bytes; + nOffset += bytes; m_buflen = std::max(m_buflen, bufpos + bytes); m_state |= STATE_MODIFIED; @@ -569,7 +585,8 @@ oslFileError FileHandle_Impl::readLineAt ( if (result != osl_File_E_None) return result; - m_bufptr = bufptr, m_buflen = uDone; + m_bufptr = bufptr; + m_buflen = uDone; } static int const LINE_STATE_BEGIN = 0; @@ -591,7 +608,8 @@ oslFileError FileHandle_Impl::readLineAt ( ppSequence, &dstpos, &(m_buffer[bufpos]), curpos - bufpos); if (result != osl_File_E_None) return result; - *pBytesRead += curpos - bufpos, nOffset += curpos - bufpos; + *pBytesRead += curpos - bufpos; + nOffset += curpos - bufpos; } bufptr = nOffset / m_bufsiz * m_bufsiz; @@ -602,10 +620,12 @@ oslFileError FileHandle_Impl::readLineAt ( result = readAt (bufptr, m_buffer, m_bufsiz, &uDone); if (result != osl_File_E_None) return result; - m_bufptr = bufptr, m_buflen = uDone; + m_bufptr = bufptr; + m_buflen = uDone; } - bufpos = nOffset - m_bufptr, curpos = bufpos; + bufpos = nOffset - m_bufptr; + curpos = bufpos; if (bufpos >= m_buflen) break; } @@ -648,7 +668,8 @@ oslFileError FileHandle_Impl::readLineAt ( ppSequence, &dstpos, &(m_buffer[bufpos]), curpos - bufpos - 1); if (result != osl_File_E_None) return result; - *pBytesRead += curpos - bufpos, nOffset += curpos - bufpos; + *pBytesRead += curpos - bufpos; + nOffset += curpos - bufpos; } break; } @@ -684,7 +705,8 @@ oslFileError FileHandle_Impl::writeSequence_Impl ( if (*ppSequence != nullptr && nBytes != 0) { /* fill sequence */ - memcpy(&((*ppSequence)->elements[*pnOffset]), pBuffer, nBytes), *pnOffset += nBytes; + memcpy(&((*ppSequence)->elements[*pnOffset]), pBuffer, nBytes); + *pnOffset += nBytes; } return (*ppSequence != nullptr) ? osl_File_E_None : osl_File_E_NOMEM; } @@ -1479,7 +1501,8 @@ SAL_CALL osl_setFileSize( oslFileHandle Handle, sal_uInt64 uSize ) oslFileError result = pImpl->syncFile(); if (result != osl_File_E_None) return result; - pImpl->m_bufptr = -1, pImpl->m_buflen = 0; + pImpl->m_bufptr = -1; + pImpl->m_buflen = 0; return pImpl->setSize (uSize); } diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index c78e775..7f3356e 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -334,7 +334,8 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory Directory, oslDirect DirectoryItem_Impl * pImpl = static_cast< DirectoryItem_Impl* >(*pItem); if (nullptr != pImpl) { - pImpl->release(), pImpl = nullptr; + pImpl->release(); + pImpl = nullptr; } #ifdef _DIRENT_HAVE_D_TYPE pImpl = new DirectoryItem_Impl(ustrFilePath, pEntry->d_type); diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx index 3e6adbe..6a7f740 100644 --- a/sal/rtl/alloc_arena.cxx +++ b/sal/rtl/alloc_arena.cxx @@ -365,7 +365,8 @@ rtl_arena_hash_remove ( { if (segment->m_addr == addr) { - *segpp = segment->m_fnext, segment->m_fnext = segment->m_fprev = segment; + *segpp = segment->m_fnext; + segment->m_fnext = segment->m_fprev = segment; break; } @@ -785,7 +786,8 @@ rtl_arena_deactivate ( while ((segment = arena->m_hash_table[i]) != nullptr) { /* pop from hash table */ - arena->m_hash_table[i] = segment->m_fnext, segment->m_fnext = segment->m_fprev = segment; + arena->m_hash_table[i] = segment->m_fnext; + segment->m_fnext = segment->m_fprev = segment; /* coalesce w/ adjacent free segment(s) */ rtl_arena_segment_coalesce (arena, segment); @@ -1034,7 +1036,8 @@ SAL_CALL rtl_arena_free ( rtl_arena_segment_coalesce (arena, segment); /* determine (new) next and prev segment */ - next = segment->m_snext, prev = segment->m_sprev; + next = segment->m_snext; + prev = segment->m_sprev; /* entire span free when prev is a span, and next is either a span or a list head */ if (((prev->m_type == RTL_ARENA_SEGMENT_TYPE_SPAN)) && diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx index ebe1b17..1241f42 100644 --- a/sal/rtl/alloc_cache.cxx +++ b/sal/rtl/alloc_cache.cxx @@ -189,7 +189,8 @@ rtl_cache_hash_remove ( { if (bufctl->m_addr == addr) { - *ppHead = bufctl->m_next, bufctl->m_next = nullptr; + *ppHead = bufctl->m_next; + bufctl->m_next = nullptr; break; } @@ -322,7 +323,8 @@ rtl_cache_slab_destroy ( rtl_cache_bufctl_type * bufctl = slab->m_sp; /* pop from freelist */ - slab->m_sp = bufctl->m_next, bufctl->m_next = nullptr; + slab->m_sp = bufctl->m_next; + bufctl->m_next = nullptr; /* return bufctl struct to bufctl cache */ rtl_cache_free (gp_cache_bufctl_cache, bufctl); @@ -914,7 +916,8 @@ rtl_cache_deactivate ( rtl_cache_magazine_type * mag; /* prevent recursion */ - mag_cache = cache->m_magazine_cache, cache->m_magazine_cache = nullptr; + mag_cache = cache->m_magazine_cache; + cache->m_magazine_cache = nullptr; /* cleanup cpu layer */ if ((mag = cache->m_cpu_curr) != nullptr) @@ -978,7 +981,8 @@ rtl_cache_deactivate ( while ((bufctl = cache->m_hash_table[i]) != nullptr) { /* pop from hash table */ - cache->m_hash_table[i] = bufctl->m_next, bufctl->m_next = nullptr; + cache->m_hash_table[i] = bufctl->m_next; + bufctl->m_next = nullptr; /* return to bufctl cache */ rtl_cache_free (gp_cache_bufctl_cache, bufctl); @@ -1137,7 +1141,8 @@ SAL_CALL rtl_cache_alloc ( if (!((cache->m_constructor)(obj, cache->m_userarg))) { /* construction failure */ - rtl_freeMemory(obj), obj = nullptr; + rtl_freeMemory(obj); + obj = nullptr; } } return obj; @@ -1194,7 +1199,8 @@ SAL_CALL rtl_cache_alloc ( if (!((cache->m_constructor)(obj, cache->m_userarg))) { /* construction failure */ - rtl_cache_slab_free (cache, obj), obj = nullptr; + rtl_cache_slab_free (cache, obj); + obj = nullptr; } } return (obj); @@ -1643,19 +1649,22 @@ rtl_cache_fini() if (gp_cache_bufctl_cache != nullptr) { - cache = gp_cache_bufctl_cache, gp_cache_bufctl_cache = nullptr; + cache = gp_cache_bufctl_cache; + gp_cache_bufctl_cache = nullptr; rtl_cache_deactivate (cache); rtl_cache_destructor (cache); } if (gp_cache_slab_cache != nullptr) { - cache = gp_cache_slab_cache, gp_cache_slab_cache = nullptr; + cache = gp_cache_slab_cache; + gp_cache_slab_cache = nullptr; rtl_cache_deactivate (cache); rtl_cache_destructor (cache); } if (gp_cache_magazine_cache != nullptr) { - cache = gp_cache_magazine_cache, gp_cache_magazine_cache = nullptr; + cache = gp_cache_magazine_cache; + gp_cache_magazine_cache = nullptr; rtl_cache_deactivate (cache); rtl_cache_destructor (cache); } diff --git a/sal/rtl/alloc_global.cxx b/sal/rtl/alloc_global.cxx index 6dd24f1..1e344f3 100644 --- a/sal/rtl/alloc_global.cxx +++ b/sal/rtl/alloc_global.cxx @@ -173,7 +173,8 @@ void * SAL_CALL rtl_reallocateMemory_CUSTOM (void * p, sal_Size n) SAL_THROW_EXT } else if (p != nullptr) { - rtl_freeMemory (p), p = nullptr; + rtl_freeMemory (p); + p = nullptr; } return p; } diff --git a/sal/rtl/alloc_impl.hxx b/sal/rtl/alloc_impl.hxx index 61c0e88..3666996 100644 --- a/sal/rtl/alloc_impl.hxx +++ b/sal/rtl/alloc_impl.hxx @@ -74,16 +74,31 @@ highbit(sal_Size n) return 0; #if SAL_TYPES_SIZEOFLONG == 8 if (n & 0xffffffff00000000ul) - k |= 32, n >>= 32; + { + k |= 32; + n >>= 32; + } #endif if (n & 0xffff0000) - k |= 16, n >>= 16; + { + k |= 16; + n >>= 16; + } if (n & 0xff00) - k |= 8, n >>= 8; + { + k |= 8; + n >>= 8; + } if (n & 0xf0) - k |= 4, n >>= 4; + { + k |= 4; + n >>= 4; + } if (n & 0x0c) - k |= 2, n >>= 2; + { + k |= 2; + n >>= 2; + } if (n & 0x02) k++; @@ -102,16 +117,31 @@ lowbit(sal_Size n) return 0; #if SAL_TYPES_SIZEOFLONG == 8 if (!(n & 0xffffffff)) - k |= 32, n >>= 32; + { + k |= 32; + n >>= 32; + } #endif if (!(n & 0xffff)) - k |= 16, n >>= 16; + { + k |= 16; + n >>= 16; + } if (!(n & 0xff)) - k |= 8, n >>= 8; + { + k |= 8; + n >>= 8; + } if (!(n & 0xf)) - k |= 4, n >>= 4; + { + k |= 4; + n >>= 4; + } if (!(n & 0x3)) - k |= 2, n >>= 2; + { + k |= 2; + n >>= 2; + } if (!(n & 0x1)) k++; return k; diff --git a/sal/rtl/cipher.cxx b/sal/rtl/cipher.cxx index 0bcaa49f..4660e6a 100644 --- a/sal/rtl/cipher.cxx +++ b/sal/rtl/cipher.cxx @@ -1175,7 +1175,10 @@ static rtlCipherError rtl_cipherARCFOUR_init_Impl ( for (x = 0, y = 0; x < CIPHER_CBLOCK_ARCFOUR; x++) { y = (y + S[x] + K[x]) % CIPHER_CBLOCK_ARCFOUR; - t = S[x], S[x] = S[y], S[y] = t; /* swap S[x] and S[y] */ + /* swap S[x] and S[y] */ + t = S[x]; + S[x] = S[y]; + S[y] = t; } /* Initialize counters X and Y. */ @@ -1217,7 +1220,9 @@ static rtlCipherError rtl_cipherARCFOUR_update_Impl ( ctx->m_Y = y; /* Swap S[x] and S[y]. */ - t = S[x], S[x] = S[y], S[y] = t; + t = S[x]; + S[x] = S[y]; + S[y] = t; /* Evaluate next key byte S[t]. */ t = (S[x] + S[y]) % CIPHER_CBLOCK_ARCFOUR; diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 3addfbf..39a8ebf8 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -3318,7 +3318,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a if ( pOut ) { pClientTextBox->Write( pOut->GetData(), pOut->Tell() ); - delete pOut, aTextRule.pOut = nullptr; + delete pOut; + aTextRule.pOut = nullptr; } if ( aExtBu.Tell() ) { @@ -3381,7 +3382,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a .WriteUInt32( pClientData->Tell() ); mpStrm->Write( pClientData->GetData(), pClientData->Tell() ); - delete pClientData, pClientData = nullptr; + delete pClientData; + pClientData = nullptr; } if ( pClientTextBox ) { @@ -3389,7 +3391,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a .WriteUInt32( pClientTextBox->Tell() ); mpStrm->Write( pClientTextBox->GetData(), pClientTextBox->Tell() ); - delete pClientTextBox, pClientTextBox = nullptr; + delete pClientTextBox; + pClientTextBox = nullptr; } mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer } @@ -3454,7 +3457,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a .WriteUInt32( pClientTextBox->Tell() ); mpStrm->Write( pClientTextBox->GetData(), pClientTextBox->Tell() ); - delete pClientTextBox, pClientTextBox = nullptr; + delete pClientTextBox; + pClientTextBox = nullptr; mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer @@ -3701,7 +3705,8 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc .WriteUInt32( pClientData->Tell() ); mpStrm->Write( pClientData->GetData(), pClientData->Tell() ); - delete pClientData, pClientData = nullptr; + delete pClientData; + pClientData = nullptr; } aPropOptSp.Commit( *mpStrm ); diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 844ae34..fc5c89b 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2696,7 +2696,8 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi maAnimations[pMediaObj] = pAnimation; } - SdrObject::Free( pObj ), pObj = pMediaObj; // SJ: hoping that pObj is not inserted in any list + SdrObject::Free( pObj ); + pObj = pMediaObj; // SJ: hoping that pObj is not inserted in any list pMediaObj->setURL( aMediaURL, ""/*TODO?*/ ); } } diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index bb253c0..71d548d 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -1715,7 +1715,7 @@ void AnimationImporter::importAnimateSetContainer( const Atom* pAtom, const Refe sal_Int32 nU1, nU2; mrStCtrl.ReadInt32( nU1 ).ReadInt32( nU2 ); - dump( " set_1=\"%ld\"", nU1 ), + dump( " set_1=\"%ld\"", nU1 ); dump( " set_2=\"%ld\"", nU2 ); } break; diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index ce537a5..add56e7 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -126,8 +126,10 @@ void SdModule::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint); if( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DEINITIALIZING ) { - delete pImpressOptions, pImpressOptions = nullptr; - delete pDrawOptions, pDrawOptions = nullptr; + delete pImpressOptions; + pImpressOptions = nullptr; + delete pDrawOptions; + pDrawOptions = nullptr; } } diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 3103f72..aea5e11 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -152,10 +152,14 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) { if( pObj ) { - delete mpOLEDataHelper, mpOLEDataHelper = nullptr; - delete mpGraphic, mpGraphic = nullptr; - delete mpBookmark, mpBookmark = nullptr; - delete mpImageMap, mpImageMap = nullptr; + delete mpOLEDataHelper; + mpOLEDataHelper = nullptr; + delete mpGraphic; + mpGraphic = nullptr; + delete mpBookmark; + mpBookmark = nullptr; + delete mpImageMap; + mpImageMap = nullptr; if( nullptr!= dynamic_cast< const SdrOle2Obj* >( pObj ) ) { diff --git a/sdext/source/minimizer/pppoptimizerdialog.cxx b/sdext/source/minimizer/pppoptimizerdialog.cxx index 64efae2..122875c 100644 --- a/sdext/source/minimizer/pppoptimizerdialog.cxx +++ b/sdext/source/minimizer/pppoptimizerdialog.cxx @@ -126,7 +126,8 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL, OUString sResult( sBuf.makeStringAndClear() ); SAL_INFO("sdext.minimizer", sResult ); } - delete mpOptimizerDialog, mpOptimizerDialog = nullptr; + delete mpOptimizerDialog; + mpOptimizerDialog = nullptr; } catch( ... ) { diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index 6ef4462..b39fb25 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -717,7 +717,10 @@ bool PDFObject::getDeflatedStream( char** ppStream, unsigned int* pBytes, const } } else - *ppStream = nullptr, *pBytes = 0; + { + *ppStream = nullptr; + *pBytes = 0; + } return bIsDeflated; } diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx index 8a68dc8..7e74f74 100644 --- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx +++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx @@ -983,7 +983,10 @@ void DrawXmlFinalizer::visit( PageElement& elem, const std::list< Element* >::co double page_width = convPx2mm( elem.w ), page_height = convPx2mm( elem.h ); // calculate page margins out of the relevant children (paragraphs) - elem.TopMargin = elem.h, elem.BottomMargin = 0, elem.LeftMargin = elem.w, elem.RightMargin = 0; + elem.TopMargin = elem.h; + elem.BottomMargin = 0; + elem.LeftMargin = elem.w; + elem.RightMargin = 0; for( std::list< Element* >::const_iterator it = elem.Children.begin(); it != elem.Children.end(); ++it ) { diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx index 36335e7..b184828 100644 --- a/sdext/source/pdfimport/tree/writertreevisiting.cxx +++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx @@ -1086,7 +1086,10 @@ void WriterXmlFinalizer::visit( PageElement& elem, const std::list< Element* >:: double page_width = convPx2mm( elem.w ), page_height = convPx2mm( elem.h ); // calculate page margins out of the relevant children (paragraphs) - elem.TopMargin = elem.h, elem.BottomMargin = 0, elem.LeftMargin = elem.w, elem.RightMargin = 0; + elem.TopMargin = elem.h; + elem.BottomMargin = 0; + elem.LeftMargin = elem.w; + elem.RightMargin = 0; // first element should be a paragraphy ParagraphElement* pFirstPara = nullptr; for( std::list< Element* >::const_iterator it = elem.Children.begin(); it != elem.Children.end(); ++it ) diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx index cc891da..a97ae379 100644 --- a/sfx2/source/appl/appquit.cxx +++ b/sfx2/source/appl/appquit.cxx @@ -101,7 +101,8 @@ void SfxApplication::Deinitialize() DBG_ASSERT( pAppData_Impl->pViewFrame == nullptr, "active foreign ViewFrame" ); - delete[] pAppData_Impl->pInterfaces, pAppData_Impl->pInterfaces = nullptr; + delete[] pAppData_Impl->pInterfaces; + pAppData_Impl->pInterfaces = nullptr; // free administration managers DELETEZ(pAppData_Impl->pAppDispat); diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 6ddcf09..bf7df42 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -341,7 +341,8 @@ void SfxModule::DestroyModules_Impl() SfxModule* pMod = rModules[nPos]; delete pMod; } - delete pModules, pModules = nullptr; + delete pModules; + pModules = nullptr; } } diff --git a/sfx2/source/bastyp/mieclip.cxx b/sfx2/source/bastyp/mieclip.cxx index cbbb348..00d1e52 100644 --- a/sfx2/source/bastyp/mieclip.cxx +++ b/sfx2/source/bastyp/mieclip.cxx @@ -34,7 +34,10 @@ SvStream* MSE40HTMLClipFormatObj::IsValid( SvStream& rStream ) { bool bRet = false; if( pStrm ) - delete pStrm, pStrm = nullptr; + { + delete pStrm; + pStrm = nullptr; + } OString sLine, sVersion; sal_Int32 nStt = -1, nEnd = -1, nFragStart = -1, nFragEnd = -1; diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 3314c97..ed5b055 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1894,7 +1894,7 @@ static void SetToken( OUString& rOrigStr, sal_Int32 nToken, sal_Unicode cTok, co } } - ++pStr, + ++pStr; ++i; } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 1b342e9..e510588 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -521,7 +521,8 @@ SfxBaseModel::~SfxBaseModel() { //In SvxDrawingLayerImport when !xTargetDocument the fallback SvxUnoDrawingModel created there //never gets disposed called on it, so m_pData leaks. - delete m_pData, m_pData = nullptr; + delete m_pData; + m_pData = nullptr; } // XInterface diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c index 85d43bc..fad3737 100644 --- a/soltools/mkdepend/main.c +++ b/soltools/mkdepend/main.c @@ -563,10 +563,12 @@ char *get_line(struct filepointer *filep) for(bol = p--; ++p < eof; ) { if (*p == '/' && *(p+1) == '*') { /* consume comments */ - *p++ = ' ', *p++ = ' '; + *p++ = ' '; + *p++ = ' '; while (*p) { if (*p == '*' && *(p+1) == '/') { - *p++ = ' ', *p = ' '; + *p++ = ' '; + *p = ' '; break; } else if (*p == '\n') @@ -576,7 +578,8 @@ char *get_line(struct filepointer *filep) continue; } else if (*p == '/' && *(p+1) == '/') { /* consume comments */ - *p++ = ' ', *p++ = ' '; + *p++ = ' '; + *p++ = ' '; while (*p && *p != '\n') *p++ = ' '; if ( *p == '\n' ) diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx index fac1ed7..b7a3d9f 100644 --- a/sot/source/sdstor/stgavl.cxx +++ b/sot/source/sdstor/stgavl.cxx @@ -70,7 +70,10 @@ short StgAvlNode::Locate { // check for pPivot if( pCur->m_nBalance != 0 ) - *pPivot = pCur, *pParent = *pPrev; + { + *pPivot = pCur; + *pParent = *pPrev; + } // save pPrev location and see what direction to go *pPrev = pCur; nRes = pCur->Compare( pFind ); diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx index e7e40cf..832fde7 100644 --- a/sot/source/sdstor/stgcache.cxx +++ b/sot/source/sdstor/stgcache.cxx @@ -336,7 +336,8 @@ bool StgCache::Read( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) // fixed address and size for the header if( nPage == -1 ) { - nPos = 0L, nBytes = 512; + nPos = 0L; + nBytes = 512; nPg2 = nPg; } if( m_pStrm->Tell() != nPos ) @@ -365,7 +366,10 @@ bool StgCache::Write( sal_Int32 nPage, void* pBuf, sal_Int32 nPg ) // fixed address and size for the header // nPageSize must be >= 512, otherwise the header can not be written here, we check it on import if( nPage == -1 ) - nPos = 0L, nBytes = 512; + { + nPos = 0L; + nBytes = 512; + } if( m_pStrm->Tell() != nPos ) { m_pStrm->Seek(nPos); diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index 7436764..8e8eaa0 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -200,7 +200,8 @@ bool StgDirEntry::StoreStream( StgIo& rIo ) if( !m_pStgStrm ) { OpenStream( rIo ); - delete m_pStgStrm, m_pStgStrm = nullptr; + delete m_pStgStrm; + m_pStgStrm = nullptr; } else m_pStgStrm->SetSize( 0 ); @@ -532,7 +533,11 @@ bool StgDirEntry::Commit() if( m_aEntry.GetType() == STG_STREAM ) { if( m_pTmpStrm ) - delete m_pCurStrm, m_pCurStrm = m_pTmpStrm, m_pTmpStrm = nullptr; + { + delete m_pCurStrm; + m_pCurStrm = m_pTmpStrm; + m_pTmpStrm = nullptr; + } if( m_bRemoved ) // Delete the stream if needed if( m_pStgStrm ) @@ -616,7 +621,10 @@ bool StgDirEntry::Tmp2Strm() { // We did commit once, but have not written since then if( !m_pTmpStrm ) - m_pTmpStrm = m_pCurStrm, m_pCurStrm = nullptr; + { + m_pTmpStrm = m_pCurStrm; + m_pCurStrm = nullptr; + } if( m_pTmpStrm ) { OSL_ENSURE( m_pStgStrm, "The pointer may not be NULL!" ); diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx index b0b7ac0..7e2c5fb 100644 --- a/sot/source/sdstor/stgelem.cxx +++ b/sot/source/sdstor/stgelem.cxx @@ -221,39 +221,65 @@ void StgHeader::SetFATPage( short n, sal_Int32 nb ) if( n >= 0 && n < cFATPagesInHeader ) { if( m_nMasterFAT[ n ] != nb ) - m_bDirty = sal_uInt8(true), m_nMasterFAT[ n ] = nb; + { + m_bDirty = sal_uInt8(true); + m_nMasterFAT[ n ] = nb; + } } } void StgHeader::SetTOCStart( sal_Int32 n ) { - if( n != m_nTOCstrm ) m_bDirty = sal_uInt8(true), m_nTOCstrm = n; + if( n != m_nTOCstrm ) + { + m_bDirty = sal_uInt8(true); + m_nTOCstrm = n; + } } void StgHeader::SetDataFATStart( sal_Int32 n ) { - if( n != m_nDataFAT ) m_bDirty = sal_uInt8(true), m_nDataFAT = n; + if( n != m_nDataFAT ) + { + m_bDirty = sal_uInt8(true); + m_nDataFAT = n; + } } void StgHeader::SetDataFATSize( sal_Int32 n ) { - if( n != m_nDataFATSize ) m_bDirty = sal_uInt8(true), m_nDataFATSize = n; + if( n != m_nDataFATSize ) + { + m_bDirty = sal_uInt8(true); + m_nDataFATSize = n; + } } void StgHeader::SetFATSize( sal_Int32 n ) { - if( n != m_nFATSize ) m_bDirty = sal_uInt8(true), m_nFATSize = n; + if( n != m_nFATSize ) + { + m_bDirty = sal_uInt8(true); + m_nFATSize = n; + } } void StgHeader::SetFATChain( sal_Int32 n ) { if( n != m_nMasterChain ) - m_bDirty = sal_uInt8(true), m_nMasterChain = n; + { + m_bDirty = sal_uInt8(true); + m_nMasterChain = n; + } } void StgHeader::SetMasters( sal_Int32 n ) { - if( n != m_nMaster ) m_bDirty = sal_uInt8(true), m_nMaster = n; + if( n != m_nMaster ) + { + m_bDirty = sal_uInt8(true); + m_nMaster = n; + } } ///////////////////////////// class StgEntry diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 3ae6b11..cfb29fd 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -195,7 +195,10 @@ bool EasyFat::HasUnrefChains() sal_uLong EasyFat::Mark( sal_Int32 nPage, sal_Int32 nCount, sal_Int32 nExpect ) { if( nCount > 0 ) - --nCount /= GetPageSize(), nCount++; + { + --nCount /= GetPageSize(); + nCount++; + } sal_Int32 nCurPage = nPage; while( nCount != 0 ) diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index a67a663..ffc27a4 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -110,8 +110,10 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs ) if( nTmpLen ) nTmpLen++; else - nTmpStart = i, + { + nTmpStart = i; nTmpLen = 1; + } if( nTmpLen == nPgs // If we already did find a block, stop when reaching the limit || ( bFound && ( nEntry >= m_nLimit ) ) ) @@ -120,12 +122,17 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs ) else if( nTmpLen ) { if( nTmpLen > nPgs && nTmpLen < nMaxLen ) + { // block > requested size - nMaxLen = nTmpLen, nMaxStart = nTmpStart, bFound = true; + nMaxLen = nTmpLen; + nMaxStart = nTmpStart; + bFound = true; + } else if( nTmpLen >= nMinLen ) { // block < requested size - nMinLen = nTmpLen, nMinStart = nTmpStart; + nMinLen = nTmpLen; + nMinStart = nTmpStart; bFound = true; if( nTmpLen == nPgs ) break; @@ -138,11 +145,17 @@ sal_Int32 StgFAT::FindBlock( sal_Int32& nPgs ) if( nTmpLen ) { if( nTmpLen > nPgs && nTmpLen < nMaxLen ) + { // block > requested size - nMaxLen = nTmpLen, nMaxStart = nTmpStart; + nMaxLen = nTmpLen; + nMaxStart = nTmpStart; + } else if( nTmpLen >= nMinLen ) + { // block < requested size - nMinLen = nTmpLen, nMinStart = nTmpStart; + nMinLen = nTmpLen; + nMinStart = nTmpStart; + } } if( nMinStart != STG_EOF && nMaxStart != STG_EOF ) { diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx index 9e5a5fc..beb21b1 100644 --- a/store/source/lockbyte.cxx +++ b/store/source/lockbyte.cxx @@ -490,7 +490,8 @@ struct FileMapping { // Release mapping. unmapFile (rMapping.m_hFile, rMapping.m_pAddr, rMapping.m_nSize); - rMapping.m_pAddr = nullptr, rMapping.m_nSize = 0; + rMapping.m_pAddr = nullptr; + rMapping.m_nSize = 0; } }; typedef UnmapFile destructor_type; @@ -556,7 +557,10 @@ void MappedLockBytes::allocate_Impl (void ** ppPage, sal_uInt16 * pnSize) { OSL_PRECOND((ppPage != nullptr) && (pnSize != nullptr), "contract violation"); if ((ppPage != nullptr) && (pnSize != nullptr)) - *ppPage = nullptr, *pnSize = m_nPageSize; + { + *ppPage = nullptr; + *pnSize = m_nPageSize; + } } void MappedLockBytes::deallocate_Impl (void * pPage) @@ -778,7 +782,8 @@ storeError MemoryLockBytes::setSize_Impl (sal_uInt32 nSize) if (nSize != 0) return store_E_OutOfMemory; } - m_pData = pData, m_nSize = nSize; + m_pData = pData; + m_nSize = nSize; } return store_E_None; } diff --git a/store/source/storbase.cxx b/store/source/storbase.cxx index 51f1ddf..df505d8 100644 --- a/store/source/storbase.cxx +++ b/store/source/storbase.cxx @@ -61,7 +61,8 @@ SharedCount::Allocator::Allocator() SharedCount::Allocator::~Allocator() { - rtl_cache_destroy (m_cache), m_cache = nullptr; + rtl_cache_destroy (m_cache); + m_cache = nullptr; } /*======================================================================== @@ -124,14 +125,18 @@ PageData::Allocator_Impl::initialize (sal_uInt16 nPageSize) PageData::Allocator_Impl::~Allocator_Impl() { - rtl_cache_destroy(m_page_cache), m_page_cache = nullptr; + rtl_cache_destroy(m_page_cache); + m_page_cache = nullptr; } void PageData::Allocator_Impl::allocate_Impl (void ** ppPage, sal_uInt16 * pnSize) { OSL_PRECOND((ppPage != nullptr) && (pnSize != nullptr), "contract violation"); if ((ppPage != nullptr) && (pnSize != nullptr)) - *ppPage = rtl_cache_alloc(m_page_cache), *pnSize = m_page_size; + { + *ppPage = rtl_cache_alloc(m_page_cache); + *pnSize = m_page_size; + } } void PageData::Allocator_Impl::deallocate_Impl (void * pPage) diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx index 7052b3f..564fe41 100644 --- a/store/source/storbios.cxx +++ b/store/source/storbios.cxx @@ -392,7 +392,8 @@ OStorePageBIOS::Ace::Ace() OStorePageBIOS::Ace::~Ace() { - m_next->m_prev = m_prev, m_prev->m_next = m_next; + m_next->m_prev = m_prev; + m_prev->m_next = m_next; } int @@ -485,7 +486,8 @@ OStorePageBIOS::AceCache::AceCache() OStorePageBIOS::AceCache::~AceCache() { - rtl_cache_destroy (m_ace_cache), m_ace_cache = nullptr; + rtl_cache_destroy (m_ace_cache); + m_ace_cache = nullptr; } OStorePageBIOS::Ace * @@ -510,7 +512,8 @@ OStorePageBIOS::AceCache::destroy (OStorePageBIOS::Ace * ace) if (ace != nullptr) { // remove from queue (if any). - ace->m_next->m_prev = ace->m_prev, ace->m_prev->m_next = ace->m_next; + ace->m_next->m_prev = ace->m_prev; + ace->m_prev->m_next = ace->m_next; // restore invariant state. ace->m_next = ace->m_prev = ace; @@ -667,7 +670,8 @@ void OStorePageBIOS::cleanup_Impl() } // Release SuperBlock page. - delete m_pSuper, m_pSuper = nullptr; + delete m_pSuper; + m_pSuper = nullptr; // Release PageCache. m_xCache.clear(); diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx index d0b6c05..af4ec4c 100644 --- a/store/source/storcach.cxx +++ b/store/source/storcach.cxx @@ -107,7 +107,8 @@ EntryCache::EntryCache() EntryCache::~EntryCache() { - rtl_cache_destroy (m_entry_cache), m_entry_cache = nullptr; + rtl_cache_destroy (m_entry_cache); + m_entry_cache = nullptr; } Entry * EntryCache::create (PageHolder const & rxPage, sal_uInt32 nOffset) @@ -142,16 +143,31 @@ static int highbit(sal_Size n) return 0; #if SAL_TYPES_SIZEOFLONG == 8 if (n & 0xffffffff00000000ul) - k |= 32, n >>= 32; + { + k |= 32; + n >>= 32; + } #endif if (n & 0xffff0000) - k |= 16, n >>= 16; + { + k |= 16; + n >>= 16; + } if (n & 0xff00) - k |= 8, n >>= 8; + { + k |= 8; + n >>= 8; + } if (n & 0xf0) - k |= 4, n >>= 4; + { + k |= 4; + n >>= 4; + } if (n & 0x0c) - k |= 2, n >>= 2; + { + k |= 2; + n >>= 2; + } if (n & 0x02) k++; @@ -183,7 +199,8 @@ PageCache::~PageCache() Entry * entry = m_hash_table[i]; while (entry != nullptr) { - m_hash_table[i] = entry->m_pNext, entry->m_pNext = nullptr; + m_hash_table[i] = entry->m_pNext; + entry->m_pNext = nullptr; EntryCache::get().destroy (entry); entry = m_hash_table[i]; x += 1; @@ -234,7 +251,8 @@ void PageCache::rescale_Impl (sal_Size new_size) { Entry * next = curr->m_pNext; int index = hash_index_Impl(curr->m_nOffset); - curr->m_pNext = m_hash_table[index], m_hash_table[index] = curr; + curr->m_pNext = m_hash_table[index]; + m_hash_table[index] = curr; curr = next; } old_table[i] = nullptr; @@ -314,7 +332,8 @@ storeError PageCache::insertPageAt (PageHolder const & rxPage, sal_uInt32 nOffse { // Insert new entry. int index = hash_index_Impl(nOffset); - entry->m_pNext = m_hash_table[index], m_hash_table[index] = entry; + entry->m_pNext = m_hash_table[index]; + m_hash_table[index] = entry; // Update stats and leave. m_hash_entries += 1; @@ -368,7 +387,8 @@ storeError PageCache::removePageAt (sal_uInt32 nOffset) Entry * entry = (*ppEntry); // Dequeue and destroy entry. - (*ppEntry) = entry->m_pNext, entry->m_pNext = nullptr; + (*ppEntry) = entry->m_pNext; + entry->m_pNext = nullptr; EntryCache::get().destroy (entry); // Update stats and leave. diff --git a/store/source/storpage.cxx b/store/source/storpage.cxx index 2892908..0f559b4 100644 --- a/store/source/storpage.cxx +++ b/store/source/storpage.cxx @@ -190,7 +190,8 @@ storeError OStorePageManager::remove_Impl (entry & rEntry) xNext.swap (xPage); // Check index. - i = xPage->find (rEntry), n = xPage->usageCount(); + i = xPage->find (rEntry); + n = xPage->usageCount(); if (!(i < n)) { // Path to entry not exists (Must not happen(?)). diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 5f1bde5..1f77288 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -637,7 +637,8 @@ void SfxItemSet::SetRanges( const sal_uInt16 *pNewRanges ) { if ( !*pOld && !*pNew ) return; - ++pOld, ++pNew; + ++pOld; + ++pNew; } // create new item-array (by iterating through all new ranges) diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 2cbf054..1a3cfad 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -1902,9 +1902,15 @@ void BrowseBox::Dispatch( sal_uInt16 nId ) sal_uInt16 nNewPos = GetColumnPos(nColId); bool bMoveAllowed = false; if ( BROWSER_MOVECOLUMNLEFT == nId && nNewPos > 1 ) - --nNewPos,bMoveAllowed = true; + { + --nNewPos; + bMoveAllowed = true; + } else if ( BROWSER_MOVECOLUMNRIGHT == nId && nNewPos < (ColCount()-1) ) - ++nNewPos,bMoveAllowed = true; + { + ++nNewPos; + bMoveAllowed = true; + } if ( bMoveAllowed ) { diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx index e001b3f..5490209 100644 --- a/svtools/source/contnr/imivctl2.cxx +++ b/svtools/source/contnr/imivctl2.cxx @@ -538,7 +538,8 @@ IcnGridMap_Impl::IcnGridMap_Impl(SvxIconChoiceCtrl_Impl* pView) IcnGridMap_Impl::~IcnGridMap_Impl() { - delete[] _pGridMap, _pGridMap=nullptr; + delete[] _pGridMap; + _pGridMap = nullptr; } void IcnGridMap_Impl::Expand() @@ -719,7 +720,8 @@ void IcnGridMap_Impl::Clear() { if( _pGridMap ) { - delete[] _pGridMap, _pGridMap=nullptr; + delete[] _pGridMap; + _pGridMap = nullptr; _nGridRows = 0; _nGridCols = 0; _aLastOccupiedGrid.SetEmpty(); diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index 4f46e0c..5c06d6a 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -391,7 +391,8 @@ void ExportDialog::GetGraphicStream() { if ( !IsTempExportAvailable() ) { - delete mpTempStream, mpTempStream = new SvMemoryStream(); + delete mpTempStream; + mpTempStream = new SvMemoryStream(); maBitmap = Bitmap(); return; } @@ -409,7 +410,8 @@ void ExportDialog::GetGraphicStream() { if ( bRecreateOutputStream ) { - delete mpTempStream, mpTempStream = new SvMemoryStream(); + delete mpTempStream; + mpTempStream = new SvMemoryStream(); maBitmap = Bitmap(); uno::Reference < io::XStream > xStream( new utl::OStreamWrapper( *mpTempStream ) ); diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx index e8fdfe1..623e7b1 100644 --- a/svtools/source/graphic/grfcache.cxx +++ b/svtools/source/graphic/grfcache.cxx @@ -208,13 +208,22 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj ) const Graphic& rGraphic = rObj.GetGraphic(); if( mpBmpEx ) - delete mpBmpEx, mpBmpEx = nullptr; + { + delete mpBmpEx; + mpBmpEx = nullptr; + } if( mpMtf ) - delete mpMtf, mpMtf = nullptr; + { + delete mpMtf; + mpMtf = nullptr; + } if( mpAnimation ) - delete mpAnimation, mpAnimation = nullptr; + { + delete mpAnimation; + mpAnimation = nullptr; + } switch( rGraphic.GetType() ) { @@ -361,9 +370,12 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj* if( mbSwappedAll ) { - delete mpBmpEx, mpBmpEx = nullptr; - delete mpMtf, mpMtf = nullptr; - delete mpAnimation, mpAnimation = nullptr; + delete mpBmpEx; + mpBmpEx = nullptr; + delete mpMtf; + mpMtf = nullptr; + delete mpAnimation; + mpAnimation = nullptr; // #119176# also reset SvgData maSvgData.reset(); diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 74346e9..95182e1 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -126,7 +126,10 @@ GraphicObject::~GraphicObject() mpMgr->ImplUnregisterObj( *this ); if( ( mpMgr == mpGlobalMgr ) && !mpGlobalMgr->ImplHasObjects() ) - delete mpGlobalMgr, mpGlobalMgr = nullptr; + { + delete mpGlobalMgr; + mpGlobalMgr = nullptr; + } } delete mpSwapOutTimer; @@ -177,7 +180,10 @@ void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const OSt mpMgr->ImplUnregisterObj( *this ); if( ( mpMgr == mpGlobalMgr ) && !mpGlobalMgr->ImplHasObjects() ) - delete mpGlobalMgr, mpGlobalMgr = nullptr; + { + delete mpGlobalMgr; + mpGlobalMgr = nullptr; + } } if( !pMgr ) @@ -350,7 +356,8 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj ) mpMgr->ImplUnregisterObj( *this ); maSwapStreamHdl = Link<const GraphicObject*, SvStream*>(); - delete mpSimpleCache, mpSimpleCache = nullptr; + delete mpSimpleCache; + mpSimpleCache = nullptr; maGraphic = rGraphicObj.GetGraphic(); maAttr = rGraphicObj.maAttr; @@ -400,7 +407,10 @@ void GraphicObject::SetAttr( const GraphicAttr& rAttr ) maAttr = rAttr; if( mpSimpleCache && ( mpSimpleCache->maAttr != rAttr ) ) - delete mpSimpleCache, mpSimpleCache = nullptr; + { + delete mpSimpleCache; + mpSimpleCache = nullptr; + } } void GraphicObject::SetLink() @@ -454,7 +464,10 @@ void GraphicObject::SetSwapStreamHdl(const Link<const GraphicObject*, SvStream*> mpSwapOutTimer->Start(); } else - delete mpSwapOutTimer, mpSwapOutTimer = nullptr; + { + delete mpSwapOutTimer; + mpSwapOutTimer = nullptr; + } } void GraphicObject::FireSwapInRequest() @@ -684,7 +697,8 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic, const GraphicObject* pC mbAutoSwapped = false; ImplAssignGraphicData(); maLink.clear(); - delete mpSimpleCache, mpSimpleCache = nullptr; + delete mpSimpleCache; + mpSimpleCache = nullptr; mpMgr->ImplRegisterObj( *this, maGraphic, nullptr, pCopyObj); diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index 7ffb467..fc9d819 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -478,8 +478,10 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib if( ( nUnRotX >= 0L ) && ( nUnRotX < aUnrotatedWidth ) && ( nUnRotY >= 0L ) && ( nUnRotY < aUnrotatedHeight ) ) { - nTmpX = pMapIX[ nUnRotX ]; nTmpFX = pMapFX[ nUnRotX ]; - nTmpY = pMapIY[ nUnRotY ], nTmpFY = pMapFY[ nUnRotY ]; + nTmpX = pMapIX[ nUnRotX ]; + nTmpFX = pMapFX[ nUnRotX ]; + nTmpY = pMapIY[ nUnRotY ]; + nTmpFY = pMapFY[ nUnRotY ]; const BitmapColor& rCol0 = pReadAccess->GetPaletteColor( pReadAccess->GetPixelIndex( nTmpY, nTmpX ) ); const BitmapColor& rCol1 = pReadAccess->GetPaletteColor( pReadAccess->GetPixelIndex( nTmpY, ++nTmpX ) ); @@ -518,8 +520,10 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib if( ( nUnRotX >= 0L ) && ( nUnRotX < aUnrotatedWidth ) && ( nUnRotY >= 0L ) && ( nUnRotY < aUnrotatedHeight ) ) { - nTmpX = pMapIX[ nUnRotX ]; nTmpFX = pMapFX[ nUnRotX ]; - nTmpY = pMapIY[ nUnRotY ], nTmpFY = pMapFY[ nUnRotY ]; + nTmpX = pMapIX[ nUnRotX ]; + nTmpFX = pMapFX[ nUnRotX ]; + nTmpY = pMapIY[ nUnRotY ]; + nTmpFY = pMapFY[ nUnRotY ]; aCol0 = pReadAccess->GetPixel( nTmpY, nTmpX ); aCol1 = pReadAccess->GetPixel( nTmpY, ++nTmpX ); @@ -643,7 +647,8 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib for( long nY = 0; nY < aTargetHeight; nY++ ) { - nSinY = pSinY[ nY ], nCosY = pCosY[ nY ]; + nSinY = pSinY[ nY ]; + nCosY = pCosY[ nY ]; pLineW = pWriteAccess->GetScanline( nY ); for( long nX = 0; nX < aTargetWidth; nX++ ) @@ -654,8 +659,10 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib if( ( nUnRotX >= 0L ) && ( nUnRotX < aUnrotatedWidth ) && ( nUnRotY >= 0L ) && ( nUnRotY < aUnrotatedHeight ) ) { - nTmpX = pMapIX[ nUnRotX ], nTmpFX = pMapFX[ nUnRotX ]; - nTmpY = pMapIY[ nUnRotY ], nTmpFY = pMapFY[ nUnRotY ]; + nTmpX = pMapIX[ nUnRotX ]; + nTmpFX = pMapFX[ nUnRotX ]; + nTmpY = pMapIY[ nUnRotY ]; + nTmpFY = pMapFY[ nUnRotY ]; pLine0 = pReadAccess->GetScanline( nTmpY++ ); pLine1 = pReadAccess->GetScanline( nTmpY ); @@ -740,7 +747,8 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib for( long nY = 0; nY < aTargetHeight; nY++ ) { - nSinY = pSinY[ nY ], nCosY = pCosY[ nY ]; + nSinY = pSinY[ nY ]; + nCosY = pCosY[ nY ]; for( long nX = 0; nX < aTargetWidth; nX++ ) { @@ -750,8 +758,10 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib if( ( nUnRotX >= 0L ) && ( nUnRotX < aUnrotatedWidth ) && ( nUnRotY >= 0L ) && ( nUnRotY < aUnrotatedHeight ) ) { - nTmpX = pMapIX[ nUnRotX ]; nTmpFX = pMapFX[ nUnRotX ]; - nTmpY = pMapIY[ nUnRotY ], nTmpFY = pMapFY[ nUnRotY ]; + nTmpX = pMapIX[ nUnRotX ]; + nTmpFX = pMapFX[ nUnRotX ]; + nTmpY = pMapIY[ nUnRotY ]; + nTmpFY = pMapFY[ nUnRotY ]; const long nAlpha0 = pReadAccess->GetPixel( nTmpY, nTmpX ).GetIndex(); const long nAlpha1 = pReadAccess->GetPixel( nTmpY, ++nTmpX ).GetIndex(); diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index af105c1..4efd3d8 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -664,8 +664,16 @@ void EmbeddedObjectRef::DrawPaintReplacement( const Rectangle &rRect, const OUSt aPt.Y() = (rRect.GetHeight() - pOut->GetTextHeight()) / 2; bool bTiny = false; - if( aPt.X() < 0 ) bTiny = true, aPt.X() = 0; - if( aPt.Y() < 0 ) bTiny = true, aPt.Y() = 0; + if( aPt.X() < 0 ) + { + bTiny = true; + aPt.X() = 0; + } + if( aPt.Y() < 0 ) + { + bTiny = true; + aPt.Y() = 0; + } if( bTiny ) { // decrease for small images diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index dc79ac6..d4761af 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -1181,8 +1181,10 @@ TransferableDataHelper& TransferableDataHelper::operator=( const TransferableDat StopClipboardListening(); mxTransfer = rDataHelper.mxTransfer; - delete mpFormats, mpFormats = new DataFlavorExVector( *rDataHelper.mpFormats ); - delete mpObjDesc, mpObjDesc = new TransferableObjectDescriptor( *rDataHelper.mpObjDesc ); + delete mpFormats; + mpFormats = new DataFlavorExVector( *rDataHelper.mpFormats ); + delete mpObjDesc; + mpObjDesc = new TransferableObjectDescriptor( *rDataHelper.mpObjDesc ); mxClipboard = rDataHelper.mxClipboard; if ( bWasClipboardListening ) @@ -1198,8 +1200,10 @@ TransferableDataHelper::~TransferableDataHelper() StopClipboardListening( ); { ::osl::MutexGuard aGuard( mpImpl->maMutex ); - delete mpFormats, mpFormats = nullptr; - delete mpObjDesc, mpObjDesc = nullptr; + delete mpFormats; + mpFormats = nullptr; + delete mpObjDesc; + mpObjDesc = nullptr; } } @@ -1303,7 +1307,8 @@ void TransferableDataHelper::InitFormats() ::osl::MutexGuard aGuard( mpImpl->maMutex ); mpFormats->clear(); - delete mpObjDesc, mpObjDesc = new TransferableObjectDescriptor; + delete mpObjDesc; + mpObjDesc = new TransferableObjectDescriptor; if( mxTransfer.is() ) { diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index d1a081b..0ac318c 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -1502,12 +1502,16 @@ const HTMLOptions& HTMLParser::GetOptions( sal_uInt16 *pNoConvertToken ) if( bStripCRLF ) aToken = aToken.replaceAt( nPos, 1, "" ); else - nPos++, nLen++; + { + nPos++; + nLen++; + } break; case '\\': if( bOldEscape ) { - nPos++, nLen++; + nPos++; + nLen++; } else { @@ -1519,10 +1523,14 @@ const HTMLOptions& HTMLParser::GetOptions( sal_uInt16 *pNoConvertToken ) case '\'': bDone = !bOldEscape && cChar==cEnd; if( !bDone ) - nPos++, nLen++; + { + nPos++; + nLen++; + } break; default: - nPos++, nLen++; + nPos++; + nLen++; break; } } @@ -1544,7 +1552,10 @@ const HTMLOptions& HTMLParser::GetOptions( sal_uInt16 *pNoConvertToken ) case ' ': bDone = !bOldEscape; if( !bDone ) - nPos++, nLen++; + { + nPos++; + nLen++; + } break; case '\t': @@ -1556,7 +1567,8 @@ const HTMLOptions& HTMLParser::GetOptions( sal_uInt16 *pNoConvertToken ) case '\\': if( bOldEscape ) { - nPos++, nLen++; + nPos++; + nLen++; } else { @@ -1567,7 +1579,10 @@ const HTMLOptions& HTMLParser::GetOptions( sal_uInt16 *pNoConvertToken ) default: if( HTML_ISPRINTABLE( c ) ) - nPos++, nLen++; + { + nPos++; + nLen++; + } else bDone = true; break; diff --git a/svx/source/accessibility/AccessibleShapeTreeInfo.cxx b/svx/source/accessibility/AccessibleShapeTreeInfo.cxx index 6652143..214725c 100644 --- a/svx/source/accessibility/AccessibleShapeTreeInfo.cxx +++ b/svx/source/accessibility/AccessibleShapeTreeInfo.cxx @@ -56,7 +56,7 @@ AccessibleShapeTreeInfo& AccessibleShapeTreeInfo::operator= (const AccessibleSha mxDocumentWindow = rInfo.mxDocumentWindow; mxModelBroadcaster = rInfo.mxModelBroadcaster; mpView = rInfo.mpView; - mxController = rInfo.mxController, + mxController = rInfo.mxController; mpWindow = rInfo.mpWindow; mpViewForwarder = rInfo.mpViewForwarder; } diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index cd54857..47b5dab 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -621,7 +621,8 @@ GalleryTheme* Gallery::ImplGetCachedTheme(const GalleryThemeEntry* pThemeEntry) if( pIStm->GetError() ) { - delete pTheme, pTheme = nullptr; + delete pTheme; + pTheme = nullptr; } } catch (const css::ucb::ContentCreationException&) diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 2925883..025b101 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -454,7 +454,10 @@ void GalleryTransferable::InitData( bool bLazy ) mpURL = new INetURLObject; if( !mpTheme->GetURL( mnObjectPos, *mpURL ) ) - delete mpURL, mpURL = nullptr; + { + delete mpURL; + mpURL = nullptr; + } } if( ( SGA_OBJ_SOUND != meObjectKind ) && !mpGraphicObject ) @@ -570,9 +573,12 @@ void GalleryTransferable::DragFinished( sal_Int8 nDropAction ) void GalleryTransferable::ObjectReleased() { mxModelStream.Clear(); - delete mpGraphicObject, mpGraphicObject = nullptr; - delete mpImageMap, mpImageMap = nullptr; - delete mpURL, mpURL = nullptr; + delete mpGraphicObject; + mpGraphicObject = nullptr; + delete mpImageMap; + mpImageMap = nullptr; + delete mpURL; + mpURL = nullptr; } void GalleryTransferable::CopyToClipboard( vcl::Window* pWindow ) diff --git a/svx/source/items/grfitem.cxx b/svx/source/items/grfitem.cxx index b033f8f..e4cfffc 100644 --- a/svx/source/items/grfitem.cxx +++ b/svx/source/items/grfitem.cxx @@ -56,7 +56,12 @@ SfxPoolItem* SvxGrfCrop::Create( SvStream& rStrm, sal_uInt16 nVersion ) const rStrm.ReadInt32( top ).ReadInt32( left ).ReadInt32( right ).ReadInt32( bottom ); if( GRFCROP_VERSION_SWDEFAULT == nVersion ) - top = -top, bottom = -bottom, left = -left, right = -right; + { + top = -top; + bottom = -bottom; + left = -left; + right = -right; + } SvxGrfCrop* pNew = static_cast<SvxGrfCrop*>(Clone()); pNew->SetLeft( left ); @@ -72,7 +77,12 @@ SvStream& SvxGrfCrop::Store( SvStream& rStrm, sal_uInt16 nVersion ) const sal_Int32 left = GetLeft(), right = GetRight(), top = GetTop(), bottom = GetBottom(); if( GRFCROP_VERSION_SWDEFAULT == nVersion ) - top = -top, bottom = -bottom, left = -left, right = -right; + { + top = -top; + bottom = -bottom; + left = -left; + right = -right; + } rStrm.WriteInt32( top ).WriteInt32( left ).WriteInt32( right ).WriteInt32( bottom ); diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index b5ac4d8..26165e8 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -109,7 +109,8 @@ ImplGrafMetricField::ImplGrafMetricField( vcl::Window* pParent, const OUString& { Size aSize( GetTextWidth( "-100 %" ), GetTextHeight() ); - aSize.Width() += 20, aSize.Height() += 6; + aSize.Width() += 20; + aSize.Height() += 6; SetSizePixel( aSize ); if ( maCommand == ".uno:GrafGamma" ) @@ -274,9 +275,15 @@ ImplGrafControl::ImplGrafControl( SetBackground( Wallpaper( COL_TRANSPARENT ) ); if( aImgSize.Height() > aFldSize.Height() ) - nImgY = 0, nFldY = ( aImgSize.Height() - aFldSize.Height() ) >> 1; + { + nImgY = 0; + nFldY = ( aImgSize.Height() - aFldSize.Height() ) >> 1; + } else - nFldY = 0, nImgY = ( aFldSize.Height() - aImgSize.Height() ) >> 1; + { + nFldY = 0; + nImgY = ( aFldSize.Height() - aImgSize.Height() ) >> 1; + } long nOffset = SYMBOL_TO_FIELD_OFFSET / 2; maImage->SetPosPixel( Point( nOffset, nImgY ) ); diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index f341bf4..88782db 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -235,7 +235,8 @@ SvxShape::~SvxShape() throw() SdrObject::Free( pObject ); } - delete mpImpl, mpImpl = nullptr; + delete mpImpl; + mpImpl = nullptr; EndListeningAll(); // call explictily within SolarMutexGuard } diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 58cd9b4..9a5ee24 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -336,8 +336,10 @@ const GraphicObject& SvXMLGraphicOutputStream::GetGraphicObject() maGrfObj = aGraphic; if( maGrfObj.GetType() != GRAPHIC_NONE ) { - delete mpOStm, mpOStm = nullptr; - delete mpTmp, mpTmp = nullptr; + delete mpOStm; + mpOStm = nullptr; + delete mpTmp; + mpTmp = nullptr; } } diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx b/toolkit/source/controls/geometrycontrolmodel.cxx index 79da293..f4cc7cd 100644 --- a/toolkit/source/controls/geometrycontrolmodel.cxx +++ b/toolkit/source/controls/geometrycontrolmodel.cxx @@ -550,8 +550,8 @@ // -> remove from the aggregate property sequence ::comphelper::removeElementAt( aAggregateProps, pAggPropPos - pAggProps ); // which means we have to adjust the pointers - pAggProps = aAggregateProps.getConstArray(), - pAggPropsEnd = aAggregateProps.getConstArray() + aAggregateProps.getLength(), + pAggProps = aAggregateProps.getConstArray(); + pAggPropsEnd = aAggregateProps.getConstArray() + aAggregateProps.getLength(); // and additionally, remember the id of this property rDuplicateIds.push_back( pProp->Handle ); diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 4bfec2e..52c4c5c 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -768,8 +768,12 @@ Polygon::Polygon( const Point& rBezPt1, const Point& rCtrlPt1, { Point& rPt = mpImplPolygon->mpPointAry[ i ]; - fK_2 = fK_1, fK_3 = ( fK_2 *= fK_1 ), fK_3 *= fK_1; - fK1_2 = fK1_1, fK1_3 = ( fK1_2 *= fK1_1 ), fK1_3 *= fK1_1; + fK_2 = fK_1; + fK_3 = ( fK_2 *= fK_1 ); + fK_3 *= fK_1; + fK1_2 = fK1_1; + fK1_3 = ( fK1_2 *= fK1_1 ); + fK1_3 *= fK1_1; double fK12 = fK_1 * fK1_2; double fK21 = fK_2 * fK1_1; @@ -1129,7 +1133,7 @@ private: public: explicit Vector2D( const Point& rPair ) : mfX( rPair.A() ), mfY( rPair.B() ) {}; double GetLength() const { return hypot( mfX, mfY ); } - Vector2D& operator-=( const Vector2D& rVec ) { mfX -= rVec.mfX, mfY -= rVec.mfY; return *this; } + Vector2D& operator-=( const Vector2D& rVec ) { mfX -= rVec.mfX; mfY -= rVec.mfY; return *this; } double Scalar( const Vector2D& rVec ) const { return mfX * rVec.mfX + mfY * rVec.mfY ; } Vector2D& Normalize(); bool IsPositive( Vector2D& rVec ) const { return ( mfX * rVec.mfY - mfY * rVec.mfX ) >= 0.0; } @@ -1140,7 +1144,10 @@ Vector2D& Vector2D::Normalize() double fLen = Scalar( *this ); ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits