diff options
Diffstat (limited to 'dbaccess/source/ui/misc')
-rw-r--r-- | dbaccess/source/ui/misc/TokenWriter.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WCopyTable.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/databaseobjectview.cxx | 19 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/linkeddocuments.cxx | 34 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/singledoccontroller.cxx | 6 |
5 files changed, 31 insertions, 40 deletions
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index c0401f591a6f..615620ba6271 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -695,8 +695,9 @@ void OHTMLImportExport::WriteTables() { sal_Int32 nCount = m_xResultSetMetaData->getColumnCount(); aNames.realloc(nCount); + auto aNamesRange = asNonConstRange(aNames); for (sal_Int32 i= 0; i < nCount; ++i) - aNames[i] = m_xResultSetMetaData->getColumnName(i+1); + aNamesRange[i] = m_xResultSetMetaData->getColumnName(i+1); bUseResultMetaData = true; } } diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index b72e16180727..376c882d373f 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -55,6 +55,8 @@ #include <sal/log.hxx> #include <tools/diagnose_ex.h> +#include <algorithm> + using namespace ::dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -327,9 +329,8 @@ void NamedTableCopySource::impl_ensureColumnInfo_throw() Sequence< OUString > NamedTableCopySource::getColumnNames() const { Sequence< OUString > aNames( m_aColumnInfo.size() ); - size_t nPos = 0; - for (auto const& elem : m_aColumnInfo) - aNames[ nPos++ ] = elem.GetName(); + std::transform(m_aColumnInfo.begin(), m_aColumnInfo.end(), aNames.getArray(), + [](const auto& elem) { return elem.GetName(); }); return aNames; } @@ -346,7 +347,7 @@ Sequence< OUString > NamedTableCopySource::getPrimaryKeyColumnNames() const { sal_Int32 len( aPKColNames.getLength() ); aPKColNames.realloc( len + 1 ); - aPKColNames[ len ] = xPKDescRow->getString( 4 ); // COLUMN_NAME + aPKColNames.getArray()[ len ] = xPKDescRow->getString( 4 ); // COLUMN_NAME } } catch( const Exception& ) diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index 7c47a8101bb6..4a58f085acb0 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -103,21 +103,10 @@ namespace dbaui if ( !m_xFrameLoader.is() ) { Reference< XSingleServiceFactory > xFact = TaskCreator::create(m_xORB); - Sequence< Any > lArgs(3); - NamedValue aProp; - sal_Int32 nArg = 0; - - aProp.Name = "ParentFrame"; - aProp.Value <<= m_xParentFrame; - lArgs[nArg++] <<= aProp; - - aProp.Name = "TopWindow"; - aProp.Value <<= true; - lArgs[nArg++] <<= aProp; - - aProp.Name = "SupportPersistentWindowState"; - aProp.Value <<= true; - lArgs[nArg++] <<= aProp; + Sequence< Any > lArgs{ Any(NamedValue("ParentFrame", Any(m_xParentFrame))), + Any(NamedValue("TopWindow", Any(true))), + Any(NamedValue("SupportPersistentWindowState", + Any(true))) }; m_xFrameLoader.set(xFact->createInstanceWithArguments(lArgs), UNO_QUERY_THROW); diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index 13effe4ccd93..15394133ed59 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -65,24 +65,22 @@ namespace dbaui sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11, sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15 ) { - Sequence< sal_Int8 > aResult( 16 ); - aResult[0] = static_cast<sal_Int8>(n1 >> 24); - aResult[1] = static_cast<sal_Int8>(( n1 << 8 ) >> 24); - aResult[2] = static_cast<sal_Int8>(( n1 << 16 ) >> 24); - aResult[3] = static_cast<sal_Int8>(( n1 << 24 ) >> 24); - aResult[4] = static_cast<sal_Int8>(n2 >> 8); - aResult[5] = static_cast<sal_Int8>(( n2 << 8 ) >> 8); - aResult[6] = static_cast<sal_Int8>(n3 >> 8); - aResult[7] = static_cast<sal_Int8>(( n3 << 8 ) >> 8); - aResult[8] = b8; - aResult[9] = b9; - aResult[10] = b10; - aResult[11] = b11; - aResult[12] = b12; - aResult[13] = b13; - aResult[14] = b14; - aResult[15] = b15; - + Sequence< sal_Int8 > aResult{ /* [ 0] */ static_cast<sal_Int8>(n1 >> 24), + /* [ 1] */ static_cast<sal_Int8>(( n1 << 8 ) >> 24), + /* [ 2] */ static_cast<sal_Int8>(( n1 << 16 ) >> 24), + /* [ 3] */ static_cast<sal_Int8>(( n1 << 24 ) >> 24), + /* [ 4] */ static_cast<sal_Int8>(n2 >> 8), + /* [ 5] */ static_cast<sal_Int8>(( n2 << 8 ) >> 8), + /* [ 6] */ static_cast<sal_Int8>(n3 >> 8), + /* [ 7] */ static_cast<sal_Int8>(( n3 << 8 ) >> 8), + /* [ 8] */ static_cast<sal_Int8>(b8), + /* [ 9] */ static_cast<sal_Int8>(b9), + /* [10] */ static_cast<sal_Int8>(b10), + /* [11] */ static_cast<sal_Int8>(b11), + /* [12] */ static_cast<sal_Int8>(b12), + /* [13] */ static_cast<sal_Int8>(b13), + /* [14] */ static_cast<sal_Int8>(b14), + /* [15] */ static_cast<sal_Int8>(b15) }; return aResult; } } diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index c07da46c955f..28b0c9e774bd 100644 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -123,8 +123,9 @@ namespace dbaui { size_t nCount(GetUndoManager().GetUndoActionCount()); Sequence<OUString> aSeq(nCount); + auto aSeqRange = asNonConstRange(aSeq); for (size_t n = 0; n < nCount; ++n) - aSeq[n] = GetUndoManager().GetUndoActionComment(n); + aSeqRange[n] = GetUndoManager().GetUndoActionComment(n); aReturn.aValue <<= aSeq; aReturn.bEnabled = true; break; @@ -134,8 +135,9 @@ namespace dbaui { size_t nCount(GetUndoManager().GetRedoActionCount()); Sequence<OUString> aSeq(nCount); + auto aSeqRange = asNonConstRange(aSeq); for (size_t n = 0; n < nCount; ++n) - aSeq[n] = GetUndoManager().GetRedoActionComment(n); + aSeqRange[n] = GetUndoManager().GetRedoActionComment(n); aReturn.aValue <<= aSeq; aReturn.bEnabled = true; break; |