summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-06-08 12:57:35 +0200
committerJulien Nabet <serval2412@yahoo.fr>2021-06-08 17:07:46 +0200
commitaf8dc07bfdf5d6e7bd2278305cd39ed269e50ed7 (patch)
tree906cc5264d994eb19c9c24068f947b409c0726c3 /dbaccess/source
parentb32520f3e6b4ec4868d6e94d6fc20abb283c8308 (diff)
Simplify Sequences initializations (dbaccess)
Change-Id: I38ecf7f13a853909fc746ee9bf1167f9c15cbc5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116832 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx5
-rw-r--r--dbaccess/source/core/dataaccess/documentcontainer.cxx11
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx26
-rw-r--r--dbaccess/source/ui/control/sqledit.cxx4
-rw-r--r--dbaccess/source/ui/dlg/CollectionView.cxx4
5 files changed, 18 insertions, 32 deletions
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index e560d75040b0..9ce895bae875 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -219,9 +219,8 @@ void SAL_CALL OAuthenticationContinuation::setPassword( const OUString& _rPasswo
Sequence< RememberAuthentication > SAL_CALL OAuthenticationContinuation::getRememberPasswordModes( RememberAuthentication& _reDefault )
{
- Sequence< RememberAuthentication > aReturn(1);
- _reDefault = aReturn[0] = RememberAuthentication_SESSION;
- return aReturn;
+ _reDefault = RememberAuthentication_SESSION;
+ return { _reDefault };
}
void SAL_CALL OAuthenticationContinuation::setRememberPassword( RememberAuthentication _eRemember )
diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx
index 9d88d27222f5..472f60ad566f 100644
--- a/dbaccess/source/core/dataaccess/documentcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx
@@ -372,11 +372,12 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments
Sequence< OUString > SAL_CALL ODocumentContainer::getAvailableServiceNames( )
{
- Sequence< OUString > aSe(3);
- aSe[0] = SERVICE_SDB_DOCUMENTDEFINITION;
- aSe[1] = SERVICE_NAME_FORM_COLLECTION;
- aSe[2] = SERVICE_NAME_REPORT_COLLECTION;
- return aSe;
+ return
+ {
+ SERVICE_SDB_DOCUMENTDEFINITION,
+ SERVICE_NAME_FORM_COLLECTION,
+ SERVICE_NAME_REPORT_COLLECTION
+ };
}
Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 CommandId, const Reference< XCommandEnvironment >& Environment )
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index db5bec8c6428..e8c1c1f5920b 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -3147,24 +3147,14 @@ void SbaTableQueryBrowser::impl_initialize()
{
try
{
- Sequence< OUString> aProperties(5);
- Sequence< Any> aValues(5);
-
- OUString* pStringIter = aProperties.getArray();
- Any* pValueIter = aValues.getArray();
- *pStringIter++ = "AlwaysShowCursor";
- *pValueIter++ <<= false;
- *pStringIter++ = PROPERTY_BORDER;
- *pValueIter++ <<= sal_Int16(0);
-
- *pStringIter++ = "HasNavigationBar";
- *pValueIter++ <<= false;
- *pStringIter++ = "HasRecordMarker";
- *pValueIter++ <<= false;
-
- *pStringIter++ = "Tabstop";
- *pValueIter++ <<= false;
-
+ Sequence< OUString> aProperties
+ {
+ "AlwaysShowCursor", PROPERTY_BORDER, "HasNavigationBar", "HasRecordMarker", "Tabstop"
+ };
+ Sequence< Any> aValues
+ {
+ Any(false), Any(sal_Int16(0)), Any(false), Any(false), Any(false)
+ };
Reference< XMultiPropertySet > xFormMultiSet(getFormComponent(), UNO_QUERY);
if ( xFormMultiSet.is() )
xFormMultiSet->setPropertyValues(aProperties, aValues);
diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx
index 062f99e96cae..c53f684dab4a 100644
--- a/dbaccess/source/ui/control/sqledit.cxx
+++ b/dbaccess/source/ui/control/sqledit.cxx
@@ -142,9 +142,7 @@ void SQLEditView::SetDrawingArea(weld::DrawingArea* pDrawingArea)
osl::MutexGuard g(m_mutex);
m_notifier = n;
}
- css::uno::Sequence< OUString > s(2);
- s[0] = "FontHeight";
- s[1] = "FontName";
+ css::uno::Sequence< OUString > s { "FontHeight", "FontName" };
n->addPropertiesChangeListener(s, m_listener);
m_ColorConfig.AddListener(this);
}
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index 77dd170785b2..75973ad1e780 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -290,9 +290,7 @@ void OCollectionView::Initialize()
try
{
::ucbhelper::Content aContent(m_xContent, m_xCmdEnv, comphelper::getProcessComponentContext());
- Sequence<OUString> aProps(2);
- aProps[0] = "Title";
- aProps[1] = "IsFolder";
+ Sequence<OUString> aProps { "Title", "IsFolder" };
auto xDynResultSet = aContent.createDynamicCursor(aProps, ucbhelper::INCLUDE_FOLDERS_ONLY);
if (!xDynResultSet.is())
return;