incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1346854 - in /incubator/ooo/branches/AOO34/main: sc/source/core/data/table3.cxx svl/inc/svl/poolitem.hxx
Date Wed, 06 Jun 2012 12:41:07 GMT
Author: hdu
Date: Wed Jun  6 12:41:07 2012
New Revision: 1346854

URL: http://svn.apache.org/viewvc?rev=1346854&view=rev
Log:
#i118877# fix for Calc crash when Redo refreshes data

Patch by: Lei Debin

Modified:
    incubator/ooo/branches/AOO34/main/sc/source/core/data/table3.cxx
    incubator/ooo/branches/AOO34/main/svl/inc/svl/poolitem.hxx

Modified: incubator/ooo/branches/AOO34/main/sc/source/core/data/table3.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/AOO34/main/sc/source/core/data/table3.cxx?rev=1346854&r1=1346853&r2=1346854&view=diff
==============================================================================
--- incubator/ooo/branches/AOO34/main/sc/source/core/data/table3.cxx (original)
+++ incubator/ooo/branches/AOO34/main/sc/source/core/data/table3.cxx Wed Jun  6 12:41:07 2012
@@ -421,8 +421,12 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL
 			const ScPatternAttr* pPat2 = GetPattern(nCol2, nRow);
 			if (pPat1 != pPat2)
 			{
+				//Add Reference to avoid pPat1 to be deleted by merge same cell attributes for adjacent
cells
+				if( IsPooledItem( pPat1 ) ) pPat1->AddRef();
 				SetPattern(nCol1, nRow, *pPat2, sal_True);
 				SetPattern(nCol2, nRow, *pPat1, sal_True);
+				if( IsPooledItem( pPat1 ) ) pPat1->ReleaseRef();
+				
 			}
 		}
 	}
@@ -439,8 +443,11 @@ void ScTable::SwapRow(SCROW nRow1, SCROW
 			const ScPatternAttr* pPat2 = GetPattern(nCol, nRow2);
 			if (pPat1 != pPat2)
 			{
+				//Add Reference to avoid pPat1 to be deleted by merge same cell attributes for adjacent
cells
+				if( IsPooledItem( pPat1 ) ) pPat1->AddRef();
 				SetPattern(nCol, nRow1, *pPat2, sal_True);
 				SetPattern(nCol, nRow2, *pPat1, sal_True);
+				if( IsPooledItem( pPat1 ) ) pPat1->ReleaseRef();
 			}
 		}
 	}

Modified: incubator/ooo/branches/AOO34/main/svl/inc/svl/poolitem.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/AOO34/main/svl/inc/svl/poolitem.hxx?rev=1346854&r1=1346853&r2=1346854&view=diff
==============================================================================
--- incubator/ooo/branches/AOO34/main/svl/inc/svl/poolitem.hxx (original)
+++ incubator/ooo/branches/AOO34/main/svl/inc/svl/poolitem.hxx Wed Jun  6 12:41:07 2012
@@ -188,8 +188,8 @@ private:
 	inline void				 SetKind( sal_uInt16 n );
 public:
 	inline sal_uLong             AddRef( sal_uLong n = 1 ) const;
-private:
 	inline sal_uLong             ReleaseRef( sal_uLong n = 1 ) const;
+private:
 	SVL_DLLPRIVATE long      Delete_Impl(void*);
 
 #if 0



Mime
View raw message