diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-26 12:47:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-26 16:00:38 +0200 |
commit | ec694a32ea6c9f0287e8c12f4de62047abfcde72 (patch) | |
tree | 6be4394b3bb98870ee49bbb1c10269791ed7add5 /sw | |
parent | 7f6fbed9f195078ed63760f1206a328f38571ba8 (diff) |
avoid some allocation in SwDoc::ResetAttrs
can put SwDataChanged on the stack
Change-Id: I6631d04e181e2156184833642abdfab83092da60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135015
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index bbdd0b1ea6fb..dbf8fefeda4a 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -296,10 +296,10 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, } // #i96644# - std::unique_ptr< SwDataChanged > xDataChanged; + std::optional< SwDataChanged > oDataChanged; if ( bSendDataChangedEvents ) { - xDataChanged.reset( new SwDataChanged( *pPam ) ); + oDataChanged.emplace( *pPam ); } SwHistory* pHst = nullptr; if (GetIDocumentUndoRedo().DoesUndo()) @@ -395,7 +395,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, getIDocumentState().SetModified(); - xDataChanged.reset(); //before delete pPam + oDataChanged.reset(); //before delete pPam if( pPam != &rRg ) delete pPam; |