[Libreoffice-commits] core.git: cui/source editeng/source include/tools starmath/source svl/source svx/source sw/inc sw/qa sw/source writerfilter/source

Tor Lillqvist tml at collabora.com
Fri Apr 11 03:19:34 PDT 2014


 cui/source/tabpages/numpages.cxx                 |   15 +--
 editeng/source/items/frmitems.cxx                |   98 ++++++++++-------------
 editeng/source/items/numitem.cxx                 |    9 --
 editeng/source/items/paraitem.cxx                |   30 ++-----
 editeng/source/items/textitem.cxx                |   31 +++----
 include/tools/mapunit.hxx                        |   16 +++
 starmath/source/unomodel.cxx                     |   10 --
 svl/source/items/ptitem.cxx                      |   16 +--
 svx/source/dialog/rulritem.cxx                   |   28 +++---
 svx/source/items/algitem.cxx                     |   28 ++----
 svx/source/items/grfitem.cxx                     |   21 ++--
 svx/source/xoutdev/xattr.cxx                     |    8 -
 sw/inc/swtypes.hxx                               |    8 -
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx         |    2 
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx         |   10 +-
 sw/qa/extras/rtfexport/rtfexport.cxx             |    4 
 sw/qa/extras/rtfimport/rtfimport.cxx             |   20 ++--
 sw/qa/extras/ww8import/ww8import.cxx             |    4 
 sw/source/core/graphic/ndgrf.cxx                 |    8 -
 sw/source/core/layout/atrfrm.cxx                 |   36 ++++----
 sw/source/core/para/paratr.cxx                   |    8 -
 sw/source/core/uibase/config/fontcfg.cxx         |    4 
 sw/source/core/uibase/config/modcfg.cxx          |   16 +--
 sw/source/core/uibase/config/usrpref.cxx         |   12 +-
 sw/source/core/uibase/envelp/envimg.cxx          |   32 +++----
 sw/source/core/uibase/envelp/labelcfg.cxx        |   32 +++----
 sw/source/core/uibase/envelp/labimg.cxx          |   32 +++----
 sw/source/core/uibase/shells/grfsh.cxx           |   20 ++--
 sw/source/core/uibase/uiview/view.cxx            |   24 ++---
 sw/source/core/uibase/uno/unomod.cxx             |    8 -
 sw/source/core/uibase/uno/unotxdoc.cxx           |   32 +++----
 sw/source/core/uibase/uno/unotxvw.cxx            |    4 
 sw/source/core/uibase/utlui/uiitems.cxx          |   12 +-
 sw/source/core/unocore/unodraw.cxx               |   34 +++----
 sw/source/core/unocore/unoframe.cxx              |    4 
 sw/source/core/unocore/unoidx.cxx                |    4 
 sw/source/core/unocore/unosett.cxx               |   44 +++++-----
 sw/source/core/unocore/unotbl.cxx                |   42 ++++-----
 sw/source/filter/html/htmlform.cxx               |   24 ++---
 sw/source/filter/ww8/docxattributeoutput.cxx     |    6 -
 sw/source/filter/xml/xmlexp.cxx                  |    8 -
 sw/source/filter/xml/xmlimp.cxx                  |    8 -
 sw/source/filter/xml/xmltexti.cxx                |    4 
 sw/source/ui/index/cntex.cxx                     |    2 
 sw/source/ui/vba/vbainformationhelper.cxx        |    2 
 writerfilter/source/dmapper/ConversionHelper.cxx |    7 -
 writerfilter/source/rtftok/rtfdocumentimpl.cxx   |   34 +++----
 writerfilter/source/rtftok/rtfsdrimport.cxx      |   19 ++--
 48 files changed, 420 insertions(+), 460 deletions(-)

New commits:
commit 84272d115da1165ac5f7cf4ae53875855d762b25
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Apr 4 13:39:38 2014 +0300

    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 at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index a85745a..2588b18 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -25,6 +25,7 @@
 #include <numpages.hrc>
 #include <dialmgr.hxx>
 #include <tools/shl.hxx>
+#include <tools/mapunit.hxx>
 #include <i18nlangtag/mslangid.hxx>
 #include <helpid.hrc>
 #include <editeng/numitem.hxx>
