From 4126104867709da30b1a8391b4345688084eace7 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Thu, 4 Sep 2008 09:22:32 +0000 Subject: INTEGRATION: CWS swenhancedfields2 (1.57.232); FILE MERGED 2008/08/07 11:51:12 b_michaelsen 1.57.232.3: fixed formatting in trvlfrm.cxx portxt.cxx portxt.hxx swfont.cxx unobkm.cxx unocoll.cxx amd unoportenum.cxx 2008/08/04 14:17:02 b_michaelsen 1.57.232.2: RESYNC: (1.57-1.58); FILE MERGED 2008/04/23 14:29:19 ama 1.57.232.1: #i33737#: Enhanced fields --- sw/source/core/txtnode/swfont.cxx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index d922b03f8790..8efc0795a6b9 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: swfont.cxx,v $ - * $Revision: 1.58 $ + * $Revision: 1.59 $ * * This file is part of OpenOffice.org. * @@ -795,6 +795,31 @@ Size SwSubFont::_GetTxtSize( SwDrawTextInfo& rInf ) } } + if (1==rInf.GetLen() && CH_TXT_ATR_FIELDSTART==rInf.GetText().GetChar(rInf.GetIdx())) + { + xub_StrLen nOldIdx(rInf.GetIdx()); + xub_StrLen nOldLen(rInf.GetLen()); + String aNewText=String::CreateFromAscii(CH_TXT_ATR_SUBST_FIELDSTART); + rInf.SetText( aNewText ); + rInf.SetIdx( 0 ); + rInf.SetLen( aNewText.Len() ); + aTxtSize = pLastFont->GetTextSize( rInf ); + rInf.SetIdx( nOldIdx ); + rInf.SetLen( nOldLen ); + } + else if (1==rInf.GetLen() && CH_TXT_ATR_FIELDEND==rInf.GetText().GetChar(rInf.GetIdx())) + { + xub_StrLen nOldIdx(rInf.GetIdx()); + xub_StrLen nOldLen(rInf.GetLen()); + String aNewText=String::CreateFromAscii(CH_TXT_ATR_SUBST_FIELDEND); + rInf.SetText( aNewText ); + rInf.SetIdx( 0 ); + rInf.SetLen( aNewText.Len() ); + aTxtSize = pLastFont->GetTextSize( rInf ); + rInf.SetIdx( nOldIdx ); + rInf.SetLen( nOldLen ); + } + return aTxtSize; } -- cgit