Simplify Sequences initializations (comphelper+connectivity)
Change-Id: I8a91f4bd2a1117acb571f1058af18071bc058c9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116815 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
@@ -64,10 +64,7 @@ namespace comphelper
|
||||
void OAccessibleKeyBindingHelper::AddKeyBinding( const awt::KeyStroke& rKeyStroke )
|
||||
{
|
||||
::osl::MutexGuard aGuard( m_aMutex );
|
||||
|
||||
Sequence< awt::KeyStroke > aSeq(1);
|
||||
aSeq[0] = rKeyStroke;
|
||||
m_aKeyBindings.push_back( aSeq );
|
||||
m_aKeyBindings.push_back( { rKeyStroke } );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,11 +38,8 @@ OResultSetPrivileges::OResultSetPrivileges( const Reference< XDatabaseMetaData>&
|
||||
osl_atomic_increment( &m_refCount );
|
||||
{
|
||||
OUString sUserWorkingFor;
|
||||
Sequence< OUString > sTableTypes(3);
|
||||
// we want all catalogues, all schemas, all tables
|
||||
sTableTypes[0] = "VIEW";
|
||||
sTableTypes[1] = "TABLE";
|
||||
sTableTypes[2] = "%"; // just to be sure to include anything else...
|
||||
Sequence< OUString > sTableTypes {"VIEW", "TABLE", "%"}; // this last one is just to be sure to include anything else...
|
||||
try
|
||||
{
|
||||
m_xTables = _rxMeta->getTables(catalog,schemaPattern,tableNamePattern,sTableTypes);
|
||||
|
||||
@@ -27,9 +27,7 @@ Catalog::Catalog(const uno::Reference< XConnection >& rConnection):
|
||||
//----- OCatalog -------------------------------------------------------------
|
||||
void Catalog::refreshTables()
|
||||
{
|
||||
Sequence< OUString > aTypes(2);
|
||||
aTypes[0] = "TABLE";
|
||||
aTypes[1] = "VIEW";
|
||||
Sequence< OUString > aTypes {"TABLE", "VIEW"};
|
||||
|
||||
uno::Reference< XResultSet > xTables = m_xMetaData->getTables(Any(),
|
||||
"%",
|
||||
|
||||
@@ -54,9 +54,7 @@ void OHCatalog::refreshTables()
|
||||
{
|
||||
::std::vector< OUString> aVector;
|
||||
|
||||
Sequence< OUString > sTableTypes(2);
|
||||
sTableTypes[0] = "VIEW";
|
||||
sTableTypes[1] = "TABLE";
|
||||
Sequence< OUString > sTableTypes {"VIEW", "TABLE"};
|
||||
|
||||
refreshObjects(sTableTypes,aVector);
|
||||
|
||||
|
||||
@@ -463,11 +463,13 @@ void write_to_storage_stream( JNIEnv* env, jstring name, jstring key, jint v )
|
||||
{
|
||||
if ( xOut.is() )
|
||||
{
|
||||
Sequence< ::sal_Int8 > oneByte(4);
|
||||
oneByte[0] = static_cast<sal_Int8>((v >> 24) & 0xFF);
|
||||
oneByte[1] = static_cast<sal_Int8>((v >> 16) & 0xFF);
|
||||
oneByte[2] = static_cast<sal_Int8>((v >> 8) & 0xFF);
|
||||
oneByte[3] = static_cast<sal_Int8>((v >> 0) & 0xFF);
|
||||
Sequence< ::sal_Int8 > oneByte
|
||||
{
|
||||
static_cast<sal_Int8>((v >> 24) & 0xFF),
|
||||
static_cast<sal_Int8>((v >> 16) & 0xFF),
|
||||
static_cast<sal_Int8>((v >> 8) & 0xFF),
|
||||
static_cast<sal_Int8>((v >> 0) & 0xFF)
|
||||
};
|
||||
|
||||
xOut->writeBytes(oneByte);
|
||||
}
|
||||
|
||||
@@ -45,10 +45,7 @@ sdbcx::ObjectType OTables::createObject(const OUString& _rName)
|
||||
OUString sCatalog,sSchema,sTable;
|
||||
::dbtools::qualifiedNameComponents(m_xMetaData,_rName,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation);
|
||||
|
||||
Sequence< OUString > sTableTypes(3);
|
||||
sTableTypes[0] = "VIEW";
|
||||
sTableTypes[1] = "TABLE";
|
||||
sTableTypes[2] = "%"; // just to be sure to include anything else...
|
||||
Sequence< OUString > sTableTypes {"VIEW", "TABLE", "%"}; // this last one just to be sure to include anything else...
|
||||
|
||||
Any aCatalog;
|
||||
if ( !sCatalog.isEmpty() )
|
||||
|
||||
@@ -52,10 +52,9 @@ void OMySQLCatalog::refreshTables()
|
||||
{
|
||||
::std::vector<OUString> aVector;
|
||||
|
||||
Sequence<OUString> sTableTypes(3);
|
||||
sTableTypes[0] = "VIEW";
|
||||
sTableTypes[1] = "TABLE";
|
||||
sTableTypes[2] = "%"; // just to be sure to include anything else...
|
||||
Sequence<OUString> sTableTypes{
|
||||
"VIEW", "TABLE", "%"
|
||||
}; // this last one just to be sure to include anything else...
|
||||
|
||||
refreshObjects(sTableTypes, aVector);
|
||||
|
||||
|
||||
@@ -46,10 +46,9 @@ sdbcx::ObjectType OTables::createObject(const OUString& _rName)
|
||||
::dbtools::qualifiedNameComponents(m_xMetaData, _rName, sCatalog, sSchema, sTable,
|
||||
::dbtools::EComposeRule::InDataManipulation);
|
||||
|
||||
Sequence<OUString> sTableTypes(3);
|
||||
sTableTypes[0] = "VIEW";
|
||||
sTableTypes[1] = "TABLE";
|
||||
sTableTypes[2] = "%"; // just to be sure to include anything else...
|
||||
Sequence<OUString> sTableTypes{
|
||||
"VIEW", "TABLE", "%"
|
||||
}; // this last one just to be sure to include anything else...
|
||||
|
||||
Any aCatalog;
|
||||
if (!sCatalog.isEmpty())
|
||||
|
||||
@@ -200,9 +200,7 @@ Statics & getStatics()
|
||||
|
||||
statics.refl.tableDescriptor.implName =
|
||||
"org.openoffice.comp.pq.sdbcx.TableDescriptor";
|
||||
statics.refl.tableDescriptor.serviceNames = Sequence< OUString > (1);
|
||||
statics.refl.tableDescriptor.serviceNames[0] =
|
||||
"com.sun.star.sdbcx.TableDescriptor";
|
||||
statics.refl.tableDescriptor.serviceNames = { "com.sun.star.sdbcx.TableDescriptor" };
|
||||
PropertyDef tableDescDef[] =
|
||||
{
|
||||
PropertyDef( statics.CATALOG_NAME , tString ),
|
||||
|
||||
@@ -267,10 +267,7 @@ namespace
|
||||
static constexpr OUStringLiteral s_sWildcard = u"%" ;
|
||||
|
||||
// we want all catalogues, all schemas, all tables
|
||||
Sequence< OUString > sTableTypes(3);
|
||||
sTableTypes[0] = "VIEW";
|
||||
sTableTypes[1] = "TABLE";
|
||||
sTableTypes[2] = s_sWildcard; // just to be sure to include anything else...
|
||||
Sequence< OUString > sTableTypes { "VIEW", "TABLE", s_sWildcard }; // this last one just to be sure to include anything else...
|
||||
|
||||
if ( _rxDBMeta.is() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user