summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-03-08 20:33:57 +0200
committerEike Rathke <erack@redhat.com>2016-03-31 15:18:55 +0000
commit374b69716dcf83dbbc1e240eb02e5101d9b6a983 (patch)
tree7125117499905f484d603ad84a23577ab21ae4ed /sc
parent8c32ffd59aef2c7b319d64c310e7d0a46dbb9e2c (diff)
sequence->vector in sc
Change-Id: I3edf08fe5db798dbc1190db375cfb82c5b9bc5da Reviewed-on: https://gerrit.libreoffice.org/23696 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/dpobject.hxx2
-rw-r--r--sc/inc/scabstdlg.hxx2
-rw-r--r--sc/source/core/data/dpobject.cxx12
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx2
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx2
-rw-r--r--sc/source/ui/dbgui/dapitype.cxx7
-rw-r--r--sc/source/ui/inc/dapitype.hxx2
-rw-r--r--sc/source/ui/view/cellsh1.cxx2
8 files changed, 12 insertions, 19 deletions
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<OUString> GetRegisteredSources();
+ static std::vector<OUString> GetRegisteredSources();
static css::uno::Reference<css::sheet::XDimensionsSupplier>
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<OUString>& rServices,
+ const std::vector<OUString>& 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<OUString> ScDPObject::GetRegisteredSources()
+std::vector<OUString> ScDPObject::GetRegisteredSources()
{
- uno::Sequence<OUString> aSeq(0);
+ std::vector<OUString> aVec;
// use implementation names...
@@ -2683,7 +2683,6 @@ uno::Sequence<OUString> ScDPObject::GetRegisteredSources()
SCDPSOURCE_SERVICE );
if ( xEnum.is() )
{
- long nCount = 0;
while ( xEnum->hasMoreElements() )
{
uno::Any aAddInAny = xEnum->nextElement();
@@ -2697,10 +2696,7 @@ uno::Sequence<OUString> 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<OUString> ScDPObject::GetRegisteredSources()
}
}
- return aSeq;
+ return aVec;
}
uno::Reference<sheet::XDimensionsSupplier> 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<OUString>& rServices,
+ const std::vector<OUString>& rServices,
int nId )
{
VclPtr<ScDataPilotServiceDlg> 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<OUString>& rServices,
+ const std::vector<OUString>& 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<OUString>& rServices ) :
+ const std::vector<OUString>& 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; i<nCount; i++)
+ for (const OUString& aName : rServices)
{
- OUString aName = pArray[i];
m_pLbService->InsertEntry( 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<OUString>& rServices );
+ const std::vector<OUString>& 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<OUString> aSources = ScDPObject::GetRegisteredSources();
+ std::vector<OUString> aSources = ScDPObject::GetRegisteredSources();
std::unique_ptr<AbstractScDataPilotServiceDlg> pServDlg(
pFact->CreateScDataPilotServiceDlg(
pTabViewShell->GetDialogParent(), aSources, RID_SCDLG_DAPISERVICE));