Kaydet (Commit) 1397e7dd authored tarafından Michael Stahl's avatar Michael Stahl

sw: convert DBG_ASSERTs in SwAccessibleParagraph

... and fix a copy-paste error and remove some pointlessly defensive
code.

Change-Id: I08e74a6bc843b307d1c8a7157c2a67f471c00522
üst cd7beed5
...@@ -1154,9 +1154,7 @@ uno::Sequence< OUString > getAttributeNames() ...@@ -1154,9 +1154,7 @@ uno::Sequence< OUString > getAttributeNames()
pStrings[i++] = UNO_NAME_CHAR_UNDERLINE; pStrings[i++] = UNO_NAME_CHAR_UNDERLINE;
pStrings[i++] = UNO_NAME_CHAR_UNDERLINE_COLOR; pStrings[i++] = UNO_NAME_CHAR_UNDERLINE_COLOR;
pStrings[i++] = UNO_NAME_CHAR_WEIGHT; pStrings[i++] = UNO_NAME_CHAR_WEIGHT;
DBG_ASSERT( i == pSeq->getLength(), "Please adjust length" ); assert(i == pSeq->getLength());
if( i != pSeq->getLength() )
pSeq->realloc( i );
pNames = pSeq; pNames = pSeq;
} }
return *pNames; return *pNames;
...@@ -1184,9 +1182,7 @@ uno::Sequence< OUString > getSupplementalAttributeNames() ...@@ -1184,9 +1182,7 @@ uno::Sequence< OUString > getSupplementalAttributeNames()
pStrings[i++] = UNO_NAME_PARA_LINE_SPACING; pStrings[i++] = UNO_NAME_PARA_LINE_SPACING;
pStrings[i++] = UNO_NAME_PARA_RIGHT_MARGIN; pStrings[i++] = UNO_NAME_PARA_RIGHT_MARGIN;
pStrings[i++] = UNO_NAME_TABSTOPS; pStrings[i++] = UNO_NAME_TABSTOPS;
DBG_ASSERT( i == pSeq->getLength(), "Please adjust length" ); assert(i == pSeq->getLength());
if( i != pSeq->getLength() )
pSeq->realloc( i );
pNames = pSeq; pNames = pSeq;
} }
return *pNames; return *pNames;
...@@ -3755,8 +3751,7 @@ bool SwAccessibleParagraph::GetSelectionAtIndex( ...@@ -3755,8 +3751,7 @@ bool SwAccessibleParagraph::GetSelectionAtIndex(
} }
else else
{ {
DBG_ASSERT( nHere == nStartIndex, assert(nHere == nStartIndex);
"miscalculated index" );
// selection starts in this node: // selection starts in this node:
// then check whether it's before or inside our part of // then check whether it's before or inside our part of
...@@ -3770,10 +3765,11 @@ bool SwAccessibleParagraph::GetSelectionAtIndex( ...@@ -3770,10 +3765,11 @@ bool SwAccessibleParagraph::GetSelectionAtIndex(
else if( nCoreStart <= else if( nCoreStart <=
GetPortionData().GetLastValidCorePosition() ) GetPortionData().GetLastValidCorePosition() )
{ {
DBG_ASSERT( SAL_WARN_IF(
GetPortionData().IsValidCorePosition( GetPortionData().IsValidCorePosition(
nCoreStart ), nCoreStart),
"problem determining valid core position" ); "sw.core",
"problem determining valid core position");
nLocalStart = nLocalStart =
GetPortionData().GetAccessiblePosition( GetPortionData().GetAccessiblePosition(
...@@ -3792,8 +3788,7 @@ bool SwAccessibleParagraph::GetSelectionAtIndex( ...@@ -3792,8 +3788,7 @@ bool SwAccessibleParagraph::GetSelectionAtIndex(
} }
else else
{ {
DBG_ASSERT( nHere == nStartIndex, assert(nHere == nEndIndex);
"miscalculated index" );
// selection ends in this node: then select everything // selection ends in this node: then select everything
// before our part of the node // before our part of the node
...@@ -3809,10 +3804,11 @@ bool SwAccessibleParagraph::GetSelectionAtIndex( ...@@ -3809,10 +3804,11 @@ bool SwAccessibleParagraph::GetSelectionAtIndex(
GetPortionData().GetFirstValidCorePosition() ) GetPortionData().GetFirstValidCorePosition() )
{ {
// selection is inside our part of this para // selection is inside our part of this para
DBG_ASSERT( SAL_WARN_IF(
GetPortionData().IsValidCorePosition( GetPortionData().IsValidCorePosition(
nCoreEnd ), nCoreEnd),
"problem determining valid core position" ); "sw.core",
"problem determining valid core position");
nLocalEnd = GetPortionData().GetAccessiblePosition( nLocalEnd = GetPortionData().GetAccessiblePosition(
nCoreEnd ); nCoreEnd );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment