Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9FF4CA11 for ; Wed, 6 Jun 2012 12:35:25 +0000 (UTC) Received: (qmail 57862 invoked by uid 500); 6 Jun 2012 12:35:25 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 57768 invoked by uid 500); 6 Jun 2012 12:35:25 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 57759 invoked by uid 99); 6 Jun 2012 12:35:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2012 12:35:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Jun 2012 12:35:24 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5111123889BF; Wed, 6 Jun 2012 12:35:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: ooo-commits@incubator.apache.org From: hdu@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120606123504.5111123889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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