xref: /aoo41x/main/sw/source/core/text/txtfld.cxx (revision dec99bbd)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 
27 
28 #include "hintids.hxx"
29 #include <fmtfld.hxx>
30 #include <txtfld.hxx>
31 #include <charfmt.hxx>
32 
33 #include "viewsh.hxx"   // NewFldPortion, GetDoc()
34 #include "doc.hxx"      // NewFldPortion, GetSysFldType()
35 #include "rootfrm.hxx"  // Info ueber virt. PageNumber
36 #include "pagefrm.hxx"  // NewFldPortion, GetVirtPageNum()
37 #include "ndtxt.hxx"    // NewNumberPortion, pHints->GetNum()
38 #include "fldbas.hxx"      // SwField
39 #include "viewopt.hxx"	// SwViewOptions
40 #include "flyfrm.hxx"	//IsInBody()
41 #include "viewimp.hxx"
42 #include "txtatr.hxx"   // SwTxtFld
43 #include "txtcfg.hxx"
44 #include "swfont.hxx"   // NewFldPortion, new SwFont
45 #include "fntcache.hxx"   // NewFldPortion, SwFntAccess
46 #include "porfld.hxx"
47 #include "porftn.hxx"   // NewExtraPortion
48 #include "porref.hxx"   // NewExtraPortion
49 #include "portox.hxx"   // NewExtraPortion
50 #include "porhyph.hxx"   // NewExtraPortion
51 #include "porfly.hxx"   // NewExtraPortion
52 #include "itrform2.hxx"   // SwTxtFormatter
53 #include "chpfld.hxx"
54 #include "dbfld.hxx"
55 #include "expfld.hxx"
56 #include "docufld.hxx"
57 #include "pagedesc.hxx"  // NewFldPortion, GetNum()
58 #include <pormulti.hxx> 	// SwMultiPortion
59 #include "fmtmeta.hxx" // lcl_NewMetaPortion
60 
61 
62 #ifndef _REFFLD_HXX
63 #include "reffld.hxx"
64 #endif
65 #ifndef _FLDDAT_HXX
66 #include "flddat.hxx"
67 #endif
68 /*************************************************************************
69  *                      SwTxtFormatter::NewFldPortion()
70  *************************************************************************/
71 
72 
lcl_IsInBody(SwFrm * pFrm)73 sal_Bool lcl_IsInBody( SwFrm *pFrm )
74 {
75 	if ( pFrm->IsInDocBody() )
76 		return sal_True;
77 	else
78 	{
79         const SwFrm *pTmp = pFrm;
80         const SwFlyFrm *pFly;
81 		while ( 0 != (pFly = pTmp->FindFlyFrm()) )
82             pTmp = pFly->GetAnchorFrm();
83 		return pTmp->IsInDocBody();
84 	}
85 }
86 
87 
NewFldPortion(SwTxtFormatInfo & rInf,const SwTxtAttr * pHint) const88 SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
89 												const SwTxtAttr *pHint ) const
90 {
91 	SwExpandPortion *pRet = 0;
92 	SwFrm *pFrame = (SwFrm*)pFrm;
93 	SwField *pFld = (SwField*)pHint->GetFmtFld().GetField();
94 	const sal_Bool bName = rInf.GetOpt().IsFldName();
95 
96 	SwCharFmt* pChFmt = 0;
97 	sal_Bool bNewFlyPor = sal_False,
98 		 bINet = sal_False;
99 	sal_uInt16 subType;
100 	// set language
101 	((SwTxtFormatter*)this)->SeekAndChg( rInf );
102 	if (pFld->GetLanguage() != GetFnt()->GetLanguage())
103 	{
104 		pFld->SetLanguage( GetFnt()->GetLanguage() );
105 		// let the visual note know about its new language
106 		if (pFld->GetTyp()->Which()==RES_POSTITFLD)
107 			const_cast<SwFmtFld*> (&pHint->GetFmtFld())->Broadcast( SwFmtFldHint( &pHint->GetFmtFld(), SWFMTFLD_LANGUAGE ) );
108 	}
109 
110 	ViewShell *pSh = rInf.GetVsh();
111     SwDoc *const pDoc( (pSh) ? pSh->GetDoc() : 0 );
112     bool const bInClipboard( (pDoc) ? pDoc->IsClipBoard() : true );
113     sal_Bool bPlaceHolder = sal_False;
114 
115 	switch( pFld->GetTyp()->Which() )
116 	{
117 		case RES_SCRIPTFLD:
118 		case RES_POSTITFLD:
119 			pRet = new SwPostItsPortion( RES_SCRIPTFLD == pFld->GetTyp()->Which() );
120 			break;
121 
122 		case RES_COMBINED_CHARS:
123 			{
124 				if( bName )
125                 {
126                     String const sName( pFld->GetFieldName() );
127                     pRet = new SwFldPortion(sName);
128                 }
129 				else
130                 {
131                     String const sContent( pFld->ExpandField(bInClipboard) );
132                     pRet = new SwCombinedPortion(sContent);
133                 }
134 			}
135 			break;
136 
137 		case RES_HIDDENTXTFLD:
138             {
139                 String const str( (bName)
140                         ? pFld->GetFieldName()
141                         : pFld->ExpandField(bInClipboard) );
142                 pRet = new SwHiddenPortion(str);
143             }
144 			break;
145 
146 		case RES_CHAPTERFLD:
147 			if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() )
148 			{
149 				((SwChapterField*)pFld)->ChangeExpansion( pFrame,
150 										&((SwTxtFld*)pHint)->GetTxtNode() );
151 			}
152             {
153                 String const str( (bName)
154                         ? pFld->GetFieldName()
155                         : pFld->ExpandField(bInClipboard) );
156                 pRet = new SwFldPortion( str );
157             }
158 			break;
159 
160 		case RES_DOCSTATFLD:
161 			if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() )
162             {
163 				((SwDocStatField*)pFld)->ChangeExpansion( pFrame );
164             }
165             {
166                 String const str( (bName)
167                         ? pFld->GetFieldName()
168                         : pFld->ExpandField(bInClipboard) );
169                 pRet = new SwFldPortion( str );
170             }
171             if(pRet)
172                 ((SwFldPortion*)pRet)->m_nAttrFldType= ATTR_PAGECOOUNTFLD;
173             break;
174 
175 		case RES_PAGENUMBERFLD:
176 		{
177 			if( !bName && pSh && pSh->GetLayout() && !pSh->Imp()->IsUpdateExpFlds() )//swmod 080122
178 			{
179                 SwPageNumberFieldType *pPageNr = (SwPageNumberFieldType *)pFld->GetTyp();
180 
181                 const SwRootFrm* pTmpRootFrm = pSh->GetLayout();
182                 const sal_Bool bVirt = pTmpRootFrm->IsVirtPageNum();
183 
184                 MSHORT nVirtNum = pFrame->GetVirtPageNum();
185                 MSHORT nNumPages = pTmpRootFrm->GetPageNum();
186 				sal_Int16 nNumFmt = -1;
187 				if(SVX_NUM_PAGEDESC == pFld->GetFormat())
188 					nNumFmt = pFrame->FindPageFrm()->GetPageDesc()->GetNumType().GetNumberingType();
189 
190 				pPageNr->ChangeExpansion( pDoc, nVirtNum, nNumPages,
191 											bVirt, nNumFmt > -1 ? &nNumFmt : 0);
192 			}
193             {
194                 String const str( (bName)
195                         ? pFld->GetFieldName()
196                         : pFld->ExpandField(bInClipboard) );
197                 pRet = new SwFldPortion( str );
198             }
199             if(pRet)
200                 ((SwFldPortion*)pRet)->m_nAttrFldType= ATTR_PAGENUMBERFLD;
201             break;
202 		}
203 		case RES_GETEXPFLD:
204 		{
205 			if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() )
206 			{
207 				SwGetExpField* pExpFld = (SwGetExpField*)pFld;
208 				if( !::lcl_IsInBody( pFrame ) )
209 				{
210 					pExpFld->ChgBodyTxtFlag( sal_False );
211 					pExpFld->ChangeExpansion( *pFrame, *((SwTxtFld*)pHint) );
212 				}
213 				else if( !pExpFld->IsInBodyTxt() )
214 				{
215 					// war vorher anders, also erst expandieren, dann umsetzen!!
216 					pExpFld->ChangeExpansion( *pFrame, *((SwTxtFld*)pHint) );
217 					pExpFld->ChgBodyTxtFlag( sal_True );
218 				}
219 			}
220             {
221                 String const str( (bName)
222                         ? pFld->GetFieldName()
223                         : pFld->ExpandField(bInClipboard) );
224                 pRet = new SwFldPortion( str );
225             }
226 			break;
227 		}
228 		case RES_DBFLD:
229 		{
230 			if( !bName )
231 			{
232 				SwDBField* pDBFld = (SwDBField*)pFld;
233 				pDBFld->ChgBodyTxtFlag( ::lcl_IsInBody( pFrame ) );
234 /* Solange das ChangeExpansion auskommentiert ist.
235  * Aktualisieren in Kopf/Fuszeilen geht aktuell nicht.
236 				if( !::lcl_IsInBody( pFrame ) )
237 				{
238 					pDBFld->ChgBodyTxtFlag( sal_False );
239 					pDBFld->ChangeExpansion( pFrame, (SwTxtFld*)pHint );
240 				}
241 				else if( !pDBFld->IsInBodyTxt() )
242 				{
243 					// war vorher anders, also erst expandieren, dann umsetzen!!
244 					pDBFld->ChangeExpansion( pFrame, (SwTxtFld*)pHint );
245 					pDBFld->ChgBodyTxtFlag( sal_True );
246 				}
247 */
248 			}
249             {
250                 String const str( (bName)
251                         ? pFld->GetFieldName()
252                         : pFld->ExpandField(bInClipboard) );
253                 pRet = new SwFldPortion(str);
254             }
255 			break;
256 		}
257 		case RES_REFPAGEGETFLD:
258 			if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() )
259             {
260 				((SwRefPageGetField*)pFld)->ChangeExpansion( pFrame, (SwTxtFld*)pHint );
261             }
262             {
263                 String const str( (bName)
264                         ? pFld->GetFieldName()
265                         : pFld->ExpandField(bInClipboard) );
266                 pRet = new SwFldPortion(str);
267             }
268 			break;
269 
270 		case RES_JUMPEDITFLD:
271 			if( !bName )
272 				pChFmt =  ((SwJumpEditField*)pFld)->GetCharFmt();
273 			bNewFlyPor = sal_True;
274             bPlaceHolder = sal_True;
275 			break;
276 		case RES_GETREFFLD:
277 			subType = ((SwGetRefField*)pFld)->GetSubType();
278             {
279                 String const str( (bName)
280                         ? pFld->GetFieldName()
281                         : pFld->ExpandField(bInClipboard) );
282                 pRet = new SwFldPortion(str);
283             }
284             if(pRet)
285 			{
286 				if( subType == REF_BOOKMARK  )
287                     ((SwFldPortion*)pRet)->m_nAttrFldType = ATTR_BOOKMARKFLD;
288 				else if( subType == REF_SETREFATTR )
289 					((SwFldPortion*)pRet)->m_nAttrFldType = ATTR_SETREFATTRFLD;
290 				break;
291 			}
292 		case RES_DATETIMEFLD:
293 			subType = ((SwDateTimeField*)pFld)->GetSubType();
294             {
295                 String const str( (bName)
296                         ? pFld->GetFieldName()
297                         : pFld->ExpandField(bInClipboard) );
298                 pRet = new SwFldPortion(str);
299             }
300             if(pRet)
301 			{
302 				if( subType & DATEFLD  )
303 					((SwFldPortion*)pRet)->m_nAttrFldType= ATTR_DATEFLD;
304 				else if( subType & TIMEFLD )
305 					((SwFldPortion*)pRet)->m_nAttrFldType = ATTR_TIMEFLD;
306 				break;
307 			}
308 		default:
309             {
310                 String const str( (bName)
311                         ? pFld->GetFieldName()
312                         : pFld->ExpandField(bInClipboard) );
313                 pRet = new SwFldPortion(str);
314             }
315 	}
316 
317 	if( bNewFlyPor )
318 	{
319 		SwFont *pTmpFnt = 0;
320 		if( !bName )
321 		{
322 			pTmpFnt = new SwFont( *pFnt );
323 			if( bINet )
324 			{
325 				SwAttrPool* pPool = pChFmt->GetAttrSet().GetPool();
326 				SfxItemSet aSet( *pPool, RES_CHRATR_BEGIN, RES_CHRATR_END );
327 				SfxItemSet aTmpSet( aSet );
328                 pFrm->GetTxtNode()->GetAttr(aSet,rInf.GetIdx(),rInf.GetIdx()+1);
329 				aTmpSet.Set( pChFmt->GetAttrSet() );
330 				aTmpSet.Differentiate( aSet );
331 				if( aTmpSet.Count() )
332                     pTmpFnt->SetDiffFnt( &aTmpSet, pFrm->GetTxtNode()->getIDocumentSettingAccess() );
333 			}
334 			else
335                 pTmpFnt->SetDiffFnt( &pChFmt->GetAttrSet(), pFrm->GetTxtNode()->getIDocumentSettingAccess() );
336 		}
337         {
338             String const str( (bName)
339                     ? pFld->GetFieldName()
340                     : pFld->ExpandField(bInClipboard) );
341             pRet = new SwFldPortion(str, pTmpFnt, bPlaceHolder);
342         }
343 	}
344 
345 	return pRet;
346 }
347 
348 /*************************************************************************
349  *                      SwTxtFormatter::TryNewNoLengthPortion()
350  *************************************************************************/
351 
lcl_NewMetaPortion(SwTxtAttr & rHint,const bool bPrefix)352 SwFldPortion * lcl_NewMetaPortion(SwTxtAttr & rHint, const bool bPrefix)
353 {
354     ::sw::Meta *const pMeta(
355         static_cast<SwFmtMeta &>(rHint.GetAttr()).GetMeta() );
356     ::rtl::OUString fix;
357     ::sw::MetaField *const pField( dynamic_cast< ::sw::MetaField * >(pMeta) );
358     OSL_ENSURE(pField, "lcl_NewMetaPortion: no meta field?");
359     if (pField)
360     {
361         pField->GetPrefixAndSuffix((bPrefix) ? &fix : 0, (bPrefix) ? 0 : &fix);
362     }
363     return new SwFldPortion( fix );
364 }
365 
366 /** Try to create a new portion with zero length, for an end of a hint
367     (where there is no CH_TXTATR). Because there may be multiple hint ends at a
368     given index, m_nHintEndIndex is used to keep track of the already created
369     portions. But the portions created here may actually be deleted again,
370     due to UnderFlow. In that case, m_nHintEndIndex must be decremented,
371     so the portion will be created again on the next line.
372  */
373 SwExpandPortion *
TryNewNoLengthPortion(SwTxtFormatInfo & rInfo)374 SwTxtFormatter::TryNewNoLengthPortion(SwTxtFormatInfo & rInfo)
375 {
376     if (pHints)
377     {
378         const xub_StrLen nIdx(rInfo.GetIdx());
379         while (m_nHintEndIndex < pHints->GetEndCount())
380         {
381             SwTxtAttr & rHint( *pHints->GetEnd(m_nHintEndIndex) );
382             xub_StrLen const nEnd( *rHint.GetAnyEnd() );
383             if (nEnd > nIdx)
384             {
385                 break;
386             }
387             ++m_nHintEndIndex;
388             if (nEnd == nIdx)
389             {
390                 if (RES_TXTATR_METAFIELD == rHint.Which())
391                 {
392                     SwFldPortion *const pPortion(
393                             lcl_NewMetaPortion(rHint, false));
394                     pPortion->SetNoLength(); // no CH_TXTATR at hint end!
395                     return pPortion;
396                 }
397             }
398         }
399     }
400     return 0;
401 }
402 
403 /*************************************************************************
404  *                      SwTxtFormatter::NewExtraPortion()
405  *************************************************************************/
406 
NewExtraPortion(SwTxtFormatInfo & rInf)407 SwLinePortion *SwTxtFormatter::NewExtraPortion( SwTxtFormatInfo &rInf )
408 {
409     SwTxtAttr *pHint = GetAttr( rInf.GetIdx() );
410     SwLinePortion *pRet = 0;
411     if( !pHint )
412     {
413         pRet = new SwTxtPortion;
414         pRet->SetLen( 1 );
415         rInf.SetLen( 1 );
416         return pRet;
417     }
418 
419     switch( pHint->Which() )
420     {
421     case RES_TXTATR_FLYCNT :
422         {
423             pRet = NewFlyCntPortion( rInf, pHint );
424             break;
425         }
426     case RES_TXTATR_FTN :
427         {
428             pRet = NewFtnPortion( rInf, pHint );
429             break;
430         }
431     case RES_TXTATR_FIELD :
432     case RES_TXTATR_ANNOTATION :
433         {
434             pRet = NewFldPortion( rInf, pHint );
435             break;
436         }
437     case RES_TXTATR_REFMARK :
438         {
439             pRet = new SwIsoRefPortion;
440             break;
441         }
442     case RES_TXTATR_TOXMARK :
443         {
444             pRet = new SwIsoToxPortion;
445             break;
446         }
447     case RES_TXTATR_METAFIELD:
448         {
449             pRet = lcl_NewMetaPortion( *pHint, true );
450             break;
451         }
452     default: ;
453     }
454     if( !pRet )
455     {
456         const XubString aNothing;
457         pRet = new SwFldPortion( aNothing );
458         rInf.SetLen( 1 );
459     }
460     return pRet;
461 }
462 
463 /*************************************************************************
464  *                      SwTxtFormatter::NewNumberPortion()
465  *************************************************************************/
466 
467 
NewNumberPortion(SwTxtFormatInfo & rInf) const468 SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
469 {
470 	if( rInf.IsNumDone() || rInf.GetTxtStart() != nStart
471 				|| rInf.GetTxtStart() != rInf.GetIdx() )
472 		return 0;
473 
474 	SwNumberPortion *pRet = 0;
475 	const SwTxtNode* pTxtNd = GetTxtFrm()->GetTxtNode();
476 	const SwNumRule* pNumRule = pTxtNd->GetNumRule();
477 
478 	// hat ein "gueltige" Nummer ?
479     if( pTxtNd->IsNumbered() && pTxtNd->IsCountedInList())
480 	{
481         const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()) );
482 		const sal_Bool bLeft = SVX_ADJUST_LEFT == rNumFmt.GetNumAdjust();
483 		const sal_Bool bCenter = SVX_ADJUST_CENTER == rNumFmt.GetNumAdjust();
484         // --> OD 2008-01-23 #newlistlevelattrs#
485         const bool bLabelAlignmentPosAndSpaceModeActive(
486                 rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT );
487         const KSHORT nMinDist = bLabelAlignmentPosAndSpaceModeActive
488                                 ? 0 : rNumFmt.GetCharTextDistance();
489         // <--
490 
491 		if( SVX_NUM_BITMAP == rNumFmt.GetNumberingType() )
492 		{
493             // --> OD 2008-01-23 #newlistlevelattrs#
494             pRet = new SwGrfNumPortion( (SwFrm*)GetTxtFrm(),
495                                         pTxtNd->GetLabelFollowedBy(),
496                                         rNumFmt.GetBrush(),
497                                         rNumFmt.GetGraphicOrientation(),
498                                         rNumFmt.GetGraphicSize(),
499                                         bLeft, bCenter, nMinDist,
500                                         bLabelAlignmentPosAndSpaceModeActive );
501             // <--
502 			long nTmpA = rInf.GetLast()->GetAscent();
503 			long nTmpD = rInf.GetLast()->Height() - nTmpA;
504 			if( !rInf.IsTest() )
505 				((SwGrfNumPortion*)pRet)->SetBase( nTmpA, nTmpD, nTmpA, nTmpD );
506 		}
507 		else
508 		{
509 			// Der SwFont wird dynamisch angelegt und im CTOR uebergeben,
510 			// weil das CharFmt nur einen SV-Font zurueckliefert.
511 			// Im Dtor vom SwNumberPortion wird der SwFont deletet.
512 			SwFont *pNumFnt = 0;
513 			const SwAttrSet* pFmt = rNumFmt.GetCharFmt() ?
514                                     &rNumFmt.GetCharFmt()->GetAttrSet() :
515                                     NULL;
516             const IDocumentSettingAccess* pIDSA = pTxtNd->getIDocumentSettingAccess();
517 
518             if( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() )
519 			{
520 				const Font *pFmtFnt = rNumFmt.GetBulletFont();
521 
522                 //
523                 // Build a new bullet font basing on the current paragraph font:
524                 //
525                 pNumFnt = new SwFont( &rInf.GetCharAttr(), pIDSA );
526 
527                 // --> FME 2005-08-11 #i53199#
528                 if ( !pIDSA->get(IDocumentSettingAccess::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT) )
529                 {
530                     // i18463:
531                     // Underline style of paragraph font should not be considered
532                     // Overline style of paragraph font should not be considered
533                     // Weight style of paragraph font should not be considered
534                     // Posture style of paragraph font should not be considered
535                     pNumFnt->SetUnderline( UNDERLINE_NONE );
536                     pNumFnt->SetOverline( UNDERLINE_NONE );
537                     pNumFnt->SetItalic( ITALIC_NONE, SW_LATIN );
538                     pNumFnt->SetItalic( ITALIC_NONE, SW_CJK );
539                     pNumFnt->SetItalic( ITALIC_NONE, SW_CTL );
540                     pNumFnt->SetWeight( WEIGHT_NORMAL, SW_LATIN );
541                     pNumFnt->SetWeight( WEIGHT_NORMAL, SW_CJK );
542                     pNumFnt->SetWeight( WEIGHT_NORMAL, SW_CTL );
543                 }
544 
545                 //
546                 // Apply the explicit attributes from the character style
547                 // associated with the numering to the new bullet font.
548                 //
549 				if( pFmt )
550                     pNumFnt->SetDiffFnt( pFmt, pIDSA );
551 
552                 if ( pFmtFnt )
553 				{
554 					const sal_uInt8 nAct = pNumFnt->GetActual();
555 					pNumFnt->SetFamily( pFmtFnt->GetFamily(), nAct );
556 					pNumFnt->SetName( pFmtFnt->GetName(), nAct );
557 					pNumFnt->SetStyleName( pFmtFnt->GetStyleName(), nAct );
558 					pNumFnt->SetCharSet( pFmtFnt->GetCharSet(), nAct );
559 					pNumFnt->SetPitch( pFmtFnt->GetPitch(), nAct );
560 				}
561 
562                 // we do not allow a vertical font
563                 pNumFnt->SetVertical( pNumFnt->GetOrientation(),
564                                       pFrm->IsVertical() );
565 
566                 // --> OD 2008-01-23 #newlistelevelattrs#
567                 pRet = new SwBulletPortion( rNumFmt.GetBulletChar(),
568                                             pTxtNd->GetLabelFollowedBy(),
569                                             pNumFnt,
570                                             bLeft, bCenter, nMinDist,
571                                             bLabelAlignmentPosAndSpaceModeActive );
572                 // <--
573 			}
574 			else
575 			{
576                 XubString aTxt( pTxtNd->GetNumString() );
577                 // --> OD 2008-01-23 #newlistlevelattrs#
578                 if ( aTxt.Len() > 0 )
579                 {
580                     aTxt.Insert( pTxtNd->GetLabelFollowedBy() );
581                 }
582                 // <--
583 
584 				// 7974: Nicht nur eine Optimierung...
585 				// Eine Numberportion ohne Text wird die Breite von 0
586 				// erhalten. Die nachfolgende Textportion wird im BreakLine
587 				// in das BreakCut laufen, obwohl rInf.GetLast()->GetFlyPortion()
588 				// vorliegt!
589 				if( aTxt.Len() )
590 				{
591                     //
592                     // Build a new numbering font basing on the current paragraph font:
593                     //
594                     pNumFnt = new SwFont( &rInf.GetCharAttr(), pIDSA );
595 
596                     // --> FME 2005-08-11 #i53199#
597                     if ( !pIDSA->get(IDocumentSettingAccess::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT) )
598                     {
599                         // i18463:
600                         // Underline style of paragraph font should not be considered
601                         pNumFnt->SetUnderline( UNDERLINE_NONE );
602                         // Overline style of paragraph font should not be considered
603                         pNumFnt->SetOverline( UNDERLINE_NONE );
604                     }
605 
606 
607                     //
608                     // Apply the explicit attributes from the character style
609                     // associated with the numering to the new bullet font.
610                     //
611 					if( pFmt )
612                         pNumFnt->SetDiffFnt( pFmt, pIDSA );
613 
614                     // we do not allow a vertical font
615                     pNumFnt->SetVertical( pNumFnt->GetOrientation(), pFrm->IsVertical() );
616 
617                     // --> OD 2008-01-23 #newlistlevelattrs#
618                     pRet = new SwNumberPortion( aTxt, pNumFnt,
619                                                 bLeft, bCenter, nMinDist,
620                                                 bLabelAlignmentPosAndSpaceModeActive );
621                     // <--
622 				}
623 			}
624 		}
625 	}
626 	return pRet;
627 }
628 
629