diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-28 16:09:55 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 06:50:32 +0200 |
commit | 81a7d46d9f89252146bf3ba4074625bdfe3345f8 (patch) | |
tree | aecb50de3e630b2041cab18889df83e275a29f6b /basic/source/uno | |
parent | 86d11097cd4a2ae4a6b4e6b35e28a6075376d67a (diff) |
Prepare for removal of non-const operator[] from Sequence in basic
Change-Id: If048bc301c38ac5ac5412a7d8f69231705088a50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124343
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic/source/uno')
-rw-r--r-- | basic/source/uno/dlgcont.cxx | 4 | ||||
-rw-r--r-- | basic/source/uno/modsizeexceeded.cxx | 4 | ||||
-rw-r--r-- | basic/source/uno/namecont.cxx | 16 |
3 files changed, 7 insertions, 17 deletions
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index 56305e820870..31c64aef95f5 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -121,9 +121,7 @@ static bool writeOasis2OOoLibraryElement( xWriter->setOutputStream( xOutput ); - Sequence<Any> aArgs( 1 ); - aArgs[0] <<= xWriter; - + Sequence<Any> aArgs{ Any(xWriter) }; Reference< xml::sax::XDocumentHandler > xHandler( xSMgr->createInstanceWithArgumentsAndContext( "com.sun.star.comp.Oasis2OOoTransformer", diff --git a/basic/source/uno/modsizeexceeded.cxx b/basic/source/uno/modsizeexceeded.cxx index 897c460f5940..27c795934961 100644 --- a/basic/source/uno/modsizeexceeded.cxx +++ b/basic/source/uno/modsizeexceeded.cxx @@ -36,9 +36,7 @@ ModuleSizeExceeded::ModuleSizeExceeded(const std::vector<OUString>& sModules) m_xAbort = new comphelper::OInteractionAbort; m_xApprove = new comphelper::OInteractionApprove; - m_lContinuations.realloc(2); - m_lContinuations[0] = m_xApprove; - m_lContinuations[1] = m_xAbort; + m_lContinuations = { m_xApprove, m_xAbort }; } bool ModuleSizeExceeded::isAbort() const diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index 98b999ecf29e..a2cb37611f08 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -172,10 +172,7 @@ void NameContainer::replaceByName( const OUString& aName, const Any& aElement ) ChangesEvent aEvent; aEvent.Source = mpxEventSource; aEvent.Base <<= aEvent.Source; - aEvent.Changes.realloc( 1 ); - aEvent.Changes[ 0 ].Accessor <<= aName; - aEvent.Changes[ 0 ].Element = aElement; - aEvent.Changes[ 0 ].ReplacedElement = aOldElement; + aEvent.Changes = { { Any(aName), aElement, aOldElement } }; maChangesListeners.notifyEach( &XChangesListener::changesOccurred, aEvent ); } } @@ -223,9 +220,7 @@ void NameContainer::insertNoCheck(const OUString& aName, const Any& aElement) ChangesEvent aEvent; aEvent.Source = mpxEventSource; aEvent.Base <<= aEvent.Source; - aEvent.Changes.realloc( 1 ); - aEvent.Changes[ 0 ].Accessor <<= aName; - aEvent.Changes[ 0 ].Element = aElement; + aEvent.Changes = { { Any(aName), aElement, {} } }; maChangesListeners.notifyEach( &XChangesListener::changesOccurred, aEvent ); } } @@ -277,10 +272,9 @@ void NameContainer::removeByName( const OUString& aName ) ChangesEvent aEvent; aEvent.Source = mpxEventSource; aEvent.Base <<= aEvent.Source; - aEvent.Changes.realloc( 1 ); - aEvent.Changes[ 0 ].Accessor <<= aName; - // aEvent.Changes[ 0 ].Element remains empty (meaning "replaced with nothing") - aEvent.Changes[ 0 ].ReplacedElement = aOldElement; + aEvent.Changes = { { Any(aName), + {}, // Element remains empty (meaning "replaced with nothing") + aOldElement } }; maChangesListeners.notifyEach( &XChangesListener::changesOccurred, aEvent ); } } |