@@ -2687,25 +2688,23 @@ SvxNumPositionTabPage::~SvxNumPositionTabPage()
 #if OSL_DEBUG_LEVEL > 1
 void lcl_PrintDebugOutput(FixedText& rFixed, const SvxNumberFormat& rNumFmt)
 {
-#define TWIP_TO_MM100(TWIP)     ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
-
     OUString const sHash( " # " );
     if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
     {
-        OUString sDebugText( OUString::number( TWIP_TO_MM100(rNumFmt.GetAbsLSpace() ) ) );
+        OUString sDebugText( OUString::number( convertTwipToMm100(rNumFmt.GetAbsLSpace() ) ) );
         sDebugText += sHash;
-        sDebugText += OUString::number( TWIP_TO_MM100(rNumFmt.GetCharTextDistance() ) );
+        sDebugText += OUString::number( convertTwipToMm100(rNumFmt.GetCharTextDistance() ) );
         sDebugText += sHash;
-        sDebugText += OUString::number( TWIP_TO_MM100(rNumFmt.GetFirstLineOffset() ) );
+        sDebugText += OUString::number( convertTwipToMm100(rNumFmt.GetFirstLineOffset() ) );
         rFixed.SetText(sDebugText);
     }
     else if ( rNumFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
     {
-        OUString sDebugText( OUString::number( TWIP_TO_MM100(rNumFmt.GetListtabPos() ) ) );
+        OUString sDebugText( OUString::number( convertTwipToMm100(rNumFmt.GetListtabPos() ) ) );
         sDebugText += sHash;
-        sDebugText += OUString::number( TWIP_TO_MM100(rNumFmt.GetFirstLineIndent() ) );
+        sDebugText += OUString::number( convertTwipToMm100(rNumFmt.GetFirstLineIndent() ) );
         sDebugText += sHash;
-        sDebugText += OUString::number( TWIP_TO_MM100(rNumFmt.GetIndentAt() ) );
+        sDebugText += OUString::number( convertTwipToMm100(rNumFmt.GetIndentAt() ) );
         rFixed.SetText(sDebugText);
     }
 
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 75b6f3a..398c9ed 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -56,6 +56,7 @@
 #include <svtools/borderhelper.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/ustrbuf.hxx>
+#include <tools/mapunit.hxx>
 #include <vcl/graphicfilter.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/svapp.hxx>
@@ -87,13 +88,6 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::drawing;
 using namespace ::com::sun::star::table::BorderLineStyle;
 
-
-// Conversion for UNO
-#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 TWIP_TO_MM100_UNSIGNED(TWIP)     ((((TWIP)*127L+36L)/72L))
-#define MM100_TO_TWIP_UNSIGNED(MM100)    ((((MM100)*72L+63L)/127L))
-
 /*
 SvxBorderLine is not an SfxPoolItem, and has no Store/Create serialization/deserialization methods.
 Since border line information needs to be serialized by the table autoformat code, these file-local
@@ -241,8 +235,8 @@ bool SvxSizeItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     awt::Size aTmp(aSize.Width(), aSize.Height());
     if( bConvert )
     {
-        aTmp.Height = TWIP_TO_MM100(aTmp.Height);
-        aTmp.Width = TWIP_TO_MM100(aTmp.Width);
+        aTmp.Height = convertTwipToMm100(aTmp.Height);
+        aTmp.Width = convertTwipToMm100(aTmp.Width);
     }
 
     switch( nMemberId )
@@ -270,8 +264,8 @@ bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             {
                 if(bConvert)
                 {
-                    aTmp.Height = MM100_TO_TWIP(aTmp.Height);
-                    aTmp.Width = MM100_TO_TWIP(aTmp.Width);
+                    aTmp.Height = convertMm100ToTwip(aTmp.Height);
+                    aTmp.Width = convertMm100ToTwip(aTmp.Width);
                 }
                 aSize = Size( aTmp.Width, aTmp.Height );
             }
@@ -287,7 +281,7 @@ bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             if(!(rVal >>= nVal ))
                 return false;
 
-            aSize.Width() = bConvert ? MM100_TO_TWIP(nVal) : nVal;
+            aSize.Width() = bConvert ? convertMm100ToTwip(nVal) : nVal;
         }
         break;
         case MID_SIZE_HEIGHT:
@@ -296,7 +290,7 @@ bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             if(!(rVal >>= nVal))
                 return true;
 
-            aSize.Height() = bConvert ? MM100_TO_TWIP(nVal) : nVal;
+            aSize.Height() = bConvert ? convertMm100ToTwip(nVal) : nVal;
         }
         break;
         default: OSL_FAIL("Wrong MemberId!");
@@ -458,14 +452,14 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     {
         // now all signed
         case MID_L_MARGIN:
-            rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLeftMargin) : nLeftMargin);
+            rVal <<= (sal_Int32)(bConvert ? convertTwipToMm100(nLeftMargin) : nLeftMargin);
             break;
 
         case MID_TXT_LMARGIN :
-            rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100(nTxtLeft) : nTxtLeft);
+            rVal <<= (sal_Int32)(bConvert ? convertTwipToMm100(nTxtLeft) : nTxtLeft);
         break;
         case MID_R_MARGIN:
-            rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100(nRightMargin) : nRightMargin);
+            rVal <<= (sal_Int32)(bConvert ? convertTwipToMm100(nRightMargin) : nRightMargin);
             break;
         case MID_L_REL_MARGIN:
             rVal <<= (sal_Int16)nPropLeftMargin;
@@ -475,7 +469,7 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         break;
 
         case MID_FIRST_LINE_INDENT:
-            rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100(nFirstLineOfst) : nFirstLineOfst);
+            rVal <<= (sal_Int32)(bConvert ? convertTwipToMm100(nFirstLineOfst) : nFirstLineOfst);
             break;
 
         case MID_FIRST_LINE_REL_INDENT:
@@ -507,15 +501,15 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
     switch( nMemberId )
     {
         case MID_L_MARGIN:
-            SetLeft((sal_Int32)bConvert ? MM100_TO_TWIP(nVal) : nVal);
+            SetLeft((sal_Int32)bConvert ? convertMm100ToTwip(nVal) : nVal);
             break;
 
         case MID_TXT_LMARGIN :
-            SetTxtLeft((sal_Int32)bConvert ? MM100_TO_TWIP(nVal) : nVal);
+            SetTxtLeft((sal_Int32)bConvert ? convertMm100ToTwip(nVal) : nVal);
         break;
 
         case MID_R_MARGIN:
-            SetRight((sal_Int32)    bConvert ? MM100_TO_TWIP(nVal) : nVal);
+            SetRight((sal_Int32)    bConvert ? convertMm100ToTwip(nVal) : nVal);
             break;
         case MID_L_REL_MARGIN:
         case MID_R_REL_MARGIN:
@@ -533,7 +527,7 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
         }
         break;
         case MID_FIRST_LINE_INDENT     :
-            SetTxtFirstLineOfst((short)(bConvert ?  MM100_TO_TWIP(nVal) : nVal));
+            SetTxtFirstLineOfst((short)(bConvert ?  convertMm100ToTwip(nVal) : nVal));
             break;
 
         case MID_FIRST_LINE_REL_INDENT:
@@ -863,15 +857,15 @@ bool    SvxULSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         case 0:
         {
             ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;
-            aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED(nUpper) : nUpper);
-            aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED(nLower) : nPropUpper);
+            aUpperLowerMarginScale.Upper = (sal_Int32)(bConvert ? convertTwipToMm100(nUpper) : nUpper);
+            aUpperLowerMarginScale.Lower = (sal_Int32)(bConvert ? convertTwipToMm100(nLower) : nPropUpper);
             aUpperLowerMarginScale.ScaleUpper = (sal_Int16)nPropUpper;
             aUpperLowerMarginScale.ScaleLower = (sal_Int16)nPropLower;
             rVal <<= aUpperLowerMarginScale;
             break;
         }
-        case MID_UP_MARGIN: rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED(nUpper) : nUpper); break;
-        case MID_LO_MARGIN: rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED(nLower) : nLower); break;
+        case MID_UP_MARGIN: rVal <<= (sal_Int32)(bConvert ? convertTwipToMm100(nUpper) : nUpper); break;
+        case MID_LO_MARGIN: rVal <<= (sal_Int32)(bConvert ? convertTwipToMm100(nLower) : nLower); break;
         case MID_CTX_MARGIN: rVal <<= bContext; break;
         case MID_UP_REL_MARGIN: rVal <<= (sal_Int16) nPropUpper; break;
         case MID_LO_REL_MARGIN: rVal <<= (sal_Int16) nPropLower; break;
@@ -894,8 +888,8 @@ bool SvxULSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             if ( !(rVal >>= aUpperLowerMarginScale ))
                 return false;
             {
-                SetUpper((sal_uInt16)(bConvert ? MM100_TO_TWIP( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper));
-                SetLower((sal_uInt16)(bConvert ? MM100_TO_TWIP( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower));
+                SetUpper((sal_uInt16)(bConvert ? convertMm100ToTwip( aUpperLowerMarginScale.Upper ) : aUpperLowerMarginScale.Upper));
+                SetLower((sal_uInt16)(bConvert ? convertMm100ToTwip( aUpperLowerMarginScale.Lower ) : aUpperLowerMarginScale.Lower));
                 if( aUpperLowerMarginScale.ScaleUpper > 1 )
                     nPropUpper = aUpperLowerMarginScale.ScaleUpper;
                 if( aUpperLowerMarginScale.ScaleLower > 1 )
@@ -906,12 +900,12 @@ bool SvxULSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
         case MID_UP_MARGIN :
             if(!(rVal >>= nVal) || nVal < 0)
                 return false;
-            SetUpper((sal_uInt16)(bConvert ? MM100_TO_TWIP(nVal) : nVal));
+            SetUpper((sal_uInt16)(bConvert ? convertMm100ToTwip(nVal) : nVal));
             break;
         case MID_LO_MARGIN :
             if(!(rVal >>= nVal) || nVal < 0)
                 return false;
-            SetLower((sal_uInt16)(bConvert ? MM100_TO_TWIP(nVal) : nVal));
+            SetLower((sal_uInt16)(bConvert ? convertMm100ToTwip(nVal) : nVal));
             break;
         case MID_CTX_MARGIN :
             if (!(rVal >>= bVal))
@@ -1345,7 +1339,7 @@ bool SvxShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         default: ;//prevent warning
     }
     aShadow.Location = eSet;
-    aShadow.ShadowWidth =   bConvert ? TWIP_TO_MM100_UNSIGNED(nWidth) : nWidth;
+    aShadow.ShadowWidth =   bConvert ? convertTwipToMm100(nWidth) : nWidth;
     aShadow.IsTransparent = aShadowColor.GetTransparency() > 0;
     aShadow.Color = aShadowColor.GetColor();
 
@@ -1418,7 +1412,7 @@ bool SvxShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             default: ;//prevent warning
         }
 
-        nWidth = bConvert ? MM100_TO_TWIP(aShadow.ShadowWidth) : aShadow.ShadowWidth;
+        nWidth = bConvert ? convertMm100ToTwip(aShadow.ShadowWidth) : aShadow.ShadowWidth;
         Color aSet(aShadow.Color);
         aShadowColor = aSet;
     }
@@ -1709,11 +1703,11 @@ table::BorderLine2 SvxBoxItem::SvxLineToLine(const SvxBorderLine* pLine, bool bC
     if(pLine)
     {
         aLine.Color          = pLine->GetColor().GetColor() ;
-        aLine.InnerLineWidth = sal_uInt16( bConvert ? TWIP_TO_MM100_UNSIGNED(pLine->GetInWidth() ): pLine->GetInWidth() );
-        aLine.OuterLineWidth = sal_uInt16( bConvert ? TWIP_TO_MM100_UNSIGNED(pLine->GetOutWidth()): pLine->GetOutWidth() );
-        aLine.LineDistance   = sal_uInt16( bConvert ? TWIP_TO_MM100_UNSIGNED(pLine->GetDistance()): pLine->GetDistance() );
+        aLine.InnerLineWidth = sal_uInt16( bConvert ? convertTwipToMm100(pLine->GetInWidth() ): pLine->GetInWidth() );
+        aLine.OuterLineWidth = sal_uInt16( bConvert ? convertTwipToMm100(pLine->GetOutWidth()): pLine->GetOutWidth() );
+        aLine.LineDistance   = sal_uInt16( bConvert ? convertTwipToMm100(pLine->GetDistance()): pLine->GetDistance() );
         aLine.LineStyle      = pLine->GetBorderLineStyle();
-        aLine.LineWidth      = sal_uInt32( bConvert ? TWIP_TO_MM100( pLine->GetWidth( ) ) : pLine->GetWidth( ) );
+        aLine.LineWidth      = sal_uInt32( bConvert ? convertTwipToMm100( pLine->GetWidth( ) ) : pLine->GetWidth( ) );
     }
     else
         aLine.Color          = aLine.InnerLineWidth = aLine.OuterLineWidth = aLine.LineDistance  = 0;
@@ -1737,11 +1731,11 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId  ) const
             aSeq[1] = uno::makeAny( SvxBoxItem::SvxLineToLine(GetRight(), bConvert) );
             aSeq[2] = uno::makeAny( SvxBoxItem::SvxLineToLine(GetBottom(), bConvert) );
             aSeq[3] = uno::makeAny( SvxBoxItem::SvxLineToLine(GetTop(), bConvert) );
-            aSeq[4] <<= uno::makeAny( (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED( GetDistance()) : GetDistance()));
-            aSeq[5] <<= uno::makeAny( (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED( nTopDist ) : nTopDist ));
-            aSeq[6] <<= uno::makeAny( (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED( nBottomDist ) : nBottomDist ));
-            aSeq[7] <<= uno::makeAny( (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED( nLeftDist ) : nLeftDist ));
-            aSeq[8] <<= uno::makeAny( (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED( nRightDist ) : nRightDist ));
+            aSeq[4] <<= uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100( GetDistance()) : GetDistance()));
+            aSeq[5] <<= uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100( nTopDist ) : nTopDist ));
+            aSeq[6] <<= uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100( nBottomDist ) : nBottomDist ));
+            aSeq[7] <<= uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100( nLeftDist ) : nLeftDist ));
+            aSeq[8] <<= uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100( nRightDist ) : nRightDist ));
             rVal = uno::makeAny( aSeq );
             return true;
         }
@@ -1784,7 +1778,7 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId  ) const
     }
 
     if( bDistMember )
-        rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED(nDist) : nDist);
+        rVal <<= (sal_Int32)(bConvert ? convertTwipToMm100(nDist) : nDist);
     else
         rVal <<= aRetLine;
 
@@ -1801,9 +1795,9 @@ lcl_lineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine, sal_B
     if ( bGuessWidth )
     {
         rSvxLine.GuessLinesWidths( rSvxLine.GetBorderLineStyle(),
-                sal_uInt16( bConvert ? MM100_TO_TWIP(rLine.OuterLineWidth) : rLine.OuterLineWidth  ),
-                sal_uInt16( bConvert ? MM100_TO_TWIP(rLine.InnerLineWidth) : rLine.InnerLineWidth  ),
-                sal_uInt16( bConvert ? MM100_TO_TWIP(rLine.LineDistance )  : rLine.LineDistance  ));
+                sal_uInt16( bConvert ? convertMm100ToTwip(rLine.OuterLineWidth) : rLine.OuterLineWidth  ),
+                sal_uInt16( bConvert ? convertMm100ToTwip(rLine.InnerLineWidth) : rLine.InnerLineWidth  ),
+                sal_uInt16( bConvert ? convertMm100ToTwip(rLine.LineDistance )  : rLine.LineDistance  ));
     }
 
     sal_Bool bRet = !rSvxLine.isEmpty();
@@ -1831,7 +1825,7 @@ SvxBoxItem::LineToSvxLine(const ::com::sun::star::table::BorderLine2& rLine, Svx
     sal_Bool bGuessWidth = sal_True;
     if ( rLine.LineWidth )
     {
-        rSvxLine.SetWidth( bConvert? MM100_TO_TWIP_UNSIGNED( rLine.LineWidth ) : rLine.LineWidth );
+        rSvxLine.SetWidth( bConvert? convertMm100ToTwip( rLine.LineWidth ) : rLine.LineWidth );
         // fdo#46112: double does not necessarily mean symmetric
         // for backwards compatibility
         bGuessWidth = ((DOUBLE == nStyle || DOUBLE_THIN == nStyle)) &&
@@ -1913,7 +1907,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                     if ( aSeq[n] >>= nDist )
                     {
                         if( bConvert )
-                            nDist = MM100_TO_TWIP(nDist);
+                            nDist = convertMm100ToTwip(nDist);
                         if ( n == 4 )
                             SetDistance( sal_uInt16( nDist ));
                         else
@@ -1987,7 +1981,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 long nWidth(0);
                 rVal >>= nWidth;
                 if( bConvert )
-                    nWidth = MM100_TO_TWIP( nWidth );
+                    nWidth = convertMm100ToTwip( nWidth );
 
                 // Set the line Width on all borders
                 const sal_uInt16 aBorders[] = { BOX_LINE_LEFT, BOX_LINE_RIGHT, BOX_LINE_BOTTOM, BOX_LINE_TOP };
@@ -2010,7 +2004,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
         if(nDist >= 0)
         {
             if( bConvert )
-                nDist = MM100_TO_TWIP(nDist);
+                nDist = convertMm100ToTwip(nDist);
             if( nMemberId == BORDER_DISTANCE )
                 SetDistance( sal_uInt16( nDist ));
             else
@@ -2740,7 +2734,7 @@ bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId  ) const
             aSeq[2] = ::com::sun::star::uno::makeAny( nVal );
             nVal = nValidFlags;
             aSeq[3] = ::com::sun::star::uno::makeAny( nVal );
-            aSeq[4] = ::com::sun::star::uno::makeAny( (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED(GetDefDist()) : GetDefDist()) );
+            aSeq[4] = ::com::sun::star::uno::makeAny( (sal_Int32)(bConvert ? convertTwipToMm100(GetDefDist()) : GetDefDist()) );
             rVal = ::com::sun::star::uno::makeAny( aSeq );
             return true;
         }
@@ -2768,7 +2762,7 @@ bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId  ) const
             break;
         case MID_DISTANCE:
             bIntMember = sal_True;
-            rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100_UNSIGNED(GetDefDist()) : GetDefDist());
+            rVal <<= (sal_Int32)(bConvert ? convertTwipToMm100(GetDefDist()) : GetDefDist());
             break;
         default: OSL_FAIL("Wrong MemberId!"); return false;
     }
@@ -2816,7 +2810,7 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 if (( aSeq[4] >>= nVal ) && ( nVal >= 0 ))
                 {
                     if( bConvert )
-                        nVal = MM100_TO_TWIP(nVal);
+                        nVal = convertMm100ToTwip(nVal);
                     SetDefDist( (sal_uInt16)nVal );
                 }
             }
@@ -2933,7 +2927,7 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             if ( bRet && nVal>=0 )
             {
                 if( bConvert )
-                    nVal = MM100_TO_TWIP(nVal);
+                    nVal = convertMm100ToTwip(nVal);
                 SetDefDist( (sal_uInt16)nVal );
             }
             break;
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index e49e0c3..61cc688 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -41,11 +41,10 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <comphelper/processfactory.hxx>
+#include <tools/mapunit.hxx>
 
 #include <editeng/unonrule.hxx>
 
-#define MM100_TO_TWIP(MM100)    ((MM100*72L+63L)/127L)
-
 #define DEF_WRITER_LSPACE   500     //Standard Indentation
 #define DEF_DRAW_LSPACE     800     //Standard Indentation
 
@@ -619,9 +618,9 @@ SvxNumRule::SvxNumRule( sal_uLong nFeatures,
                 if ( eDefaultNumberFormatPositionAndSpaceMode ==
                                     SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
                 {
-                    aFmts[i]->SetLSpace( MM100_TO_TWIP(DEF_WRITER_LSPACE) );
-                    aFmts[i]->SetAbsLSpace( MM100_TO_TWIP(DEF_WRITER_LSPACE * (i+1)) );
-                    aFmts[i]->SetFirstLineOffset(MM100_TO_TWIP(-DEF_WRITER_LSPACE));
+                    aFmts[i]->SetLSpace( convertMm100ToTwip(DEF_WRITER_LSPACE) );
+                    aFmts[i]->SetAbsLSpace( convertMm100ToTwip(DEF_WRITER_LSPACE * (i+1)) );
+                    aFmts[i]->SetFirstLineOffset(convertMm100ToTwip(-DEF_WRITER_LSPACE));
                 }
                 else if ( eDefaultNumberFormatPositionAndSpaceMode ==
                                             SvxNumberFormat::LABEL_ALIGNMENT )
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 906ba1a..4f3d598 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -25,6 +25,7 @@
 #include <unotools/syslocale.hxx>
 #include <comphelper/types.hxx>
 #include <tools/rtti.hxx>
+#include <tools/mapunit.hxx>
 #include <svl/itempool.hxx>
 #include <svl/memberid.hrc>
 #include <editeng/editrids.hrc>
@@ -53,19 +54,6 @@
 using namespace ::rtl;
 using namespace ::com::sun::star;
 
-// Konvertierung fuer UNO
-#define TWIP_TO_MM100(TWIP)     ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
-#define TWIP_TO_MM100_UNSIGNED(TWIP)     ((((TWIP)*127L+36L)/72L))
-#define MM100_TO_TWIP(MM100)    ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L))
-#define MM100_TO_TWIP_UNSIGNED(MM100)    ((((MM100)*72L+63L)/127L))
-
-
-// STATIC DATA -----------------------------------------------------------
-
-
-
-
-
 TYPEINIT1_FACTORY(SvxLineSpacingItem, SfxPoolItem , new SvxLineSpacingItem(LINE_SPACE_DEFAULT_HEIGHT, 0));
 TYPEINIT1_FACTORY(SvxAdjustItem, SfxPoolItem, new SvxAdjustItem(SVX_ADJUST_LEFT, 0));
 TYPEINIT1_FACTORY(SvxWidowsItem, SfxByteItem, new SvxWidowsItem(0, 0));
@@ -133,7 +121,7 @@ bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             if(eInterLineSpace == SVX_INTER_LINE_SPACE_FIX)
             {
                 aLSp.Mode = style::LineSpacingMode::LEADING;
-                aLSp.Height = ( bConvert ? (short)TWIP_TO_MM100(nInterLineSpace) : nInterLineSpace);
+                aLSp.Height = ( bConvert ? (short)convertTwipToMm100(nInterLineSpace) : nInterLineSpace);
             }
             else if(eInterLineSpace == SVX_INTER_LINE_SPACE_OFF)
             {
@@ -149,7 +137,7 @@ bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         case SVX_LINE_SPACE_FIX :
         case SVX_LINE_SPACE_MIN :
             aLSp.Mode = eLineSpace == SVX_LINE_SPACE_FIX ? style::LineSpacingMode::FIX : style::LineSpacingMode::MINIMUM;
-            aLSp.Height = ( bConvert ? (short)TWIP_TO_MM100_UNSIGNED(nLineHeight) : nLineHeight );
+            aLSp.Height = ( bConvert ? (short)convertTwipToMm100(nLineHeight) : nLineHeight );
         break;
         default:
             ;//prevent warning about SVX_LINE_SPACE_END
@@ -196,7 +184,7 @@ bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 eLineSpace = SVX_LINE_SPACE_AUTO;
                 nInterLineSpace = aLSp.Height;
                 if(bConvert)
-                    nInterLineSpace = (short)MM100_TO_TWIP(nInterLineSpace);
+                    nInterLineSpace = (short)convertMm100ToTwip(nInterLineSpace);
 
             }
             break;
@@ -217,7 +205,7 @@ bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 eLineSpace = aLSp.Mode == style::LineSpacingMode::FIX ? SVX_LINE_SPACE_FIX : SVX_LINE_SPACE_MIN;
                 nLineHeight = aLSp.Height;
                 if(bConvert)
-                    nLineHeight = (sal_uInt16)MM100_TO_TWIP_UNSIGNED(nLineHeight);
+                    nLineHeight = (sal_uInt16)convertMm100ToTwip(nLineHeight);
             }
             break;
         }
@@ -956,7 +944,7 @@ bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             for(sal_uInt16 i = 0; i < nCount; i++)
             {
                 const SvxTabStop& rTab = (*this)[i];
-                pArr[i].Position        = bConvert ? TWIP_TO_MM100(rTab.GetTabPos()) : rTab.GetTabPos();
+                pArr[i].Position        = bConvert ? convertTwipToMm100(rTab.GetTabPos()) : rTab.GetTabPos();
                 switch(rTab.GetAdjustment())
                 {
                 case  SVX_TAB_ADJUST_LEFT   : pArr[i].Alignment = style::TabAlign_LEFT; break;
@@ -976,7 +964,7 @@ bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         case MID_STD_TAB:
         {
             const SvxTabStop &rTab = maTabStops.front();
-            rVal <<= (static_cast<sal_Int32>(bConvert ? TWIP_TO_MM100(rTab.GetTabPos()) : rTab.GetTabPos()));
+            rVal <<= (static_cast<sal_Int32>(bConvert ? convertTwipToMm100(rTab.GetTabPos()) : rTab.GetTabPos()));
             break;
         }
     }
@@ -1051,7 +1039,7 @@ bool SvxTabStopItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 }
                 sal_Unicode cFill = pArr[i].FillChar;
                 sal_Unicode cDecimal = pArr[i].DecimalChar;
-                SvxTabStop aTab( bConvert ? MM100_TO_TWIP(pArr[i].Position) : pArr[i].Position,
+                SvxTabStop aTab( bConvert ? convertMm100ToTwip(pArr[i].Position) : pArr[i].Position,
                                     eAdjust,
                                     cDecimal,
                                     cFill );
@@ -1065,7 +1053,7 @@ bool SvxTabStopItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             if (!(rVal >>= nNewPos) )
                 return false;
             if (bConvert)
-                nNewPos = MM100_TO_TWIP ( nNewPos );
+                nNewPos = convertMm100ToTwip ( nNewPos );
             if (nNewPos <= 0)
                 return false;
             const SvxTabStop& rTab = maTabStops.front();
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index b3f8208..5cc4929 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -35,6 +35,7 @@
 #include <editeng/editrids.hrc>
 #include <vcl/vclenum.hxx>
 #include <tools/tenccvt.hxx>
+#include <tools/mapunit.hxx>
 
 #include <rtl/ustring.hxx>
 #include <i18nlangtag/languagetag.hxx>
@@ -99,12 +100,6 @@ using namespace ::rtl;
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::text;
 
-// Conversion for UNO
-#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 TWIP_TO_MM100_UNSIGNED(TWIP)     ((((TWIP)*127L+36L)/72L))
-#define MM100_TO_TWIP_UNSIGNED(MM100)    ((((MM100)*72L+63L)/127L))
-
 bool SvxFontItem::bEnableStoreUnicodeNames = false;
 
 // STATIC DATA -----------------------------------------------------------
@@ -837,12 +832,12 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             // CONVERT_TWIPS is not set.
             if( bConvert )
             {
-                long nTwips = bConvert ? nHeight : MM100_TO_TWIP_UNSIGNED(nHeight);
+                long nTwips = bConvert ? nHeight : convertMm100ToTwip(nHeight);
                 aFontHeight.Height = (float)( nTwips / 20.0 );
             }
             else
             {
-                double fPoints = MM100_TO_TWIP_UNSIGNED(nHeight) / 20.0;
+                double fPoints = convertMm100ToTwip(nHeight) / 20.0;
                 float fRoundPoints =
                     static_cast<float>(::rtl::math::round(fPoints, 1));
                 aFontHeight.Height = fRoundPoints;
@@ -857,7 +852,7 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
                     fRet = 0.;
                 break;
                 case SFX_MAPUNIT_100TH_MM:
-                    fRet = MM100_TO_TWIP(fRet);
+                    fRet = convertMm100ToTwip(fRet);
                     fRet /= 20.;
                 break;
                 case SFX_MAPUNIT_POINT:
@@ -878,12 +873,12 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             // CONVERT_TWIPS is not set.
             if( bConvert )
             {
-                long nTwips = bConvert ? nHeight : MM100_TO_TWIP_UNSIGNED(nHeight);
+                long nTwips = bConvert ? nHeight : convertMm100ToTwip(nHeight);
                 rVal <<= (float)( nTwips / 20.0 );
             }
             else
             {
-                double fPoints = MM100_TO_TWIP_UNSIGNED(nHeight) / 20.0;
+                double fPoints = convertMm100ToTwip(nHeight) / 20.0;
                 float fRoundPoints =
                     static_cast<float>(::rtl::math::round(fPoints, 1));
                 rVal <<= fRoundPoints;
@@ -902,7 +897,7 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
                     fRet = 0.;
                 break;
                 case SFX_MAPUNIT_100TH_MM:
-                    fRet = MM100_TO_TWIP(fRet);
+                    fRet = convertMm100ToTwip(fRet);
                     fRet /= 20.;
                 break;
                 case SFX_MAPUNIT_POINT:
@@ -936,7 +931,7 @@ static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, S
             short nTemp = (short)nProp;
             nDiff = nTemp * 20;
             if(!bCoreInTwip)
-                nDiff = (short)TWIP_TO_MM100((long)(nDiff));
+                nDiff = (short)convertTwipToMm100((long)(nDiff));
         }
         break;
         case SFX_MAPUNIT_100TH_MM:
@@ -974,7 +969,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
 
                 nHeight = (long)( fPoint * 20.0 + 0.5 );        // Twips
                 if (!bConvert)
-                    nHeight = TWIP_TO_MM100_UNSIGNED(nHeight);  // Convert, if the item contains 1/100mm
+                    nHeight = convertTwipToMm100(nHeight);  // Convert, if the item contains 1/100mm
 
                 nProp = aFontHeight.Prop;
             }
@@ -999,7 +994,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
 
             nHeight = (long)( fPoint * 20.0 + 0.5 );        // Twips
             if (!bConvert)
-                nHeight = TWIP_TO_MM100_UNSIGNED(nHeight);  // Convert, if the item contains 1/100mm
+                nHeight = convertTwipToMm100(nHeight);  // Convert, if the item contains 1/100mm
         }
         break;
         case MID_FONTHEIGHT_PROP:
@@ -1028,7 +1023,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 fValue = (float)nValue;
             }
             sal_Int16 nCoreDiffValue = (sal_Int16)(fValue * 20.);
-            nHeight += bConvert ? nCoreDiffValue : TWIP_TO_MM100(nCoreDiffValue);
+            nHeight += bConvert ? nCoreDiffValue : convertTwipToMm100(nCoreDiffValue);
             nProp = (sal_uInt16)((sal_Int16)fValue);
             ePropUnit = SFX_MAPUNIT_POINT;
         }
@@ -2203,7 +2198,7 @@ bool SvxKerningItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
 {
     sal_Int16 nVal = GetValue();
     if(nMemberId & CONVERT_TWIPS)
-        nVal = (sal_Int16)TWIP_TO_MM100(nVal);
+        nVal = (sal_Int16)convertTwipToMm100(nVal);
     rVal <<= nVal;
     return true;
 }
@@ -2214,7 +2209,7 @@ bool SvxKerningItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId)
     if(!(rVal >>= nVal))
         return false;
     if(nMemberId & CONVERT_TWIPS)
-        nVal = (sal_Int16)MM100_TO_TWIP(nVal);
+        nVal = (sal_Int16)convertMm100ToTwip(nVal);
     SetValue(nVal);
     return true;
 }
diff --git a/include/tools/mapunit.hxx b/include/tools/mapunit.hxx
index 0076b68..a68b6b4 100644
--- a/include/tools/mapunit.hxx
+++ b/include/tools/mapunit.hxx
@@ -25,6 +25,22 @@ enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM,
                MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT,
                MAP_RELATIVE, MAP_LASTENUMDUMMY };
 
+inline sal_Int64 convertTwipToMm100(sal_Int64 n)
+{
+    if (n >= 0)
+        return (n*127+36)/72;
+    else
+        return (n*127-36)/72;
+}
+
+inline sal_Int64 convertMm100ToTwip(sal_Int64 n)
+{
+    if (n >= 0)
+        return (n*72+63)/127;
+    else
+        return (n*72-63)/127;
+}
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 0bafd5b..fb29c14 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;
             }
diff --git a/svl/source/items/ptitem.cxx b/svl/source/items/ptitem.cxx
index 1b66c80..c9c36e2 100644
--- a/svl/source/items/ptitem.cxx
+++ b/svl/source/items/ptitem.cxx
@@ -22,17 +22,13 @@
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/awt/Point.hpp>
 #include <tools/stream.hxx>
+#include <tools/mapunit.hxx>
 
 #include <svl/poolitem.hxx>
 #include <svl/memberid.hrc>
 
 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))
-
-
-
 TYPEINIT1_AUTOFACTORY(SfxPointItem, SfxPoolItem);
 
 
@@ -113,8 +109,8 @@ bool SfxPointItem::QueryValue( uno::Any& rVal,
     awt::Point aTmp(aVal.X(), aVal.Y());
     if( bConvert )
     {
-        aTmp.X = TWIP_TO_MM100(aTmp.X);
-        aTmp.Y = TWIP_TO_MM100(aTmp.Y);
+        aTmp.X = convertTwipToMm100(aTmp.X);
+        aTmp.Y = convertTwipToMm100(aTmp.Y);
     }
     nMemberId &= ~CONVERT_TWIPS;
     switch ( nMemberId )
@@ -143,15 +139,15 @@ bool SfxPointItem::PutValue( const uno::Any& rVal,
         bRet = ( rVal >>= aValue );
         if( bConvert )
         {
-            aValue.X = MM100_TO_TWIP(aValue.X);
-            aValue.Y = MM100_TO_TWIP(aValue.Y);
+            aValue.X = convertMm100ToTwip(aValue.X);
+            aValue.Y = convertMm100ToTwip(aValue.Y);
         }
     }
     else
     {
         bRet = ( rVal >>= nVal );
         if( bConvert )
-            nVal = MM100_TO_TWIP( nVal );
+            nVal = convertMm100ToTwip( nVal );
     }
 
     if ( bRet )
diff --git a/svx/source/dialog/rulritem.cxx b/svx/source/dialog/rulritem.cxx
index c8bbede..149c659 100644
--- a/svx/source/dialog/rulritem.cxx
+++ b/svx/source/dialog/rulritem.cxx
@@ -19,6 +19,7 @@
 
 #include <svx/dialogs.hrc>
 #include "svx/rulritem.hxx"
+#include <tools/mapunit.hxx>
 #include <com/sun/star/awt/Rectangle.hpp>
 #include <com/sun/star/frame/status/LeftRightMargin.hpp>
 #include <com/sun/star/frame/status/UpperLowerMargin.hpp>
@@ -43,9 +44,6 @@ OUString SvxLongLRSpaceItem::GetValueText() const
     return OUString();
 }
 
-#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))
-
 bool SvxLongLRSpaceItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const
 {
     bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
@@ -57,8 +55,8 @@ bool SvxLongLRSpaceItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8
         case 0:
         {
             ::com::sun::star::frame::status::LeftRightMargin aLeftRightMargin;
-            aLeftRightMargin.Left = bConvert ? TWIP_TO_MM100( mlLeft ) : mlLeft;
-            aLeftRightMargin.Right = bConvert ? TWIP_TO_MM100( mlRight ) : mlRight;
+            aLeftRightMargin.Left = bConvert ? convertTwipToMm100( mlLeft ) : mlLeft;
+            aLeftRightMargin.Right = bConvert ? convertTwipToMm100( mlRight ) : mlRight;
             rVal <<= aLeftRightMargin;
             return true;
         }
@@ -75,7 +73,7 @@ bool SvxLongLRSpaceItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8
     }
 
     if ( bConvert )
-        nVal = TWIP_TO_MM100( nVal );
+        nVal = convertTwipToMm100( nVal );
 
     rVal <<= nVal;
     return true;
@@ -92,15 +90,15 @@ bool SvxLongLRSpaceItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_u
         ::com::sun::star::frame::status::LeftRightMargin aLeftRightMargin;
         if ( rVal >>= aLeftRightMargin )
         {
-            mlLeft  = bConvert ? MM100_TO_TWIP(aLeftRightMargin.Left) : aLeftRightMargin.Left;
-            mlRight = bConvert ? MM100_TO_TWIP(aLeftRightMargin.Right) : aLeftRightMargin.Right;
+            mlLeft  = bConvert ? convertMm100ToTwip(aLeftRightMargin.Left) : aLeftRightMargin.Left;
+            mlRight = bConvert ? convertMm100ToTwip(aLeftRightMargin.Right) : aLeftRightMargin.Right;
             return true;
         }
     }
     else if ( rVal >>= nVal )
     {
         if ( bConvert )
-            nVal = MM100_TO_TWIP( nVal );
+            nVal = convertMm100ToTwip( nVal );
 
         switch( nMemberId )
         {
@@ -200,8 +198,8 @@ bool SvxLongULSpaceItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8
         case 0:
         {
             ::com::sun::star::frame::status::UpperLowerMargin aUpperLowerMargin;
-            aUpperLowerMargin.Upper = bConvert ? TWIP_TO_MM100( mlLeft )  : mlLeft;
-            aUpperLowerMargin.Lower = bConvert ? TWIP_TO_MM100( mlRight ) : mlRight;
+            aUpperLowerMargin.Upper = bConvert ? convertTwipToMm100( mlLeft )  : mlLeft;
+            aUpperLowerMargin.Lower = bConvert ? convertTwipToMm100( mlRight ) : mlRight;
             rVal <<= aUpperLowerMargin;
             return true;
         }
@@ -216,7 +214,7 @@ bool SvxLongULSpaceItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8
     }
 
     if ( bConvert )
-        nVal = TWIP_TO_MM100( nVal );
+        nVal = convertTwipToMm100( nVal );
 
     rVal <<= nVal;
     return true;
@@ -233,15 +231,15 @@ bool SvxLongULSpaceItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_u
         ::com::sun::star::frame::status::UpperLowerMargin aUpperLowerMargin;
         if ( rVal >>= aUpperLowerMargin )
         {
-            mlLeft    = bConvert ? MM100_TO_TWIP( aUpperLowerMargin.Upper ) : aUpperLowerMargin.Upper;
-            mlRight   = bConvert ? MM100_TO_TWIP( aUpperLowerMargin.Lower ) : aUpperLowerMargin.Lower;
+            mlLeft    = bConvert ? convertMm100ToTwip( aUpperLowerMargin.Upper ) : aUpperLowerMargin.Upper;
+            mlRight   = bConvert ? convertMm100ToTwip( aUpperLowerMargin.Lower ) : aUpperLowerMargin.Lower;
             return true;
         }
     }
     else if ( rVal >>= nVal )
     {
         if ( bConvert )
-            nVal = MM100_TO_TWIP( nVal );
+            nVal = convertMm100ToTwip( nVal );
 
         switch( nMemberId )
         {
diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx
index 8f9f505..2cdc3ca 100644
--- a/svx/source/items/algitem.cxx
+++ b/svx/source/items/algitem.cxx
@@ -17,11 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 #include <svx/svxitems.hrc>
 
-
 #include <tools/stream.hxx>
+#include <tools/mapunit.hxx>
 #include <com/sun/star/table/BorderLine.hpp>
 #include <com/sun/star/table/ShadowLocation.hpp>
 #include <com/sun/star/table/TableBorder.hpp>
@@ -42,13 +41,6 @@
 using namespace ::rtl;
 using namespace ::com::sun::star;
 
-// Konvertierung fuer UNO
-#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))
-
-// STATIC DATA -----------------------------------------------------------
-
-//TYPEINIT1_AUTOFACTORY( SvxHorJustifyItem, SfxEnumItem );
 TYPEINIT1_FACTORY( SvxOrientationItem, SfxEnumItem, new SvxOrientationItem(SVX_ORIENTATION_STANDARD, 0) );
 TYPEINIT1_FACTORY( SvxMarginItem, SfxPoolItem, new SvxMarginItem(0) );
 
@@ -342,16 +334,16 @@ bool SvxMarginItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     {
         //  jetzt alles signed
         case MID_MARGIN_L_MARGIN:
-            rVal <<= (sal_Int32)( bConvert ? TWIP_TO_MM100(nLeftMargin) : nLeftMargin );
+            rVal <<= (sal_Int32)( bConvert ? convertTwipToMm100(nLeftMargin) : nLeftMargin );
             break;
         case MID_MARGIN_R_MARGIN:
-            rVal <<= (sal_Int32)( bConvert ? TWIP_TO_MM100(nRightMargin) : nRightMargin );
+            rVal <<= (sal_Int32)( bConvert ? convertTwipToMm100(nRightMargin) : nRightMargin );
             break;
         case MID_MARGIN_UP_MARGIN:
-            rVal <<= (sal_Int32)( bConvert ? TWIP_TO_MM100(nTopMargin) : nTopMargin );
+            rVal <<= (sal_Int32)( bConvert ? convertTwipToMm100(nTopMargin) : nTopMargin );
             break;
         case MID_MARGIN_LO_MARGIN:
-            rVal <<= (sal_Int32)( bConvert ? TWIP_TO_MM100(nBottomMargin) : nBottomMargin );
+            rVal <<= (sal_Int32)( bConvert ? convertTwipToMm100(nBottomMargin) : nBottomMargin );
             break;
         default:
             OSL_FAIL("unknown MemberId");
@@ -365,7 +357,7 @@ bool SvxMarginItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
 bool SvxMarginItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
 {
     bool bConvert = ( ( nMemberId & CONVERT_TWIPS ) != 0 );
-    long nMaxVal = bConvert ? TWIP_TO_MM100(SHRT_MAX) : SHRT_MAX;   // Members sind sal_Int16
+    long nMaxVal = bConvert ? convertTwipToMm100(SHRT_MAX) : SHRT_MAX;   // Members sind sal_Int16
     sal_Int32 nVal = 0;
     if(!(rVal >>= nVal) || (nVal > nMaxVal))
         return false;
@@ -373,16 +365,16 @@ bool SvxMarginItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
     switch ( nMemberId & ~CONVERT_TWIPS )
     {
         case MID_MARGIN_L_MARGIN:
-            nLeftMargin = (sal_Int16)( bConvert ? MM100_TO_TWIP(nVal) : nVal );
+            nLeftMargin = (sal_Int16)( bConvert ? convertMm100ToTwip(nVal) : nVal );
             break;
         case MID_MARGIN_R_MARGIN:
-            nRightMargin = (sal_Int16)( bConvert ? MM100_TO_TWIP(nVal) : nVal );
+            nRightMargin = (sal_Int16)( bConvert ? convertMm100ToTwip(nVal) : nVal );
             break;
         case MID_MARGIN_UP_MARGIN:
-            nTopMargin = (sal_Int16)( bConvert ? MM100_TO_TWIP(nVal) : nVal );
+            nTopMargin = (sal_Int16)( bConvert ? convertMm100ToTwip(nVal) : nVal );
             break;
         case MID_MARGIN_LO_MARGIN:
-            nBottomMargin = (sal_Int16)( bConvert ? MM100_TO_TWIP(nVal) : nVal );
+            nBottomMargin = (sal_Int16)( bConvert ? convertMm100ToTwip(nVal) : nVal );
             break;
         default:
             OSL_FAIL("unknown MemberId");
diff --git a/svx/source/items/grfitem.cxx b/svx/source/items/grfitem.cxx
index be31810..05232eb 100644
--- a/svx/source/items/grfitem.cxx
+++ b/svx/source/items/grfitem.cxx
@@ -21,13 +21,10 @@
 #include <svx/grfcrop.hxx>
 #include <editeng/itemtype.hxx>
 #include <com/sun/star/text/GraphicCrop.hpp>
+#include <tools/mapunit.hxx>
 
 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))
-//TYPEINIT1_FACTORY( SvxGrfCrop, SfxPoolItem , new  SvxGrfCrop(0))
-
 /******************************************************************************
  *  Implementierung     class SwCropGrf
  ******************************************************************************/
@@ -99,10 +96,10 @@ bool SvxGrfCrop::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
 
     if( bConvert )
     {
-       aRet.Right   = TWIP_TO_MM100(aRet.Right );
-       aRet.Top     = TWIP_TO_MM100(aRet.Top );
-       aRet.Left    = TWIP_TO_MM100(aRet.Left   );
-       aRet.Bottom  = TWIP_TO_MM100(aRet.Bottom);
+       aRet.Right   = convertTwipToMm100(aRet.Right );
+       aRet.Top     = convertTwipToMm100(aRet.Top );
+       aRet.Left    = convertTwipToMm100(aRet.Left   );
+       aRet.Bottom  = convertTwipToMm100(aRet.Bottom);
     }
 
 
@@ -120,10 +117,10 @@ bool SvxGrfCrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
         return false;
     if( bConvert )
     {
-       aVal.Right   = MM100_TO_TWIP(aVal.Right );
-       aVal.Top     = MM100_TO_TWIP(aVal.Top );
-       aVal.Left    = MM100_TO_TWIP(aVal.Left   );
-       aVal.Bottom  = MM100_TO_TWIP(aVal.Bottom);
+       aVal.Right   = convertMm100ToTwip(aVal.Right );
+       aVal.Top     = convertMm100ToTwip(aVal.Top );
+       aVal.Left    = convertMm100ToTwip(aVal.Left   );
+       aVal.Bottom  = convertMm100ToTwip(aVal.Bottom);
     }
 
     nLeft   = aVal.Left  ;
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 800542e..a8f6a1b 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;
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 3cf2c83..a77b553 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SW_INC_SWTYPES_HXX
 #include <rtl/ustring.hxx>
 #include <tools/solar.h>
+#include <tools/mapunit.hxx>
 #include <SwGetPoolIdFromName.hxx>
 
 #include <limits.h>
@@ -197,13 +198,6 @@ namespace nsSetAttrMode
     const SetAttrMode SETATTR_IS_COPY        = 0x0100;
 }
 
-// Conversion Twip <-> 1/100 mm for UNO
-
-#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 TWIP_TO_MM100_UNSIGNED(TWIP)     ((((TWIP)*127L+36L)/72L))
-#define MM100_TO_TWIP_UNSIGNED(MM100)    ((((MM100)*72L+63L)/127L))
-
 #define SW_ISPRINTABLE( c ) ( c >= ' ' && 127 != c )
 
 #ifndef SW_CONSTASCII_DECL
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 2722075..cafd9ea 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1023,7 +1023,7 @@ DECLARE_OOXMLEXPORT_TEST(testParaShadow, "para-shadow.docx")
     CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color));
     CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location);
     // w:sz="48" is in eights of a point, 1 pt is 20 twips.
