diff options
Diffstat (limited to 'dbaccess/source/ui/dlg')
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionHelper.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/paramdialog.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/queryfilter.cxx | 52 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/tablespage.cxx | 5 |
4 files changed, 20 insertions, 45 deletions
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 184f49046a90..b9c954c62c0b 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -614,16 +614,14 @@ namespace dbaui // the properties which need to be set on the new content Sequence< OUString > aNewDirectoryProperties { "Title" }; - // the values to be set - Sequence< Any > aNewDirectoryAttributes(1); - // loop for ( std::vector< OUString >::const_reverse_iterator aLocalName = aToBeCreated.rbegin(); aLocalName != aToBeCreated.rend(); ++aLocalName ) { - aNewDirectoryAttributes[0] <<= *aLocalName; + // the values to be set + Sequence< Any > aNewDirectoryAttributes{ Any(* aLocalName) }; if (!aParent.insertNewContent(sContentType, aNewDirectoryProperties, aNewDirectoryAttributes, aParent)) return false; } diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 5bb6024a4b67..12f96d186f78 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -280,7 +280,7 @@ namespace dbaui return true; } - m_aFinalValues[m_nCurrentlySelected].Value <<= m_xParam->get_text(); + m_aFinalValues.getArray()[m_nCurrentlySelected].Value <<= m_xParam->get_text(); } // initialize the controls with the new values diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 1b75869cf15e..c5490bd959c1 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -675,22 +675,18 @@ IMPL_LINK_NOARG(DlgFilterCrit, ListSelectCompHdl, weld::ComboBox&, void) void DlgFilterCrit::BuildWherePart() { - Sequence<Sequence<PropertyValue> > aFilter,aHaving; - aFilter.realloc(1); - aHaving.realloc(1); + Sequence<Sequence<PropertyValue> > aFilter(1),aHaving(1); if( LbPos(*m_xLB_WHEREFIELD1) != 0 ) { PropertyValue aValue; if ( getCondition(*m_xLB_WHEREFIELD1,*m_xLB_WHERECOMP1,*m_xET_WHEREVALUE1,aValue) ) { - aHaving[0].realloc(1); - aHaving[0][0] = aValue; + aHaving = { { aValue } }; } else { - aFilter[0].realloc(1); - aFilter[0][0] = aValue; + aFilter = { { aValue} }; } } @@ -700,22 +696,13 @@ void DlgFilterCrit::BuildWherePart() Sequence<Sequence<PropertyValue> >& _rValues = aFilter; if ( getCondition(*m_xLB_WHEREFIELD2,*m_xLB_WHERECOMP2,*m_xET_WHEREVALUE2,aValue) ) _rValues = aHaving; - PropertyValue* pPos = nullptr; if ( m_xLB_WHERECOND2->get_active() ) - { - sal_Int32 nPos = _rValues.getLength(); - _rValues.realloc( nPos + 1); - _rValues[nPos].realloc( 1); - pPos = &_rValues[nPos][0]; - } - else - { - sal_Int32 nPos = _rValues.getLength() - 1; - sal_Int32 nAndPos = _rValues[nPos].getLength(); - _rValues[nPos].realloc( _rValues[nPos].getLength() + 1); - pPos = &_rValues[nPos][nAndPos]; - } - *pPos = aValue; + _rValues.realloc( _rValues.getLength() + 1); + sal_Int32 nPos = _rValues.getLength() - 1; + sal_Int32 nAndPos = _rValues[nPos].getLength(); + auto pValues = _rValues.getArray(); + pValues[nPos].realloc( _rValues[nPos].getLength() + 1); + pValues[nPos].getArray()[nAndPos] = aValue; } if( LbPos(*m_xLB_WHEREFIELD3) != 0 ) @@ -724,22 +711,13 @@ void DlgFilterCrit::BuildWherePart() Sequence<Sequence<PropertyValue> >& _rValues = aFilter; if ( getCondition(*m_xLB_WHEREFIELD3,*m_xLB_WHERECOMP3,*m_xET_WHEREVALUE3,aValue) ) _rValues = aHaving; - PropertyValue* pPos = nullptr; if (m_xLB_WHERECOND3->get_active()) - { - sal_Int32 nPos = _rValues.getLength(); - _rValues.realloc( nPos + 1); - _rValues[nPos].realloc( 1); - pPos = &_rValues[nPos][0]; - } - else - { - sal_Int32 nPos = _rValues.getLength() - 1; - sal_Int32 nAndPos = _rValues[nPos].getLength(); - _rValues[nPos].realloc( _rValues[nPos].getLength() + 1); - pPos = &_rValues[nPos][nAndPos]; - } - *pPos = aValue; + _rValues.realloc( _rValues.getLength() + 1); + sal_Int32 nPos = _rValues.getLength() - 1; + sal_Int32 nAndPos = _rValues[nPos].getLength(); + auto pValues = _rValues.getArray(); + pValues[nPos].realloc( _rValues[nPos].getLength() + 1); + pValues[nPos].getArray()[nAndPos] = aValue; } try { diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index 91456123ec58..d8ff8f863923 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -412,7 +412,7 @@ namespace dbaui sal_Int32 nOldLen = aTableFilter.getLength(); aTableFilter.realloc(nOldLen + 1); // add the new name - aTableFilter[nOldLen] = sComposedName.makeStringAndClear(); + aTableFilter.getArray()[nOldLen] = sComposedName.makeStringAndClear(); } if (bCatalogWildcard) @@ -463,8 +463,7 @@ namespace dbaui auto xRoot = m_xTablesList->getAllObjectsEntry(); if (xRoot && m_xTablesList->isWildcardChecked(*xRoot)) { - aTableFilter.realloc(1); - aTableFilter[0] = "%"; + aTableFilter = { "%" }; } else { |