core.git: svl/source
svl/source/fsstor/ostreamcontainer.cxx | 40 ++--- 1 file changed, 18 insertions(+), 22 deletions(-) New commits: commit e1e7a1ef0f4abc10a55cf9b093468ba6adf0505e Author: Noel Grandin AuthorDate: Thu Oct 3 19:11:33 2024 +0200 Commit: Noel Grandin CommitDate: Sat Oct 5 08:57:43 2024 +0200 cid#1556892 Data race condition Change-Id: I69e3148fc01378a5cea5f23aa992658db3997edc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174501 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svl/source/fsstor/ostreamcontainer.cxx b/svl/source/fsstor/ostreamcontainer.cxx index 53814285880e..78a168f04b49 100644 --- a/svl/source/fsstor/ostreamcontainer.cxx +++ b/svl/source/fsstor/ostreamcontainer.cxx @@ -135,31 +135,27 @@ void SAL_CALL OFSStreamContainer::release() // XTypeProvider uno::Sequence< uno::Type > SAL_CALL OFSStreamContainer::getTypes() { +std::scoped_lock aGuard( m_aMutex ); if ( !m_aTypes.hasElements() ) { -std::scoped_lock aGuard( m_aMutex ); - -if ( !m_aTypes.hasElements() ) +std::vector tmp { -std::vector tmp -{ -cppu::UnoType::get(), -cppu::UnoType::get() -}; - -if ( m_xSeekable.is() ) -tmp.push_back(cppu::UnoType::get()); -if ( m_xInputStream.is() ) -tmp.push_back(cppu::UnoType::get()); -if ( m_xOutputStream.is() ) -tmp.push_back(cppu::UnoType::get()); -if ( m_xTruncate.is() ) -tmp.push_back(cppu::UnoType::get()); -if ( m_xAsyncOutputMonitor.is() ) -tmp.push_back(cppu::UnoType::get()); - -m_aTypes = comphelper::containerToSequence(tmp); -} +cppu::UnoType::get(), +cppu::UnoType::get() +}; + +if ( m_xSeekable.is() ) +tmp.push_back(cppu::UnoType::get()); +if ( m_xInputStream.is() ) +tmp.push_back(cppu::UnoType::get()); +if ( m_xOutputStream.is() ) +tmp.push_back(cppu::UnoType::get()); +if ( m_xTruncate.is() ) +tmp.push_back(cppu::UnoType::get()); +if ( m_xAsyncOutputMonitor.is() ) +tmp.push_back(cppu::UnoType::get()); + +m_aTypes = comphelper::containerToSequence(tmp); } return m_aTypes; }
core.git: 2 commits - sfx2/source stoc/source
sfx2/source/control/thumbnailviewacc.hxx |6 +- stoc/source/inspect/introspection.cxx| 27 +++ 2 files changed, 8 insertions(+), 25 deletions(-) New commits: commit 46f5aa4f5897b6c3a151cf7bca0d4fcc6cd985c4 Author: Noel Grandin AuthorDate: Thu Oct 3 19:08:14 2024 +0200 Commit: Noel Grandin CommitDate: Sat Oct 5 08:57:34 2024 +0200 cid#1607010 Data race condition Change-Id: Ic89cfabeb25b0b82f2b766ea81f13b0d91bd8de8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174500 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 716e35c95df1..114983d08a7f 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -785,15 +785,8 @@ ImplIntrospectionAccess::ImplIntrospectionAccess Reference ImplIntrospectionAccess::getXElementAccess() { std::unique_lock aGuard( m_aMutex ); - if( !mxObjElementAccess.is() ) -{ -aGuard.unlock(); -Reference xElementAccess( mxIface, UNO_QUERY ); -aGuard.lock(); -if( !mxObjElementAccess.is() ) -mxObjElementAccess = std::move(xElementAccess); -} +mxObjElementAccess.set( mxIface, UNO_QUERY ); return mxObjElementAccess; } @@ -922,30 +915,16 @@ Reference ImplIntrospectionAccess::getXIndexAccess() Reference ImplIntrospectionAccess::getXEnumerationAccess() { std::unique_lock aGuard( m_aMutex ); - if( !mxObjEnumerationAccess.is() ) -{ -aGuard.unlock(); -Reference xEnumerationAccess( mxIface, UNO_QUERY ); -aGuard.lock(); -if( !mxObjEnumerationAccess.is() ) -mxObjEnumerationAccess = std::move(xEnumerationAccess); -} +mxObjEnumerationAccess.set( mxIface, UNO_QUERY ); return mxObjEnumerationAccess; } Reference ImplIntrospectionAccess::getXIdlArray() { std::unique_lock aGuard( m_aMutex ); - if( !mxObjIdlArray.is() ) -{ -aGuard.unlock(); -Reference xIdlArray( mxIface, UNO_QUERY ); -aGuard.lock(); -if( !mxObjIdlArray.is() ) -mxObjIdlArray = std::move(xIdlArray); -} +mxObjIdlArray.set( mxIface, UNO_QUERY ); return mxObjIdlArray; } commit 5195aadf1cfcf53316ff4d5b36635548e95120cb Author: Noel Grandin AuthorDate: Thu Oct 3 18:57:07 2024 +0200 Commit: Noel Grandin CommitDate: Sat Oct 5 08:57:25 2024 +0200 cid#1607477 Data race condition Change-Id: I8efcac94aebd10af8d6e749bbf9ad57a0097da49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174499 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sfx2/source/control/thumbnailviewacc.hxx b/sfx2/source/control/thumbnailviewacc.hxx index 63ea533009ad..e483e64a7afc 100644 --- a/sfx2/source/control/thumbnailviewacc.hxx +++ b/sfx2/source/control/thumbnailviewacc.hxx @@ -54,7 +54,11 @@ public: const css::uno::Any& rOldValue, const css::uno::Any& rNewValue ); -bool HasAccessibleListeners() const { return( mxEventListeners.size() > 0 ); } +bool HasAccessibleListeners() const +{ +std::unique_lock aGuard (m_aMutex); +return( mxEventListeners.size() > 0 ); +} public: /** Called by the corresponding ValueSet when it gets the focus.
core.git: external/skia
external/skia/Library_skia.mk | 989 +- external/skia/README |3 2 files changed, 600 insertions(+), 392 deletions(-) New commits: commit 19566380abbb936104076ae42d34f2075a89dc65 Author: Noel Grandin AuthorDate: Fri Oct 4 13:31:00 2024 +0200 Commit: Noel Grandin CommitDate: Sat Oct 5 08:41:16 2024 +0200 Re-organise the skia makefile so it more closely corresponds to the GN buildfiles that it is derived from, in order to make updating to newer versions of skia easier Change-Id: Iffd934d0bb05f4abe2b97838eb18baccac4a5096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174474 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk index 9d240e40da0c..a12d339ba7a9 100644 --- a/external/skia/Library_skia.mk +++ b/external/skia/Library_skia.mk @@ -139,10 +139,188 @@ $(eval $(call gb_Library_add_exception_objects,skia,\ $(eval $(call gb_Library_set_generated_cxx_suffix,skia,cpp)) +# from file skia/gn/BUILD.gn:416, target "optional("fontmgr_fontconfig")" +# +ifneq ($(filter-out WNT MACOSX,$(OS)),) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/ports/SkFontMgr_fontconfig \ +)) +endif + +# from file skia/gn/BUILD.gn:426, target "optional("fontmgr_fontconfig_factory")" +# +ifneq ($(filter-out WNT MACOSX,$(OS)),) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/ports/SkFontMgr_fontconfig_factory \ +)) +endif + +# from file skia/gn/BUILD.gn:432, target "optional("fontmgr_FontConfigInterface")" +# +ifneq ($(filter-out WNT MACOSX,$(OS)),) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/ports/SkFontConfigInterface \ +UnpackedTarball/skia/src/ports/SkFontConfigInterface_direct \ +UnpackedTarball/skia/src/ports/SkFontConfigInterface_direct_factory \ +UnpackedTarball/skia/src/ports/SkFontMgr_FontConfigInterface \ +)) +endif + +# from file skia/gn/BUILD.gn:472, target "optional("fontmgr_mac_ct")" +# +ifeq ($(OS),MACOSX) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/ports/SkFontMgr_mac_ct \ +UnpackedTarball/skia/src/ports/SkScalerContext_mac_ct \ +UnpackedTarball/skia/src/ports/SkTypeface_mac_ct \ +)) +endif + +# from file skia/gn/BUILD.gn:508, target "optional("fontmgr_mac_ct_factory")" +# +ifeq ($(OS),MACOSX) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/ports/SkFontMgr_mac_ct_factory \ +)) +endif + +# from file skia/gn/BUILD.gn:514, target "optional("fontmgr_win")" +# +ifeq ($(OS),WNT) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/fonts/SkFontMgr_indirect \ +UnpackedTarball/skia/src/ports/SkFontMgr_win_dw \ +UnpackedTarball/skia/src/ports/SkScalerContext_win_dw \ +UnpackedTarball/skia/src/ports/SkTypeface_win_dw \ +)) +endif + +# from file skia/gn/BUILD.gn:530, target "optional("fontmgr_win_factory")" +# +ifeq ($(OS),WNT) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/ports/SkFontMgr_win_dw_factory \ +)) +endif + +# from file skia/gn/BUILD.gn:536, target "optional("fontmgr_win_gdi")" +# +ifeq ($(OS),WNT) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/ports/SkFontHost_win \ +)) +endif + +# from file skia/gn/BUILD.gn:1278, target "optional("png_decode")" +# +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/codec/SkIcoCodec \ +UnpackedTarball/skia/src/codec/SkPngCodec \ +)) + +# from file skia/gn/BUILD.gn:1314, target "typeface_freetype" +# +ifneq ($(filter-out WNT MACOSX,$(OS)),) +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/ports/SkFontHost_FreeType \ +UnpackedTarball/skia/src/ports/SkFontHost_FreeType_common \ +)) +endif + +# from file skia/gn/BUILD.gn:1400, target "skia_component("skia")" +# +$(eval $(call gb_Library_add_generated_exception_objects,skia,\ +UnpackedTarball/skia/src/codec/SkAndroidCodec \ +UnpackedTarball/skia/src/codec/SkAndroidCodecAdapter \ +UnpackedTarball/skia/src/codec/SkEncodedInfo \ +UnpackedTarball/skia/src/codec/SkParseEncodedOrigin \ +UnpackedTarball/skia/src/codec/SkSampledCodec \ +UnpackedTarball/skia/src/ports/SkGlobalInitialization_default \ +UnpackedTarball/skia/src/ports/SkOSFile_stdio \ +UnpackedTarball/skia/src/sfnt/SkOTTable_name \ +UnpackedTarball/skia/src/sfnt/SkOTUtils \ +)) +ifeq ($(OS),WNT) +$(eval $(call gb_Library_add_generated_exception_obje
core.git: Branch 'libreoffice-24-8' - forms/source
forms/source/misc/limitedformats.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 3e5c424a5b2a2739dd4a50bfc14ac350b9638837 Author: Noel Grandin AuthorDate: Tue Oct 1 15:39:51 2024 +0200 Commit: Xisco Fauli CommitDate: Fri Oct 4 10:32:27 2024 +0200 tdf#162713 Changed format for date-field and time-field in form regression from commit 9c92eb6800468de34c5aec3690c1b990a4e763c9 Author: Noel Grandin Date: Mon May 13 15:42:27 2024 +0200 createFromAscii -> OUString literals in OLimitedFormats Change-Id: I620526e3e0efd9e9376e428881e0240e2d3017d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174352 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit 54fa4c438bd458d72a8e23a6819c7be639eaee92) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174329 Reviewed-by: Xisco Fauli diff --git a/forms/source/misc/limitedformats.cxx b/forms/source/misc/limitedformats.cxx index c40de6b23430..628a42c55892 100644 --- a/forms/source/misc/limitedformats.cxx +++ b/forms/source/misc/limitedformats.cxx @@ -243,8 +243,8 @@ namespace frm std::span pFormats = lcl_getFormatTable(m_nTableId); // seek to the nValue'th entry -OSL_ENSURE(pFormats.size() < o3tl::make_unsigned(nValue), "OLimitedFormats::getFormatKeyPropertyValue: did not find the value!"); -if (pFormats.size() < o3tl::make_unsigned(nValue)) +OSL_ENSURE(o3tl::make_unsigned(nValue) < pFormats.size(), "OLimitedFormats::getFormatKeyPropertyValue: did not find the value!"); +if (o3tl::make_unsigned(nValue) < pFormats.size()) _rValue <<= pFormats[nValue].nKey; // TODO: should use a standard format for the control type we're working for
core.git: scripting/source
scripting/source/provider/MasterScriptProvider.cxx | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) New commits: commit 94c33fb4f2141d9015db5ec4ea889e28ba27fa68 Author: Noel Grandin AuthorDate: Thu Oct 3 16:10:32 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 18:44:28 2024 +0200 cid#1556166 Data race condition Change-Id: I2b5e4fe19c8ba4792b3cb89a90278540733192d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174431 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index b9e5426d5391..ccbe721350a5 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -334,21 +334,18 @@ MasterScriptProvider::getScript( const OUString& scriptURI ) ProviderCache* MasterScriptProvider::providerCache() { +std::scoped_lock aGuard( m_mutex ); if ( !m_pPCache ) { -std::scoped_lock aGuard( m_mutex ); -if ( !m_pPCache ) -{ -Sequence denylist { u"com.sun.star.script.provider.ScriptProviderForBasic"_ustr }; +Sequence denylist { u"com.sun.star.script.provider.ScriptProviderForBasic"_ustr }; -if ( !m_bIsPkgMSP ) -{ -m_pPCache.reset( new ProviderCache( m_xContext, m_sAargs ) ); -} -else -{ -m_pPCache.reset( new ProviderCache( m_xContext, m_sAargs, denylist ) ); -} +if ( !m_bIsPkgMSP ) +{ +m_pPCache.reset( new ProviderCache( m_xContext, m_sAargs ) ); +} +else +{ +m_pPCache.reset( new ProviderCache( m_xContext, m_sAargs, denylist ) ); } } return m_pPCache.get();
core.git: 2 commits - filter/source vcl/source
filter/source/xsltfilter/LibXSLTTransformer.cxx |6 +++--- vcl/source/window/dndlistenercontainer.cxx | 11 ++- 2 files changed, 9 insertions(+), 8 deletions(-) New commits: commit 9c59f0bc666ff841bd51eaaddbb04bb6470a13eb Author: Noel Grandin AuthorDate: Thu Oct 3 16:02:23 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 18:44:18 2024 +0200 cid#1556833 Data race condition Change-Id: I8b6b929240d9bd730480c5559bc40f39e9c93511 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174430 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx b/filter/source/xsltfilter/LibXSLTTransformer.cxx index 017fad2c8548..4defe3ff160d 100644 --- a/filter/source/xsltfilter/LibXSLTTransformer.cxx +++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx @@ -315,10 +315,10 @@ namespace XSLT std::scoped_lock g(m_mutex); m_tcontext = tcontext; } -oh->registercontext(m_tcontext); -xsltQuoteUserParams(m_tcontext, params.data()); +oh->registercontext(tcontext); +xsltQuoteUserParams(tcontext, params.data()); result = xsltApplyStylesheetUser(styleSheet, doc, nullptr, nullptr, nullptr, - m_tcontext); + tcontext); } if (result) commit 6f7265ef036ca421654670b2b5fd59222a99ecd7 Author: Noel Grandin AuthorDate: Thu Oct 3 15:59:45 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 18:44:06 2024 +0200 cid#1608220 Data race condition Change-Id: I7ff30128d663ca3524dc95ef99ef8c64dd158643 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174429 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/window/dndlistenercontainer.cxx b/vcl/source/window/dndlistenercontainer.cxx index 9ff128c808bb..df8b6114f93b 100644 --- a/vcl/source/window/dndlistenercontainer.cxx +++ b/vcl/source/window/dndlistenercontainer.cxx @@ -384,11 +384,12 @@ sal_uInt32 DNDListenerContainer::fireDragGestureEvent( sal_Int8 dragAction, sal_ void SAL_CALL DNDListenerContainer::acceptDrag( sal_Int8 dragOperation ) { -if( m_xDropTargetDragContext.is() ) -{ -m_xDropTargetDragContext->acceptDrag( dragOperation ); -m_xDropTargetDragContext.clear(); -} +std::unique_lock g(m_aMutex); +if( !m_xDropTargetDragContext ) +return; +auto xTmpDragContext = std::move(m_xDropTargetDragContext); +g.unlock(); +xTmpDragContext->acceptDrag( dragOperation ); } void SAL_CALL DNDListenerContainer::rejectDrag( )
core.git: 2 commits - toolkit/inc vcl/source
toolkit/inc/awt/vclxpointer.hxx |8 ++-- vcl/source/app/session.cxx |9 +++-- 2 files changed, 13 insertions(+), 4 deletions(-) New commits: commit fa58e872794f23a84e6a741f0d3074bca9f93c19 Author: Noel Grandin AuthorDate: Thu Oct 3 15:56:43 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 18:43:57 2024 +0200 cid#1606585 Data race condition and cid#1606993 Data race condition Change-Id: I291829f0b59fc228ad3f305f280f7f58aae0d40b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174428 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx index b742fc948ba0..2ec3bbc5c7d6 100644 --- a/vcl/source/app/session.cxx +++ b/vcl/source/app/session.cxx @@ -294,16 +294,21 @@ void SAL_CALL VCLSession::queryInteraction( const css::uno::ReferenceapproveInteraction( false ); else xListener->approveInteraction( true ); return; } -std::unique_lock aGuard( m_aMutex ); if( ! m_bInteractionRequested ) { if (m_xSession) commit 95faca7cf8e8bf09b30c3ee9f4d6b5e81a660c2f Author: Noel Grandin AuthorDate: Thu Oct 3 15:52:10 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 18:43:47 2024 +0200 cid#1555162 Data race condition Change-Id: I0f1aa14732d6fe32ac6875e29cb678cb0b2d2872 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174427 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/inc/awt/vclxpointer.hxx b/toolkit/inc/awt/vclxpointer.hxx index 103031926919..6a4c21b1d611 100644 --- a/toolkit/inc/awt/vclxpointer.hxx +++ b/toolkit/inc/awt/vclxpointer.hxx @@ -34,14 +34,18 @@ class VCLXPointer final : public cppu::WeakImplHelper< css::awt::XPointer, css::lang::XServiceInfo> { -std::mutexmaMutex; +mutable std::mutex maMutex; PointerStylemaPointer; public: VCLXPointer(); virtual ~VCLXPointer() override; -PointerStyle GetPointer() const { return maPointer; } +PointerStyle GetPointer() const +{ +std::scoped_lock aGuard( maMutex ); +return maPointer; +} // css::awt::XPointer void SAL_CALL setType( sal_Int32 nType ) override;
core.git: svx/source
svx/source/form/fmscriptingenv.cxx | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) New commits: commit 2be7689549ca126de2cb404e79f60c3f503a51fd Author: Noel Grandin AuthorDate: Wed Oct 2 19:50:33 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 16:56:27 2024 +0200 cid#1606754 Thread deadlock Change-Id: I51985e5ac573aa42c011730b73848ab55a4b2130 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174410 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx index cf567083b6a0..8012319f5e33 100644 --- a/svx/source/form/fmscriptingenv.cxx +++ b/svx/source/form/fmscriptingenv.cxx @@ -917,10 +917,15 @@ namespace svxform void FormScriptingEnvironment::dispose() { -std::unique_lock aGuard( m_aMutex ); -m_bDisposed = true; -m_pScriptListener->dispose(); -m_pScriptListener.clear(); +rtl::Reference xListener; +{ +std::unique_lock aGuard( m_aMutex ); +if (m_bDisposed) +return; +m_bDisposed = true; +xListener = std::move(m_pScriptListener); +} +xListener->dispose(); } }
core.git: svx/source
svx/source/unodraw/unoshcol.cxx | 62 1 file changed, 25 insertions(+), 37 deletions(-) New commits: commit 16569ed32638464b4b6857fc2c29f59a919baed7 Author: Noel Grandin AuthorDate: Wed Oct 2 19:46:27 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 15:46:47 2024 +0200 simplify SvxShapeCollection::dispose Change-Id: Idb1605b27995cbf9eccb2710f74f6ccb37547646 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174409 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index 3a58ab514ff3..280dd23f98cf 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -76,52 +76,40 @@ void SvxShapeCollection::dispose() // Guard dispose against multiple threading // Remark: It is an error to call dispose more than once -bool bDoDispose = false; { std::unique_lock aGuard( m_aMutex ); -if( !bDisposed && !bInDispose ) -{ -// only one call go into this section -bInDispose = true; -bDoDispose = true; -} +if( bDisposed || bInDispose ) +return; +// only one call go into this section +bInDispose = true; } // Do not hold the mutex because we are broadcasting -if( bDoDispose ) +// Create an event with this as sender +try { -// Create an event with this as sender -try -{ -document::EventObject aEvt; -aEvt.Source = uno::Reference< uno::XInterface >::query( static_cast(this) ); -// inform all listeners to release this object -// The listener container are automatically cleared -std::unique_lock g(m_aMutex); -maEventListeners.disposeAndClear( g, aEvt ); -maShapeContainer.clear(); -} -catch(const css::uno::Exception&) -{ -// catch exception and throw again but signal that -// the object was disposed. Dispose should be called -// only once. -bDisposed = true; -bInDispose = false; -throw; -} - -// the values bDispose and bInDisposing must set in this order. -// No multithread call overcome the "!rBHelper.bDisposed && !rBHelper.bInDispose" guard. -bDisposed = true; -bInDispose = false; +document::EventObject aEvt; +aEvt.Source = uno::Reference< uno::XInterface >::query( static_cast(this) ); +// inform all listeners to release this object +// The listener container are automatically cleared +std::unique_lock g(m_aMutex); +maEventListeners.disposeAndClear( g, aEvt ); +maShapeContainer.clear(); } -else +catch(const css::uno::Exception&) { -// in a multithreaded environment, it can't be avoided, that dispose is called twice. -// However this condition is traced, because it MAY indicate an error. -SAL_INFO("svx", "dispose called twice" ); +// catch exception and throw again but signal that +// the object was disposed. Dispose should be called +// only once. +bDisposed = true; +bInDispose = false; +throw; } + +// the values bDispose and bInDisposing must set in this order. +// No multithread call overcome the "!rBHelper.bDisposed && !rBHelper.bInDispose" guard. +bDisposed = true; +bInDispose = false; } // XComponent
core.git: ucb/source
ucb/source/cacher/cacheddynamicresultset.cxx | 10 - ucb/source/cacher/cacheddynamicresultset.hxx |4 ucb/source/cacher/cacheddynamicresultsetstub.cxx | 10 - ucb/source/cacher/cacheddynamicresultsetstub.hxx |4 ucb/source/cacher/dynamicresultsetwrapper.cxx| 158 ++- ucb/source/cacher/dynamicresultsetwrapper.hxx|6 6 files changed, 90 insertions(+), 102 deletions(-) New commits: commit db20a13d452ac5599416f64729d964829536a033 Author: Noel Grandin AuthorDate: Wed Oct 2 19:31:32 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 15:26:49 2024 +0200 cid#1607746 Data race condition and cid#1608428 Data race condition cid#1607985 Data race condition cid#1607894 Data race condition cid#1607463 Data race condition cid#1607218 Data race condition Change-Id: Ifb30dd8490f41e06d47442c3a2b090b184932a4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174408 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/ucb/source/cacher/cacheddynamicresultset.cxx b/ucb/source/cacher/cacheddynamicresultset.cxx index c9f8933b22f6..e69191e71096 100644 --- a/ucb/source/cacher/cacheddynamicresultset.cxx +++ b/ucb/source/cacher/cacheddynamicresultset.cxx @@ -47,29 +47,27 @@ CachedDynamicResultSet::~CachedDynamicResultSet() //virtual void CachedDynamicResultSet -::impl_InitResultSetOne( const Reference< XResultSet >& xResultSet ) +::impl_InitResultSetOne( std::unique_lock& rGuard, const Reference< XResultSet >& xResultSet ) { -DynamicResultSetWrapper::impl_InitResultSetOne( xResultSet ); +DynamicResultSetWrapper::impl_InitResultSetOne( rGuard, xResultSet ); OSL_ENSURE( m_xSourceResultOne.is(), "need source resultset" ); Reference< XResultSet > xCache( new CachedContentResultSet( m_xContext, m_xSourceResultOne, m_xContentIdentifierMapping ) ); -std::unique_lock aGuard( m_aMutex ); m_xMyResultOne = std::move(xCache); } //virtual void CachedDynamicResultSet -::impl_InitResultSetTwo( const Reference< XResultSet >& xResultSet ) +::impl_InitResultSetTwo( std::unique_lock& rGuard, const Reference< XResultSet >& xResultSet ) { -DynamicResultSetWrapper::impl_InitResultSetTwo( xResultSet ); +DynamicResultSetWrapper::impl_InitResultSetTwo( rGuard, xResultSet ); OSL_ENSURE( m_xSourceResultTwo.is(), "need source resultset" ); Reference< XResultSet > xCache( new CachedContentResultSet( m_xContext, m_xSourceResultTwo, m_xContentIdentifierMapping ) ); -std::unique_lock aGuard( m_aMutex ); m_xMyResultTwo = std::move(xCache); } diff --git a/ucb/source/cacher/cacheddynamicresultset.hxx b/ucb/source/cacher/cacheddynamicresultset.hxx index 76075b98eb20..814b57afc957 100644 --- a/ucb/source/cacher/cacheddynamicresultset.hxx +++ b/ucb/source/cacher/cacheddynamicresultset.hxx @@ -37,9 +37,9 @@ class CachedDynamicResultSet protected: virtual void -impl_InitResultSetOne( const css::uno::Reference< css::sdbc::XResultSet >& xResultSet ) override; +impl_InitResultSetOne( std::unique_lock& rGuard, const css::uno::Reference< css::sdbc::XResultSet >& xResultSet ) override; virtual void -impl_InitResultSetTwo( const css::uno::Reference< css::sdbc::XResultSet >& xResultSet ) override; +impl_InitResultSetTwo( std::unique_lock& rGuard, const css::uno::Reference< css::sdbc::XResultSet >& xResultSet ) override; public: CachedDynamicResultSet( css::uno::Reference< css::ucb::XDynamicResultSet > const & xOrigin diff --git a/ucb/source/cacher/cacheddynamicresultsetstub.cxx b/ucb/source/cacher/cacheddynamicresultsetstub.cxx index eac5d7db439d..f5decb5e5506 100644 --- a/ucb/source/cacher/cacheddynamicresultsetstub.cxx +++ b/ucb/source/cacher/cacheddynamicresultsetstub.cxx @@ -48,29 +48,27 @@ CachedDynamicResultSetStub::~CachedDynamicResultSetStub() //virtual void CachedDynamicResultSetStub -::impl_InitResultSetOne( const Reference< XResultSet >& xResultSet ) +::impl_InitResultSetOne( std::unique_lock& rGuard, const Reference< XResultSet >& xResultSet ) { -DynamicResultSetWrapper::impl_InitResultSetOne( xResultSet ); +DynamicResultSetWrapper::impl_InitResultSetOne( rGuard, xResultSet ); OSL_ENSURE( m_xSourceResultOne.is(), "need source resultset" ); Reference< XResultSet > xStub( new CachedContentResultSetStub( m_xSourceResultOne ) ); -std::unique_lock aGuard( m_aMutex ); m_xMyResultOne = std::move(xStub); } //virtual void CachedDynamicResultSetStub -::impl_InitResultSetTwo( const Reference< XResultSet >& xResultSet ) +::impl_InitResultSetTwo( std::unique_lock& rGuard, const Reference< XResultSet >& xResultSet ) { -
core.git: 2 commits - sd/source svtools/source
sd/source/ui/inc/unomodel.hxx |5 sd/source/ui/inc/unopage.hxx|3 sd/source/ui/unoidl/unomodel.cxx| 269 +--- sd/source/ui/unoidl/unopage.cxx | 11 - svtools/source/control/valueacc.cxx |9 - svtools/source/control/valueimp.hxx |5 svtools/source/control/valueset.cxx | 21 +- 7 files changed, 156 insertions(+), 167 deletions(-) New commits: commit 36d4938894a0c4ac3fecd2fe00991328560d4b8a Author: Noel Grandin AuthorDate: Wed Oct 2 21:37:35 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 14:08:07 2024 +0200 use more concrete UNO class in SdXImpressDocument Change-Id: I61fb3e0c5f76fd6208255dc1f1bc403c25221ba6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174412 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 02f1ee19ceb7..3141abd46bc9 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -59,6 +59,7 @@ class SdMasterPagesAccess; class SdLayerManager; class SdXCustomPresentationAccess; class SdDocLinkTargets; +class SdGenericDrawPage; namespace sd { class DrawDocShell; @@ -304,6 +305,8 @@ public: /// @see vcl::ITiledRenderable::renderNextSlideLayer(). bool renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, OUString& rJsonMsg) override; +rtl::Reference< SdDrawPagesAccess > getSdDrawPages(); + // XComponent /** This dispose implementation releases the resources held by the @@ -355,6 +358,8 @@ public: virtual void SAL_CALL dispose( ) override; virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override; virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override; + +SdGenericDrawPage* getDrawPageByIndex( sal_Int32 Index ); }; /*** diff --git a/sd/source/ui/inc/unopage.hxx b/sd/source/ui/inc/unopage.hxx index 534aa8c1c6a4..f27b79ad4ce8 100644 --- a/sd/source/ui/inc/unopage.hxx +++ b/sd/source/ui/inc/unopage.hxx @@ -38,6 +38,7 @@ class SdrObject; class SdXImpressDocument; +class SdMasterPage; class SdGenericDrawPage : public SvxDrawPage, public SdUnoSearchReplaceShape, @@ -211,6 +212,8 @@ public: // XShapes virtual void SAL_CALL add( const css::uno::Reference< css::drawing::XShape >& xShape ) override; virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XShape >& xShape ) override; + +SdMasterPage* getSdMasterPage(); }; /*** diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 9a8b17c65cdb..b5e2bb9dbf0b 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1561,6 +1561,11 @@ uno::Reference< drawing::XDrawPages > SAL_CALL SdXImpressDocument::getDrawPages( { ::SolarMutexGuard aGuard; +return getSdDrawPages(); +} + +rtl::Reference< SdDrawPagesAccess > SdXImpressDocument::getSdDrawPages() +{ if( nullptr == mpDoc ) throw lang::DisposedException(); @@ -3759,157 +3764,142 @@ OString SdXImpressDocument::getPresentationInfo() const try { -uno::Reference xDrawPages = const_cast(this)->getDrawPages(); -uno::Reference xSlides(xDrawPages, uno::UNO_QUERY_THROW); -if (xSlides.is()) +rtl::Reference xDrawPages = const_cast(this)->getSdDrawPages(); +// size in twips +Size aDocSize = const_cast(this)->getDocumentSize(); +aJsonWriter.put("docWidth", aDocSize.getWidth()); +aJsonWriter.put("docHeight", aDocSize.getHeight()); + +auto aSlideList = aJsonWriter.startArray("slides"); +sal_Int32 nSlideCount = xDrawPages->getCount(); +for (sal_Int32 i = 0; i < nSlideCount; ++i) { -// size in twips -Size aDocSize = const_cast(this)->getDocumentSize(); -aJsonWriter.put("docWidth", aDocSize.getWidth()); -aJsonWriter.put("docHeight", aDocSize.getHeight()); - -auto aSlideList = aJsonWriter.startArray("slides"); -sal_Int32 nSlideCount = xSlides->getCount(); -for (sal_Int32 i = 0; i < nSlideCount; ++i) +SdGenericDrawPage* pSlide(xDrawPages->getDrawPageByIndex(i)); +bool bIsVisible = true; // default visible +pSlide->getPropertyValue("Visible") >>= bIsVisible; +if (bIsVisible) { -uno::Reference xSlide(xSlides->getByIndex(i), uno::UNO
core.git: ucb/source
ucb/source/core/ucbstore.cxx |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) New commits: commit 87519013cb9ed1eae27f799a1a35c8a3cd0e3dd7 Author: Noel Grandin AuthorDate: Wed Oct 2 19:23:16 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 10:39:50 2024 +0200 cid#1606693 Data race condition Change-Id: I107174d36f2bfa0cdcb7017838b1b4404179fb0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174407 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index 7190906b8147..6cc7ee759ab8 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -170,12 +170,9 @@ UcbStore::createPropertySetRegistry( const OUString& ) // The URL parameter is ignored by this interface implementation. It always // uses the configuration server as storage medium. +std::unique_lock aGuard( m_aMutex ); if ( !m_xTheRegistry.is() ) -{ -std::unique_lock aGuard( m_aMutex ); -if ( !m_xTheRegistry.is() ) -m_xTheRegistry = new PropertySetRegistry( m_xContext, m_aInitArgs ); -} +m_xTheRegistry = new PropertySetRegistry( m_xContext, m_aInitArgs ); return m_xTheRegistry; }
core.git: 2 commits - ucb/source
ucb/source/ucp/file/filrow.cxx |1 ucb/source/ucp/file/filrset.cxx | 63 +++- ucb/source/ucp/file/filrset.hxx |4 +- 3 files changed, 33 insertions(+), 35 deletions(-) New commits: commit 12e7a664f8e0accea5b52d9537d8133a5e7a2c2c Author: Noel Grandin AuthorDate: Wed Oct 2 19:19:20 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 10:39:38 2024 +0200 cid#1554974 Data race condition Change-Id: I9b9b1bb9f63b9eaf294b27afbde4c39e773ede8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174406 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucb/source/ucp/file/filrow.cxx b/ucb/source/ucp/file/filrow.cxx index e352e7919907..066233aafc2f 100644 --- a/ucb/source/ucp/file/filrow.cxx +++ b/ucb/source/ucp/file/filrow.cxx @@ -90,6 +90,7 @@ XRow_impl::~XRow_impl() sal_Bool SAL_CALL XRow_impl::wasNull() { + std::scoped_lock aGuard( m_aMutex ); return m_nWasNull; } commit 74ed4d1937449009343676546a937420a1ef5570 Author: Noel Grandin AuthorDate: Wed Oct 2 19:15:05 2024 +0200 Commit: Noel Grandin CommitDate: Thu Oct 3 10:39:27 2024 +0200 cid#1608230 Data race condition and cid#1607831 Data race condition cid#1607761 Check of thread-shared field evades lock acquisition cid#1606784 Data race condition Change-Id: Icbc872531117fbd9c22e33ffc560e07322f39ef8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174405 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx index 5aa3007d7b4d..7c911d57d6b0 100644 --- a/ucb/source/ucp/file/filrset.cxx +++ b/ucb/source/ucp/file/filrset.cxx @@ -128,42 +128,33 @@ XResultSet_impl::dispose() void XResultSet_impl::rowCountChanged(std::unique_lock& rGuard) { -sal_Int32 aOldValue,aNewValue; -std::vector< uno::Reference< beans::XPropertyChangeListener > > seq = m_aRowCountListeners.getElements(rGuard); -aNewValue = m_aItems.size(); -aOldValue = aNewValue-1; +sal_Int32 aNewValue = m_aItems.size(); +sal_Int32 aOldValue = aNewValue-1; beans::PropertyChangeEvent aEv; aEv.PropertyName = "RowCount"; aEv.Further = false; aEv.PropertyHandle = -1; aEv.OldValue <<= aOldValue; aEv.NewValue <<= aNewValue; -for( const auto& listener : seq ) -listener->propertyChange( aEv ); +m_aRowCountListeners.notifyEach(rGuard, &beans::XPropertyChangeListener::propertyChange, aEv); } -void XResultSet_impl::isFinalChanged() +void XResultSet_impl::isFinalChanged(std::unique_lock& rGuard) { -std::vector< uno::Reference< beans::XPropertyChangeListener > > seq; -{ -std::unique_lock aGuard( m_aMutex ); -seq = m_aIsFinalListeners.getElements(aGuard); -m_bRowCountFinal = true; -} +m_bRowCountFinal = true; beans::PropertyChangeEvent aEv; aEv.PropertyName = "IsRowCountFinal"; aEv.Further = false; aEv.PropertyHandle = -1; aEv.OldValue <<= false; aEv.NewValue <<= true; -for( const auto& listener : seq ) -listener->propertyChange( aEv ); +m_aIsFinalListeners.notifyEach(rGuard, &beans::XPropertyChangeListener::propertyChange, aEv); } bool -XResultSet_impl::OneMore() +XResultSet_impl::OneMore(std::unique_lock& rGuard) { if( ! m_nIsOpen ) return false; @@ -181,7 +172,7 @@ XResultSet_impl::OneMore() if( err == osl::FileBase::E_NOENT || err == osl::FileBase::E_INVAL ) { m_aFolder.close(); -isFinalChanged(); +isFinalChanged(rGuard); m_nIsOpen = false; return m_nIsOpen; } @@ -197,11 +188,10 @@ XResultSet_impl::OneMore() if( m_nOpenMode == ucb::OpenMode::DOCUMENTS && IsRegular ) { -std::unique_lock aGuard( m_aMutex ); m_aItems.push_back( aRow ); m_aIdents.emplace_back( ); m_aUnqPath.push_back( aUnqPath ); -rowCountChanged(aGuard); +rowCountChanged(rGuard); return true; } @@ -211,11 +201,10 @@ XResultSet_impl::OneMore() } else if( m_nOpenMode == ucb::OpenMode::FOLDERS && ! IsRegular ) { -std::unique_lock aGuard( m_aMutex ); m_aItems.push_back( aRow ); m_aIdents.emplace_back( ); m_aUnqPath.push_back( aUnqPath ); -rowCountChanged(aGuard); +rowCountChanged(rGuard); return true; } else if( m_nOpenMode == ucb::OpenMode::FOLDERS && IsRegular ) @@ -224,11 +213,10 @@ XResultSet_impl::OneMore() } else { -
core.git: Branch 'distro/allotropia/zeta-24-2' - solenv/gbuild
solenv/gbuild/platform/com_MSC_defs.mk |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8ddf9a992bf1826a66f0543127916f25d0f8e516 Author: Noel Grandin AuthorDate: Tue May 7 12:49:07 2024 +0200 Commit: Balazs Varga CommitDate: Wed Oct 2 19:50:03 2024 +0200 fix Windows incremental build after commit 4c86718e78c6b18c84774e48ca025694364c251a Author: Christian Lohmaier Date: Thu Apr 18 12:45:01 2024 +0200 initial support for running autogen.sh inside wsl from git-bash otherwise we end up with mixed cygwin/windows paths in our .d files, which the make executable we use will not like. Change-Id: Ia1325793f47657a23774c216df319ae6afd6d638 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167269 Tested-by: Jenkins Reviewed-by: Christian Lohmaier Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174259 Reviewed-by: Balazs Varga Tested-by: Balazs Varga diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk index cd314e19a954..176c491f8abf 100644 --- a/solenv/gbuild/platform/com_MSC_defs.mk +++ b/solenv/gbuild/platform/com_MSC_defs.mk @@ -257,7 +257,7 @@ gb_COMPILERDEBUGOPTFLAGS := ifeq ($(gb_FULLDEPS),$(true)) gb_COMPILERDEPFLAGS := -showIncludes define gb_create_deps -| $(call gb_Helper_cyg_path,$(GBUILDDIR)/platform/filter-showIncludes.awk -vdepfile=$(1) -vobjectfile=$(2) -vsourcefile=$(3)); exit $${PIPESTATUS[0]} +| $(GBUILDDIR)/platform/filter-showIncludes.awk -vdepfile=$(1) -vobjectfile=$(2) -vsourcefile=$(3); exit $${PIPESTATUS[0]} endef else gb_COMPILERDEPFLAGS :=
core.git: 2 commits - sc/source
sc/source/filter/xml/XMLStylesImportHelper.cxx | 68 +++-- sc/source/filter/xml/xmlcelli.cxx |7 ++ sc/source/filter/xml/xmlsubti.cxx |5 + sc/source/filter/xml/xmlsubti.hxx |1 4 files changed, 45 insertions(+), 36 deletions(-) New commits: commit 4dfffddceb12fe25ac3dd97281c3006502e04934 Author: Noel Grandin AuthorDate: Wed Oct 2 10:15:30 2024 +0200 Commit: Noel Grandin CommitDate: Wed Oct 2 14:00:20 2024 +0200 flatten ScMyStylesImportHelper::AddDefaultRange Change-Id: I7a3afbed392786eea3533318421959d8e2b0dbd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174377 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/filter/xml/XMLStylesImportHelper.cxx b/sc/source/filter/xml/XMLStylesImportHelper.cxx index ed3a210fc347..d2d71aa7994a 100644 --- a/sc/source/filter/xml/XMLStylesImportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesImportHelper.cxx @@ -232,48 +232,44 @@ ScMyStylesMap::iterator ScMyStylesImportHelper::GetIterator(const OUString & rSt void ScMyStylesImportHelper::AddDefaultRange(const ScRange& rRange) { OSL_ENSURE(aRowDefaultStyle != aCellStyles.end(), "no row default style"); -if (aRowDefaultStyle->first.isEmpty()) +if (!aRowDefaultStyle->first.isEmpty()) { -SCCOL nStartCol(rRange.aStart.Col()); -SCCOL nEndCol(rRange.aEnd.Col()); -if (aColDefaultStyles.size() > sal::static_int_cast(nStartCol)) -{ -ScMyStylesMap::iterator aPrevItr(aColDefaultStyles[nStartCol]); -for (SCCOL i = nStartCol + 1; (i <= nEndCol) && (i < sal::static_int_cast(aColDefaultStyles.size())); ++i) -{ -if (aPrevItr != aColDefaultStyles[i]) -{ -OSL_ENSURE(aPrevItr != aCellStyles.end(), "no column default style"); -ScRange aRange(rRange); -aRange.aStart.SetCol(nStartCol); -aRange.aEnd.SetCol(i - 1); -pPrevStyleName = aPrevItr->first; -AddSingleRange(aRange); -nStartCol = i; -aPrevItr = aColDefaultStyles[i]; -} -} -if (aPrevItr != aCellStyles.end()) -{ -ScRange aRange(rRange); -aRange.aStart.SetCol(nStartCol); -pPrevStyleName = aPrevItr->first; -AddSingleRange(aRange); -} -else -{ -OSL_FAIL("no column default style"); -} -} -else +pPrevStyleName = aRowDefaultStyle->first; +AddSingleRange(rRange); +return; +} +SCCOL nStartCol(rRange.aStart.Col()); +SCCOL nEndCol(rRange.aEnd.Col()); +if (aColDefaultStyles.size() <= sal::static_int_cast(nStartCol)) +{ +OSL_FAIL("too many columns"); +return; +} +ScMyStylesMap::iterator aPrevItr(aColDefaultStyles[nStartCol]); +for (SCCOL i = nStartCol + 1; (i <= nEndCol) && (i < sal::static_int_cast(aColDefaultStyles.size())); ++i) +{ +if (aPrevItr != aColDefaultStyles[i]) { -OSL_FAIL("too many columns"); +OSL_ENSURE(aPrevItr != aCellStyles.end(), "no column default style"); +ScRange aRange(rRange); +aRange.aStart.SetCol(nStartCol); +aRange.aEnd.SetCol(i - 1); +pPrevStyleName = aPrevItr->first; +AddSingleRange(aRange); +nStartCol = i; +aPrevItr = aColDefaultStyles[i]; } } +if (aPrevItr != aCellStyles.end()) +{ +ScRange aRange(rRange); +aRange.aStart.SetCol(nStartCol); +pPrevStyleName = aPrevItr->first; +AddSingleRange(aRange); +} else { -pPrevStyleName = aRowDefaultStyle->first; -AddSingleRange(rRange); + OSL_FAIL("no column default style"); } } commit 5f6b8b18dc16d290382187693861404e9a405b34 Author: Noel Grandin AuthorDate: Wed Oct 2 10:02:12 2024 +0200 Commit: Noel Grandin CommitDate: Wed Oct 2 14:00:10 2024 +0200 tdf#161986 speedup ODS with large merged range reduces load time from 90s to 25s Change-Id: I7523776e5f4e2c4dc8645ccdf303e51178a9848a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174376 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 0de47dcfbe5e..911586eb2683 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1269,6 +1269,13 @@ void ScXMLTableRowCellContext::AddTextAndValueCell( const ScAddress& rCellPos, rTables.AddColumn(false);
core.git: 2 commits - ucb/source
ucb/source/sorter/sortdynres.cxx | 11 +++ ucb/source/sorter/sortresult.cxx |5 + 2 files changed, 12 insertions(+), 4 deletions(-) New commits: commit 2857c0b9cd096a83c7d0de927116dac1fd7c0b09 Author: Noel Grandin AuthorDate: Tue Oct 1 20:11:56 2024 +0200 Commit: Noel Grandin CommitDate: Wed Oct 2 09:38:43 2024 +0200 cid#1607055 Data race condition Change-Id: I1b1a3c426226c6ed4b9bb58a89bf727f48c5fc22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174364 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx index b4eefd920cf3..cacdc9f52617 100644 --- a/ucb/source/sorter/sortdynres.cxx +++ b/ucb/source/sorter/sortdynres.cxx @@ -168,11 +168,14 @@ SortedDynamicResultSet::setListener( const Reference< XDynamicResultSetListener void SAL_CALL SortedDynamicResultSet::connectToCache( const Reference< XDynamicResultSet > & xCache ) { -if( mxListener.is() ) -throw ListenerAlreadySetException(); +{ +std::unique_lock aGuard( maMutex ); +if( mxListener.is() ) +throw ListenerAlreadySetException(); -if( mbStatic ) -throw ListenerAlreadySetException(); +if( mbStatic ) +throw ListenerAlreadySetException(); +} Reference< XSourceInitialization > xTarget( xCache, UNO_QUERY ); if( xTarget.is() && m_xContext.is() ) commit d1a9740735bcafe71325cb82bcebd82d219e2172 Author: Noel Grandin AuthorDate: Tue Oct 1 19:46:53 2024 +0200 Commit: Noel Grandin CommitDate: Wed Oct 2 09:38:35 2024 +0200 cid#1608281 Data race condition and cid#1608132 Data race condition cid#1607743 Data race condition cid#1607393 Data race condition cid#1607038 Data race condition cid#1606543 Data race condition Change-Id: Id6075bf9f28d3e77a487116f522d38d9e9d3fab1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174363 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index 27d0a504d970..fbcf846f0ac1 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -236,6 +236,7 @@ sal_Bool SAL_CALL SortedResultSet::next() sal_Bool SAL_CALL SortedResultSet::isBeforeFirst() { +std::unique_lock aGuard( maMutex ); if ( mnCurEntry ) return false; else @@ -245,6 +246,7 @@ sal_Bool SAL_CALL SortedResultSet::isBeforeFirst() sal_Bool SAL_CALL SortedResultSet::isAfterLast() { +std::unique_lock aGuard( maMutex ); if ( mnCurEntry > mnCount ) return true; else @@ -254,6 +256,7 @@ sal_Bool SAL_CALL SortedResultSet::isAfterLast() sal_Bool SAL_CALL SortedResultSet::isFirst() { +std::unique_lock aGuard( maMutex ); if ( mnCurEntry == 1 ) return true; else @@ -263,6 +266,7 @@ sal_Bool SAL_CALL SortedResultSet::isFirst() sal_Bool SAL_CALL SortedResultSet::isLast() { +std::unique_lock aGuard( maMutex ); if ( mnCurEntry == mnCount ) return true; else @@ -324,6 +328,7 @@ sal_Bool SAL_CALL SortedResultSet::last() sal_Int32 SAL_CALL SortedResultSet::getRow() { +std::unique_lock aGuard( maMutex ); return mnCurEntry; }
core.git: 2 commits - ucb/source
ucb/source/ucp/file/prov.cxx |9 + ucb/source/ucp/file/prov.hxx |2 +- ucb/source/ucp/hierarchy/hierarchydatasource.cxx | 19 --- 3 files changed, 14 insertions(+), 16 deletions(-) New commits: commit 30f437f4fc21ec83a597432a15e0ab570252a93d Author: Noel Grandin AuthorDate: Tue Oct 1 19:30:00 2024 +0200 Commit: Noel Grandin CommitDate: Wed Oct 2 09:38:24 2024 +0200 cid#1556822 Data race condition and cid#1555688 Data race condition cid#1554983 Data race condition Change-Id: Iea24c9567de33aeaa519bc6b832ff1338b6d67be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174362 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index 77e7772db7e2..40484c5d9a3c 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -300,9 +300,8 @@ XPropertySetInfoImpl2::hasPropertyByName( } -void FileProvider::initProperties() +void FileProvider::initProperties(std::unique_lock& /*rGuard*/) { -std::scoped_lock aGuard( m_aMutex ); if( m_xPropertySetInfo.is() ) return; @@ -332,7 +331,8 @@ void FileProvider::initProperties() Reference< XPropertySetInfo > SAL_CALL FileProvider::getPropertySetInfo( ) { -initProperties(); +std::unique_lock aGuard( m_aMutex ); +initProperties(aGuard); return m_xPropertySetInfo; } @@ -352,7 +352,8 @@ Any SAL_CALL FileProvider::getPropertyValue( const OUString& aPropertyName ) { -initProperties(); +std::unique_lock aGuard( m_aMutex ); +initProperties(aGuard); if( aPropertyName == "FileSystemNotation" ) { return Any(m_FileSystemNotation); diff --git a/ucb/source/ucp/file/prov.hxx b/ucb/source/ucp/file/prov.hxx index 311c1be0e469..3d1f9d7f63a0 100644 --- a/ucb/source/ucp/file/prov.hxx +++ b/ucb/source/ucp/file/prov.hxx @@ -143,7 +143,7 @@ namespace fileaccess { // Members css::uno::Reference< css::uno::XComponentContext > m_xContext; -void initProperties(); +void initProperties(std::unique_lock& rGuard); std::mutex m_aMutex; OUString m_HostName; OUString m_HomeDirectory; commit 187728c38a654e1505d976524899d66fca37e993 Author: Noel Grandin AuthorDate: Tue Oct 1 19:26:40 2024 +0200 Commit: Noel Grandin CommitDate: Wed Oct 2 09:38:15 2024 +0200 cid#1607345 Data race condition Change-Id: I30798e5bfc6182e1b436c5116b49b7a4ae2328ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174361 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx index cb7b52fb119d..b30f6cd55a44 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx @@ -410,20 +410,17 @@ HierarchyDataSource::createInstanceWithArguments( uno::Reference< lang::XMultiServiceFactory > HierarchyDataSource::getConfigProvider() { +std::unique_lock aGuard( m_aMutex ); if ( !m_xConfigProvider.is() ) { -std::unique_lock aGuard( m_aMutex ); -if ( !m_xConfigProvider.is() ) +try { -try -{ -m_xConfigProvider = configuration::theDefaultProvider::get( m_xContext ); -} -catch ( uno::Exception const & ) -{ -OSL_FAIL( "HierarchyDataSource::getConfigProvider - " - "caught exception!" ); -} +m_xConfigProvider = configuration::theDefaultProvider::get( m_xContext ); +} +catch ( uno::Exception const & ) +{ +OSL_FAIL( "HierarchyDataSource::getConfigProvider - " + "caught exception!" ); } }
core.git: 3 commits - ucbhelper/source ucb/source
ucb/source/ucp/tdoc/tdoc_stgelems.hxx |9 ++--- ucbhelper/source/client/content.cxx |9 +++-- ucbhelper/source/provider/resultsethelper.cxx | 12 3 files changed, 17 insertions(+), 13 deletions(-) New commits: commit e376719201d8300cff467eb8098aa932723413b4 Author: Noel Grandin AuthorDate: Tue Oct 1 19:25:34 2024 +0200 Commit: Noel Grandin CommitDate: Wed Oct 2 09:38:07 2024 +0200 cid#1557069 Data race condition Change-Id: Ic4a20cb5682c575affa9933a55d677a8048c4c2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174360 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx index 40dd7f723705..6562ab7ffa47 100644 --- a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx +++ b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx @@ -48,9 +48,12 @@ public: bool isParentARootStorage() const { return m_bParentIsRootStorage; } -const css::uno::Reference< css::embed::XStorage >& +css::uno::Reference< css::embed::XStorage > getParentStorage() const -{ return m_xParentStorage; } +{ +std::scoped_lock aGuard( m_aMutex ); +return m_xParentStorage; +} void clearParentStorage() { std::scoped_lock aGuard( m_aMutex ); @@ -58,7 +61,7 @@ public: } private: -std::mutex m_aMutex; +mutable std::mutex m_aMutex; css::uno::Reference< css::embed::XStorage > m_xParentStorage; bool m_bParentIsRootStorage; }; commit 3b60abdc948f3101d2107bd515f4ca31b041bd04 Author: Noel Grandin AuthorDate: Tue Oct 1 19:23:34 2024 +0200 Commit: Noel Grandin CommitDate: Wed Oct 2 09:38:00 2024 +0200 cid#1608390 Data race condition Change-Id: I98a8addad50888e5969fce5bf47d67f96b06ecf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174359 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx index 68db5fce9817..b3f2fe2e1ff4 100644 --- a/ucbhelper/source/client/content.cxx +++ b/ucbhelper/source/client/content.cxx @@ -1241,13 +1241,10 @@ const Reference< XContent > & Content_Impl::getContent_NoLock() Reference< XCommandProcessor > Content_Impl::getCommandProcessor() { -if ( !m_xCommandProcessor.is() ) -{ -std::unique_lock aGuard( m_aMutex ); +std::unique_lock aGuard( m_aMutex ); -if ( !m_xCommandProcessor.is() ) -m_xCommandProcessor.set( getContent_NoLock(), UNO_QUERY ); -} +if ( !m_xCommandProcessor.is() ) +m_xCommandProcessor.set( getContent_NoLock(), UNO_QUERY ); return m_xCommandProcessor; } commit 9ea9c6f0fc5e08167906b22817ad03c3fd072e62 Author: Noel Grandin AuthorDate: Tue Oct 1 19:19:23 2024 +0200 Commit: Noel Grandin CommitDate: Wed Oct 2 09:37:52 2024 +0200 cid#1606901 Data race condition Change-Id: Id1d8f0895021719670c5419ab464c247ae3bf29c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174358 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/ucbhelper/source/provider/resultsethelper.cxx b/ucbhelper/source/provider/resultsethelper.cxx index f4e1154f0bce..80a9caeed97a 100644 --- a/ucbhelper/source/provider/resultsethelper.cxx +++ b/ucbhelper/source/provider/resultsethelper.cxx @@ -185,11 +185,15 @@ sal_Int16 SAL_CALL ResultSetImplHelper::getCapabilities() void SAL_CALL ResultSetImplHelper::connectToCache( const uno::Reference< css::ucb::XDynamicResultSet > & xCache ) { -if ( m_xListener.is() ) -throw css::ucb::ListenerAlreadySetException(); +{ +std::unique_lock aGuard( m_aMutex ); -if ( m_bStatic ) -throw css::ucb::ListenerAlreadySetException(); +if ( m_xListener.is() ) +throw css::ucb::ListenerAlreadySetException(); + +if ( m_bStatic ) +throw css::ucb::ListenerAlreadySetException(); +} uno::Reference< css::ucb::XSourceInitialization > xTarget( xCache, uno::UNO_QUERY ); if ( xTarget.is() )
core.git: forms/source
forms/source/misc/limitedformats.cxx |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) New commits: commit 52942df3125d8ea3725f2847695cf7281bb4580b Author: Noel Grandin AuthorDate: Tue Oct 1 15:40:50 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 20:50:11 2024 +0200 remove some dead code ever since commit 9c92eb6800468de34c5aec3690c1b990a4e763c9 Author: Noel Grandin Date: Mon May 13 15:42:27 2024 +0200 createFromAscii -> OUString literals in OLimitedFormats Change-Id: Ic0ab48b13be3799ca5b3b20b9aa8289d8bee03f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174353 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/forms/source/misc/limitedformats.cxx b/forms/source/misc/limitedformats.cxx index 628a42c55892..e14a2e5146ab 100644 --- a/forms/source/misc/limitedformats.cxx +++ b/forms/source/misc/limitedformats.cxx @@ -280,6 +280,7 @@ namespace frm _rConvertedValue.clear(); _rOldValue <<= pFormats[nOldEnumValue].nKey; + bool bModified = false; bool bFoundIt = false; // look for the entry with the given format key @@ -296,12 +297,6 @@ namespace frm ++nTablePosition; } -if (!_rOldValue.hasValue()) -{ // did not reach the end of the table (means we found nNewFormat) -// -> go to the end to ensure that _rOldValue is set -_rOldValue <<= pFormats[nOldEnumValue].nKey; -} - OSL_ENSURE(_rOldValue.hasValue(), "OLimitedFormats::convertFormatKeyPropertyValue: did not find the old enum value in the table!"); if (!bFoundIt)
core.git: 2 commits - sw/inc sw/source ucb/source vcl/source
sw/inc/rdfhelper.hxx |7 - sw/inc/swabstdlg.hxx |1 sw/inc/unoframe.hxx |2 - sw/inc/unoredline.hxx |4 --- sw/inc/unotbl.hxx |2 - sw/inc/unotext.hxx|2 - sw/inc/unotextbodyhf.hxx |4 --- sw/source/core/doc/rdfhelper.cxx | 28 -- sw/source/core/inc/unofootnote.hxx|2 - sw/source/core/unocore/unocontentcontrol.cxx | 10 --- sw/source/core/unocore/unoframe.cxx | 12 - sw/source/core/unocore/unoftn.cxx | 12 - sw/source/core/unocore/unoredline.cxx | 15 --- sw/source/core/unocore/unorefmk.cxx | 11 sw/source/core/unocore/unotbl.cxx |9 --- sw/source/core/unocore/unotext.cxx| 21 sw/source/ui/dialog/swdlgfact.cxx |5 --- sw/source/ui/dialog/swdlgfact.hxx |1 sw/source/writerfilter/ooxml/OOXMLPropertySet.hxx |4 --- ucb/source/ucp/webdav-curl/SerfLockStore.hxx |3 -- vcl/source/control/imivctl.hxx|1 21 files changed, 156 deletions(-) New commits: commit 73637f83ee92453eb6249acf9ceb2b39b5a9c4ea Author: Noel Grandin AuthorDate: Mon Sep 30 13:19:58 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:16:30 2024 +0200 loplugin:unusedmethods Change-Id: I121a0e1323df7b6669f496ad63d771df8f76b429 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174297 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sw/inc/rdfhelper.hxx b/sw/inc/rdfhelper.hxx index 164f99683495..8152ef6765c5 100644 --- a/sw/inc/rdfhelper.hxx +++ b/sw/inc/rdfhelper.hxx @@ -73,13 +73,6 @@ public: const css::uno::Reference& xSubject, const OUString& rKey, const OUString& rValue); -/// Clone all statements in the graph of type rType, if any exists, from one subject to another. -static void cloneStatements(const rtl::Reference& xSrcModel, -const rtl::Reference& xDstModel, -const OUString& rType, -const css::uno::Reference& xSrcSubject, -const css::uno::Reference& xDstSubject); - /// Remove all statements in the graph of type rType, if any exists. static void clearStatements(const rtl::Reference& xModel, const OUString& rType, diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 6a17984c6fc8..229b2fdc042d 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -280,7 +280,6 @@ public: virtual void GetValues( sal_Unicode& rDelim, SwInsertTableOptions& rInsTableFlags, SwTableAutoFormat const*& prTAFormat ) = 0; -virtual std::unique_ptr FillAutoFormatOfIndex() const = 0; }; class AbstractSwInsertDBColAutoPilot : public VclAbstractDialog diff --git a/sw/source/core/doc/rdfhelper.cxx b/sw/source/core/doc/rdfhelper.cxx index b3db96f149a1..bb5615bec265 100644 --- a/sw/source/core/doc/rdfhelper.cxx +++ b/sw/source/core/doc/rdfhelper.cxx @@ -169,34 +169,6 @@ void SwRDFHelper::clearStatements(const rtl::Reference& xModel, } } -void SwRDFHelper::cloneStatements(const rtl::Reference& xSrcModel, - const rtl::Reference& xDstModel, - const OUString& rType, - const css::uno::Reference& xSrcSubject, - const css::uno::Reference& xDstSubject) -{ -uno::Reference xComponentContext(comphelper::getProcessComponentContext()); -uno::Reference xType = rdf::URI::create(xComponentContext, rType); -uno::Reference xDocumentMetadataAccess(xSrcModel); -const uno::Sequence< uno::Reference > aGraphNames = getGraphNames(xDocumentMetadataAccess, xType); -if (!aGraphNames.hasElements()) -return; - -for (const uno::Reference& xGraphName : aGraphNames) -{ -uno::Reference xGraph = xDocumentMetadataAccess->getRDFRepository()->getGraph(xGraphName); -uno::Reference xStatements = xGraph->getStatements(xSrcSubject, uno::Reference(), uno::Reference()); -while (xStatements->hasMoreElements()) -{ -const rdf::Statement aStatement = xStatements->nextElement().get(); - -const OUString sKey = aStatement.Predicate->getStringValue(); -const OUString sValue = aStatement.Object->getStringValue(); -addStatement(xDstModel, r
core.git: forms/source
forms/source/misc/limitedformats.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 54fa4c438bd458d72a8e23a6819c7be639eaee92 Author: Noel Grandin AuthorDate: Tue Oct 1 15:39:51 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 19:34:21 2024 +0200 tdf#162713 Changed format for date-field and time-field in form regression from commit 9c92eb6800468de34c5aec3690c1b990a4e763c9 Author: Noel Grandin Date: Mon May 13 15:42:27 2024 +0200 createFromAscii -> OUString literals in OLimitedFormats Change-Id: I620526e3e0efd9e9376e428881e0240e2d3017d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174352 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/forms/source/misc/limitedformats.cxx b/forms/source/misc/limitedformats.cxx index c40de6b23430..628a42c55892 100644 --- a/forms/source/misc/limitedformats.cxx +++ b/forms/source/misc/limitedformats.cxx @@ -243,8 +243,8 @@ namespace frm std::span pFormats = lcl_getFormatTable(m_nTableId); // seek to the nValue'th entry -OSL_ENSURE(pFormats.size() < o3tl::make_unsigned(nValue), "OLimitedFormats::getFormatKeyPropertyValue: did not find the value!"); -if (pFormats.size() < o3tl::make_unsigned(nValue)) +OSL_ENSURE(o3tl::make_unsigned(nValue) < pFormats.size(), "OLimitedFormats::getFormatKeyPropertyValue: did not find the value!"); +if (o3tl::make_unsigned(nValue) < pFormats.size()) _rValue <<= pFormats[nValue].nKey; // TODO: should use a standard format for the control type we're working for
core.git: reportdesign/source
reportdesign/source/core/api/Group.cxx |4 ++-- reportdesign/source/core/api/Section.cxx |4 ++-- reportdesign/source/core/inc/Group.hxx |7 --- reportdesign/source/core/inc/Section.hxx |4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) New commits: commit 885c0b1948668243bbb6379017a89834e31fdbab Author: Noel Grandin AuthorDate: Tue Oct 1 12:41:54 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 19:34:46 2024 +0200 use more concrete UNO types in reportdesign Change-Id: Ic5d773bc063629b13293ff875cb5c894373e7d08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174317 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/reportdesign/source/core/api/Group.cxx b/reportdesign/source/core/api/Group.cxx index d7fe730184a4..fbb3f6915754 100644 --- a/reportdesign/source/core/api/Group.cxx +++ b/reportdesign/source/core/api/Group.cxx @@ -297,12 +297,12 @@ void SAL_CALL OGroup::removeVetoableChangeListener( const OUString& PropertyName void OGroup::setSection( const OUString& _sProperty ,bool _bOn ,const OUString& _sName -,uno::Reference< report::XSection>& _member) +,rtl::Reference< OSection>& _member) { BoundListeners l; { ::osl::MutexGuard aGuard(m_aMutex); -prepareSet(_sProperty, uno::Any(_member), uno::Any(_bOn), &l); +prepareSet(_sProperty, uno::Any(uno::Reference(_member)), uno::Any(_bOn), &l); // create section if needed if ( _bOn && !_member.is() ) diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx index 59ea0280956b..6bff419b64e9 100644 --- a/reportdesign/source/core/api/Section.cxx +++ b/reportdesign/source/core/api/Section.cxx @@ -75,7 +75,7 @@ static uno::Sequence< OUString> lcl_getAbsent(bool _bPageSection) return uno::Sequence< OUString >(pProps,SAL_N_ELEMENTS(pProps)); } -uno::Reference OSection::createOSection( +rtl::Reference OSection::createOSection( const rtl::Reference< OReportDefinition >& xParentDef, const uno::Reference< uno::XComponentContext >& context, bool const bPageSection) @@ -86,7 +86,7 @@ uno::Reference OSection::createOSection( return pNew; } -uno::Reference OSection::createOSection( +rtl::Reference OSection::createOSection( const rtl::Reference< OGroup >& xParentGroup, const uno::Reference< uno::XComponentContext >& context) { diff --git a/reportdesign/source/core/inc/Group.hxx b/reportdesign/source/core/inc/Group.hxx index 67a4b5b5ebd1..e929e226a295 100644 --- a/reportdesign/source/core/inc/Group.hxx +++ b/reportdesign/source/core/inc/Group.hxx @@ -34,6 +34,7 @@ namespace reportdesign { class OFunctions; class OGroups; +class OSection; typedef ::cppu::WeakComponentImplHelper< css::report::XGroup , css::lang::XServiceInfo> GroupBase; typedef ::cppu::PropertySetMixin< css::report::XGroup> GroupPropertySet; @@ -48,8 +49,8 @@ namespace reportdesign { css::uno::Reference< css::uno::XComponentContext >m_xContext; unotools::WeakReference< OGroups >m_xParent; -css::uno::Reference< css::report::XSection> m_xHeader; -css::uno::Reference< css::report::XSection> m_xFooter; +rtl::Reference< OSection> m_xHeader; +rtl::Reference< OSection> m_xFooter; rtl::Reference< OFunctions > m_xFunctions; ::rptshared::GroupProperties m_aProps; @@ -90,7 +91,7 @@ namespace reportdesign void setSection( const OUString& _sProperty ,bool _bOn ,const OUString& _sName -,css::uno::Reference< css::report::XSection>& _member); +,rtl::Reference< OSection>& _member); protected: // TODO: VirtualFunctionFinder: This is virtual function! diff --git a/reportdesign/source/core/inc/Section.hxx b/reportdesign/source/core/inc/Section.hxx index 595cc9596e8c..0f12e551189c 100644 --- a/reportdesign/source/core/inc/Section.hxx +++ b/reportdesign/source/core/inc/Section.hxx @@ -131,10 +131,10 @@ namespace reportdesign ,const css::uno::Reference< css::uno::XComponentContext >& context, css::uno::Sequence< OUString> const&); public: -static css::uno::Reference< css::report::XSection> +static rtl::Reference< OSection> createOSection(const rtl::Reference< OReportDefinition >&am
core.git: svtools/source
svtools/source/misc/acceleratorexecute.cxx |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit ccef1a40d420a8220ac07e1cc6387c3d77cebcd5 Author: Noel Grandin AuthorDate: Mon Sep 30 19:25:32 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:15:52 2024 +0200 cid#1607958 Data race condition Change-Id: I1d5d0c9eae073f69e4308163dcc62371c31e0d78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174292 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 24a4d365e894..b7370436b175 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -180,15 +180,16 @@ bool AcceleratorExecute::execute(const css::awt::KeyEvent& aAWTKey) OUString sCommand = impl_ts_findCommand(aAWTKey); // No Command found? Do nothing! User is not interested on any error handling .-) -// or for some reason m_xContext is NULL (which would crash impl_ts_getURLParser() -if (sCommand.isEmpty() || !m_xContext.is()) -{ +if (sCommand.isEmpty()) return false; -} // SAFE -> -- std::unique_lock aLock(m_aLock); +// or for some reason m_xContext is NULL (which would crash impl_ts_getURLParser() +if (!m_xContext.is()) +return false; + css::uno::Reference< css::frame::XDispatchProvider > xProvider = m_xDispatcher; aLock.unlock();
core.git: ucb/source
ucb/source/ucp/file/filerror.hxx |1 - ucb/source/ucp/file/filglob.cxx | 10 -- 2 files changed, 11 deletions(-) New commits: commit 89aef7ec59390ff5bbff2c6cc0160948ab5d07bf Author: Noel Grandin AuthorDate: Mon Sep 30 14:49:59 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:17:28 2024 +0200 TRANSFER_ACCESSINGROOT is unused since commit 03b2320067ba3d9855e075044e0427bc7f040bc2 Author: Jens-Heiner Rechtien Date: Mon May 10 13:20:50 2004 + INTEGRATION: CWS relocinst (1.30.68); FILE MERGED Change-Id: I01ad2cc00526cd4308aec9cbddcee3ef97baddd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174304 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/ucb/source/ucp/file/filerror.hxx b/ucb/source/ucp/file/filerror.hxx index ed6e34ce86b4..38b32fec1959 100644 --- a/ucb/source/ucp/file/filerror.hxx +++ b/ucb/source/ucp/file/filerror.hxx @@ -76,7 +76,6 @@ enum class TaskHandlerErr { VALIDFILESTATUSWHILE_FOR_REMOVE , DIRECTORYEXHAUSTED_FOR_REMOVE , -TRANSFER_ACCESSINGROOT, TRANSFER_INVALIDSCHEME, TRANSFER_INVALIDURL , TRANSFER_DESTFILETYPE , diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index 6e42d975646c..c25f21789313 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -758,16 +758,6 @@ namespace fileaccess { aMsg, xComProc ); } -else if( errorCode == TaskHandlerErr::TRANSFER_ACCESSINGROOT ) -{ -ioErrorCode = IOErrorCode_WRITE_PROTECTED; -cancelCommandExecution( -ioErrorCode, -generateErrorArguments(aUncPath), -xEnv, -u"accessing the root during transfer"_ustr, -xComProc ); -} else if( errorCode == TaskHandlerErr::TRANSFER_INVALIDSCHEME ) { aAny <<= InteractiveBadTransferURLException(
core.git: 2 commits - chart2/source comphelper/source include/comphelper include/package include/vcl sd/inc sd/source vcl/source
chart2/source/view/charttypes/HistogramChart.cxx | 41 - chart2/source/view/charttypes/HistogramChart.hxx |6 --- comphelper/source/misc/backupfilehelper.cxx|5 -- include/comphelper/backupfilehelper.hxx|1 include/package/Inflater.hxx |3 - include/vcl/toolkit/ivctrl.hxx |8 sd/inc/sdpage.hxx |1 sd/source/core/sdpage.cxx |5 -- sd/source/ui/annotations/annotationmanagerimpl.hxx |4 -- sd/source/ui/dlg/navigatr.cxx | 36 -- sd/source/ui/inc/navigatr.hxx |3 - vcl/source/control/imivctl1.cxx|5 -- vcl/source/control/ivctrl.cxx |1 13 files changed, 1 insertion(+), 118 deletions(-) New commits: commit c8734eddf4cce6c2c54556fee383f2764dbb981d Author: Noel Grandin AuthorDate: Mon Sep 30 13:33:33 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:16:47 2024 +0200 loplugin:singlevalfields Change-Id: I8f844c40dcb48737d95a3004cd7e8c730656d955 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174299 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 0340eacf164e..95b29933349e 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -45,12 +45,6 @@ namespace o3tl template<> struct typed_flags : is_typed_flags {}; } -enum class SvxIconChoiceCtrlTextMode -{ -Full = 1,// Enlarge BoundRect southwards -Short// Shorten with "..." -}; - class SvxIconChoiceCtrlEntry { Image aImage; @@ -65,7 +59,6 @@ class SvxIconChoiceCtrlEntry tools::Rectangle aRect; // Bounding-Rectangle of the entry -SvxIconChoiceCtrlTextMode eTextMode; sal_uInt16 nX,nY; // for keyboard control SvxIconViewFlagsnFlags; @@ -83,7 +76,6 @@ public: voidSetQuickHelpText( const OUString& rText ) { aQuickHelpText = rText; } const OUString& GetQuickHelpText() const { return aQuickHelpText; } -SvxIconChoiceCtrlTextMode GetTextMode() const { return eTextMode; } SvxIconViewFlagsGetFlags() const { return nFlags; } boolIsSelected() const { return bool(nFlags & SvxIconViewFlags::SELECTED); } boolIsFocused() const { return bool(nFlags & SvxIconViewFlags::FOCUSED); } diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index c264f1481306..2fb00f963a40 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1560,8 +1560,7 @@ void SvxIconChoiceCtrl_Impl::SetGrid( const Size& rSize ) } // Calculates the maximum size that the text rectangle may use within its -// bounding rectangle. In WB_ICON mode with SvxIconChoiceCtrlTextMode::Full, Bottom is set to -// LONG_MAX. +// bounding rectangle. tools::Rectangle SvxIconChoiceCtrl_Impl::CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const { @@ -1582,8 +1581,6 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcMaxTextRect( const SvxIconChoiceCtr aBoundRect.AdjustRight( -1 ); if( aBoundRect.Left() > aBoundRect.Right()) aBoundRect.SetLeft( aBoundRect.Right() ); -if( pEntry->GetTextMode() == SvxIconChoiceCtrlTextMode::Full ) -aBoundRect.SetBottom( LONG_MAX ); } else if (nWinBits & WB_SMALLICON) { diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 4566ad1310b9..05fdf8d41864 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -58,7 +58,6 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( OUString _aText, Image _aImage ) : aImage(std::move(_aImage)) , aText(std::move(_aText)) -, eTextMode(SvxIconChoiceCtrlTextMode::Short) , nX(0) , nY(0) , nFlags(SvxIconViewFlags::NONE) commit a6f1841aedae66915bcc10287bdec21fc2ebe8eb Author: Noel Grandin AuthorDate: Mon Sep 30 13:27:29 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:16:39 2024 +0200 loplugin:unusedmethods Change-Id: I3897ccb3349874672b778835b9c15642cb1a14f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174298 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/chart2/source/view/charttypes/HistogramChart.cxx b/chart2/source/view/charttypes/HistogramChart.cxx index 5ef3d42838d5..3324d61a3f82 100644 --- a/chart2/source/view/charttypes/HistogramChart.cxx +++ b/chart2/source/view/charttypes/HistogramChart.cxx @@ -81,47 +81,6 @@ PlottingPositionHelper& HistogramChart::getPlottingPositionHelper(sal_I
core.git: 2 commits - chart2/source sw/source
chart2/source/model/template/ChartTypeManager.cxx |8 +++--- chart2/source/model/template/HistogramChartTypeTemplate.cxx |4 +-- chart2/source/model/template/HistogramChartTypeTemplate.hxx |2 - chart2/source/model/template/PieChartTypeTemplate.cxx |3 -- chart2/source/model/template/PieChartTypeTemplate.hxx |3 -- sw/source/core/doc/notxtfrm.cxx |2 - sw/source/core/inc/cellfrm.hxx |3 -- sw/source/core/inc/flyfrm.hxx |3 -- sw/source/core/inc/frame.hxx|3 -- sw/source/core/inc/layfrm.hxx |3 -- sw/source/core/inc/notxtfrm.hxx |3 -- sw/source/core/inc/rootfrm.hxx |3 -- sw/source/core/inc/tabfrm.hxx |3 -- sw/source/core/inc/txtfrm.hxx |3 -- sw/source/core/layout/paintfrm.cxx | 16 ++-- sw/source/core/layout/unusedf.cxx |2 - sw/source/core/text/frmpaint.cxx|2 - 17 files changed, 28 insertions(+), 38 deletions(-) New commits: commit 0210aac7f9f52701a3b3b74d4de8eaf86a52e8b5 Author: Noel Grandin AuthorDate: Mon Sep 30 14:03:14 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:17:03 2024 +0200 loplugin:constantparam Change-Id: I114331d1cb7860087d5f5bee77af771e537b0616 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174301 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx index 4ec856c822f0..b81e47ee3884 100644 --- a/chart2/source/model/template/ChartTypeManager.cxx +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -426,22 +426,22 @@ rtl::Reference< ::chart::ChartTypeTemplate > ChartTypeManager::createTemplate( case TEMPLATE_THREEDPIE: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_NONE, false, -chart2::PieChartSubType_NONE, 2, 3 )); +chart2::PieChartSubType_NONE, 3 )); break; case TEMPLATE_THREEDPIEALLEXPLODED: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_ALL_EXPLODED, false, -chart2::PieChartSubType_NONE, 2, 3 )); +chart2::PieChartSubType_NONE, 3 )); break; case TEMPLATE_THREEDDONUT: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_NONE, true, -chart2::PieChartSubType_NONE, 2, 3 )); +chart2::PieChartSubType_NONE, 3 )); break; case TEMPLATE_THREEDDONUTALLEXPLODED: xTemplate.set( new PieChartTypeTemplate( m_xContext, aServiceSpecifier, chart2::PieChartOffsetMode_ALL_EXPLODED, true, -chart2::PieChartSubType_NONE, 2, 3 )); +chart2::PieChartSubType_NONE, 3 )); break; case TEMPLATE_SCATTERLINESYMBOL: diff --git a/chart2/source/model/template/HistogramChartTypeTemplate.cxx b/chart2/source/model/template/HistogramChartTypeTemplate.cxx index 0bc41d56fc7b..97dc001d9550 100644 --- a/chart2/source/model/template/HistogramChartTypeTemplate.cxx +++ b/chart2/source/model/template/HistogramChartTypeTemplate.cxx @@ -61,10 +61,10 @@ namespace chart { HistogramChartTypeTemplate::HistogramChartTypeTemplate( Reference const& xContext, const OUString& rServiceName, -StackMode eStackMode, sal_Int32 nDim /* = 2 */) +StackMode eStackMode) : ChartTypeTemplate(xContext, rServiceName) , m_eStackMode(eStackMode) -, m_nDim(nDim) +, m_nDim(2) { } diff --git a/chart2/source/model/template/HistogramChartTypeTemplate.hxx b/chart2/source/model/template/HistogramChartTypeTemplate.hxx index 292cdce32f33..519292f6107f 100644 --- a/chart2/source/model/template/HistogramChartTypeTemplate.hxx +++ b/chart2/source/model/template/HistogramChartTypeTemplate.hxx @@ -21,7 +21,7 @@ class HistogramChartTypeTemplate : public ChartTypeTemplate, public ::property:: public: explicit HistogramChartTypeTemplate( css::uno::Reference const& xContext, -const OUString& rServiceName, StackMode eStackMode, sal_Int32 nDim = 2); +const OUString& rServiceName, StackMode eStackMode); /// merge XInterface implementations DECLARE_XINTERFACE() diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx index 0ae474623f37..6bd4d3bb6efb 100644 --- a/chart2/source/model/template/PieChartTypeTempla
core.git: 3 commits - reportdesign/source scripting/source
reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx |1 reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx |1 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx |1 reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx |1 scripting/source/stringresource/stringresource.cxx | 35 +--- 5 files changed, 16 insertions(+), 23 deletions(-) New commits: commit e9d1abc0b059a4b6174d3a855757b2f745515907 Author: Noel Grandin AuthorDate: Mon Sep 30 19:22:01 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:15:44 2024 +0200 cid#1608000 Data race condition just remove the mutex, this class is only ever accessed from one thread Change-Id: I7c088c0cb33d21513a5566ae65f663877d829072 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174291 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index c203af228670..81140bd7e161 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -273,7 +273,6 @@ void SAL_CALL ExportDocumentHandler::setDocumentLocator(const uno::Reference< xm } void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any >& _aArguments ) { -std::unique_lock aGuard(m_aMutex); comphelper::SequenceAsHashMap aArgs(_aArguments); m_xDelegatee = aArgs.getUnpackedValueOrDefault(u"DocumentHandler"_ustr,m_xDelegatee); m_xModel = aArgs.getUnpackedValueOrDefault(u"Model"_ustr,m_xModel); diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx index 93465e674242..8dacca06955f 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.hxx @@ -75,7 +75,6 @@ private: virtual ~ExportDocumentHandler() override; -std::mutexm_aMutex; css::uno::Reference< css::uno::XComponentContext >m_xContext; css::uno::Reference< css::xml::sax::XDocumentHandler >m_xDelegatee; css::uno::Reference< css::uno::XAggregation > m_xProxy; commit 21e2158fa11757e43ccd904bba48553b8caba2ca Author: Noel Grandin AuthorDate: Mon Sep 30 19:16:38 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:15:37 2024 +0200 remove unnecessary null checks Change-Id: I73805881eef49fc6886f7f4fbc212da3aac1fd6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174290 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index a081601b42b2..f144fd3bcb32 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -930,7 +930,7 @@ void StringResourcePersistenceImpl::storeToURL( const OUString& URL, std::unique_lock aGuard( m_aMutex ); Reference< ucb::XSimpleFileAccess3 > xFileAccess = ucb::SimpleFileAccess::create(m_xContext); -if( xFileAccess.is() && Handler.is() ) +if( Handler.is() ) xFileAccess->setInteractionHandler( Handler ); implStoreAtLocation( URL, NameBase, Comment, xFileAccess, false/*bUsedForStore*/, true/*bStoreAll*/ ); @@ -2531,7 +2531,7 @@ void StringResourceWithLocationImpl::setURL( const OUString& URL ) void StringResourceWithLocationImpl::implScanLocales() { const Reference< ucb::XSimpleFileAccess3 > xFileAccess = getFileAccessImpl(); -if( xFileAccess.is() && xFileAccess->isFolder( m_aLocation ) ) +if( xFileAccess->isFolder( m_aLocation ) ) { Sequence< OUString > aContentSeq = xFileAccess->getFolderContents( m_aLocation, false ); implScanLocaleNames( aContentSeq ); @@ -2544,23 +2544,20 @@ bool StringResourceWithLocationImpl::implLoadLocale( LocaleItem* pLocaleItem ) bool bSuccess = false; const Reference< ucb::XSimpleFileAccess3 > xFileAccess = getFileAccessImpl(); -if( xFileAccess.is() ) -{ -OUString aCompleteFileName = -implGetPathForLocaleItem( pLocaleItem, m_aNameBase, m_aLocation ); +OUString aCompleteFileName = +implGetPathForLocaleItem( pLocaleItem, m_aNameBase, m_aLocation ); -Reference< io::XInputStream > xInputStream; -try -{ -xInputStream = xFileAccess->openFileRead( aCompleteFileName ); -} -catch( Exception& ) -{} -if( xInputStream.is() ) -{ -bSuccess = StringResourcePersistenceImpl::implReadPropertiesFile( pLocaleItem, xInputStream ); -x
core.git: 2 commits - include/svx include/vcl sd/source svx/inc svx/source vcl/source xmloff/source
include/svx/nbdtmg.hxx |2 +- include/vcl/decoview.hxx | 10 +- sd/source/ui/inc/ToolBarManager.hxx|5 + sd/source/ui/view/ToolBarManager.cxx |5 ++--- svx/inc/sxmsitm.hxx|4 ++-- svx/source/sidebar/nbdtmg.cxx |4 +--- vcl/source/control/imivctl1.cxx|2 +- vcl/source/window/decoview.cxx |6 +- xmloff/source/chart/SchXMLParagraphContext.cxx |5 ++--- xmloff/source/chart/SchXMLParagraphContext.hxx |3 +-- 10 files changed, 13 insertions(+), 33 deletions(-) New commits: commit 1683847f0f6e4d964ac529e125e39e6b047fbe17 Author: Noel Grandin AuthorDate: Mon Sep 30 14:19:11 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:17:19 2024 +0200 loplugin:constantparam Change-Id: Ibf1f8b8c01333f87f8e8cd73ccb0d62f30fbcd2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174303 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/nbdtmg.hxx b/include/svx/nbdtmg.hxx index 8979b736e40c..bccb905a21a2 100644 --- a/include/svx/nbdtmg.hxx +++ b/include/svx/nbdtmg.hxx @@ -161,7 +161,7 @@ class SVX_DLLPUBLIC BulletsTypeMgr final : public NBOTypeMgrBase virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) override; virtual void ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) override; virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override; -void ApplyCustomRule(SvxNumRule& aNum, std::u16string_view sBullet, std::u16string_view sFont, sal_uInt16 mLevel,bool isResetSize=false); +void ApplyCustomRule(SvxNumRule& aNum, std::u16string_view sBullet, std::u16string_view sFont, sal_uInt16 mLevel); virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) override; virtual bool IsCustomized(sal_uInt16 nIndex) override; static BulletsTypeMgr& GetInstance(); diff --git a/sd/source/ui/inc/ToolBarManager.hxx b/sd/source/ui/inc/ToolBarManager.hxx index a5cebb377f5c..da5325cf693c 100644 --- a/sd/source/ui/inc/ToolBarManager.hxx +++ b/sd/source/ui/inc/ToolBarManager.hxx @@ -178,13 +178,10 @@ public: The group is used for the actual tool bars. @param nToolBarId Id of the tool bar shell. -@param bAddBar -Add the toolbar itself with the shell. When false only adds the shell. */ void AddToolBarShell ( ToolBarGroup eGroup, -ShellId nToolBarId, -bool bAddBar = true); +ShellId nToolBarId); /** Remove the tool bar with the given name from the specified group. If the tool bar is not visible then nothing happens. diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index dac9aa1d8c96..d1152ec6ce23 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -389,13 +389,12 @@ void ToolBarManager::AddToolBar ( void ToolBarManager::AddToolBarShell ( ToolBarGroup eGroup, -ShellId nToolBarId, -bool bAddBar) +ShellId nToolBarId) { if (mpImpl != nullptr) { UpdateLock aLock (shared_from_this()); -mpImpl->AddToolBarShell(eGroup,nToolBarId,bAddBar); +mpImpl->AddToolBarShell(eGroup,nToolBarId,/*bAddBar*/true); } } diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 9d5e1826c983..1600c043db0f 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -349,7 +349,7 @@ void BulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 } void BulletsTypeMgr::ApplyCustomRule(SvxNumRule& aNum, std::u16string_view sBullet, - std::u16string_view sFont, sal_uInt16 mLevel, bool isResetSize) + std::u16string_view sFont, sal_uInt16 mLevel) { sal_uInt16 nMask = 1; OUString sBulletCharFormatName = GetBulletCharFmtName(); @@ -364,8 +364,6 @@ void BulletsTypeMgr::ApplyCustomRule(SvxNumRule& aNum, std::u16string_view sBull aFmt.SetBulletChar(sBullet[0]); aFmt.SetCharFormatName(sBulletCharFormatName); aFmt.SetListFormat(""); -if (isResetSize) -aFmt.SetBulletRelSize(45); aNum.SetLevel(i, aFmt); } nMask <<= 1; commit 6fdad723729a458eaff7ca509cb202ad355832be Author: Noel Grandin AuthorDate: Mon Sep 30 14:03:21 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:17:11 2024 +0200 loplugin:constantparam Change-Id: I81c9647ec7166ba429f6f58e3bd86b3a5ee4848f Reviewed-on: https://gerrit.libreoffice.org/c/
core.git: 2 commits - include/dbaccess sd/source sw/source
include/dbaccess/AsynchronousLink.hxx|8 ++-- sd/source/ui/unoidl/unomodel.cxx |6 +- sd/source/ui/view/ToolBarManager.cxx |2 -- sw/source/core/unocore/unocontentcontrol.cxx |4 +--- 4 files changed, 8 insertions(+), 12 deletions(-) New commits: commit 7ccad64046ec871b8f4524497a703f9548ddbdfa Author: Noel Grandin AuthorDate: Mon Sep 30 12:56:46 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:16:12 2024 +0200 loplugin:unusedfields Change-Id: I391bcae0c8491a17c57083e1375c8ed50d72ee9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174295 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index b8f752199f4b..e680534fb46c 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -233,8 +233,6 @@ public: private: bool getFillStyleImpl(const uno::Reference& xDrawPage); private: -uno::Reference mxDrawPage; -uno::Reference mxMasterPage; uno::Reference mxBackground; bool mbIsCustom; bool bHasBackground; @@ -245,9 +243,7 @@ private: SlideBackgroundInfo::SlideBackgroundInfo( const uno::Reference& xDrawPage, const uno::Reference& xMasterPage) -: mxDrawPage(xDrawPage) -, mxMasterPage(xMasterPage) -, mbIsCustom(false) +: mbIsCustom(false) , bHasBackground(false) , mbIsSolidColor(false) , maFillStyle(drawing::FillStyle_NONE) diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index 89a8f9cfba61..dac9aa1d8c96 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -180,8 +180,6 @@ private: things easier and does not waste too much memory. */ GroupedShellList maCurrentList; - -std::shared_ptr pCurrentActiveShell; }; /** This class concentrates the knowledge about when to show what tool bars diff --git a/sw/source/core/unocore/unocontentcontrol.cxx b/sw/source/core/unocore/unocontentcontrol.cxx index 3328c5eafb73..5327a4d646da 100644 --- a/sw/source/core/unocore/unocontentcontrol.cxx +++ b/sw/source/core/unocore/unocontentcontrol.cxx @@ -187,7 +187,6 @@ public: sal_uInt32 m_nTabIndex; OUString m_aLock; OUString m_aMultiLine; -SwContentControlType m_iType; Impl(SwXContentControl& rThis, SwDoc& rDoc, SwContentControl* pContentControl, css::uno::Reference xParentText, std::unique_ptr pPortions) @@ -207,7 +206,6 @@ public: , m_bDropDown(false) , m_nId(0) , m_nTabIndex(0) -, m_iType(SwContentControlType::RICH_TEXT) { if (m_pContentControl) { @@ -1346,7 +1344,7 @@ uno::Any SAL_CALL SwXContentControl::getPropertyValue(const OUString& rPropertyN { if (m_pImpl->m_bIsDescriptor) { -aRet <<= static_cast(m_pImpl->m_iType); +aRet <<= static_cast(SwContentControlType::RICH_TEXT); } else { commit 9a2f11cc1fc9b0157e185b39abbd6a50c4cfc8cd Author: Noel Grandin AuthorDate: Mon Sep 30 19:35:01 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 11:16:00 2024 +0200 cid#1607861 Data race condition Change-Id: Ib58f6613b98b2b778c9894359fe92b6fcf33298d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174293 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/dbaccess/AsynchronousLink.hxx b/include/dbaccess/AsynchronousLink.hxx index 22c40dc5b714..cd1af635c03a 100644 --- a/include/dbaccess/AsynchronousLink.hxx +++ b/include/dbaccess/AsynchronousLink.hxx @@ -38,7 +38,7 @@ namespace dbaui class OAsynchronousLink final { Linkm_aHandler; -std::mutex m_aEventSafety; +mutable std::mutex m_aEventSafety; std::mutex m_aDestructionSafety; ImplSVEvent * m_nEventId; DECL_LINK(OnAsyncCall, void*, void); @@ -50,7 +50,11 @@ namespace dbaui OAsynchronousLink( const Link& _rHandler ); ~OAsynchronousLink(); -boolIsRunning() const { return m_nEventId != nullptr; } +boolIsRunning() const +{ +std::unique_lock aEventGuard(m_aEventSafety); +return m_nEventId != nullptr; +} void Call( void* _pArgument = nullptr ); void CancelCall();
core.git: basctl/source comphelper/source include/comphelper
basctl/source/basicide/doceventnotifier.cxx |8 +--- comphelper/source/misc/compbase.cxx | 15 +++ include/comphelper/compbase.hxx |3 +++ 3 files changed, 19 insertions(+), 7 deletions(-) New commits: commit fc0cb364ae479ccb98e4c064da87ad151cdb5f39 Author: Noel Grandin AuthorDate: Tue Oct 1 11:39:45 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 15:18:21 2024 +0200 create method for doing the "dispose-on-destruct" which is (a) a little tricky and (b) needs to be on the base class to get the locking just right Change-Id: I425d4747e7e0ca0741fded9a6a70f6fa9995e102 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174312 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/basctl/source/basicide/doceventnotifier.cxx b/basctl/source/basicide/doceventnotifier.cxx index 9d408d7f967a..dfaa9eb13930 100644 --- a/basctl/source/basicide/doceventnotifier.cxx +++ b/basctl/source/basicide/doceventnotifier.cxx @@ -105,13 +105,7 @@ namespace basctl DocumentEventNotifier::Impl::~Impl () { -std::unique_lock aGuard(m_aMutex); -if ( !impl_isDisposed_nothrow(aGuard) ) -{ -acquire(); -aGuard.unlock(); // dispose locks m_aMutex -dispose(); -} +disposeOnDestruct(); } void SAL_CALL DocumentEventNotifier::Impl::documentEventOccured( const DocumentEvent& _rEvent ) diff --git a/comphelper/source/misc/compbase.cxx b/comphelper/source/misc/compbase.cxx index 1827527d1d56..ad333acfaaa5 100644 --- a/comphelper/source/misc/compbase.cxx +++ b/comphelper/source/misc/compbase.cxx @@ -30,6 +30,21 @@ void SAL_CALL WeakComponentImplHelperBase::dispose() maEventListeners.disposeAndClear(aGuard, aEvt); } +// This is only called from the destructor to do cleanup that +// might not have occurred +void WeakComponentImplHelperBase::disposeOnDestruct() +{ +std::unique_lock aGuard(m_aMutex); +assert(m_refCount == 0 && "only supposed to be called from the destructor"); +if (m_bDisposed) +return; +m_bDisposed = true; +// bump the ref-count so we dont accidentally do a double delete +// if something else increases and then decreases our ref-count +cppu::OWeakObject::acquire(); +disposing(aGuard); +} + void WeakComponentImplHelperBase::disposing(std::unique_lock&) {} void SAL_CALL WeakComponentImplHelperBase::addEventListener( diff --git a/include/comphelper/compbase.hxx b/include/comphelper/compbase.hxx index c0ebf3f1ff1d..d12dedb363a2 100644 --- a/include/comphelper/compbase.hxx +++ b/include/comphelper/compbase.hxx @@ -56,6 +56,9 @@ protected: if (m_bDisposed) throw css::lang::DisposedException(OUString(), static_cast(this)); } +// only to be called from the destructor, to run the dispose logic, if necessary +void disposeOnDestruct(); + comphelper::OInterfaceContainerHelper4 maEventListeners; };
core.git: 2 commits - reportdesign/inc reportdesign/source
reportdesign/inc/ReportDefinition.hxx|1 reportdesign/source/core/api/Group.cxx | 10 +++-- reportdesign/source/core/api/Groups.cxx |5 ++-- reportdesign/source/core/api/Section.cxx | 33 --- reportdesign/source/core/inc/Group.hxx |7 -- reportdesign/source/core/inc/Groups.hxx |7 -- reportdesign/source/core/inc/Section.hxx | 16 +-- 7 files changed, 49 insertions(+), 30 deletions(-) New commits: commit 9939f5cbf044c7d671e7c9f55fa489e3e479f921 Author: Noel Grandin AuthorDate: Tue Oct 1 12:37:49 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 15:17:51 2024 +0200 use more concrete UNO types in reportdesign Change-Id: I29b3b85f8ff71d66ca874434d5412145e5cfb731 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174316 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/reportdesign/source/core/api/Groups.cxx b/reportdesign/source/core/api/Groups.cxx index 375b8b0f545b..4a1170e4c6b8 100644 --- a/reportdesign/source/core/api/Groups.cxx +++ b/reportdesign/source/core/api/Groups.cxx @@ -18,6 +18,7 @@ */ #include #include +#include #include #include #include @@ -30,7 +31,7 @@ namespace reportdesign using namespace com::sun::star; -OGroups::OGroups(const uno::Reference< report::XReportDefinition >& _xParent,uno::Reference< uno::XComponentContext > context) +OGroups::OGroups(const rtl::Reference< OReportDefinition >& _xParent,uno::Reference< uno::XComponentContext > context) :GroupsBase(m_aMutex) ,m_aContainerListeners(m_aMutex) ,m_xContext(std::move(context)) @@ -64,7 +65,7 @@ void SAL_CALL OGroups::disposing() // XGroups uno::Reference< report::XReportDefinition > SAL_CALL OGroups::getReportDefinition() { -return m_xParent; +return m_xParent.get(); } uno::Reference< report::XGroup > SAL_CALL OGroups::createGroup( ) diff --git a/reportdesign/source/core/inc/Groups.hxx b/reportdesign/source/core/inc/Groups.hxx index c8d93189b2e9..d02524888580 100644 --- a/reportdesign/source/core/inc/Groups.hxx +++ b/reportdesign/source/core/inc/Groups.hxx @@ -23,12 +23,15 @@ #include #include #include +#include #include #include namespace reportdesign { +class OReportDefinition; + typedef ::cppu::WeakComponentImplHelper< css::report::XGroups> GroupsBase; /** * \ingroup reportdesign_api @@ -40,7 +43,7 @@ namespace reportdesign typedef ::std::vector< css::uno::Reference< css::report::XGroup > > TGroups; ::comphelper::OInterfaceContainerHelper3 m_aContainerListeners; css::uno::Reference< css::uno::XComponentContext > m_xContext; -css::uno::WeakReference< css::report::XReportDefinition > m_xParent; +unotools::WeakReference< OReportDefinition > m_xParent; TGroups m_aGroups; private: OGroups& operator=(const OGroups&) = delete; @@ -57,7 +60,7 @@ namespace reportdesign virtual void SAL_CALL disposing() override; public: -OGroups( const css::uno::Reference< css::report::XReportDefinition >& _xParent +OGroups( const rtl::Reference< OReportDefinition >& _xParent ,css::uno::Reference< css::uno::XComponentContext > context); // XGroups commit a9dcb13707a0dea6d04d55d66383078128cfe232 Author: Noel Grandin AuthorDate: Tue Oct 1 12:17:35 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 15:17:42 2024 +0200 use more concrete UNO types in reportdesign Change-Id: I30e391c1d5166ad24e129a20db1d7403644f8791 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174315 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx index 1d56882b5c36..f2f3fb18577c 100644 --- a/reportdesign/inc/ReportDefinition.hxx +++ b/reportdesign/inc/ReportDefinition.hxx @@ -192,7 +192,6 @@ namespace reportdesign static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); UNLESS_MERGELIBS_MORE(REPORTDESIGN_DLLPUBLIC) static std::shared_ptr getSdrModel(const css::uno::Reference< css::report::XReportDefinition >& _xReportDefinition); -private: DECLARE_XINTERFACE( ) DECLARE_XTYPEPROVIDER( ) // css::lang::XServiceInfo diff --git a/reportdesign/source/core/api/Group.cxx b/reportdesign/source/core/api/Group.cxx index ab368dda5940..d7fe730184a4 100644 --- a/reportdesign/source/core/api/Group.cxx +++ b/reportdesign/source/core/api/Group.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include +#include #include #include #include @@ -35,7 +36,7 @@ namespace reportdesign using names
core.git: desktop/source
desktop/source/lib/init.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit c77d6568067e722d7251060e4d739889151b75ba Author: Noel Grandin AuthorDate: Tue Oct 1 11:44:52 2024 +0200 Commit: Noel Grandin CommitDate: Tue Oct 1 14:03:12 2024 +0200 simplify Change-Id: I8ff1c3c333b2a44871150da3929501dec00613e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174313 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c5720c992ea5..d8d217d571ae 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4715,8 +4715,7 @@ static void doc_initializeForRendering(LibreOfficeKitDocument* pThis, } else if (rArg.Name == ".uno:SignatureCa" && rArg.Value.has()) { -std::string aSignatureCa; -aSignatureCa = rArg.Value.get().toUtf8(); +std::string aSignatureCa(rArg.Value.get().toUtf8()); std::vector aCerts = SfxLokHelper::extractCertificates(aSignatureCa); SfxLokHelper::addCertificates(aCerts); }
core.git: 2 commits - connectivity/source dbaccess/source include/ucbhelper ucbhelper/source ucb/source
connectivity/source/drivers/odbc/OStatement.cxx| 22 +- connectivity/source/inc/odbc/OStatement.hxx|5 dbaccess/source/core/dataaccess/myucp_datasupplier.cxx | 30 +-- dbaccess/source/core/dataaccess/myucp_datasupplier.hxx | 17 + include/ucbhelper/resultset.hxx| 19 +- ucb/source/ucp/cmis/cmis_datasupplier.cxx | 22 +- ucb/source/ucp/cmis/cmis_datasupplier.hxx | 12 - ucb/source/ucp/ext/ucpext_datasupplier.cxx | 18 - ucb/source/ucp/ext/ucpext_datasupplier.hxx | 12 - ucb/source/ucp/gio/gio_datasupplier.cxx| 22 +- ucb/source/ucp/gio/gio_datasupplier.hxx| 12 - ucb/source/ucp/hierarchy/hierarchydatasupplier.cxx | 36 ++- ucb/source/ucp/hierarchy/hierarchydatasupplier.hxx | 16 - ucb/source/ucp/package/pkgdatasupplier.cxx | 40 ++-- ucb/source/ucp/package/pkgdatasupplier.hxx | 18 - ucb/source/ucp/tdoc/tdoc_datasupplier.cxx | 42 ++-- ucb/source/ucp/tdoc/tdoc_datasupplier.hxx | 18 - ucb/source/ucp/webdav-curl/webdavdatasupplier.cxx | 30 +-- ucb/source/ucp/webdav-curl/webdavdatasupplier.hxx | 14 - ucbhelper/source/provider/resultset.cxx| 154 +++-- 20 files changed, 313 insertions(+), 246 deletions(-) New commits: commit 6571e77d03491090c9d3a4ef74295bd4cfc3fda4 Author: Noel Grandin AuthorDate: Mon Sep 30 15:35:25 2024 +0200 Commit: Noel Grandin CommitDate: Mon Sep 30 18:24:41 2024 +0200 use more concrete UNO type in odbc::OStatement_Base Change-Id: I86073baf25e2f10a57879fcedbbb1c0e8c354813 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174281 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/connectivity/source/drivers/odbc/OStatement.cxx b/connectivity/source/drivers/odbc/OStatement.cxx index 13970dc7b80e..895bfa59dc60 100644 --- a/connectivity/source/drivers/odbc/OStatement.cxx +++ b/connectivity/source/drivers/odbc/OStatement.cxx @@ -83,10 +83,12 @@ OStatement_Base::~OStatement_Base() void OStatement_Base::disposeResultSet() { // free the cursor if alive -Reference< XComponent > xComp(m_xResultSet.get(), UNO_QUERY); +rtl::Reference< OResultSet > xComp(m_xResultSet.get()); if (xComp.is()) +{ xComp->dispose(); -m_xResultSet.clear(); +m_xResultSet.clear(); +} } void SAL_CALL OStatement_Base::disposing() @@ -208,8 +210,7 @@ void OStatement_Base::clearMyResultSet() try { -Reference xCloseable( -m_xResultSet.get(), css::uno::UNO_QUERY); +rtl::Reference xCloseable(m_xResultSet.get()); if ( xCloseable.is() ) xCloseable->close(); } @@ -362,7 +363,7 @@ sal_Bool SAL_CALL OStatement_Base::execute( const OUString& sql ) // getResultSet returns the current result as a ResultSet. It // returns NULL if the current result is not a ResultSet. -Reference< XResultSet > OStatement_Base::getResultSet(bool checkCount) +rtl::Reference< OResultSet > OStatement_Base::getResultSet(bool checkCount) { ::osl::MutexGuard aGuard( m_aMutex ); checkDisposed(OStatement_BASE::rBHelper.bDisposed); @@ -427,15 +428,15 @@ Reference< XResultSet > SAL_CALL OStatement_Base::executeQuery( const OUString& checkDisposed(OStatement_BASE::rBHelper.bDisposed); -Reference< XResultSet > xRS; +rtl::Reference< OResultSet > xRS; // Execute the statement. If execute returns true, a result // set exists. if (execute (sql)) { -xRS = getResultSet (false); -m_xResultSet = xRS; +xRS = getResultSet(false); +m_xResultSet = xRS.get(); } else { @@ -542,8 +543,9 @@ Reference< XResultSet > SAL_CALL OStatement_Base::getResultSet( ) checkDisposed(OStatement_BASE::rBHelper.bDisposed); -m_xResultSet = getResultSet(true); -return m_xResultSet; +rtl::Reference xRS = getResultSet(true); +m_xResultSet = xRS.get(); +return xRS; } diff --git a/connectivity/source/inc/odbc/OStatement.hxx b/connectivity/source/inc/odbc/OStatement.hxx index 773e79b8d266..2de1e905364d 100644 --- a/connectivity/source/inc/odbc/OStatement.hxx +++ b/connectivity/source/inc/odbc/OStatement.hxx @@ -37,6 +37,7 @@ #include #include #include +#include namespace connectivity::odbc { @@ -61,7 +62,7 @@ namespace connectivity::odbc { css::sdbc::SQLWarning m_aLastWarning; protected: -css::uno::WeakReference< css::sdbc::XResultSet> m_xResultSet; // The last ResultSet created +unotools::WeakReference< OResultSet > m_xResultSet; // The last ResultSet created css::uno::Reference< css::sdbc::XStatement> m_xGeneratedStatement;
core.git: include/svl include/svx
include/svl/poolitem.hxx |1 + include/svx/sdgcpitm.hxx |2 +- 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit eb73e2c8b66ef3539e68ee8150e119bbe437955c Author: Noel Grandin AuthorDate: Mon Sep 30 13:49:56 2024 +0200 Commit: Noel Grandin CommitDate: Mon Sep 30 18:27:45 2024 +0200 SdrGrafCropItem needs its own SfxItemType Change-Id: I45bf4abf015dd493451f77e66dd70006867a2a6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174268 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index dcf1a449eeb5..85bdef1c563e 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -178,6 +178,7 @@ enum class SfxItemType : sal_uInt16 { SdrFractionItemType, SdrGrafBlueItemType, SdrGrafContrastItemType, +SdrGrafCropType, SdrGrafGamma100ItemType, SdrGrafGreenItemType, SdrGrafLuminanceItemType, diff --git a/include/svx/sdgcpitm.hxx b/include/svx/sdgcpitm.hxx index a9712a15608d..d2c25d57f896 100644 --- a/include/svx/sdgcpitm.hxx +++ b/include/svx/sdgcpitm.hxx @@ -35,7 +35,7 @@ public: SdrGrafCropItem( sal_Int32 nLeftCrop = 0, sal_Int32 nTopCrop = 0, sal_Int32 nRightCrop = 0, sal_Int32 nBottomCrop = 0 ) : -SvxGrfCrop( nLeftCrop, nRightCrop, nTopCrop, nBottomCrop, SDRATTR_GRAFCROP ) {} +SvxGrfCrop( nLeftCrop, nRightCrop, nTopCrop, nBottomCrop, SDRATTR_GRAFCROP, SfxItemType::SdrGrafCropType ) {} virtual SdrGrafCropItem* Clone( SfxItemPool* pPool = nullptr ) const override; };
core.git: 2 commits - connectivity/source
connectivity/source/drivers/calc/CConnection.cxx|4 ++-- connectivity/source/drivers/dbase/DConnection.cxx |4 ++-- connectivity/source/drivers/file/FConnection.cxx|6 +++--- connectivity/source/drivers/file/FPreparedStatement.cxx |2 +- connectivity/source/drivers/file/FStatement.cxx | 10 -- connectivity/source/drivers/flat/EConnection.cxx|4 ++-- connectivity/source/drivers/writer/WConnection.cxx |4 ++-- connectivity/source/inc/file/FConnection.hxx|5 - connectivity/source/inc/file/FStatement.hxx |3 ++- 9 files changed, 22 insertions(+), 20 deletions(-) New commits: commit 84725adbdc3419b78fad567b59456fdb80db3a93 Author: Noel Grandin AuthorDate: Mon Sep 30 15:45:44 2024 +0200 Commit: Noel Grandin CommitDate: Mon Sep 30 18:25:01 2024 +0200 use more concrete UNO type in file::OConnection Change-Id: I6fe51ae569430d8f31217d7781b3e98e79e1c607 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174283 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx index 7cb543d5d9e2..d1ae21a38e07 100644 --- a/connectivity/source/drivers/calc/CConnection.cxx +++ b/connectivity/source/drivers/calc/CConnection.cxx @@ -213,11 +213,11 @@ Reference< XDatabaseMetaData > SAL_CALL OCalcConnection::getMetaData( ) css::uno::Reference< XTablesSupplier > OCalcConnection::createCatalog() { ::osl::MutexGuard aGuard( m_aMutex ); -Reference< XTablesSupplier > xTab = m_xCatalog; +rtl::Reference< connectivity::sdbcx::OCatalog > xTab = m_xCatalog; if(!xTab.is()) { xTab = new OCalcCatalog(this); -m_xCatalog = xTab; +m_xCatalog = xTab.get(); } return xTab; } diff --git a/connectivity/source/drivers/dbase/DConnection.cxx b/connectivity/source/drivers/dbase/DConnection.cxx index 696f7dd3d53c..ab97a3aeeaa0 100644 --- a/connectivity/source/drivers/dbase/DConnection.cxx +++ b/connectivity/source/drivers/dbase/DConnection.cxx @@ -69,11 +69,11 @@ Reference< XDatabaseMetaData > SAL_CALL ODbaseConnection::getMetaData( ) css::uno::Reference< XTablesSupplier > ODbaseConnection::createCatalog() { ::osl::MutexGuard aGuard( m_aMutex ); -Reference< XTablesSupplier > xTab = m_xCatalog; +rtl::Reference< connectivity::sdbcx::OCatalog > xTab = m_xCatalog; if(!xTab.is()) { xTab = new ODbaseCatalog(this); -m_xCatalog = xTab; +m_xCatalog = xTab.get(); } return xTab; } diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx index d1635906e24a..cc55b54ba8e7 100644 --- a/connectivity/source/drivers/file/FConnection.cxx +++ b/connectivity/source/drivers/file/FConnection.cxx @@ -368,17 +368,17 @@ void OConnection::disposing() m_xDir.clear(); m_xContent.clear(); -m_xCatalog = WeakReference< XTablesSupplier>(); +m_xCatalog.clear(); } Reference< XTablesSupplier > OConnection::createCatalog() { ::osl::MutexGuard aGuard( m_aMutex ); -Reference< XTablesSupplier > xTab = m_xCatalog; +rtl::Reference< connectivity::sdbcx::OCatalog > xTab = m_xCatalog.get(); if(!xTab.is()) { xTab = new OFileCatalog(this); -m_xCatalog = xTab; +m_xCatalog = xTab.get(); } return xTab; } diff --git a/connectivity/source/drivers/flat/EConnection.cxx b/connectivity/source/drivers/flat/EConnection.cxx index 1529e5baaddb..3f199cdfc4f0 100644 --- a/connectivity/source/drivers/flat/EConnection.cxx +++ b/connectivity/source/drivers/flat/EConnection.cxx @@ -132,11 +132,11 @@ Reference< XDatabaseMetaData > SAL_CALL OFlatConnection::getMetaData( ) css::uno::Reference< XTablesSupplier > OFlatConnection::createCatalog() { ::osl::MutexGuard aGuard( m_aMutex ); -Reference< XTablesSupplier > xTab = m_xCatalog; +rtl::Reference< connectivity::sdbcx::OCatalog > xTab = m_xCatalog; if(!xTab.is()) { xTab = new OFlatCatalog(this); -m_xCatalog = xTab; +m_xCatalog = xTab.get(); } return xTab; } diff --git a/connectivity/source/drivers/writer/WConnection.cxx b/connectivity/source/drivers/writer/WConnection.cxx index 9f59541c0125..0f23b315beca 100644 --- a/connectivity/source/drivers/writer/WConnection.cxx +++ b/connectivity/source/drivers/writer/WConnection.cxx @@ -198,11 +198,11 @@ uno::Reference SAL_CALL OWriterConnection::getMetaData( css::uno::Reference OWriterConnection::createCatalog() { ::osl::MutexGuard aGuard(m_aMutex); -uno::Reference xTab = m_xCatalog; +rtl::Reference xTab = m_xCatalog; if (!xTab.is()) { xTab = new OWriterCatalog(this); -m_xCatalog = xTab; +m_xCatalog = xTab
core.git: Branch 'libreoffice-24-8' - vcl/source
vcl/source/gdi/print.cxx |5 - 1 file changed, 5 deletions(-) New commits: commit 3c0fc2ca962275dcd8bc28c68b6717257b6066ec Author: Noel Grandin AuthorDate: Wed Sep 25 14:29:30 2024 +0200 Commit: Xisco Fauli CommitDate: Mon Sep 30 12:10:50 2024 +0200 fix Printer::EmulateDrawTransparent after commit 9153a36b59f2efc2bfb2c9256c39eb5687808deb Author: Chris Sherlock Date: Fri Mar 28 23:30:02 2014 +1100 fdo#74702 Refactor OutputDevice::DrawTransparent() where it looks like a copy/paste error resulted in the metafile and mpAlphaVDev being restored too early. Change-Id: Ib2989927166bc2da7c8da6274f295a73218386fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173935 Reviewed-by: Noel Grandin Tested-by: Jenkins (cherry picked from commit 747e2676ec0681c6cd8789ab9218b437e17474b5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173914 Reviewed-by: Xisco Fauli diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 06625a4227bd..3b4fd7c9c8db 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -221,11 +221,6 @@ void Printer::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, GDIMetaFile* pOldMetaFile = mpMetaFile; mpMetaFile = nullptr; -mpMetaFile = pOldMetaFile; - -// #110958# Restore disabled alpha VDev -mpAlphaVDev = pOldAlphaVDev; - tools::Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() ); const Size aDPISize( LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch)) ); const tools::Long nBaseExtent = std::max( basegfx::fround( aDPISize.Width() / 300. ), 1 );
core.git: sw/inc sw/source
sw/inc/doc.hxx |3 ++ sw/source/core/bastyp/init.cxx |2 - sw/source/core/doc/doc.cxx | 39 + sw/source/filter/ww8/rtfexport.cxx | 15 -- 4 files changed, 48 insertions(+), 11 deletions(-) New commits: commit 3d0058306385d0322c18d397fce1cd6e94daa1a3 Author: Noel Grandin AuthorDate: Tue Sep 24 15:43:21 2024 +0200 Commit: Noel Grandin CommitDate: Mon Sep 30 09:46:47 2024 +0200 dont use GetItemSurrogates for gathering SvxBrushItem which is very expensive these days Change-Id: I6ef85e3f635d11263d87cfd57c5153a450da46e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173868 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index a90f82fcd720..8c3adf65c6ec 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1474,6 +1474,9 @@ public: /// Iterate over all RES_SHADOW SvxShadowItem, if the function returns false, iteration is stopped SW_DLLPUBLIC void ForEachShadowItem(const std::function& ) const; +/// Iterate over all RES_BACKGROUND SvxBrushItem, if the function returns false, iteration is stopped +SW_DLLPUBLIC void ForEachBackgroundBrushItem(const std::function& ) const; + // Call into intransparent Basic; expect possible Return String. void ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ); diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 3bbfd40268a1..bd69f9689cbc 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -407,7 +407,7 @@ ItemInfoPackage& getItemInfoPackageSwAttributes() { RES_VERT_ORIENT, new SwFormatVertOrient, FN_VERT_ORIENT, SFX_ITEMINFOFLAG_NONE }, { RES_HORI_ORIENT, new SwFormatHoriOrient, FN_HORI_ORIENT, SFX_ITEMINFOFLAG_NONE }, { RES_ANCHOR, new SwFormatAnchor, 0, SFX_ITEMINFOFLAG_NONE }, -{ RES_BACKGROUND, new SvxBrushItem( RES_BACKGROUND ), SID_ATTR_BRUSH, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE }, +{ RES_BACKGROUND, new SvxBrushItem( RES_BACKGROUND ), SID_ATTR_BRUSH, SFX_ITEMINFOFLAG_NONE }, { RES_BOX, new SvxBoxItem( RES_BOX ), SID_ATTR_BORDER_OUTER, SFX_ITEMINFOFLAG_NONE }, { RES_SHADOW, new SvxShadowItem( RES_SHADOW ), SID_ATTR_BORDER_SHADOW, SFX_ITEMINFOFLAG_NONE }, { RES_FRMMACRO, new SvxMacroItem( RES_FRMMACRO ), SID_ATTR_MACROITEM, SFX_ITEMINFOFLAG_NONE }, diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index f32c3655b571..6c3db0e7acaa 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1634,6 +1634,45 @@ void SwDoc::ForEachShadowItem(const std::function& r } } +/// Iterate over all RES_BACKGROUND SvxBrushItem, if the function returns false, iteration is stopped +void SwDoc::ForEachBackgroundBrushItem(const std::function& rFunc ) const +{ +SwNodeOffset nCount = GetNodes().Count(); +for (SwNodeOffset i(0); i < nCount; ++i) +{ +const SwNode* pNode = GetNodes()[i]; +if (!pNode->IsTableNode()) +continue; +const SwTableNode* pTableNode = pNode->GetTableNode(); +const SwTable& rTable = pTableNode->GetTable(); +if (const SwTableFormat* pFormat = rTable.GetFrameFormat()) +{ +const SwAttrSet& rAttrSet = pFormat->GetAttrSet(); +if (const SvxBrushItem* pItem = rAttrSet.GetItemIfSet(RES_BACKGROUND)) +if (!rFunc(*pItem)) +return; +} +for (const SwTableLine* pTableLine : rTable.GetTabLines()) +{ +if (const SwTableLineFormat* pFormat = pTableLine->GetFrameFormat()) +{ +const SwAttrSet& rAttrSet = pFormat->GetAttrSet(); +if (const SvxBrushItem* pItem = rAttrSet.GetItemIfSet(RES_BACKGROUND)) +if (!rFunc(*pItem)) +return; +} +for (const SwTableBox* pTableBox : pTableLine->GetTabBoxes()) +if (SwTableBoxFormat* pFormat = pTableBox->GetFrameFormat()) +{ +const SwAttrSet& rAttrSet = pFormat->GetAttrSet(); +if (const SvxBrushItem* pItem = rAttrSet.GetItemIfSet(RES_BACKGROUND)) +if (!rFunc(*pItem)) +return; +} +} +} +} + void SwDoc::Summary(SwDoc& rExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress) { const SwOutlineNodes& rOutNds = GetNodes().GetOutLineNds(); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 0ce35c6f9c29..ffd36410f4b6 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -1316,7 +1316,6 @@ void RtfExport::OutColorTable()
core.git: sw/source
sw/source/core/doc/DocumentRedlineManager.cxx | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) New commits: commit bf340cc7d08545dd2fd9c1c53a9f2907df3ad533 Author: Noel Grandin AuthorDate: Sun Sep 29 13:28:26 2024 +0200 Commit: Noel Grandin CommitDate: Mon Sep 30 08:07:33 2024 +0200 cid#1606686 Overflowed constant Change-Id: Ib2e96b80ee91d5617ae643202187460df0eb05a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174203 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 411727e1880f..d510491fb8f4 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -1204,15 +1204,13 @@ void DocumentRedlineManager::SetRedlineFlags( RedlineFlags eMode ) } for (sal_uInt16 nLoop = 1; nLoop <= 2; ++nLoop) -for (size_t i = 0; i < maRedlineTable.size(); ++i) +for (size_t i = 0; i < maRedlineTable.size(); ) { SwRangeRedline *const pRedline = maRedlineTable[i]; (pRedline->*pFnc)(nLoop, i, false); -while (maRedlineTable.size() <= i -|| maRedlineTable[i] != pRedline) -{// ensure current position ---i; // a previous redline may have been deleted -} +// a previous redline may have been deleted +if (i < maRedlineTable.size() && maRedlineTable[i] == pRedline) +++i; } //SwRangeRedline::MoveFromSection routinely changes
core.git: sw/source
sw/source/core/unocore/unochart.cxx | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) New commits: commit 358298fd29caf3f20f84445aad0a907ccf54aff7 Author: Noel Grandin AuthorDate: Sun Sep 29 12:27:06 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 20:29:33 2024 +0200 simplify Change-Id: I18e27d76af250ab8fa6534fdb1876a90e3343d9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174185 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 10c79c82cd10..8d170ff4893e 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -2205,15 +2205,12 @@ void SAL_CALL SwChartDataSequence::disposing( const lang::EventObject& rSource ) void SAL_CALL SwChartDataSequence::dispose( ) { -bool bMustDispose( false ); { std::unique_lock aGuard( GetChartMutex() ); -bMustDispose = !m_bDisposed; -if (!m_bDisposed) -m_bDisposed = true; +if (m_bDisposed) +return; +m_bDisposed = true; } -if (!bMustDispose) -return; if (m_xDataProvider.is()) { @@ -2653,19 +2650,13 @@ void SAL_CALL SwChartLabeledDataSequence::removeModifyListener( void SAL_CALL SwChartLabeledDataSequence::dispose( ) { -bool bMustDispose( false ); -{ -std::unique_lock aGuard( GetChartMutex() ); -bMustDispose = !m_bDisposed; -if (!m_bDisposed) -m_bDisposed = true; -} -if (!bMustDispose) +std::unique_lock aGuard( GetChartMutex() ); +if (m_bDisposed) return; +m_bDisposed = true; // require listeners to release references to this object lang::EventObject aEvtObj( static_cast< chart2::data::XLabeledDataSequence * >(this) ); -std::unique_lock aGuard( GetChartMutex() ); m_aModifyListeners.disposeAndClear( aGuard, aEvtObj ); m_aEventListeners.disposeAndClear( aGuard, aEvtObj ); }
core.git: sw/source
sw/source/core/doc/docglbl.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 2b4375fcfa5f1f852ab6c85ca82d55c2be324b70 Author: Noel Grandin AuthorDate: Sun Sep 29 13:25:08 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 20:29:02 2024 +0200 cid#1606690 Overflowed constant Change-Id: I7d3556cbaa43ba7605005059545c3d52685d33c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174202 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 56f78b66cb9a..6066a230fb0f 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -369,7 +369,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, // If FlyFrames are still around, delete these too auto& rSpzs = *GetSpzFrameFormats(); - for(sw::FrameFormats::size_type n = 0; n < GetSpzFrameFormats()->size(); ++n) + for(sw::FrameFormats::size_type n = 0; n < GetSpzFrameFormats()->size(); ) { auto pFly = rSpzs[n]; const SwFormatAnchor* pAnchor = &pFly->GetAnchor(); @@ -382,8 +382,9 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, *pAnchorNode < aEIdx.GetNode() ) { getIDocumentLayoutAccess().DelLayoutFormat( pFly ); ---n; } +else +++n; } GetNodes().Delete( aSIdx, nNodeDiff );
core.git: chart2/source sw/source
chart2/source/tools/XMLRangeHelper.cxx| 10 +- sw/source/core/unocore/XMLRangeHelper.cxx | 10 +- 2 files changed, 10 insertions(+), 10 deletions(-) New commits: commit a8cc5deeb1d5f10120a9207018808ef712844890 Author: Noel Grandin AuthorDate: Sun Sep 29 12:19:58 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 18:31:30 2024 +0200 avoid temporary OUString in lcl_getSingleCellAddressFromXMLString Change-Id: I3ec79a4ae0259babb8aa472c338cc78910abc800 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174181 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/chart2/source/tools/XMLRangeHelper.cxx b/chart2/source/tools/XMLRangeHelper.cxx index 196a0396542a..1a7e789d3098 100644 --- a/chart2/source/tools/XMLRangeHelper.cxx +++ b/chart2/source/tools/XMLRangeHelper.cxx @@ -112,15 +112,15 @@ void lcl_getSingleCellAddressFromXMLString( static const sal_Unicode aDollar( '$' ); static const sal_Unicode aLetterA( 'A' ); -OUString aCellStr = OUString(rXMLString.substr( nStartPos, nEndPos - nStartPos + 1 )).toAsciiUpperCase(); -const sal_Unicode* pStrArray = aCellStr.getStr(); -sal_Int32 nLength = aCellStr.getLength(); +std::u16string_view aCellStr = rXMLString.substr( nStartPos, nEndPos - nStartPos + 1 ); +const sal_Unicode* pStrArray = aCellStr.data(); +sal_Int32 nLength = aCellStr.size(); sal_Int32 i = nLength - 1, nColumn = 0; // parse number for row while( rtl::isAsciiDigit( pStrArray[ i ] ) && i >= 0 ) i--; -rOutCell.nRow = (o3tl::toInt32(aCellStr.subView( i + 1 ))) - 1; +rOutCell.nRow = (o3tl::toInt32(aCellStr.substr( i + 1 ))) - 1; // a dollar in XML means absolute (whereas in UI it means relative) if( pStrArray[ i ] == aDollar ) { @@ -134,7 +134,7 @@ void lcl_getSingleCellAddressFromXMLString( sal_Int32 nPower = 1; while( rtl::isAsciiAlpha( pStrArray[ i ] )) { -nColumn += (pStrArray[ i ] - aLetterA + 1) * nPower; +nColumn += (rtl::toAsciiUpperCase(pStrArray[ i ]) - aLetterA + 1) * nPower; i--; nPower *= 26; } diff --git a/sw/source/core/unocore/XMLRangeHelper.cxx b/sw/source/core/unocore/XMLRangeHelper.cxx index ad2d56bd19d5..037fe76d2dbe 100644 --- a/sw/source/core/unocore/XMLRangeHelper.cxx +++ b/sw/source/core/unocore/XMLRangeHelper.cxx @@ -110,15 +110,15 @@ void lcl_getSingleCellAddressFromXMLString( static const sal_Unicode aDollar( '$' ); static const sal_Unicode aLetterA( 'A' ); -OUString aCellStr = OUString(rXMLString.substr( nStartPos, nEndPos - nStartPos + 1 )).toAsciiUpperCase(); -const sal_Unicode* pStrArray = aCellStr.getStr(); -sal_Int32 nLength = aCellStr.getLength(); +std::u16string_view aCellStr = rXMLString.substr( nStartPos, nEndPos - nStartPos + 1 ); +const sal_Unicode* pStrArray = aCellStr.data(); +sal_Int32 nLength = aCellStr.size(); sal_Int32 i = nLength - 1, nColumn = 0; // parse number for row while( rtl::isAsciiDigit( pStrArray[ i ] ) && i >= 0 ) i--; -rOutCell.nRow = (o3tl::toInt32(aCellStr.subView( i + 1 ))) - 1; +rOutCell.nRow = (o3tl::toInt32(aCellStr.substr( i + 1 ))) - 1; // a dollar in XML means absolute (whereas in UI it means relative) if( pStrArray[ i ] == aDollar ) { @@ -133,7 +133,7 @@ void lcl_getSingleCellAddressFromXMLString( sal_Int32 nPower = 1; while( i >= 0 && rtl::isAsciiAlpha( pStrArray[ i ] )) { -nColumn += (pStrArray[ i ] - aLetterA + 1) * nPower; +nColumn += (rtl::toAsciiUpperCase(pStrArray[ i ]) - aLetterA + 1) * nPower; i--; nPower *= 26; }
core.git: sw/source
sw/source/core/unocore/XMLRangeHelper.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 9e5321f46d175e827924a8040f6325cdcd7d751f Author: Noel Grandin AuthorDate: Sun Sep 29 12:18:09 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 18:05:24 2024 +0200 cid#1606810 Overflowed constant Change-Id: I831acf42054d16d16714ff3ec46eefbfaa24047e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174180 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sw/source/core/unocore/XMLRangeHelper.cxx b/sw/source/core/unocore/XMLRangeHelper.cxx index 6464543d51ca..ad2d56bd19d5 100644 --- a/sw/source/core/unocore/XMLRangeHelper.cxx +++ b/sw/source/core/unocore/XMLRangeHelper.cxx @@ -129,8 +129,9 @@ void lcl_getSingleCellAddressFromXMLString( rOutCell.bRelativeRow = true; // parse rest for column +assert(i <= 6); sal_Int32 nPower = 1; -while( rtl::isAsciiAlpha( pStrArray[ i ] )) +while( i >= 0 && rtl::isAsciiAlpha( pStrArray[ i ] )) { nColumn += (pStrArray[ i ] - aLetterA + 1) * nPower; i--;
core.git: 2 commits - editeng/source registry/source
editeng/source/editeng/impedit2.cxx |1 + registry/source/reflwrit.cxx|2 +- 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit 68110da8242677d67a48ad04e4279f7220da2086 Author: Noel Grandin AuthorDate: Sun Sep 29 12:07:41 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 18:05:14 2024 +0200 cid#1606852 Overflowed constant Change-Id: Ib77efd3069d81a9c4b6cdb78e795def327e27368 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174179 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 5304d03463c8..318c3bbc2c55 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -62,7 +62,7 @@ sal_uInt32 readString(const sal_uInt8* buffer, sal_Unicode* v, sal_uInt32 maxSiz len = maxSize / 2; } -for (i = 0; i < (len - 1); i++) +for (i = 0; i <= len; i++) { sal_uInt16 aChar; commit c2aad1b6b7e5c7976969824bb870748d9f24 Author: Noel Grandin AuthorDate: Sun Sep 29 12:00:14 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 18:05:05 2024 +0200 cid#1606889 Overflowed constant Change-Id: I5c0b458aca0ffc1b16eba31ace4039cd359160f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174178 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 91a4456989cb..a4276e7daba9 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -790,6 +790,7 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode const * pNode, bool bIgnoreU pPortion->MarkSelectionInvalid( 0 ); sal_Int32 nPara = maEditDoc.GetPos( pNode ); +assert( nPara != EE_PARA_NOT_FOUND ); if (bIgnoreUndoCheck || mpEditEngine->IsInUndo()) mpEditEngine->ParaAttribsChanged( nPara );
core.git: 2 commits - editeng/source
editeng/source/editeng/impedit2.cxx |4 ++-- editeng/source/editeng/impedit3.cxx |6 +- 2 files changed, 7 insertions(+), 3 deletions(-) New commits: commit 0e955c4b236bcf9e66e7b49cc3ae285f1a4a9e32 Author: Noel Grandin AuthorDate: Sat Sep 28 21:21:25 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 11:57:00 2024 +0200 cid#1607049 Overflowed constant Change-Id: I9f031fa3ad7a216435c72692d92d7b566417977b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174156 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index e4392c73453a..91a4456989cb 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2490,8 +2490,8 @@ EditPaM ImpEditEngine::ImpDeleteSelection(const EditSelection& rCurSel) sal_Int32 nStartNode = maEditDoc.GetPos( aStartPaM.GetNode() ); sal_Int32 nEndNode = maEditDoc.GetPos( aEndPaM.GetNode() ); -OSL_ENSURE( nEndNode != EE_PARA_NOT_FOUND, "Start > End ?!" ); -OSL_ENSURE( nStartNode <= nEndNode, "Start > End ?!" ); +assert( nEndNode != EE_PARA_NOT_FOUND && "Start > End ?!" ); +assert( nStartNode <= nEndNode && "Start > End ?!" ); // Remove all nodes in between... for ( sal_Int32 z = nStartNode+1; z < nEndNode; z++ ) commit f213fcb8c75cde4a9ea5075ac87eea6af470bbac Author: Noel Grandin AuthorDate: Sat Sep 28 21:40:36 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 11:56:48 2024 +0200 cid#1606997 Overflowed constant Change-Id: I7973793a084c2bcd05f1ede9546094410ffc31cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174157 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 5993ab9a3ca0..eeb6d3a0a175 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -4383,7 +4383,11 @@ const ParaPortion* ImpEditEngine::GetPrevVisPortion( const ParaPortion* pCurPort const ParaPortion* ImpEditEngine::GetNextVisPortion( const ParaPortion* pCurPortion ) const { sal_Int32 nPara = GetParaPortions().GetPos( pCurPortion ); -DBG_ASSERT( nPara < GetParaPortions().Count() , "Portion not found: GetPrevVisNode" ); +if (nPara == EE_PARA_NOT_FOUND) +{ +SAL_WARN("editeng", "Portion not found: GetPrevVisNode" ); +return nullptr; +} const ParaPortion* pPortion = GetParaPortions().SafeGetObject( ++nPara ); while ( pPortion && !pPortion->IsVisible() ) pPortion = GetParaPortions().SafeGetObject( ++nPara );
core.git: include/comphelper
include/comphelper/parallelsort.hxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit b0aa70c9565f5ef4467db1711519edc9859e9fdb Author: Noel Grandin AuthorDate: Sat Sep 28 19:37:59 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 09:05:16 2024 +0200 cid#1607243 Overflowed constant Change-Id: Ia5d57d8612d8a2a8079c22e5dd739c249fa9262d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174151 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/comphelper/parallelsort.hxx b/include/comphelper/parallelsort.hxx index fd7bb83b1686..300e7ea4675a 100644 --- a/include/comphelper/parallelsort.hxx +++ b/include/comphelper/parallelsort.hxx @@ -124,12 +124,12 @@ private: constexpr size_t nMaxTreeArraySize = 64; -size_t lcl_round_down_pow2(size_t nNum) +size_t lcl_tree_array_size(size_t nNum) { size_t nPow2; for (nPow2 = 1; nPow2 <= nNum; nPow2 <<= 1) ; -return std::min((nPow2 >> 1), nMaxTreeArraySize); +return std::clamp((nPow2 >> 1), size_t(1), nMaxTreeArraySize); } template struct Sampler @@ -171,7 +171,7 @@ public: size_t maBinEnds[nMaxTreeArraySize]; Binner(const ValueType* pSamples, size_t nSamples, size_t nBins, bool bThreaded) -: mnTreeArraySize(lcl_round_down_pow2(nBins)) +: mnTreeArraySize(lcl_tree_array_size(nBins)) , mnDividers(mnTreeArraySize - 1) , mbThreaded(bThreaded) { @@ -299,7 +299,7 @@ void s3sort(const RandItr aBegin, const RandItr aEnd, Compare aComp = Compare(), using ValueType = typename std::iterator_traits::value_type; auto pOut = std::make_unique(nLen); -const size_t nBins = lcl_round_down_pow2(nThreadCount); +const size_t nBins = lcl_tree_array_size(nThreadCount); assert(nBins >= 1); const size_t nOverSamplingFactor = std::max(1.0, std::sqrt(static_cast(nLen) / 64)); const size_t nSamples = nOverSamplingFactor * nBins;
core.git: 2 commits - sc/source store/source
sc/source/core/data/fillinfo.cxx |2 +- store/source/storcach.cxx|2 +- store/source/storcach.hxx|2 +- 3 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 2009ecbeb1b6b4c771c79ea695e34e7bf4e10965 Author: Noel Grandin AuthorDate: Sat Sep 28 19:33:58 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 09:05:06 2024 +0200 cid#1607257 Overflowed constant this is a false positve, but perhaps we can help coverity work it out properly with some constexpr Change-Id: I8398153d6678585dacf4acaf7081ec32094bcda6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174150 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx index bb4e34b5af27..dc030fa1c809 100644 --- a/store/source/storcach.cxx +++ b/store/source/storcach.cxx @@ -123,7 +123,7 @@ void EntryCache::destroy (Entry * entry) } // highbit():= log2() + 1 (complexity O(1)) -static int highbit(std::size_t n) +static constexpr int highbit(std::size_t n) { int k = 1; diff --git a/store/source/storcach.hxx b/store/source/storcach.hxx index b787248349ac..ebdbd392ee18 100644 --- a/store/source/storcach.hxx +++ b/store/source/storcach.hxx @@ -39,7 +39,7 @@ struct Entry; class PageCache : public store::OStoreObject { -static size_t const theTableSize = 32; +static size_t constexpr theTableSize = 32; static_assert((theTableSize & (theTableSize-1)) == 0, "table size should be a power of 2"); Entry ** m_hash_table; commit df389675fc1e6c4f620b6769cc70c9c3b794175a Author: Noel Grandin AuthorDate: Sat Sep 28 20:12:42 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 29 09:04:52 2024 +0200 cid#1607205 Overflowed constant Change-Id: Ic70c6f866a78ee01947415fe2f4af9508490e351 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174152 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 7afa00b86543..d3739b2878ef 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -397,7 +397,7 @@ void ScDocument::FillInfo( { //TODO: check Conditionals also for HasAttrFlags::Rotate -OSL_ENSURE( nArrCount>2, "nArrCount too small" ); +assert( nArrCount>2 && "nArrCount too small" ); FindMaxRotCol( nTab, &pRowInfo[1], nArrCount-1, nCol1, nCol2 ); // FindMaxRotCol sets nRotMaxCol
core.git: sw/source
sw/source/core/layout/pagechg.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit e76c7bc413af5ca1d74acb71a5a8bb6095605a89 Author: Noel Grandin AuthorDate: Sat Sep 28 20:08:38 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 28 21:25:31 2024 +0200 Revert "cid#1607805 Overflowed constant" This reverts commit f063ea562c6ba14db15b9773bdcbb18af4a72ff8. Reason for revert: bad idea. We're not going to re-evalute the loop condition if we use a goto Change-Id: I8b892cd35c3560396f65619cd095a9b186ecbd24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174011 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 351ad146d6e0..d086166caaef 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -411,7 +411,6 @@ static void lcl_MakeObjs(const sw::FrameFormats& rSpzs, SwP // formats are in the special table of the document for(size_t i = 0; i < rSpzs.size(); ++i ) { -LOOP_START: auto pSpz = rSpzs[i]; const SwFormatAnchor &rAnch = pSpz->GetAnchor(); if ( rAnch.GetPageNum() == pPage->GetPhyPageNum() ) @@ -435,7 +434,8 @@ static void lcl_MakeObjs(const sw::FrameFormats& rSpzs, SwP { OSL_FAIL( "DrawObject not found." ); pSpz->GetDoc()->DelFrameFormat( pSpz ); -goto LOOP_START; +--i; +continue; } // The object might be anchored to another page, e.g. when inserting // a new page due to a page descriptor change. In such cases, the
core.git: sfx2/source
sfx2/source/doc/docinf.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 8535d6741ec9bd5d6105181af28f0500148d034f Author: Noel Grandin AuthorDate: Sat Sep 28 20:16:04 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 28 21:22:16 2024 +0200 cid#1607100 Overflowed constant Change-Id: I930e8661845c3c089e8d3d5b180815b1d65d4423 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174153 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx index 4e8e3663707f..8a4558760ed2 100644 --- a/sfx2/source/doc/docinf.cxx +++ b/sfx2/source/doc/docinf.cxx @@ -116,6 +116,7 @@ ErrCode LoadOlePropertySet( && aDateTime.Day == 0 && aDateTime.Month == 0 && aDateTime.Year == 0) ) { +assert(aDateTime.Day <= 31); // subtract offset 1601-01-01 aDateTime.Year -= 1601; aDateTime.Month -= 1;
core.git: sd/source
sd/source/ui/view/outlview.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 4ff5a7b810d293e3d9d457049145ef5c3b1d95d0 Author: Noel Grandin AuthorDate: Sat Sep 28 15:16:19 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 28 20:09:48 2024 +0200 cid#1607680 Overflowed constant Change-Id: I8522cfe5422c187b9045858c2f94753d0f2c8714 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174123 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 07c55d7c3ee7..33d8f78ba3c5 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1176,7 +1176,9 @@ Paragraph* OutlineView::GetParagraphForPage( ::Outliner const & rOutl, SdPage co { // get the number of paragraphs with ident 0 we need to skip before // we find the actual page -sal_uInt32 nPagesToSkip = (pPage->GetPageNum() - 1) >> 1; +sal_uInt16 nPageNum = pPage->GetPageNum(); +assert(nPageNum > 0); +sal_uInt32 nPagesToSkip = (nPageNum - 1) >> 1; sal_Int32 nParaPos = 0; Paragraph* pPara = rOutl.GetParagraph( 0 );
core.git: 2 commits - sw/source xmlhelp/source
sw/source/core/doc/DocumentContentOperationsManager.cxx |6 -- xmlhelp/source/cxxhelp/provider/databases.cxx |2 +- 2 files changed, 5 insertions(+), 3 deletions(-) New commits: commit 2596131a1fcb40cd134200035049c23113d3e141 Author: Noel Grandin AuthorDate: Sat Sep 28 15:11:10 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 28 20:09:32 2024 +0200 cid#1607687 Overflowed constant This code does not appear to be handling the case where there is no anchor correctly, all the way back to commit c5718b941491ffaa937767c579627444c0957b86 Author: Andreas Bille Date: Wed Oct 31 12:08:14 2001 + #83054# Now reading the necessary variables( provider.cxx ), Change-Id: Ia8f514a95ca2e3ae17129b34f0ed444cd9d0ade8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174122 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 86d521f11d89..6119d8373f92 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -592,7 +592,7 @@ void KeywordInfo::KeywordElement::init( Databases const *pDatabases,helpdatafile if( idx == std::u16string_view::npos ) break; size_t h = ids.find( '#', k ); -if( h == std::u16string_view::npos || h < idx ) +if( h != std::u16string_view::npos && h < idx ) { // found an anchor id.push_back( OUString(ids.substr( k, h-k )) ); commit 2264538ec245839651de4e34cec45958460c4021 Author: Noel Grandin AuthorDate: Sat Sep 28 14:59:14 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 28 20:09:18 2024 +0200 cid#1607691 Overflowed constant Change-Id: Ib3f32065334769298483d4cf9131040ab28a3a1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174121 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 0f24abd95bc3..79ad75ea2007 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -828,7 +828,7 @@ namespace // iterate over relevant redlines and decide for each whether it should // be saved, or split + saved SwRedlineTable& rRedlineTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable(); -for( ; nCurrentRedline < rRedlineTable.size(); nCurrentRedline++ ) +for( ; nCurrentRedline < rRedlineTable.size(); ) { SwRangeRedline* pCurrent = rRedlineTable[ nCurrentRedline ]; SwComparePosition eCompare = @@ -843,7 +843,7 @@ namespace eCompare == SwComparePosition::Inside || eCompare == SwComparePosition::Equal ) { -rRedlineTable.Remove( nCurrentRedline-- ); +rRedlineTable.Remove( nCurrentRedline ); // split beginning, if necessary if( eCompare == SwComparePosition::OverlapBefore || @@ -868,6 +868,8 @@ namespace // save the current redline rArr.emplace_back( pCurrent, *pStart ); } +else +nCurrentRedline++; } // restore old redline mode
core.git: vcl/source
vcl/source/filter/imet/ios2met.cxx | 38 - 1 file changed, 17 insertions(+), 21 deletions(-) New commits: commit 980f28fce8ccf317ee099179b07e68a50119dc6e Author: Noel Grandin AuthorDate: Sat Sep 28 14:53:46 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 28 20:08:57 2024 +0200 cid#1607692 Overflowed constant use less convoluted logic here Change-Id: I786d7f857c7104358559782247c4272914299314 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174112 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/vcl/source/filter/imet/ios2met.cxx b/vcl/source/filter/imet/ios2met.cxx index 3b6077a648a3..0a16c07f5671 100644 --- a/vcl/source/filter/imet/ios2met.cxx +++ b/vcl/source/filter/imet/ios2met.cxx @@ -748,31 +748,27 @@ void OS2METReader::SetPen( const Color& rColor, sal_uInt16 nLineWidth, PenStyle pVirDev->SetLineColor( rColor ); aLineInfo.SetWidth( nLineWidth ); -sal_uInt16 nDotCount = 0; -sal_uInt16 nDashCount = 0; -switch ( ePenStyle ) +if (ePenStyle == PEN_NULL) +eLineStyle = LineStyle::NONE; +else if (ePenStyle == PEN_DASHDOT || ePenStyle == PEN_DOT || ePenStyle == PEN_DASH) { -case PEN_NULL : -eLineStyle = LineStyle::NONE; -break; -case PEN_DASHDOT : +sal_uInt16 nDotCount = 0; +sal_uInt16 nDashCount = 0; +if (ePenStyle == PEN_DASHDOT) +{ nDashCount++; -[[fallthrough]]; -case PEN_DOT : nDotCount++; -nDashCount--; -[[fallthrough]]; -case PEN_DASH : +} +else if (ePenStyle == PEN_DOT) +nDotCount++; +else // (ePenStyle == PEN_DASH) nDashCount++; -aLineInfo.SetDotCount( nDotCount ); -aLineInfo.SetDashCount( nDashCount ); -aLineInfo.SetDistance( nLineWidth ); -aLineInfo.SetDotLen( nLineWidth ); -aLineInfo.SetDashLen( nLineWidth << 2 ); -eLineStyle = LineStyle::Dash; -break; -case PEN_SOLID: -break; // -Wall not handled... +aLineInfo.SetDotCount( nDotCount ); +aLineInfo.SetDashCount( nDashCount ); +aLineInfo.SetDistance( nLineWidth ); +aLineInfo.SetDotLen( nLineWidth ); +aLineInfo.SetDashLen( nLineWidth << 2 ); +eLineStyle = LineStyle::Dash; } aLineInfo.SetStyle( eLineStyle ); }
core.git: sc/source
sc/source/core/tool/chartpos.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit aea48c1eb8f42ba620008a1b2119f80dbbb9c4ba Author: Noel Grandin AuthorDate: Sat Sep 28 14:41:33 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 28 18:08:41 2024 +0200 cid#1607751 Overflowed constant help out coverity by asserting what should be true here Change-Id: I1c98c29cccf0fd40eb6cc19699428872a5bf56a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174111 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx index 780b8f4ac982..51736ecd23a3 100644 --- a/sc/source/core/tool/chartpos.cxx +++ b/sc/source/core/tool/chartpos.cxx @@ -142,6 +142,7 @@ void ScChartPositioner::GlueState() if ( i < nRanges ) pR = &(*aRangeListRef)[i]; } +assert(nEndCol >= nStartCol); SCCOL nC = nEndCol - nStartCol + 1; if ( nC == 1 ) {
core.git: 2 commits - dbaccess/source sw/source
dbaccess/source/filter/hsqldb/utils.cxx |3 ++- sw/source/core/layout/pagechg.cxx |4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit c2306ddbac82e643cf05773ce39fe09195937af6 Author: Noel Grandin AuthorDate: Sat Sep 28 14:24:50 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 28 18:08:33 2024 +0200 cid#1607790 Overflowed constant Change-Id: Ia2b180d6a93f139a0f83653ee45b4ad929ccef45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174110 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/dbaccess/source/filter/hsqldb/utils.cxx b/dbaccess/source/filter/hsqldb/utils.cxx index d8addd33623e..4ed05ae5075a 100644 --- a/dbaccess/source/filter/hsqldb/utils.cxx +++ b/dbaccess/source/filter/hsqldb/utils.cxx @@ -90,7 +90,7 @@ OUString utils::convertToUTF8(std::string_view original) OUString utils::getTableNameFromStmt(std::u16string_view sSql) { -auto stmtComponents = comphelper::string::split(sSql, sal_Unicode(u' ')); +std::vector stmtComponents = comphelper::string::split(sSql, sal_Unicode(u' ')); assert(stmtComponents.size() > 2); auto wordIter = stmtComponents.begin(); @@ -105,6 +105,7 @@ OUString utils::getTableNameFromStmt(std::u16string_view sSql) if (wordIter->indexOf("\"") >= 0) { size_t nAposBegin = sSql.find('"'); +assert(nAposBegin != std::u16string_view::npos); // make coverity happy size_t nAposEnd = nAposBegin; bool bProperEndAposFound = false; while (!bProperEndAposFound) commit f063ea562c6ba14db15b9773bdcbb18af4a72ff8 Author: Noel Grandin AuthorDate: Sat Sep 28 14:19:23 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 28 18:08:25 2024 +0200 cid#1607805 Overflowed constant Change-Id: Id146853a86a54597a1e07efba6c86abc10d93796 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174109 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index d086166caaef..351ad146d6e0 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -411,6 +411,7 @@ static void lcl_MakeObjs(const sw::FrameFormats& rSpzs, SwP // formats are in the special table of the document for(size_t i = 0; i < rSpzs.size(); ++i ) { +LOOP_START: auto pSpz = rSpzs[i]; const SwFormatAnchor &rAnch = pSpz->GetAnchor(); if ( rAnch.GetPageNum() == pPage->GetPhyPageNum() ) @@ -434,8 +435,7 @@ static void lcl_MakeObjs(const sw::FrameFormats& rSpzs, SwP { OSL_FAIL( "DrawObject not found." ); pSpz->GetDoc()->DelFrameFormat( pSpz ); ---i; -continue; +goto LOOP_START; } // The object might be anchored to another page, e.g. when inserting // a new page due to a page descriptor change. In such cases, the
Re: Missing Patches on LibreOffice master
Hi On Wed, 25 Sept 2024 at 20:28, Andreas Mantke wrote: > > > it's the duty of every member of TDF to support the foundation, its > purposes, goals and its community (including the source code etc. the > community is working on) in the first place and to put private (etc.) > interests aside (if you like it or not). > > Rubbish. There is no commitment, implied or explicit, for people to put aside their other interests in favour of TDF. There is also no commitment for people to do work for other people in the foundation. In this specific situation, you even seem to think that other people are required to meet your requests within some time bound. That is not how this works. You are free to ask, but as volunteers, we are under no obligation to assist. If you need a set of patches in a git branch, it is extremely easy for you to maintain your own branch of master, either as a personal branch on gerrit, or on your own git server. -- Noel Grandin.
core.git: vcl/source
vcl/source/gdi/print.cxx |5 - 1 file changed, 5 deletions(-) New commits: commit 747e2676ec0681c6cd8789ab9218b437e17474b5 Author: Noel Grandin AuthorDate: Wed Sep 25 14:29:30 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 25 22:12:40 2024 +0200 fix Printer::EmulateDrawTransparent after commit 9153a36b59f2efc2bfb2c9256c39eb5687808deb Author: Chris Sherlock Date: Fri Mar 28 23:30:02 2014 +1100 fdo#74702 Refactor OutputDevice::DrawTransparent() where it looks like a copy/paste error resulted in the metafile and mpAlphaVDev being restored too early. Change-Id: Ib2989927166bc2da7c8da6274f295a73218386fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173935 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 399f0286b6ca..ce3e3786a450 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -221,11 +221,6 @@ void Printer::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, GDIMetaFile* pOldMetaFile = mpMetaFile; mpMetaFile = nullptr; -mpMetaFile = pOldMetaFile; - -// #110958# Restore disabled alpha VDev -mpAlphaVDev = pOldAlphaVDev; - tools::Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() ); const Size aDPISize( LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch)) ); const tools::Long nBaseExtent = std::max( basegfx::fround( aDPISize.Width() / 300. ), 1 );
core.git: solenv/gdb
solenv/gdb/libreoffice/basegfx.py |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit f513741bdc91f1871bdb8b01b21058e208a96eb0 Author: Noel Grandin AuthorDate: Wed Sep 25 17:09:58 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 25 22:10:17 2024 +0200 fix basegfx.py after commit 3c82f49fcee3f1e4ddae8919993dde57e8bbab2d Author: Armin Le Grand (allotropia) Date: Mon Sep 23 17:57:00 2024 +0200 Adapting basegfx.py due to blocking in some situations Change-Id: Ie266c7b5aeb5dccaae03c26b7cd73cd65841748c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173949 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/solenv/gdb/libreoffice/basegfx.py b/solenv/gdb/libreoffice/basegfx.py index 9e5fa4c88d00..b2e4db94536c 100644 --- a/solenv/gdb/libreoffice/basegfx.py +++ b/solenv/gdb/libreoffice/basegfx.py @@ -60,7 +60,7 @@ class B2DPolygonPrinter(object): def _count(self): # It's a call into the inferior (being debugged) process. # Will not work with core dumps and can cause a deadlock. -if self.exists() +if self.exists(): return int(gdb.parse_and_eval( "(('basegfx::B2DPolygon' *) {})->count()".format(self.value.address))) @@ -70,7 +70,7 @@ class B2DPolygonPrinter(object): def _hasCurves(self): # It's a call into the inferior (being debugged) process. # Will not work with core dumps and can cause a deadlock. -if self.exists() +if self.exists(): return int(gdb.parse_and_eval( "(('basegfx::B2DPolygon' *) {})->areControlPointsUsed()".format(self.value.address))) != 0 @@ -153,14 +153,14 @@ class B2DPolyPolygonPrinter(object): def _count(self): # It's a call into the inferior (being debugged) process. # Will not work with core dumps and can cause a deadlock. -if self.exists() +if self.exists(): return int(gdb.parse_and_eval( "(('basegfx::B2DPolyPolygon' *) {})->count()".format(self.value.address))) def _isClosed(self): # It's a call into the inferior (being debugged) process. # Will not work with core dumps and can cause a deadlock. -if self.exists() +if self.exists(): return int(gdb.parse_and_eval( "(('basegfx::B2DPolyPolygon' *) {})->isClosed()".format(self.value.address))) != 0
core.git: 2 commits - sw/inc sw/source
sw/inc/doc.hxx |6 ++ sw/source/core/bastyp/init.cxx |4 ++-- sw/source/core/doc/doc.cxx | 36 sw/source/filter/ww8/rtfexport.cxx | 20 4 files changed, 52 insertions(+), 14 deletions(-) New commits: commit c2f32dbd8a64bb986b01aed746e7448fadb8cbe0 Author: Noel Grandin AuthorDate: Tue Sep 24 15:31:16 2024 +0200 Commit: Noel Grandin CommitDate: Tue Sep 24 17:01:57 2024 +0200 dont use GetItemSurrogates for gathering SvxShadowItem which is very expensive these days Change-Id: I93833d703407304e8ed20be0783e0562352b927a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173867 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index abc125138b71..a90f82fcd720 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1471,6 +1471,9 @@ public: /// Iterate over all RES_BOX SvxBoxItem, if the function returns false, iteration is stopped SW_DLLPUBLIC void ForEachBoxItem(const std::function& ) const; +/// Iterate over all RES_SHADOW SvxShadowItem, if the function returns false, iteration is stopped +SW_DLLPUBLIC void ForEachShadowItem(const std::function& ) const; + // Call into intransparent Basic; expect possible Return String. void ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ); diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 814f4b23bcb8..3bbfd40268a1 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -409,7 +409,7 @@ ItemInfoPackage& getItemInfoPackageSwAttributes() { RES_ANCHOR, new SwFormatAnchor, 0, SFX_ITEMINFOFLAG_NONE }, { RES_BACKGROUND, new SvxBrushItem( RES_BACKGROUND ), SID_ATTR_BRUSH, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE }, { RES_BOX, new SvxBoxItem( RES_BOX ), SID_ATTR_BORDER_OUTER, SFX_ITEMINFOFLAG_NONE }, -{ RES_SHADOW, new SvxShadowItem( RES_SHADOW ), SID_ATTR_BORDER_SHADOW, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE }, +{ RES_SHADOW, new SvxShadowItem( RES_SHADOW ), SID_ATTR_BORDER_SHADOW, SFX_ITEMINFOFLAG_NONE }, { RES_FRMMACRO, new SvxMacroItem( RES_FRMMACRO ), SID_ATTR_MACROITEM, SFX_ITEMINFOFLAG_NONE }, { RES_COL, new SwFormatCol, FN_ATTR_COLUMNS, SFX_ITEMINFOFLAG_NONE }, { RES_KEEP, new SvxFormatKeepItem( false, RES_KEEP ), SID_ATTR_PARA_KEEP, SFX_ITEMINFOFLAG_NONE }, diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index db1762009ef4..fe9a5be66c00 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1621,6 +1621,24 @@ void SwDoc::ForEachBoxItem(const std::function& rFunc ) } } +/// Iterate over all RES_SHADOW SvxBoxItem, if the function returns false, iteration is stopped +void SwDoc::ForEachShadowItem(const std::function& rFunc ) const +{ +SwNodeOffset nCount = GetNodes().Count(); +for (SwNodeOffset i(0); i < nCount; ++i) +{ +const SwNode* pNode = GetNodes()[i]; +if (pNode->IsContentNode()) +{ +const SwContentNode* pTextNode = pNode->GetContentNode(); +if (pTextNode->HasSwAttrSet()) +if (const SvxShadowItem* pItem = pTextNode->GetSwAttrSet().GetItemIfSet(RES_SHADOW)) +if (!rFunc(*pItem)) +return; +} +} +} + void SwDoc::Summary(SwDoc& rExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress) { const SwOutlineNodes& rOutNds = GetNodes().GetOutLineNds(); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 5ff491f53e8b..0ce35c6f9c29 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -1388,12 +1388,10 @@ void RtfExport::OutColorTable() { InsColor(pShadow->GetColor()); } -rPool.GetItemSurrogates(aSurrogates, RES_SHADOW); -for (const SfxPoolItem* pItem : aSurrogates) -{ -pShadow = &static_cast(*pItem); -InsColor(pShadow->GetColor()); -} +m_rDoc.ForEachShadowItem([this](const SvxShadowItem& rShadow) -> bool { +InsColor(rShadow.GetColor()); +return true; +}); } // frame border color commit a8161a4aea3fc7e2f24435c30befdf82421653e6 Author: Noel Grandin AuthorDate: Mon Sep 23 21:35:06 2024 +0200 Commit: Noel Grandin CommitDate: Tue Sep 24 17:01:48 2024 +0200 dont use GetItemSurrogates for gathering SvxBoxItem which is very expensive these days Change-Id: I0cb9af2afcbdb802e6a783df6cd30f5905e1ff1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173854 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 776120717e73..abc12513
core.git: sw/inc sw/source
sw/inc/doc.hxx |2 +- sw/source/core/doc/doc.cxx | 19 --- 2 files changed, 17 insertions(+), 4 deletions(-) New commits: commit a32c551d75fadfdfcbf4299320b88264123d6805 Author: Noel Grandin AuthorDate: Sat Sep 21 16:15:40 2024 +0200 Commit: Noel Grandin CommitDate: Tue Sep 24 16:52:26 2024 +0200 fixes for "dont use GetItemSurrogates for gathering SvxTabStopItem" improvements to commit 01ab23b13297c9d7b091dfbe2850cd343fcd3e0e, thanks to vmiklos for review Change-Id: I2d4c5fb07405988b56156370db2e73ba0a24fa36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173763 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 6e037f3878c9..776120717e73 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1463,7 +1463,7 @@ public: SW_DLLPUBLIC void ForEachTxtAtrContainerItem(const std::function& ) const; /// Iterate over all RES_PARATR_TABSTOP SvxTabStopItem, if the function returns false, iteration is stopped -SW_DLLPUBLIC void ForEachParaAtrTabStopItem(const std::function& ) const; +SW_DLLPUBLIC void ForEachParaAtrTabStopItem(const std::function& ); /// Iterate over all RES_UNKNOWNATR_CONTAINER SvXMLAttrContainerItem, if the function returns false, iteration is stopped SW_DLLPUBLIC void ForEachUnknownAtrContainerItem(const std::function& ) const; diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index f9ab83b6522f..2724ccb0fb7c 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1566,10 +1566,23 @@ void SwDoc::ForEachCharacterFontItem(TypedWhichId nWhich, bool bIgn } } -/// Iterate over all RES_PARATR_TABSTOP SvXMLAttrContainerItem, if the function returns false, iteration is stopped -void SwDoc::ForEachParaAtrTabStopItem(const std::function& rFunc ) const +/// Iterate over all RES_PARATR_TABSTOP SvxTabStopItem, if the function returns false, iteration is stopped +void SwDoc::ForEachParaAtrTabStopItem(const std::function& rFunc ) { -for(SwCharFormat* pFormat : *GetCharFormats()) +SwNodeOffset nCount = GetNodes().Count(); +for (SwNodeOffset i(0); i < nCount; ++i) +{ +const SwNode* pNode = GetNodes()[i]; +if (pNode->IsContentNode()) +{ +const SwContentNode* pTextNode = pNode->GetContentNode(); +if (pTextNode->HasSwAttrSet()) +if (const SvxTabStopItem* pItem = pTextNode->GetSwAttrSet().GetItemIfSet(RES_PARATR_TABSTOP)) +if (!rFunc(*pItem)) +return; +} +} +for(const SwTextFormatColl* pFormat : *GetTextFormatColls()) { const SwAttrSet& rAttrSet = pFormat->GetAttrSet(); if (const SvxTabStopItem* pItem = rAttrSet.GetItemIfSet(RES_PARATR_TABSTOP))
core.git: dbaccess/source
dbaccess/source/core/dataaccess/documenteventexecutor.cxx | 19 +- dbaccess/source/core/dataaccess/documenteventexecutor.hxx |8 +++-- 2 files changed, 13 insertions(+), 14 deletions(-) New commits: commit fff43a2e76dd6e6892a9c447edf60a44ba1a345e Author: Noel Grandin AuthorDate: Fri Sep 20 15:30:38 2024 +0200 Commit: Noel Grandin CommitDate: Tue Sep 24 12:13:47 2024 +0200 use more concrete UNO types in dbaccess Change-Id: Ibcf54e3bbdad4888c5da1f52f636951356e0aa51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173818 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx index dca584d5b054..aebaf385e64b 100644 --- a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx +++ b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx @@ -18,6 +18,7 @@ */ #include "documenteventexecutor.hxx" +#include "databasedocument.hxx" #include #include @@ -60,11 +61,11 @@ namespace dbaccess namespace { void lcl_dispatchScriptURL_throw( -css::uno::WeakReference< css::document::XEventsSupplier > const & xWeakDocument, +::unotools::WeakReference< ODatabaseDocument > const & xWeakDocument, css::uno::Reference< css::util::XURLTransformer > const & xURLTransformer, const OUString& _rScriptURL, const DocumentEvent& _rTrigger ) { -Reference< XModel > xDocument( xWeakDocument.get(), UNO_QUERY_THROW ); +rtl::Reference< ODatabaseDocument > xDocument( xWeakDocument.get() ); Reference< XController > xController( xDocument->getCurrentController() ); Reference< XDispatchProvider > xDispProv; @@ -102,14 +103,12 @@ namespace dbaccess // DocumentEventExecutor DocumentEventExecutor::DocumentEventExecutor( const Reference & _rContext, -const Reference< XEventsSupplier >& _rxDocument ) +const rtl::Reference< ODatabaseDocument >& _rxDocument ) :mxDocument( _rxDocument ) { -Reference< XDocumentEventBroadcaster > xBroadcaster( _rxDocument, UNO_QUERY_THROW ); - osl_atomic_increment( &m_refCount ); { -xBroadcaster->addDocumentEventListener( this ); +_rxDocument->addDocumentEventListener( this ); } osl_atomic_decrement( &m_refCount ); @@ -129,18 +128,16 @@ namespace dbaccess void SAL_CALL DocumentEventExecutor::documentEventOccured( const DocumentEvent& Event ) { -Reference< XEventsSupplier > xEventsSupplier( mxDocument.get(), UNO_QUERY ); -if ( !xEventsSupplier ) +rtl::Reference< ODatabaseDocument > xDocument( mxDocument.get() ); +if ( !xDocument ) { OSL_FAIL( "DocumentEventExecutor::documentEventOccurred: no document anymore, but still being notified?" ); return; } -Reference< XModel > xDocument( xEventsSupplier, UNO_QUERY_THROW ); - try { -Reference< XNameAccess > xDocEvents( xEventsSupplier->getEvents(), UNO_SET_THROW ); +Reference< XNameAccess > xDocEvents( xDocument->getEvents(), UNO_SET_THROW ); if ( !xDocEvents->hasByName( Event.EventName ) ) { // this is worth an assertion: We are listener at the very same document which we just asked diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.hxx b/dbaccess/source/core/dataaccess/documenteventexecutor.hxx index 58aee4bcd590..e012846c83e9 100644 --- a/dbaccess/source/core/dataaccess/documenteventexecutor.hxx +++ b/dbaccess/source/core/dataaccess/documenteventexecutor.hxx @@ -23,13 +23,15 @@ #include #include -#include +#include namespace com::sun::star::uno { class XComponentContext; } namespace com::sun::star::util { class XURLTransformer; } namespace dbaccess { +class ODatabaseDocument; + // DocumentEventExecutor typedef ::cppu::WeakImplHelper < css::document::XDocumentEventListener > DocumentEventExecutor_Base; @@ -38,7 +40,7 @@ namespace dbaccess public: DocumentEventExecutor( const css::uno::Reference< css::uno::XComponentContext >& _rContext, -const css::uno::Reference< css::document::XEventsSupplier >& _rxDocument ); +const rtl::Reference< ODatabaseDocument >& _rxDocument ); protected: virtual ~DocumentEventExecutor() override; @@ -49,7 +51,7 @@ namespace dbaccess virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; private: -css::uno::WeakReference< css::document::XEventsSupplier > mxDocument; +unotools::WeakReference< ODatabaseDocument > mxDocument; css::uno::Reference< css::util::XURLTransformer > mxURLTransformer; };
core.git: include/rtl oox/source sd/source
include/rtl/string.hxx| 12 include/rtl/ustring.hxx | 12 oox/source/ppt/pptfilterhelpers.cxx |2 ++ sd/source/filter/eppt/pptexanimations.cxx |2 ++ 4 files changed, 28 insertions(+) New commits: commit 59915ec9211b90e5b7be164d0bfa26d9d9be4f5a Author: Noel Grandin AuthorDate: Mon Sep 23 09:17:58 2024 +0200 Commit: Noel Grandin CommitDate: Tue Sep 24 12:09:41 2024 +0200 in OUString find functions, assert that fromIndex >= 0 otherwise, the pointer calculations mean that we will start searching inside data that does not belong to the character array. which flushes out a couple of problem cases Change-Id: Ide9edf23900289343077c406d95614057c1d1a6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173807 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index b98e9e01f674..43a31e92303a 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -940,12 +940,14 @@ public: #if defined LIBO_INTERNAL_ONLY bool match( std::string_view str, sal_Int32 fromIndex = 0 ) const { +assert(fromIndex >= 0); return rtl_str_shortenedCompare_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, str.data(), str.size(), str.size() ) == 0; } #else bool match( const OString & str, sal_Int32 fromIndex = 0 ) const { +assert(fromIndex >= 0); return rtl_str_shortenedCompare_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, str.pData->buffer, str.pData->length, str.pData->length ) == 0; } @@ -962,6 +964,7 @@ public: RTL_STRING_CONST_FUNCTION assert( libreoffice_internal::ConstCharArrayDetector::isValid(literal)); +assert(fromIndex >= 0); return rtl_str_shortenedCompare_WithLength( pData->buffer + fromIndex, pData->length - fromIndex, @@ -992,6 +995,7 @@ public: char const * str, sal_Int32 strLength, sal_Int32 fromIndex = 0) const { +assert(fromIndex >= 0); return rtl_str_shortenedCompare_WithLength( pData->buffer + fromIndex, pData->length - fromIndex, str, strLength, strLength) == 0; @@ -1026,6 +1030,7 @@ public: #if defined LIBO_INTERNAL_ONLY bool matchIgnoreAsciiCase( std::string_view str, sal_Int32 fromIndex = 0 ) const { +assert(fromIndex >= 0); return rtl_str_shortenedCompareIgnoreAsciiCase_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, str.data(), str.size(), str.size() ) == 0; @@ -1033,6 +1038,7 @@ public: #else bool matchIgnoreAsciiCase( const OString & str, sal_Int32 fromIndex = 0 ) const { +assert(fromIndex >= 0); return rtl_str_shortenedCompareIgnoreAsciiCase_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, str.pData->buffer, str.pData->length, str.pData->length ) == 0; @@ -1049,6 +1055,7 @@ public: RTL_STRING_CONST_FUNCTION assert( libreoffice_internal::ConstCharArrayDetector::isValid(literal)); +assert(fromIndex >= 0); return rtl_str_shortenedCompareIgnoreAsciiCase_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, @@ -1747,6 +1754,7 @@ public: */ sal_Int32 indexOf( char ch, sal_Int32 fromIndex = 0 ) const { +assert(fromIndex >= 0); sal_Int32 ret = rtl_str_indexOfChar_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, ch ); return (ret < 0 ? ret : ret+fromIndex); } @@ -1800,6 +1808,7 @@ public: #if defined LIBO_INTERNAL_ONLY sal_Int32 indexOf( std::string_view str, sal_Int32 fromIndex = 0 ) const { +assert(fromIndex >= 0); sal_Int32 ret = rtl_str_indexOfStr_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, str.data(), str.size() ); return (ret < 0 ? ret : ret+fromIndex); @@ -1807,6 +1816,7 @@ public: #else sal_Int32 indexOf( const OString & str, sal_Int32 fromIndex = 0 ) const { +assert(fromIndex >= 0); sal_Int32 ret = rtl_str_indexOfStr_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, str.pData->buffer, str.pData->leng
core.git: dbaccess/source
dbaccess/source/core/dataaccess/ModelImpl.cxx | 32 ++--- dbaccess/source/core/dataaccess/databasecontext.cxx| 12 ++ dbaccess/source/core/dataaccess/databasedocument.cxx |4 +- dbaccess/source/core/dataaccess/documentdefinition.cxx |9 ++-- dbaccess/source/core/inc/ModelImpl.hxx |7 ++- 5 files changed, 35 insertions(+), 29 deletions(-) New commits: commit 5ceff2c65cc2ae80a11a1787400ca22dea9c3500 Author: Noel Grandin AuthorDate: Fri Sep 20 15:23:50 2024 +0200 Commit: Noel Grandin CommitDate: Tue Sep 24 08:18:18 2024 +0200 use more concrete UNO types in dbaccess Change-Id: If34294e2db4dc3365a7308c90658d5fa0c0e6532 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173817 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 7c566fc8286d..49503a9d7b56 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -631,15 +631,19 @@ void ODatabaseModelImpl::dispose() m_xDataSource.clear(); } -Reference< XModel > xModel( m_xModel ); -::comphelper::disposeComponent( xModel ); +rtl::Reference< ODatabaseDocument > xModel( m_xModel ); +if (xModel) +{ +xModel->dispose(); +m_xModel.clear(); +} } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION("dbaccess"); } m_xDataSource.clear(); -m_xModel = WeakReference< XModel >(); +m_xModel.clear(); for (auto const& elem : m_aContainer) { @@ -932,7 +936,7 @@ void ODatabaseModelImpl::setModified( bool _bModified ) try { -Reference< XModifiable > xModi( m_xModel.get(), UNO_QUERY ); +rtl::Reference< ODatabaseDocument > xModi( m_xModel ); if ( xModi.is() ) xModi->setModified( _bModified ); else @@ -955,26 +959,26 @@ Reference ODatabaseModelImpl::getOrCreateDataSource() return xDs; } -Reference< XModel> ODatabaseModelImpl::getModel_noCreate() const +rtl::Reference ODatabaseModelImpl::getModel_noCreate() const { -return m_xModel; +return m_xModel.get(); } -Reference< XModel > ODatabaseModelImpl::createNewModel_deliverOwnership() +rtl::Reference< ODatabaseDocument > ODatabaseModelImpl::createNewModel_deliverOwnership() { -Reference< XModel > xModel( m_xModel ); +rtl::Reference< ODatabaseDocument > xModel( m_xModel ); OSL_PRECOND( !xModel.is(), "ODatabaseModelImpl::createNewModel_deliverOwnership: not to be called if there already is a model!" ); if ( !xModel.is() ) { bool bHadModelBefore = m_bDocumentInitialized; xModel = ODatabaseDocument::createDatabaseDocument( this, ODatabaseDocument::FactoryAccess() ); -m_xModel = xModel; +m_xModel = xModel.get(); try { Reference< XGlobalEventBroadcaster > xModelCollection = theGlobalEventBroadcaster::get( m_aContext ); -xModelCollection->insert( Any( xModel ) ); +xModelCollection->insert( Any( Reference< XModel >(xModel) ) ); } catch( const Exception& ) { @@ -1134,7 +1138,9 @@ Reference< XStorageBasedLibraryContainer > ODatabaseModelImpl::getLibraryContain if ( rxContainer.is() ) return rxContainer; -Reference< XStorageBasedDocument > xDocument( getModel_noCreate(), UNO_QUERY_THROW ); +rtl::Reference< ODatabaseDocument > xDocument( getModel_noCreate() ); +if (!xDocument) +throw uno::RuntimeException(); // this is only to be called if there already exists a document model - in fact, it is // to be called by the document model only @@ -1156,7 +1162,7 @@ Reference< XStorageBasedLibraryContainer > ODatabaseModelImpl::getLibraryContain { throw WrappedTargetRuntimeException( OUString(), -xDocument, +cppu::getXWeak(xDocument.get()), ::cppu::getCaughtException() ); } @@ -1347,7 +1353,7 @@ bool ODatabaseModelImpl::macroCallsSeenWhileLoading() const Reference< XEmbeddedScripts > ODatabaseModelImpl::getEmbeddedDocumentScripts() const { -return Reference< XEmbeddedScripts >( getModel_noCreate(), UNO_QUERY ); +return getModel_noCreate(); } SignatureState ODatabaseModelImpl::getScriptingSignatureState() diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index a63ca5af6031..fc5dc5f0907e 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -25,6 +25,7 @@ #include #include
core.git: 2 commits - connectivity/source dbaccess/source
connectivity/source/drivers/evoab2/NStatement.cxx|4 ++-- connectivity/source/drivers/evoab2/NStatement.hxx|5 - dbaccess/source/core/dataaccess/ModelImpl.cxx| 14 +- dbaccess/source/core/dataaccess/databasedocument.cxx | 15 ++- dbaccess/source/core/dataaccess/databasedocument.hxx |3 +++ dbaccess/source/core/dataaccess/datasource.cxx |4 ++-- dbaccess/source/core/inc/ModelImpl.hxx |6 -- 7 files changed, 38 insertions(+), 13 deletions(-) New commits: commit 87039e3e772c7b36480e70019dea0faa15feef6b Author: Noel Grandin AuthorDate: Fri Sep 20 15:10:22 2024 +0200 Commit: Noel Grandin CommitDate: Mon Sep 23 18:32:24 2024 +0200 use more concrete UNO types in dbaccess Change-Id: I3f689e6ec296fe0c8876ba5cc68133f28902b3fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173816 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 78f1693ebc97..7c566fc8286d 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -624,8 +624,12 @@ void ODatabaseModelImpl::dispose() // dispose the data source and the model try { -Reference< XDataSource > xDS( m_xDataSource ); -::comphelper::disposeComponent( xDS ); +rtl::Reference< ODatabaseSource > xDS( m_xDataSource ); +if (xDS) +{ +xDS->dispose(); +m_xDataSource.clear(); +} Reference< XModel > xModel( m_xModel ); ::comphelper::disposeComponent( xModel ); @@ -634,7 +638,7 @@ void ODatabaseModelImpl::dispose() { DBG_UNHANDLED_EXCEPTION("dbaccess"); } -m_xDataSource = WeakReference(); +m_xDataSource.clear(); m_xModel = WeakReference< XModel >(); for (auto const& elem : m_aContainer) @@ -942,11 +946,11 @@ void ODatabaseModelImpl::setModified( bool _bModified ) Reference ODatabaseModelImpl::getOrCreateDataSource() { -Reference xDs = m_xDataSource; +rtl::Reference xDs = m_xDataSource; if ( !xDs.is() ) { xDs = new ODatabaseSource(this); -m_xDataSource = xDs; +m_xDataSource = xDs.get(); } return xDs; } diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 9ece0a1493b4..8ab876fef99b 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -23,6 +23,7 @@ #include "documenteventexecutor.hxx" #include #include "documentcontainer.hxx" +#include "commandcontainer.hxx" #include #include #include @@ -149,7 +150,8 @@ ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference& { impl_reparent_nothrow( m_xForms ); impl_reparent_nothrow( m_xReports ); -impl_reparent_nothrow( m_pImpl->m_xTableDefinitions ); +if (auto xTableDef = m_pImpl->m_xTableDefinitions.get()) +xTableDef->setParent(*this); impl_reparent_nothrow( m_pImpl->m_xCommandDefinitions ); m_pEventExecutor = new DocumentEventExecutor( m_pImpl->m_aContext, this ); @@ -1395,6 +1397,17 @@ void ODatabaseDocument::clearObjectContainer( WeakReference< XNameAccess >& _rxC _rxContainer.clear(); } +void ODatabaseDocument::clearObjectContainer( unotools::WeakReference< OCommandContainer >& _rxContainer) +{ +rtl::Reference< OCommandContainer > xContainer = _rxContainer; +if ( xContainer.is() ) +{ +xContainer->dispose(); +xContainer->setParent( nullptr ); +} +_rxContainer.clear(); +} + Reference< XNameAccess > ODatabaseDocument::impl_getDocumentContainer_throw( ODatabaseModelImpl::ObjectType _eType ) { if ( ( _eType != ODatabaseModelImpl::ObjectType::Form ) && ( _eType != ODatabaseModelImpl::ObjectType::Report ) ) diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx index daccea4d1f9f..46d86d278dc9 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.hxx +++ b/dbaccess/source/core/dataaccess/databasedocument.hxx @@ -74,6 +74,7 @@ namespace dbaccess class DocumentEvents; class DocumentEventExecutor; class DocumentGuard; +class OCommandContainer; typedef std::vector< css::uno::Reference< css::frame::XController > > Controllers; @@ -439,6 +440,8 @@ public: */ static void clearObjectContainer( css::uno::WeakReference< css::container::XNameAccess >& _rxContainer); +static void clearObjectContainer( +unotools::WeakReference< OCommandContainer >& _rxContainer); /** checks wheth
core.git: sw/inc sw/source
sw/inc/doc.hxx |3 ++ sw/inc/shellio.hxx |2 - sw/source/core/bastyp/init.cxx |6 ++-- sw/source/core/doc/doc.cxx | 45 + sw/source/filter/writer/writer.cxx | 27 -- sw/source/filter/ww8/wrtw8sty.cxx | 19 +++ sw/source/filter/xml/xmlfonte.cxx | 23 +- 7 files changed, 93 insertions(+), 32 deletions(-) New commits: commit 9ceb4141ec291129dfbf0c1a220c9c498bc50585 Author: Noel Grandin AuthorDate: Thu Sep 19 13:03:39 2024 +0200 Commit: Noel Grandin CommitDate: Mon Sep 23 14:34:07 2024 +0200 dont use GetItemSurrogates for gathering SvxFontItem which is very expensive these days Change-Id: I43e19c77eee024fd4875aa57d9c28d5c9e0ad465 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173650 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 7137078c1571..a1bcea1eca4f 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1455,6 +1455,9 @@ public: /// Iterate over all RES_CHRATR_BACKGROUND SvxBrushItem, if the function returns false, iteration is stopped SW_DLLPUBLIC void ForEachCharacterBrushItem(const std::function& ) const; +/// Iterate over all RES_CHRATR_FONT/RES_CHRATR_CJK_FONT/RES_CHRATR_CTL_FONT SvxFontItem, if the function returns false, iteration is stopped +SW_DLLPUBLIC void ForEachCharacterFontItem(TypedWhichId nWhich, bool bIgnoreAutoStyles, const std::function& ); + /// Iterate over all RES_TXTATR_UNKNOWN_CONTAINER SvXMLAttrContainerItem, if the function returns false, iteration is stopped SW_DLLPUBLIC void ForEachTxtAtrContainerItem(const std::function& ) const; diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index 633dbacf9070..a9245c8f3bba 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -392,7 +392,7 @@ class SW_DLLPUBLIC Writer OUString m_sBaseURL; void AddFontItem( SfxItemPool& rPool, const SvxFontItem& rFont ); -void AddFontItems_( SfxItemPool& rPool, sal_uInt16 nWhichId ); +void AddFontItems_( SfxItemPool& rPool, TypedWhichId nWhichId ); std::unique_ptr m_pImpl; diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 487484512141..9dbf4043d88f 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -283,7 +283,7 @@ ItemInfoPackage& getItemInfoPackageSwAttributes() { RES_CHRATR_CONTOUR, new SvxContourItem( false, RES_CHRATR_CONTOUR ), SID_ATTR_CHAR_CONTOUR, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_CROSSEDOUT, new SvxCrossedOutItem( STRIKEOUT_NONE, RES_CHRATR_CROSSEDOUT ), SID_ATTR_CHAR_STRIKEOUT, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_ESCAPEMENT, new SvxEscapementItem( RES_CHRATR_ESCAPEMENT ), SID_ATTR_CHAR_ESCAPEMENT, SFX_ITEMINFOFLAG_NONE }, -{ RES_CHRATR_FONT, nullptr, SID_ATTR_CHAR_FONT, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE }, +{ RES_CHRATR_FONT, nullptr, SID_ATTR_CHAR_FONT, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_FONTSIZE, new SvxFontHeightItem( 240, 100, RES_CHRATR_FONTSIZE ), SID_ATTR_CHAR_FONTHEIGHT, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_KERNING, new SvxKerningItem( 0, RES_CHRATR_KERNING ), SID_ATTR_CHAR_KERNING, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_LANGUAGE, new SvxLanguageItem(LANGUAGE_DONTKNOW, RES_CHRATR_LANGUAGE ), SID_ATTR_CHAR_LANGUAGE, SFX_ITEMINFOFLAG_NONE }, @@ -300,14 +300,14 @@ ItemInfoPackage& getItemInfoPackageSwAttributes() { RES_CHRATR_BACKGROUND, new SvxBrushItem( RES_CHRATR_BACKGROUND ), SID_ATTR_BRUSH_CHAR, SFX_ITEMINFOFLAG_NONE }, // CJK-Attributes -{ RES_CHRATR_CJK_FONT, nullptr, SID_ATTR_CHAR_CJK_FONT, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE }, +{ RES_CHRATR_CJK_FONT, nullptr, SID_ATTR_CHAR_CJK_FONT, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_CJK_FONTSIZE, new SvxFontHeightItem( 240, 100, RES_CHRATR_CJK_FONTSIZE ), SID_ATTR_CHAR_CJK_FONTHEIGHT, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_CJK_LANGUAGE, new SvxLanguageItem(LANGUAGE_DONTKNOW, RES_CHRATR_CJK_LANGUAGE), SID_ATTR_CHAR_CJK_LANGUAGE, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_CJK_POSTURE, new SvxPostureItem(ITALIC_NONE, RES_CHRATR_CJK_POSTURE ), SID_ATTR_CHAR_CJK_POSTURE, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_CJK_WEIGHT, new SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_CJK_WEIGHT ), SID_ATTR_CHAR_CJK_WEIGHT, SFX_ITEMINFOFLAG_NONE }, // CTL-Attributes -{ RES_CHRATR_CTL_FONT, nullptr, SID_ATTR_CHAR_CTL_FONT, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE }, +{ RES_CHRATR_CTL_FONT, nullptr, SID_ATTR_CHAR_CTL_FONT, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_CTL_FONTSIZE, new SvxFontHeightItem( 240, 100, RES_CHRATR_CTL_FONTSIZE ), SID_ATTR_CHAR_C
core.git: vcl/source
vcl/source/outdev/bitmapex.cxx | 98 ++--- 1 file changed, 6 insertions(+), 92 deletions(-) New commits: commit 3194b9b42eda967dc57c2d244fb7b800a98c09d2 Author: Noel Grandin AuthorDate: Sun Sep 22 18:55:17 2024 +0200 Commit: Noel Grandin CommitDate: Sun Sep 22 22:19:56 2024 +0200 remove some dead code in DrawDeviceBitmapEx ever since we added the call to DrawDeviceAlphaBitmap Change-Id: Ia329e355839ffc27c88135513898e7ea460242fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173772 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx index 2a1b21153d0b..45408ac5cba6 100644 --- a/vcl/source/outdev/bitmapex.cxx +++ b/vcl/source/outdev/bitmapex.cxx @@ -190,100 +190,14 @@ void OutputDevice::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSi rBitmapEx.Mirror(nMirrFlags); const SalBitmap* pSalSrcBmp = rBitmapEx.ImplGetBitmapSalBitmap().get(); -std::shared_ptr xMaskBmp = rBitmapEx.maAlphaMask.GetBitmap().ImplGetSalBitmap(); +assert(!rBitmapEx.maAlphaMask.GetBitmap().ImplGetSalBitmap() && "I removed some code here that will need to be restored"); -if (xMaskBmp) -{ -if (mpGraphics->DrawAlphaBitmap(aPosAry, *pSalSrcBmp, *xMaskBmp, *this)) -{ -// tried to paint as alpha directly. If this worked, we are done (except -// alpha, see below) -} -else -{ -// #4919452# reduce operation area to bounds of -// cliprect. since masked transparency involves -// creation of a large vdev and copying the screen -// content into that (slooow read from framebuffer), -// that should considerably increase performance for -// large bitmaps and small clippings. - -// Note that this optimization is a workaround for a -// Writer peculiarity, namely, to decompose background -// graphics into myriads of disjunct, tiny -// rectangles. That otherwise kills us here, since for -// transparent output, SAL always prepares the whole -// bitmap, if aPosAry contains the whole bitmap (and -// it's _not_ to blame for that). - -// Note the call to ImplPixelToDevicePixel(), since -// aPosAry already contains the mnOutOff-offsets, they -// also have to be applied to the region -tools::Rectangle aClipRegionBounds( ImplPixelToDevicePixel(maRegion).GetBoundRect() ); - -// TODO: Also respect scaling (that's a bit tricky, -// since the source points have to move fractional -// amounts (which is not possible, thus has to be -// emulated by increases copy area) -// const double nScaleX( aPosAry.mnDestWidth / aPosAry.mnSrcWidth ); -// const double nScaleY( aPosAry.mnDestHeight / aPosAry.mnSrcHeight ); - -// for now, only identity scales allowed -if (!aClipRegionBounds.IsEmpty() && -aPosAry.mnDestWidth == aPosAry.mnSrcWidth && -aPosAry.mnDestHeight == aPosAry.mnSrcHeight) -{ -// now intersect dest rect with clip region - aClipRegionBounds.Intersection(tools::Rectangle(aPosAry.mnDestX, - aPosAry.mnDestY, - aPosAry.mnDestX + aPosAry.mnDestWidth - 1, - aPosAry.mnDestY + aPosAry.mnDestHeight - 1)); - -// Note: I could theoretically optimize away the -// DrawBitmap below, if the region is empty -// here. Unfortunately, cannot rule out that -// somebody relies on the side effects. -if (!aClipRegionBounds.IsEmpty()) -{ -aPosAry.mnSrcX += aClipRegionBounds.Left() - aPosAry.mnDestX; -aPosAry.mnSrcY += aClipRegionBounds.Top() - aPosAry.mnDestY; -aPosAry.mnSrcWidth = aClipRegionBounds.GetWidth(); -aPosAry.mnSrcHeight = aClipRegionBounds.GetHeight(); - -aPosAry.mnDestX = aClipRegionBounds.Left(); -aPosAry.mnDestY = aClipRegionBounds.
core.git: chart2/source
chart2/source/inc/WeakListenerAdapter.hxx | 40 chart2/source/tools/WeakListenerAdapter.cxx |7 2 files changed, 13 insertions(+), 34 deletions(-) New commits: commit d7549a402ddc75bd5b8e3a3a2e3aa98d5be85b36 Author: Noel Grandin AuthorDate: Fri Sep 20 14:33:57 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 21 16:10:28 2024 +0200 no need for a template here it is instantiated only once Change-Id: I0545219a390eb382bcffd3b1a551245f54c47f90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173730 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/chart2/source/inc/WeakListenerAdapter.hxx b/chart2/source/inc/WeakListenerAdapter.hxx index f300f1aa0391..e312f7bee56f 100644 --- a/chart2/source/inc/WeakListenerAdapter.hxx +++ b/chart2/source/inc/WeakListenerAdapter.hxx @@ -38,47 +38,31 @@ namespace chart the same wrapper that you added, i.e., you should store the adapter as a member in the adapted class for later use. */ -template< class Listener > -class WeakListenerAdapter : public -::cppu::WeakImplHelper< Listener > +class WeakSelectionChangeListenerAdapter final : +public ::cppu::WeakImplHelper< css::view::XSelectionChangeListener > { public: -explicit WeakListenerAdapter( const css::uno::Reference< Listener > & xListener ) : -m_xListener( xListener ) -{} +explicit WeakSelectionChangeListenerAdapter( +const css::uno::Reference< css::view::XSelectionChangeListener > & xListener ) +: m_xListener( xListener ) {} +virtual ~WeakSelectionChangeListenerAdapter() override; protected: +// XSelectionChangeListener +virtual void SAL_CALL selectionChanged( +const css::lang::EventObject& aEvent ) override; + // XEventListener (base of all listeners) virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override { -css::uno::Reference< css::lang::XEventListener > xEventListener( - css::uno::Reference< Listener >( m_xListener), css::uno::UNO_QUERY ); +css::uno::Reference< css::view::XSelectionChangeListener > xEventListener( m_xListener ); if( xEventListener.is()) xEventListener->disposing( Source ); } -css::uno::Reference< Listener > getListener() const -{ -return m_xListener; -} - private: -css::uno::WeakReference< Listener > m_xListener; -}; - -class WeakSelectionChangeListenerAdapter final : -public WeakListenerAdapter< css::view::XSelectionChangeListener > -{ -public: -explicit WeakSelectionChangeListenerAdapter( -const css::uno::Reference< css::view::XSelectionChangeListener > & xListener ); -virtual ~WeakSelectionChangeListenerAdapter() override; - -protected: -// XSelectionChangeListener -virtual void SAL_CALL selectionChanged( -const css::lang::EventObject& aEvent ) override; +css::uno::WeakReference< css::view::XSelectionChangeListener > m_xListener; }; } // namespace chart diff --git a/chart2/source/tools/WeakListenerAdapter.cxx b/chart2/source/tools/WeakListenerAdapter.cxx index 16b3d815031c..b456c5bdadf9 100644 --- a/chart2/source/tools/WeakListenerAdapter.cxx +++ b/chart2/source/tools/WeakListenerAdapter.cxx @@ -26,17 +26,12 @@ using ::com::sun::star::uno::Reference; namespace chart { -WeakSelectionChangeListenerAdapter::WeakSelectionChangeListenerAdapter( -const Reference< view::XSelectionChangeListener > & xListener ) : -WeakListenerAdapter< css::view::XSelectionChangeListener >( xListener ) -{} - WeakSelectionChangeListenerAdapter::~WeakSelectionChangeListenerAdapter() {} void SAL_CALL WeakSelectionChangeListenerAdapter::selectionChanged( const lang::EventObject& aEvent ) { -Reference< view::XSelectionChangeListener > xSelChgListener( getListener() ); +Reference< view::XSelectionChangeListener > xSelChgListener( m_xListener ); if( xSelChgListener.is()) xSelChgListener->selectionChanged( aEvent ); }
core.git: sw/inc sw/source
sw/inc/doc.hxx |3 ++ sw/source/core/bastyp/init.cxx |2 - sw/source/core/doc/doc.cxx | 12 + sw/source/filter/xml/xmlexp.cxx | 51 4 files changed, 47 insertions(+), 21 deletions(-) New commits: commit 809808f56bc79c229ca7ce84eb03274271ff1044 Author: Noel Grandin AuthorDate: Fri Sep 20 16:47:23 2024 +0200 Commit: Noel Grandin CommitDate: Sat Sep 21 13:13:59 2024 +0200 dont use GetItemSurrogates for gathering SvXMLAttrContainerItem which is very expensive these days Change-Id: I1880ae272e422baca7b0540f58c9e8f9c3bb1287 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173732 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 0e16a9607e34..7137078c1571 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1461,6 +1461,9 @@ public: /// Iterate over all RES_PARATR_TABSTOP SvxTabStopItem, if the function returns false, iteration is stopped SW_DLLPUBLIC void ForEachParaAtrTabStopItem(const std::function& ) const; +/// Iterate over all RES_UNKNOWNATR_CONTAINER SvXMLAttrContainerItem, if the function returns false, iteration is stopped +SW_DLLPUBLIC void ForEachUnknownAtrContainerItem(const std::function& ) const; + // Call into intransparent Basic; expect possible Return String. void ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ); diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 9c1fb0bb62c5..487484512141 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -457,7 +457,7 @@ ItemInfoPackage& getItemInfoPackageSwAttributes() { RES_BOXATR_FORMAT, new SwTableBoxNumFormat, 0, SFX_ITEMINFOFLAG_NONE }, { RES_BOXATR_FORMULA, new SwTableBoxFormula( OUString() ), 0, SFX_ITEMINFOFLAG_NONE }, { RES_BOXATR_VALUE, new SwTableBoxValue, 0, SFX_ITEMINFOFLAG_NONE }, -{ RES_UNKNOWNATR_CONTAINER, new SvXMLAttrContainerItem( RES_UNKNOWNATR_CONTAINER ), 0, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE } +{ RES_UNKNOWNATR_CONTAINER, new SvXMLAttrContainerItem( RES_UNKNOWNATR_CONTAINER ), 0, SFX_ITEMINFOFLAG_NONE } }}; virtual const ItemInfoStatic& getItemInfoStatic(size_t nIndex) const override { return maItemInfos[nIndex]; } diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 1f2db1ab6668..15e6a1bf29fe 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1533,6 +1533,18 @@ void SwDoc::ForEachParaAtrTabStopItem(const std::function& rFunc ) const +{ +for(SwFrameFormat* pFormat : *GetFrameFormats()) +{ +const SwAttrSet& rAttrSet = pFormat->GetAttrSet(); +if (const SvXMLAttrContainerItem* pItem = rAttrSet.GetItemIfSet(RES_UNKNOWNATR_CONTAINER)) +if (!rFunc(*pItem)) +return; +} +} + void SwDoc::Summary(SwDoc& rExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress) { const SwOutlineNodes& rOutNds = GetNodes().GetOutLineNds(); diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 0d9e89979bdf..676317ef869e 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -148,31 +148,42 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) } return true; }); - +pDoc->ForEachUnknownAtrContainerItem([this](const SvXMLAttrContainerItem& rUnknown) -> bool { +if( rUnknown.GetAttrCount() > 0 ) +{ +sal_uInt16 nIdx = rUnknown.GetFirstNamespaceIndex(); +while( USHRT_MAX != nIdx ) +{ +GetNamespaceMap_().Add( rUnknown.GetPrefix( nIdx ), +rUnknown.GetNamespace( nIdx ) ); +nIdx = rUnknown.GetNextNamespaceIndex( nIdx ); +} +} +return true; +}); const SfxItemPool& rPool = pDoc->GetAttrPool(); -sal_uInt16 aWhichIds[4] = { RES_UNKNOWNATR_CONTAINER, -SDRATTR_XMLATTRIBUTES, -EE_PARA_XMLATTRIBS, -EE_CHAR_XMLATTRIBS }; - -const int nWhichIds = rPool.GetSecondaryPool() ? 4 : 1; -for( int j=0; j < nWhichIds; ++j ) +if (rPool.GetSecondaryPool()) { -const sal_uInt16 nWhichId = aWhichIds[j]; -ItemSurrogates aSurrogates; -rPool.GetItemSurrogates(aSurrogates, nWhichId); -for (const SfxPoolItem* pItem : aSurrogates) +sal_uInt16 aWhichIds[3] = { SDRATTR_XMLATTRIBUTES, +EE_PARA_XMLATTRIBS, +EE_CHAR_X
core.git: sc/source
sc/source/core/data/patattr.cxx | 72 +++- 1 file changed, 14 insertions(+), 58 deletions(-) New commits: commit 944fbe89fd48fa7814c0b33ef22910e8221da9de Author: Noel Grandin AuthorDate: Fri Sep 20 15:39:31 2024 +0200 Commit: Noel Grandin CommitDate: Fri Sep 20 21:03:32 2024 +0200 tdf#161562 Sluggish scrolling after saving and changing text color This reverts commit eb13c889c760cfe153d5b41188e218bdda797d52. "Speed up scrolling through large document with lots of patterns" Which seems (according to buovjaga testing) to be a pessimisation now. I can't reproduce this either way, so lets just revert it for now. Change-Id: I6b7f95173eb875d215f1192b3a7ca44014c50886 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173641 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index b5814947b906..284759d1b965 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -47,8 +47,6 @@ #include #include #include -#include -#include #include #include #include @@ -1506,66 +1504,24 @@ bool ScPatternAttr::CalcVisible() const return false; } -bool ScPatternAttr::IsVisibleEqual( const ScPatternAttr& rOther ) const +static bool OneEqual( const SfxItemSet& rSet1, const SfxItemSet& rSet2, sal_uInt16 nId ) { -// This method is hot, so we do an optimised comparison here, by -// walking the two itemsets in parallel, avoiding doing repeated searches. -auto IsInterestingWhich = [](sal_uInt16 n) -{ -return n == ATTR_BORDER_TLBR || n == ATTR_BORDER_BLTR || n == ATTR_BACKGROUND - || n == ATTR_BORDER || n == ATTR_SHADOW; -}; -SfxWhichIter aIter1(GetItemSet()); -SfxWhichIter aIter2(rOther.GetItemSet()); -sal_uInt16 nWhich1 = aIter1.FirstWhich(); -sal_uInt16 nWhich2 = aIter2.FirstWhich(); -for (;;) -{ -while (nWhich1 != nWhich2) -{ -SfxWhichIter* pIterToIncrement; -sal_uInt16* pSmallerWhich; -if (nWhich1 == 0 || nWhich1 > nWhich2) -{ -pSmallerWhich = &nWhich2; -pIterToIncrement = &aIter2; -} -else -{ -pSmallerWhich = &nWhich1; -pIterToIncrement = &aIter1; -} - -if (IsInterestingWhich(*pSmallerWhich)) -{ -// the iter with larger which has already passed this point, and has no interesting -// item available in the other - so indeed these are unequal -return false; -} - -*pSmallerWhich = pIterToIncrement->NextWhich(); -} +const SfxPoolItem* pItem1 = &rSet1.Get(nId); +const SfxPoolItem* pItem2 = &rSet2.Get(nId); +return ( pItem1 == pItem2 || *pItem1 == *pItem2 ); +} -// Here nWhich1 == nWhich2 +bool ScPatternAttr::IsVisibleEqual( const ScPatternAttr& rOther ) const +{ +const SfxItemSet& rThisSet = GetItemSet(); +const SfxItemSet& rOtherSet = rOther.GetItemSet(); -if (!nWhich1 /* && !nWhich2*/) -return true; +return OneEqual( rThisSet, rOtherSet, ATTR_BACKGROUND ) && +OneEqual( rThisSet, rOtherSet, ATTR_BORDER ) && +OneEqual( rThisSet, rOtherSet, ATTR_BORDER_TLBR ) && +OneEqual( rThisSet, rOtherSet, ATTR_BORDER_BLTR ) && +OneEqual( rThisSet, rOtherSet, ATTR_SHADOW ); -if (IsInterestingWhich(nWhich1)) -{ -const SfxPoolItem* pItem1 = nullptr; -const SfxPoolItem* pItem2 = nullptr; -SfxItemState state1 = aIter1.GetItemState(true, &pItem1); -SfxItemState state2 = aIter2.GetItemState(true, &pItem2); -if (state1 != state2 -&& (state1 < SfxItemState::DEFAULT || state2 < SfxItemState::DEFAULT)) -return false; -if (!SfxPoolItem::areSame(pItem1, pItem2)) -return false; -} -nWhich1 = aIter1.NextWhich(); -nWhich2 = aIter2.NextWhich(); -} //TODO: also here only check really visible values !!! }
core.git: basic/source
basic/source/classes/sbunoobj.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f65b2049428cda9b65199efdac46577926b1efe7 Author: Noel Grandin AuthorDate: Fri Sep 20 14:27:43 2024 +0200 Commit: Noel Grandin CommitDate: Fri Sep 20 19:12:27 2024 +0200 no need to do UNO_QUERY here Change-Id: I52d13a7e4806d8fc34c4ff6f4cc5ab1e785a8b76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173729 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index bede3ce759eb..57d262960f31 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -4470,7 +4470,7 @@ void disposeComVariablesForBasic( StarBASIC const * pBasic ) ComponentRefVector& rv = pItem->m_vComImplementsObjects; for (auto const& elem : rv) { -Reference< XComponent > xComponent( elem.get(), UNO_QUERY ); +Reference< XComponent > xComponent( elem ); if (xComponent.is()) xComponent->dispose(); }
core.git: hwpfilter/source reportdesign/inc sd/source svtools/source
hwpfilter/source/hwpreader.cxx|2 - reportdesign/inc/RptObject.hxx|4 ++- sd/source/ui/framework/factories/BasicViewFactory.cxx | 20 +++--- svtools/source/dialogs/ServerDetailsControls.hxx |4 +-- 4 files changed, 14 insertions(+), 16 deletions(-) New commits: commit 66cf2087187651c10293472ae139c366f38cb1a3 Author: Noel Grandin AuthorDate: Fri Sep 20 10:49:36 2024 +0200 Commit: Noel Grandin CommitDate: Fri Sep 20 12:46:10 2024 +0200 use more concrete UNO types in various Change-Id: Ia28cffdeae8ced2e19dcf695ee5c3417d4f97d64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173698 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 2921ef5ff2f0..6d24faca1ced 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -4744,7 +4744,7 @@ public: virtual OUString SAL_CALL detect( css::uno::Sequence< css::beans::PropertyValue >& rDescriptor ) override; private: -Reference< XFilter > rFilter; +rtl::Reference< HwpReader > rFilter; Reference< XImporter > rImporter; }; diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx index 5920eb2bc8c2..b5c8c9b239fb 100644 --- a/reportdesign/inc/RptObject.hxx +++ b/reportdesign/inc/RptObject.hxx @@ -34,6 +34,8 @@ namespace rptui { +class OObjectListener; + typedef ::std::multimap< sal_Int16, OUString > IndexToNameMap; enum DlgEdHintKind { @@ -64,7 +66,7 @@ class UNLESS_MERGELIBS_MORE(REPORTDESIGN_DLLPUBLIC) SAL_LOPLUGIN_ANNOTATE("cross { protected: mutable rtl::Reference m_xMediator; -mutable css::uno::Reference< css::beans::XPropertyChangeListener> m_xPropertyChangeListener; +mutable rtl::Reference< OObjectListener > m_xPropertyChangeListener; mutable css::uno::Reference< css::report::XReportComponent> m_xReportComponent; css::uno::Reference< css::uno::XInterface > m_xKeepShapeAlive; OUString m_sComponentName; diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 20cb7ed6df2f..c9f06e6593d6 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -57,7 +57,7 @@ namespace sd::framework { class BasicViewFactory::ViewDescriptor { public: -Reference mxView; +rtl::Reference mxView; std::shared_ptr mpViewShell; Reference mxViewId; static bool CompareView (const std::shared_ptr& rpDescriptor, @@ -386,11 +386,10 @@ void BasicViewFactory::ReleaseView ( if (bIsCacheable) { -Reference xResource (rpDescriptor->mxView, UNO_QUERY); -if (xResource.is()) +if (rpDescriptor->mxView) { if (mxLocalPane.is()) -if (xResource->relocateToAnchor(mxLocalPane)) +if (rpDescriptor->mxView->relocateToAnchor(mxLocalPane)) mpViewCache->push_back(rpDescriptor); else bIsCacheable = false; @@ -410,9 +409,8 @@ void BasicViewFactory::ReleaseView ( mpBase->GetDocShell()->Disconnect(rpDescriptor->mpViewShell.get()); mpBase->GetViewShellManager()->DeactivateViewShell(rpDescriptor->mpViewShell.get()); -Reference xComponent (rpDescriptor->mxView, UNO_QUERY); -if (xComponent.is()) -xComponent->dispose(); +if (rpDescriptor->mxView) +rpDescriptor->mxView->dispose(); } } @@ -420,8 +418,7 @@ bool BasicViewFactory::IsCacheable (const std::shared_ptr& rpDes { bool bIsCacheable (false); -Reference xResource (rpDescriptor->mxView, UNO_QUERY); -if (xResource.is()) +if (rpDescriptor->mxView) { static ::std::vector > s_aCacheableResources = [&]() { @@ -463,10 +460,9 @@ std::shared_ptr BasicViewFactory::GetViewFromC if (pDescriptor != nullptr) { bool bRelocationSuccessful (false); -Reference xResource (pDescriptor->mxView, UNO_QUERY); -if (xResource.is() && rxPane.is()) +if (pDescriptor->mxView && rxPane.is()) { -if (xResource->relocateToAnchor(rxPane)) +if (pDescriptor->mxView->relocateToAnchor(rxPane)) bRelocationSuccessful = true; } diff --git a/svtools/source/dialogs/ServerDetailsControls.hxx b/svtools/source/dialogs/ServerDetailsControls.hxx index 186125e555bb..ddca70807d77 100644 --- a/svtools/source/dialogs/ServerDetailsControls.hxx +++ b/svtools/source/dialogs/ServerDetailsControls.hxx @@ -12,7 +12,7 @@ #include
core.git: 2 commits - sw/inc sw/source
sw/inc/doc.hxx |6 ++ sw/source/core/bastyp/init.cxx |4 ++-- sw/source/core/doc/doc.cxx | 39 +++ sw/source/core/doc/docfmt.cxx |9 +++-- sw/source/filter/xml/xmlexp.cxx | 19 --- 5 files changed, 66 insertions(+), 11 deletions(-) New commits: commit 01ab23b13297c9d7b091dfbe2850cd343fcd3e0e Author: Noel Grandin AuthorDate: Thu Sep 19 19:53:53 2024 +0200 Commit: Noel Grandin CommitDate: Fri Sep 20 07:52:02 2024 +0200 dont use GetItemSurrogates for gathering SvxTabStopItem which is very expensive these days Change-Id: Iae80c9d677fd1db8606a6a3f9462fe16b110a540 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173682 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index c11f23dcf6f6..0e16a9607e34 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1458,6 +1458,9 @@ public: /// Iterate over all RES_TXTATR_UNKNOWN_CONTAINER SvXMLAttrContainerItem, if the function returns false, iteration is stopped SW_DLLPUBLIC void ForEachTxtAtrContainerItem(const std::function& ) const; +/// Iterate over all RES_PARATR_TABSTOP SvxTabStopItem, if the function returns false, iteration is stopped +SW_DLLPUBLIC void ForEachParaAtrTabStopItem(const std::function& ) const; + // Call into intransparent Basic; expect possible Return String. void ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ); diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index b5b409705f1a..9c1fb0bb62c5 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -358,7 +358,7 @@ ItemInfoPackage& getItemInfoPackageSwAttributes() { RES_PARATR_SPLIT, new SvxFormatSplitItem( true, RES_PARATR_SPLIT ), SID_ATTR_PARA_SPLIT, SFX_ITEMINFOFLAG_NONE }, { RES_PARATR_ORPHANS, new SvxOrphansItem( 0, RES_PARATR_ORPHANS ), SID_ATTR_PARA_ORPHANS, SFX_ITEMINFOFLAG_NONE }, { RES_PARATR_WIDOWS, new SvxWidowsItem( 0, RES_PARATR_WIDOWS ), SID_ATTR_PARA_WIDOWS, SFX_ITEMINFOFLAG_NONE }, -{ RES_PARATR_TABSTOP, new SvxTabStopItem( 1, SVX_TAB_DEFDIST, SvxTabAdjust::Default, RES_PARATR_TABSTOP ), SID_ATTR_TABSTOP, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE }, +{ RES_PARATR_TABSTOP, new SvxTabStopItem( 1, SVX_TAB_DEFDIST, SvxTabAdjust::Default, RES_PARATR_TABSTOP ), SID_ATTR_TABSTOP, SFX_ITEMINFOFLAG_NONE }, // for this at the Item GetMaxHyphens() = 0 was called, do this now on-demand at construction time // it will get added in constructor below once for LO runtime as static default diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 2be295986df3..1f2db1ab6668 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1521,6 +1521,18 @@ void SwDoc::ForEachTxtAtrContainerItem(const std::function& rFunc ) const +{ +for(SwCharFormat* pFormat : *GetCharFormats()) +{ +const SwAttrSet& rAttrSet = pFormat->GetAttrSet(); +if (const SvxTabStopItem* pItem = rAttrSet.GetItemIfSet(RES_PARATR_TABSTOP)) +if (!rFunc(*pItem)) +return; +} +} + void SwDoc::Summary(SwDoc& rExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress) { const SwOutlineNodes& rOutNds = GetNodes().GetOutLineNds(); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 75ccf557810e..b7f8d4ba7791 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -636,18 +636,15 @@ void SwDoc::SetDefault( const SfxItemSet& rSet ) nOldWidth = aOld.Get(RES_PARATR_TABSTOP)[ 0 ].GetTabPos(); bool bChg = false; -ItemSurrogates aSurrogates; -GetAttrPool().GetItemSurrogates(aSurrogates, RES_PARATR_TABSTOP); -for (const SfxPoolItem* pItem2 : aSurrogates) -{ +ForEachParaAtrTabStopItem([&bChg, &nOldWidth, &nNewWidth](const SvxTabStopItem& rTabStopItem) -> bool { // pItem2 and thus pTabStopItem is a evtl. shared & RefCounted // Item and *should* not be changed that way. lcl_SetNewDefTabStops // seems to change pTabStopItem (!). This may need to be changed // to use iterateItemSurrogates and a defined write cycle. -const auto & rTabStopItem = static_cast(*pItem2); bChg |= lcl_SetNewDefTabStops( nOldWidth, nNewWidth, const_cast(rTabStopItem) ); -} +return true; +}); aNew.ClearItem( RES_PARATR_TABSTOP ); aOld.ClearItem( RES_PARATR_TABSTOP ); commit 1442dc4ee12251eed04e51eb324a34dc4b7973c3 Author: Noel Grandin AuthorDate: Thu Se
core.git: include/i18nlangtag include/o3tl
include/i18nlangtag/lang.h |3 +++ include/o3tl/strong_int.hxx |9 + 2 files changed, 12 insertions(+) New commits: commit 7db1150b2c4a9adb993084d2dceedb450781b1dc Author: Noel Grandin AuthorDate: Thu Sep 19 08:46:50 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 19 17:54:32 2024 +0200 fix macos build with clang 16 Undefined symbols for architecture arm64: "o3tl::strong_int::strong_int(int, std::__1::enable_if::value, int>::type)", referenced from: sfx2::(anonymous namespace)::SvxInternalLink::Connect(sfx2::SvBaseLink*) in linkmgr2.o SfxHTMLParser::GetTableDataOptionsValNum(unsigned int&, o3tl::strong_int&, rtl::OUString const&, std::__1::basic_string_view>, SvNumberFormatter&) in sfxhtml.o SfxHTMLParser::GetTableDataOptionsValNum(unsigned int&, o3tl::strong_int&, rtl::OUString const&, std::__1::basic_string_view>, SvNumberFormatter&) in sfxhtml.o SfxHTMLParser::GetTableDataOptionsValNum(unsigned int&, o3tl::strong_int&, rtl::OUString const&, std::__1::basic_string_view>, SvNumberFormatter&) in sfxhtml.o SfxHTMLParser::GetTableDataOptionsValNum(unsigned int&, o3tl::strong_int&, rtl::OUString const&, std::__1::basic_string_view>, SvNumberFormatter&) in sfxhtml.o ld: symbol(s) not found for architecture arm64 clang++: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [/Users/noelgrandin/lode/dev/core/sfx2/Library_sfx.mk:20: /Users/noelgrandin/lode/dev/core/instdir/LibreOfficeDev.app/Contents/Frameworks/libsfxlo.dylib] Error 1 make[1]: Target 'build' not remade because of errors. make: *** [Makefile:296: build] Error 2 Change-Id: Ia8c338a89156e18a1c96630ecad2bccbba7bb745 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173652 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h index c9870969c6a9..1bd03fb51c98 100644 --- a/include/i18nlangtag/lang.h +++ b/include/i18nlangtag/lang.h @@ -90,10 +90,13 @@ constexpr LanguageType primary(LanguageType lt) { return LanguageType(sal_uInt16 namespace o3tl { +// when compiling LO on macOS, debug builds will display a linking error +#if !(defined MACOSX && defined __clang__ && __clang_major__ == 16) // delete "sal_Int16" constructor via specialization: values > 0x7FFF are // actually used, and unfortunately passed around in the API as signed // "short", so use this to find all places where casts must be inserted template<> template<> constexpr strong_int::strong_int(short, std::enable_if::value, int>::type) = delete; +#endif } #define LANGUAGE_MASK_PRIMARY 0x03ff diff --git a/include/o3tl/strong_int.hxx b/include/o3tl/strong_int.hxx index fd7a9abb9c52..aea775805bda 100644 --- a/include/o3tl/strong_int.hxx +++ b/include/o3tl/strong_int.hxx @@ -84,6 +84,14 @@ template struct strong_int { public: +// when compiling LO on macOS, debug builds will display a linking error +#if defined MACOSX && defined __clang__ && __clang_major__ == 16 +explicit constexpr strong_int(unsigned long long value) : m_value(value) {} +explicit constexpr strong_int(unsigned long value) : m_value(value) {} +explicit constexpr strong_int(long value) : m_value(value) {} +explicit constexpr strong_int(int value) : m_value(value) {} +explicit constexpr strong_int(unsigned int value) : m_value(value) {} +#else template explicit constexpr strong_int( T value, typename std::enable_if::value, int>::type = 0): @@ -95,6 +103,7 @@ public: && "out of range"); #endif } +#endif strong_int() : m_value(0) {} explicit constexpr operator UNDERLYING_TYPE() const { return m_value; }
core.git: slideshow/source
slideshow/source/engine/slideview.cxx | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) New commits: commit a386837e4ea4a15609623916df5217e572480598 Author: Noel Grandin AuthorDate: Mon Sep 16 12:10:52 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 19 08:01:06 2024 +0200 use more concrete UNO types in WeakRefWrapper Change-Id: I5805a681833003c01b5c06c4719606cb27ab600c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173608 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx index 5c5758bb2831..8582918b2c4b 100644 --- a/slideshow/source/engine/slideview.cxx +++ b/slideshow/source/engine/slideview.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -1018,23 +1019,21 @@ void SlideView::disposing( lang::EventObject const& evt ) // silly wrapper to check that event handlers don't touch dead SlideView struct WeakRefWrapper { -SlideView & m_rObj; -uno::WeakReference const m_wObj; +unotools::WeakReference const m_wObj; std::function const m_func; WeakRefWrapper(SlideView & rObj, std::function func) -: m_rObj(rObj) -, m_wObj(rObj.getXWeak()) +: m_wObj(&rObj) , m_func(std::move(func)) { } void operator()() { -uno::Reference const xObj(m_wObj); +rtl::Reference const xObj(m_wObj); if (xObj.is()) { -m_func(m_rObj); +m_func(*xObj); } } };
core.git: 2 commits - sc/inc sc/source
sc/inc/textuno.hxx |9 + sc/source/core/data/attarray.cxx |9 + sc/source/ui/unoobj/fielduno.cxx |9 - sc/source/ui/unoobj/textuno.cxx | 21 + 4 files changed, 23 insertions(+), 25 deletions(-) New commits: commit 5fdc026250c9d691730e2062a7b5e2d5a6a81575 Author: Noel Grandin AuthorDate: Wed Sep 18 12:42:14 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 19 08:00:56 2024 +0200 use more concrete UNO types in sc Change-Id: I5b70733fb5be0a4f9a51e48197454ff0452770bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173611 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx index e5ec1aca0cad..87faca864992 100644 --- a/sc/inc/textuno.hxx +++ b/sc/inc/textuno.hxx @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -96,7 +97,7 @@ class ScHeaderFooterTextData { private: std::unique_ptr mpTextObj; -css::uno::WeakReference xContentObj; +unotools::WeakReference xContentObj; ScHeaderFooterPart nPart; std::unique_ptr pEditEngine; std::unique_ptr pForwarder; @@ -106,7 +107,7 @@ public: ScHeaderFooterTextData(const ScHeaderFooterTextData&) = delete; const ScHeaderFooterTextData& operator=(const ScHeaderFooterTextData&) = delete; ScHeaderFooterTextData( -css::uno::WeakReference xContent, ScHeaderFooterPart nP, const EditTextObject* pTextObj); +unotools::WeakReference xContent, ScHeaderFooterPart nP, const EditTextObject* pTextObj); ~ScHeaderFooterTextData(); // helper functions @@ -116,7 +117,7 @@ public: ScEditEngineDefaulter* GetEditEngine() { GetTextForwarder(); return pEditEngine.get(); } ScHeaderFooterPart GetPart() const { return nPart; } -css::uno::Reference GetContentObj() const { return xContentObj; } +rtl::Reference GetContentObj() const { return xContentObj; } const EditTextObject* GetTextObject() const { return mpTextObj.get(); } }; @@ -142,7 +143,7 @@ private: public: ScHeaderFooterTextObj( -const css::uno::WeakReference& xContent, ScHeaderFooterPart nP, const EditTextObject* pTextObj); +const unotools::WeakReference& xContent, ScHeaderFooterPart nP, const EditTextObject* pTextObj); virtual ~ScHeaderFooterTextObj() override; const EditTextObject* GetTextObject() const; diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index e14cfaa4cfcb..700cb97d4492 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -449,23 +449,22 @@ uno::Reference ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_In // Get the parent text range instance. uno::Reference xTextRange; -uno::Reference xContentObj = mrData.GetContentObj(); +rtl::Reference xContentObj = mrData.GetContentObj(); if (!xContentObj.is()) throw uno::RuntimeException(u""_ustr); -rtl::Reference pContentObj = ScHeaderFooterContentObj::getImplementation(xContentObj); uno::Reference xText; switch ( mrData.GetPart() ) { case ScHeaderFooterPart::LEFT: -xText = pContentObj->getLeftText(); +xText = xContentObj->getLeftText(); break; case ScHeaderFooterPart::CENTER: -xText = pContentObj->getCenterText(); +xText = xContentObj->getCenterText(); break; case ScHeaderFooterPart::RIGHT: -xText = pContentObj->getRightText(); +xText = xContentObj->getRightText(); break; } diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 45deb7d9bb4a..30b67d411f9f 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -137,14 +137,13 @@ void ScHeaderFooterContentObj::Init( const EditTextObject* pLeft, const EditTextObject* pCenter, const EditTextObject* pRight ) { -uno::Reference xThis(this); -mxLeftText = rtl::Reference(new ScHeaderFooterTextObj(xThis, ScHeaderFooterPart::LEFT, pLeft)); -mxCenterText = rtl::Reference(new ScHeaderFooterTextObj(xThis, ScHeaderFooterPart::CENTER, pCenter)); -mxRightText = rtl::Reference(new ScHeaderFooterTextObj(xThis, ScHeaderFooterPart::RIGHT, pRight)); +mxLeftText = rtl::Reference(new ScHeaderFooterTextObj(this, ScHeaderFooterPart::LEFT, pLeft)); +mxCenterText = rtl::Reference(new ScHeaderFooterTextObj(this, ScHeaderFooterPart::CENTER, pCenter)); +mxRightText = rtl::Reference(new ScHeaderFooterTextObj(this, ScHeaderFooterPart::RIGHT, pRight)); } ScHeaderFooterTextData::ScHeaderFooterTextData( -uno::WeakReference xContent, ScHeaderFooterPart nP, const EditTextObject* p
core.git: sd/source
sd/source/console/PresenterPaneFactory.cxx | 15 --- sd/source/console/PresenterPaneFactory.hxx |4 +++- sd/source/console/PresenterScreen.cxx | 14 +++--- sd/source/console/PresenterScreen.hxx |4 +++- sd/source/ui/inc/DrawController.hxx|2 +- sd/source/ui/inc/framework/ConfigurationController.hxx |3 ++- 6 files changed, 24 insertions(+), 18 deletions(-) New commits: commit b97b725312767dc5baf0a80c00c2ceda0f8dfa57 Author: Noel Grandin AuthorDate: Wed Sep 18 12:27:24 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 18 21:33:39 2024 +0200 use more concrete UNO types in sd Change-Id: If731da0f4839dc98b0dab1fa61669b92d5cc70f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173610 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sd/source/console/PresenterPaneFactory.cxx b/sd/source/console/PresenterPaneFactory.cxx index 5001bdec3ca3..22626286637b 100644 --- a/sd/source/console/PresenterPaneFactory.cxx +++ b/sd/source/console/PresenterPaneFactory.cxx @@ -24,6 +24,7 @@ #include "PresenterPaneContainer.hxx" #include "PresenterSpritePane.hxx" #include +#include #include #include @@ -58,12 +59,12 @@ PresenterPaneFactory::PresenterPaneFactory ( void PresenterPaneFactory::Register (const rtl::Reference<::sd::DrawController>& rxController) { -Reference xCC; +rtl::Reference<::sd::framework::ConfigurationController> xCC; try { // Get the configuration controller. -xCC.set(rxController->getConfigurationController()); -mxConfigurationControllerWeak = xCC; +xCC = rxController->getConfigurationControllerImpl(); +mxConfigurationControllerWeak = xCC.get(); if ( ! xCC.is()) { throw RuntimeException(); @@ -77,7 +78,7 @@ void PresenterPaneFactory::Register (const rtl::Reference<::sd::DrawController>& OSL_ASSERT(false); if (xCC.is()) xCC->removeResourceFactoryForReference(this); -mxConfigurationControllerWeak = WeakReference(); +mxConfigurationControllerWeak.clear(); throw; } @@ -89,10 +90,10 @@ PresenterPaneFactory::~PresenterPaneFactory() void SAL_CALL PresenterPaneFactory::disposing() { -Reference xCC (mxConfigurationControllerWeak); +rtl::Reference<::sd::framework::ConfigurationController> xCC (mxConfigurationControllerWeak); if (xCC.is()) xCC->removeResourceFactoryForReference(this); -mxConfigurationControllerWeak = WeakReference(); +mxConfigurationControllerWeak.clear(); // Dispose the panes in the cache. if (mpResourceCache != nullptr) @@ -190,7 +191,7 @@ Reference PresenterPaneFactory::CreatePane ( if ( ! rxPaneId.is()) return nullptr; -Reference xCC (mxConfigurationControllerWeak); +rtl::Reference<::sd::framework::ConfigurationController> xCC (mxConfigurationControllerWeak); if ( ! xCC.is()) return nullptr; diff --git a/sd/source/console/PresenterPaneFactory.hxx b/sd/source/console/PresenterPaneFactory.hxx index 1145cd5327af..3b00ae505dd8 100644 --- a/sd/source/console/PresenterPaneFactory.hxx +++ b/sd/source/console/PresenterPaneFactory.hxx @@ -28,10 +28,12 @@ #include #include #include +#include #include #include namespace sd { class DrawController; } +namespace sd::framework { class ConfigurationController; } namespace sdext::presenter { @@ -88,7 +90,7 @@ public: private: css::uno::WeakReference mxComponentContextWeak; -css::uno::WeakReference +unotools::WeakReference mxConfigurationControllerWeak; ::rtl::Reference mpPresenterController; typedef ::std::map > diff --git a/sd/source/console/PresenterScreen.cxx b/sd/source/console/PresenterScreen.cxx index 2b9b4bf2e5e7..ab46c2988c8a 100644 --- a/sd/source/console/PresenterScreen.cxx +++ b/sd/source/console/PresenterScreen.cxx @@ -27,6 +27,7 @@ #include "PresenterViewFactory.hxx" #include "PresenterWindowManager.hxx" #include +#include #include #include #include @@ -257,7 +258,6 @@ PresenterScreen::PresenterScreen ( : PresenterScreenInterfaceBase(m_aMutex) , mxModel(std::move(xModel)) , mxController() -, mxConfigurationControllerWeak() , mxContextWeak(rxContext) , mpPresenterController() , mxSavedConfiguration() @@ -298,12 +298,12 @@ bool PresenterScreen::isPresenterScreenFullScreen(const css::uno::Reference xCC (mxConfigurationControllerWeak); +rtl::Reference<::sd::framework::ConfigurationController> xCC (mxConfigurationControllerWeak); if (xCC.is() && mxSavedConfiguration.is()) { xCC->restoreConfiguration(mxSavedConfiguration); } -mxConfigurationControllerWeak = Reference(nullptr); +mxConfigurationControllerWeak.
core.git: 2 commits - sd/source
sd/source/ui/framework/factories/BasicPaneFactory.cxx | 11 - sd/source/ui/inc/framework/factories/BasicPaneFactory.hxx |5 sd/source/ui/inc/unomodel.hxx | 19 ++- sd/source/ui/unoidl/unocpres.hxx |2 sd/source/ui/unoidl/unomodel.cxx | 88 ++ 5 files changed, 62 insertions(+), 63 deletions(-) New commits: commit b09c52542fc431ff9e31e5bc1d24623c6bf42ac9 Author: Noel Grandin AuthorDate: Wed Sep 18 12:15:53 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 18 21:33:28 2024 +0200 use more concrete UNO types in sd Change-Id: I60977cf7e0690b8a01daa2fe6700e89c8a29516b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173609 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx index 0d32c1831e76..62a42f2ec2b0 100644 --- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx +++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -96,8 +97,8 @@ BasicPaneFactory::BasicPaneFactory ( // Tunnel through the controller to obtain access to the ViewShellBase. mpViewShellBase = rxController->GetViewShellBase(); -Reference xCC (rxController->getConfigurationController()); -mxConfigurationControllerWeak = xCC; +rtl::Reference xCC (rxController->getConfigurationControllerImpl()); +mxConfigurationControllerWeak = xCC.get(); // Add pane factories for the two left panes (one for Impress and one for // Draw) and the center pane. @@ -146,7 +147,7 @@ BasicPaneFactory::BasicPaneFactory ( } catch (RuntimeException&) { -Reference xCC (mxConfigurationControllerWeak); +rtl::Reference xCC (mxConfigurationControllerWeak); if (xCC.is()) xCC->removeResourceFactoryForReference(this); } @@ -158,7 +159,7 @@ BasicPaneFactory::~BasicPaneFactory() void BasicPaneFactory::disposing(std::unique_lock&) { -Reference xCC (mxConfigurationControllerWeak); +rtl::Reference xCC (mxConfigurationControllerWeak); if (xCC.is()) { xCC->removeResourceFactoryForReference(this); @@ -310,7 +311,7 @@ void SAL_CALL BasicPaneFactory::notifyConfigurationChange ( void SAL_CALL BasicPaneFactory::disposing ( const lang::EventObject& rEventObject) { -if (mxConfigurationControllerWeak.get() == rEventObject.Source) +if (uno::Reference(cppu::getXWeak(mxConfigurationControllerWeak.get().get())) == rEventObject.Source) { mxConfigurationControllerWeak.clear(); } diff --git a/sd/source/ui/inc/framework/factories/BasicPaneFactory.hxx b/sd/source/ui/inc/framework/factories/BasicPaneFactory.hxx index 57395f196bf4..ef97cff00984 100644 --- a/sd/source/ui/inc/framework/factories/BasicPaneFactory.hxx +++ b/sd/source/ui/inc/framework/factories/BasicPaneFactory.hxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -37,6 +37,7 @@ class ViewShellBase; } namespace sd::framework { +class ConfigurationController; typedef comphelper::WeakComponentImplHelper < css::drawing::framework::XResourceFactory, @@ -85,7 +86,7 @@ public: private: css::uno::Reference mxComponentContext; -css::uno::WeakReference +unotools::WeakReference mxConfigurationControllerWeak; ViewShellBase* mpViewShellBase; class PaneDescriptor; commit ff632abcc3e907304c31c5bd8bbd7c7d4e38d2ab Author: Noel Grandin AuthorDate: Wed Sep 18 11:49:00 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 18 21:33:19 2024 +0200 use more concrete UNO types in sd Change-Id: I1176da07dae2ac510ac4acf310ce3e4d499573d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173607 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index da857eebaef3..02f1ee19ceb7 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -52,6 +53,12 @@ namespace com::sun::star::presentation { class XPresentation; } class SdDrawDocument; class SdPage; class SvxItemPropertySet; +class SdUnoForbiddenCharsTable; +class SdDrawPagesAccess; +class SdMasterPagesAccess; +class SdLayerManager; +class SdXCustomPresentationAccess; +class SdDocLinkTargets; namespace sd { class DrawDocShell; @@ -96,12 +103,12 @@ private: const bool mbImpressDoc; bool mbClipBoard; -css::uno::WeakReference< css::drawing::XDrawPages > mxDrawPagesAccess; -css::uno::WeakReference< css::drawing::XDrawPages > mxMasterPagesAccess; -css::uno::WeakReference< css::container
core.git: 2 commits - sd/source
sd/source/ui/inc/DrawController.hxx |2 + sd/source/ui/tools/EventMultiplexer.cxx | 24 ++- sd/source/ui/unoidl/DrawController.cxx |8 + sd/source/ui/unoidl/unolayer.cxx| 50 +--- sd/source/ui/unoidl/unolayer.hxx|2 - sd/source/ui/unoidl/unowcntr.cxx| 25 sd/source/ui/unoidl/unowcntr.hxx| 14 7 files changed, 49 insertions(+), 76 deletions(-) New commits: commit 77a58b5f7c85e8036606791ee6fe2fb763eaab0d Author: Noel Grandin AuthorDate: Wed Sep 18 11:08:14 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 18 21:33:11 2024 +0200 use more concrete UNO types in sd Change-Id: I07e1db5a771c0a2391afbd715c91ea5919e19ac0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173606 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sd/source/ui/inc/DrawController.hxx b/sd/source/ui/inc/DrawController.hxx index c935888fa92c..f856df0d00b2 100644 --- a/sd/source/ui/inc/DrawController.hxx +++ b/sd/source/ui/inc/DrawController.hxx @@ -223,6 +223,8 @@ public: virtual css::uno::Reference SAL_CALL getModuleController() override; +rtl::Reference getConfigurationControllerImpl(); + private: /** This method must return the name to index table. This table contains all property names and types of this object. diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx index 5e20b9cc1f33..20f3b6e5e518 100644 --- a/sd/source/ui/tools/EventMultiplexer.cxx +++ b/sd/source/ui/tools/EventMultiplexer.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -122,7 +123,7 @@ private: css::uno::WeakReference mxControllerWeak; css::uno::WeakReference mxFrameWeak; SdDrawDocument* mpDocument; -css::uno::WeakReference +unotools::WeakReference mxConfigurationControllerWeak; void ReleaseListeners(); @@ -214,15 +215,13 @@ EventMultiplexer::Implementation::Implementation (ViewShellBase& rBase) // Listen for configuration changes. DrawController& rDrawController = *mrBase.GetDrawController(); -Reference xConfigurationController ( -rDrawController.getConfigurationController()); -mxConfigurationControllerWeak = xConfigurationController; +rtl::Reference xConfigurationController ( +rDrawController.getConfigurationControllerImpl()); +mxConfigurationControllerWeak = xConfigurationController.get(); if (!xConfigurationController.is()) return; -Reference xComponent (xConfigurationController, UNO_QUERY); -if (xComponent.is()) - xComponent->addEventListener(static_cast(this)); + xConfigurationController->addEventListener(static_cast(this)); xConfigurationController->addConfigurationChangeListener( this, @@ -268,13 +267,10 @@ void EventMultiplexer::Implementation::ReleaseListeners() } // Stop listening for configuration changes. -Reference xConfigurationController (mxConfigurationControllerWeak); +rtl::Reference xConfigurationController (mxConfigurationControllerWeak.get()); if (xConfigurationController.is()) { -Reference xComponent (xConfigurationController, UNO_QUERY); -if (xComponent.is()) - xComponent->removeEventListener(static_cast(this)); - + xConfigurationController->removeEventListener(static_cast(this)); xConfigurationController->removeConfigurationChangeListener(this); } } @@ -418,10 +414,10 @@ void SAL_CALL EventMultiplexer::Implementation::disposing ( } } -Reference xConfigurationController ( +rtl::Reference xConfigurationController ( mxConfigurationControllerWeak); if (xConfigurationController.is() -&& rEventObject.Source == xConfigurationController) +&& rEventObject.Source == cppu::getXWeak(xConfigurationController.get())) { mxConfigurationControllerWeak.clear(); } diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index 813b07477076..d35578616777 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -561,6 +561,14 @@ Reference SAL_CALL return mxConfigurationController; } +rtl::Reference +DrawController::getConfigurationControllerImpl() +{ +ThrowIfDisposed(); + +return mxConfigurationController; +} + Reference SAL_CALL DrawController::getModuleController() { commit 20c7dd09f2485838a0d230efe0a1c36d5b22723f Author: Noel Grandin AuthorDate: Wed Sep 18 11:01:11 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 18 21:33:03 2024 +0200 use more concrete UNO types in sd Change-Id: I01e30ca54b909da84c3bf535842d2c2283c31451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173605 Reviewe
core.git: basctl/source basic/source
basctl/source/basicide/basidesh.cxx | 14 ++ basctl/source/inc/basidesh.hxx |3 ++- basctl/source/inc/dlgedobj.hxx |8 basic/source/basmgr/basmgr.cxx |2 +- 4 files changed, 13 insertions(+), 14 deletions(-) New commits: commit f48c9d59cc1799d7eb1523af9e3b2df147676d22 Author: Noel Grandin AuthorDate: Wed Sep 18 08:20:19 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 18 15:02:58 2024 +0200 use more concrete UNO in basic Change-Id: I6606008d9b45e00295cf441a7321a677d62317f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173581 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 4cff365345f7..ef3e89a78f8f 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -262,8 +262,8 @@ Shell::~Shell() aWindowTable.clear(); // Destroy all ContainerListeners for Basic Container. -if (ContainerListenerImpl* pListener = static_cast(m_xLibListener.get())) -pListener->removeContainerListener(m_aCurDocument, m_aCurLibName); +if (m_xLibListener) +m_xLibListener->removeContainerListener(m_aCurDocument, m_aCurLibName); GetExtraData()->ShellInCriticalSection() = false; @@ -940,16 +940,14 @@ void Shell::SetCurLib( const ScriptDocument& rDocument, const OUString& aLibName if ( bCheck && rDocument == m_aCurDocument && aLibName == m_aCurLibName ) return; -ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() ); - -if (pListener) -pListener->removeContainerListener(m_aCurDocument, m_aCurLibName); +if (m_xLibListener) +m_xLibListener->removeContainerListener(m_aCurDocument, m_aCurLibName); m_aCurDocument = rDocument; m_aCurLibName = aLibName; -if ( pListener ) -pListener->addContainerListener( m_aCurDocument, aLibName ); +if ( m_xLibListener ) +m_xLibListener->addContainerListener( m_aCurDocument, aLibName ); if ( bUpdateWindows ) UpdateWindows(); diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx index 8b0aaea0c7c5..3bf3abaa1a05 100644 --- a/basctl/source/inc/basidesh.hxx +++ b/basctl/source/inc/basidesh.hxx @@ -55,6 +55,7 @@ class TabBar; class BaseWindow; class LocalizationMgr; class BasicColorConfig; +class ContainerListenerImpl; class Shell : public SfxViewShell, @@ -98,7 +99,7 @@ private: DocumentEventNotifier m_aNotifier; friend class ContainerListenerImpl; -css::uno::Reference< css::container::XContainerListener > m_xLibListener; +rtl::Reference m_xLibListener; std::unique_ptr mpSearchItem; voidInit(); diff --git a/basctl/source/inc/dlgedobj.hxx b/basctl/source/inc/dlgedobj.hxx index a8c249adec16..7e9e396668b7 100644 --- a/basctl/source/inc/dlgedobj.hxx +++ b/basctl/source/inc/dlgedobj.hxx @@ -33,10 +33,10 @@ namespace basctl typedef std::multimap< sal_Int16, OUString > IndexToNameMap; - class DlgEdForm; class DlgEditor; - +class DlgEdEvtContListenerImpl; +class DlgEdPropListenerImpl; // DlgEdObj @@ -51,8 +51,8 @@ class DlgEdObj: public SdrUnoObj private: boolbIsListening; rtl::Reference pDlgEdForm; -css::uno::Reference< css::beans::XPropertyChangeListener> m_xPropertyChangeListener; -css::uno::Reference< css::container::XContainerListener> m_xContainerListener; +rtl::Reference m_xPropertyChangeListener; +rtl::Reference m_xContainerListener; private: DlgEditor& GetDialogEditor (); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 985f66e0f3f2..17e5d1760bbc 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -2045,7 +2045,7 @@ typedef WeakImplHelper< script::XStarBasicAccess > StarBasicAccessHelper; class StarBasicAccess_Impl : public StarBasicAccessHelper { BasicManager* mpMgr; -uno::Reference< container::XNameContainer > mxLibContainer; +rtl::Reference< LibraryContainer_Impl > mxLibContainer; public: explicit StarBasicAccess_Impl( BasicManager* pMgr )
core.git: extensions/source
extensions/source/propctrlr/taborder.cxx |4 ++-- extensions/source/propctrlr/taborder.hxx |4 +++- extensions/source/scanner/scanunx.cxx|2 +- 3 files changed, 6 insertions(+), 4 deletions(-) New commits: commit 7f445e42b6148c37c9de9180d1f192f585061479 Author: Noel Grandin AuthorDate: Wed Sep 18 08:20:31 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 18 12:40:04 2024 +0200 use more concrete UNO in extensions Change-Id: I67215b2b5ae03cf3c93915a7590b645914b505de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173582 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx index 358b2818fc12..42a375c70238 100644 --- a/extensions/source/propctrlr/taborder.cxx +++ b/extensions/source/propctrlr/taborder.cxx @@ -79,6 +79,8 @@ namespace pcr return sImageId; } +} + //= OSimpleTabModel class OSimpleTabModel : public ::cppu::WeakImplHelper< XTabControllerModel> @@ -102,8 +104,6 @@ namespace pcr virtual void SAL_CALL setGroupControl(sal_Bool /*GroupControl*/) override {}; }; -} - //= TabOrderDialog TabOrderDialog::TabOrderDialog(weld::Window* _pParent, const Reference< XTabControllerModel >& _rxTabModel, const Reference< XControlContainer >& _rxControlCont, const Reference< XComponentContext >& _rxORB) diff --git a/extensions/source/propctrlr/taborder.hxx b/extensions/source/propctrlr/taborder.hxx index e43f010e8282..e512cf8e9a90 100644 --- a/extensions/source/propctrlr/taborder.hxx +++ b/extensions/source/propctrlr/taborder.hxx @@ -27,10 +27,12 @@ namespace pcr { +class OSimpleTabModel; + //= TabOrderDialog class TabOrderDialog : public weld::GenericDialogController { -css::uno::Reference< css::awt::XTabControllerModel > +rtl::Reference< OSimpleTabModel > m_xTempModel; css::uno::Reference< css::awt::XTabControllerModel > m_xModel; diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx index c2bbca99c982..f3402d33804b 100644 --- a/extensions/source/scanner/scanunx.cxx +++ b/extensions/source/scanner/scanunx.cxx @@ -83,7 +83,7 @@ namespace { struct SaneHolder { Sanem_aSane; -Reference< css::awt::XBitmap > m_xBitmap; +rtl::Reference< BitmapTransporter > m_xBitmap; osl::Mutex m_aProtector; ScanError m_nError; boolm_bBusy;
core.git: sw/inc sw/source
sw/inc/doc.hxx |3 +++ sw/source/core/bastyp/init.cxx |2 +- sw/source/core/doc/doc.cxx | 21 + sw/source/filter/ww8/rtfexport.cxx | 21 - 4 files changed, 41 insertions(+), 6 deletions(-) New commits: commit b6a5cdc0f753c8ed6ed080f9189ac2e2601dce9d Author: Noel Grandin AuthorDate: Tue Sep 17 20:19:06 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 18 09:24:18 2024 +0200 dont use GetItemSurrogates for gathering SvxBrushItem which is very expensive these days Change-Id: I010d174fbd256da0b220e13cbc50d9b4d8c6b1bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173576 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 9b6e56db50d9..1f5ec0e53094 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1449,6 +1449,9 @@ public: /// Iterate over all RES_CHRATR_UNDERLINE SvxUnderlineItem, if the function returns false, iteration is stopped SW_DLLPUBLIC void ForEachCharacterUnderlineItem(const std::function& ) const; +/// Iterate over all RES_CHRATR_BACKGROUND SvxBrushItem, if the function returns false, iteration is stopped +SW_DLLPUBLIC void ForEachCharacterBrushItem(const std::function& ) const; + // Call into intransparent Basic; expect possible Return String. void ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ); diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index daca2f32d7c4..0920842909e4 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -297,7 +297,7 @@ ItemInfoPackage& getItemInfoPackageSwAttributes() { RES_CHRATR_BLINK, new SvxBlinkItem( false, RES_CHRATR_BLINK ), SID_ATTR_FLASH, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_NOHYPHEN, new SvxNoHyphenItem( false, RES_CHRATR_NOHYPHEN ), 0, SFX_ITEMINFOFLAG_NONE }, { RES_CHRATR_UNUSED2, new SfxVoidItem( RES_CHRATR_UNUSED2 ), 0, SFX_ITEMINFOFLAG_NONE }, -{ RES_CHRATR_BACKGROUND, new SvxBrushItem( RES_CHRATR_BACKGROUND ), SID_ATTR_BRUSH_CHAR, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE }, +{ RES_CHRATR_BACKGROUND, new SvxBrushItem( RES_CHRATR_BACKGROUND ), SID_ATTR_BRUSH_CHAR, SFX_ITEMINFOFLAG_NONE }, // CJK-Attributes { RES_CHRATR_CJK_FONT, nullptr, SID_ATTR_CHAR_CJK_FONT, SFX_ITEMINFOFLAG_SUPPORT_SURROGATE }, diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index bc5ec45973eb..58bb026e1c7e 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1473,6 +1473,27 @@ void SwDoc::ForEachCharacterUnderlineItem( const std::function& rFunc ) const +{ +for(SwCharFormat* pFormat : *GetCharFormats()) +{ +const SwAttrSet& rAttrSet = pFormat->GetAttrSet(); +if (const SvxBrushItem* pItem = rAttrSet.GetItemIfSet(RES_CHRATR_BACKGROUND)) +if (!rFunc(*pItem)) +return; +} +std::vector> aStyles; +for (auto eFamily : { IStyleAccess::AUTO_STYLE_CHAR, IStyleAccess::AUTO_STYLE_RUBY, IStyleAccess::AUTO_STYLE_PARA, IStyleAccess::AUTO_STYLE_NOTXT }) +{ +const_cast(this)->GetIStyleAccess().getAllStyles(aStyles, eFamily); +for (const auto & rxItemSet : aStyles) +if (const SvxBrushItem* pItem = rxItemSet->GetItemIfSet(RES_CHRATR_BACKGROUND)) +if (!rFunc(*pItem)) +return; +} +} + void SwDoc::Summary(SwDoc& rExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress) { const SwOutlineNodes& rOutNds = GetNodes().GetOutLineNds(); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index ee490d562013..d7bbeb6bfb53 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -1346,18 +1346,16 @@ void RtfExport::OutColorTable() } // background color -static const sal_uInt16 aBrushIds[] = { RES_BACKGROUND, RES_CHRATR_BACKGROUND, 0 }; -for (const sal_uInt16* pIds = aBrushIds; *pIds; ++pIds) { -auto pBackground = static_cast(GetDfltAttr(*pIds)); +const SvxBrushItem* pBackground = GetDfltAttr(RES_BACKGROUND); InsColor(pBackground->GetColor()); -pBackground = static_cast(rPool.GetUserDefaultItem(*pIds)); +pBackground = rPool.GetUserDefaultItem(RES_BACKGROUND); if (pBackground) { InsColor(pBackground->GetColor()); } -rPool.GetItemSurrogates(aSurrogates, *pIds); +rPool.GetItemSurrogates(aSurrogates, RES_BACKGROUND); for (const SfxPoolItem* pItem : aSurrogates) { pBackground = static_cast(pItem); @@ -1367,6 +1365,19 @@ void RtfExport::OutColorTable() } } } +{ +const SvxBrushItem* pBackground = GetDfltAttr(RES_CHRAT
core.git: dbaccess/source
dbaccess/source/core/api/RowSet.cxx | 20 ++-- dbaccess/source/core/api/RowSet.hxx |5 +++-- 2 files changed, 13 insertions(+), 12 deletions(-) New commits: commit 26fd88df801c91117b8819e2a1afb898d2612eba Author: Noel Grandin AuthorDate: Tue Sep 17 19:20:51 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 18 08:06:55 2024 +0200 remove OSubComponent from RowSet which attempts to implement a very dodgy and almost but not actually thread-safe dispose function. Rather just hold a weak reference to the rowset that created us. Change-Id: I1881ac34320b61866eefc3641b455f618d0759d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173573 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 46c4984f7439..0b6e7c5a885a 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -2708,9 +2708,9 @@ void ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard) // *** ORowSetClone::ORowSetClone( const Reference& _rContext, ORowSet& rParent, ::osl::Mutex* _pMutex ) - :OSubComponent(m_aMutex, rParent) + : ::cppu::WeakComponentImplHelper<>(m_aMutex) ,ORowSetBase( _rContext, WeakComponentImplHelper::rBHelper, _pMutex ) - ,m_pParent(&rParent) + ,m_xParent(&rParent) ,m_nFetchDirection(rParent.m_nFetchDirection) ,m_nFetchSize(rParent.m_nFetchSize) ,m_bIsBookmarkable(true) @@ -2801,7 +2801,7 @@ ORowSetClone::~ORowSetClone() // css::XTypeProvider Sequence< Type > ORowSetClone::getTypes() { -return ::comphelper::concatSequences(OSubComponent::getTypes(),ORowSetBase::getTypes()); +return ::comphelper::concatSequences(::cppu::WeakComponentImplHelper<>::getTypes(),ORowSetBase::getTypes()); } // css::XInterface @@ -2809,18 +2809,18 @@ Any ORowSetClone::queryInterface( const Type & rType ) { Any aRet = ORowSetBase::queryInterface(rType); if(!aRet.hasValue()) -aRet = OSubComponent::queryInterface(rType); +aRet = ::cppu::WeakComponentImplHelper<>::queryInterface(rType); return aRet; } void ORowSetClone::acquire() noexcept { -OSubComponent::acquire(); +::cppu::WeakComponentImplHelper<>::acquire(); } void ORowSetClone::release() noexcept { -OSubComponent::release(); +::cppu::WeakComponentImplHelper<>::release(); } // XServiceInfo @@ -2845,9 +2845,9 @@ void ORowSetClone::disposing() MutexGuard aGuard( m_aMutex ); ORowSetBase::disposing(); -m_pParent = nullptr; +m_xParent = nullptr; m_pMutex= &m_aMutex; // this must be done here because someone could hold a ref to us and try to do something -OSubComponent::disposing(); +::cppu::WeakComponentImplHelper<>::disposing(); } // XCloseable @@ -2879,8 +2879,8 @@ void SAL_CALL ORowSetClone::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,c { if ( nHandle == PROPERTY_ID_FETCHSIZE ) { -if ( m_pParent ) -m_pParent->setFastPropertyValue_NoBroadcast( nHandle, rValue ); +if ( auto xParent = m_xParent.get() ) +xParent->setFastPropertyValue_NoBroadcast( nHandle, rValue ); } OPropertyStateContainer::setFastPropertyValue_NoBroadcast(nHandle,rValue); diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index 3cf6fe690193..92d9e53f7461 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -48,6 +48,7 @@ #include #include #include +#include namespace dbaccess { @@ -445,11 +446,11 @@ namespace dbaccess // ORowSetClone class ORowSetClone : public cppu::BaseMutex - ,public OSubComponent + ,public ::cppu::WeakComponentImplHelper<> ,public ORowSetBase ,public ::comphelper::OPropertyArrayUsageHelper < ORowSetClone > { -ORowSet*m_pParent; +unotools::WeakReference m_xParent; sal_Int32 m_nFetchDirection; sal_Int32 m_nFetchSize; boolm_bIsBookmarkable;
core.git: 2 commits - dbaccess/source include/vcl solenv/clang-format vcl/qa
dbaccess/source/core/api/preparedstatement.cxx |5 +++-- dbaccess/source/core/api/statement.cxx | 20 +++- dbaccess/source/core/dataaccess/connection.cxx |2 +- dbaccess/source/core/dataaccess/datasource.cxx |2 +- dbaccess/source/core/inc/callablestatement.hxx |2 +- dbaccess/source/core/inc/connection.hxx|8 dbaccess/source/core/inc/preparedstatement.hxx |2 +- dbaccess/source/core/inc/statement.hxx | 11 +++ include/vcl/BitmapAlphaClampFilter.hxx |3 +-- solenv/clang-format/excludelist|2 +- vcl/qa/cppunit/BitmapFilterTest.cxx| 19 +++ 11 files changed, 50 insertions(+), 26 deletions(-) New commits: commit f7354e18731ae41ab86584b04b0b23bee844f3dd Author: Noel Grandin AuthorDate: Tue Sep 17 14:29:32 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 18 08:06:47 2024 +0200 remove OSubComponent from OStatementBase which attempts to implement a very dodgy and almost but not actually thread-safe dispose function. Rather just hold a weak reference to the connection that created us. Change-Id: I01e4f5fc0a8aeb33adc14a2981ce09522a0306bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173572 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/dbaccess/source/core/api/preparedstatement.cxx b/dbaccess/source/core/api/preparedstatement.cxx index 3691477a5ebd..ecb1a4c1e348 100644 --- a/dbaccess/source/core/api/preparedstatement.cxx +++ b/dbaccess/source/core/api/preparedstatement.cxx @@ -31,6 +31,7 @@ #include #include "resultcolumn.hxx" #include "resultset.hxx" +#include #include using namespace ::com::sun::star::sdbc; @@ -42,7 +43,7 @@ using namespace ::osl; using namespace dbaccess; -OPreparedStatement::OPreparedStatement(const Reference< XConnection > & _xConn, +OPreparedStatement::OPreparedStatement(const rtl::Reference< OConnection > & _xConn, const Reference< XInterface > & _xStatement) :OStatementBase(_xConn, _xStatement) { @@ -220,7 +221,7 @@ sal_Bool OPreparedStatement::execute() Reference< XConnection > OPreparedStatement::getConnection() { -return Reference< XConnection > (m_xParent, UNO_QUERY); +return m_xParent.get(); } // XParameters diff --git a/dbaccess/source/core/api/statement.cxx b/dbaccess/source/core/api/statement.cxx index 3a6dfe2a490e..7166de42a233 100644 --- a/dbaccess/source/core/api/statement.cxx +++ b/dbaccess/source/core/api/statement.cxx @@ -31,6 +31,7 @@ #include #include #include +#include using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; @@ -43,10 +44,11 @@ using namespace dbaccess; using namespace dbtools; -OStatementBase::OStatementBase(const Reference< XConnection > & _xConn, +OStatementBase::OStatementBase(const rtl::Reference< OConnection > & _xConn, const Reference< XInterface > & _xStatement) -:OSubComponent(m_aMutex, _xConn) +:WeakComponentImplHelper(m_aMutex) ,OPropertySetHelper(WeakComponentImplHelper::rBHelper) +,m_xParent(_xConn.get()) ,m_bUseBookmarks( false ) ,m_bEscapeProcessing( true ) @@ -68,7 +70,7 @@ Sequence< Type > OStatementBase::getTypes() cppu::UnoType::get(), cppu::UnoType::get(), cppu::UnoType::get(), - OSubComponent::getTypes() ); + ::cppu::WeakComponentImplHelper<>::getTypes() ); Reference< XGeneratedResultSet > xGRes(m_xAggregateAsSet, UNO_QUERY); if ( xGRes.is() ) aTypes = OTypeCollection(cppu::UnoType::get(),aTypes.getTypes()); @@ -82,7 +84,7 @@ Sequence< Type > OStatementBase::getTypes() // css::uno::XInterface Any OStatementBase::queryInterface( const Type & rType ) { -Any aIface = OSubComponent::queryInterface( rType ); +Any aIface = ::cppu::WeakComponentImplHelper<>::queryInterface( rType ); if (!aIface.hasValue()) { aIface = ::cppu::queryInterface( @@ -110,12 +112,12 @@ Any OStatementBase::queryInterface( const Type & rType ) void OStatementBase::acquire() noexcept { -OSubComponent::acquire(); +::cppu::WeakComponentImplHelper<>::acquire(); } void OStatementBase::release() noexcept { -OSubComponent::release(); +::cppu::WeakComponentImplHelper<>::release(); } void OStatementBase::disposeResultSet() @@ -159,7 +161,7 @@ void OStatementBase::disposing() m_xAggregateAsSet = nullptr; // free the parent at last -OSubComponent::disposing(); +::cppu::WeakComponentImplHelper<>::disposing(); } // XCloseable @@ -419,7 +421,7 @@ Reference< XResultSet > SAL_CALL
core.git: sw/inc sw/qa sw/source
sw/inc/docsh.hxx |4 sw/inc/rdfhelper.hxx | 21 +-- sw/qa/extras/mailmerge/mailmerge2.cxx |5 sw/qa/extras/uiwriter/uiwriter.cxx|5 sw/source/core/access/AccessibilityCheck.cxx |9 - sw/source/core/doc/docedt.cxx |5 sw/source/core/doc/docnew.cxx | 12 +- sw/source/core/doc/rdfhelper.cxx | 49 sw/source/core/doc/textboxhelper.cxx |5 sw/source/core/draw/dpage.cxx |6 - sw/source/core/edit/edfcol.cxx| 105 -- sw/source/core/edit/edlingu.cxx |5 sw/source/core/text/itrform2.cxx |5 sw/source/core/text/porlay.cxx|7 - sw/source/core/txtnode/thints.cxx |3 sw/source/core/unocore/unoframe.cxx |7 - sw/source/core/unocore/unoidx.cxx |8 - sw/source/core/unocore/unoobj2.cxx|7 - sw/source/core/unocore/unostyle.cxx |6 - sw/source/filter/html/htmlform.cxx|7 - sw/source/filter/html/htmlforw.cxx|4 sw/source/filter/html/htmlgrin.cxx|5 sw/source/filter/ww8/docxattributeoutput.cxx |5 sw/source/filter/ww8/docxexport.cxx | 13 +- sw/source/filter/ww8/docxexportfilter.cxx |4 sw/source/filter/ww8/docxtablestyleexport.cxx |4 sw/source/filter/ww8/ww8par.cxx | 10 - sw/source/ui/dbui/mmresultdialogs.cxx |9 - sw/source/ui/frmdlg/cption.cxx| 15 +- sw/source/ui/misc/bookmark.cxx|6 - sw/source/uibase/app/applab.cxx |5 sw/source/uibase/app/docsh.cxx|6 + sw/source/uibase/app/docsh2.cxx |5 sw/source/uibase/app/docshini.cxx | 16 +- sw/source/uibase/shells/textsh1.cxx |3 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 13 -- sw/source/uibase/uno/unomailmerge.cxx |2 sw/source/uibase/utlui/content.cxx| 49 +++- 38 files changed, 221 insertions(+), 234 deletions(-) New commits: commit c69ad797408fd93afec2c5ac47ba94eba5e4c81c Author: Noel Grandin AuthorDate: Tue Sep 17 11:37:15 2024 +0200 Commit: Noel Grandin CommitDate: Tue Sep 17 18:01:18 2024 +0200 use more concrete UNO types in sw Change-Id: I0f84ce7116441abb2359ee756c912ae663baa2fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173545 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index 3cbc43c98803..f29c4ed78134 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -53,6 +53,7 @@ class SwDocShell; class SwDrawModel; class SwViewShell; class SwDocStyleSheetPool; +class SwXTextDocument; namespace svt { class EmbeddedObjectRef; @@ -185,6 +186,9 @@ public: /// OLE 2.0-notification. DECL_DLLPRIVATE_LINK( Ole2ModifiedHdl, bool, void ); +/// Override SfxObjectShell::GetBaseModel and return a more accurate type +rtl::Reference GetBaseModel() const; + /// OLE-stuff. virtual void SetVisArea( const tools::Rectangle &rRect ) override; virtual tools::Rectangle GetVisArea( sal_uInt16 nAspect ) const override; diff --git a/sw/inc/rdfhelper.hxx b/sw/inc/rdfhelper.hxx index ee346c499fe2..164f99683495 100644 --- a/sw/inc/rdfhelper.hxx +++ b/sw/inc/rdfhelper.hxx @@ -12,6 +12,7 @@ #include +#include #include #include "swdllapi.h" @@ -20,7 +21,7 @@ #include class SwTextNode; - +class SwXTextDocument; namespace com::sun::star { namespace frame { class XModel; @@ -43,44 +44,44 @@ public: /// Gets all graph-names in RDF of a given type. static css::uno::Sequence> -getGraphNames(const css::uno::Reference& xModel, const OUString& rType); +getGraphNames(const rtl::Reference& xModel, const OUString& rType); /// Gets all (XResource, key, value) statements in RDF graphs given the graph-names. static std::map -getStatements(const css::uno::Reference& xModel, +getStatements(const rtl::Reference& xModel, const css::uno::Sequence>& rGraphNames, const css::uno::Reference& xSubject); /// Gets all (XResource, key, value) statements in RDF graphs of type rType. static std::map -getStatements(const css::uno::Reference& xModel, const OUString& rType, +getStatements(const rtl::Reference& xModel, const OUString& rType, const css:
core.git: unoxml/source
unoxml/source/rdf/librdf_repository.cxx | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) New commits: commit c8de7794d048b5e7e977370b6d1345e5a36d4878 Author: Noel Grandin AuthorDate: Fri Sep 13 15:19:37 2024 +0200 Commit: Noel Grandin CommitDate: Fri Sep 13 20:58:54 2024 +0200 use more concrete UNO type in librdf_NamedGraph Change-Id: I97b8965bc73923c35aa086e10bfef081a263de58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173339 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index af7cab516474..09b4a9cac17a 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -59,7 +59,7 @@ #include #include #include -#include +#include #include #include @@ -698,7 +698,6 @@ public: librdf_NamedGraph(librdf_Repository * i_pRep, uno::Reference i_xName) : m_wRep(i_pRep) -, m_pRep(i_pRep) , m_xName(std::move(i_xName)) { }; @@ -736,8 +735,7 @@ private: const uno::Reference< rdf::XNode > & i_xObject); /// weak reference: this is needed to check if m_pRep is valid -uno::WeakReference< rdf::XRepository > const m_wRep; -librdf_Repository *const m_pRep; +unotools::WeakReference< librdf_Repository > const m_wRep; uno::Reference< rdf::XURI > const m_xName; /// Querying is rather slow, so cache the results. @@ -771,14 +769,14 @@ uno::Reference< rdf::XURI > SAL_CALL librdf_NamedGraph::getName() void SAL_CALL librdf_NamedGraph::clear() { -uno::Reference< rdf::XRepository > xRep( m_wRep ); +rtl::Reference< librdf_Repository > xRep( m_wRep ); if (!xRep.is()) { throw rdf::RepositoryException( u"librdf_NamedGraph::clear: repository is gone"_ustr, *this); } const OUString contextU( m_xName->getStringValue() ); try { -m_pRep->clearGraph_NoLock(contextU); +xRep->clearGraph_NoLock(contextU); } catch (lang::IllegalArgumentException & ex) { css::uno::Any anyEx = cppu::getCaughtException(); throw lang::WrappedTargetRuntimeException( ex.Message, @@ -793,7 +791,7 @@ void SAL_CALL librdf_NamedGraph::addStatement( const uno::Reference< rdf::XURI > & i_xPredicate, const uno::Reference< rdf::XNode > & i_xObject) { -uno::Reference< rdf::XRepository > xRep( m_wRep ); +rtl::Reference< librdf_Repository > xRep( m_wRep ); if (!xRep.is()) { throw rdf::RepositoryException( u"librdf_NamedGraph::addStatement: repository is gone"_ustr, *this); @@ -802,7 +800,7 @@ void SAL_CALL librdf_NamedGraph::addStatement( std::unique_lock g(m_CacheMutex); m_aStatementsCache.clear(); } -m_pRep->addStatementGraph_NoLock( +xRep->addStatementGraph_NoLock( i_xSubject, i_xPredicate, i_xObject, m_xName); } @@ -811,7 +809,7 @@ void SAL_CALL librdf_NamedGraph::removeStatements( const uno::Reference< rdf::XURI > & i_xPredicate, const uno::Reference< rdf::XNode > & i_xObject) { -uno::Reference< rdf::XRepository > xRep( m_wRep ); +rtl::Reference< librdf_Repository > xRep( m_wRep ); if (!xRep.is()) { throw rdf::RepositoryException( u"librdf_NamedGraph::removeStatements: repository is gone"_ustr, *this); @@ -820,7 +818,7 @@ void SAL_CALL librdf_NamedGraph::removeStatements( std::unique_lock g(m_CacheMutex); m_aStatementsCache.clear(); } -m_pRep->removeStatementsGraph_NoLock( +xRep->removeStatementsGraph_NoLock( i_xSubject, i_xPredicate, i_xObject, m_xName); } @@ -853,12 +851,12 @@ librdf_NamedGraph::getStatements( } } -uno::Reference< rdf::XRepository > xRep( m_wRep ); +rtl::Reference< librdf_Repository > xRep( m_wRep ); if (!xRep.is()) { throw rdf::RepositoryException( u"librdf_NamedGraph::getStatements: repository is gone"_ustr, *this); } -std::vector vStatements = m_pRep->getStatementsGraph_NoLock( +std::vector vStatements = xRep->getStatementsGraph_NoLock( i_xSubject, i_xPredicate, i_xObject, m_xName); {
core.git: chart2/source include/comphelper include/svx
chart2/source/controller/chartapiwrapper/AxisWrapper.hxx | 10 +- chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | 12 ++- chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 10 +- chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx | 37 +++--- chart2/source/controller/chartapiwrapper/TitleWrapper.hxx |2 chart2/source/controller/inc/ChartDocumentWrapper.hxx |9 +- chart2/source/view/diagram/VDiagram.cxx |5 - chart2/source/view/inc/VDiagram.hxx |2 include/comphelper/types.hxx | 10 ++ include/svx/unoshape.hxx |3 10 files changed, 54 insertions(+), 46 deletions(-) New commits: commit 451a66438a58505d2e89e76c7559a9dac1bbc00e Author: Noel Grandin AuthorDate: Fri Sep 13 11:16:12 2024 +0200 Commit: Noel Grandin CommitDate: Fri Sep 13 18:51:41 2024 +0200 use more concrete UNO types in chart2 Change-Id: Id2d58ad76b6e8ff569bd7b65f86a7fdd0152f3d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173324 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx index e70c85b23ff8..3b63c45c100d 100644 --- a/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx +++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.hxx @@ -27,7 +27,7 @@ #include #include #include - +#include #include namespace com::sun::star::chart2 { class XAxis; } @@ -35,6 +35,8 @@ namespace com::sun::star::chart2 { class XAxis; } namespace chart::wrapper { class Chart2ModelContact; +class TitleWrapper; +class GridWrapper; class AxisWrapper : public ::cppu::ImplInheritanceHelper< WrappedPropertySet @@ -113,9 +115,9 @@ private: //member tAxisType m_eType; -css::uno::Reference< css::beans::XPropertySet > m_xAxisTitle; -css::uno::Reference< css::beans::XPropertySet > m_xMajorGrid; -css::uno::Reference< css::beans::XPropertySet > m_xMinorGrid; +rtl::Reference< TitleWrapper > m_xAxisTitle; +rtl::Reference< GridWrapper > m_xMajorGrid; +rtl::Reference< GridWrapper > m_xMinorGrid; }; } // namespace chart::wrapper diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index f7825b714855..ab6de48e0fe1 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -858,7 +858,11 @@ void SAL_CALL ChartDocumentWrapper::dispose() try { Reference< lang::XComponent > xFormerDelegator( m_xDelegator, uno::UNO_QUERY ); -DisposeHelper::DisposeAndClear( m_xTitle ); +if (m_xTitle) +{ +m_xTitle->dispose(); +m_xTitle.clear(); +} DisposeHelper::DisposeAndClear( m_xSubTitle ); DisposeHelper::DisposeAndClear( m_xLegend ); DisposeHelper::DisposeAndClear( m_xChartData ); @@ -1344,11 +1348,11 @@ uno::Any SAL_CALL ChartDocumentWrapper::queryAggregation( const uno::Type& rType // ::utl::OEventListenerAdapter void ChartDocumentWrapper::_disposing( const lang::EventObject& rSource ) { -if( rSource.Source == m_xTitle ) +if( rSource.Source == cppu::getXWeak(m_xTitle.get()) ) m_xTitle.clear(); -else if( rSource.Source == m_xSubTitle ) +else if( rSource.Source == cppu::getXWeak(m_xSubTitle.get()) ) m_xSubTitle.clear(); -else if( rSource.Source == m_xLegend ) +else if( rSource.Source == cppu::getXWeak(m_xLegend.get()) ) m_xLegend.clear(); else if( rSource.Source == m_xChartData ) m_xChartData.clear(); diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index 1b9da6491134..12b7e1b11c7b 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -887,7 +887,7 @@ Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getZAxis() { if( ! m_xZAxis.is()) m_xZAxis = new AxisWrapper( AxisWrapper::Z_AXIS, m_spChart2ModelContact ); -return Reference< beans::XPropertySet >( m_xZAxis, uno::UNO_QUERY ); +return m_xZAxis; } // XTwoAxisXSupplier @@ -895,7 +895,7 @@ Reference< beans::XPropertySet > SAL_CALL DiagramWrapper::getSecondaryXAxis() { if( ! m_xSecondXAxis.is()) m_xSecondXAxis = new AxisWrapper( AxisWrapper::SECOND_X_AXIS, m_spChart2ModelContact ); -return Reference< beans::XPropertySet >( m_xSecondXAxis, uno
core.git: dbaccess/source
dbaccess/source/core/api/KeySet.cxx|8 dbaccess/source/core/api/KeySet.hxx|4 +++- dbaccess/source/core/api/OptimisticSet.cxx |3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) New commits: commit dff484283dcd562f60840fb9800800187c013b87 Author: Noel Grandin AuthorDate: Thu Sep 12 19:41:16 2024 +0200 Commit: Noel Grandin CommitDate: Fri Sep 13 12:45:54 2024 +0200 use more concrete UNO types in dbaccess Change-Id: I017d4fd7131735dfd2dba6e1b046fbe691522745 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173280 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 511338e30d9b..f931adbab02f 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -311,7 +311,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet, const OUStrin // the first row is empty because it's now easier for us to distinguish when we are beforefirst or first // without extra variable to be set -OKeySetValue keySetValue{nullptr,0,Reference()}; +OKeySetValue keySetValue{nullptr,0,nullptr}; m_aKeyMap.emplace(0, keySetValue); m_aKeyIter = m_aKeyMap.begin(); } @@ -321,7 +321,7 @@ void OKeySet::reset(const Reference< XResultSet>& _xDriverSet) OCacheSet::construct(_xDriverSet, m_sRowSetFilter); m_bRowCountFinal = false; m_aKeyMap.clear(); -OKeySetValue keySetValue{nullptr,0,Reference()}; +OKeySetValue keySetValue{nullptr,0,nullptr}; m_aKeyMap.emplace(0,keySetValue); m_aKeyIter = m_aKeyMap.begin(); } @@ -752,7 +752,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const OUString& i_sSQ ORowSetRow aKeyRow = new connectivity::ORowVector< ORowSetValue >(m_pKeyColumnNames->size()); copyRowValue(_rInsertRow,aKeyRow,aKeyIter->first + 1); -m_aKeyIter = m_aKeyMap.emplace( aKeyIter->first + 1, OKeySetValue{aKeyRow,1,Reference()} ).first; +m_aKeyIter = m_aKeyMap.emplace( aKeyIter->first + 1, OKeySetValue{aKeyRow,1,nullptr} ).first; // now we set the bookmark for this row (*_rInsertRow)[0] = Any(static_cast(m_aKeyIter->first)); tryRefetch(_rInsertRow,bRefetch); @@ -1197,7 +1197,7 @@ bool OKeySet::fetchRow() aIter->fill(rColDesc.nPosition, rColDesc.nType, m_xRow); ++aIter; } -m_aKeyIter = m_aKeyMap.emplace( m_aKeyMap.rbegin()->first+1,OKeySetValue{aKeyRow,0,Reference()} ).first; +m_aKeyIter = m_aKeyMap.emplace( m_aKeyMap.rbegin()->first+1,OKeySetValue{aKeyRow,0,nullptr} ).first; } else m_bRowCountFinal = true; diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index c5b78811a814..37cde22d7e32 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -32,6 +32,8 @@ namespace dbaccess { +class OPrivateRow; + struct SelectColumnDescription { OUString sRealName; // may be empty @@ -72,7 +74,7 @@ namespace dbaccess { ORowSetRow m_aRowSetRow; sal_Int32 m_nUpdateInsert; -css::uno::Reference< css::sdbc::XRow> m_xRow; +rtl::Reference m_xRow; }; typedef std::map OKeySetMatrix; typedef std::map > OUpdatedParameter; diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index e77560d41386..a74ec45e41d7 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -36,6 +36,7 @@ #include #include #include +#include "PrivateRow.hxx" using namespace dbaccess; using namespace ::connectivity; @@ -105,7 +106,7 @@ void OptimisticSet::construct(const Reference< XResultSet>& _xDriverSet,const OU // the first row is empty because it's now easier for us to distinguish when we are beforefirst or first // without extra variable to be set -OKeySetValue keySetValue{nullptr,0,Reference()}; +OKeySetValue keySetValue{nullptr,0,nullptr}; m_aKeyMap.emplace(0,keySetValue); m_aKeyIter = m_aKeyMap.begin();
core.git: Branch 'distro/collabora/co-24.04' - include/svx sd/source svx/source
include/svx/svdmodel.hxx |8 +++--- sd/source/filter/pdf/sdpdffilter.cxx |4 ++- svx/source/svdraw/svdmodel.cxx | 46 ++- 3 files changed, 31 insertions(+), 27 deletions(-) New commits: commit e4251f16e8659b02d36a9b44215970e77a67ead5 Author: Noel Grandin AuthorDate: Fri Sep 6 12:55:26 2024 +0200 Commit: Tomaž Vajngerl CommitDate: Fri Sep 13 11:20:41 2024 +0200 reduce time spent in RecalcPageNums when importing PDF when we have lots of pages, we trigger a O(n^2) loop. Do two things to reduce this (a) be smarter about recalculating page numbers, so we only recalculate the set of page numbers that need recalculating (b) duplicate the last page repeatedly, instead of the first page, so we don't recalculate all the page numbers for each page we duplicate Change-Id: I40aca812b47a9551039c5855b1c8d26f5f171f41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172950 Reviewed-by: Michael Meeks Tested-by: Jenkins CollaboraOffice Reviewed-by: Tomaž Vajngerl diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index 68565e264bc3..f037baf6fcc4 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -199,12 +199,12 @@ protected: std::deque> m_aRedoStack; std::unique_ptr m_pCurrentUndoGroup; // For multi-level sal_uInt16 m_nUndoLevel; // undo nesting +sal_uInt16 m_nPageNumsDirtyFrom = SAL_MAX_UINT16; +sal_uInt16 m_nMasterPageNumsDirtyFrom = SAL_MAX_UINT16; boolm_bIsWriter:1;// to clean up pMyPool from 303a boolm_bThemedControls:1; // If false UnoControls should not use theme colors boolmbUndoEnabled:1; // If false no undo is recorded or we are during the execution of an undo action boolmbChanged:1; -boolm_bPagNumsDirty:1; -boolm_bMPgNumsDirty:1; boolm_bTransportContainer:1; // doc is temporary object container, no display (e.g. clipboard) boolm_bReadOnly:1; boolm_bTransparentTextFrames:1; @@ -397,8 +397,8 @@ public: static OUString GetPercentString(const Fraction& rVal); // RecalcPageNums is ordinarily only called by the Page. -bool IsPagNumsDirty() const { return m_bPagNumsDirty; }; -bool IsMPgNumsDirty() const { return m_bMPgNumsDirty; }; +bool IsPagNumsDirty() const { return m_nPageNumsDirtyFrom != SAL_MAX_UINT16; } +bool IsMPgNumsDirty() const { return m_nMasterPageNumsDirtyFrom != SAL_MAX_UINT16; } void RecalcPageNums(bool bMaster); // After the Insert the Page belongs to the SdrModel. virtual void InsertPage(SdrPage* pPage, sal_uInt16 nPos=0x); diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index 9e6597ce..068aca1fcce9 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -65,9 +65,11 @@ bool SdPdfFilter::Import() // Add as many pages as we need up-front. mrDocument.CreateFirstPages(); +sal_uInt16 nPageToDuplicate = 0; for (size_t i = 0; i < aGraphics.size() - 1; ++i) { -mrDocument.DuplicatePage(0); +// duplicating the last page is cheaper than repeatedly duplicating the first one +nPageToDuplicate = mrDocument.DuplicatePage(nPageToDuplicate); } for (vcl::PDFGraphicResult const& rPDFGraphicResult : aGraphics) diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 46497f398944..8101e7ac0b96 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -133,8 +133,6 @@ SdrModel::SdrModel(SfxItemPool* pPool, comphelper::IEmbeddedHelper* pEmbeddedHel , m_bThemedControls(true) , mbUndoEnabled(true) , mbChanged(false) -, m_bPagNumsDirty(false) -, m_bMPgNumsDirty(false) , m_bTransportContainer(false) , m_bReadOnly(false) , m_bTransparentTextFrames(false) @@ -1176,23 +1174,27 @@ void SdrModel::RecalcPageNums(bool bMaster) { if(bMaster) { -sal_uInt16 nCount=sal_uInt16(maMasterPages.size()); -sal_uInt16 i; -for (i=0; iSetPageNum(i); +if (m_nMasterPageNumsDirtyFrom != SAL_MAX_UINT16) +{ +sal_uInt16 nCount=sal_uInt16(maMasterPages.size()); +for (sal_uInt16 i=m_nMasterPageNumsDirtyFrom; iSetPageNum(i); +} +m_nMasterPageNumsDirtyFrom = SAL_MAX_UINT16; } -m_bMPgNumsDirty=false; } else { -sal_uInt16 nCount=sal_uInt16(maPages.size()); -sal_uInt16 i; -for (i=0; iSetPageNum(i); +if (m
core.git: dbaccess/source
dbaccess/source/core/api/KeySet.cxx| 32 ++--- dbaccess/source/core/api/KeySet.hxx|7 +- dbaccess/source/core/api/OptimisticSet.cxx |2 - 3 files changed, 23 insertions(+), 18 deletions(-) New commits: commit 76c6436faa5e87132cc13be42ac4510baf1c9f8a Author: Noel Grandin AuthorDate: Thu Sep 12 19:38:11 2024 +0200 Commit: Noel Grandin CommitDate: Fri Sep 13 08:18:58 2024 +0200 convert OKeySetValue to a struct for better readability Change-Id: I9750668a31740bb1de0b6f024912d5cc73f7e766 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173279 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 9366c990c87e..511338e30d9b 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -245,7 +245,7 @@ void OKeySet::setOneKeyColumnParameter( sal_Int32 &nPos, const Reference< XParam OUStringBuffer OKeySet::createKeyFilter() { -connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aIter = m_aKeyIter->second.first->begin(); +connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aIter = m_aKeyIter->second.m_aRowSetRow->begin(); static const char aAnd[] = " AND "; const OUString aQuote= getIdentifierQuoteString(); @@ -311,7 +311,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet, const OUStrin // the first row is empty because it's now easier for us to distinguish when we are beforefirst or first // without extra variable to be set -OKeySetValue keySetValue(nullptr,std::pair >(0,Reference())); +OKeySetValue keySetValue{nullptr,0,Reference()}; m_aKeyMap.emplace(0, keySetValue); m_aKeyIter = m_aKeyMap.begin(); } @@ -321,7 +321,7 @@ void OKeySet::reset(const Reference< XResultSet>& _xDriverSet) OCacheSet::construct(_xDriverSet, m_sRowSetFilter); m_bRowCountFinal = false; m_aKeyMap.clear(); -OKeySetValue keySetValue(nullptr,std::pair >(0,Reference())); +OKeySetValue keySetValue{nullptr,0,Reference()}; m_aKeyMap.emplace(0,keySetValue); m_aKeyIter = m_aKeyMap.begin(); } @@ -331,8 +331,8 @@ void OKeySet::ensureStatement( ) // do we already have a statement for the current combination of NULLness // of key & foreign columns? std::vector FilterColumnsNULL; -FilterColumnsNULL.reserve(m_aKeyIter->second.first->size()); -for (auto const& elem : *m_aKeyIter->second.first) +FilterColumnsNULL.reserve(m_aKeyIter->second.m_aRowSetRow->size()); +for (auto const& elem : *m_aKeyIter->second.m_aRowSetRow) FilterColumnsNULL.push_back(elem.isNull()); vStatements_t::const_iterator pNewStatement(m_vStatements.find(FilterColumnsNULL)); if(pNewStatement == m_vStatements.end()) @@ -575,9 +575,9 @@ void OKeySet::executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rO const sal_Int32 nBookmark = ::comphelper::getINT32((*_rInsertRow)[0].getAny()); m_aKeyIter = m_aKeyMap.find(nBookmark); assert(m_aKeyIter != m_aKeyMap.end()); -m_aKeyIter->second.second.first = 2; -m_aKeyIter->second.second.second.clear(); -copyRowValue(_rInsertRow,m_aKeyIter->second.first,nBookmark); +m_aKeyIter->second.m_nUpdateInsert = 2; +m_aKeyIter->second.m_xRow.clear(); +copyRowValue(_rInsertRow, m_aKeyIter->second.m_aRowSetRow, nBookmark); tryRefetch(_rInsertRow,bRefetch); } } @@ -752,7 +752,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const OUString& i_sSQ ORowSetRow aKeyRow = new connectivity::ORowVector< ORowSetValue >(m_pKeyColumnNames->size()); copyRowValue(_rInsertRow,aKeyRow,aKeyIter->first + 1); -m_aKeyIter = m_aKeyMap.emplace( aKeyIter->first + 1, OKeySetValue(aKeyRow,std::pair >(1,Reference())) ).first; +m_aKeyIter = m_aKeyMap.emplace( aKeyIter->first + 1, OKeySetValue{aKeyRow,1,Reference()} ).first; // now we set the bookmark for this row (*_rInsertRow)[0] = Any(static_cast(m_aKeyIter->first)); tryRefetch(_rInsertRow,bRefetch); @@ -774,7 +774,7 @@ void OKeySet::tryRefetch(const ORowSetRow& _rInsertRow,bool bRefetch) } if ( !bRefetch ) { -m_aKeyIter->second.second.second = new OPrivateRow(std::vector(*_rInsertRow)); +m_aKeyIter->second.m_xRow = new OPrivateRow(std::vector(*_rInsertRow)); } } @@ -1102,7 +1102,7 @@ bool OKeySet::doTryRefetch_throw() } // now set the primary key column values -connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aIter = m_aKeyIter->second.first->begin(); +connectivity::ORowVector< OR
core.git: chart2/source
chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx | 18 -- chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx |5 ++ chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx |5 ++ chart2/source/controller/inc/ChartDocumentWrapper.hxx |3 + chart2/source/inc/DisposeHelper.hxx |9 + 5 files changed, 28 insertions(+), 12 deletions(-) New commits: commit f976823a66858d3ecc749544be50fdda0c8c40f6 Author: Noel Grandin AuthorDate: Thu Sep 12 15:39:44 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 12 19:28:23 2024 +0200 use more concrete UNO class in chart2 Change-Id: Ifbdcf39f6f621dc63746a8c389a19c52aab847b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173264 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index 7c832ed0d781..f7825b714855 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -709,20 +709,18 @@ Reference< XDiagram > SAL_CALL ChartDocumentWrapper::getDiagram() return m_xDiagram; } -void SAL_CALL ChartDocumentWrapper::setDiagram( const Reference< XDiagram >& xDiagram ) +void SAL_CALL ChartDocumentWrapper::setDiagram( const Reference< XDiagram >& _xDiagram ) { -uno::Reference< util::XRefreshable > xAddIn( xDiagram, uno::UNO_QUERY ); -if( xAddIn.is() ) -{ -setAddIn( xAddIn ); -} -else if( xDiagram.is() && xDiagram != m_xDiagram ) +if (!_xDiagram.is()) +return; +auto xDiagram = dynamic_cast(_xDiagram.get()); +assert(xDiagram); +if( xDiagram != m_xDiagram ) { // set new wrapped diagram at new chart. This requires the old // diagram given as parameter to implement the new interface. If // this is not possible throw an exception -Reference< chart2::XDiagramProvider > xNewDiaProvider( xDiagram, uno::UNO_QUERY_THROW ); -Reference< chart2::XDiagram > xNewDia( xNewDiaProvider->getDiagram()); +rtl::Reference< ::chart::Diagram > xNewDia( xDiagram->getUnderlyingDiagram()); try { @@ -1354,7 +1352,7 @@ void ChartDocumentWrapper::_disposing( const lang::EventObject& rSource ) m_xLegend.clear(); else if( rSource.Source == m_xChartData ) m_xChartData.clear(); -else if( rSource.Source == m_xDiagram ) +else if( rSource.Source == cppu::getXWeak(m_xDiagram.get()) ) m_xDiagram.clear(); else if( rSource.Source == m_xArea ) m_xArea.clear(); diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index 1623eecb2364..1b9da6491134 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -1845,6 +1845,11 @@ Reference< chart2::XDiagram > SAL_CALL DiagramWrapper::getDiagram() return m_spChart2ModelContact->getDiagram(); } +rtl::Reference< ::chart::Diagram > DiagramWrapper::getUnderlyingDiagram() +{ +return m_spChart2ModelContact->getDiagram(); +} + void SAL_CALL DiagramWrapper::setDiagram( const Reference< chart2::XDiagram >& /*xDiagram*/ ) { diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx index 3a3a8383de05..2e00c0941e58 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.hxx @@ -33,12 +33,13 @@ #include #include #include - #include +#include #include namespace com::sun::star::chart2 { class XDiagram; } namespace com::sun::star::lang { class XEventListener; } +namespace chart { class Diagram; } namespace chart::wrapper { @@ -178,6 +179,8 @@ public: virtual css::uno::Reference< css::chart2::XDiagram > SAL_CALL getDiagram() override; virtual void SAL_CALL setDiagram( const css::uno::Reference< css::chart2::XDiagram >& xDiagram ) override; +rtl::Reference< ::chart::Diagram > getUnderlyingDiagram(); + protected: // WrappedPropertySet virtual const css::uno::Sequence< css::beans::Property >& getPropertySequence() override; diff --git a/chart2/source/controller/inc/ChartDocumentWrapper.hxx b/chart2/source/controller/inc/ChartDocumentWrapper.hxx index a5bded3c8fb7..008296b6a358 100644 --- a/chart2/source/controller/inc/ChartDocumentWrapper.hxx +++ b/chart2/source/controller/inc/ChartDocumentWrapper.hxx @@ -37,6 +37,7 @@ namespace chart { class ChartView; } namespace chart::wrapper { +class Diagr
core.git: 2 commits - ucb/source xmloff/inc xmloff/source
ucb/source/core/ucbstore.hxx |3 ++- ucb/source/ucp/file/prov.cxx |2 +- ucb/source/ucp/file/prov.hxx |4 +++- xmloff/inc/XMLEmbeddedObjectImportContext.hxx |2 +- xmloff/source/core/XMLEmbeddedObjectImportContext.cxx |3 +-- xmloff/source/transform/FormPropOOoTContext.cxx |6 ++ xmloff/source/transform/FormPropOOoTContext.hxx |2 +- xmloff/source/transform/MergeElemTContext.cxx |3 +-- xmloff/source/transform/MergeElemTContext.hxx |3 ++- xmloff/source/transform/StyleOASISTContext.cxx| 17 - 10 files changed, 18 insertions(+), 27 deletions(-) New commits: commit 925b8da69413708249c6d3f08c86ce54faf4b2e3 Author: Noel Grandin AuthorDate: Thu Sep 12 16:38:24 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 12 19:28:06 2024 +0200 use more concrete UNO types in ucb Change-Id: I3f3c94c6aa320d9e2a7658f0ee7005ae25100fc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173269 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/ucb/source/core/ucbstore.hxx b/ucb/source/core/ucbstore.hxx index 63d240b5b983..791abdf33dec 100644 --- a/ucb/source/core/ucbstore.hxx +++ b/ucb/source/core/ucbstore.hxx @@ -38,6 +38,7 @@ #include #include +class PropertySetRegistry; using UcbStore_Base = comphelper::WeakComponentImplHelper < css::lang::XServiceInfo, @@ -48,7 +49,7 @@ class UcbStore : public UcbStore_Base { css::uno::Reference< css::uno::XComponentContext >m_xContext; css::uno::Sequence< css::uno::Any > m_aInitArgs; -css::uno::Reference< css::ucb::XPropertySetRegistry > m_xTheRegistry; +rtl::Reference< PropertySetRegistry > m_xTheRegistry; public: explicit UcbStore( const css::uno::Reference< css::uno::XComponentContext >& xContext ); diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index 4039c955897c..77e7772db7e2 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -193,7 +193,7 @@ FileProvider::createContentIdentifier( //XPropertySetInfoImpl -namespace { +namespace fileaccess { class XPropertySetInfoImpl2 : public cppu::OWeakObject, diff --git a/ucb/source/ucp/file/prov.hxx b/ucb/source/ucp/file/prov.hxx index 530010be1f4d..311c1be0e469 100644 --- a/ucb/source/ucp/file/prov.hxx +++ b/ucb/source/ucp/file/prov.hxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -39,6 +40,7 @@ namespace fileaccess { class BaseContent; class TaskManager; +class XPropertySetInfoImpl2; class FileProvider: public cppu::WeakImplHelper < css::lang::XServiceInfo, @@ -147,7 +149,7 @@ namespace fileaccess { OUString m_HomeDirectory; sal_Int32 m_FileSystemNotation; -css::uno::Reference< css::beans::XPropertySetInfo > m_xPropertySetInfo; +rtl::Reference< XPropertySetInfoImpl2 > m_xPropertySetInfo; std::unique_ptrm_pMyShell; }; commit 4000d57869fda437f0361dc4ac991858905a40e9 Author: Noel Grandin AuthorDate: Thu Sep 12 16:38:37 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 12 19:27:53 2024 +0200 use more concrete UNO types in xmloff Change-Id: Idf2bcf23497ef5d673ab36f776f562e8c964b3a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173270 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmloff/inc/XMLEmbeddedObjectImportContext.hxx b/xmloff/inc/XMLEmbeddedObjectImportContext.hxx index ca1ea2ac4dcb..557f61e5b664 100644 --- a/xmloff/inc/XMLEmbeddedObjectImportContext.hxx +++ b/xmloff/inc/XMLEmbeddedObjectImportContext.hxx @@ -26,7 +26,7 @@ namespace com::sun::star::lang { class XComponent; } class XMLEmbeddedObjectImportContext final : public SvXMLImportContext { -css::uno::Reference mxFastHandler; +rtl::Reference mxFastHandler; css::uno::Reference xComp; OUString sFilterService; diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx index 25b0522ab28f..126ef93d2428 100644 --- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx @@ -131,8 +131,7 @@ void XMLEmbeddedObjectImportContext::SetComponent( Reference< XComponent > const { } -Reference < XImporter > xImporter( mxFastHandler, UNO_QUERY ); -xImporter->setTargetDocument( rComp ); +mxFastHandler->setTargetDocument( rComp ); xComp = rComp; // keep ref to component only if there is a handler diff --git a/xmloff/source/transform/FormPropOOoTContext.cxx b/xmloff/source/transform/FormPropOOoTContext.cxx index 1f5c6086dbfa..5a2
core.git: include/unotools unotools/source
include/unotools/configitem.hxx |8 +--- include/unotools/streamwrap.hxx |6 +++--- unotools/source/config/configitem.cxx |3 +++ 3 files changed, 11 insertions(+), 6 deletions(-) New commits: commit d4c0bb0ce626fa24eddb886e3bf6444da292df25 Author: Noel Grandin AuthorDate: Thu Sep 12 10:19:34 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 12 16:21:59 2024 +0200 use more concrete UNO classes in unotools Change-Id: Iaf743ae040a3a7bd808bf3cac033197001c31b18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173250 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/include/unotools/configitem.hxx b/include/unotools/configitem.hxx index f04f2b057798..649c05fdbe28 100644 --- a/include/unotools/configitem.hxx +++ b/include/unotools/configitem.hxx @@ -21,6 +21,7 @@ #define INCLUDED_UNOTOOLS_CONFIGITEM_HXX #include +#include #include #include #include @@ -57,6 +58,7 @@ namespace o3tl namespace utl { +class ConfigChangeListener_Impl; enum class ConfigNameFormat { @@ -72,7 +74,7 @@ namespace utl const OUString sSubTree; css::uno::Reference< css::container::XHierarchicalNameAccess> m_xHierarchyAccess; -css::uno::Reference< css::util::XChangesListener > +rtl::Reference< ConfigChangeListener_Impl > xChangeLstnr; ConfigItemMode m_nMode; boolm_bIsModified; @@ -144,8 +146,8 @@ namespace utl public: virtual ~ConfigItem() override; -ConfigItem(ConfigItem const &) = default; -ConfigItem(ConfigItem &&) = default; +ConfigItem(ConfigItem const &); +ConfigItem(ConfigItem &&); ConfigItem & operator =(ConfigItem const &) = delete; // due to const sSubTree ConfigItem & operator =(ConfigItem &&) = delete; // due to const sSubTree diff --git a/include/unotools/streamwrap.hxx b/include/unotools/streamwrap.hxx index dfe0134086a0..a21d9e070995 100644 --- a/include/unotools/streamwrap.hxx +++ b/include/unotools/streamwrap.hxx @@ -104,14 +104,14 @@ class OOutputStreamWrapper : public cppu::WeakImplHelper public: UNOTOOLS_DLLPUBLIC OOutputStreamWrapper(SvStream& _rStream); -protected: -virtual ~OOutputStreamWrapper() override; - // css::io::XOutputStream virtual void SAL_CALL writeBytes(const css::uno::Sequence< sal_Int8 >& aData) override final; virtual void SAL_CALL flush() override final; virtual void SAL_CALL closeOutput() override final; +protected: +virtual ~OOutputStreamWrapper() override; + /// throws an exception according to the error flag of m_pSvStream void checkError() const; diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index a8e82ba7602a..b6c0b808dfd9 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -155,6 +155,9 @@ ConfigItem::ConfigItem(OUString aSubTree, ConfigItemMode nSetMode ) : m_xHierarchyAccess = ConfigManager::getConfigManager().addConfigItem(*this); } +ConfigItem::ConfigItem(ConfigItem const &) = default; +ConfigItem::ConfigItem(ConfigItem &&) = default; + ConfigItem::~ConfigItem() { suppress_fun_call_w_exception(RemoveChangesListener());
core.git: 2 commits - connectivity/source svx/source
connectivity/source/cpool/ZPooledConnection.cxx |2 connectivity/source/cpool/ZPooledConnection.hxx |5 - connectivity/source/drivers/evoab2/NPreparedStatement.hxx|2 connectivity/source/drivers/file/FPreparedStatement.cxx |7 + connectivity/source/drivers/firebird/PreparedStatement.hxx |4 connectivity/source/drivers/firebird/ResultSet.hxx |3 connectivity/source/drivers/firebird/StatementCommonBase.cxx |6 - connectivity/source/drivers/firebird/StatementCommonBase.hxx |3 connectivity/source/drivers/jdbc/ResultSet.cxx |4 connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.hxx |2 connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx |4 connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx |3 connectivity/source/drivers/mysqlc/mysqlc_statement.cxx |3 connectivity/source/drivers/mysqlc/mysqlc_statement.hxx |3 connectivity/source/drivers/odbc/OPreparedStatement.cxx |7 + connectivity/source/drivers/postgresql/pq_connection.cxx |1 connectivity/source/drivers/postgresql/pq_connection.hxx |4 connectivity/source/drivers/postgresql/pq_xkey.hxx |3 connectivity/source/drivers/postgresql/pq_xtable.hxx |2 connectivity/source/inc/FDatabaseMetaDataResultSet.hxx |4 connectivity/source/inc/TDatabaseMetaDataBase.hxx|5 - connectivity/source/inc/file/FPreparedStatement.hxx |5 - connectivity/source/inc/file/FResultSet.hxx |7 + connectivity/source/inc/java/sql/ResultSet.hxx |2 connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx |4 connectivity/source/inc/odbc/OPreparedStatement.hxx |5 - connectivity/source/inc/odbc/OResultSet.hxx |6 - svx/source/inc/cell.hxx |4 svx/source/table/accessibletableshape.cxx| 46 -- 29 files changed, 90 insertions(+), 66 deletions(-) New commits: commit d0d84eba568aaa9aef6ad812f19410946a274640 Author: Noel Grandin AuthorDate: Thu Sep 12 10:18:26 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 12 14:11:00 2024 +0200 use more concrete UNO classes in connectivity Change-Id: I5c70278add0aa0b0c4a7680c6615b75b688f2180 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173247 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/connectivity/source/cpool/ZPooledConnection.cxx b/connectivity/source/cpool/ZPooledConnection.cxx index 42e8d6c02db7..6cabc1ce2e29 100644 --- a/connectivity/source/cpool/ZPooledConnection.cxx +++ b/connectivity/source/cpool/ZPooledConnection.cxx @@ -65,7 +65,7 @@ Reference< XConnection > OPooledConnection::getConnection() if (m_xComponent.is()) m_xComponent->addEventListener(this); } -return Reference< XConnection >(m_xComponent,UNO_QUERY); +return m_xComponent; } diff --git a/connectivity/source/cpool/ZPooledConnection.hxx b/connectivity/source/cpool/ZPooledConnection.hxx index 79450ea081d3..0f5506f4f3b1 100644 --- a/connectivity/source/cpool/ZPooledConnection.hxx +++ b/connectivity/source/cpool/ZPooledConnection.hxx @@ -22,10 +22,11 @@ #include #include #include - +#include namespace connectivity { +class OConnectionWeakWrapper; // OPooledConnection - // allows to pool a real connection @@ -37,7 +38,7 @@ namespace connectivity ,public OPooledConnection_Base { css::uno::Reference< css::sdbc::XConnection > m_xRealConnection; // the connection from driver -css::uno::Reference< css::lang::XComponent > m_xComponent; // the connection which wraps the real connection +rtl::Reference< OConnectionWeakWrapper > m_xComponent; // the connection which wraps the real connection css::uno::Reference< css::reflection::XProxyFactory > m_xProxyFactory; public: // OComponentHelper diff --git a/connectivity/source/drivers/evoab2/NPreparedStatement.hxx b/connectivity/source/drivers/evoab2/NPreparedStatement.hxx index cd42d42d505b..076216e0cf42 100644 --- a/connectivity/source/drivers/evoab2/NPreparedStatement.hxx +++ b/connectivity/source/drivers/evoab2/NPreparedStatement.hxx @@ -47,7 +47,7 @@ namespace connectivity::evoab // the EBookQuery we're working with QueryData m_aQueryData; // our meta data -css::uno::Reference< css::sdbc::XResultSetMetaData > m_xMetaData; +rtl::Reference m_xMetaData; virtual ~OEvoabPrepare
core.git: 2 commits - comphelper/source include/comphelper scripting/source
comphelper/source/misc/docpasswordrequest.cxx |4 include/comphelper/docpasswordrequest.hxx |6 +++--- scripting/source/stringresource/stringresource.cxx | 18 -- scripting/source/vbaevents/eventhelper.cxx |2 +- 4 files changed, 12 insertions(+), 18 deletions(-) New commits: commit 1fbc623a5e8183b0042e886af9e2a4e0ac7e51f7 Author: Noel Grandin AuthorDate: Thu Sep 12 10:19:03 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 12 12:35:00 2024 +0200 use more concrete UNO classes in scripting Change-Id: I4eddf7ccdf2d0720a4204e578c9f21d8c78dbd35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173249 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx index 3e06668ec7d0..a081601b42b2 100644 --- a/scripting/source/stringresource/stringresource.cxx +++ b/scripting/source/stringresource/stringresource.cxx @@ -1049,13 +1049,12 @@ void StringResourcePersistenceImpl::implStoreAtLocation class BinaryOutput { rtl::Reference< utl::TempFileFastService > m_xTempFile; -Reference< io::XOutputStream > m_xOutputStream; public: explicit BinaryOutput(); -const Reference< io::XOutputStream >& getOutputStream() const -{ return m_xOutputStream; } +Reference< io::XOutputStream > getOutputStream() const +{ return m_xTempFile; } Sequence< ::sal_Int8 > closeAndGetData(); @@ -1073,13 +1072,12 @@ public: BinaryOutput::BinaryOutput() { m_xTempFile = new utl::TempFileFastService; -m_xOutputStream = m_xTempFile; } template< class T > void BinaryOutput::write16BitInt( T n ) { -if( !m_xOutputStream.is() ) +if( !m_xTempFile.is() ) return; Sequence< sal_Int8 > aSeq( 2 ); @@ -1090,12 +1088,12 @@ void BinaryOutput::write16BitInt( T n ) p[0] = nLow; p[1] = nHigh; -m_xOutputStream->writeBytes( aSeq ); +m_xTempFile->writeBytes( aSeq ); } void BinaryOutput::writeInt32( sal_Int32 n ) { -if( !m_xOutputStream.is() ) +if( !m_xTempFile.is() ) return; Sequence< sal_Int8 > aSeq( 4 ); @@ -1106,7 +1104,7 @@ void BinaryOutput::writeInt32( sal_Int32 n ) p[i] = sal_Int8( n & 0xff ); n >>= 8; } -m_xOutputStream->writeBytes( aSeq ); +m_xTempFile->writeBytes( aSeq ); } void BinaryOutput::writeString( const OUString& aStr ) @@ -1123,10 +1121,10 @@ void BinaryOutput::writeString( const OUString& aStr ) Sequence< ::sal_Int8 > BinaryOutput::closeAndGetData() { Sequence< ::sal_Int8 > aRetSeq; -if( !m_xOutputStream.is() ) +if( !m_xTempFile.is() ) return aRetSeq; -m_xOutputStream->closeOutput(); +m_xTempFile->closeOutput(); sal_Int32 nSize = static_cast(m_xTempFile->getPosition()); diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx index dd68e99cf1b5..0e8acbcc3677 100644 --- a/scripting/source/vbaevents/eventhelper.cxx +++ b/scripting/source/vbaevents/eventhelper.cxx @@ -514,7 +514,7 @@ public: // XScriptEventSupplier virtual Reference< container::XNameContainer > SAL_CALL getEvents( ) override { return m_xNameContainer; } private: -Reference< container::XNameContainer > m_xNameContainer; +rtl::Reference< ReadOnlyEventsNameContainer > m_xNameContainer; }; } commit 99243746d26035b91b7301028007dbd6d5c50763 Author: Noel Grandin AuthorDate: Thu Sep 12 10:18:51 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 12 12:34:50 2024 +0200 use more concrete UNO classes in comphelper Change-Id: I1a81d2264a450c23a5196f980e91a686f69edca8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173248 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/comphelper/source/misc/docpasswordrequest.cxx b/comphelper/source/misc/docpasswordrequest.cxx index 6f644336e1e2..8a606630c25e 100644 --- a/comphelper/source/misc/docpasswordrequest.cxx +++ b/comphelper/source/misc/docpasswordrequest.cxx @@ -41,16 +41,12 @@ using ::com::sun::star::task::XInteractionPassword2; namespace comphelper { -namespace { - class AbortContinuation : public ::cppu::WeakImplHelper< XInteractionAbort > { public: virtual void SAL_CALL select() override {} }; -} - class PasswordContinuation : public ::cppu::WeakImplHelper< XInteractionPassword2 > { public: diff --git a/include/comphelper/docpasswordrequest.hxx b/include/comphelper/docpasswordrequest.hxx index a4e8704eb5e4..e57c293df9fd 100644 --- a/include/comphelper/docpasswordrequest.hxx +++ b/include/comphelper/docpasswordrequest.hxx @@ -31,7 +31,7 @@ namespace com::sun::star::task { class XInteractionAbort; } namespace comphelper { class PasswordContinuati
core.git: 2 commits - editeng/source include/editeng include/svx include/vcl svx/source
editeng/source/editeng/impedit.cxx | 12 ++ editeng/source/editeng/impedit.hxx |2 - editeng/source/uno/unoipset.cxx|2 - editeng/source/xml/xmltxtexp.cxx |2 - include/editeng/unoipset.hxx |5 +- include/svx/svdotable.hxx |3 + include/svx/unoshape.hxx |2 - include/vcl/dndhelp.hxx|2 - svx/source/inc/tablemodel.hxx |6 ++- svx/source/table/cellcursor.cxx| 22 ++-- svx/source/table/svdotable.cxx | 14 +--- svx/source/table/tablecontroller.cxx | 50 + svx/source/table/tablehtmlimporter.cxx |6 +-- svx/source/table/tablelayouter.cxx |2 - svx/source/table/tablemodel.cxx|4 +- svx/source/table/tablertfexporter.cxx |8 ++-- svx/source/table/tablertfimporter.cxx |6 +-- svx/source/table/viewcontactoftableobj.cxx |4 +- svx/source/unodraw/unoshape.cxx|2 - 19 files changed, 79 insertions(+), 75 deletions(-) New commits: commit d39e7878b32a68aa34759737000aa6e138b87999 Author: Noel Grandin AuthorDate: Wed Sep 11 16:20:35 2024 +0200 Commit: Noel Grandin CommitDate: Thu Sep 12 08:09:27 2024 +0200 use less dynamic_cast in svx table stuff we already statically know the types of all these objects Change-Id: I976dbf2b150fcd2176df18a07c2e9f21b1d2fe65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173214 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx index 9abacce2b9ff..e22ef60a48b7 100644 --- a/include/svx/svdotable.hxx +++ b/include/svx/svdotable.hxx @@ -39,6 +39,7 @@ namespace sdr::table { class TableLayouter; struct ImplTableShadowPaintInfo; +class TableModel; #ifndef CellRef class Cell; @@ -116,6 +117,8 @@ public: void DistributeRows( sal_Int32 nFirstRow, sal_Int32 nLastRow, const bool bOptimize, const bool bMinimize ); css::uno::Reference< css::table::XTable > getTable() const; +/// Get the concrete UNO class for the table +rtl::Reference< sdr::table::TableModel > getUnoTable() const; bool isValid( const sdr::table::CellPos& rPos ) const; static CellPos getFirstCell(); diff --git a/svx/source/inc/tablemodel.hxx b/svx/source/inc/tablemodel.hxx index 3446604bc722..a82163f7b874 100644 --- a/svx/source/inc/tablemodel.hxx +++ b/svx/source/inc/tablemodel.hxx @@ -26,6 +26,7 @@ #include #include #include "celltypes.hxx" +#include struct _xmlTextWriter; typedef struct _xmlTextWriter* xmlTextWriterPtr; @@ -50,7 +51,7 @@ protected: typedef ::comphelper::WeakComponentImplHelper< css::table::XTable, css::util::XBroadcaster > TableModelBase; -class TableModel final : +class SVXCORE_DLLPUBLIC TableModel final : public TableModelBase, public ICellRange { @@ -135,6 +136,8 @@ public: virtual void SAL_CALL lockBroadcasts() override; virtual void SAL_CALL unlockBroadcasts() override; +CellRef getCell( sal_Int32 nCol, sal_Int32 nRow ) const; + private: void notifyModification(); @@ -147,7 +150,6 @@ private: sal_Int32 getColumnCountImpl() const; CellRef createCell(); -CellRef getCell( ::sal_Int32 nCol, ::sal_Int32 nRow ) const; void UndoInsertRows( sal_Int32 nIndex, sal_Int32 nCount ); void UndoRemoveRows( sal_Int32 nIndex, RowVector& aNewRows ); diff --git a/svx/source/table/cellcursor.cxx b/svx/source/table/cellcursor.cxx index 78358ca465d5..b4d9ce812869 100644 --- a/svx/source/table/cellcursor.cxx +++ b/svx/source/table/cellcursor.cxx @@ -165,14 +165,14 @@ bool CellCursor::GetMergedSelection( CellPos& rStart, CellPos& rEnd ) // single cell merge is never valid if( mxTable.is() && ((mnLeft != mnRight) || (mnTop != mnBottom)) ) try { -CellRef xCell( dynamic_cast< Cell* >( mxTable->getCellByPosition( mnLeft, mnTop ).get() ) ); +CellRef xCell = mxTable->getCell( mnLeft, mnTop ); // check if first cell is merged if( xCell.is() && xCell->isMerged() ) findMergeOrigin( mxTable, mnLeft, mnTop, rStart.mnCol, rStart.mnRow ); // check if last cell is merged -xCell.set( dynamic_cast< Cell* >( mxTable->getCellByPosition( mnRight, mnBottom ).get() ) ); +xCell = mxTable->getCell( mnRight, mnBottom ); if( xCell.is() ) { if( xCell->isMerged() ) @@ -181,7 +181,7 @@ bool CellCursor::GetMergedSelection( CellPos& rStart, CellPos& rEnd ) // merge not possible if selection is only one cell and all its merges if( rEnd == rStart ) return false; -xCell.set( dynamic_cast< Cell* >( mx
core.git: include/svl svl/source
include/svl/itemprop.hxx |7 --- svl/source/items/itemprop.cxx |2 +- 2 files changed, 5 insertions(+), 4 deletions(-) New commits: commit a2ee9929c8a4a8b6d4b6857db79f0b64e230d9f6 Author: Noel Grandin AuthorDate: Wed Sep 11 10:29:49 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 11 20:40:47 2024 +0200 use more concrete UNO type in svl Change-Id: I794fba1f111709e0469812d48eb81cc4dc1f11d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173195 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svl/itemprop.hxx b/include/svl/itemprop.hxx index ddd636272ea4..ff12f4060551 100644 --- a/include/svl/itemprop.hxx +++ b/include/svl/itemprop.hxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -88,10 +89,11 @@ private: mutable css::uno::Sequence< css::beans::Property > m_aPropSeq; }; +class SfxItemPropertySetInfo; class SVL_DLLPUBLIC SfxItemPropertySet final { SfxItemPropertyMapm_aMap; -mutable css::uno::Reference m_xInfo; +mutable rtl::Reference m_xInfo; public: SfxItemPropertySet( std::span pMap ) : @@ -131,8 +133,7 @@ public: getPropertyState(const SfxItemPropertyMapEntry& rEntry, const SfxItemSet& rSet) noexcept; -css::uno::Reference const & -getPropertySetInfo() const; +rtl::Reference const & getPropertySetInfo() const; const SfxItemPropertyMap& getPropertyMap() const {return m_aMap;} }; diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index 923bd7c0b260..329f84df722e 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -227,7 +227,7 @@ PropertyState SfxItemPropertySet::getPropertyState(const OUString& rName, cons return eRet; } -Reference const & SfxItemPropertySet::getPropertySetInfo() const +rtl::Reference const & SfxItemPropertySet::getPropertySetInfo() const { if( !m_xInfo.is() ) m_xInfo = new SfxItemPropertySetInfo( m_aMap );
core.git: 2 commits - framework/inc framework/source include/framework toolkit/inc toolkit/source
framework/inc/uielement/menubarmanager.hxx |3 + framework/inc/uifactory/configurationaccessfactorymanager.hxx|6 +++ framework/inc/uifactory/factoryconfiguration.hxx |5 ++- framework/inc/xml/imagesdocumenthandler.hxx |4 +- framework/inc/xml/menudocumenthandler.hxx|3 + framework/inc/xml/statusbardocumenthandler.hxx |4 +- framework/inc/xml/toolboxdocumenthandler.hxx |4 +- framework/source/accelerators/globalacceleratorconfiguration.cxx |2 - framework/source/accelerators/moduleacceleratorconfiguration.cxx |2 - framework/source/fwe/xml/menudocumenthandler.cxx |1 framework/source/fwe/xml/statusbardocumenthandler.cxx|1 framework/source/fwe/xml/toolboxdocumenthandler.cxx |1 framework/source/jobs/jobexecutor.cxx|2 - framework/source/services/desktop.cxx| 11 +- framework/source/services/frame.cxx | 16 +- framework/source/services/pathsettings.cxx |2 - framework/source/uiconfiguration/uicategorydescription.cxx |3 + framework/source/uiconfiguration/windowstateconfiguration.cxx|3 + framework/source/uielement/uicommanddescription.cxx |5 +-- framework/source/xml/imagesdocumenthandler.cxx |2 - include/framework/desktop.hxx| 11 +- toolkit/inc/awt/vclxgraphics.hxx |3 + toolkit/inc/awt/vclxprinter.hxx |5 +-- toolkit/inc/controls/controlmodelcontainerbase.hxx |2 - toolkit/inc/controls/geometrycontrolmodel.hxx|4 +- toolkit/source/awt/vclxprinter.cxx |2 - 26 files changed, 60 insertions(+), 47 deletions(-) New commits: commit ca8c59c7e645a072352b775cc32ea1af06b53413 Author: Noel Grandin AuthorDate: Wed Sep 11 09:02:48 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 11 16:14:54 2024 +0200 use more concrete UNO type in framework Change-Id: I3ee54f3967339ab52c04f48a047bc29fc5161680 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173159 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx index 1beb2961e690..986ed951f9ea 100644 --- a/framework/inc/uielement/menubarmanager.hxx +++ b/framework/inc/uielement/menubarmanager.hxx @@ -45,6 +45,7 @@ #include #include #include +#include namespace framework { @@ -146,7 +147,7 @@ class MenuBarManager final : rtl::Reference< MenuBarManager > xSubMenuManager; css::uno::Reference< css::frame::XDispatch > xMenuItemDispatch; css::uno::Reference< css::frame::XPopupMenuController > xPopupMenuController; -css::uno::Reference< css::awt::XPopupMenu > xPopupMenu; +rtl::Reference< VCLXPopupMenu > xPopupMenu; vcl::KeyCode aKeyCode; }; diff --git a/framework/inc/uifactory/configurationaccessfactorymanager.hxx b/framework/inc/uifactory/configurationaccessfactorymanager.hxx index af0345b496e9..2272aabc355c 100644 --- a/framework/inc/uifactory/configurationaccessfactorymanager.hxx +++ b/framework/inc/uifactory/configurationaccessfactorymanager.hxx @@ -28,14 +28,18 @@ #include #include +#include #include #include #include #include + namespace framework { +class WeakContainerListener; + class ConfigurationAccess_FactoryManager final : public ::cppu::WeakImplHelper< css::container::XContainerListener> { public: @@ -74,7 +78,7 @@ class ConfigurationAccess_FactoryManager final : public ::cppu::WeakImplHelper< FactoryManagerMapm_aFactoryManagerMap; css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider; css::uno::Reference< css::container::XNameAccess > m_xConfigAccess; -css::uno::Reference< css::container::XContainerListener > m_xConfigListener; +rtl::Reference< WeakContainerListener > m_xConfigListener; bool m_bConfigAccessInitialized; }; diff --git a/framework/inc/uifactory/factoryconfiguration.hxx b/framework/inc/uifactory/factoryconfiguration.hxx index 4e5ea6c4b052..4d6b80d7943b 100644 --- a/framework/inc/uifactory/factoryconfiguration.hxx +++ b/framework/inc/uifactory/factoryconfiguration.hxx @@ -25,6 +25,7 @@ #include #include +#include #include
core.git: package/source
package/source/xstor/xstorage.cxx |7 +++ package/source/xstor/xstorage.hxx |4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) New commits: commit cd88ea52a0902963f9c616d0d9984a6dd533 Author: Noel Grandin AuthorDate: Wed Sep 11 09:01:59 2024 +0200 Commit: Noel Grandin CommitDate: Wed Sep 11 14:34:13 2024 +0200 use more concrete UNO type in package Change-Id: I95283bf49b8966d73035dd718fbcfcbdcacc78c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173157 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 3951a38fec66..e0550695e1dd 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -207,7 +207,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > const & xStream, if ( m_nStorageMode & embed::ElementModes::WRITE ) { m_pSwitchStream = new SwitchablePersistenceStream(xStream); -m_xStream = static_cast< io::XStream* >( m_pSwitchStream.get() ); +m_xStream = m_pSwitchStream.get(); } else { @@ -378,7 +378,7 @@ void OStorage_Impl::OpenOwnPackage() uno::Sequence< uno::Any > aArguments( 2 ); auto pArguments = aArguments.getArray(); if ( m_nStorageMode & embed::ElementModes::WRITE ) -pArguments[ 0 ] <<= m_xStream; +pArguments[ 0 ] <<= css::uno::Reference< css::io::XStream >(m_xStream); else { SAL_WARN_IF( !m_xInputStream.is(), "package.xstor", "Input stream must be set for readonly access!" ); @@ -1715,8 +1715,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain if ( m_xRelStorage->hasElements() ) { -uno::Reference< embed::XTransactedObject > xTrans( m_xRelStorage, uno::UNO_QUERY_THROW ); -xTrans->commit(); +m_xRelStorage->commit(); } if ( xNewPackageFolder.is() && xNewPackageFolder->hasByName( aRelsStorName ) ) diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index 93d5f8dd32ae..f6e9890c43a3 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -141,7 +141,7 @@ struct OStorage_Impl // valid only for root storage css::uno::Reference< css::io::XInputStream > m_xInputStream; // ??? may be stored in properties -css::uno::Reference< css::io::XStream > m_xStream; // ??? may be stored in properties +rtl::Reference< SwitchablePersistenceStream > m_xStream; // ??? may be stored in properties css::uno::Sequence< css::beans::PropertyValue > m_xProperties; bool m_bHasCommonEncryptionData; ::comphelper::SequenceAsHashMap m_aCommonEncryptionData; @@ -162,7 +162,7 @@ struct OStorage_Impl // the _rels substorage that is handled in a special way in embed::StorageFormats::OFOPXML SotElement_Impl* m_pRelStorElement; -css::uno::Reference< css::embed::XStorage > m_xRelStorage; +rtl::Reference< OStorage > m_xRelStorage; css::uno::Sequence< css::uno::Sequence< css::beans::StringPair > > m_aRelInfo; css::uno::Reference< css::io::XInputStream > m_xNewRelInfoStream; sal_Int16 m_nRelInfoStatus;
core.git: Branch 'libreoffice-24-8' - comphelper/source extensions/source forms/source include/comphelper reportdesign/source svx/source
comphelper/source/property/propmultiplex.cxx | 20 +++- extensions/source/propctrlr/submissionhandler.cxx |2 +- forms/source/component/DatabaseForm.cxx |4 ++-- forms/source/component/FormComponent.cxx |4 ++-- forms/source/component/clickableimage.cxx |4 ++-- include/comphelper/propmultiplex.hxx |8 +--- reportdesign/source/ui/dlg/AddField.cxx |2 +- reportdesign/source/ui/dlg/GroupsSorting.cxx |2 +- reportdesign/source/ui/dlg/Navigator.cxx |4 ++-- reportdesign/source/ui/report/ReportSection.cxx |2 +- reportdesign/source/ui/report/ReportWindow.cxx|2 +- reportdesign/source/ui/report/ScrollHelper.cxx|2 +- reportdesign/source/ui/report/SectionWindow.cxx |2 +- svx/source/fmcomp/gridcell.cxx|2 +- svx/source/fmcomp/gridctrl.cxx|4 ++-- 15 files changed, 38 insertions(+), 26 deletions(-) New commits: commit 68edc89a5159aace580b81e92b3c86e5116343c6 Author: Noel Grandin AuthorDate: Mon Sep 9 10:50:07 2024 +0200 Commit: Michael Stahl CommitDate: Wed Sep 11 11:25:32 2024 +0200 tsan:lock-order-inversion in forms == WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=14614) Cycle in lock order graph: M0 (0x720c004ac190) => M1 (0x720c004a8200) => M0 Mutex M1 acquired here while holding mutex M0 in thread T43: 2 osl::Mutex::acquire() /home/noel/libo-tsan/include/osl/mutex.hxx:63 (libuno_cppuhelpergcc3.so.3+0x8fdd9) 3 osl::Guard::Guard(osl::Mutex&) /home/noel/libo-tsan/include/osl/mutex.hxx:144 (libuno_cppuhelpergcc3.so.3+0x8fdd9) 4 cppu::OBroadcastHelperVar::addListener(com::sun::star::uno::Type const&, com::sun::star::uno::Reference const&) /home/noel/libo-tsan/include/cppuhelper/interfacecontainer.h:468 (libuno_cppuhelpergcc3.so.3+0x8fdd9) 5 cppu::OPropertySetHelper::addPropertiesChangeListener(com::sun::star::uno::Sequence const&, com::sun::star::uno::Reference const&) /home/noel/libo-tsan/cppuhelper/source/propshlp.cxx:912 (libuno_cppuhelpergcc3.so.3+0x8fdd9) 6 comphelper::OPropertySetAggregationHelper::addPropertiesChangeListener(com::sun::star::uno::Sequence const&, com::sun::star::uno::Reference const&) /home/noel/libo-tsan/comphelper/source/property/propagg.cxx:495 (libcomphelper.so+0x1a1865) 7 comphelper::OPropertySetAggregationHelper::startListening() /home/noel/libo-tsan/comphelper/source/property/propagg.cxx:466 (libcomphelper.so+0x1a1416) ^^^ Mutex M0 previously acquired by the same thread here: 8 comphelper::OPropertySetAggregationHelper::addPropertyChangeListener(rtl::OUString const&, com::sun::star::uno::Reference const&) /home/noel/libo-tsan/comphelper/source/property/propagg.cxx:488 (libcomphelper.so+0x1a181a) 9 non-virtual thunk to comphelper::OPropertySetAggregationHelper::addPropertyChangeListener(rtl::OUString const&, com::sun::star::uno::Reference const&) /home/noel/libo-tsan/comphelper/source/property/propagg.cxx:? (libcomphelper.so+0x1a181a) 10 frm::OInterfaceContainer::implInsert(int, com::sun::star::uno::Reference const&, bool, frm::ElementDescription*, bool) /home/noel/libo-tsan/forms/source/misc/InterfaceContainer.cxx:787 (libfrmlo.so+0x23e03c) 11 frm::OInterfaceContainer::insertByIndex(int, com::sun::star::uno::Any const&) /home/noel/libo-tsan/forms/source/misc/InterfaceContainer.cxx:904 (libfrmlo.so+0x240644) 12 non-virtual thunk to frm::OInterfaceContainer::insertByIndex(int, com::sun::star::uno::Any const&) /home/noel/libo-tsan/forms/source/misc/InterfaceContainer.cxx:? (libfrmlo.so+0x240716) 13 FmXUndoEnvironment::Inserted(FmFormObj*) /home/noel/libo-tsan/svx/source/form/fmundo.cxx:424 (libsvxcorelo.so+0x41b2a4) 14 FmXUndoEnvironment::Inserted(SdrObject*) /home/noel/libo-tsan/svx/source/form/fmundo.cxx:336 (libsvxcorelo.so+0x41a982) 15 FmXUndoEnvironment::Notify(SfxBroadcaster&, SfxHint const&) /home/noel/libo-tsan/svx/source/form/fmundo.cxx:292 (libsvxcorelo.so+0x41a8a0) 16 non-virtual thunk to FmXUndoEnvironment::Notify(SfxBroadcaster&, SfxHint const&) /home/noel/libo-tsan/svx/source/form/fmundo.cxx:? (libsvxcorelo.so+0x41acd2) 17 SfxBroadcaster::Broadcast(SfxHint const&) /home/noel/libo-tsan/svl/source/notify/SfxBroadcaster.cxx:40 (libsvllo.so+0xe7c3d) 18 SdrObjList::InsertObject(SdrObject*, unsigned long) /home/noel/libo-tsan/svx/source/svdraw/svdpage.cxx:351 (libsvxcorelo.so+0x6fdf3a) 19 FmFormPage::InsertObject(SdrObject*, unsigned long) /home/noel/libo-tsan/svx/source/form/fmpage.cxx:79 (libsvxcorelo.so+0x3c1e05) 2
core.git: Branch 'libreoffice-24-8' - forms/source
forms/source/component/DatabaseForm.cxx | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) New commits: commit df7cc4207d21641082e51230ba1903566bd153b3 Author: Noel Grandin AuthorDate: Thu Sep 5 14:39:50 2024 +0200 Commit: Michael Stahl CommitDate: Wed Sep 11 11:07:07 2024 +0200 tsan:lock-order-inversion in forms ThreadSanitizer: lock-order-inversion (potential deadlock) Cycle in lock order graph: M0 (0x720c00011640) => M1 (0x720c00474120) => M0 Mutex M1 acquired here while holding mutex M0 in thread T8: 3 osl::Guard::Guard(osl::Mutex&) 4 comphelper::OPropertySetAggregationHelper::setAggregation(com::sun::star::uno::Reference const&) ^^ acquires cppu mutex 5 frm::ODatabaseForm::impl_construct() 6 frm::ODatabaseForm::ODatabaseForm(com::sun::star::uno::Reference const&) 7 com_sun_star_comp_forms_ODatabaseForm_get_implementation 12 cppuhelper::ServiceManager::Data::Implementation::doCreateInstance(com::sun::star::uno::Reference const&) 13 cppuhelper::ServiceManager::Data::Implementation::createInstance(com::sun::star::uno::Reference const&, bool) 14 cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference const&) 15 cppuhelper::ServiceManager::createInstance(rtl::OUString const&) 16 non-virtual thunk to cppuhelper::ServiceManager::createInstance(rtl::OUString const&) 17 FmFormPageImpl::getDefaultForm() 18 FmFormPageImpl::findPlaceInFormComponentHierarchy(com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&, rtl::OUString const&, rtl::OUString const&, int) 19 FmXUndoEnvironment::Inserted(FmFormObj*) 20 FmXUndoEnvironment::Inserted(SdrObject*) 21 FmXUndoEnvironment::Notify(SfxBroadcaster&, SfxHint const&) 22 non-virtual thunk to FmXUndoEnvironment::Notify(SfxBroadcaster&, SfxHint const&) 23 SfxBroadcaster::Broadcast(SfxHint const&) 24 SdrObjList::InsertObject(SdrObject*, unsigned long) 25 FmFormPage::InsertObject(SdrObject*, unsigned long) 26 SvxDrawPage::add(com::sun::star::uno::Reference const&) 27 SwFmDrawPage::add(com::sun::star::uno::Reference const&) ^^ acquires solar mutex 28 non-virtual thunk to SwFmDrawPage::add(com::sun::star::uno::Reference const&) 33 binaryurp::IncomingRequest::execute() const 35 cppu_threadpool::JobQueue::enter(void const*, bool) Mutex M0 acquired here while holding mutex M1 in thread T8: 6 SolarMutexClearableGuard::SolarMutexClearableGuard() 7 SfxModelGuard::SfxModelGuard(SfxBaseModel const&, SfxModelGuard::AllowedModelState) ^^ acquires solar mutex 8 SfxBaseModel::getArgs2(com::sun::star::uno::Sequence const&) 9 SfxBaseModel::getArgs() 10 SwXTextDocument::getArgs() 11 non-virtual thunk to SwXTextDocument::getArgs() 12 dbtools::isEmbeddedInDatabase(com::sun::star::uno::Reference const&, com::sun::star::uno::Reference&) 13 frm::ODatabaseForm::setFastPropertyValue_NoBroadcast(int, com::sun::star::uno::Any const&) 15 cppu::OPropertySetHelper::setFastPropertyValue(int, com::sun::star::uno::Any const&) ^^ acquires cppu mutex 16 comphelper::OPropertySetAggregationHelper::setFastPropertyValue(int, com::sun::star::uno::Any const&) 17 cppu::OPropertySetHelper::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) 18 non-virtual thunk to cppu::OPropertySetHelper::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) 20 cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy*, bridges::cpp_uno::shared::VtableSlot, _typelib_TypeDescriptionReference*, int, _typelib_MethodParameter*, void*, void**, _uno_Any**) /home/noel/libo-tsan/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx:229 (libgcc3_uno.so+0x2118a) 22 binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny*, std::vector >*) const 23 binaryurp::IncomingRequest::execute() const Change-Id: I00de2ad02b7ab247ee0aa62abcb11f5d46c9b157 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173067 Reviewed-by: Noel Grandin Tested-by: Jenkins (cherry picked from commit 07db23624497d303dca142ba9376cdcf265b20d8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173099 Reviewed-by: Michael Stahl diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 118054615aa4..929d897e77a1 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -164
core.git: 3 commits - include/vcl stoc/source ucbhelper/source vcl/inc vcl/source vcl/unx
include/vcl/toolkit/edit.hxx |2 +- include/vcl/transfer.hxx |7 --- stoc/source/servicemanager/servicemanager.cxx |3 ++- ucbhelper/source/client/content.cxx |2 +- ucbhelper/source/provider/resultset.cxx |4 ++-- vcl/inc/window.h |6 -- vcl/source/control/edit.cxx | 12 vcl/source/edit/textview.cxx |8 +++- vcl/source/treelist/transfer.cxx |2 +- vcl/source/window/dockwin.cxx |1 + vcl/source/window/mouse.cxx |7 +++ vcl/source/window/window.cxx | 11 +-- vcl/source/window/winproc.cxx | 26 -- vcl/unx/generic/dtrans/X11_selection.cxx |2 +- vcl/unx/generic/dtrans/X11_selection.hxx |5 +++-- 15 files changed, 47 insertions(+), 51 deletions(-) New commits: commit 5cd1f77618ec3d74c8c9c0743b9daef7108bc80a Author: Noel Grandin AuthorDate: Tue Sep 10 13:09:12 2024 +0200 Commit: Noel Grandin CommitDate: Tue Sep 10 17:17:51 2024 +0200 use more concrete UNO type in vcl Change-Id: I157109d11b349e1304a3279471d4ab90b65b5841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173138 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/toolkit/edit.hxx b/include/vcl/toolkit/edit.hxx index be84069b99ca..93abf1c5dd63 100644 --- a/include/vcl/toolkit/edit.hxx +++ b/include/vcl/toolkit/edit.hxx @@ -85,7 +85,7 @@ private: css::uno::Reference mxBreakIterator; css::uno::Reference mxISC; -css::uno::Reference mxDnDListener; +rtl::Reference mxDnDListener; SAL_DLLPRIVATE boolImplTruncateToMaxLen( OUString&, sal_Int32 nSelectionLen ) const; SAL_DLLPRIVATE voidImplInitEditData(); diff --git a/include/vcl/transfer.hxx b/include/vcl/transfer.hxx index 3f07a9f6aab9..4a13f99db1b1 100644 --- a/include/vcl/transfer.hxx +++ b/include/vcl/transfer.hxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -166,7 +167,7 @@ private: css::uno::Any maAny; OUString maLastFormat; mutable css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard; -css::uno::Reference< css::frame::XTerminateListener > mxTerminateListener; +rtl::Reference< TerminateListener > mxTerminateListener; DataFlavorExVector maFormats; std::unique_ptr mxObjDesc; @@ -399,7 +400,7 @@ private: std::mutex maMutex; css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > mxDragGestureRecognizer; -css::uno::Reference< css::datatransfer::dnd::XDragGestureListener > mxDragGestureListener; +rtl::Reference< DragSourceHelper::DragGestureListener > mxDragGestureListener; DragSourceHelper& operator=( const DragSourceHelper& rDragSourceHelper ) = delete; booloperator==( const DragSourceHelper& rDragSourceHelper ) const = delete; @@ -448,7 +449,7 @@ private: std::mutex maMutex; css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget; -css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener; +rtl::Reference< DropTargetHelper::DropTargetListener > mxDropTargetListener; DataFlavorExVector maFormats; DropTargetHelper() = delete; diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 69c61214ce7a..72d07bc85c01 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -48,6 +48,8 @@ class VCLXWindow; namespace vcl { class WindowData; } class SalFrame; class SalObject; +class DNDEventDispatcher; +class DNDListenerContainer; enum class MouseEventModifiers; enum class NotifyEventType; enum class ActivateModeFlags; @@ -173,7 +175,7 @@ struct ImplFrameData css::uno::Reference< css::datatransfer::dnd::XDragSource > mxDragSource; css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget; -css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > mxDropTargetListener; +rtl::Reference< DNDEventDispatcher > mxDropTargetListener; // css::datatransfer::dnd::XDropTargetListener css::uno::Reference< css::datatransfer::clipboard::XClipboard > mxClipboard; boolmbIn
core.git: comphelper/source
comphelper/source/compare/AnyCompareFactory.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 369c3bb5f0e47586bd743e68690d128758f3ce7c Author: Noel Grandin AuthorDate: Tue Sep 10 13:08:30 2024 +0200 Commit: Noel Grandin CommitDate: Tue Sep 10 16:23:08 2024 +0200 use more concrete UNO type in comphelper Change-Id: I290b3ca15d9fc50e5c272c8e6a6634811a595d20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173134 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/comphelper/source/compare/AnyCompareFactory.cxx b/comphelper/source/compare/AnyCompareFactory.cxx index 785fc9005707..52ce3c39aa8d 100644 --- a/comphelper/source/compare/AnyCompareFactory.cxx +++ b/comphelper/source/compare/AnyCompareFactory.cxx @@ -25,6 +25,7 @@ #include #include #include +#include using namespace com::sun::star::uno; using namespace com::sun::star::ucb; @@ -50,7 +51,7 @@ public: class AnyCompareFactory : public cppu::WeakImplHelper< XAnyCompareFactory, XInitialization, XServiceInfo > { -Reference< XAnyCompare >m_xAnyCompare; +rtl::Reference< AnyCompare >m_xAnyCompare; Reference< XComponentContext > m_xContext; Locale m_Locale;