diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-10-12 01:54:37 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-10-14 10:46:30 +0000 |
commit | a6e066e3aa1fdf0e9001e4721171b523ac39d8d8 (patch) | |
tree | b13d8f6fa420a24ab3774edc52cc09e8d01dfb90 | |
parent | fdo#64495: sw: fix regex search for soft hyphen \xAD (diff) | |
download | core-a6e066e3aa1fdf0e9001e4721171b523ac39d8d8.tar.gz core-a6e066e3aa1fdf0e9001e4721171b523ac39d8d8.zip |
sw: fix regex search/replace of $ in selection
SwView::Replace() nowadays first searches for the to-be-replaced text in
the current selection, which does not work in the corner case of "$"
when the selection starts at end of a paragraph, as it will when
clicking "Find" to look for "$" and then clicking "Replace".
The problem is that there is some antique code in SwPaM::Find() to
move the cursor forward if it's at the end of a paragraph, which is
presumably some pointless micro-optimization; the result is that
"Replace" does not replace the selected paragraph break but the
one in the following paragraph.
(regression from 68a014dbca8bbd25056f75ef551fb81a0dbfb1b7)
Conflicts:
sw/source/core/crsr/findtxt.cxx
(cherry picked from commit b60ce8465c8f01242354abccebe00742d164af60)
Change-Id: I5aae9c272d102a48166c63e01775dc6322f9f02d
Reviewed-on: https://gerrit.libreoffice.org/6230
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/source/core/crsr/findtxt.cxx | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx index eb66500f6105..f4d3408d22a5 100644 --- a/sw/source/core/crsr/findtxt.cxx +++ b/sw/source/core/crsr/findtxt.cxx @@ -226,22 +226,6 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes SwNodeIndex& rNdIdx = pPam->GetPoint()->nNode; SwIndex& rCntntIdx = pPam->GetPoint()->nContent; - // If a beginning/end, from out of node; stop if empty node - if( bSrchForward - ? ( rCntntIdx.GetIndex() == pPam->GetCntntNode()->Len() && - rCntntIdx.GetIndex() ) - : !rCntntIdx.GetIndex() && pPam->GetCntntNode()->Len() ) - { - if( !(*fnMove->fnNds)( &rNdIdx, sal_False )) - { - delete pPam; - return sal_False; - } - SwCntntNode *pNd = rNdIdx.GetNode().GetCntntNode(); - xub_StrLen nTmpPos = bSrchForward ? 0 : pNd->Len(); - rCntntIdx.Assign( pNd, nTmpPos ); - } - // If bFound is true then the string was found and is between nStart and nEnd sal_Bool bFound = sal_False; // start position in text or initial position |