diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-05-01 10:00:25 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-06-18 03:14:11 +0500 |
commit | f93a01d929ef91b84b2d8260ecab74c6f39699bf (patch) | |
tree | 25e3f4ac226c55b6ca0fb69183db3ccd2556c0c5 | |
parent | 958efa1943e3a5f303cd9a85d7af3e8dabaff3da (diff) |
Make pNoteURL thread-local, just in case
Change-Id: I27247a85f0d7497f70c5d97a8955b68a29be1176
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166946
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | sw/source/core/inc/noteurl.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/noteurl.cxx | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/inc/noteurl.hxx b/sw/source/core/inc/noteurl.hxx index eeae15642a43..b575b60d20a0 100644 --- a/sw/source/core/inc/noteurl.hxx +++ b/sw/source/core/inc/noteurl.hxx @@ -59,7 +59,7 @@ public: }; // globale Variable, in NoteURL.Cxx angelegt -extern SwNoteURL* pNoteURL; +extern thread_local SwNoteURL* pNoteURL; #endif diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 69c571e1afe0..e04720c309b1 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -8036,7 +8036,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap, const sal_uInt32 /*nMaxim SfxItemState::SET != GetAttrSet().GetItemState( RES_URL ); if( bNoteURL ) { - OSL_ENSURE( !pNoteURL, "MakeGraphic: pNoteURL already used? " ); + assert(!pNoteURL); pNoteURL = new SwNoteURL; } SwFlyFrame *pFly = static_cast<SwFlyFrame*>(pFirst); @@ -8117,7 +8117,7 @@ Graphic SwFlyFrameFormat::MakeGraphic( ImageMap* pMap, const sal_uInt32 /*nMaxim if( bNoteURL ) { - OSL_ENSURE( pNoteURL, "MakeGraphic: Good Bye, NoteURL." ); + assert(pNoteURL); pNoteURL->FillImageMap(pMap, pFly->getFrameArea().Pos(), aMap); delete pNoteURL; pNoteURL = nullptr; diff --git a/sw/source/core/text/noteurl.cxx b/sw/source/core/text/noteurl.cxx index ae52e1c29a91..d66736280bb5 100644 --- a/sw/source/core/text/noteurl.cxx +++ b/sw/source/core/text/noteurl.cxx @@ -25,7 +25,7 @@ #include <vcl/outdev.hxx> // Global variable -SwNoteURL* pNoteURL = nullptr; +thread_local SwNoteURL* pNoteURL = nullptr; void SwNoteURL::InsertURLNote(const OUString& rURL, const OUString& rTarget, const SwRect& rRect) { |