dbaccess/source/core/dataaccess/datasource.cxx        |    5 +--
 dbaccess/source/core/dataaccess/documentcontainer.cxx |   11 ++++---
 dbaccess/source/ui/browser/unodatbr.cxx               |   26 +++++-------------
 dbaccess/source/ui/control/sqledit.cxx                |    4 --
 dbaccess/source/ui/dlg/CollectionView.cxx             |    4 --
 5 files changed, 18 insertions(+), 32 deletions(-)

New commits:
commit af8dc07bfdf5d6e7bd2278305cd39ed269e50ed7
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Tue Jun 8 12:57:35 2021 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Tue Jun 8 17:07:46 2021 +0200

    Simplify Sequences initializations (dbaccess)
    
    Change-Id: I38ecf7f13a853909fc746ee9bf1167f9c15cbc5f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116832
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to