From a0926265dbfc617603cfa1fb8a4a22a5663183fe Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 1 Dec 2012 12:18:53 +0000 Subject: Resolves: fdo#56549 crash in format->autocorrect->apply and edit changes regression from cad9afa15f53d547733fa55f1353772f6d696611 Change-Id: I1aa36bf86969a5a90456817d360d59125948e519 (cherry picked from commit 32c26ffb1f7585318a11f684a9886b58cea5b307) Reviewed-on: https://gerrit.libreoffice.org/1218 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna --- sw/inc/shellres.hxx | 2 +- sw/source/ui/utlui/initui.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx index 688fe084385c..7a7a543694b0 100644 --- a/sw/inc/shellres.hxx +++ b/sw/inc/shellres.hxx @@ -95,7 +95,7 @@ struct SW_DLLPUBLIC ShellResource : public Resource private: void _GetAutoFmtNameLst() const; - std::vector *pAutoFmtNameLst; + mutable std::vector *pAutoFmtNameLst; String sPageDescFirstName; String sPageDescFollowName; String sPageDescName; diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx index 1a3e6d4319d1..0b2dac9db19f 100644 --- a/sw/source/ui/utlui/initui.cxx +++ b/sw/source/ui/utlui/initui.cxx @@ -238,10 +238,10 @@ struct ImpAutoFmtNameListLoader : public Resource void ShellResource::_GetAutoFmtNameLst() const { - std::vector* pLst(pAutoFmtNameLst); - pLst = new std::vector; - pLst->reserve(STR_AUTOFMTREDL_END); - ImpAutoFmtNameListLoader aTmp( *pLst ); + assert(!pAutoFmtNameLst); + pAutoFmtNameLst = new std::vector; + pAutoFmtNameLst->reserve(STR_AUTOFMTREDL_END); + ImpAutoFmtNameListLoader aTmp(*pAutoFmtNameLst); } ImpAutoFmtNameListLoader::ImpAutoFmtNameListLoader( std::vector& rLst ) -- cgit v1.2.3