-    CPPUNIT_ASSERT_EQUAL(sal_Int16(TWIP_TO_MM100(24/8*20)), aShadow.ShadowWidth);
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(24/8*20)), aShadow.ShadowWidth);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTableFloating, "table-floating.docx")
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 3c63f51..103a3db 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -527,7 +527,7 @@ DECLARE_OOXMLIMPORT_TEST(testN766487, "n766487.docx")
     xPropertySet.set(xParaEnum->nextElement(), uno::UNO_QUERY);
     sal_Int32 nValue = 0;
     xPropertySet->getPropertyValue("ParaFirstLineIndent") >>= nValue;
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(-360)), nValue);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-360)), nValue);
 }
 
 DECLARE_OOXMLIMPORT_TEST(testN693238, "n693238.docx")
@@ -1272,7 +1272,7 @@ DECLARE_OOXMLIMPORT_TEST(testPageBorderShadow, "page-border-shadow.docx")
     CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color));
     CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location);
     // w:sz="48" is in eights of a point, 1 pt is 20 twips.
-    CPPUNIT_ASSERT_EQUAL(sal_Int16(TWIP_TO_MM100(48/8*20)), aShadow.ShadowWidth);
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(48/8*20)), aShadow.ShadowWidth);
 }
 
 DECLARE_OOXMLIMPORT_TEST(testN816593, "n816593.docx")
