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