diff options
Diffstat (limited to 'svx/source/outliner/outliner.cxx')
-rw-r--r-- | svx/source/outliner/outliner.cxx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/svx/source/outliner/outliner.cxx b/svx/source/outliner/outliner.cxx index 3da9e8dbecac..fc144cf4304f 100644 --- a/svx/source/outliner/outliner.cxx +++ b/svx/source/outliner/outliner.cxx @@ -1867,6 +1867,20 @@ IMPL_LINK( Outliner, EndMovingParagraphsHdl, MoveParagraphsInfo*, pInfos ) return 0; } +static bool isSameNumbering( const SvxNumberFormat& rN1, const SvxNumberFormat& rN2 ) +{ + if( rN1.GetNumberingType() != rN2.GetNumberingType() ) + return false; + + if( rN1.GetNumStr(1) != rN2.GetNumStr(1) ) + return false; + + if( (rN1.GetPrefix() != rN2.GetPrefix()) || (rN1.GetSuffix() != rN2.GetSuffix()) ) + return false; + + return true; +} + sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pParaFmt ) { sal_uInt16 nNumber = pParaFmt->GetStart() - 1; @@ -1879,8 +1893,8 @@ sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pPar pPara = pParaList->GetParagraph( nPara ); const sal_Int16 nDepth = pPara->GetDepth(); - // ignore paragraphs that are below our paragraph - if( nDepth > nParaDepth ) + // ignore paragraphs that are below our paragraph or have no numbering + if( (nDepth > nParaDepth) || (nDepth == -1) ) continue; // stop on paragraphs that are above our paragraph @@ -1888,8 +1902,13 @@ sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pPar break; const SvxNumberFormat* pFmt = GetNumberFormat( nPara ); - if( pFmt == 0 || (*pFmt != *pParaFmt) ) - break; // change in number format, stop here + + if( pFmt == 0 ) + continue; // ignore paragraphs without bullets + + // check if numbering is the same + if( !isSameNumbering( *pFmt, *pParaFmt ) ) + break; const SfxBoolItem& rBulletState = (const SfxBoolItem&) pEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ); |