@@ -1343,7 +1343,7 @@ DECLARE_OOXMLIMPORT_TEST(testTableAutoColumnFixedSize, "table-auto-column-fixed-
     uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
 
     // Width was not recognized during import when table size was 'auto'
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(3996)), getProperty<sal_Int32>(xTextTable, "Width"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(3996)), getProperty<sal_Int32>(xTextTable, "Width"));
 }
 
 DECLARE_OOXMLIMPORT_TEST(testFdo46361, "fdo46361.docx")
@@ -1934,9 +1934,9 @@ DECLARE_OOXMLIMPORT_TEST(testStrict, "strict.docx")
 {
     uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
     // This was only 127, pt suffix was ignored, so this got parsed as twips instead of points.
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(72 * 20)), getProperty<sal_Int32>(xPageStyle, "BottomMargin"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(72 * 20)), getProperty<sal_Int32>(xPageStyle, "BottomMargin"));
     // This was only 1397, same issue
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(792 * 20)), getProperty<sal_Int32>(xPageStyle, "Height"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(792 * 20)), getProperty<sal_Int32>(xPageStyle, "Height"));
     // Text was missing, due to not handling the strict namespaces.
     getParagraph(1, "Hello world!");
 
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 3f277cb..a0ffe5d 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -539,7 +539,7 @@ DECLARE_RTFEXPORT_TEST(testParaShadow, "para-shadow.rtf")
     table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(getParagraph(2), "ParaShadowFormat");
     CPPUNIT_ASSERT_EQUAL(COL_BLACK, sal_uInt32(aShadow.Color));
     CPPUNIT_ASSERT_EQUAL(table::ShadowLocation_BOTTOM_RIGHT, aShadow.Location);
