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