diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-21 14:58:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-22 08:21:12 +0100 |
commit | 05044640531055c86b34f1c6ec8055c8a0ca3df8 (patch) | |
tree | bd5a756138f618ee54f48f3f4df8d07ccd905e67 /sw/source/uibase | |
parent | 03fcb4aae62a9403f22ec3671b61555419d02514 (diff) |
use boost::optional for OUString
instead of storing on heap
Change-Id: I4ca2bb58ec4f71b161c9e6081f5e456de54d8153
Reviewed-on: https://gerrit.libreoffice.org/65537
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/uiview/viewsrch.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index c4d6bf2fce8b..a127c1a12241 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -309,15 +309,14 @@ void SwView::ExecSearch(SfxRequest& rReq) m_pWrtShell->Push(); OUString aReplace( m_pSrchItem->GetReplaceString() ); i18nutil::SearchOptions2 aTmp( m_pSrchItem->GetSearchOptions() ); - OUString *pBackRef = sw::ReplaceBackReferences(aTmp, + boost::optional<OUString> xBackRef = sw::ReplaceBackReferences(aTmp, m_pWrtShell->GetCursor(), m_pWrtShell->GetLayout()); - if( pBackRef ) - m_pSrchItem->SetReplaceString( *pBackRef ); + if( xBackRef ) + m_pSrchItem->SetReplaceString( *xBackRef ); Replace(); - if( pBackRef ) + if( xBackRef ) { m_pSrchItem->SetReplaceString( aReplace ); - delete pBackRef; } if (bBack) { |