incubator-ooo-commits mailing list archives

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

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

Patch by: Lei Debin

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

Modified: incubator/ooo/trunk/main/sc/source/core/data/table3.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/core/data/table3.cxx?rev=1346850&r1=1346849&r2=1346850&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/core/data/table3.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/core/data/table3.cxx Wed Jun  6 12:35:03 2012
@@ -421,12 +421,12 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL
 			const ScPatternAttr* pPat2 = GetPattern(nCol2, nRow);
 			if (pPat1 != pPat2)
 			{
-				//maybe the content is the same
-				if (!(*pPat1 == *pPat2))
-				{
-					SetPattern(nCol1, nRow, *pPat2, sal_True);
-					SetPattern(nCol2, nRow, *pPat1, sal_True);
-				}
+				//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();
+				
 			}
 		}
 	}
@@ -443,12 +443,11 @@ void ScTable::SwapRow(SCROW nRow1, SCROW
 			const ScPatternAttr* pPat2 = GetPattern(nCol, nRow2);
 			if (pPat1 != pPat2)
 			{
-				//maybe the content is the same
-				if (!(*pPat1 == *pPat2))
-				{
-					SetPattern(nCol, nRow1, *pPat2, sal_True);
-					SetPattern(nCol, nRow2, *pPat1, sal_True);
-				}
+				//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/trunk/main/svl/inc/svl/poolitem.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svl/inc/svl/poolitem.hxx?rev=1346850&r1=1346849&r2=1346850&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svl/inc/svl/poolitem.hxx (original)
+++ incubator/ooo/trunk/main/svl/inc/svl/poolitem.hxx Wed Jun  6 12:35:03 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