Kaydet (Commit) 691e2f97 authored tarafından Herbert Dürr's avatar Herbert Dürr

#i118877# updated fix for Calc crash when Redo refreshes data

Patch by: Lei Debin
üst 9268b63d
...@@ -421,12 +421,12 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2) ...@@ -421,12 +421,12 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2)
const ScPatternAttr* pPat2 = GetPattern(nCol2, nRow); const ScPatternAttr* pPat2 = GetPattern(nCol2, nRow);
if (pPat1 != pPat2) if (pPat1 != pPat2)
{ {
//maybe the content is the same //Add Reference to avoid pPat1 to be deleted by merge same cell attributes for adjacent cells
if (!(*pPat1 == *pPat2)) if( IsPooledItem( pPat1 ) ) pPat1->AddRef();
{ SetPattern(nCol1, nRow, *pPat2, sal_True);
SetPattern(nCol1, nRow, *pPat2, sal_True); SetPattern(nCol2, nRow, *pPat1, sal_True);
SetPattern(nCol2, nRow, *pPat1, sal_True); if( IsPooledItem( pPat1 ) ) pPat1->ReleaseRef();
}
} }
} }
} }
...@@ -443,12 +443,11 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2) ...@@ -443,12 +443,11 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
const ScPatternAttr* pPat2 = GetPattern(nCol, nRow2); const ScPatternAttr* pPat2 = GetPattern(nCol, nRow2);
if (pPat1 != pPat2) if (pPat1 != pPat2)
{ {
//maybe the content is the same //Add Reference to avoid pPat1 to be deleted by merge same cell attributes for adjacent cells
if (!(*pPat1 == *pPat2)) if( IsPooledItem( pPat1 ) ) pPat1->AddRef();
{ SetPattern(nCol, nRow1, *pPat2, sal_True);
SetPattern(nCol, nRow1, *pPat2, sal_True); SetPattern(nCol, nRow2, *pPat1, sal_True);
SetPattern(nCol, nRow2, *pPat1, sal_True); if( IsPooledItem( pPat1 ) ) pPat1->ReleaseRef();
}
} }
} }
} }
......
...@@ -188,8 +188,8 @@ private: ...@@ -188,8 +188,8 @@ private:
inline void SetKind( sal_uInt16 n ); inline void SetKind( sal_uInt16 n );
public: public:
inline sal_uLong AddRef( sal_uLong n = 1 ) const; inline sal_uLong AddRef( sal_uLong n = 1 ) const;
private:
inline sal_uLong ReleaseRef( sal_uLong n = 1 ) const; inline sal_uLong ReleaseRef( sal_uLong n = 1 ) const;
private:
SVL_DLLPRIVATE long Delete_Impl(void*); SVL_DLLPRIVATE long Delete_Impl(void*);
#if 0 #if 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment