diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-04-04 13:39:38 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-04-11 10:19:05 +0000 |
commit | 84272d115da1165ac5f7cf4ae53875855d762b25 (patch) | |
tree | fa97d5319616492e230ebe03a08e1f898c389d77 /starmath | |
parent | 8568fec3b942e725a0114ff137a61b3292e079ed (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 'starmath')
-rw-r--r-- | starmath/source/unomodel.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 0bafd5b1e900..fb29c1459e78 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -39,6 +39,7 @@ #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <unotools/moduleoptions.hxx> +#include <tools/mapunit.hxx> #include <unomodel.hxx> #include <document.hxx> @@ -59,11 +60,6 @@ using namespace ::com::sun::star::formula; using namespace ::com::sun::star::view; using namespace ::com::sun::star::script; -#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)) - - - SmPrintUIOptions::SmPrintUIOptions() { ResStringArray aLocalizedStrings( SmResId( RID_PRINTUIOPTIONS ) ); @@ -526,7 +522,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* throw IllegalArgumentException(); Size aSize = aFormat.GetBaseSize(); nVal *= 20; - nVal = static_cast < sal_Int16 > ( TWIP_TO_MM100(nVal) ); + nVal = static_cast < sal_Int16 > ( convertTwipToMm100(nVal) ); aSize.Height() = nVal; aFormat.SetBaseSize(aSize); @@ -780,7 +776,7 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu { // Point! sal_Int16 nVal = static_cast < sal_Int16 > (aFormat.GetBaseSize().Height()); - nVal = static_cast < sal_Int16 > (MM100_TO_TWIP(nVal)); + nVal = static_cast < sal_Int16 > (convertMm100ToTwip(nVal)); nVal = (nVal + 10) / 20; *pValue <<= nVal; } |