-    CPPUNIT_ASSERT_EQUAL(sal_Int16(TWIP_TO_MM100(60)), aShadow.ShadowWidth);
+    CPPUNIT_ASSERT_EQUAL(sal_Int16(convertTwipToMm100(60)), aShadow.ShadowWidth);
 }
 
 DECLARE_RTFEXPORT_TEST(testCharacterBorder, "charborder.odt")
@@ -599,7 +599,7 @@ DECLARE_RTFEXPORT_TEST(testFdo74709, "fdo74709.rtf")
 {
     uno::Reference<table::XCell> xCell = getCell(getParagraphOrTable(1), "B1");
     // This was 0, as top/bottom/left/right padding wasn't imported.
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(360)), getProperty<sal_Int32>(xCell, "RightBorderDistance"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(360)), getProperty<sal_Int32>(xCell, "RightBorderDistance"));
 }
 
 DECLARE_RTFEXPORT_TEST(testRelsize, "relsize.rtf")
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 2c25a16..d06d8fd 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -125,9 +125,9 @@ DECLARE_RTFIMPORT_TEST(testFdo45553, "fdo45553.rtf")
             uno::Reference<text::XTextRange> xRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
             OUString aStr = xRange->getString();
             if ( aStr == "space-before" )
-                CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(120)), getProperty<sal_Int32>(xRange, "ParaTopMargin"));
+                CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(120)), getProperty<sal_Int32>(xRange, "ParaTopMargin"));
             else if ( aStr == "space-after" )
-                CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(240)), getProperty<sal_Int32>(xRange, "ParaBottomMargin"));
+                CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(240)), getProperty<sal_Int32>(xRange, "ParaBottomMargin"));
         }
     }
 }
@@ -161,7 +161,7 @@ DECLARE_RTFIMPORT_TEST(testN695479, "n695479.rtf")
 
     // Negative ABSH should mean fixed size.
     CPPUNIT_ASSERT_EQUAL(text::SizeType::FIX, getProperty<sal_Int16>(xPropertySet, "SizeType"));
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(300)), getProperty<sal_Int32>(xPropertySet, "Height"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(300)), getProperty<sal_Int32>(xPropertySet, "Height"));
 
     uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
     uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
@@ -284,7 +284,7 @@ DECLARE_RTFIMPORT_TEST(testN751020, "n751020.rtf")
     uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY);
     uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
     CPPUNIT_ASSERT(xParaEnum->hasMoreElements());
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(200)), getProperty<sal_Int32>(xParaEnum->nextElement(), "ParaBottomMargin"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(200)), getProperty<sal_Int32>(xParaEnum->nextElement(), "ParaBottomMargin"));
 }
 
 DECLARE_RTFIMPORT_TEST(testFdo47326, "fdo47326.rtf")
@@ -477,7 +477,7 @@ DECLARE_RTFIMPORT_TEST(testFdo49501, "fdo49501.rtf")
     uno::Reference<beans::XPropertySet> xStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
 
     CPPUNIT_ASSERT_EQUAL(sal_True, getProperty<sal_Bool>(xStyle, "IsLandscape"));
-    sal_Int32 nExpected(TWIP_TO_MM100(567));
+    sal_Int32 nExpected(convertTwipToMm100(567));
     CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "LeftMargin"));
     CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "RightMargin"));
     CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int32>(xStyle, "TopMargin"));
@@ -511,7 +511,7 @@ DECLARE_RTFIMPORT_TEST(testFdo45190, "fdo45190.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraph(1), "ParaFirstLineIndent"));
 
     // but direct one not
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(-100)), getProperty<sal_Int32>(getParagraph(2), "ParaFirstLineIndent"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(-100)), getProperty<sal_Int32>(getParagraph(2), "ParaFirstLineIndent"));
 }
 
 DECLARE_RTFIMPORT_TEST(testFdo50539, "fdo50539.rtf")
@@ -548,7 +548,7 @@ DECLARE_RTFIMPORT_TEST(testFdo46966, "fdo46966.rtf")
      * xray ThisComponent.StyleFamilies.PageStyles.Default.TopMargin
      */
     uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(720)), getProperty<sal_Int32>(xPropertySet, "TopMargin"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(720)), getProperty<sal_Int32>(xPropertySet, "TopMargin"));
 }
 
 DECLARE_RTFIMPORT_TEST(testFdo52066, "fdo52066.rtf")
@@ -559,7 +559,7 @@ DECLARE_RTFIMPORT_TEST(testFdo52066, "fdo52066.rtf")
      * xray ThisComponent.DrawPage(0).Size.Height
      */
     uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(19)), xShape->getSize().Height);
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(19)), xShape->getSize().Height);
 }
 
 DECLARE_RTFIMPORT_TEST(testFdo48033, "fdo48033.rtf")
@@ -956,7 +956,7 @@ DECLARE_RTFIMPORT_TEST(testFdo59419, "fdo59419.rtf")
 DECLARE_RTFIMPORT_TEST(testFdo58076_2, "fdo58076-2.rtf")
 {
     // Position of the picture wasn't correct.
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(8345)), getProperty<sal_Int32>(getShape(1), "HoriOrientPosition"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(8345)), getProperty<sal_Int32>(getShape(1), "HoriOrientPosition"));
 }
 
 DECLARE_RTFIMPORT_TEST(testFdo59953, "fdo59953.rtf")
@@ -1285,7 +1285,7 @@ DECLARE_RTFIMPORT_TEST(testFdo67365, "fdo67365.rtf")
 DECLARE_RTFIMPORT_TEST(testFdo67498, "fdo67498.rtf")
 {
     // Left margin of the default page style wasn't set (was 2000).
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(5954)), getProperty<sal_Int32>(getStyles("PageStyles")->getByName(DEFAULT_STYLE), "LeftMargin"));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(5954)), getProperty<sal_Int32>(getStyles("PageStyles")->getByName(DEFAULT_STYLE), "LeftMargin"));
 }
 
 DECLARE_RTFIMPORT_TEST(testFdo47440, "fdo47440.rtf")
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 9c9b5d8..972b06b 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -21,7 +21,7 @@
 
 #include <bordertest.hxx>
 
-#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
+#define convertTwipToMm100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
 
 class Test : public SwModelTestBase
 {
@@ -209,7 +209,7 @@ DECLARE_WW8IMPORT_TEST(testPageBorder, "page-border.doc")
 {
     // Page border was missing (LineWidth was 0), due to wrong interpretation of pgbApplyTo.
     table::BorderLine2 aBorder = getProperty<table::BorderLine2>(getStyles("PageStyles")->getByName(DEFAULT_STYLE), "TopBorder");
-    CPPUNIT_ASSERT_EQUAL(sal_uInt32(TWIP_TO_MM100(6 * 20)), aBorder.LineWidth);
+    CPPUNIT_ASSERT_EQUAL(sal_uInt32(convertTwipToMm100(6 * 20)), aBorder.LineWidth);
 }
 
 DECLARE_WW8IMPORT_TEST(testN823651, "n823651.doc")
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index a08403b..578b6f8a 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -1136,10 +1136,10 @@ GraphicAttr& SwGrfNode::GetGraphicAttr( GraphicAttr& rGA,
     rGA.SetMirrorFlags( nMirror );
 
     const SwCropGrf& rCrop = rSet.GetCropGrf();
-    rGA.SetCrop( TWIP_TO_MM100( rCrop.GetLeft() ),
-                 TWIP_TO_MM100( rCrop.GetTop() ),
-                 TWIP_TO_MM100( rCrop.GetRight() ),
-                 TWIP_TO_MM100( rCrop.GetBottom() ));
+    rGA.SetCrop( convertTwipToMm100( rCrop.GetLeft() ),
+                 convertTwipToMm100( rCrop.GetTop() ),
+                 convertTwipToMm100( rCrop.GetRight() ),
+                 convertTwipToMm100( rCrop.GetBottom() ));
 
     const SwRotationGrf& rRotation = rSet.GetRotationGrf();
     rGA.SetRotation( rRotation.GetValue() );
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index af7c007..5f9923b 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -221,8 +221,8 @@ bool SwFmtFrmSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         case MID_FRMSIZE_SIZE:
         {
             awt::Size aTmp;
-            aTmp.Height = TWIP_TO_MM100(m_aSize.Height());
-            aTmp.Width = TWIP_TO_MM100(m_aSize.Width());
+            aTmp.Height = convertTwipToMm100(m_aSize.Height());
+            aTmp.Width = convertTwipToMm100(m_aSize.Width());
             rVal.setValue(&aTmp, ::getCppuType((const awt::Size*)0));
         }
         break;
@@ -251,14 +251,14 @@ bool SwFmtFrmSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         }
         break;
         case MID_FRMSIZE_WIDTH :
-            rVal <<= (sal_Int32)TWIP_TO_MM100(m_aSize.Width());
+            rVal <<= (sal_Int32)convertTwipToMm100(m_aSize.Width());
         break;
         case MID_FRMSIZE_HEIGHT:
             // #95848# returned size should never be zero.
             // (there was a bug that allowed for setting height to 0.
             // Thus there some documents existing with that not allowed
             // attribut value which may cause problems on import.)
-            rVal <<= (sal_Int32)TWIP_TO_MM100(m_aSize.Height() < MINLAY ? MINLAY : m_aSize.Height() );
+            rVal <<= (sal_Int32)convertTwipToMm100(m_aSize.Height() < MINLAY ? MINLAY : m_aSize.Height() );
         break;
         case MID_FRMSIZE_SIZE_TYPE:
             rVal <<= (sal_Int16)GetHeightSizeType();
@@ -293,8 +293,8 @@ bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 Size aTmp(aVal.Width, aVal.Height);
                 if(bConvert)
                 {
-                    aTmp.Height() = MM100_TO_TWIP(aTmp.Height());
-                    aTmp.Width() = MM100_TO_TWIP(aTmp.Width());
+                    aTmp.Height() = convertMm100ToTwip(aTmp.Height());
+                    aTmp.Width() = convertMm100ToTwip(aTmp.Width());
                 }
                 if(aTmp.Height() && aTmp.Width())
                     m_aSize = aTmp;
@@ -361,7 +361,7 @@ bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             if(rVal >>= nWd)
             {
                 if(bConvert)
-                    nWd = MM100_TO_TWIP(nWd);
+                    nWd = convertMm100ToTwip(nWd);
                 if(nWd < MINLAY)
                    nWd = MINLAY;
                 m_aSize.Width() = nWd;
@@ -376,7 +376,7 @@ bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             if(rVal >>= nHg)
             {
                 if(bConvert)
-                    nHg = MM100_TO_TWIP(nHg);
+                    nHg = convertMm100ToTwip(nHg);
                 if(nHg < MINLAY)
                     nHg = MINLAY;
                 m_aSize.Height() = nHg;
@@ -1060,8 +1060,8 @@ bool SwFmtCol::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                     SwColumn* pCol = new SwColumn;
                     pCol->SetWishWidth( static_cast<sal_uInt16>(pArray[i].Width) );
                     nWidthSum = static_cast<sal_uInt16>(nWidthSum + pArray[i].Width);
-                    pCol->SetLeft ( static_cast<sal_uInt16>(MM100_TO_TWIP(pArray[i].LeftMargin)) );
-                    pCol->SetRight( static_cast<sal_uInt16>(MM100_TO_TWIP(pArray[i].RightMargin)) );
+                    pCol->SetLeft ( static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].LeftMargin)) );
+                    pCol->SetRight( static_cast<sal_uInt16>(convertMm100ToTwip(pArray[i].RightMargin)) );
                     aColumns.insert(aColumns.begin() + i, pCol);
                 }
             bRet = true;
