summaryrefslogtreecommitdiff
path: root/sw/source/core/text/atrstck.cxx
diff options
context:
space:
mode:
authormb93783 <mb93783@v60x-so15.Germany.Sun.COM>2009-12-02 12:43:33 +0100
committermb93783 <mb93783@v60x-so15.Germany.Sun.COM>2009-12-02 12:43:33 +0100
commit4c2df1ef1d3a8f73429ec9bd4e328fd659d89a6e (patch)
tree3daa52ff970a0fe4ada0fa08655d16c4b351f6c3 /sw/source/core/text/atrstck.cxx
parent89ad581281e4790f616db43f3dbe6cb769b9c00f (diff)
parent4a72548a893b94c5915a4f603ec69606c9484395 (diff)
merge to m66
Diffstat (limited to 'sw/source/core/text/atrstck.cxx')
-rw-r--r--sw/source/core/text/atrstck.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index 2fb76f93828a..31040d9665c5 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -523,13 +523,11 @@ void SwAttrHandler::PushAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
{
- ASSERT( rItem.Which() < RES_TXTATR_WITHEND_END ||
- RES_UNKNOWNATR_CONTAINER == rItem.Which() ,
+ ASSERT( rItem.Which() < RES_TXTATR_WITHEND_END,
"I do not want this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
// robust
- if ( RES_TXTATR_WITHEND_END <= rItem.Which() ||
- RES_UNKNOWNATR_CONTAINER == rItem.Which() )
+ if ( RES_TXTATR_WITHEND_END <= rItem.Which() )
return sal_False;
USHORT nStack = StackPos[ rItem.Which() ];
@@ -557,6 +555,9 @@ sal_Bool SwAttrHandler::Push( const SwTxtAttr& rAttr, const SfxPoolItem& rItem )
void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
{
+ if ( RES_TXTATR_WITHEND_END <= rAttr.Which() )
+ return; // robust
+
// these special attributes in fact represent a collection of attributes
// they have to be removed from each stack they belong to
if ( RES_TXTATR_INETFMT == rAttr.Which() ||
@@ -583,7 +584,7 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
}
// this is the usual case, we have a basic attribute, remove it from the
// stack and reset the font
- else if ( RES_UNKNOWNATR_CONTAINER != rAttr.Which() )
+ else
{
aAttrStack[ StackPos[ rAttr.Which() ] ].Remove( rAttr );
// reset font according to attribute on top of stack
@@ -600,13 +601,13 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
void SwAttrHandler::Pop( const SwTxtAttr& rAttr )
{
- ASSERT( rAttr.Which() < RES_TXTATR_WITHEND_END ||
- RES_UNKNOWNATR_CONTAINER == rAttr.Which() ,
+ ASSERT( rAttr.Which() < RES_TXTATR_WITHEND_END,
"I do not have this attribute, nWhich >= RES_TXTATR_WITHEND_END" );
- if ( RES_UNKNOWNATR_CONTAINER != rAttr.Which() &&
- rAttr.Which() < RES_TXTATR_WITHEND_END )
+ if ( rAttr.Which() < RES_TXTATR_WITHEND_END )
+ {
aAttrStack[ StackPos[ rAttr.Which() ] ].Remove( rAttr );
+ }
}
/*************************************************************************