diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-05-03 22:11:02 +0300 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-05-17 11:20:15 +0200 |
commit | 0e4c542f7a862e681baf25f042bc3a928c14004f (patch) | |
tree | 56582ddb40671a22eaaa54e1ab3058dc553b9d5d /reportdesign | |
parent | 644ca26af744aec1e66c8dd4199d1228e0f780be (diff) |
Use hasElements to check Sequence emptiness in [l-r]*
Similar to clang-tidy readability-container-size-empty
Change-Id: Idd67f332b04857a39df26bad1733aae21236f105
Reviewed-on: https://gerrit.libreoffice.org/71764
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlControlProperty.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlExport.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/GroupExchange.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/GroupsSorting.cxx | 8 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/Navigator.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 16 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportSection.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ViewsWindow.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/propbrw.cxx | 4 |
10 files changed, 21 insertions, 21 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index dc2f6f6ba06c..67f74d58458f 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1133,7 +1133,7 @@ void OReportDefinition::fillArgs(utl::MediaDescriptor& _aDescriptor) { uno::Sequence<beans::PropertyValue> aComponentData; aComponentData = _aDescriptor.getUnpackedValueOrDefault("ComponentData",aComponentData); - if ( aComponentData.getLength() && (!m_pImpl->m_xActiveConnection.is() || !m_pImpl->m_xNumberFormatsSupplier.is()) ) + if ( aComponentData.hasElements() && (!m_pImpl->m_xActiveConnection.is() || !m_pImpl->m_xNumberFormatsSupplier.is()) ) { ::comphelper::SequenceAsHashMap aComponentDataMap( aComponentData ); m_pImpl->m_xActiveConnection = aComponentDataMap.getUnpackedValueOrDefault("ActiveConnection",m_pImpl->m_xActiveConnection); diff --git a/reportdesign/source/filter/xml/xmlControlProperty.cxx b/reportdesign/source/filter/xml/xmlControlProperty.cxx index a844ae79f149..df7b9b2444a4 100644 --- a/reportdesign/source/filter/xml/xmlControlProperty.cxx +++ b/reportdesign/source/filter/xml/xmlControlProperty.cxx @@ -151,7 +151,7 @@ void OXMLControlProperty::EndElement() { if ( !m_aSetting.Name.isEmpty() && m_xControl.is() ) { - if ( m_bIsList && !m_aSequence.getLength() ) + if ( m_bIsList && !m_aSequence.hasElements() ) m_aSetting.Value <<= m_aSequence; try { diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index a907b3c237c1..2139827e4d13 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -347,7 +347,7 @@ void ORptExport::exportFunction(const uno::Reference< XFunction>& _xFunction) void ORptExport::exportMasterDetailFields(const Reference<XReportComponent>& _xReportComponet) { const uno::Sequence< OUString> aMasterFields = _xReportComponet->getMasterFields(); - if ( aMasterFields.getLength() ) + if ( aMasterFields.hasElements() ) { SvXMLElementExport aElement(*this,XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELDS, true, true); const uno::Sequence< OUString> aDetailFields = _xReportComponet->getDetailFields(); diff --git a/reportdesign/source/ui/dlg/GroupExchange.cxx b/reportdesign/source/ui/dlg/GroupExchange.cxx index 980f8f26d077..a3017a6a7069 100644 --- a/reportdesign/source/ui/dlg/GroupExchange.cxx +++ b/reportdesign/source/ui/dlg/GroupExchange.cxx @@ -43,7 +43,7 @@ namespace rptui void OGroupExchange::AddSupportedFormats() { - if ( m_aGroupRow.getLength() ) + if ( m_aGroupRow.hasElements() ) { AddFormat(OGroupExchange::getReportGroupId()); } diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index a12479660ad5..d761e50655d3 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -260,7 +260,7 @@ void OFieldExpressionControl::StartDrag( sal_Int8 /*_nAction*/ , const Point& /* { uno::Sequence<uno::Any> aClipboardList = fillSelectedGroups(); - if( aClipboardList.getLength() ) + if( aClipboardList.hasElements() ) { rtl::Reference<OGroupExchange> pData = new OGroupExchange(aClipboardList); pData->StartDrag(this, DND_ACTION_MOVE ); @@ -297,7 +297,7 @@ sal_Int8 OFieldExpressionControl::ExecuteDrop( const BrowserExecuteDropEvent& rE uno::Any aDrop = aDropped.GetAny(OGroupExchange::getReportGroupId(), OUString()); uno::Sequence< uno::Any > aGroups; aDrop >>= aGroups; - if ( aGroups.getLength() ) + if ( aGroups.hasElements() ) { moveGroups(aGroups,nRow); nAction = DND_ACTION_MOVE; @@ -308,7 +308,7 @@ sal_Int8 OFieldExpressionControl::ExecuteDrop( const BrowserExecuteDropEvent& rE void OFieldExpressionControl::moveGroups(const uno::Sequence<uno::Any>& _aGroups,sal_Int32 _nRow,bool _bSelect) { - if ( _aGroups.getLength() ) + if ( _aGroups.hasElements() ) { m_bIgnoreEvent = true; { @@ -1026,7 +1026,7 @@ IMPL_LINK_NOARG( OGroupsSortingDialog, OnFormatAction, ToolBox*, void ) } else { - if ( nIndex >= 0 && aClipboardList.getLength() ) + if ( nIndex >= 0 && aClipboardList.hasElements() ) { m_pFieldExpression->SetNoSelection(); m_pFieldExpression->moveGroups(aClipboardList,nIndex,false); diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index cf72819673b7..6dd851e5bd0c 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -488,7 +488,7 @@ void NavigatorTree::_selectionChanged( const lang::EventObject& aEvent ) uno::Any aSec = xSelectionSupplier->getSelection(); uno::Sequence< uno::Reference< report::XReportComponent > > aSelection; aSec >>= aSelection; - if ( !aSelection.getLength() ) + if ( !aSelection.hasElements() ) { uno::Reference< uno::XInterface> xSelection(aSec,uno::UNO_QUERY); SvTreeListEntry* pEntry = find(xSelection); diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index e1ba098803d5..315061709c5e 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -224,7 +224,7 @@ static void lcl_getReportControlFormat(const Sequence< PropertyValue >& aArgs, ::std::vector< uno::Reference< uno::XInterface > >& _rControlsFormats) { uno::Reference< report::XReportControlFormat> xReportControlFormat; - if ( aArgs.getLength() ) + if ( aArgs.hasElements() ) { SequenceAsHashMap aMap(aArgs); xReportControlFormat = aMap.getUnpackedValueOrDefault(REPORTCONTROLFORMAT,uno::Reference< report::XReportControlFormat>()); @@ -1522,10 +1522,10 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > if ( !xFormat.is() ) continue; - if ( aSettings.getLength() == 0 ) + if ( !aSettings.hasElements() ) { ::rptui::openCharDialog( xFormat, xWindow, aSettings ); - if ( aSettings.getLength() == 0 ) + if ( !aSettings.hasElements() ) break; } @@ -1554,7 +1554,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_DATETIME: if ( m_xReportDefinition.is() ) { - if ( !aArgs.getLength() ) + if ( !aArgs.hasElements() ) { ODateTimeDialog aDlg(getFrameWeld(), getDesignView()->getCurrentSection(), this); aDlg.run(); @@ -1566,7 +1566,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_INSERT_FLD_PGNUMBER: if ( m_xReportDefinition.is() ) { - if ( !aArgs.getLength() ) + if ( !aArgs.hasElements() ) { OPageNumberDialog aDlg(getFrameWeld(), m_xReportDefinition, this); aDlg.run(); @@ -1590,7 +1590,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_GROUP: break; case SID_ATTR_ZOOM: - if ( aArgs.getLength() == 0 ) + if ( !aArgs.hasElements() ) { openZoomDialog(); } @@ -1722,7 +1722,7 @@ IMPL_LINK( OReportController, OnCreateHdl, OAddFieldWindow& ,_rAddFieldDlg, void WaitObject aObj( getDesignView() ); uno::Sequence< beans::PropertyValue > aArgs = _rAddFieldDlg.getSelectedFieldDescriptors(); // we use this way to create undo actions - if ( aArgs.getLength() ) + if ( aArgs.hasElements() ) { executeChecked(SID_ADD_CONTROL_PAIR,aArgs); } @@ -3019,7 +3019,7 @@ sal_Bool SAL_CALL OReportController::select( const Any& aSelection ) uno::Sequence< uno::Reference<report::XReportComponent> > aElements; if ( aSelection >>= aElements ) { - if ( aElements.getLength() > 0 ) + if ( aElements.hasElements() ) getDesignView()->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY)); getDesignView()->setMarked(aElements, true); } diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 73de1d115c24..d064f485f328 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -234,7 +234,7 @@ void OReportSection::fill() void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyCopiedObjects,bool _bForce) { OSL_ENSURE(m_xSection.is(),"Why is the section here NULL!"); - if ( m_xSection.is() && _aAllreadyCopiedObjects.getLength() ) + if ( m_xSection.is() && _aAllreadyCopiedObjects.hasElements() ) { // stop all drawing actions m_pView->BrkAction(); diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 19bc83444787..6204f2808d8e 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -1212,7 +1212,7 @@ void OViewsWindow::EndDragObj(bool _bControlKeyPressed, const OSectionView* _pSe pInSection->EndDragObj(); } - if ( aAllreadyCopiedObjects.getLength() ) + if ( aAllreadyCopiedObjects.hasElements() ) { try { diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index 701be41e183c..633d5faea46a 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -328,7 +328,7 @@ void PropBrw::implSetNewObject( const uno::Sequence< Reference<uno::XInterface> OUString PropBrw::GetHeadlineName( const uno::Sequence< Reference<uno::XInterface> >& _aObjects ) { OUString aName; - if ( !_aObjects.getLength() ) + if ( !_aObjects.hasElements() ) { aName = RptResId(RID_STR_BRWTITLE_NO_PROPERTIES); } @@ -510,7 +510,7 @@ void PropBrw::Update( OSectionView* pNewView ) } } - if ( aMarkedObjects.getLength() ) // multiple selection + if ( aMarkedObjects.hasElements() ) // multiple selection { m_xLastSection.clear(); implSetNewObject( aMarkedObjects ); |