@@ -1281,7 +1281,7 @@ bool SwFmtVertOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
                 rVal <<= (sal_Int16)eRelation;
         break;
         case MID_VERTORIENT_POSITION:
-                rVal <<= (sal_Int32)TWIP_TO_MM100(GetPos());
+                rVal <<= (sal_Int32)convertTwipToMm100(GetPos());
                 break;
         default:
             OSL_ENSURE( !this, "unknown MemberId" );
@@ -1314,7 +1314,7 @@ bool SwFmtVertOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             sal_Int32 nVal = 0;
             rVal >>= nVal;
             if(bConvert)
-                nVal = MM100_TO_TWIP(nVal);
+                nVal = convertMm100ToTwip(nVal);
             SetPos( nVal );
         }
         break;
@@ -1367,7 +1367,7 @@ bool SwFmtHoriOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
             rVal <<= (sal_Int16)eRelation;
         break;
         case MID_HORIORIENT_POSITION:
-                rVal <<= (sal_Int32)TWIP_TO_MM100(GetPos());
+                rVal <<= (sal_Int32)convertTwipToMm100(GetPos());
                 break;
         case MID_HORIORIENT_PAGETOGGLE:
         {
@@ -1407,7 +1407,7 @@ bool SwFmtHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
             if(!(rVal >>= nVal))
                 bRet = false;
             if(bConvert)
-                nVal = MM100_TO_TWIP(nVal);
+                nVal = convertMm100ToTwip(nVal);
             SetPos( nVal );
         }
         break;
@@ -2184,17 +2184,17 @@ bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         case MID_GRID_BASEHEIGHT:
             OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
                         "This value needs TWIPS-MM100 conversion" );
-            rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(m_nBaseHeight);
+            rVal <<= (sal_Int32) convertTwipToMm100(m_nBaseHeight);
             break;
         case MID_GRID_BASEWIDTH:
             OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
                         "This value needs TWIPS-MM100 conversion" );
-            rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(m_nBaseWidth);
+            rVal <<= (sal_Int32) convertTwipToMm100(m_nBaseWidth);
             break;
         case MID_GRID_RUBYHEIGHT:
             OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
                         "This value needs TWIPS-MM100 conversion" );
-            rVal <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(m_nRubyHeight);
+            rVal <<= (sal_Int32)convertTwipToMm100(m_nRubyHeight);
             break;
         case MID_GRID_TYPE:
             switch( GetGridType() )
@@ -2272,7 +2272,7 @@ bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                         "This value needs TWIPS-MM100 conversion" );
             sal_Int32 nTmp = 0;
             bRet = (rVal >>= nTmp);
-            nTmp = MM100_TO_TWIP( nTmp );
+            nTmp = convertMm100ToTwip( nTmp );
             if( bRet && (nTmp >= 0) && ( nTmp <= USHRT_MAX) )
             {
                 // rhbz#1043551 round up to 5pt -- 0 causes divide-by-zero
diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx
index 4500d8c..415766c 100644
--- a/sw/source/core/para/paratr.cxx
+++ b/sw/source/core/para/paratr.cxx
@@ -128,13 +128,13 @@ bool SwFmtDrop::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     {
         case MID_DROPCAP_LINES : rVal <<= (sal_Int16)nLines; break;
         case MID_DROPCAP_COUNT : rVal <<= (sal_Int16)nChars; break;
-        case MID_DROPCAP_DISTANCE : rVal <<= (sal_Int16) TWIP_TO_MM100_UNSIGNED(nDistance); break;
+        case MID_DROPCAP_DISTANCE : rVal <<= (sal_Int16) convertTwipToMm100(nDistance); break;
         case MID_DROPCAP_FORMAT:
         {
              style::DropCapFormat aDrop;
             aDrop.Lines = nLines   ;
             aDrop.Count = nChars   ;
-            aDrop.Distance  = TWIP_TO_MM100_UNSIGNED(nDistance);
+            aDrop.Distance  = convertTwipToMm100(nDistance);
             rVal.setValue(&aDrop, ::getCppuType((const style::DropCapFormat*)0));
         }
         break;
@@ -178,7 +178,7 @@ bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
         {
             sal_Int16 nVal = 0;
             if ( rVal >>= nVal )
-                nDistance = (sal_Int16) MM100_TO_TWIP((sal_Int32)nVal);
+                nDistance = (sal_Int16) convertMm100ToTwip((sal_Int32)nVal);
             else
                 return false;
             break;
@@ -190,7 +190,7 @@ bool SwFmtDrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
                 const style::DropCapFormat* pDrop = (const style::DropCapFormat*)rVal.getValue();
                 nLines      = pDrop->Lines;
                 nChars      = pDrop->Count;
-                nDistance   = MM100_TO_TWIP(pDrop->Distance);
+                nDistance   = convertMm100ToTwip(pDrop->Distance);
             }
             else {
             }
diff --git a/sw/source/core/uibase/config/fontcfg.cxx b/sw/source/core/uibase/config/fontcfg.cxx
index 35d84ab..20ebfde 100644
--- a/sw/source/core/uibase/config/fontcfg.cxx
+++ b/sw/source/core/uibase/config/fontcfg.cxx
@@ -124,7 +124,7 @@ SwStdFontConfig::SwStdFontConfig() :
                 else
                 {
                    pValues[nProp] >>= nDefaultFontHeight[nProp - DEF_FONT_COUNT];
-                   nDefaultFontHeight[nProp - DEF_FONT_COUNT] = MM100_TO_TWIP(nDefaultFontHeight[nProp - DEF_FONT_COUNT]);
+                   nDefaultFontHeight[nProp - DEF_FONT_COUNT] = convertMm100ToTwip(nDefaultFontHeight[nProp - DEF_FONT_COUNT]);
                 }
             }
         }
@@ -156,7 +156,7 @@ void    SwStdFontConfig::Commit()
         else
         {
             if(nDefaultFontHeight[nProp - DEF_FONT_COUNT] > 0)
-                pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(nDefaultFontHeight[nProp - DEF_FONT_COUNT]));
+                pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(nDefaultFontHeight[nProp - DEF_FONT_COUNT]));
         }
     }
     PutProperties(aNames, aValues);
diff --git a/sw/source/core/uibase/config/modcfg.cxx b/sw/source/core/uibase/config/modcfg.cxx
index 211b34a..a242b94 100644
--- a/sw/source/core/uibase/config/modcfg.cxx
+++ b/sw/source/core/uibase/config/modcfg.cxx
@@ -1157,10 +1157,10 @@ void SwTableConfig::Commit()
     {
         switch(nProp)
         {
-            case 0 : pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nTblHMove); break;   //"Shift/Row",
-            case 1 : pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nTblVMove); break;     //"Shift/Column",
-            case 2 : pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nTblHInsert); break;   //"Insert/Row",
-            case 3 : pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nTblVInsert); break;   //"Insert/Column",
+            case 0 : pValues[nProp] <<= (sal_Int32)convertTwipToMm100(nTblHMove); break;   //"Shift/Row",
+            case 1 : pValues[nProp] <<= (sal_Int32)convertTwipToMm100(nTblVMove); break;     //"Shift/Column",
+            case 2 : pValues[nProp] <<= (sal_Int32)convertTwipToMm100(nTblHInsert); break;   //"Insert/Row",
+            case 3 : pValues[nProp] <<= (sal_Int32)convertTwipToMm100(nTblVInsert); break;   //"Insert/Column",
             case 4 : pValues[nProp] <<= (sal_Int32)eTblChgMode; break;   //"Change/Effect",
             case 5 : pValues[nProp].setValue(&bInsTblFormatNum, rType); break;  //"Input/NumberRecognition",
             case 6 : pValues[nProp].setValue(&bInsTblChangeNumFormat, rType); break;  //"Input/NumberFormatRecognition",
@@ -1185,10 +1185,10 @@ void SwTableConfig::Load()
                 sal_Int32 nTemp = 0;
                 switch(nProp)
                 {
-                    case 0 : pValues[nProp] >>= nTemp; nTblHMove = (sal_uInt16)MM100_TO_TWIP(nTemp); break;  //"Shift/Row",
-                    case 1 : pValues[nProp] >>= nTemp; nTblVMove = (sal_uInt16)MM100_TO_TWIP(nTemp); break;     //"Shift/Column",
-                    case 2 : pValues[nProp] >>= nTemp; nTblHInsert = (sal_uInt16)MM100_TO_TWIP(nTemp); break;   //"Insert/Row",
-                    case 3 : pValues[nProp] >>= nTemp; nTblVInsert = (sal_uInt16)MM100_TO_TWIP(nTemp); break;   //"Insert/Column",
+                    case 0 : pValues[nProp] >>= nTemp; nTblHMove = (sal_uInt16)convertMm100ToTwip(nTemp); break;  //"Shift/Row",
+                    case 1 : pValues[nProp] >>= nTemp; nTblVMove = (sal_uInt16)convertMm100ToTwip(nTemp); break;     //"Shift/Column",
+                    case 2 : pValues[nProp] >>= nTemp; nTblHInsert = (sal_uInt16)convertMm100ToTwip(nTemp); break;   //"Insert/Row",
+                    case 3 : pValues[nProp] >>= nTemp; nTblVInsert = (sal_uInt16)convertMm100ToTwip(nTemp); break;   //"Insert/Column",
                     case 4 : pValues[nProp] >>= nTemp; eTblChgMode = (TblChgMode)nTemp; break;   //"Change/Effect",
                     case 5 : bInsTblFormatNum = *(sal_Bool*)pValues[nProp].getValue();  break;  //"Input/NumberRecognition",
                     case 6 : bInsTblChangeNumFormat = *(sal_Bool*)pValues[nProp].getValue(); break;  //"Input/NumberFormatRecognition",
diff --git a/sw/source/core/uibase/config/usrpref.cxx b/sw/source/core/uibase/config/usrpref.cxx
index 7c47d45..6e0f70d 100644
--- a/sw/source/core/uibase/config/usrpref.cxx
+++ b/sw/source/core/uibase/config/usrpref.cxx
@@ -292,7 +292,7 @@ void SwLayoutViewConfig::Commit()
             case 10: rVal <<= (sal_Int32)rParent.GetZoomType(); break;              // "Zoom/Type",
             case 11: rVal <<= (sal_Bool) rParent.IsAlignMathObjectsToBaseline(); break;      // "Other/IsAlignMathObjectsToBaseline"
             case 12: rVal <<= (sal_Int32)rParent.GetMetric(); break;                // "Other/MeasureUnit",
-            case 13: rVal <<= static_cast<sal_Int32>(TWIP_TO_MM100(rParent.GetDefTab())); break;// "Other/TabStop",
+            case 13: rVal <<= static_cast<sal_Int32>(convertTwipToMm100(rParent.GetDefTab())); break;// "Other/TabStop",
             case 14: rVal <<= (sal_Bool) rParent.IsVRulerRight(); break;            // "Window/IsVerticalRulerRight",
             case 15: rVal <<= (sal_Int32)rParent.GetViewLayoutColumns(); break;     // "ViewLayout/Columns",
             case 16: rVal <<= (sal_Bool) rParent.IsViewLayoutBookMode(); break;     // "ViewLayout/BookMode",
@@ -346,7 +346,7 @@ void SwLayoutViewConfig::Load()
                     case 10: rParent.SetZoomType( static_cast< SvxZoomType >(nInt32Val) ); break;// "Zoom/Type",
                     case 11: rParent.SetAlignMathObjectsToBaseline(bSet); break;// "Other/IsAlignMathObjectsToBaseline"
                     case 12: rParent.SetMetric((FieldUnit)nInt32Val, sal_True); break;// "Other/MeasureUnit",
-                    case 13: rParent.SetDefTab(MM100_TO_TWIP(nInt32Val), sal_True); break;// "Other/TabStop",
+                    case 13: rParent.SetDefTab(convertMm100ToTwip(nInt32Val), sal_True); break;// "Other/TabStop",
                     case 14: rParent.SetVRulerRight(bSet); break;// "Window/IsVerticalRulerRight",
                     case 15: rParent.SetViewLayoutColumns( static_cast<sal_uInt16>(nInt32Val) ); break;// "ViewLayout/Columns",
                     case 16: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode",
@@ -409,8 +409,8 @@ void SwGridConfig::Commit()
             case  0: bSet = rParent.IsSnap(); break;//      "Option/SnapToGrid",
             case  1: bSet = rParent.IsGridVisible(); break;//"Option/VisibleGrid",
             case  2: bSet = rParent.IsSynchronize(); break;//  "Option/Synchronize",
-            case  3: pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100(rParent.GetSnapSize().Width()); break;//      "Resolution/XAxis",
-            case  4: pValues[nProp] <<= (sal_Int32)TWIP_TO_MM100(rParent.GetSnapSize().Height()); break;//      "Resolution/YAxis",
+            case  3: pValues[nProp] <<= (sal_Int32)convertTwipToMm100(rParent.GetSnapSize().Width()); break;//      "Resolution/XAxis",
+            case  4: pValues[nProp] <<= (sal_Int32)convertTwipToMm100(rParent.GetSnapSize().Height()); break;//      "Resolution/YAxis",
             case  5: pValues[nProp] <<= (sal_Int16)rParent.GetDivisionX(); break;//   "Subdivision/XAxis",
             case  6: pValues[nProp] <<= (sal_Int16)rParent.GetDivisionY(); break;//   "Subdivision/YAxis"
         }
