summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/swfont.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-09-04 09:22:32 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-09-04 09:22:32 +0000
commit4126104867709da30b1a8391b4345688084eace7 (patch)
tree94f92e01ba6facefe4262cd8cb508e6b8a51235b /sw/source/core/txtnode/swfont.cxx
parente5d875dbad4e42f0dba375c4f865787902a5d9a9 (diff)
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
Diffstat (limited to 'sw/source/core/txtnode/swfont.cxx')
-rw-r--r--sw/source/core/txtnode/swfont.cxx27
1 files changed, 26 insertions, 1 deletions
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;
}