Index: source/core/fields/chpfld.cxx =================================================================== --- source/core/fields/chpfld.cxx (revision 1380462) +++ source/core/fields/chpfld.cxx (working copy) @@ -138,6 +138,31 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum) { + if (bSrchNum && !rTxtNd.IsOutline()) + { + SwNumRule* pRule(rTxtNd.GetNumRule()); + if (rTxtNd.IsCountedInList() && pRule) + { + sNumber = rTxtNd.GetNumString(false); + const SwNumFmt& rNFmt = pRule->Get(static_cast(rTxtNd.GetActualListLevel())); + sPost = rNFmt.GetSuffix(); + sPre = rNFmt.GetPrefix(); + } + else + { + sNumber = String::CreateFromAscii("0"); + sPost = aEmptyStr; + sPre = aEmptyStr; + } + sTitle = rTxtNd.GetExpandTxt(); + + for( xub_StrLen i = 0; i < sTitle.Len(); ++i ) + if( ' ' > sTitle.GetChar( i ) ) + sTitle.Erase( i--, 1 ); + + return; + } + SwDoc* pDoc = (SwDoc*)rTxtNd.GetDoc(); const SwTxtNode *pTxtNd = rTxtNd.FindOutlineNodeOfLevel( nLevel ); if( pTxtNd )