summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-04-26 18:22:31 +0200
committerMichael Stahl <mst@openoffice.org>2010-04-26 18:22:31 +0200
commitcaa1ed58b354fa289d4801d716b63c64f3bc495e (patch)
tree9bc9e1906f04fdb10b24e07b56313a45d7ef56b4
parent1bd25912372dad5ad1371d363838b35b0775861d (diff)
sw33bf03: #i108345#: SwpHintsArray::Check(): check for overlapping AUTOFMT
-rw-r--r--sw/source/core/txtnode/ndhints.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx
index ef165b010aea..ee05b1fe2180 100644
--- a/sw/source/core/txtnode/ndhints.cxx
+++ b/sw/source/core/txtnode/ndhints.cxx
@@ -372,7 +372,7 @@ bool SwpHintsArray::Check() const
CHECK_ERR( !isCHRATR(nWhich),
"HintsCheck: Character attribute in end array" );
- // 8) portion check
+ // 8) style portion check
#if OSL_DEBUG_LEVEL > 1
const SwTxtAttr* pHtThis = m_HintStarts[i];
const SwTxtAttr* pHtLast = i > 0 ? m_HintStarts[i-1] : 0;
@@ -380,11 +380,19 @@ bool SwpHintsArray::Check() const
( RES_TXTATR_CHARFMT != pHtLast->Which() && RES_TXTATR_AUTOFMT != pHtLast->Which() ) ||
( RES_TXTATR_CHARFMT != pHtThis->Which() && RES_TXTATR_AUTOFMT != pHtThis->Which() ) ||
( *pHtThis->GetStart() >= *pHtLast->GetEnd() ) ||
- ( *pHtThis->GetStart() == *pHtLast->GetStart() && *pHtThis->GetEnd() == *pHtLast->GetEnd() ) ||
- ( *pHtThis->GetStart() == *pHtThis->GetEnd() ),
+ ( ( ( (*pHtThis->GetStart() == *pHtLast->GetStart())
+ && (*pHtThis->GetEnd() == *pHtLast->GetEnd())
+ ) // same range
+ || (*pHtThis->GetStart() == *pHtThis->GetEnd())
+ )
+ && ( (pHtThis->Which() != RES_TXTATR_AUTOFMT)
+ || (pHtLast->Which() != RES_TXTATR_AUTOFMT)
+ ) // never two AUTOFMT on same range
+ ),
"HintsCheck: Portion inconsistency. "
"This can be temporarily ok during undo operations" );
+ // 9) nesting portion check
if (pHtThis->IsNesting())
{
for ( USHORT j = 0; j < Count(); ++j )
@@ -402,7 +410,7 @@ bool SwpHintsArray::Check() const
}
}
- // 9) dummy char check (unfortunately cannot check SwTxtNode::m_Text)
+ // 10) dummy char check (unfortunately cannot check SwTxtNode::m_Text)
if (pHtThis->HasDummyChar())
{
for ( USHORT j = 0; j < i; ++j )