You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by or...@apache.org on 2012/08/10 13:09:09 UTC
svn commit: r1371655 - in /incubator/ooo/branches/AOO34: ./ main/
main/sw/source/core/view/printdata.cxx main/sw/source/ui/uno/unotxdoc.cxx
Author: orw
Date: Fri Aug 10 11:09:09 2012
New Revision: 1371655
URL: http://svn.apache.org/viewvc?rev=1371655&view=rev
Log:
#120389# - Printing in Writer
-- <SwRenderData> instance takes complete ownership of created comments printing data
-- fix memory leak regarding multiple creations of comments printing data
Found by: arthurgoldberg <artg at cs dot nyu dot edu>
Merged from trunk
Modified:
incubator/ooo/branches/AOO34/ (props changed)
incubator/ooo/branches/AOO34/main/ (props changed)
incubator/ooo/branches/AOO34/main/sw/source/core/view/printdata.cxx
incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxdoc.cxx
Propchange: incubator/ooo/branches/AOO34/
------------------------------------------------------------------------------
Merged /incubator/ooo/trunk:r1371648
Propchange: incubator/ooo/branches/AOO34/main/
------------------------------------------------------------------------------
Merged /incubator/ooo/trunk/main:r1371648
Modified: incubator/ooo/branches/AOO34/main/sw/source/core/view/printdata.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/AOO34/main/sw/source/core/view/printdata.cxx?rev=1371655&r1=1371654&r2=1371655&view=diff
==============================================================================
--- incubator/ooo/branches/AOO34/main/sw/source/core/view/printdata.cxx (original)
+++ incubator/ooo/branches/AOO34/main/sw/source/core/view/printdata.cxx Fri Aug 10 11:09:09 2012
@@ -78,6 +78,7 @@ void SwRenderData::CreatePostItData( SwD
m_pPostItFields = new _SetGetExpFlds;
lcl_GetPostIts( pDoc, m_pPostItFields );
m_pPostItDoc = new SwDoc;
+ m_pPostItDoc->acquire();
//!! Disable spell and grammar checking in the temporary document.
//!! Otherwise the grammar checker might process it and crash if we later on
@@ -94,11 +95,15 @@ void SwRenderData::DeletePostItData()
if (HasPostItData())
{
m_pPostItDoc->setPrinter( 0, false, false ); //damit am echten DOC der Drucker bleibt
- delete m_pPostItShell; //Nimmt das PostItDoc mit ins Grab.
- delete m_pPostItFields;
- m_pPostItDoc = 0;
+ delete m_pPostItShell;
m_pPostItShell = 0;
+ delete m_pPostItFields;
m_pPostItFields = 0;
+ if ( !m_pPostItDoc->release() )
+ {
+ delete m_pPostItDoc;
+ }
+ m_pPostItDoc = 0;
}
}
Modified: incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxdoc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxdoc.cxx?rev=1371655&r1=1371654&r2=1371655&view=diff
==============================================================================
--- incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxdoc.cxx (original)
+++ incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxdoc.cxx Fri Aug 10 11:09:09 2012
@@ -2783,6 +2783,10 @@ sal_Int32 SAL_CALL SwXTextDocument::getR
}
else
{
+ if ( m_pRenderData->HasPostItData() )
+ {
+ m_pRenderData->DeletePostItData();
+ }
const sal_Int16 nPostItMode = (sal_Int16) m_pPrintUIOptions->getIntValue( "PrintAnnotationMode", 0 );
if (nPostItMode != POSTITS_NONE)
{