@@ -442,8 +442,8 @@ void SwGridConfig::Load()
                     case  0: rParent.SetSnap(bSet); break;//        "Option/SnapToGrid",
                     case  1: rParent.SetGridVisible(bSet); break;//"Option/VisibleGrid",
                     case  2: rParent.SetSynchronize(bSet); break;//  "Option/Synchronize",
-                    case  3: aSnap.Width() = MM100_TO_TWIP(nSet); break;//      "Resolution/XAxis",
-                    case  4: aSnap.Height() = MM100_TO_TWIP(nSet); break;//      "Resolution/YAxis",
+                    case  3: aSnap.Width() = convertMm100ToTwip(nSet); break;//      "Resolution/XAxis",
+                    case  4: aSnap.Height() = convertMm100ToTwip(nSet); break;//      "Resolution/YAxis",
                     case  5: rParent.SetDivisionX((short)nSet); break;//   "Subdivision/XAxis",
                     case  6: rParent.SetDivisionY((short)nSet); break;//   "Subdivision/YAxis"
                 }
diff --git a/sw/source/core/uibase/envelp/envimg.cxx b/sw/source/core/uibase/envelp/envimg.cxx
index 6bdbe02f..66e3f0a 100644
--- a/sw/source/core/uibase/envelp/envimg.cxx
+++ b/sw/source/core/uibase/envelp/envimg.cxx
@@ -191,27 +191,27 @@ SwEnvCfgItem::SwEnvCfgItem() :
                     case  2: aEnvItem.bSend = *(sal_Bool*)pValues[nProp].getValue(); break;// "Inscription/UseSender",
                     case  3:
                         pValues[nProp] >>= aEnvItem.lAddrFromLeft;// "Format/AddresseeFromLeft",
-                        aEnvItem.lAddrFromLeft = MM100_TO_TWIP(aEnvItem.lAddrFromLeft);
+                        aEnvItem.lAddrFromLeft = convertMm100ToTwip(aEnvItem.lAddrFromLeft);
                     break;
                     case  4:
                         pValues[nProp] >>= aEnvItem.lAddrFromTop;  // "Format/AddresseeFromTop",
-                        aEnvItem.lAddrFromTop = MM100_TO_TWIP(aEnvItem.lAddrFromTop);
+                        aEnvItem.lAddrFromTop = convertMm100ToTwip(aEnvItem.lAddrFromTop);
                     break;
                     case  5:
                         pValues[nProp] >>= aEnvItem.lSendFromLeft; // "Format/SenderFromLeft",
-                        aEnvItem.lSendFromLeft = MM100_TO_TWIP(aEnvItem.lSendFromLeft);
+                        aEnvItem.lSendFromLeft = convertMm100ToTwip(aEnvItem.lSendFromLeft);
                     break;
                     case  6:
                         pValues[nProp] >>= aEnvItem.lSendFromTop;// "Format/SenderFromTop",
-                        aEnvItem.lSendFromTop = MM100_TO_TWIP(aEnvItem.lSendFromTop);
+                        aEnvItem.lSendFromTop = convertMm100ToTwip(aEnvItem.lSendFromTop);
                     break;
                     case  7:
                         pValues[nProp] >>= aEnvItem.lWidth; // "Format/Width",
-                        aEnvItem.lWidth = MM100_TO_TWIP(aEnvItem.lWidth);
+                        aEnvItem.lWidth = convertMm100ToTwip(aEnvItem.lWidth);
                     break;
                     case  8:
                         pValues[nProp] >>= aEnvItem.lHeight; // "Format/Height",
-                        aEnvItem.lHeight = MM100_TO_TWIP(aEnvItem.lHeight);
+                        aEnvItem.lHeight = convertMm100ToTwip(aEnvItem.lHeight);
                     break;
                     case  9:
                     {
@@ -221,11 +221,11 @@ SwEnvCfgItem::SwEnvCfgItem() :
                     case 10: aEnvItem.bPrintFromAbove = *(sal_Bool*)pValues[nProp].getValue(); break;// "Print/FromAbove",
                     case 11:
                         pValues[nProp] >>= aEnvItem.lShiftRight;
-                        aEnvItem.lShiftRight = MM100_TO_TWIP(aEnvItem.lShiftRight);// "Print/Right",
+                        aEnvItem.lShiftRight = convertMm100ToTwip(aEnvItem.lShiftRight);// "Print/Right",
                     break;
                     case 12:
                         pValues[nProp] >>= aEnvItem.lShiftDown;
-                        aEnvItem.lShiftDown = MM100_TO_TWIP(aEnvItem.lShiftDown);
+                        aEnvItem.lShiftDown = convertMm100ToTwip(aEnvItem.lShiftDown);
                     break;// "Print/Down"
                 }
             }
@@ -251,16 +251,16 @@ void    SwEnvCfgItem::Commit()
             case  0: pValues[nProp] <<= aEnvItem.aAddrText; break;// "Inscription/Addressee",
             case  1: pValues[nProp] <<= aEnvItem.aSendText; break;// "Inscription/Sender",
             case  2: pValues[nProp].setValue(&aEnvItem.bSend, rType);break;// "Inscription/UseSender",
-            case  3: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lAddrFromLeft)) ; break;// "Format/AddresseeFromLeft",
-            case  4: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lAddrFromTop))  ; break;// "Format/AddresseeFromTop",
-            case  5: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lSendFromLeft)) ; break;// "Format/SenderFromLeft",
-            case  6: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lSendFromTop))  ; break;// "Format/SenderFromTop",
-            case  7: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lWidth))  ; break;// "Format/Width",
-            case  8: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lHeight)) ; break;// "Format/Height",
+            case  3: pValues[nProp] <<= static_cast <sal_Int32>(convertTwipToMm100(aEnvItem.lAddrFromLeft)) ; break;// "Format/AddresseeFromLeft",
+            case  4: pValues[nProp] <<= static_cast <sal_Int32>(convertTwipToMm100(aEnvItem.lAddrFromTop))  ; break;// "Format/AddresseeFromTop",
+            case  5: pValues[nProp] <<= static_cast <sal_Int32>(convertTwipToMm100(aEnvItem.lSendFromLeft)) ; break;// "Format/SenderFromLeft",
+            case  6: pValues[nProp] <<= static_cast <sal_Int32>(convertTwipToMm100(aEnvItem.lSendFromTop))  ; break;// "Format/SenderFromTop",
+            case  7: pValues[nProp] <<= static_cast <sal_Int32>(convertTwipToMm100(aEnvItem.lWidth))  ; break;// "Format/Width",
+            case  8: pValues[nProp] <<= static_cast <sal_Int32>(convertTwipToMm100(aEnvItem.lHeight)) ; break;// "Format/Height",
             case  9: pValues[nProp] <<= sal_Int32(aEnvItem.eAlign); break;// "Print/Alignment",
             case 10: pValues[nProp].setValue(&aEnvItem.bPrintFromAbove, rType); break;// "Print/FromAbove",
-            case 11: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lShiftRight));break; // "Print/Right",
-            case 12: pValues[nProp] <<= static_cast <sal_Int32>(TWIP_TO_MM100(aEnvItem.lShiftDown)); break;// "Print/Down"
+            case 11: pValues[nProp] <<= static_cast <sal_Int32>(convertTwipToMm100(aEnvItem.lShiftRight));break; // "Print/Right",
+            case 12: pValues[nProp] <<= static_cast <sal_Int32>(convertTwipToMm100(aEnvItem.lShiftDown)); break;// "Print/Down"
         }
     }
     PutProperties(aNames, aValues);
diff --git a/sw/source/core/uibase/envelp/labelcfg.cxx b/sw/source/core/uibase/envelp/labelcfg.cxx
index 8630ea0..b798098 100644
--- a/sw/source/core/uibase/envelp/labelcfg.cxx
+++ b/sw/source/core/uibase/envelp/labelcfg.cxx
@@ -191,16 +191,16 @@ static SwLabRec* lcl_CreateSwLabRec(const OUString& rType, const OUString& rMeas
         switch(i)
         {
             case  0 : pNewRec->bCont = sToken[0] == 'C'; break;
-            case  1 : pNewRec->lHDist    = MM100_TO_TWIP(nVal);  break;
-            case  2 : pNewRec->lVDist    = MM100_TO_TWIP(nVal);  break;
-            case  3 : pNewRec->lWidth    = MM100_TO_TWIP(nVal);  break;
-            case  4 : pNewRec->lHeight   = MM100_TO_TWIP(nVal);  break;
-            case  5 : pNewRec->lLeft     = MM100_TO_TWIP(nVal);  break;
-            case  6 : pNewRec->lUpper    = MM100_TO_TWIP(nVal);  break;
+            case  1 : pNewRec->lHDist    = convertMm100ToTwip(nVal);  break;
+            case  2 : pNewRec->lVDist    = convertMm100ToTwip(nVal);  break;
+            case  3 : pNewRec->lWidth    = convertMm100ToTwip(nVal);  break;
+            case  4 : pNewRec->lHeight   = convertMm100ToTwip(nVal);  break;
+            case  5 : pNewRec->lLeft     = convertMm100ToTwip(nVal);  break;
+            case  6 : pNewRec->lUpper    = convertMm100ToTwip(nVal);  break;
             case  7 : pNewRec->nCols     = nVal;                 break;
             case  8 : pNewRec->nRows     = nVal;                 break;
-            case  9 : pNewRec->lPWidth   = MM100_TO_TWIP(nVal);  break;
-            case 10 : pNewRec->lPHeight  = MM100_TO_TWIP(nVal);  break;
+            case  9 : pNewRec->lPWidth   = convertMm100ToTwip(nVal);  break;
+            case 10 : pNewRec->lPHeight  = convertMm100ToTwip(nVal);  break;
         }
     }
     // lines added for compatibility with custom label definitions saved before patch fdo#44516
