summaryrefslogtreecommitdiff
path: root/svx/source/xoutdev
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-04-04 13:39:38 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-04-11 10:19:05 +0000
commit84272d115da1165ac5f7cf4ae53875855d762b25 (patch)
treefa97d5319616492e230ebe03a08e1f898c389d77 /svx/source/xoutdev
parent8568fec3b942e725a0114ff137a61b3292e079ed (diff)
Introduce twip/mm100 conversion functions instead of duplicated macros
Change-Id: Ib689e35b417e0e9016cd6a239c986e0603a99d62 Reviewed-on: https://gerrit.libreoffice.org/8837 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'svx/source/xoutdev')
-rw-r--r--svx/source/xoutdev/xattr.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 800542e81ec2..a8f6a1b2287f 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -31,6 +31,7 @@
#include <svl/itempool.hxx>
#include <editeng/memberids.hrc>
#include <tools/stream.hxx>
+#include <tools/mapunit.hxx>
#include "svx/unoapi.hxx"
#include <svl/style.hxx>
@@ -57,9 +58,6 @@
using namespace ::rtl;
using namespace ::com::sun::star;
-#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 ) (sal_uInt16)((((sal_uInt16)(rCol))<<8)|(rCol))
TYPEINIT1_AUTOFACTORY(NameOrIndex, SfxStringItem);
@@ -1092,7 +1090,7 @@ bool XLineWidthItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMe
{
sal_Int32 nValue = GetValue();
if( 0 != (nMemberId&CONVERT_TWIPS) )
- nValue = TWIP_TO_MM100(nValue);
+ nValue = convertTwipToMm100(nValue);
rVal <<= nValue;
return true;
@@ -1103,7 +1101,7 @@ bool XLineWidthItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8
sal_Int32 nValue = 0;
rVal >>= nValue;
if( 0 != (nMemberId&CONVERT_TWIPS) )
- nValue = MM100_TO_TWIP(nValue);
+ nValue = convertMm100ToTwip(nValue);
SetValue( nValue );
return true;