summaryrefslogtreecommitdiff
path: root/connectivity/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-11-23 11:16:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-11-23 12:06:50 +0100
commitf23ee916466bd6e0d328a4e541e104445c8ecb0a (patch)
treebe272c074f5f950117b102fdde0f83f2e5643ebd /connectivity/source
parentd7b33b1be8fee684e906f170f4001735c095056e (diff)
tdf#158072 Fails to apply AutoFilter in Mail Merge dialog
regression from commit 66b0bc55854ba13b92b6c39b95f3f2d4ef76bf20 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Fri Mar 10 10:35:33 2023 +0200 simplify initialisation in *DatabaseMetaData where I failed to notice that the supposedly static data was being std::move'd Change-Id: I6238fa8e20ee6ca9fe31c29a7e05262dc1e3bede Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159851 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source')
-rw-r--r--connectivity/source/drivers/component/CDatabaseMetaData.cxx125
-rw-r--r--connectivity/source/drivers/dbase/DDatabaseMetaData.cxx173
-rw-r--r--connectivity/source/drivers/file/FDatabaseMetaData.cxx8
3 files changed, 146 insertions, 160 deletions
diff --git a/connectivity/source/drivers/component/CDatabaseMetaData.cxx b/connectivity/source/drivers/component/CDatabaseMetaData.cxx
index bbd921bca3f6..49d83e36af12 100644
--- a/connectivity/source/drivers/component/CDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/component/CDatabaseMetaData.cxx
@@ -48,72 +48,67 @@ Reference< XResultSet > OComponentDatabaseMetaData::impl_getTypeInfo_throw( )
{
rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- static ODatabaseMetaDataResultSet::ORows aRows = []()
+ ODatabaseMetaDataResultSet::ORows aRows;
+ aRows.reserve(6);
+ ODatabaseMetaDataResultSet::ORow aRow
{
- ODatabaseMetaDataResultSet::ORows aTmp;
- aTmp.reserve(6);
- ODatabaseMetaDataResultSet::ORow aRow
- {
- ODatabaseMetaDataResultSet::getEmptyValue(),
- new ORowSetValueDecorator(OUString("VARCHAR")),
- new ORowSetValueDecorator(DataType::VARCHAR),
- new ORowSetValueDecorator(sal_Int32(65535)),
- ODatabaseMetaDataResultSet::getQuoteValue(),
- ODatabaseMetaDataResultSet::getQuoteValue(),
- ODatabaseMetaDataResultSet::getEmptyValue(),
- ODatabaseMetaDataResultSet::get1Value(), // ORowSetValue((sal_Int32)ColumnValue::NULLABLE
- ODatabaseMetaDataResultSet::get1Value(),
- new ORowSetValueDecorator(sal_Int32(ColumnSearch::CHAR)),
- ODatabaseMetaDataResultSet::get1Value(),
- ODatabaseMetaDataResultSet::get0Value(),
- ODatabaseMetaDataResultSet::get0Value(),
- ODatabaseMetaDataResultSet::getEmptyValue(),
- ODatabaseMetaDataResultSet::get0Value(),
- ODatabaseMetaDataResultSet::get0Value(),
- ODatabaseMetaDataResultSet::getEmptyValue(),
- ODatabaseMetaDataResultSet::getEmptyValue(),
- new ORowSetValueDecorator(sal_Int32(10))
- };
-
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("DECIMAL"));
- aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
- aRow[3] = ODatabaseMetaDataResultSet::get0Value();
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("BOOL"));
- aRow[2] = new ORowSetValueDecorator(DataType::BIT);
- aRow[3] = new ORowSetValueDecorator(sal_Int32(20));
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[15] = new ORowSetValueDecorator(sal_Int32(15));
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("DATE"));
- aRow[2] = new ORowSetValueDecorator(DataType::DATE);
- aRow[3] = ODatabaseMetaDataResultSet::get0Value();
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("TIME"));
- aRow[2] = new ORowSetValueDecorator(DataType::TIME);
- aRow[3] = ODatabaseMetaDataResultSet::get0Value();
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("TIMESTAMP"));
- aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[3] = ODatabaseMetaDataResultSet::get0Value();
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aTmp.push_back(aRow);
-
- return aTmp;
- }();
+ ODatabaseMetaDataResultSet::getEmptyValue(),
+ new ORowSetValueDecorator(OUString("VARCHAR")),
+ new ORowSetValueDecorator(DataType::VARCHAR),
+ new ORowSetValueDecorator(sal_Int32(65535)),
+ ODatabaseMetaDataResultSet::getQuoteValue(),
+ ODatabaseMetaDataResultSet::getQuoteValue(),
+ ODatabaseMetaDataResultSet::getEmptyValue(),
+ ODatabaseMetaDataResultSet::get1Value(), // ORowSetValue((sal_Int32)ColumnValue::NULLABLE
+ ODatabaseMetaDataResultSet::get1Value(),
+ new ORowSetValueDecorator(sal_Int32(ColumnSearch::CHAR)),
+ ODatabaseMetaDataResultSet::get1Value(),
+ ODatabaseMetaDataResultSet::get0Value(),
+ ODatabaseMetaDataResultSet::get0Value(),
+ ODatabaseMetaDataResultSet::getEmptyValue(),
+ ODatabaseMetaDataResultSet::get0Value(),
+ ODatabaseMetaDataResultSet::get0Value(),
+ ODatabaseMetaDataResultSet::getEmptyValue(),
+ ODatabaseMetaDataResultSet::getEmptyValue(),
+ new ORowSetValueDecorator(sal_Int32(10))
+ };
+
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("DECIMAL"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
+ aRow[3] = ODatabaseMetaDataResultSet::get0Value();
+ aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
+ aRow[15] = ODatabaseMetaDataResultSet::get0Value();
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("BOOL"));
+ aRow[2] = new ORowSetValueDecorator(DataType::BIT);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(20));
+ aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
+ aRow[15] = new ORowSetValueDecorator(sal_Int32(15));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("DATE"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DATE);
+ aRow[3] = ODatabaseMetaDataResultSet::get0Value();
+ aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
+ aRow[15] = ODatabaseMetaDataResultSet::get0Value();
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("TIME"));
+ aRow[2] = new ORowSetValueDecorator(DataType::TIME);
+ aRow[3] = ODatabaseMetaDataResultSet::get0Value();
+ aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
+ aRow[15] = ODatabaseMetaDataResultSet::get0Value();
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("TIMESTAMP"));
+ aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
+ aRow[3] = ODatabaseMetaDataResultSet::get0Value();
+ aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
+ aRow[15] = ODatabaseMetaDataResultSet::get0Value();
+ aRows.push_back(aRow);
pResult->setRows(std::move(aRows));
return pResult;
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index 91a9c66fbdcb..b3791f7d85d1 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -56,96 +56,91 @@ Reference< XResultSet > ODbaseDatabaseMetaData::impl_getTypeInfo_throw( )
{
rtl::Reference<::connectivity::ODatabaseMetaDataResultSet> pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- static ODatabaseMetaDataResultSet::ORows aRows = []()
+ ODatabaseMetaDataResultSet::ORows aRows;
+ aRows.reserve(10);
+ ODatabaseMetaDataResultSet::ORow aRow
{
- ODatabaseMetaDataResultSet::ORows aTmp;
- aTmp.reserve(10);
- ODatabaseMetaDataResultSet::ORow aRow
- {
- ODatabaseMetaDataResultSet::getEmptyValue(),
- new ORowSetValueDecorator(OUString("VARCHAR")),
- new ORowSetValueDecorator(DataType::VARCHAR),
- new ORowSetValueDecorator(sal_Int32(254)),
- ODatabaseMetaDataResultSet::getQuoteValue(),
- ODatabaseMetaDataResultSet::getQuoteValue(),
- new ORowSetValueDecorator(OUString("length")),
- new ORowSetValueDecorator(sal_Int32(ColumnValue::NULLABLE)),
- ODatabaseMetaDataResultSet::get1Value(),
- new ORowSetValueDecorator(sal_Int32(ColumnSearch::FULL)),
- ODatabaseMetaDataResultSet::get1Value(),
- ODatabaseMetaDataResultSet::get0Value(),
- ODatabaseMetaDataResultSet::get0Value(),
- new ORowSetValueDecorator(OUString("C")),
- ODatabaseMetaDataResultSet::get0Value(),
- ODatabaseMetaDataResultSet::get0Value(),
- ODatabaseMetaDataResultSet::getEmptyValue(),
- ODatabaseMetaDataResultSet::getEmptyValue(),
- new ORowSetValueDecorator(sal_Int32(10))
- };
-
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("LONGVARCHAR"));
- aRow[2] = new ORowSetValueDecorator(DataType::LONGVARCHAR);
- aRow[3] = new ORowSetValueDecorator(sal_Int32(2147483647));
- aRow[6] = new ORowSetValueDecorator();
- aRow[13] = new ORowSetValueDecorator(OUString("M"));
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("DATE"));
- aRow[2] = new ORowSetValueDecorator(DataType::DATE);
- aRow[3] = new ORowSetValueDecorator(sal_Int32(10));
- aRow[13] = new ORowSetValueDecorator(OUString("D"));
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("BOOLEAN"));
- aRow[2] = new ORowSetValueDecorator(DataType::BIT);
- aRow[3] = ODatabaseMetaDataResultSet::get1Value();
- aRow[4] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[5] = ODatabaseMetaDataResultSet::getEmptyValue();
- aRow[6] = new ORowSetValueDecorator(OUString());
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRow[13] = new ORowSetValueDecorator(OUString("L"));
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("DOUBLE"));
- aRow[2] = new ORowSetValueDecorator(DataType::DOUBLE);
- aRow[3] = new ORowSetValueDecorator(sal_Int32(8));
- aRow[13] = new ORowSetValueDecorator(OUString("B"));
- aTmp.push_back(aRow);
-
- aRow[11] = new ORowSetValueDecorator(ORowSetValue(true));
- aRow[13] = new ORowSetValueDecorator(OUString("Y"));
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("TIMESTAMP"));
- aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[11] = new ORowSetValueDecorator(ORowSetValue(false));
- aRow[13] = new ORowSetValueDecorator(OUString("T"));
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("INTEGER"));
- aRow[2] = new ORowSetValueDecorator(DataType::INTEGER);
- aRow[3] = new ORowSetValueDecorator(sal_Int32(10));
- aRow[13] = new ORowSetValueDecorator(OUString("I"));
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("DECIMAL"));
- aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
- aRow[3] = new ORowSetValueDecorator(sal_Int32(20));
- aRow[6] = new ORowSetValueDecorator(OUString("length,scale"));
- aRow[13] = new ORowSetValueDecorator(OUString("F"));
- aTmp.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(OUString("NUMERIC"));
- aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
- aRow[3] = new ORowSetValueDecorator(sal_Int32(16));
- aRow[13] = new ORowSetValueDecorator(OUString("N"));
- aRow[15] = new ORowSetValueDecorator(sal_Int32(16));
- aTmp.push_back(aRow);
-
- return aTmp;
- }();
+ ODatabaseMetaDataResultSet::getEmptyValue(),
+ new ORowSetValueDecorator(OUString("VARCHAR")),
+ new ORowSetValueDecorator(DataType::VARCHAR),
+ new ORowSetValueDecorator(sal_Int32(254)),
+ ODatabaseMetaDataResultSet::getQuoteValue(),
+ ODatabaseMetaDataResultSet::getQuoteValue(),
+ new ORowSetValueDecorator(OUString("length")),
+ new ORowSetValueDecorator(sal_Int32(ColumnValue::NULLABLE)),
+ ODatabaseMetaDataResultSet::get1Value(),
+ new ORowSetValueDecorator(sal_Int32(ColumnSearch::FULL)),
+ ODatabaseMetaDataResultSet::get1Value(),
+ ODatabaseMetaDataResultSet::get0Value(),
+ ODatabaseMetaDataResultSet::get0Value(),
+ new ORowSetValueDecorator(OUString("C")),
+ ODatabaseMetaDataResultSet::get0Value(),
+ ODatabaseMetaDataResultSet::get0Value(),
+ ODatabaseMetaDataResultSet::getEmptyValue(),
+ ODatabaseMetaDataResultSet::getEmptyValue(),
+ new ORowSetValueDecorator(sal_Int32(10))
+ };
+
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("LONGVARCHAR"));
+ aRow[2] = new ORowSetValueDecorator(DataType::LONGVARCHAR);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(2147483647));
+ aRow[6] = new ORowSetValueDecorator();
+ aRow[13] = new ORowSetValueDecorator(OUString("M"));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("DATE"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DATE);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(10));
+ aRow[13] = new ORowSetValueDecorator(OUString("D"));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("BOOLEAN"));
+ aRow[2] = new ORowSetValueDecorator(DataType::BIT);
+ aRow[3] = ODatabaseMetaDataResultSet::get1Value();
+ aRow[4] = ODatabaseMetaDataResultSet::getEmptyValue();
+ aRow[5] = ODatabaseMetaDataResultSet::getEmptyValue();
+ aRow[6] = new ORowSetValueDecorator(OUString());
+ aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
+ aRow[13] = new ORowSetValueDecorator(OUString("L"));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("DOUBLE"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DOUBLE);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(8));
+ aRow[13] = new ORowSetValueDecorator(OUString("B"));
+ aRows.push_back(aRow);
+
+ aRow[11] = new ORowSetValueDecorator(ORowSetValue(true));
+ aRow[13] = new ORowSetValueDecorator(OUString("Y"));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("TIMESTAMP"));
+ aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
+ aRow[11] = new ORowSetValueDecorator(ORowSetValue(false));
+ aRow[13] = new ORowSetValueDecorator(OUString("T"));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("INTEGER"));
+ aRow[2] = new ORowSetValueDecorator(DataType::INTEGER);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(10));
+ aRow[13] = new ORowSetValueDecorator(OUString("I"));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("DECIMAL"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(20));
+ aRow[6] = new ORowSetValueDecorator(OUString("length,scale"));
+ aRow[13] = new ORowSetValueDecorator(OUString("F"));
+ aRows.push_back(aRow);
+
+ aRow[1] = new ORowSetValueDecorator(OUString("NUMERIC"));
+ aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
+ aRow[3] = new ORowSetValueDecorator(sal_Int32(16));
+ aRow[13] = new ORowSetValueDecorator(OUString("N"));
+ aRow[15] = new ORowSetValueDecorator(sal_Int32(16));
+ aRows.push_back(aRow);
pResult->setRows(std::move(aRows));
return pResult;
diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
index 8935022e5088..b0d7bcd7f8a2 100644
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
@@ -619,12 +619,8 @@ sal_Bool SAL_CALL ODatabaseMetaData::supportsOuterJoins( )
Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTableTypes( )
{
rtl::Reference<ODatabaseMetaDataResultSet> pResult = new ODatabaseMetaDataResultSet( ODatabaseMetaDataResultSet::eTableTypes );
- static ODatabaseMetaDataResultSet::ORows aRows = []()
- {
- ODatabaseMetaDataResultSet::ORows aTmp;
- aTmp.push_back( { ODatabaseMetaDataResultSet::getEmptyValue(), new ORowSetValueDecorator(OUString("TABLE")) } );
- return aTmp;
- }();
+ ODatabaseMetaDataResultSet::ORows aRows;
+ aRows.push_back( { ODatabaseMetaDataResultSet::getEmptyValue(), new ORowSetValueDecorator(OUString("TABLE")) } );
pResult->setRows(std::move(aRows));
return pResult;
}