incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject svn commit: r1350103 - in /incubator/ooo/trunk/main/sc: inc/document.hxx source/core/data/documen9.cxx source/ui/view/dbfunc3.cxx
Date Thu, 14 Jun 2012 06:45:04 GMT
Author: leiw
Date: Thu Jun 14 06:45:03 2012
New Revision: 1350103

URL: http://svn.apache.org/viewvc?rev=1350103&view=rev
Log:
#i119956 - Crash if undo redo creating data pilot from imported data 

          Patch by: pengyunquan
          Review by: Wang Lei

Modified:
    incubator/ooo/trunk/main/sc/inc/document.hxx
    incubator/ooo/trunk/main/sc/source/core/data/documen9.cxx
    incubator/ooo/trunk/main/sc/source/ui/view/dbfunc3.cxx

Modified: incubator/ooo/trunk/main/sc/inc/document.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/inc/document.hxx?rev=1350103&r1=1350102&r2=1350103&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/inc/document.hxx (original)
+++ incubator/ooo/trunk/main/sc/inc/document.hxx Thu Jun 14 06:45:03 2012
@@ -712,6 +712,9 @@ public:
 	ScDrawLayer*	GetDrawLayer()				{ return pDrawLayer; }
 	SfxBroadcaster*	GetDrawBroadcaster();		// zwecks Header-Vermeidung
 	void			BeginDrawUndo();
+	sal_Bool		IsDrawRecording() const;
+	void			EndDrawUndo();//paired with BeginDrawUndo, clear undo object if GetUndoObj is not
called. 
+								//Not necessary if GetUndoObj is called, but call EndDrawUndo paired with BeginDrawUndo
is recommended
 
     void            BeginUnoRefUndo();
     bool            HasUnoRefUndo() const       { return ( pUnoRefUndoList != NULL ); }

Modified: incubator/ooo/trunk/main/sc/source/core/data/documen9.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/core/data/documen9.cxx?rev=1350103&r1=1350102&r2=1350103&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/core/data/documen9.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/core/data/documen9.cxx Thu Jun 14 06:45:03 2012
@@ -78,6 +78,17 @@ void ScDocument::BeginDrawUndo()
 		pDrawLayer->BeginCalcUndo();
 }
 
+sal_Bool ScDocument::IsDrawRecording() const
+{
+	return pDrawLayer ? pDrawLayer->IsRecording() : sal_False;
+}
+
+void ScDocument::EndDrawUndo()
+{
+	if( pDrawLayer )
+		delete pDrawLayer->GetCalcUndo();
+}
+
 XColorTable* ScDocument::GetColorTable()
 {
 	if (pDrawLayer)

Modified: incubator/ooo/trunk/main/sc/source/ui/view/dbfunc3.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/view/dbfunc3.cxx?rev=1350103&r1=1350102&r2=1350103&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/view/dbfunc3.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/view/dbfunc3.cxx Thu Jun 14 06:45:03 2012
@@ -614,6 +614,11 @@ bool ScDBFunc::MakePivotTable( const ScD
 
 		SCTAB nNewTab = nSrcTab+1;
 
+		const bool bDrawUndo = ( bUndo && !pDoc->IsDrawRecording() );
+
+		if( bDrawUndo )
+			pDoc->BeginDrawUndo();
+
 		SCTAB i=1;
 		while ( !pDoc->InsertTab( nNewTab, lcl_MakePivotTabName( aName, i ) ) && i <=
MAXTAB )
 			i++;
@@ -629,6 +634,9 @@ bool ScDBFunc::MakePivotTable( const ScD
 		SetTabNo( nNewTab, sal_True );
 
 		aDestRange = ScRange( 0, 0, nNewTab );
+
+		if( bDrawUndo )
+			pDoc->EndDrawUndo();
 	}
 
 	ScDPObject* pDPObj = pDoc->GetDPAtCursor(



Mime
View raw message