[Libreoffice] [PATCH] MSWordExportBase::ExportDocument: check if we have a DocShell

Miklos Vajna vmiklos at frugalware.org
Mon Aug 1 11:26:24 PDT 2011


Hello Noel,

I recently tested the copy&paste export (using RTF) on master and got a
crash. The attached patch solves the issue here.

OK to push, or you want to add a check in the called SwMSConvertControls
constructor?

Thanks.
-------------- next part --------------
From 9ab1204db32020ad0d70e91fb06e12b9c6a2b398 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos at frugalware.org>
Date: Mon, 1 Aug 2011 19:55:42 +0200
Subject: [PATCH] MSWordExportBase::ExportDocument: check if we have a
 DocShell

This fixes a crash during RTF export invoked by copy&paste, as the
called constructor would unconditionally dereference the DocShell's
pointer since commit 183c9723dce0296baa0a38220199a1aa0e9f52ca.
---
 sw/source/filter/ww8/wrtww8.cxx |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index edad4b1..cf07bc8 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2925,7 +2925,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll )
     if ( !pOleMap)
         pOleMap = new WW8OleMaps;
 
-    if ( !pOCXExp )
+    if ( !pOCXExp && pDoc->GetDocShell() )
         pOCXExp = new SwMSConvertControls( pDoc->GetDocShell(), pCurPam );
 
     // #i81405# - Collect anchored objects before changing the redline mode.
-- 
1.7.6

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110801/abde5d1c/attachment.pgp>


More information about the LibreOffice mailing list