sw/source/core/access/accmap.cxx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
New commits: commit 58407933724f0c9da15b567ab3e293204e9d483d Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 17 08:13:30 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 18 08:24:32 2025 +0200 sw a11y: Reduce variable scope Change-Id: I6460ad4619b1185f86f27267f21cc61d1ddddfc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184309 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index eaf613b99e26..46dd67872f95 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1129,15 +1129,14 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() { DBG_TESTSOLARMUTEX(); - SwAccessibleObjShape_Impl *pSelShape = nullptr; - size_t nShapes = 0; - const SwViewShell& rVSh = GetShell(); const SwFEShell *pFESh = dynamic_cast<const SwFEShell*>(&rVSh); SwPaM* pCursor = pFESh ? pFESh->GetCursor( false /* ??? */ ) : nullptr; if( mpShapeMap ) { + SwAccessibleObjShape_Impl* pSelShape = nullptr; + size_t nShapes = 0; std::unique_ptr<SwAccessibleObjShape_Impl[]> pShapes = mpShapeMap->Copy(nShapes, pFESh, &pSelShape); commit 31e8f0c7baae4fcab112f0f4266d3ee4d9f27f9e Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 17 08:07:02 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 18 08:24:18 2025 +0200 sw a11y: Move std::unique_ptr into block for auto-reset Instead of declaring the std::unique_ptr before the block it is used in and resetting it manually after the block, move the declaration inside, so it is automatically deleted as it goes out of scope at the end of the block, freeing the memory. Change-Id: I7a2179834aa243621f913e11ea2ec606302db5ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184308 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 4d61248117b1..eaf613b99e26 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1129,7 +1129,6 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() { DBG_TESTSOLARMUTEX(); - std::unique_ptr<SwAccessibleObjShape_Impl[]> pShapes; SwAccessibleObjShape_Impl *pSelShape = nullptr; size_t nShapes = 0; @@ -1139,7 +1138,8 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() if( mpShapeMap ) { - pShapes = mpShapeMap->Copy( nShapes, pFESh, &pSelShape ); + std::unique_ptr<SwAccessibleObjShape_Impl[]> pShapes + = mpShapeMap->Copy(nShapes, pFESh, &pSelShape); //Checked for shapes. SwAccessibleShapeMap_Impl::const_iterator aIter = mpShapeMap->cbegin(); @@ -1291,8 +1291,6 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() }//else } - pShapes.reset(); - //Checked for FlyFrame if (mpFrameMap) { commit ccfebdceaba6f6393b9aeaef5e8cad45b83097dd Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 17 08:02:35 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 18 08:23:44 2025 +0200 sw a11y: Merge two blocks using same if condition Change-Id: I2d86635a99f6b6e71cd22ec24e81069de1d18113 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184307 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 75f2f09af93d..4d61248117b1 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1138,10 +1138,9 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() SwPaM* pCursor = pFESh ? pFESh->GetCursor( false /* ??? */ ) : nullptr; if( mpShapeMap ) + { pShapes = mpShapeMap->Copy( nShapes, pFESh, &pSelShape ); - if( mpShapeMap ) - { //Checked for shapes. SwAccessibleShapeMap_Impl::const_iterator aIter = mpShapeMap->cbegin(); SwAccessibleShapeMap_Impl::const_iterator aEndIter = mpShapeMap->cend(); commit 1c9c895708a58e4d6cce9db8d19b590d1fec61d9 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 17 08:01:48 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Fri Apr 18 08:23:12 2025 +0200 sw a11y: Drop commented line of code Commented out ever since it was added in commit 76c549eb01dcb7b5bf28a271ce00e386f3d388ba Author: Steve Yin <stev...@apache.org> Date: Fri Nov 29 13:03:27 2013 +0000 Integrate branch of IAccessible2 Change-Id: Id6653f045019f8d58574ab46eb2750001c7fa5f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184306 Tested-by: Jenkins Reviewed-by: Simon Chenery <simon_chen...@yahoo.com> Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index b787ec7a22d5..75f2f09af93d 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1137,8 +1137,6 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() const SwFEShell *pFESh = dynamic_cast<const SwFEShell*>(&rVSh); SwPaM* pCursor = pFESh ? pFESh->GetCursor( false /* ??? */ ) : nullptr; - //const size_t nSelShapes = pFESh ? pFESh->IsObjSelected() : 0; - if( mpShapeMap ) pShapes = mpShapeMap->Copy( nShapes, pFESh, &pSelShape );