summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-05-03 11:46:58 +0200
committerBosdonnat Cedric <cedric.bosdonnat@free.fr>2013-05-03 12:39:23 +0000
commit19e60e1a0507e041bbbbd2bf639782e990f7a55e (patch)
treed7d1d2c756691c1bf20d7b4d5a2d810b642320b2 /sw/source
parent0849bd9c5ef5ac885527cb98dafb9cea6200d8e5 (diff)
SwPostItMgr::Delete: fix crash when layout is not yet ready
pPostIt is 0 when we have a large document, and the layout is not yet ready for a later part of the document, having a comment. Just don't try to delete such comments, better than a crash. (cherry picked from commit 9a7641451dad5c73a936de5361aa3c3f148132d0) Change-Id: I5fd5c908bc7b1feba926214863e84391b9037484 Reviewed-on: https://gerrit.libreoffice.org/3757 Reviewed-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr> Tested-by: Bosdonnat Cedric <cedric.bosdonnat@free.fr>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 7f67fb0b441d..4a37c000bb04 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -1169,7 +1169,7 @@ void SwPostItMgr::Delete(String aAuthor)
aTmp.reserve( mvPostItFlds.size() );
for(std::list<SwSidebarItem*>::iterator pPostIt = mvPostItFlds.begin(); pPostIt!= mvPostItFlds.end() ; ++pPostIt)
{
- if ((*pPostIt)->GetFmtFld() && ((*pPostIt)->pPostIt->GetAuthor() == aAuthor) )
+ if ((*pPostIt)->GetFmtFld() && (*pPostIt)->pPostIt && ((*pPostIt)->pPostIt->GetAuthor() == aAuthor) )
aTmp.push_back( (*pPostIt)->GetFmtFld() );
}
for(std::vector<SwFmtFld*>::iterator i = aTmp.begin(); i!= aTmp.end() ; ++i)