summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <od@openoffice.org>2010-01-13 15:57:11 +0100
committerOliver-Rainer Wittmann <od@openoffice.org>2010-01-13 15:57:11 +0100
commited963dc6d712f7fe65489095765514892b19a188 (patch)
tree5fd87dbf0494b2419805162ac82041940dfc8971 /sw
parentd3c001f6e069f93e1385fabd3c9fcd334ccb28dc (diff)
sw33bf02: #b6912256# - assure consistent Writer core attributes if list styles are deleted via UNO-API
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/SwNumberTree/SwNodeNum.cxx19
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx10
2 files changed, 22 insertions, 7 deletions
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 <IDocumentListItems.hxx>
// <--
+// --> OD 2010-01-13 #b6912256#
+#include <svl/svstdarr.hxx>
+#include <doc.hxx>
+// <--
// --> 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;
}