[Libreoffice-commits] core.git: sc/inc sc/source
Noel Grandin
noelgrandin at gmail.com
Thu Mar 31 15:19:17 UTC 2016
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(-)
New commits:
commit 374b69716dcf83dbbc1e240eb02e5101d9b6a983
Author: Noel Grandin <noelgrandin at gmail.com>
Date: Tue Mar 8 20:33:57 2016 +0200
sequence->vector in sc
Change-Id: I3edf08fe5db798dbc1190db375cfb82c5b9bc5da
Reviewed-on: https://gerrit.libreoffice.org/23696
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 4ecdd8f..5876bd9 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 8b46a09..b59142b 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 7324c7f..c70e02e 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 9f6b795..178e589 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 7a84d73..0ec96c0 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 3621607..58af492 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 2855769..e6b2eec 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 b97450b..a014832 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));
More information about the Libreoffice-commits
mailing list