@@ -231,16 +231,16 @@ static Sequence<PropertyValue> lcl_CreateProperties(
             {
                 rMeasure = "";
                 rMeasure += rRec.bCont ? OUString( "C" ) : OUString( "S" );      rMeasure += sColon;
-                rMeasure += OUString::number( TWIP_TO_MM100( rRec.lHDist ) );   rMeasure += sColon;
-                rMeasure += OUString::number( TWIP_TO_MM100( rRec.lVDist ) );   rMeasure += sColon;
-                rMeasure += OUString::number( TWIP_TO_MM100( rRec.lWidth ) );   rMeasure += sColon;
-                rMeasure += OUString::number( TWIP_TO_MM100( rRec.lHeight ) );  rMeasure += sColon;
-                rMeasure += OUString::number( TWIP_TO_MM100( rRec.lLeft ) );    rMeasure += sColon;
-                rMeasure += OUString::number( TWIP_TO_MM100( rRec.lUpper ) );   rMeasure += sColon;
+                rMeasure += OUString::number( convertTwipToMm100( rRec.lHDist ) );   rMeasure += sColon;
+                rMeasure += OUString::number( convertTwipToMm100( rRec.lVDist ) );   rMeasure += sColon;
+                rMeasure += OUString::number( convertTwipToMm100( rRec.lWidth ) );   rMeasure += sColon;
+                rMeasure += OUString::number( convertTwipToMm100( rRec.lHeight ) );  rMeasure += sColon;
+                rMeasure += OUString::number( convertTwipToMm100( rRec.lLeft ) );    rMeasure += sColon;
+                rMeasure += OUString::number( convertTwipToMm100( rRec.lUpper ) );   rMeasure += sColon;
                 rMeasure += OUString::number( rRec.nCols );                     rMeasure += sColon;
                 rMeasure += OUString::number( rRec.nRows );                     rMeasure += sColon;
-                rMeasure += OUString::number( TWIP_TO_MM100( rRec.lPWidth ) );  rMeasure += sColon;
-                rMeasure += OUString::number( TWIP_TO_MM100( rRec.lPHeight ) );
+                rMeasure += OUString::number( convertTwipToMm100( rRec.lPWidth ) );  rMeasure += sColon;
+                rMeasure += OUString::number( convertTwipToMm100( rRec.lPHeight ) );
                 pValues[nProp].Value <<= rMeasure;
             }
             break;
diff --git a/sw/source/core/uibase/envelp/labimg.cxx b/sw/source/core/uibase/envelp/labimg.cxx
index a2006b8..3665206 100644
--- a/sw/source/core/uibase/envelp/labimg.cxx
+++ b/sw/source/core/uibase/envelp/labimg.cxx
@@ -295,35 +295,35 @@ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) :
                     case  4: pValues[nProp] >>= aItem.nRows;            break;// "Format/Row",
                     case  5:
                         pValues[nProp] >>= aItem.lHDist;
-                        aItem.lHDist = MM100_TO_TWIP(aItem.lHDist);
+                        aItem.lHDist = convertMm100ToTwip(aItem.lHDist);
                     break;// "Format/HorizontalDistance",
                     case  6:
                         pValues[nProp] >>= aItem.lVDist;
-                        aItem.lVDist = MM100_TO_TWIP(aItem.lVDist);
+                        aItem.lVDist = convertMm100ToTwip(aItem.lVDist);
                     break;// "Format/VerticalDistance",
                     case  7:
                         pValues[nProp] >>= aItem.lWidth;
-                        aItem.lWidth = MM100_TO_TWIP(aItem.lWidth);
+                        aItem.lWidth = convertMm100ToTwip(aItem.lWidth);
                     break;// "Format/Width",
                     case  8:
                         pValues[nProp] >>= aItem.lHeight;
-                        aItem.lHeight = MM100_TO_TWIP(aItem.lHeight);
+                        aItem.lHeight = convertMm100ToTwip(aItem.lHeight);
                     break;// "Format/Height",
                     case  9:
                         pValues[nProp] >>= aItem.lLeft;
-                        aItem.lLeft = MM100_TO_TWIP(aItem.lLeft);
+                        aItem.lLeft = convertMm100ToTwip(aItem.lLeft);
                     break;// "Format/LeftMargin",
                     case 10:
                         pValues[nProp] >>= aItem.lUpper;
-                        aItem.lUpper = MM100_TO_TWIP(aItem.lUpper);
+                        aItem.lUpper = convertMm100ToTwip(aItem.lUpper);
                     break;// "Format/TopMargin",
                     case 11:
                         pValues[nProp] >>= aItem.lPWidth;
-                        aItem.lPWidth = MM100_TO_TWIP(aItem.lPWidth);
+                        aItem.lPWidth = convertMm100ToTwip(aItem.lPWidth);
                     break;// "Format/PageWidth",
                     case 12:
                         pValues[nProp] >>= aItem.lPHeight;
-                        aItem.lPHeight = MM100_TO_TWIP(aItem.lPHeight);
+                        aItem.lPHeight = convertMm100ToTwip(aItem.lPHeight);
                     break;// "Format/PageHeight",
                     case 13: aItem.bSynchron = *(sal_Bool*)pValues[nProp].getValue(); break;// "Option/Synchronize",
                     case 14: aItem.bPage = *(sal_Bool*)pValues[nProp].getValue(); break;// "Option/Page",
@@ -416,14 +416,14 @@ void    SwLabCfgItem::Commit()
             case  2: pValues[nProp] <<= aItem.aType;            break;// "Medium/Type",
             case  3: pValues[nProp] <<= aItem.nCols;            break;// "Format/Column",
             case  4: pValues[nProp] <<= aItem.nRows;            break;// "Format/Row",
-            case  5: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lHDist));break;// "Format/HorizontalDistance",
-            case  6: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lVDist));break;// "Format/VerticalDistance",
-            case  7: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lWidth));            break;// "Format/Width",
-            case  8: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lHeight));           break;// "Format/Height",
-            case  9: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lLeft));         break;// "Format/LeftMargin",
-            case 10: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lUpper));            break;// "Format/TopMargin",
-            case 11: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lPWidth)); break;// "Format/Page Width",
-            case 12: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(aItem.lPHeight)); break;// "Format/PageHeight",
+            case  5: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(aItem.lHDist));break;// "Format/HorizontalDistance",
+            case  6: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(aItem.lVDist));break;// "Format/VerticalDistance",
+            case  7: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(aItem.lWidth));            break;// "Format/Width",
+            case  8: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(aItem.lHeight));           break;// "Format/Height",
+            case  9: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(aItem.lLeft));         break;// "Format/LeftMargin",
+            case 10: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(aItem.lUpper));            break;// "Format/TopMargin",
+            case 11: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(aItem.lPWidth)); break;// "Format/Page Width",
+            case 12: pValues[nProp] <<= static_cast<sal_Int32>(convertTwipToMm100(aItem.lPHeight)); break;// "Format/PageHeight",
             case 13: pValues[nProp].setValue(&aItem.bSynchron, rType); break;// "Option/Synchronize",
             case 14: pValues[nProp].setValue(&aItem.bPage, rType); break;// "Option/Page",
             case 15: pValues[nProp] <<= aItem.nCol;            break;// "Option/Column",
diff --git a/sw/source/core/uibase/shells/grfsh.cxx b/sw/source/core/uibase/shells/grfsh.cxx
index 5538251..980dcea 100644
--- a/sw/source/core/uibase/shells/grfsh.cxx
+++ b/sw/source/core/uibase/shells/grfsh.cxx
@@ -133,18 +133,18 @@ void SwGrfShell::Execute(SfxRequest &rReq)
             if( pGraphic )
             {
                 Size aSize (
-                    TWIP_TO_MM100(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Width()),
-                    TWIP_TO_MM100(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Height()));
+                    convertTwipToMm100(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Width()),
+                    convertTwipToMm100(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Height()));
 
                 SfxItemSet aSet( rSh.GetAttrPool(), RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF );
                 rSh.GetCurAttr( aSet );
                 SwCropGrf aCrop( (const SwCropGrf&) aSet.Get(RES_GRFATR_CROPGRF) );
 
                 Rectangle aCropRectangle(
-                    TWIP_TO_MM100(aCrop.GetLeft()),
-                    TWIP_TO_MM100(aCrop.GetTop()),
-                    TWIP_TO_MM100(aCrop.GetRight()),
-                    TWIP_TO_MM100(aCrop.GetBottom()) );
+                    convertTwipToMm100(aCrop.GetLeft()),
+                    convertTwipToMm100(aCrop.GetTop()),
+                    convertTwipToMm100(aCrop.GetRight()),
+                    convertTwipToMm100(aCrop.GetBottom()) );
 
                 Graphic aGraphic = Graphic( *pGraphic );
 
@@ -155,10 +155,10 @@ void SwGrfShell::Execute(SfxRequest &rReq)
                     rSh.StartUndo(UNDO_START);
                     Rectangle aScaledCropedRectangle = aDialog.GetScaledCropRectangle();
 
-                    aCrop.SetLeft(   MM100_TO_TWIP( aScaledCropedRectangle.Left() ));
-                    aCrop.SetTop(    MM100_TO_TWIP( aScaledCropedRectangle.Top() ));
-                    aCrop.SetRight(  MM100_TO_TWIP( aScaledCropedRectangle.Right() ));
-                    aCrop.SetBottom( MM100_TO_TWIP( aScaledCropedRectangle.Bottom() ));
+                    aCrop.SetLeft(   convertMm100ToTwip( aScaledCropedRectangle.Left() ));
+                    aCrop.SetTop(    convertMm100ToTwip( aScaledCropedRectangle.Top() ));
+                    aCrop.SetRight(  convertMm100ToTwip( aScaledCropedRectangle.Right() ));
+                    aCrop.SetBottom( convertMm100ToTwip( aScaledCropedRectangle.Bottom() ));
 
                     Graphic aCompressedGraphic( aDialog.GetCompressedGraphic() );
                     rSh.ReRead(OUString(), OUString(), (const Graphic*) &aCompressedGraphic);
diff --git a/sw/source/core/uibase/uiview/view.cxx b/sw/source/core/uibase/uiview/view.cxx
index 1fdf0bf..e13f917 100644
--- a/sw/source/core/uibase/uiview/view.cxx
+++ b/sw/source/core/uibase/uiview/view.cxx
@@ -1269,35 +1269,35 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
             if ( pValue->Name == "ViewLeft" )
             {
                pValue->Value >>= nX;
-               nX = MM100_TO_TWIP( nX );
+               nX = convertMm100ToTwip( nX );
             }
             else if ( pValue->Name == "ViewTop" )
             {
                pValue->Value >>= nY;
-               nY = MM100_TO_TWIP( nY );
+               nY = convertMm100ToTwip( nY );
             }
             else if ( pValue->Name == "VisibleLeft" )
             {
                pValue->Value >>= nLeft;
-               nLeft = MM100_TO_TWIP( nLeft );
+               nLeft = convertMm100ToTwip( nLeft );
                bGotVisibleLeft = sal_True;
             }
             else if ( pValue->Name == "VisibleTop" )
             {
                pValue->Value >>= nTop;
-               nTop = MM100_TO_TWIP( nTop );
+               nTop = convertMm100ToTwip( nTop );
                bGotVisibleTop = sal_True;
             }
             else if ( pValue->Name == "VisibleRight" )
             {
                pValue->Value >>= nRight;
-               nRight = MM100_TO_TWIP( nRight );
+               nRight = convertMm100ToTwip( nRight );
                bGotVisibleRight = sal_True;
             }
             else if ( pValue->Name == "VisibleBottom" )
             {
                pValue->Value >>= nBottom;
-               nBottom = MM100_TO_TWIP( nBottom );
+               nBottom = convertMm100ToTwip( nBottom );
                bGotVisibleBottom = sal_True;
             }
             else if ( pValue->Name == "ZoomType" )
@@ -1471,27 +1471,27 @@ void SwView::WriteUserDataSequence ( uno::Sequence < beans::PropertyValue >& rSe
     pValue++;nIndex++;
 
     pValue->Name = "ViewLeft";
-    pValue->Value <<= TWIP_TO_MM100 ( rRect.Left() );
+    pValue->Value <<= convertTwipToMm100 ( rRect.Left() );
     pValue++;nIndex++;
 
     pValue->Name = "ViewTop";
-    pValue->Value <<= TWIP_TO_MM100 ( rRect.Top() );
+    pValue->Value <<= convertTwipToMm100 ( rRect.Top() );
     pValue++;nIndex++;
 
     pValue->Name = "VisibleLeft";
-    pValue->Value <<= TWIP_TO_MM100 ( rVis.Left() );
+    pValue->Value <<= convertTwipToMm100 ( rVis.Left() );
     pValue++;nIndex++;
 
     pValue->Name = "VisibleTop";
-    pValue->Value <<= TWIP_TO_MM100 ( rVis.Top() );
+    pValue->Value <<= convertTwipToMm100 ( rVis.Top() );
     pValue++;nIndex++;
 
     pValue->Name = "VisibleRight";
-    pValue->Value <<= TWIP_TO_MM100 ( bBrowse ? LONG_MIN : rVis.Right() );
+    pValue->Value <<= convertTwipToMm100 ( bBrowse ? LONG_MIN : rVis.Right() );
     pValue++;nIndex++;
 
     pValue->Name = "VisibleBottom";
-    pValue->Value <<= TWIP_TO_MM100 ( bBrowse ? LONG_MIN : rVis.Bottom() );
+    pValue->Value <<= convertTwipToMm100 ( bBrowse ? LONG_MIN : rVis.Bottom() );

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list