diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 08:14:44 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 13:22:00 +0200 |
commit | 3412c0f091c54da74ea6964062b9be302e126fe9 (patch) | |
tree | 08c54f59688726f54b235d8f3d818beb462634f5 /dbaccess/source/ui/browser | |
parent | 4b2ad350213ececdbb1002b3ada87791dc126b20 (diff) |
Prepare for removal of non-const operator[] from Sequence in dbaccess
Change-Id: Iddb96d39a512ef68827ecf89f3b5650950f88096
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124357
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'dbaccess/source/ui/browser')
-rw-r--r-- | dbaccess/source/ui/browser/formadapter.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/sbagrid.cxx | 16 |
2 files changed, 8 insertions, 11 deletions
diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx index 37f35a0472ee..4b98babb26c9 100644 --- a/dbaccess/source/ui/browser/formadapter.cxx +++ b/dbaccess/source/ui/browser/formadapter.cxx @@ -1227,13 +1227,14 @@ Sequence< Any > SAL_CALL SbaXFormAdapter::getPropertyValues(const Sequence< OUSt return Sequence< Any>(aPropertyNames.getLength()); Sequence< Any> aReturn = xSet->getPropertyValues(aPropertyNames); + auto aReturnRange = asNonConstRange(aReturn); // search for (and fake) the NAME property OSL_ENSURE(aReturn.getLength() == aPropertyNames.getLength(), "SAL_CALL SbaXFormAdapter::getPropertyValues : the main form returned an invalid-length sequence !"); for (sal_Int32 i=0; i<aPropertyNames.getLength(); ++i) if (aPropertyNames[i] == PROPERTY_NAME) { - aReturn[i] <<= m_sName; + aReturnRange[i] <<= m_sName; break; } diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index db4dc6da6290..16980f05bfe5 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -44,6 +44,7 @@ #include <svl/zforlist.hxx> #include <cppuhelper/queryinterface.hxx> #include <connectivity/dbtools.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/types.hxx> #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/SQLException.hpp> @@ -777,14 +778,10 @@ void SbaGridControl::SetBrowserAttrs() try { Reference< XComponentContext > xContext = getContext(); - css::beans::PropertyValue aArg; - css::uno::Sequence<css::uno::Any> aArguments(2); - aArg.Name = "IntrospectedObject"; - aArg.Value <<= xGridModel; - aArguments[0] <<= aArg; - aArg.Name = "ParentWindow"; - aArg.Value <<= VCLUnoHelper::GetInterface(this); - aArguments[1] <<= aArg; + css::uno::Sequence<css::uno::Any> aArguments{ + Any(comphelper::makePropertyValue("IntrospectedObject", xGridModel)), + Any(comphelper::makePropertyValue("ParentWindow", VCLUnoHelper::GetInterface(this))) + }; Reference<XExecutableDialog> xExecute(xContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.form.ControlFontDialog", aArguments, xContext), css::uno::UNO_QUERY_THROW); xExecute->execute(); @@ -1063,8 +1060,7 @@ void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfC // collect the affected rows if ((GetSelectRowCount() == 0) && (nRowPos >= 0)) { - aSelectedRows.realloc( 1 ); - aSelectedRows[0] <<= static_cast<sal_Int32>(nRowPos + 1); + aSelectedRows = { Any(static_cast<sal_Int32>(nRowPos + 1)) }; bSelectionBookmarks = false; } else if ( !IsAllSelected() && GetSelectRowCount() ) |