sfx2/source/doc/doctempl.cxx       |   14 +++-----------
 sw/source/core/frmedt/feshview.cxx |    9 ++++++---
 2 files changed, 9 insertions(+), 14 deletions(-)

New commits:
commit 1e9eca1af58d19820ce61a178bf6049def7cadc7
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Oct 29 20:54:22 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Oct 31 14:26:53 2024 +0100

    cid#1607945 Data race condition
    
    Change-Id: I8c00cab53b775d042f183abef324fcabc9a9c73e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175839
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins

diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index e28d550963ea..5003cb478a3b 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -1404,7 +1404,6 @@ DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( 
size_t nIndex ) const
     return nullptr;
 }
 
-
 void RegionData_Impl::DeleteEntry( size_t nIndex )
 {
     if ( nIndex < maEntries.size() )
@@ -1415,33 +1414,29 @@ void RegionData_Impl::DeleteEntry( size_t nIndex )
     }
 }
 
-
 int RegionData_Impl::Compare( RegionData_Impl const * pCompare ) const
 {
     return maTitle.compareTo( pCompare->maTitle );
 }
 
-
 SfxDocTemplate_Impl::SfxDocTemplate_Impl()
-: mbConstructed( false )
-, mnLockCounter( 0 )
+    : maStandardGroup(DocTemplLocaleHelper::GetStandardGroupString())
+    , mbConstructed(false)
+    , mnLockCounter(0)
 {
 }
 
-
 SfxDocTemplate_Impl::~SfxDocTemplate_Impl()
 {
     gpTemplateData = nullptr;
 }
 
-
 void SfxDocTemplate_Impl::IncrementLock()
 {
     std::unique_lock aGuard( maMutex );
     mnLockCounter++;
 }
 
-
 void SfxDocTemplate_Impl::DecrementLock()
 {
     std::unique_lock aGuard( maMutex );
@@ -1449,7 +1444,6 @@ void SfxDocTemplate_Impl::DecrementLock()
         mnLockCounter--;
 }
 
-
 RegionData_Impl* SfxDocTemplate_Impl::GetRegion( size_t nIndex ) const
 {
     if ( nIndex < maRegions.size() )
@@ -1457,7 +1451,6 @@ RegionData_Impl* SfxDocTemplate_Impl::GetRegion( size_t 
nIndex ) const
     return nullptr;
 }
 
-
 RegionData_Impl* SfxDocTemplate_Impl::GetRegion( std::u16string_view rName )
     const
 {
@@ -1587,7 +1580,6 @@ bool SfxDocTemplate_Impl::Construct( )
     mbConstructed = true;
     maRootURL = aRootContent->getIdentifier()->getContentIdentifier();
 
-    maStandardGroup = DocTemplLocaleHelper::GetStandardGroupString();
     Content aTemplRoot( aRootContent, aCmdEnv, xContext );
     CreateFromHierarchy( aGuard, aTemplRoot );
 
commit bb4da18c55dff7e6d1146fa70a83c84dea68807f
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Thu Oct 31 11:04:42 2024 +0100
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Thu Oct 31 14:26:50 2024 +0100

    tdf#163699 sw: fix reported crash using the Navigator
    
    "On a specific file, when double-clicking multiple times on
    different images in the navigator panel, LO crashes."
    reported by Vladimir Tarakanov with a code pointer.
    
    Regression since 3e0650fb166cac116a43f6ce5d03bd69830e37b8
    "tdf#157533 sw: fix cursor position deselecting formula in table".
    
    Change-Id: I550d61d8ee10205ff2357c2511ae0062077d651e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175865
    Tested-by: Jenkins
    Reviewed-by: László Németh <nem...@numbertext.org>

diff --git a/sw/source/core/frmedt/feshview.cxx 
b/sw/source/core/frmedt/feshview.cxx
index 3e76f6c59830..ae1e47e8fd3d 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -217,8 +217,9 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 
nFlag, SdrObject *pObj )
                                 pOldSelFly->GetAnchorFrame()->GetUpper() )
                         {
                             const SwNode * pOldNd = 
pContact->GetAnchorNode().FindTableNode();
+                            const SwNode * pNewNd = 
GetCursor()->GetPointNode().FindTableNode();
                             // the original image was in a table, but the 
cursor is not in that
-                            if ( pOldNd && pOldNd != 
GetCursor()->GetPointNode().FindTableNode() )
+                            if ( pOldNd && pOldNd != pNewNd )
                             {
                                 const SwRect& rCellFrame =
                                     
pOldSelFly->GetAnchorFrame()->GetUpper()->getFrameArea();
@@ -229,8 +230,10 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 
nFlag, SdrObject *pObj )
                                     pWrtShell->SelectTableRowCol( 
aPtCellTopRight );
                             }
                             // same table, but not in the same cell
-                            else if ( pContact->GetAnchorNode().GetTableBox() 
!=
-                                            
GetCursor()->GetPointNode().GetTextNode()->GetTableBox() )
+                            else if ( pOldNd && pOldNd == pNewNd &&
+                                    GetCursor()->GetPointNode().GetTextNode() 
&&
+                                    pContact->GetAnchorNode().GetTableBox() !=
+                                    
GetCursor()->GetPointNode().GetTextNode()->GetTableBox() )
                             {
                                 aPt.setX( aPt.getX() + 2 + 
pOldSelFly->getFrameArea().Width() );
                                 // put the text cursor after the object

Reply via email to