diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-02-04 10:16:56 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-02-04 10:16:56 +0000 |
commit | 1ba0db2ec24be68b8aa598255e9eb5df84c95008 (patch) | |
tree | f408f247ed48e7d7e3d906af735439038a6a027b /svx/source/items | |
parent | 84c2223af3735568e9d5d0c9a8d7d198993edc33 (diff) |
INTEGRATION: CWS swqbetterbeta (1.57.62); FILE MERGED
2005/02/01 23:58:24 dvo 1.57.62.1: #i41746# remove SFX_MAPUNIT_ABSOLUTE from SvxFontHeightItem
(removes fix for #i4279#)
Diffstat (limited to 'svx/source/items')
-rw-r--r-- | svx/source/items/textitem.cxx | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/svx/source/items/textitem.cxx b/svx/source/items/textitem.cxx index 010a8687da7f..ca5e92cf4759 100644 --- a/svx/source/items/textitem.cxx +++ b/svx/source/items/textitem.cxx @@ -2,9 +2,9 @@ * * $RCSfile: textitem.cxx,v $ * - * $Revision: 1.57 $ + * $Revision: 1.58 $ * - * last change: $Author: kz $ $Date: 2005-01-18 14:33:57 $ + * last change: $Author: rt $ $Date: 2005-02-04 11:16:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1005,13 +1005,12 @@ sal_Bool SvxFontHeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const aFontHeight.Height = fRoundPoints; } - aFontHeight.Prop = (sal_Int16)(SFX_MAPUNIT_ABSOLUTE == ePropUnit ? 100 : nProp); + aFontHeight.Prop = (sal_Int16)(SFX_MAPUNIT_RELATIVE == ePropUnit ? nProp : 100); float fRet = (float)(short)nProp; switch( ePropUnit ) { case SFX_MAPUNIT_RELATIVE: - case SFX_MAPUNIT_ABSOLUTE: fRet = 0.; break; case SFX_MAPUNIT_100TH_MM: @@ -1048,7 +1047,7 @@ sal_Bool SvxFontHeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const } break; case MID_FONTHEIGHT_PROP: - rVal <<= (sal_Int16)(SFX_MAPUNIT_ABSOLUTE == ePropUnit ? 100 : nProp); + rVal <<= (sal_Int16)(SFX_MAPUNIT_RELATIVE == ePropUnit ? nProp : 100); break; case MID_FONTHEIGHT_DIFF: { @@ -1056,7 +1055,6 @@ sal_Bool SvxFontHeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const switch( ePropUnit ) { case SFX_MAPUNIT_RELATIVE: - case SFX_MAPUNIT_ABSOLUTE: fRet = 0.; break; case SFX_MAPUNIT_100TH_MM: @@ -1085,8 +1083,6 @@ sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, SfxMapUn short nDiff = 0; switch( eProp ) { - case SFX_MAPUNIT_ABSOLUTE: - break; case SFX_MAPUNIT_RELATIVE: nRet *= 100; nRet /= nProp; @@ -1128,6 +1124,8 @@ sal_Bool SvxFontHeightItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) if ( rVal >>= aFontHeight ) { // Height + ePropUnit = SFX_MAPUNIT_RELATIVE; + nProp = 100; double fPoint = aFontHeight.Height; if( fPoint < 0. || fPoint > 10000. ) return sal_False; @@ -1137,7 +1135,6 @@ sal_Bool SvxFontHeightItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) nHeight = TWIP_TO_MM100(nHeight); // umrechnen, wenn das Item 1/100mm enthaelt nProp = aFontHeight.Prop; - ePropUnit = SFX_MAPUNIT_ABSOLUTE; } else return sal_False; @@ -1145,7 +1142,7 @@ sal_Bool SvxFontHeightItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) break; case MID_FONTHEIGHT: { - ePropUnit = SFX_MAPUNIT_ABSOLUTE; + ePropUnit = SFX_MAPUNIT_RELATIVE; nProp = 100; double fPoint; if(!(rVal >>= fPoint)) @@ -1217,8 +1214,8 @@ SfxItemPresentation SvxFontHeightItem::GetPresentation case SFX_ITEM_PRESENTATION_NAMELESS: case SFX_ITEM_PRESENTATION_COMPLETE: { - if(ePropUnit < SFX_MAPUNIT_RELATIVE) { - + if( SFX_MAPUNIT_RELATIVE != ePropUnit ) + { ( rText = String::CreateFromInt32( (short)nProp ) ) += SVX_RESSTR( GetMetricId( ePropUnit ) ); if( 0 <= (short)nProp ) @@ -1269,7 +1266,7 @@ void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, const USHORT nNewProp, DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); #ifndef SVX_LIGHT - if( eUnit < SFX_MAPUNIT_RELATIVE ) + if( SFX_MAPUNIT_RELATIVE != eUnit ) nHeight = nNewHeight + ::ItemToControl( (short)nNewProp, eUnit, SFX_FUNIT_TWIP ); else @@ -1289,7 +1286,7 @@ void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, USHORT nNewProp, DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); #ifndef SVX_LIGHT - if( eMetric < SFX_MAPUNIT_RELATIVE ) + if( SFX_MAPUNIT_RELATIVE != eMetric ) nHeight = nNewHeight + ::ControlToItem( ::ItemToControl((short)nNewProp, eMetric, SFX_FUNIT_TWIP ), SFX_FUNIT_TWIP, |