connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx |   25 ++----
 connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx          |   25 ++----
 connectivity/source/drivers/mysqlc/mysqlc_statement.cxx          |   38 
+++-------
 3 files changed, 33 insertions(+), 55 deletions(-)

New commits:
commit dbb361815aa3aa6888c79f7c513aa3f35cf34570
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Fri Feb 18 12:02:35 2022 +0100
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Fri Feb 18 15:41:08 2022 +0100

    Simplify sequence of Property in connectivity/mysqlc
    
    Change-Id: Ib4e1c47262c42db92226be5f84742799c3a1cbb7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130138
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
index 14fdab939bc7..24208ae244af 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
@@ -1030,21 +1030,16 @@ uno::Sequence<sal_Int32>
 
 IPropertyArrayHelper* OPreparedResultSet::createArrayHelper() const
 {
-    uno::Sequence<Property> aProps(5);
-    Property* pProperties = aProps.getArray();
-    sal_Int32 nPos = 0;
-    pProperties[nPos++] = Property("FetchDirection", 
PROPERTY_ID_FETCHDIRECTION,
-                                   cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++]
-        = Property("FetchSize", PROPERTY_ID_FETCHSIZE, 
cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++] = Property("IsBookmarkable", 
PROPERTY_ID_ISBOOKMARKABLE,
-                                   cppu::UnoType<bool>::get(), 
PropertyAttribute::READONLY);
-    pProperties[nPos++] = Property("ResultSetConcurrency", 
PROPERTY_ID_RESULTSETCONCURRENCY,
-                                   cppu::UnoType<sal_Int32>::get(), 
PropertyAttribute::READONLY);
-    pProperties[nPos++] = Property("ResultSetType", PROPERTY_ID_RESULTSETTYPE,
-                                   cppu::UnoType<sal_Int32>::get(), 
PropertyAttribute::READONLY);
-
-    return new OPropertyArrayHelper(aProps);
+    return new OPropertyArrayHelper{
+        { { "FetchDirection", PROPERTY_ID_FETCHDIRECTION, 
cppu::UnoType<sal_Int32>::get(), 0 },
+          { "FetchSize", PROPERTY_ID_FETCHSIZE, 
cppu::UnoType<sal_Int32>::get(), 0 },
+          { "IsBookmarkable", PROPERTY_ID_ISBOOKMARKABLE, 
cppu::UnoType<bool>::get(),
+            PropertyAttribute::READONLY },
+          { "ResultSetConcurrency", PROPERTY_ID_RESULTSETCONCURRENCY,
+            cppu::UnoType<sal_Int32>::get(), PropertyAttribute::READONLY },
+          { "ResultSetType", PROPERTY_ID_RESULTSETTYPE, 
cppu::UnoType<sal_Int32>::get(),
+            PropertyAttribute::READONLY } }
+    };
 }
 
 IPropertyArrayHelper& OPreparedResultSet::getInfoHelper() { return 
*getArrayHelper(); }
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
index 7a11020ea8e0..348283b56505 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
@@ -1007,21 +1007,16 @@ uno::Sequence<sal_Int32> SAL_CALL 
OResultSet::deleteRows(const uno::Sequence<Any
 
 IPropertyArrayHelper* OResultSet::createArrayHelper() const
 {
-    uno::Sequence<Property> aProps(5);
-    Property* pProperties = aProps.getArray();
-    sal_Int32 nPos = 0;
-    pProperties[nPos++] = Property("FetchDirection", 
PROPERTY_ID_FETCHDIRECTION,
-                                   cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++]
-        = Property("FetchSize", PROPERTY_ID_FETCHSIZE, 
cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++] = Property("IsBookmarkable", 
PROPERTY_ID_ISBOOKMARKABLE,
-                                   cppu::UnoType<bool>::get(), 
PropertyAttribute::READONLY);
-    pProperties[nPos++] = Property("ResultSetConcurrency", 
PROPERTY_ID_RESULTSETCONCURRENCY,
-                                   cppu::UnoType<sal_Int32>::get(), 
PropertyAttribute::READONLY);
-    pProperties[nPos++] = Property("ResultSetType", PROPERTY_ID_RESULTSETTYPE,
-                                   cppu::UnoType<sal_Int32>::get(), 
PropertyAttribute::READONLY);
-
-    return new OPropertyArrayHelper(aProps);
+    return new OPropertyArrayHelper{
+        { { "FetchDirection", PROPERTY_ID_FETCHDIRECTION, 
cppu::UnoType<sal_Int32>::get(), 0 },
+          { "FetchSize", PROPERTY_ID_FETCHSIZE, 
cppu::UnoType<sal_Int32>::get(), 0 },
+          { "IsBookmarkable", PROPERTY_ID_ISBOOKMARKABLE, 
cppu::UnoType<bool>::get(),
+            PropertyAttribute::READONLY },
+          { "ResultSetConcurrency", PROPERTY_ID_RESULTSETCONCURRENCY,
+            cppu::UnoType<sal_Int32>::get(), PropertyAttribute::READONLY },
+          { "ResultSetType", PROPERTY_ID_RESULTSETTYPE, 
cppu::UnoType<sal_Int32>::get(),
+            PropertyAttribute::READONLY } }
+    };
 }
 
 IPropertyArrayHelper& OResultSet::getInfoHelper() { return *getArrayHelper(); }
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index 6e14d9ec60bc..c1da2fe41c9c 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -297,31 +297,19 @@ void SAL_CALL OCommonStatement::clearWarnings()
 {
     // this properties are define by the service statement
     // they must in alphabetic order
-    Sequence<Property> aProps(10);
-    Property* pProperties = aProps.getArray();
-    sal_Int32 nPos = 0;
-    pProperties[nPos++]
-        = Property("CursorName", PROPERTY_ID_CURSORNAME, 
cppu::UnoType<OUString>::get(), 0);
-    pProperties[nPos++]
-        = Property("EscapeProcessing", PROPERTY_ID_ESCAPEPROCESSING, 
cppu::UnoType<bool>::get(), 0);
-    pProperties[nPos++] = Property("FetchDirection", 
PROPERTY_ID_FETCHDIRECTION,
-                                   cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++]
-        = Property("FetchSize", PROPERTY_ID_FETCHSIZE, 
cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++]
-        = Property("MaxFieldSize", PROPERTY_ID_MAXFIELDSIZE, 
cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++]
-        = Property("MaxRows", PROPERTY_ID_MAXROWS, 
cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++]
-        = Property("QueryTimeOut", PROPERTY_ID_QUERYTIMEOUT, 
cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++] = Property("ResultSetConcurrency", 
PROPERTY_ID_RESULTSETCONCURRENCY,
-                                   cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++]
-        = Property("ResultSetType", PROPERTY_ID_RESULTSETTYPE, 
cppu::UnoType<sal_Int32>::get(), 0);
-    pProperties[nPos++]
-        = Property("UseBookmarks", PROPERTY_ID_USEBOOKMARKS, 
cppu::UnoType<bool>::get(), 0);
-
-    return new ::cppu::OPropertyArrayHelper(aProps);
+    return new ::cppu::OPropertyArrayHelper{
+        { { "CursorName", PROPERTY_ID_CURSORNAME, 
cppu::UnoType<OUString>::get(), 0 },
+          { "EscapeProcessing", PROPERTY_ID_ESCAPEPROCESSING, 
cppu::UnoType<bool>::get(), 0 },
+          { "FetchDirection", PROPERTY_ID_FETCHDIRECTION, 
cppu::UnoType<sal_Int32>::get(), 0 },
+          { "FetchSize", PROPERTY_ID_FETCHSIZE, 
cppu::UnoType<sal_Int32>::get(), 0 },
+          { "MaxFieldSize", PROPERTY_ID_MAXFIELDSIZE, 
cppu::UnoType<sal_Int32>::get(), 0 },
+          { "MaxRows", PROPERTY_ID_MAXROWS, cppu::UnoType<sal_Int32>::get(), 0 
},
+          { "QueryTimeOut", PROPERTY_ID_QUERYTIMEOUT, 
cppu::UnoType<sal_Int32>::get(), 0 },
+          { "ResultSetConcurrency", PROPERTY_ID_RESULTSETCONCURRENCY,
+            cppu::UnoType<sal_Int32>::get(), 0 },
+          { "ResultSetType", PROPERTY_ID_RESULTSETTYPE, 
cppu::UnoType<sal_Int32>::get(), 0 },
+          { "UseBookmarks", PROPERTY_ID_USEBOOKMARKS, 
cppu::UnoType<bool>::get(), 0 } }
+    };
 }
 
 ::cppu::IPropertyArrayHelper& OCommonStatement::getInfoHelper() { return 
*getArrayHelper(); }

Reply via email to