diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-29 01:31:19 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-30 06:20:50 +0200 |
commit | ea9367037232054a576f1e6aabffeb3a62ffa44b (patch) | |
tree | ea5c755830b87fc140e9c3ce027b4957956fae48 /sw/source/core | |
parent | e82c9633e4f9bc4590bd6cd8d2a82a974ddaf00f (diff) |
Drop some uses of css::uno::Sequence::getConstArray ...
where it was obsoleted by commits 2484de6728bd11bb7949003d112f1ece2223c7a1
(Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and
fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[]
in internal code 2021-11-05).
Change-Id: I4ccc647bb794515c8c11f8dfd9a26563f4aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166819
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 3b5249efa8f8..2f076694a09c 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -2992,7 +2992,9 @@ static rtl::Reference<SwXHeadFootText> lcl_makeHeaderFooter(const sal_uInt16 nRe uno::Sequence<uno::Any> SwXPageStyle::GetPropertyValues_Impl(const uno::Sequence<OUString>& rPropertyNames) { - if(!GetDoc()) + SolarMutexGuard aGuard; + + if (!GetDoc()) throw uno::RuntimeException(); sal_Int32 nLength = rPropertyNames.getLength(); @@ -3183,13 +3185,10 @@ uno::Sequence<uno::Any> SwXPageStyle::GetPropertyValues_Impl(const uno::Sequence uno::Sequence<uno::Any> SwXPageStyle::getPropertyValues(const uno::Sequence<OUString>& rPropertyNames) { - SolarMutexGuard aGuard; - uno::Sequence<uno::Any> aValues; - // workaround for bad designed API try { - aValues = GetPropertyValues_Impl(rPropertyNames); + return GetPropertyValues_Impl(rPropertyNames); } catch(beans::UnknownPropertyException &) { @@ -3203,13 +3202,10 @@ uno::Sequence<uno::Any> SwXPageStyle::getPropertyValues(const uno::Sequence<OUSt throw lang::WrappedTargetRuntimeException("WrappedTargetException caught", getXWeak(), anyEx ); } - - return aValues; } uno::Any SwXPageStyle::getPropertyValue(const OUString& rPropertyName) { - SolarMutexGuard aGuard; const uno::Sequence<OUString> aProperties(&rPropertyName, 1); return GetPropertyValues_Impl(aProperties)[0]; } @@ -3838,9 +3834,8 @@ void SwXAutoStyle::setPropertyValue( const OUString& /*rPropertyName*/, const un uno::Any SwXAutoStyle::getPropertyValue( const OUString& rPropertyName ) { - SolarMutexGuard aGuard; const uno::Sequence<OUString> aProperties(&rPropertyName, 1); - return GetPropertyValues_Impl(aProperties).getConstArray()[0]; + return GetPropertyValues_Impl(aProperties)[0]; } void SwXAutoStyle::addPropertyChangeListener( const OUString& /*aPropertyName*/, @@ -3872,7 +3867,9 @@ void SwXAutoStyle::setPropertyValues( uno::Sequence< uno::Any > SwXAutoStyle::GetPropertyValues_Impl( const uno::Sequence< OUString > & rPropertyNames ) { - if( !mpSet ) + SolarMutexGuard aGuard; + + if (!mpSet) { throw uno::RuntimeException(); } @@ -4009,13 +4006,10 @@ uno::Sequence< uno::Any > SwXAutoStyle::GetPropertyValues_Impl( uno::Sequence< uno::Any > SwXAutoStyle::getPropertyValues ( const uno::Sequence< OUString >& rPropertyNames ) { - SolarMutexGuard aGuard; - uno::Sequence< uno::Any > aValues; - // workaround for bad designed API try { - aValues = GetPropertyValues_Impl( rPropertyNames ); + return GetPropertyValues_Impl( rPropertyNames ); } catch (beans::UnknownPropertyException &) { @@ -4027,8 +4021,6 @@ uno::Sequence< uno::Any > SwXAutoStyle::getPropertyValues ( css::uno::Any exc = cppu::getCaughtException(); throw lang::WrappedTargetRuntimeException("WrappedTargetException caught", getXWeak(), exc ); } - - return aValues; } void SwXAutoStyle::addPropertiesChangeListener( |