From 374b69716dcf83dbbc1e240eb02e5101d9b6a983 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 8 Mar 2016 20:33:57 +0200 Subject: sequence->vector in sc Change-Id: I3edf08fe5db798dbc1190db375cfb82c5b9bc5da Reviewed-on: https://gerrit.libreoffice.org/23696 Reviewed-by: Eike Rathke Tested-by: Eike Rathke --- sc/inc/dpobject.hxx | 2 +- sc/inc/scabstdlg.hxx | 2 +- sc/source/core/data/dpobject.cxx | 12 ++++-------- sc/source/ui/attrdlg/scdlgfact.cxx | 2 +- sc/source/ui/attrdlg/scdlgfact.hxx | 2 +- sc/source/ui/dbgui/dapitype.cxx | 7 ++----- sc/source/ui/inc/dapitype.hxx | 2 +- sc/source/ui/view/cellsh1.cxx | 2 +- 8 files changed, 12 insertions(+), 19 deletions(-) (limited to 'sc') diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 4ecdd8f3faf3..5876bd930dbc 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -235,7 +235,7 @@ public: bool SyncAllDimensionMembers(); static bool HasRegisteredSources(); - static css::uno::Sequence GetRegisteredSources(); + static std::vector GetRegisteredSources(); static css::uno::Reference CreateSource( const ScDPServiceDesc& rDesc ); diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 8b46a097edf0..b59142bc4081 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -351,7 +351,7 @@ public: bool bEnableExternal) = 0; virtual AbstractScDataPilotServiceDlg * CreateScDataPilotServiceDlg( vcl::Window* pParent, - const css::uno::Sequence& rServices, + const std::vector& rServices, int nId ) = 0; virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg(vcl::Window* pParent, bool bDisallowCellMove = false) = 0 ; diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 7324c7f6428e..c70e02e13c9e 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -2669,9 +2669,9 @@ bool ScDPObject::HasRegisteredSources() return bFound; } -uno::Sequence ScDPObject::GetRegisteredSources() +std::vector ScDPObject::GetRegisteredSources() { - uno::Sequence aSeq(0); + std::vector aVec; // use implementation names... @@ -2683,7 +2683,6 @@ uno::Sequence ScDPObject::GetRegisteredSources() SCDPSOURCE_SERVICE ); if ( xEnum.is() ) { - long nCount = 0; while ( xEnum->hasMoreElements() ) { uno::Any aAddInAny = xEnum->nextElement(); @@ -2697,10 +2696,7 @@ uno::Sequence ScDPObject::GetRegisteredSources() if ( xInfo.is() ) { OUString sName = xInfo->getImplementationName(); - - aSeq.realloc( nCount+1 ); - aSeq.getArray()[nCount] = sName; - ++nCount; + aVec.push_back( sName ); } } } @@ -2708,7 +2704,7 @@ uno::Sequence ScDPObject::GetRegisteredSources() } } - return aSeq; + return aVec; } uno::Reference ScDPObject::CreateSource( const ScDPServiceDesc& rDesc ) diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 9f6b7958a026..178e589a8eda 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -661,7 +661,7 @@ AbstractScDataPilotSourceTypeDlg* ScAbstractDialogFactory_Impl::CreateScDataPilo } AbstractScDataPilotServiceDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotServiceDlg( vcl::Window* pParent, - const css::uno::Sequence& rServices, + const std::vector& rServices, int nId ) { VclPtr pDlg; diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 7a84d7366b0b..0ec96c0682f8 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -417,7 +417,7 @@ public: bool bEnableExternal) override; virtual AbstractScDataPilotServiceDlg * CreateScDataPilotServiceDlg( vcl::Window* pParent, - const css::uno::Sequence& rServices, + const std::vector& rServices, int nId ) override; virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg(vcl::Window* pParent, bool bDisallowCellMove = false ) override; diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx index 3621607736e5..58af4920b9aa 100644 --- a/sc/source/ui/dbgui/dapitype.cxx +++ b/sc/source/ui/dbgui/dapitype.cxx @@ -104,7 +104,7 @@ IMPL_LINK_TYPED( ScDataPilotSourceTypeDlg, RadioClickHdl, Button*, pBtn, void ) } ScDataPilotServiceDlg::ScDataPilotServiceDlg( vcl::Window* pParent, - const uno::Sequence& rServices ) : + const std::vector& rServices ) : ModalDialog ( pParent, "DapiserviceDialog", "modules/scalc/ui/dapiservicedialog.ui" ) { get(m_pLbService, "service"); @@ -113,11 +113,8 @@ ScDataPilotServiceDlg::ScDataPilotServiceDlg( vcl::Window* pParent, get(m_pEdUser, "user"); get(m_pEdPasswd, "password"); - long nCount = rServices.getLength(); - const OUString* pArray = rServices.getConstArray(); - for (long i=0; iInsertEntry( aName ); } m_pLbService->SelectEntryPos( 0 ); diff --git a/sc/source/ui/inc/dapitype.hxx b/sc/source/ui/inc/dapitype.hxx index 2855769e898e..e6b2eec67a9b 100644 --- a/sc/source/ui/inc/dapitype.hxx +++ b/sc/source/ui/inc/dapitype.hxx @@ -61,7 +61,7 @@ private: public: ScDataPilotServiceDlg( vcl::Window* pParent, - const css::uno::Sequence& rServices ); + const std::vector& rServices ); virtual ~ScDataPilotServiceDlg(); virtual void dispose() override; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index b97450bf8db7..a014832e15ce 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2652,7 +2652,7 @@ void ScCellShell::ExecuteDataPilotDialog() { if ( pTypeDlg->IsExternal() ) { - uno::Sequence aSources = ScDPObject::GetRegisteredSources(); + std::vector aSources = ScDPObject::GetRegisteredSources(); std::unique_ptr pServDlg( pFact->CreateScDataPilotServiceDlg( pTabViewShell->GetDialogParent(), aSources, RID_SCDLG_DAPISERVICE)); -- cgit