diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-19 08:12:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-19 10:02:39 +0200 |
commit | 2c1b7e8d6a7fa22cb91919238418816671c3a497 (patch) | |
tree | 6f356017d24dffcd25261295ab25a21b738dc835 /svx | |
parent | ad18bb24d51e4f735085d50c496d28bd637dbb0b (diff) |
clang-tidy readability-container-size-empty
Change-Id: I1df70b7dff5ebb6048f7fc618789faa15ca5d422
Reviewed-on: https://gerrit.libreoffice.org/61967
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx | 2 | ||||
-rw-r--r-- | svx/source/form/fmshimp.cxx | 4 | ||||
-rw-r--r-- | svx/source/form/navigatortree.cxx | 6 | ||||
-rw-r--r-- | svx/source/sdr/attribute/sdrallfillattributeshelper.cxx | 4 | ||||
-rw-r--r-- | svx/source/sdr/contact/viewcontactofe3d.cxx | 2 | ||||
-rw-r--r-- | svx/source/sdr/overlay/overlaymanager.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdfmtf.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextpathdecomposition.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdpdf.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdxcgv.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/tablertfimporter.cxx | 2 |
13 files changed, 18 insertions, 18 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx index 728bf2cca437..61d2be064b0b 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -817,7 +817,7 @@ public: { ParserContext::OperandStack& rNodeStack( mxContext->maOperandStack ); - if( rNodeStack.size() < 1 ) + if( rNodeStack.empty() ) throw ParseError( "Not enough arguments for unary operator" ); // retrieve arguments diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 0eb340933404..0709e3eec852 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -821,7 +821,7 @@ void FmXFormShell::invalidateFeatures( const ::std::vector< sal_Int32 >& _rFeatu if (impl_checkDisposed_Lock()) return; - OSL_ENSURE( _rFeatures.size() > 0, "FmXFormShell::invalidateFeatures: invalid arguments!" ); + OSL_ENSURE( !_rFeatures.empty(), "FmXFormShell::invalidateFeatures: invalid arguments!" ); if ( m_pShell->GetViewShell() && m_pShell->GetViewShell()->GetViewFrame() ) { @@ -889,7 +889,7 @@ void FmXFormShell::disposing() CloseExternalFormViewer_Lock(); - while ( m_aLoadingPages.size() ) + while ( !m_aLoadingPages.empty() ) { Application::RemoveUserEvent( m_aLoadingPages.front().nEventId ); m_aLoadingPages.pop(); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 1a9291bf55a0..e1761279fdd4 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -348,7 +348,7 @@ namespace svxform bool bSingleSelection = (m_arrCurrentSelection.size() == 1); - DBG_ASSERT( (m_arrCurrentSelection.size() > 0) || m_bRootSelected, "no entries selected" ); + DBG_ASSERT( (!m_arrCurrentSelection.empty()) || m_bRootSelected, "no entries selected" ); // shouldn't happen, because I would have selected one during call to IsSelected, // if there was none before @@ -774,7 +774,7 @@ namespace svxform // List of dropped entries from DragServer const ListBoxEntrySet& aDropped = m_aControlExchange->selected(); - DBG_ASSERT(aDropped.size() >= 1, "NavigatorTree::implAcceptDataTransfer: no entries !"); + DBG_ASSERT(!aDropped.empty(), "NavigatorTree::implAcceptDataTransfer: no entries !"); bool bDropTargetIsComponent = IsFormComponentEntry( _pTargetEntry ); //SvTreeListEntry* pDropTargetParent = GetParent( _pTargetEntry ); @@ -1012,7 +1012,7 @@ namespace svxform // list of dragged entries ListBoxEntrySet aDropped = _rData.selected(); - DBG_ASSERT(aDropped.size() >= 1, "NavigatorTree::implExecuteDataTransfer: no entries!"); + DBG_ASSERT(!aDropped.empty(), "NavigatorTree::implExecuteDataTransfer: no entries!"); // shell and model FmFormShell* pFormShell = GetNavModel()->GetFormShell(); diff --git a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx index 0c6067cd3efd..78e136b652ae 100644 --- a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx +++ b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx @@ -139,12 +139,12 @@ namespace drawinglayer const basegfx::B2DRange& rPaintRange, const basegfx::B2DRange& rDefineRange) const { - if(maPrimitives.size() && (maLastPaintRange != rPaintRange || maLastDefineRange != rDefineRange)) + if(!maPrimitives.empty() && (maLastPaintRange != rPaintRange || maLastDefineRange != rDefineRange)) { const_cast< SdrAllFillAttributesHelper* >(this)->maPrimitives.clear(); } - if(!maPrimitives.size()) + if(maPrimitives.empty()) { const_cast< SdrAllFillAttributesHelper* >(this)->createPrimitive2DSequence(rPaintRange, rDefineRange); } diff --git a/svx/source/sdr/contact/viewcontactofe3d.cxx b/svx/source/sdr/contact/viewcontactofe3d.cxx index 253bdea07f30..c32e823b1ca3 100644 --- a/svx/source/sdr/contact/viewcontactofe3d.cxx +++ b/svx/source/sdr/contact/viewcontactofe3d.cxx @@ -88,7 +88,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfE3d::impCreateWithG const basegfx::B3DRange& rAllContentRange = pVCOfE3DScene->getAllContentRange3D(); drawinglayer::geometry::ViewInformation3D aViewInformation3D(pVCOfE3DScene->getViewInformation3D()); - if(pVCOfE3DScene->getSdrLightingAttribute().getLightVector().size()) + if(!pVCOfE3DScene->getSdrLightingAttribute().getLightVector().empty()) { // get light normal from first light and normalize aLightNormal = pVCOfE3DScene->getSdrLightingAttribute().getLightVector()[0].getDirection(); diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx index c3fa222b83ed..3660598a23f7 100644 --- a/svx/source/sdr/overlay/overlaymanager.cxx +++ b/svx/source/sdr/overlay/overlaymanager.cxx @@ -239,7 +239,7 @@ namespace sdr void OverlayManager::completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice) const { - if(!rRegion.IsEmpty() && maOverlayObjects.size()) + if(!rRegion.IsEmpty() && !maOverlayObjects.empty()) { // check for changed MapModes. That may influence the // logical size of pixel based OverlayObjects (like BitmapHandles) diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 43f951527d8c..4f856c588dc8 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -705,7 +705,7 @@ void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlay } // #i54102# if there are edges, reconnect their ends to the corresponding clones (if found) - if(aEdges.size()) + if(!aEdges.empty()) { for(SdrEdgeObj* pSdrEdgeObj: aEdges) { diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index b74dde640e4e..e5338d43085b 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -850,7 +850,7 @@ void SdrEditView::DeleteMarkedObj() GetMarkedObjectListWriteAccess().Clear(); maHdlList.Clear(); - while(aParents.size() && !GetMarkedObjectCount()) + while(!aParents.empty() && !GetMarkedObjectCount()) { // iterate over remembered parents SdrObject* pParent = aParents.back(); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 72347de60639..6ea58083d472 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -792,7 +792,7 @@ bool ImpSdrGDIMetaFileImport::CheckLastLineMerge(const basegfx::B2DPolygon& rSrc // #i73407# reformulation to use new B2DPolygon classes if(mbLastObjWasLine && (maOldLineColor == mpVD->GetLineColor()) && rSrcPoly.count()) { - SdrObject* pTmpObj = maTmpList.size() ? maTmpList[maTmpList.size() - 1] : nullptr; + SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1] : nullptr; SdrPathObj* pLastPoly = dynamic_cast< SdrPathObj* >(pTmpObj); if(pLastPoly) @@ -858,7 +858,7 @@ bool ImpSdrGDIMetaFileImport::CheckLastPolyLineAndFillMerge(const basegfx::B2DPo // #i73407# reformulation to use new B2DPolygon classes if(mbLastObjWasPolyWithoutLine) { - SdrObject* pTmpObj = maTmpList.size() ? maTmpList[maTmpList.size() - 1] : nullptr; + SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1] : nullptr; SdrPathObj* pLastPoly = dynamic_cast< SdrPathObj* >(pTmpObj); if(pLastPoly) diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index 9346c9f86c58..770bd440a86a 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -477,7 +477,7 @@ namespace const sal_Int32 nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen)); ::std::vector< double > aNewDXArray; - if(nNextGlyphLen > 1 && pCandidate->getDoubleDXArray().size()) + if(nNextGlyphLen > 1 && !pCandidate->getDoubleDXArray().empty()) { // copy DXArray for portion aNewDXArray.insert( diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 5c739744c285..881880255f90 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -691,7 +691,7 @@ bool ImpSdrPdfImport::CheckLastPolyLineAndFillMerge(const basegfx::B2DPolyPolygo // #i73407# reformulation to use new B2DPolygon classes if (mbLastObjWasPolyWithoutLine) { - SdrObject* pTmpObj = maTmpList.size() ? maTmpList[maTmpList.size() - 1] : nullptr; + SdrObject* pTmpObj = !maTmpList.empty() ? maTmpList[maTmpList.size() - 1] : nullptr; SdrPathObj* pLastPoly = dynamic_cast<SdrPathObj*>(pTmpObj); if (pLastPoly) diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index c722484602aa..db929f86af57 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -699,7 +699,7 @@ void SdrExchangeView::DrawMarkedObj(OutputDevice& rOut) const { ::std::vector< SdrObject* > aSdrObjects(GetMarkedObjects()); - if(aSdrObjects.size()) + if(!aSdrObjects.empty()) { sdr::contact::ObjectContactOfObjListPainter aPainter(rOut, aSdrObjects, aSdrObjects[0]->getSdrPageFromSdrObject()); sdr::contact::DisplayInfo aDisplayInfo; diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index 55c5fdfdc01d..29fe40b58620 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -238,7 +238,7 @@ void SdrTableRTFParser::InsertCell( RtfImportInfo const * pInfo ) RTFColumnVectorPtr xColumn( maRows.back() ); if ( xCellInfo->mxVMergeCell ) { - if ( xColumn->size()==0 || + if ( xColumn->empty() || xColumn->back()->mxVMergeCell != xCellInfo->mxVMergeCell ) xCellInfo->mxVMergeCell->mnRowSpan++; } |