summaryrefslogtreecommitdiff
path: root/svx/source/items
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-07-06 12:17:19 +0000
committerOliver Bolte <obo@openoffice.org>2004-07-06 12:17:19 +0000
commite63b2921fa18b22c0deab12d34025e0c0e8a6c66 (patch)
tree7a828f564bcf37e7c60327fc0bebd2ee8e5631d8 /svx/source/items
parente69c477bf456d73eb46628479ea4ce5de3dc3e29 (diff)
INTEGRATION: CWS docking1 (1.54.12); FILE MERGED
2004/05/29 21:29:54 cd 1.54.12.2: RESYNC: (1.54-1.55); FILE MERGED 2004/05/17 12:21:53 cd 1.54.12.1: #i26252# SvxFontHeightItem provides/expect font height in point metric as float type in uno::Any
Diffstat (limited to 'svx/source/items')
-rw-r--r--svx/source/items/textitem.cxx22
1 files changed, 18 insertions, 4 deletions
diff --git a/svx/source/items/textitem.cxx b/svx/source/items/textitem.cxx
index 4ec0c142a63c..e3cd8032eb1b 100644
--- a/svx/source/items/textitem.cxx
+++ b/svx/source/items/textitem.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: textitem.cxx,v $
*
- * $Revision: 1.55 $
+ * $Revision: 1.56 $
*
- * last change: $Author: rt $ $Date: 2004-05-07 15:51:05 $
+ * last change: $Author: obo $ $Date: 2004-07-06 13:17:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -990,8 +990,22 @@ sal_Bool SvxFontHeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const
{
drafts::com::sun::star::frame::status::FontHeight aFontHeight;
- aFontHeight.Height = (float)( nHeight / 20.0 );
- aFontHeight.Prop <<= (sal_Int16)(SFX_MAPUNIT_RELATIVE == ePropUnit ? nProp : 100);
+ // Point (also Twips) sind gefragt,
+ // also umrechnen, wenn CONVERT_TWIPS nicht gesetzt ist
+ if( bConvert )
+ {
+ long nTwips = bConvert ? nHeight : MM100_TO_TWIP(nHeight);
+ aFontHeight.Height = (float)( nTwips / 20.0 );
+ }
+ else
+ {
+ double fPoints = MM100_TO_TWIP((long)nHeight) / 20.0;
+ float fRoundPoints =
+ static_cast<float>(::rtl::math::round(fPoints, 1));
+ aFontHeight.Height = fRoundPoints;
+ }
+
+ aFontHeight.Prop = (sal_Int16)(SFX_MAPUNIT_RELATIVE == ePropUnit ? nProp : 100);
float fRet = (float)(short)nProp;
switch( ePropUnit )