summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-07 17:06:54 +0000
committerDavid Tardon <dtardon@redhat.com>2016-11-08 08:23:08 +0000
commit5c4ace9cc3eccbe252b5d284abcdc640ac763a50 (patch)
tree0719e4940dc66adbb7c3a788b5dc0f8f33c8ede1 /oox
parentd809a2b4a11d91b8feca788522e368bcee9f2926 (diff)
google docs can generate a pptx with an empty cmLst
Change-Id: I2a3dcae5361929c6880b2da1b3107cb2c8141f32 (cherry picked from commit e6157763e9fff300b86f3c17398216f306ba3f32) Reviewed-on: https://gerrit.libreoffice.org/30672 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx21
1 files changed, 12 insertions, 9 deletions
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 944f1349cee0..b67eb8b56817 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -325,15 +325,18 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
pCommentsPersistPtr->getCommentsList().cmLst.clear();
importSlide( xCommentsFragmentHandler, pCommentsPersistPtr );
- //set comment chars for last comment on slide
- SlideFragmentHandler* comment_handler =
- dynamic_cast<SlideFragmentHandler*>(xCommentsFragmentHandler.get());
- // some comments have no text -> set empty string as text to avoid
- // crash (back() on empty vector is undefined) and losing other
- // comment data that might be there (author, position, timestamp etc.)
- pCommentsPersistPtr->getCommentsList().cmLst.back().setText(
- comment_handler->getCharVector().empty() ? "" :
- comment_handler->getCharVector().back() );
+ if (!pCommentsPersistPtr->getCommentsList().cmLst.empty())
+ {
+ //set comment chars for last comment on slide
+ SlideFragmentHandler* comment_handler =
+ dynamic_cast<SlideFragmentHandler*>(xCommentsFragmentHandler.get());
+ // some comments have no text -> set empty string as text to avoid
+ // crash (back() on empty vector is undefined) and losing other
+ // comment data that might be there (author, position, timestamp etc.)
+ pCommentsPersistPtr->getCommentsList().cmLst.back().setText(
+ comment_handler->getCharVector().empty() ? "" :
+ comment_handler->getCharVector().back() );
+ }
pCommentsPersistPtr->getCommentAuthors().setValues(maAuthorList);
//insert all comments from commentsList