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
commitbed6ae689e836a3c2494dec840bb7946a409619b (patch)
tree45494e647a867283cbcfd86f79e350065e35e423 /sw
parentc3436b84cde501fee0f8ddde012f5c81d20a1760 (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 171c4de9208d..c13b396e76f4 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 4f4c7c2658b5..d64281038bb3 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;
}