diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2005-03-23 09:53:45 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2005-03-23 09:53:45 +0000 |
commit | 0d879dadece247d719c4562af494a1fe927dd620 (patch) | |
tree | f9b8c96d3fb52e273e4c7ea9367887939570dbb8 | |
parent | ab2b41a9f377c17435d654bd252e8a29f8a18127 (diff) |
INTEGRATION: CWS os56 (1.29.296); FILE MERGED
2005/03/11 15:30:02 os 1.29.296.1: #i40843# XLineWidhtItem: converting twips now supported
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index d5fa853b20e6..753d4c9b0d76 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xattr.cxx,v $ * - * $Revision: 1.29 $ + * $Revision: 1.30 $ * - * last change: $Author: hr $ $Date: 2004-11-26 15:10:56 $ + * last change: $Author: vg $ $Date: 2005-03-23 10:53:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -142,6 +142,9 @@ using namespace ::com::sun::star; #define GLOBALOVERFLOW +#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) +#define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L)) + /************************************************************************/ #define VCLTOSVCOL( rCol ) (USHORT)((((USHORT)(rCol))<<8)|(rCol)) @@ -1349,7 +1352,11 @@ SfxItemPresentation XLineWidthItem::GetPresentation sal_Bool XLineWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, BYTE nMemberId ) const { - rVal <<= (sal_Int32)GetValue(); + sal_Int32 nValue = GetValue(); + if( 0 != (nMemberId&CONVERT_TWIPS) ) + nValue = TWIP_TO_MM100(nValue); + + rVal <<= nValue; return sal_True; } @@ -1357,6 +1364,8 @@ sal_Bool XLineWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal, BYTE { sal_Int32 nValue; rVal >>= nValue; + if( 0 != (nMemberId&CONVERT_TWIPS) ) + nValue = MM100_TO_TWIP(nValue); SetValue( nValue ); return sal_True; |