From ed963dc6d712f7fe65489095765514892b19a188 Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Wed, 13 Jan 2010 15:57:11 +0100 Subject: sw33bf02: #b6912256# - assure consistent Writer core attributes if list styles are deleted via UNO-API --- sw/source/core/SwNumberTree/SwNodeNum.cxx | 19 ++++++++++++++++++- sw/source/core/unocore/unocrsrhelper.cxx | 10 ++++------ 2 files changed, 22 insertions(+), 7 deletions(-) (limited to 'sw') diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx index 171c4de920..c13b396e76 100644 --- a/sw/source/core/SwNumberTree/SwNodeNum.cxx +++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx @@ -40,6 +40,10 @@ // --> OD 2007-10-31 #i83479# #include // <-- +// --> OD 2010-01-13 #b6912256# +#include +#include +// <-- // --> OD 2008-02-19 #refactorlists# SwNodeNum::SwNodeNum( SwTxtNode* pTxtNode ) @@ -492,8 +496,21 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum ) SwTxtNode* pTxtNode( rNodeNum.GetTxtNode() ); if ( pTxtNode ) { - // --> OD 2008-03-13 #refactorlists# pTxtNode->RemoveFromList(); + // --> OD 2010-01-13 #b6912256# + // clear all list attributes and the list style + SvUShortsSort aResetAttrsArray; + aResetAttrsArray.Insert( RES_PARATR_LIST_ID ); + aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL ); + aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART ); + aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE ); + aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED ); + aResetAttrsArray.Insert( RES_PARATR_NUMRULE ); + SwPaM aPam( *pTxtNode ); + pTxtNode->GetDoc()->ResetAttrs( aPam, sal_False, + &aResetAttrsArray, + false ); + // <-- } } } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 1ac40712b4..c091439463 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -231,13 +231,11 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry // <-- case FN_NUMBER_NEWSTART: { + // a multi selection is not considered const SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode(); - // --> OD 2006-10-19 #134160# - make code robust: - // consider case that PaM doesn't denote a text node - const SwNumRule* pRule = pTxtNd ? pTxtNd->GetNumRule() : 0; + // --> OD 2010-01-13 #b6912256# + if ( pTxtNd && pTxtNd->IsInList() ) // <-- - // hier wird Multiselektion nicht beruecksichtigt - if( pRule ) { if( pAny ) { @@ -518,7 +516,7 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry } eNewState = aCharStyles.getLength() ? - PropertyState_DIRECT_VALUE : PropertyState_DEFAULT_VALUE;; + PropertyState_DIRECT_VALUE : PropertyState_DEFAULT_VALUE;; if(pAny) (*pAny) <<= aCharStyles; } -- cgit v1.2.3