[Libreoffice-commits] core.git: 27 commits - sw/inc sw/source

Matteo Casalin matteo.casalin at yahoo.com
Tue Jul 22 14:51:32 PDT 2014


 sw/inc/ndhints.hxx                                      |   38 +--
 sw/inc/ndtxt.hxx                                        |    8 
 sw/inc/txatritr.hxx                                     |    3 
 sw/source/core/access/acchyperlink.cxx                  |    2 
 sw/source/core/access/acchyperlink.hxx                  |    4 
 sw/source/core/access/accpara.cxx                       |    8 
 sw/source/core/access/accportions.cxx                   |    2 
 sw/source/core/access/accportions.hxx                   |    2 
 sw/source/core/crsr/callnk.cxx                          |    2 
 sw/source/core/crsr/crstrvl.cxx                         |    2 
 sw/source/core/crsr/findattr.cxx                        |    4 
 sw/source/core/crsr/findtxt.cxx                         |   12 -
 sw/source/core/doc/DocumentContentOperationsManager.cxx |   10 
 sw/source/core/doc/dbgoutsw.cxx                         |    2 
 sw/source/core/doc/docfld.cxx                           |    6 
 sw/source/core/doc/docruby.cxx                          |    9 
 sw/source/core/doc/doctxm.cxx                           |    8 
 sw/source/core/docnode/nodedump.cxx                     |    2 
 sw/source/core/docnode/nodes.cxx                        |    2 
 sw/source/core/edit/acorrect.cxx                        |    5 
 sw/source/core/frmedt/fefly1.cxx                        |    9 
 sw/source/core/inc/SwPortionHandler.hxx                 |    5 
 sw/source/core/inc/txtfly.hxx                           |    9 
 sw/source/core/inc/txttypes.hxx                         |    8 
 sw/source/core/table/swtable.cxx                        |    2 
 sw/source/core/text/frmcrsr.cxx                         |   22 -
 sw/source/core/text/frmform.cxx                         |   20 -
 sw/source/core/text/frminf.cxx                          |    4 
 sw/source/core/text/frmpaint.cxx                        |   12 -
 sw/source/core/text/guess.cxx                           |    4 
 sw/source/core/text/guess.hxx                           |    8 
 sw/source/core/text/inftxt.cxx                          |   12 -
 sw/source/core/text/inftxt.hxx                          |   57 ++---
 sw/source/core/text/itradj.cxx                          |   32 +-
 sw/source/core/text/itratr.cxx                          |   33 +-
 sw/source/core/text/itratr.hxx                          |   10 
 sw/source/core/text/itrcrsr.cxx                         |   38 +--
 sw/source/core/text/itrform2.cxx                        |   64 ++---
 sw/source/core/text/itrform2.hxx                        |    8 
 sw/source/core/text/itrpaint.cxx                        |    6 
 sw/source/core/text/itrtxt.cxx                          |    4 
 sw/source/core/text/itrtxt.hxx                          |   44 +--
 sw/source/core/text/noteurl.cxx                         |    9 
 sw/source/core/text/pordrop.hxx                         |   32 +-
 sw/source/core/text/porexp.cxx                          |   10 
 sw/source/core/text/porexp.hxx                          |    6 
 sw/source/core/text/porfld.cxx                          |   36 +--
 sw/source/core/text/porfld.hxx                          |   18 -
 sw/source/core/text/porfly.cxx                          |    6 
 sw/source/core/text/porfly.hxx                          |   10 
 sw/source/core/text/porftn.hxx                          |    8 
 sw/source/core/text/porglue.cxx                         |   16 -
 sw/source/core/text/porglue.hxx                         |   20 -
 sw/source/core/text/porhyph.hxx                         |    6 
 sw/source/core/text/porlay.cxx                          |   24 --
 sw/source/core/text/porlay.hxx                          |    6 
 sw/source/core/text/porlin.cxx                          |   22 -
 sw/source/core/text/porlin.hxx                          |   27 +-
 sw/source/core/text/pormulti.cxx                        |   62 ++---
 sw/source/core/text/pormulti.hxx                        |   14 -
 sw/source/core/text/porref.cxx                          |    2 
 sw/source/core/text/porref.hxx                          |    4 
 sw/source/core/text/porrst.cxx                          |   20 -
 sw/source/core/text/porrst.hxx                          |   10 
 sw/source/core/text/portab.hxx                          |   16 -
 sw/source/core/text/portox.cxx                          |    2 
 sw/source/core/text/portox.hxx                          |    4 
 sw/source/core/text/portxt.cxx                          |   12 -
 sw/source/core/text/portxt.hxx                          |   10 
 sw/source/core/text/possiz.hxx                          |   30 +-
 sw/source/core/text/redlnitr.cxx                        |   12 -
 sw/source/core/text/redlnitr.hxx                        |    2 
 sw/source/core/text/txtcache.cxx                        |   14 -
 sw/source/core/text/txtdrop.cxx                         |   60 ++---
 sw/source/core/text/txtfld.cxx                          |    8 
 sw/source/core/text/txtfly.cxx                          |   28 +-
 sw/source/core/text/txtfrm.cxx                          |   66 ++---
 sw/source/core/text/txtftn.cxx                          |   30 +-
 sw/source/core/text/txthyph.cxx                         |   10 
 sw/source/core/text/txttab.cxx                          |   42 +--
 sw/source/core/text/widorp.cxx                          |    8 
 sw/source/core/text/widorp.hxx                          |    6 
 sw/source/core/text/wrong.cxx                           |   15 -
 sw/source/core/text/xmldump.cxx                         |    2 
 sw/source/core/tox/ToxTextGenerator.cxx                 |    2 
 sw/source/core/txtnode/modeltoviewhelper.cxx            |    2 
 sw/source/core/txtnode/ndhints.cxx                      |   16 -
 sw/source/core/txtnode/ndtxt.cxx                        |   79 +++----
 sw/source/core/txtnode/thints.cxx                       |   76 +++---
 sw/source/core/txtnode/txatritr.cxx                     |   11 
 sw/source/core/txtnode/txtedt.cxx                       |   38 +--
 sw/source/core/undo/rolbck.cxx                          |    2 
 sw/source/core/unocore/unocrsrhelper.cxx                |    2 
 sw/source/core/unocore/unoportenum.cxx                  |    8 
 sw/source/filter/ascii/ascatr.cxx                       |    5 
 sw/source/filter/html/htmlatr.cxx                       |    4 
 sw/source/filter/html/swhtml.cxx                        |    8 
 sw/source/filter/html/wrthtml.cxx                       |    5 
 sw/source/filter/ww8/wrtw8nds.cxx                       |   16 -
 sw/source/filter/ww8/ww8par.cxx                         |    2 
 sw/source/ui/misc/glosbib.cxx                           |    4 
 sw/source/ui/misc/glossary.cxx                          |    4 
 sw/source/uibase/dochdl/gloshdl.cxx                     |    4 
 sw/source/uibase/inc/conttree.hxx                       |    2 
 sw/source/uibase/inc/glosdoc.hxx                        |    4 
 sw/source/uibase/inc/gloshdl.hxx                        |    4 
 sw/source/uibase/misc/glosdoc.cxx                       |   19 -
 sw/source/uibase/uiview/viewtab.cxx                     |  177 +++++++---------
 sw/source/uibase/uno/unoatxt.cxx                        |   18 -
 sw/source/uibase/uno/unotxdoc.cxx                       |   39 +--
 sw/source/uibase/uno/unotxvw.cxx                        |    6 
 sw/source/uibase/utlui/attrdesc.cxx                     |   12 -
 sw/source/uibase/utlui/content.cxx                      |   92 +++-----
 sw/source/uibase/utlui/glbltree.cxx                     |    8 
 sw/source/uibase/utlui/gloslst.cxx                      |   41 +--
 sw/source/uibase/utlui/navipi.cxx                       |   26 --
 116 files changed, 997 insertions(+), 1026 deletions(-)

New commits:
commit 5f0967a6345f602f787901eeff25fd61b57b780e
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Tue Jul 22 17:51:51 2014 +0200

    Do not include txttypes.hxx unnecessarily
    
    Change-Id: I557019995975b24062fd346a7cc0cae872cab308

diff --git a/sw/source/core/inc/SwPortionHandler.hxx b/sw/source/core/inc/SwPortionHandler.hxx
index a4d56c1..63a6685 100644
--- a/sw/source/core/inc/SwPortionHandler.hxx
+++ b/sw/source/core/inc/SwPortionHandler.hxx
@@ -20,8 +20,7 @@
 #ifndef INCLUDED_SW_SOURCE_CORE_INC_SWPORTIONHANDLER_HXX
 #define INCLUDED_SW_SOURCE_CORE_INC_SWPORTIONHANDLER_HXX
 
-#include <tools/solar.h>
-#include <txttypes.hxx>
+#include <swtypes.hxx>
 
 /** The SwPortionHandler interface implements a visitor for the layout
  * engine's text portions. This can be used to gather information of
diff --git a/sw/source/core/inc/txtfly.hxx b/sw/source/core/inc/txtfly.hxx
index 9352755..a7500df 100644
--- a/sw/source/core/inc/txtfly.hxx
+++ b/sw/source/core/inc/txtfly.hxx
@@ -22,7 +22,6 @@
 #include "swtypes.hxx"
 #include "swrect.hxx"
 #include <fmtsrndenum.hxx>
-#include <txttypes.hxx>
 #include <vector>
 
 class OutputDevice;
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index c02754c..53c13fd 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -25,7 +25,7 @@
 #include "rootfrm.hxx"
 #include "pagefrm.hxx"
 #include "colfrm.hxx"
-#include "txttypes.hxx"
+#include "swtypes.hxx"
 #include <sfx2/printer.hxx>
 #include <editeng/lrspitem.hxx>
 #include <editeng/tstpitem.hxx>
diff --git a/sw/source/core/text/guess.hxx b/sw/source/core/text/guess.hxx
index 6cba5a4..4d33c6b 100644
--- a/sw/source/core/text/guess.hxx
+++ b/sw/source/core/text/guess.hxx
@@ -20,7 +20,7 @@
 #define INCLUDED_SW_SOURCE_CORE_TEXT_GUESS_HXX
 #include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
 
-#include "txttypes.hxx"
+#include "swtypes.hxx"
 #include "breakit.hxx"
 #include "porrst.hxx"
 
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index d0b4c06..e039a76 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -24,7 +24,6 @@
 #include <map>
 
 #include "swtypes.hxx"
-#include "txttypes.hxx"
 #include "swrect.hxx"
 #include "txtfly.hxx"
 #include "swfont.hxx"
diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx
index 4d0c06a..edd51dc 100644
--- a/sw/source/core/text/itratr.hxx
+++ b/sw/source/core/text/itratr.hxx
@@ -20,7 +20,7 @@
 #define INCLUDED_SW_SOURCE_CORE_TEXT_ITRATR_HXX
 #include <atrhndl.hxx>
 
-#include "txttypes.hxx"
+#include "swtypes.hxx"
 #include "swfont.hxx"
 #include "porlay.hxx"
 
diff --git a/sw/source/core/text/noteurl.cxx b/sw/source/core/text/noteurl.cxx
index 3d9c065..36fb723 100644
--- a/sw/source/core/text/noteurl.cxx
+++ b/sw/source/core/text/noteurl.cxx
@@ -22,7 +22,6 @@
 #include <svtools/imaprect.hxx>
 #include <svtools/imap.hxx>
 
-#include "txttypes.hxx"
 #include "noteurl.hxx"
 
 // Global variable
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index cb86657..567b408 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SW_SOURCE_CORE_TEXT_PORLIN_HXX
 
 #include "possiz.hxx"
+#include <txttypes.hxx>
 
 #ifdef DBG_UTIL
 #include <libxml/xmlwriter.h>
diff --git a/sw/source/core/text/possiz.hxx b/sw/source/core/text/possiz.hxx
index 20b7bc2..f7a5e45 100644
--- a/sw/source/core/text/possiz.hxx
+++ b/sw/source/core/text/possiz.hxx
@@ -20,7 +20,7 @@
 #define INCLUDED_SW_SOURCE_CORE_TEXT_POSSIZ_HXX
 
 #include <tools/gen.hxx>
-#include "txttypes.hxx"
+#include <sal/types.h>
 
 // Compared to the SV sizes SwPosSize is always positive
 class SwPosSize
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index bc8ce1d..c82d05f 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -18,7 +18,6 @@
  */
 
 #include "swtypes.hxx"
-#include "txttypes.hxx"
 
 #include "SwGrammarMarkUp.hxx"
 
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 71def8c..260c697 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -49,7 +49,6 @@
 #include <SwGrammarMarkUp.hxx>
 #include <rootfrm.hxx>
 
-#include <txttypes.hxx>
 #include <breakit.hxx>
 #include <crstate.hxx>
 #include <UndoOverwrite.hxx>
commit 2a6b9c93af295a6746372bc6ce462a02492f616d
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Tue Jul 22 17:14:17 2014 +0200

    Massive KSHORT/MSHORT to sal_uInt16
    
    Change-Id: I82a899ef0cad19d62c41753ffdce07d8e33d6c9d

diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index 0f402a2..1928903 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -228,7 +228,7 @@ void SwAccessiblePortionData::Special(
         bLastIsSpecial = true;
 }
 
-void SwAccessiblePortionData::LineBreak(KSHORT /*nWidth*/)
+void SwAccessiblePortionData::LineBreak(sal_uInt16 /*nWidth*/)
 {
     OSL_ENSURE( !bFinished, "We are already done!" );
 
diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx
index 0ceab1a..ff7b8ca 100644
--- a/sw/source/core/access/accportions.hxx
+++ b/sw/source/core/access/accportions.hxx
@@ -99,7 +99,7 @@ public:
     // SwPortionHandler methods
     virtual void Text(sal_uInt16 nLength, sal_uInt16 nType, sal_Int32 nHeight = 0, sal_Int32 nWidth = 0) SAL_OVERRIDE;
     virtual void Special(sal_uInt16 nLength, const OUString& rText, sal_uInt16 nType, sal_Int32 nHeight = 0, sal_Int32 nWidth = 0) SAL_OVERRIDE;
-    virtual void LineBreak(KSHORT nWidth) SAL_OVERRIDE;
+    virtual void LineBreak(sal_uInt16 nWidth) SAL_OVERRIDE;
     virtual void Skip(sal_uInt16 nLength) SAL_OVERRIDE;
     virtual void Finish() SAL_OVERRIDE;
 
diff --git a/sw/source/core/inc/SwPortionHandler.hxx b/sw/source/core/inc/SwPortionHandler.hxx
index c30498c..a4d56c1 100644
--- a/sw/source/core/inc/SwPortionHandler.hxx
+++ b/sw/source/core/inc/SwPortionHandler.hxx
@@ -75,7 +75,7 @@ public:
     /** line break. This method is called whenever a line break in the
      * layout occurs.
      */
-    virtual void LineBreak(KSHORT nWidth) = 0;
+    virtual void LineBreak(sal_uInt16 nWidth) = 0;
 
     /** skip characters. The SwTxtFrame may only display partially
      * display a certain paragraph (e.g. when the paragaph is split
diff --git a/sw/source/core/inc/txtfly.hxx b/sw/source/core/inc/txtfly.hxx
index 4ff7c57..9352755 100644
--- a/sw/source/core/inc/txtfly.hxx
+++ b/sw/source/core/inc/txtfly.hxx
@@ -59,7 +59,7 @@ class SwContourCache
     const SdrObject *pSdrObj[ POLY_CNT ];
     TextRanger *pTextRanger[ POLY_CNT ];
     long nPntCnt;
-    MSHORT nObjCnt;
+    sal_uInt16 nObjCnt;
     const SwRect ContourRect( const SwFmt* pFmt, const SdrObject* pObj,
         const SwTxtFrm* pFrm, const SwRect &rLine, const long nXPos,
         const bool bRight );
@@ -67,9 +67,9 @@ class SwContourCache
 public:
     SwContourCache();
     ~SwContourCache();
-    const SdrObject* GetObject( MSHORT nPos ) const{ return pSdrObj[ nPos ]; }
-    MSHORT GetCount() const { return nObjCnt; }
-    void ClrObject( MSHORT nPos );
+    const SdrObject* GetObject( sal_uInt16 nPos ) const{ return pSdrObj[ nPos ]; }
+    sal_uInt16 GetCount() const { return nObjCnt; }
+    void ClrObject( sal_uInt16 nPos );
 
     /**
       Computes the rectangle that will cover the object in the given line.
diff --git a/sw/source/core/inc/txttypes.hxx b/sw/source/core/inc/txttypes.hxx
index c835b6b..1dd5bff 100644
--- a/sw/source/core/inc/txttypes.hxx
+++ b/sw/source/core/inc/txttypes.hxx
@@ -21,14 +21,6 @@
 
 #include "swtypes.hxx"
 
-// Ueberpruefte USHORTs, z.B. Indizes auf Arrays oder garantiert kleine
-// Integerwerte, auch von aussen vorgegebene
-#define MSHORT sal_uInt16
-#define MSHRT_MAX USHRT_MAX
-// Koordinaten: Breite, Hoehe und Offsets in X-/Y-Richtung sowie Ascent etc.
-#define KSHORT sal_uInt16
-#define KSHRT_MAX USHRT_MAX
-
 // Portiontypen
 #define POR_LIN         0x0000
 #define POR_FLYCNT      0x0001
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 0aecaab..c02754c 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -527,8 +527,8 @@ struct SwFillData
     long Right() const { return aFrm.Right(); }
     long Bottom() const { return aFrm.Bottom(); }
     SwFillCrsrPos &Fill() const { return *pCMS->pFill; }
-    void SetTab( MSHORT nNew ) { pCMS->pFill->nTabCnt = nNew; }
-    void SetSpace( MSHORT nNew ) { pCMS->pFill->nSpaceCnt = nNew; }
+    void SetTab( sal_uInt16 nNew ) { pCMS->pFill->nTabCnt = nNew; }
+    void SetSpace( sal_uInt16 nNew ) { pCMS->pFill->nSpaceCnt = nNew; }
     void SetOrient( const sal_Int16 eNew ){ pCMS->pFill->eOrient = eNew; }
 };
 
@@ -651,7 +651,7 @@ bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
 bool SwTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& rPoint,
                                SwCrsrMoveState* pCMS, bool ) const
 {
-    MSHORT nChgFrm = 2;
+    sal_uInt16 nChgFrm = 2;
     if( pCMS )
     {
         if( MV_UPDOWN == pCMS->eState )
@@ -1302,7 +1302,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
             (SwColumnFrm*)GetUpper()->GetUpper()->GetUpper()->Lower(); // The 1st column
         // The first SwFrm in BodyFrm of the first column
         const SwFrm* pFrm = ((SwLayoutFrm*)pTmp->Lower())->Lower();
-        MSHORT nNextCol = 0;
+        sal_uInt16 nNextCol = 0;
         // In which column do we end up in?
         while( rFill.X() > pTmp->Frm().Right() && pTmp->GetNext() )
         {
@@ -1356,7 +1356,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
     }
     SwFont *pFnt;
     SwTxtFmtColl* pColl = GetTxtNode()->GetTxtColl();
-    MSHORT nFirst = GetTxtNode()->GetSwAttrSet().GetULSpace().GetLower();
+    sal_uInt16 nFirst = GetTxtNode()->GetSwAttrSet().GetULSpace().GetLower();
     SwTwips nDiff = rFill.Y() - Frm().Bottom();
     if( nDiff < nFirst )
         nDiff = -1;
@@ -1494,7 +1494,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
                         {
                             nIndent /= nSpace;
                             nIndent *= nSpace;
-                            rFill.SetTab( MSHORT( nIndent ) );
+                            rFill.SetTab( sal_uInt16( nIndent ) );
                             rRect.Left( nIndent + rFill.Left() );
                         }
                         else
@@ -1508,9 +1508,9 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
                     rFill.nLineWidth += rFill.bFirstLine ? nLeft : nTxtLeft;
                     SwTwips nLeftTab = nLeft;
                     SwTwips nRightTab = nLeft;
-                    MSHORT nSpaceCnt = 0;
-                    MSHORT nTabCnt = 0;
-                    MSHORT nIdx = 0;
+                    sal_uInt16 nSpaceCnt = 0;
+                    sal_uInt16 nTabCnt = 0;
+                    sal_uInt16 nIdx = 0;
                     do
                     {
                         nLeftTab = nRightTab;
@@ -1530,7 +1530,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
                             const SvxTabStopItem& rTab =
                                 (const SvxTabStopItem &)pSet->
                                 GetPool()->GetDefaultItem( RES_PARATR_TABSTOP );
-                            MSHORT nDefTabDist = (MSHORT)rTab[0].GetTabPos();
+                            sal_uInt16 nDefTabDist = (sal_uInt16)rTab[0].GetTabPos();
                             nRightTab = nLeftTab - nTxtLeft;
                             nRightTab /= nDefTabDist;
                             nRightTab = nRightTab * nDefTabDist + nTxtLeft;
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 9796be7..8df90fe 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -55,14 +55,14 @@
 
 class FormatLevel
 {
-    static MSHORT nLevel;
+    static sal_uInt16 nLevel;
 public:
     inline FormatLevel()  { ++nLevel; }
     inline ~FormatLevel() { --nLevel; }
-    inline MSHORT GetLevel() const { return nLevel; }
+    inline sal_uInt16 GetLevel() const { return nLevel; }
     static bool LastLevel() { return 10 < nLevel; }
 };
-MSHORT FormatLevel::nLevel = 0;
+sal_uInt16 FormatLevel::nLevel = 0;
 
 void ValidateTxt( SwFrm *pFrm )     // Friend of frame
 {
@@ -1114,8 +1114,8 @@ bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const bool bPrev )
     SwParaPortion *pPara = rLine.GetInfo().GetParaPortion();
     const SwLineLayout *pOldCur = rLine.GetCurr();
     const sal_Int32 nOldLen    = pOldCur->GetLen();
-    const KSHORT nOldAscent = pOldCur->GetAscent();
-    const KSHORT nOldHeight = pOldCur->Height();
+    const sal_uInt16 nOldAscent = pOldCur->GetAscent();
+    const sal_uInt16 nOldHeight = pOldCur->Height();
     const SwTwips nOldWidth = pOldCur->Width() + pOldCur->GetHangingMargin();
     const bool bOldHyph = pOldCur->IsEndHyph();
     SwTwips nOldTop = 0;
@@ -1575,7 +1575,7 @@ void SwTxtFrm::FormatOnceMore( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
         return;
 
     // If necessary the pPara
-    KSHORT nOld  = ((const SwTxtMargin&)rLine).GetDropHeight();
+    sal_uInt16 nOld  = ((const SwTxtMargin&)rLine).GetDropHeight();
     bool bShrink = false;
     bool bGrow   = false;
     bool bGoOn   = rLine.IsOnceMore();
@@ -1594,7 +1594,7 @@ void SwTxtFrm::FormatOnceMore( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
         bGoOn = rLine.IsOnceMore();
         if( bGoOn )
         {
-            const KSHORT nNew = ((const SwTxtMargin&)rLine).GetDropHeight();
+            const sal_uInt16 nNew = ((const SwTxtMargin&)rLine).GetDropHeight();
             if( nOld == nNew )
                 bGoOn = false;
             else
@@ -1869,7 +1869,7 @@ bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
     const SwTwips nDbgY = Frm().Top();
     (void)nDbgY;
     // nStopAt allows CV to alter it
-    static MSHORT nStopAt = 0;
+    static sal_uInt16 nStopAt = 0;
     if( nStopAt == GetFrmId() )
     {
         int i = GetFrmId();
diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx
index fe7aea5..e679cbd 100644
--- a/sw/source/core/text/frminf.cxx
+++ b/sw/source/core/text/frminf.cxx
@@ -79,7 +79,7 @@ bool SwTxtFrmInfo::IsFilled( const sal_uInt8 nPercent ) const
     long nWidth = pFrm->Prt().Width();
     nWidth *= nPercent;
     nWidth /= 100;
-    return KSHORT(nWidth) <= pLay->Width();
+    return sal_uInt16(nWidth) <= pLay->Width();
 }
 
 // Where does the text start (without whitespace)? (document global)
@@ -193,7 +193,7 @@ void SwTxtFrmInfo::GetSpaces( SwPaM &rPam, bool bWithLineBreak ) const
 
                 if( nPos < aLine.GetEnd() )
                 {
-                    MSHORT nOff = !bWithLineBreak && CH_BREAK ==
+                    sal_uInt16 nOff = !bWithLineBreak && CH_BREAK ==
                                 aLine.GetInfo().GetChar( aLine.GetEnd() - 1 )
                                 ? 1 : 0;
                     pPam = AddPam( pPam, pFrm, nPos, aLine.GetEnd() - nPos - nOff );
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index cccdaf8..06f08b5 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -69,7 +69,7 @@ class SwExtraPainter
     SwTwips nX;
     SwTwips nRedX;
     sal_uLong nLineNr;
-    MSHORT nDivider;
+    sal_uInt16 nDivider;
     bool bGoLeft;
     bool bLineNum;
     inline bool IsClipChg() { return aClip.IsChg(); }
@@ -110,7 +110,7 @@ SwExtraPainter::SwExtraPainter( const SwTxtFrm *pFrm, SwViewShell *pVwSh,
         if( aRect.Bottom() > nBottom )
             aRect.Bottom( nBottom );
     }
-    MSHORT nVirtPageNum = 0;
+    sal_uInt16 nVirtPageNum = 0;
     if( bLineNum )
     {
         /* Initializes the Members necessary for line numbering:
@@ -371,7 +371,7 @@ void SwTxtFrm::PaintExtraData( const SwRect &rRect ) const
                             if( bLineNum &&
                                 ( aExtra.HasNumber() || aExtra.HasDivider() ) )
                             {
-                                KSHORT nTmpHeight, nTmpAscent;
+                                sal_uInt16 nTmpHeight, nTmpAscent;
                                 aLine.CalcAscentAndHeight( nTmpAscent, nTmpHeight );
                                 aExtra.PaintExtra( aLine.Y(), nTmpAscent,
                                     nTmpHeight, bRed );
@@ -387,7 +387,7 @@ void SwTxtFrm::PaintExtraData( const SwRect &rRect ) const
         }
         else
         {
-            if ( MSHRT_MAX == pIDRA->GetRedlinePos(rTxtNode, USHRT_MAX) )
+            if ( USHRT_MAX == pIDRA->GetRedlinePos(rTxtNode, USHRT_MAX) )
                 bRedLine = false;
 
             if( bLineNum && rLineInf.IsCountBlankLines() &&
@@ -485,8 +485,8 @@ bool SwTxtFrm::PaintEmpty( const SwRect &rRect, bool bCheck ) const
             const IDocumentRedlineAccess* pIDRA = rTxtNode.getIDocumentRedlineAccess();
             if( IDocumentRedlineAccess::IsShowChanges( pIDRA->GetRedlineMode() ) )
             {
-                MSHORT nRedlPos = pIDRA->GetRedlinePos( rTxtNode, USHRT_MAX );
-                if( MSHRT_MAX != nRedlPos )
+                sal_uInt16 nRedlPos = pIDRA->GetRedlinePos( rTxtNode, USHRT_MAX );
+                if( USHRT_MAX != nRedlPos )
                 {
                     SwAttrHandler aAttrHandler;
                     aAttrHandler.Init(  rTxtNode.GetSwAttrSet(),
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 459ba53..44deb6a 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -46,7 +46,7 @@ using namespace ::com::sun::star::linguistic2;
 // returns true if no line break has to be performed
 // otherwise possible break or hyphenation position is determined
 bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
-                            const KSHORT nPorHeight )
+                            const sal_uInt16 nPorHeight )
 {
     nCutPos = rInf.GetIdx();
 
@@ -81,7 +81,7 @@ bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
     if( !nMaxLen )
         return false;
 
-    KSHORT nItalic = 0;
+    sal_uInt16 nItalic = 0;
     if( ITALIC_NONE != rInf.GetFont()->GetItalic() && !rInf.NotEOL() )
     {
         bool bAddItalic = true;
diff --git a/sw/source/core/text/guess.hxx b/sw/source/core/text/guess.hxx
index 3b489d9..6cba5a4 100644
--- a/sw/source/core/text/guess.hxx
+++ b/sw/source/core/text/guess.hxx
@@ -35,7 +35,7 @@ class SwTxtGuess
     sal_Int32 nBreakPos;       // start index of break position
     sal_Int32 nFieldDiff;      // absolut positions can be wrong if we
                                 // a field in the text has been expanded
-    KSHORT nBreakWidth;         // width of the broken portion
+    sal_uInt16 nBreakWidth;         // width of the broken portion
 public:
     inline SwTxtGuess(): pHanging( NULL ), nCutPos(0), nBreakStart(0),
                         nBreakPos(0), nFieldDiff(0), nBreakWidth(0)
@@ -44,12 +44,12 @@ public:
 
     // true, if current portion still fits to current line
     bool Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
-                    const KSHORT nHeight );
+                    const sal_uInt16 nHeight );
     bool AlternativeSpelling( const SwTxtFormatInfo &rInf, const sal_Int32 nPos );
 
     inline SwHangingPortion* GetHangingPortion() const { return pHanging; }
     inline void ClearHangingPortion() { pHanging = NULL; }
-    inline KSHORT BreakWidth() const { return nBreakWidth; }
+    inline sal_uInt16 BreakWidth() const { return nBreakWidth; }
     inline sal_Int32 CutPos() const { return nCutPos; }
     inline sal_Int32 BreakStart() const { return nBreakStart; }
     inline sal_Int32 BreakPos() const {return nBreakPos; }
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index a1edc44e..2a89571 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -149,7 +149,7 @@ void SwLineInfo::CtorInitLineInfo( const SwAttrSet& rAttrSet,
 
     pSpace = &rAttrSet.GetLineSpacing();
     nVertAlign = rAttrSet.GetParaVertAlign().GetValue();
-    nDefTabStop = MSHRT_MAX;
+    nDefTabStop = USHRT_MAX;
 }
 
 void SwTxtInfo::CtorInitTxtInfo( SwTxtFrm *pFrm )
@@ -919,7 +919,7 @@ void SwTxtPaintInfo::DrawSpecial(const SwLinePortion &rPor, sal_Unicode cChar, c
 {
     if( OnWin() )
     {
-        KSHORT nOldWidth = rPor.Width();
+        sal_uInt16 nOldWidth = rPor.Width();
         OUString sChar( cChar );
         SwPosSize aSize( GetTxtSize( sChar ) );
 
@@ -959,7 +959,7 @@ void SwTxtPaintInfo::DrawLineBreak( const SwLinePortion &rPor ) const
 {
     if( OnWin() )
     {
-        KSHORT nOldWidth = rPor.Width();
+        sal_uInt16 nOldWidth = rPor.Width();
         ((SwLinePortion&)rPor).Width( LINE_BREAK_WIDTH );
 
         SwRect aRect;
@@ -1207,7 +1207,7 @@ void SwTxtPaintInfo::DrawBorder( const SwLinePortion &rPor ) const
 }
 
 void SwTxtPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
-                                  const MSHORT nWhich ) const
+                                  const sal_uInt16 nWhich ) const
 {
     if( OnWin() && !IsMulti() )
     {
@@ -1455,7 +1455,7 @@ SwTxtFormatInfo::SwTxtFormatInfo( const SwTxtFormatInfo& rInf,
     nLeft = rInf.nLeft;
     nRight = rInf.nRight;
     nFirst = rInf.nLeft;
-    nRealWidth = KSHORT(nActWidth);
+    nRealWidth = sal_uInt16(nActWidth);
     nWidth = nRealWidth;
     nLineHeight = 0;
     nLineNettoHeight = 0;
@@ -1492,7 +1492,7 @@ SwTxtFormatInfo::SwTxtFormatInfo( const SwTxtFormatInfo& rInf,
 
 bool SwTxtFormatInfo::_CheckFtnPortion( SwLineLayout* pCurr )
 {
-    const KSHORT nHeight = pCurr->GetRealHeight();
+    const sal_uInt16 nHeight = pCurr->GetRealHeight();
     for( SwLinePortion *pPor = pCurr->GetPortion(); pPor; pPor = pPor->GetPortion() )
     {
         if( pPor->IsFtnPortion() && nHeight > ((SwFtnPortion*)pPor)->Orig() )
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 5364cd7..d0b4c06 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -78,7 +78,7 @@ class SwLineInfo
     SvxTabStopItem* pRuler;
     const SvxLineSpacingItem *pSpace;
     sal_uInt16 nVertAlign;
-    KSHORT nDefTabStop;
+    sal_uInt16 nDefTabStop;
     bool bListTabStopIncluded;
     long nListTabStopPosition;
 
@@ -92,8 +92,8 @@ public:
     const SvxTabStop *GetTabStop( const SwTwips nSearchPos,
                                  const SwTwips nRight ) const;
     inline const SvxLineSpacingItem *GetLineSpacing() const { return pSpace; }
-    inline KSHORT GetDefTabStop() const { return nDefTabStop; }
-    inline void SetDefTabStop( KSHORT nNew ) const
+    inline sal_uInt16 GetDefTabStop() const { return nDefTabStop; }
+    inline void SetDefTabStop( sal_uInt16 nNew ) const
         { ( (SwLineInfo*)this )->nDefTabStop = nNew; }
 
     // vertical alignment
@@ -288,7 +288,7 @@ public:
     inline sal_Unicode GetChar( const sal_Int32 nPos ) const
     { if (m_pTxt && nPos < m_pTxt->getLength()) return (*m_pTxt)[ nPos ]; return 0; }
 
-    KSHORT      GetTxtHeight() const;
+    sal_uInt16      GetTxtHeight() const;
 
     SwPosSize GetTxtSize( OutputDevice* pOut, const SwScriptInfo* pSI,
                           const OUString& rTxt, const sal_Int32 nIdx,
@@ -309,7 +309,7 @@ public:
                                            const sal_uInt16 nComp,
                                            sal_Int32& rExtraCharPos ) const;
 
-    KSHORT GetAscent() const;
+    sal_uInt16 GetAscent() const;
 
     inline sal_Int32 GetIdx() const { return m_nIdx; }
     inline void SetIdx( const sal_Int32 nNew ) { m_nIdx = nNew; }
@@ -362,9 +362,9 @@ public:
 
     // Feature: Kana Compression
 
-    inline MSHORT GetKanaIdx() const { return m_nKanaIdx; }
+    inline sal_uInt16 GetKanaIdx() const { return m_nKanaIdx; }
     inline void ResetKanaIdx(){ m_nKanaIdx = 0; }
-    inline void SetKanaIdx( MSHORT nNew ) { m_nKanaIdx = nNew; }
+    inline void SetKanaIdx( sal_uInt16 nNew ) { m_nKanaIdx = nNew; }
     inline void IncKanaIdx() { ++m_nKanaIdx; }
     inline void SetKanaComp( std::deque<sal_uInt16> *pNew ){ m_pKanaComp = pNew; }
     inline std::deque<sal_uInt16>* GetpKanaComp() const { return m_pKanaComp; }
@@ -389,7 +389,7 @@ class SwTxtPaintInfo : public SwTxtSizeInfo
     Point       aPos;       // Paint position
     SwRect      aPaintRect; // Original paint rect (from Layout paint)
 
-    MSHORT nSpaceIdx;
+    sal_uInt16 nSpaceIdx;
     void _DrawText( const OUString &rText, const SwLinePortion &rPor,
                    const sal_Int32 nIdx, const sal_Int32 nLen,
                    const bool bKern, const bool bWrong = false,
@@ -455,7 +455,7 @@ public:
     void DrawRedArrow( const SwLinePortion &rPor ) const;
     void DrawPostIts( const SwLinePortion &rPor, bool bScript ) const;
     void DrawBackground( const SwLinePortion &rPor ) const;
-    void DrawViewOpt( const SwLinePortion &rPor, const MSHORT nWhich ) const;
+    void DrawViewOpt( const SwLinePortion &rPor, const sal_uInt16 nWhich ) const;
     void DrawBackBrush( const SwLinePortion &rPor ) const;
 
     /**
@@ -493,9 +493,9 @@ public:
 
     // STUFF FOR JUSTIFIED ALIGNMENT
 
-    inline MSHORT GetSpaceIdx() const { return nSpaceIdx; }
+    inline sal_uInt16 GetSpaceIdx() const { return nSpaceIdx; }
     inline void ResetSpaceIdx(){nSpaceIdx = 0; }
-    inline void SetSpaceIdx( MSHORT nNew ) { nSpaceIdx = nNew; }
+    inline void SetSpaceIdx( sal_uInt16 nNew ) { nSpaceIdx = nNew; }
     inline void IncSpaceIdx() { ++nSpaceIdx; }
     inline void RemoveFirstSpaceAdd() { pSpaceAdd->erase( pSpaceAdd->begin() ); }
     inline long GetSpaceAdd() const
@@ -536,11 +536,11 @@ class SwTxtFormatInfo : public SwTxtPaintInfo
     SwTwips nLeft;              // Left margin
     SwTwips nRight;             // Right margin
     SwTwips nFirst;             // EZE
-    KSHORT nRealWidth;          // "real" line width
-    KSHORT nWidth;              // "virtual" line width
-    KSHORT nLineHeight;         // Final height after CalcLine
-    KSHORT nLineNettoHeight;    // line height without spacing
-    KSHORT nForcedLeftMargin;   // Shift of left margin due to frame
+    sal_uInt16 nRealWidth;          // "real" line width
+    sal_uInt16 nWidth;              // "virtual" line width
+    sal_uInt16 nLineHeight;         // Final height after CalcLine
+    sal_uInt16 nLineNettoHeight;    // line height without spacing
+    sal_uInt16 nForcedLeftMargin;   // Shift of left margin due to frame
 
     sal_Int16  nMinLeading;     // minimum number of chars before hyphenation point
     sal_Int16  nMinTrailing;    // minimum number of chars after hyphenation point
@@ -588,8 +588,8 @@ public:
     SwTxtFormatInfo( const SwTxtFormatInfo& rInf, SwLineLayout& rLay,
         SwTwips nActWidth );
 
-    inline KSHORT Width() const { return nWidth; }
-    inline void Width( const KSHORT nNew ) { nWidth = nNew; }
+    inline sal_uInt16 Width() const { return nWidth; }
+    inline void Width( const sal_uInt16 nNew ) { nWidth = nNew; }
            void Init();
 
     // Returns the first changed position of the paragraph
@@ -602,10 +602,10 @@ public:
     inline void Right( const SwTwips nNew ) { nRight = nNew; }
     inline SwTwips First() const { return nFirst; }
     inline void First( const SwTwips nNew ) { nFirst = nNew; }
-    inline KSHORT RealWidth() const { return nRealWidth; }
-    inline void RealWidth( const KSHORT nNew ) { nRealWidth = nNew; }
-    inline KSHORT ForcedLeftMargin() const { return nForcedLeftMargin; }
-    inline void ForcedLeftMargin( const KSHORT nN ) { nForcedLeftMargin = nN; }
+    inline sal_uInt16 RealWidth() const { return nRealWidth; }
+    inline void RealWidth( const sal_uInt16 nNew ) { nRealWidth = nNew; }
+    inline sal_uInt16 ForcedLeftMargin() const { return nForcedLeftMargin; }
+    inline void ForcedLeftMargin( const sal_uInt16 nN ) { nForcedLeftMargin = nN; }
 
     inline sal_uInt8 &MaxHyph() { return nMaxHyph; }
     inline const sal_uInt8 &MaxHyph() const { return nMaxHyph; }
@@ -650,10 +650,10 @@ public:
     inline void SetLineStart( const sal_Int32 nNew ) { nLineStart = nNew; }
 
     // these are used during fly calculation
-    inline KSHORT GetLineHeight() const { return nLineHeight; }
-    inline void SetLineHeight( const KSHORT nNew ) { nLineHeight = nNew; }
-    inline KSHORT GetLineNettoHeight() const { return nLineNettoHeight; }
-    inline void SetLineNettoHeight( const KSHORT nNew ) { nLineNettoHeight = nNew; }
+    inline sal_uInt16 GetLineHeight() const { return nLineHeight; }
+    inline void SetLineHeight( const sal_uInt16 nNew ) { nLineHeight = nNew; }
+    inline sal_uInt16 GetLineNettoHeight() const { return nLineNettoHeight; }
+    inline void SetLineNettoHeight( const sal_uInt16 nNew ) { nLineNettoHeight = nNew; }
 
     inline const SwLinePortion *GetUnderflow() const { return pUnderflow; }
     inline SwLinePortion *GetUnderflow() { return pUnderflow; }
@@ -766,14 +766,14 @@ public:
    ~SwFontSave();
 };
 
-inline KSHORT SwTxtSizeInfo::GetAscent() const
+inline sal_uInt16 SwTxtSizeInfo::GetAscent() const
 {
     SAL_WARN_IF( !GetOut(), "sw.core", "SwTxtSizeInfo::GetAscent() without m_pOut" );
 
     return ((SwFont*)GetFont())->GetAscent( m_pVsh, *GetOut() );
 }
 
-inline KSHORT SwTxtSizeInfo::GetTxtHeight() const
+inline sal_uInt16 SwTxtSizeInfo::GetTxtHeight() const
 {
     SAL_WARN_IF( !GetOut(), "sw.core", "SwTxtSizeInfo::GetTxtHeight() without m_pOut" );
 
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index b2ad8a2..82fb1a7 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -258,7 +258,7 @@ void SwTxtAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
     pCurrent->InitSpaceAdd();
     sal_Int32 nGluePortion = 0;
     sal_Int32 nCharCnt = 0;
-    MSHORT nSpaceIdx = 0;
+    sal_uInt16 nSpaceIdx = 0;
 
     // i60591: hennerdrews
     SwScriptInfo& rSI = GetInfo().GetParaPortion()->GetScriptInfo();
@@ -404,7 +404,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
     pCurrent->SetKanaComp( pNewKana );
 
     const sal_uInt16 nNull = 0;
-    MSHORT nKanaIdx = 0;
+    sal_uInt16 nKanaIdx = 0;
     long nKanaDiffSum = 0;
     SwTwips nRepaintOfst = 0;
     SwTwips nX = 0;
@@ -544,7 +544,7 @@ SwMarginPortion *SwTxtAdjuster::CalcRightMargin( SwLineLayout *pCurrent,
     const sal_uInt16 nRealHeight = GetLineHeight();
     const sal_uInt16 nLineHeight = pCurrent->Height();
 
-    KSHORT nPrtWidth = pCurrent->PrtWidth();
+    sal_uInt16 nPrtWidth = pCurrent->PrtWidth();
     SwLinePortion *pLast = pCurrent->FindLastPortion();
 
     if( GetInfo().IsMulti() )
@@ -575,7 +575,7 @@ SwMarginPortion *SwTxtAdjuster::CalcRightMargin( SwLineLayout *pCurrent,
     pLast->Append( pRight );
 
     if( long( nPrtWidth )< nRealWidth )
-        pRight->PrtWidth( KSHORT( nRealWidth - nPrtWidth ) );
+        pRight->PrtWidth( sal_uInt16( nRealWidth - nPrtWidth ) );
 
     // pCurrent->Width() is set to the real size, because we attach the
     // MarginPortions.
@@ -584,7 +584,7 @@ SwMarginPortion *SwTxtAdjuster::CalcRightMargin( SwLineLayout *pCurrent,
     // implicitly. GetLeftMarginAdjust() and IsJustified() think they have a
     // line filled with chars.
 
-    pCurrent->PrtWidth( KSHORT( nRealWidth ) );
+    pCurrent->PrtWidth( sal_uInt16( nRealWidth ) );
     return pRight;
 }
 
@@ -698,7 +698,7 @@ SwFlyPortion *SwTxtAdjuster::CalcFlyPortion( const long nRealWidth,
 {
     SwTxtFly aTxtFly( GetTxtFrm() );
 
-    const KSHORT nCurrWidth = pCurr->PrtWidth();
+    const sal_uInt16 nCurrWidth = pCurr->PrtWidth();
     SwFlyPortion *pFlyPortion = 0;
 
     SwRect aLineVert( rCurrRect );
@@ -725,12 +725,12 @@ SwFlyPortion *SwTxtAdjuster::CalcFlyPortion( const long nRealWidth,
             aLocal.Left( nCurrWidth );
 
         // If the rect is wider than the line, we adjust it to the right size
-        KSHORT nLocalWidth = KSHORT( aLocal.Left() + aLocal.Width() );
+        sal_uInt16 nLocalWidth = sal_uInt16( aLocal.Left() + aLocal.Width() );
         if( nRealWidth < long( nLocalWidth ) )
             aLocal.Width( nRealWidth - aLocal.Left() );
         GetInfo().GetParaPortion()->SetFly( true );
         pFlyPortion = new SwFlyPortion( aLocal );
-        pFlyPortion->Height( KSHORT( rCurrRect.Height() ) );
+        pFlyPortion->Height( sal_uInt16( rCurrRect.Height() ) );
         // The Width could be smaller than the FixWidth, thus:
         pFlyPortion->AdjFixWidth();
     }
@@ -743,7 +743,7 @@ void SwTxtAdjuster::CalcDropAdjust()
     OSL_ENSURE( 1<GetDropLines() && SVX_ADJUST_LEFT!=GetAdjust() && SVX_ADJUST_BLOCK!=GetAdjust(),
             "CalcDropAdjust: No reason for DropAdjustment." );
 
-    const MSHORT nLineNumber = GetLineNr();
+    const sal_uInt16 nLineNumber = GetLineNr();
 
     // 1) Skip dummies
     Top();
@@ -773,10 +773,10 @@ void SwTxtAdjuster::CalcDropAdjust()
             if( pRight && pRight != pLeft )
             {
                 // 5) Calculate nMinLeft. Who is the most to left?
-                const KSHORT nDropLineStart =
-                    KSHORT(GetLineStart()) + pLeft->Width() + pDropPor->Width();
-                KSHORT nMinLeft = nDropLineStart;
-                for( MSHORT i = 1; i < GetDropLines(); ++i )
+                const sal_uInt16 nDropLineStart =
+                    sal_uInt16(GetLineStart()) + pLeft->Width() + pDropPor->Width();
+                sal_uInt16 nMinLeft = nDropLineStart;
+                for( sal_uInt16 i = 1; i < GetDropLines(); ++i )
                 {
                     if( NextLine() )
                     {
@@ -790,8 +790,8 @@ void SwTxtAdjuster::CalcDropAdjust()
                             nMinLeft = 0;
                         else
                         {
-                            const KSHORT nLineStart =
-                                KSHORT(GetLineStart()) + pMar->Width();
+                            const sal_uInt16 nLineStart =
+                                sal_uInt16(GetLineStart()) + pMar->Width();
                             if( nMinLeft > nLineStart )
                                 nMinLeft = nLineStart;
                         }
@@ -827,7 +827,7 @@ void SwTxtAdjuster::CalcDropRepaint()
     SwRepaint &rRepaint = GetInfo().GetParaPortion()->GetRepaint();
     if( rRepaint.Top() > Y() )
         rRepaint.Top( Y() );
-    for( MSHORT i = 1; i < GetDropLines(); ++i )
+    for( sal_uInt16 i = 1; i < GetDropLines(); ++i )
         NextLine();
     const SwTwips nBottom = Y() + GetLineHeight() - 1;
     if( rRepaint.Bottom() < nBottom )
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index c808f43..c6729f9 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -149,7 +149,7 @@ bool SwAttrIter::SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFo
     {
         pRedln->Clear( pFnt );
         if( !bParaFont )
-            nChgCnt = nChgCnt + pRedln->Seek( *pFnt, 0, MSHRT_MAX );
+            nChgCnt = nChgCnt + pRedln->Seek( *pFnt, 0, USHRT_MAX );
         else
             pRedln->Reset();
     }
@@ -438,7 +438,7 @@ static void lcl_MinMaxNode( SwFrmFmt* pNd, SwMinMaxNodeArgs* pIn )
     {
         long nMin, nMax;
         SwHTMLTableLayout *pLayout = 0;
-        MSHORT nWhich = pNd->Which();
+        sal_uInt16 nWhich = pNd->Which();
         if( RES_DRAWFRMFMT != nWhich )
         {
             // Does the frame contain a table at the start or the end?
@@ -608,7 +608,7 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa
     aIter.SeekAndChgAttrIter( nIdx, pOut );
     sal_Int32 nLen = m_Text.getLength();
     long nAktWidth = 0;
-    MSHORT nAdd = 0;
+    sal_uInt16 nAdd = 0;
     SwMinMaxArgs aArg( pOut, pSh, rMin, rMax, rAbsMin );
     while( nIdx < nLen )
     {
@@ -701,12 +701,12 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa
                             {
                                 // This is a hack for the wollowing situation: In the paragraph there's a
                                 // text frame with relative size. Then let's take 0.5 cm as minimum width
-                                // and KSHRT_MAX as maximum width
+                                // and USHRT_MAX as maximum width
                                 // It were cleaner and maybe necessary later on to iterate over the content
                                 // of the text frame and call GetMinMaxSize recursively
                                 nAktWidth = FLYINCNT_MIN_WIDTH; // 0.5 cm
-                                if( (long)rMax < KSHRT_MAX )
-                                    rMax = KSHRT_MAX;
+                                if( (long)rMax < USHRT_MAX )
+                                    rMax = USHRT_MAX;
                             }
                             else
                                 nAktWidth = pFrmFmt->GetFrmSize().GetWidth();
diff --git a/sw/source/core/text/itratr.hxx b/sw/source/core/text/itratr.hxx
index 8e0323d..4d0c06a 100644
--- a/sw/source/core/text/itratr.hxx
+++ b/sw/source/core/text/itratr.hxx
@@ -48,14 +48,14 @@ protected:
 
 private:
     OutputDevice *pLastOut;
-    MSHORT nChgCnt;
+    sal_uInt16 nChgCnt;
     SwRedlineItr *pRedln;
     size_t nStartIndex;
     size_t nEndIndex;
     sal_Int32 nPos;
     sal_uInt8 nPropFont;
     const void* aMagicNo[ SW_SCRIPTS ];
-    MSHORT aFntIdx[ SW_SCRIPTS ];
+    sal_uInt16 aFntIdx[ SW_SCRIPTS ];
     const SwTxtNode* m_pTxtNode;
 
     void SeekFwd( const sal_Int32 nPos );
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index da2fc68..eddda73 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -256,7 +256,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
                     break;
                     case SVX_LINE_SPACE_MIN:
                     {
-                        if( nFirstLineOfs < KSHORT( pSpace->GetLineHeight() ) )
+                        if( nFirstLineOfs < sal_uInt16( pSpace->GetLineHeight() ) )
                             nFirstLineOfs = pSpace->GetLineHeight();
                         break;
                     }
@@ -281,7 +281,7 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
                         nTmp /= 100;
                         if( !nTmp )
                             ++nTmp;
-                        nFirstLineOfs = (KSHORT)nTmp;
+                        nFirstLineOfs = (sal_uInt16)nTmp;
                         break;
                     }
                     case SVX_INTER_LINE_SPACE_FIX:
@@ -416,14 +416,14 @@ bool SwTxtCursor::GetEndCharRect( SwRect* pOrig, const sal_Int32 nOfst,
     // If necessary, as catch up, do the adjustment
     GetAdjusted();
 
-    KSHORT nX = 0;
-    KSHORT nLast = 0;
+    sal_uInt16 nX = 0;
+    sal_uInt16 nLast = 0;
     SwLinePortion *pPor = pCurr->GetFirstPortion();
 
-    KSHORT nTmpHeight, nTmpAscent;
+    sal_uInt16 nTmpHeight, nTmpAscent;
     CalcAscentAndHeight( nTmpAscent, nTmpHeight );
-    KSHORT nPorHeight = nTmpHeight;
-    KSHORT nPorAscent = nTmpAscent;
+    sal_uInt16 nPorHeight = nTmpHeight;
+    sal_uInt16 nPorAscent = nTmpAscent;
 
     // Search for the last Text/EndPortion of the line
     while( pPor )
@@ -473,7 +473,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const sal_Int32 nOfst,
     SwTxtSizeInfo aInf( GetInfo(), &aText, nStart );
     if( GetPropFont() )
         aInf.GetFont()->SetProportion( GetPropFont() );
-    KSHORT nTmpAscent, nTmpHeight;  // Line height
+    sal_uInt16 nTmpAscent, nTmpHeight;  // Line height
     CalcAscentAndHeight( nTmpAscent, nTmpHeight );
     const Size  aCharSize( 1, nTmpHeight );
     const Point aCharPos;
@@ -499,15 +499,15 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const sal_Int32 nOfst,
     }
     else
     {
-        KSHORT nPorHeight = nTmpHeight;
-        KSHORT nPorAscent = nTmpAscent;
+        sal_uInt16 nPorHeight = nTmpHeight;
+        sal_uInt16 nPorAscent = nTmpAscent;
         SwTwips nX = 0;
         SwTwips nTmpFirst = 0;
         SwLinePortion *pPor = pCurr->GetFirstPortion();
         SwBidiPortion* pLastBidiPor = 0;
         SwTwips nLastBidiPorWidth = 0;
         std::deque<sal_uInt16>* pKanaComp = pCurr->GetpKanaComp();
-        MSHORT nSpaceIdx = 0;
+        sal_uInt16 nSpaceIdx = 0;
         size_t nKanaIdx = 0;
         long nSpaceAdd = pCurr->IsSpaceAdd() ? pCurr->GetLLSpaceAdd( 0 ) : 0;
 
@@ -945,7 +945,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const sal_Int32 nOfst,
                 SwFldPortion *pTmp = (SwFldPortion*)pPor;
                 while( pTmp->HasFollow() && pTmp->GetExp().isEmpty() )
                 {
-                    KSHORT nAddX = pTmp->Width();
+                    sal_uInt16 nAddX = pTmp->Width();
                     SwLinePortion *pNext = pTmp->GetPortion();
                     while( pNext && !pNext->InFldGrp() )
                     {
@@ -1281,7 +1281,7 @@ sal_Int32 SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
     // Until here everything in document coordinates.
     x -= nLeftMargin;
 
-    KSHORT nX = KSHORT( x );
+    sal_uInt16 nX = sal_uInt16( x );
 
     // If there are attribute changes in the line, search for the paragraph,
     // in which nX is situated.
@@ -1292,7 +1292,7 @@ sal_Int32 SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
 
     std::deque<sal_uInt16> *pKanaComp = pCurr->GetpKanaComp();
     sal_Int32 nOldIdx = GetInfo().GetIdx();
-    MSHORT nSpaceIdx = 0;
+    sal_uInt16 nSpaceIdx = 0;
     size_t nKanaIdx = 0;
     long nSpaceAdd = pCurr->IsSpaceAdd() ? pCurr->GetLLSpaceAdd( 0 ) : 0;
     short nKanaComp = pKanaComp ? (*pKanaComp)[0] : 0;
@@ -1300,7 +1300,7 @@ sal_Int32 SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
     // nWidth is the width of the line, or the width of
     // the paragraph with the font change, in which nX is situated.
 
-    KSHORT nWidth = pPor->Width();
+    sal_uInt16 nWidth = pPor->Width();
     if ( pCurr->IsSpaceAdd() || pKanaComp )
     {
         if ( pPor->InSpaceGrp() && nSpaceAdd )
@@ -1330,7 +1330,7 @@ sal_Int32 SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
         }
     }
 
-    KSHORT nWidth30;
+    sal_uInt16 nWidth30;
     if ( pPor->IsPostItsPortion() )
         nWidth30 = 30 + pPor->GetViewWidth( GetInfo() ) / 2;
     else
@@ -1460,7 +1460,7 @@ sal_Int32 SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
                 --nCurrStart;
             else
             {
-                KSHORT nHeight = pPor->Height();
+                sal_uInt16 nHeight = pPor->Height();
                 if ( !nHeight || nHeight > nWidth )
                     nHeight = nWidth;
                 if( nChgNode && nWidth - nHeight/2 > nX )
@@ -1480,7 +1480,7 @@ sal_Int32 SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
                      ( pPor->IsMultiPortion() &&
                        ((SwMultiPortion*)pPor)->IsBidi()  ) )
                 {
-                    KSHORT nHeight = 0;
+                    sal_uInt16 nHeight = 0;
                     if( !bFieldInfo )
                     {
                         nHeight = pPor->Height();
@@ -1567,7 +1567,7 @@ sal_Int32 SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
                     nTmpY = pPor->Height() - nTmpY;
                 if( nTmpY < 0 )
                     nTmpY = 0;
-                nX = (KSHORT)nTmpY;
+                nX = (sal_uInt16)nTmpY;
             }
 
             if( ((SwMultiPortion*)pPor)->HasBrackets() )
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 8e03566..537e163 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -135,7 +135,7 @@ void SwTxtFormatter::Insert( SwLineLayout *pLay )
         pCurr = pLay;
 }
 
-KSHORT SwTxtFormatter::GetFrmRstHeight() const
+sal_uInt16 SwTxtFormatter::GetFrmRstHeight() const
 {
     // We want the rest height relative to the page.
     // If we're in a table, then pFrm->GetUpper() is not the page.
@@ -149,7 +149,7 @@ KSHORT SwTxtFormatter::GetFrmRstHeight() const
     if( 0 > nHeight )
         return pCurr->Height();
     else
-        return KSHORT( nHeight );
+        return sal_uInt16( nHeight );
 }
 
 SwLinePortion *SwTxtFormatter::Underflow( SwTxtFormatInfo &rInf )
@@ -277,7 +277,7 @@ SwLinePortion *SwTxtFormatter::Underflow( SwTxtFormatInfo &rInf )
     {
         if( pPor->InTxtGrp() && !pPor->InExpGrp() )
         {
-            MSHORT nOldWhich = pCurr->GetWhichPor();
+            sal_uInt16 nOldWhich = pCurr->GetWhichPor();
             *(SwLinePortion*)pCurr = *pPor;
             pCurr->SetPortion( pPor->GetPortion() );
             pCurr->SetWhichPor( nOldWhich );
@@ -1493,8 +1493,8 @@ sal_Int32 SwTxtFormatter::FormatLine(const sal_Int32 nStartPos)
 
     // Recycling muss bei geaenderter Zeilenhoehe unterdrueckt werden
     // und auch bei geaendertem Ascent (Absenken der Grundlinie).
-    const KSHORT nOldHeight = pCurr->Height();
-    const KSHORT nOldAscent = pCurr->GetAscent();
+    const sal_uInt16 nOldHeight = pCurr->Height();
+    const sal_uInt16 nOldAscent = pCurr->GetAscent();
 
     pCurr->SetEndHyph( false );
     pCurr->SetMidHyph( false );
@@ -1574,7 +1574,7 @@ sal_Int32 SwTxtFormatter::FormatLine(const sal_Int32 nStartPos)
         if ( IsFlyInCntBase() && (!IsQuick() || (pPorTmp && pPorTmp->IsFlyCntPortion() && !pPorTmp->GetPortion() &&
             pCurr->Height() > pPorTmp->Height())))
         {
-            KSHORT nTmpAscent, nTmpHeight;
+            sal_uInt16 nTmpAscent, nTmpHeight;
             CalcAscentAndHeight( nTmpAscent, nTmpHeight );
             AlignFlyInCntBase( Y() + long( nTmpAscent ) );
             pCurr->CalcLine( *this, GetInfo() );
@@ -1691,7 +1691,7 @@ void SwTxtFormatter::RecalcRealHeight()
 
 void SwTxtFormatter::CalcRealHeight( bool bNewLine )
 {
-    KSHORT nLineHeight = pCurr->Height();
+    sal_uInt16 nLineHeight = pCurr->Height();
     pCurr->SetClipping( false );
 
     SwTextGridItem const*const pGrid(GetGridItem(pFrm->FindPageFrm()));
@@ -1707,7 +1707,7 @@ void SwTxtFormatter::CalcRealHeight( bool bNewLine )
         while ( pCurr->Height() > nLineHeight )
             nLineHeight = nLineHeight + nLineDist;
 
-        KSHORT nAsc = pCurr->GetAscent() +
+        sal_uInt16 nAsc = pCurr->GetAscent() +
                       ( bRubyTop ?
                        ( nLineHeight - pCurr->Height() + nRubyHeight ) / 2 :
                        ( nLineHeight - pCurr->Height() - nRubyHeight ) / 2 );
@@ -1754,11 +1754,11 @@ void SwTxtFormatter::CalcRealHeight( bool bNewLine )
                             nTmp /= 100;
                             if( !nTmp )
                                 ++nTmp;
-                            nLineHeight = (KSHORT)nTmp;
+                            nLineHeight = (sal_uInt16)nTmp;
                             /*
                             //@TODO figure out how WW maps ascent and descent
                             //in case of prop  line spacing <100%
-                            KSHORT nAsc = ( 4 * nLineHeight ) / 5;  // 80%
+                            sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;  // 80%
                             if( nAsc < pCurr->GetAscent() ||
                                 nLineHeight - nAsc < pCurr->Height() -
                                 pCurr->GetAscent() )
@@ -1772,14 +1772,14 @@ void SwTxtFormatter::CalcRealHeight( bool bNewLine )
                 break;
                 case SVX_LINE_SPACE_MIN:
                 {
-                    if( nLineHeight < KSHORT( pSpace->GetLineHeight() ) )
+                    if( nLineHeight < sal_uInt16( pSpace->GetLineHeight() ) )
                         nLineHeight = pSpace->GetLineHeight();
                     break;
                 }
                 case SVX_LINE_SPACE_FIX:
                 {
                     nLineHeight = pSpace->GetLineHeight();
-                    KSHORT nAsc = ( 4 * nLineHeight ) / 5;  // 80%
+                    sal_uInt16 nAsc = ( 4 * nLineHeight ) / 5;  // 80%
                     if( nAsc < pCurr->GetAscent() ||
                         nLineHeight - nAsc < pCurr->Height() - pCurr->GetAscent() )
                         pCurr->SetClipping( true );
@@ -1807,7 +1807,7 @@ void SwTxtFormatter::CalcRealHeight( bool bNewLine )
                         nTmp /= 100;
                         if( !nTmp )
                             ++nTmp;
-                        nLineHeight = (KSHORT)nTmp;
+                        nLineHeight = (sal_uInt16)nTmp;
                         break;
                     }
                     case SVX_INTER_LINE_SPACE_FIX:
@@ -1819,7 +1819,7 @@ void SwTxtFormatter::CalcRealHeight( bool bNewLine )
                 }
         }
 #if OSL_DEBUG_LEVEL > 1
-        KSHORT nDummy = nLineHeight + 1;
+        sal_uInt16 nDummy = nLineHeight + 1;
         (void)nDummy;
 #endif
 
@@ -1830,7 +1830,7 @@ void SwTxtFormatter::CalcRealHeight( bool bNewLine )
             if ( bVert )
                 nTmpY = pFrm->SwitchHorizontalToVertical( nTmpY );
             nTmpY = (*fnRect->fnYDiff)( nTmpY, RegStart() );
-            KSHORT nDiff = KSHORT( nTmpY % RegDiff() );
+            sal_uInt16 nDiff = sal_uInt16( nTmpY % RegDiff() );
             if( nDiff )
                 nLineHeight += RegDiff() - nDiff;
         }
@@ -1869,7 +1869,7 @@ void SwTxtFormatter::FeedInf( SwTxtFormatInfo &rInf ) const
     rInf.Right( nTmpRight );
     rInf.First( nTmpFirst );
 
-    rInf.RealWidth( KSHORT(rInf.Right()) - KSHORT(GetLeftMargin()) );
+    rInf.RealWidth( sal_uInt16(rInf.Right()) - sal_uInt16(GetLeftMargin()) );
     rInf.Width( rInf.RealWidth() );
     if( ((SwTxtFormatter*)this)->GetRedln() )
     {
@@ -1896,7 +1896,7 @@ bool SwTxtFormatter::CalcOnceMore()
 {
     if( pDropFmt )
     {
-        const KSHORT nOldDrop = GetDropHeight();
+        const sal_uInt16 nOldDrop = GetDropHeight();
         CalcDropHeight( pDropFmt->GetLines() );
         bOnceMore = nOldDrop != GetDropHeight();
     }
@@ -2026,8 +2026,8 @@ void SwTxtFormatter::UpdatePos( SwLineLayout *pCurrent, Point aStart,
     long nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc;
     pCurrent->MaxAscentDescent( nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc );
 
-    KSHORT nTmpHeight = pCurrent->GetRealHeight();
-    KSHORT nAscent = pCurrent->GetAscent() + nTmpHeight - pCurrent->Height();
+    sal_uInt16 nTmpHeight = pCurrent->GetRealHeight();
+    sal_uInt16 nAscent = pCurrent->GetAscent() + nTmpHeight - pCurrent->Height();
     objectpositioning::AsCharFlags nFlags = AS_CHAR_ULSPACE;
     if( GetMulti() )
     {
@@ -2219,9 +2219,9 @@ bool SwTxtFormatter::ChkFlyUnderflow( SwTxtFormatInfo &rInf ) const
                     {
                         // To be evaluated during reformat of this line:
                         // RealHeight including spacing
-                        rInf.SetLineHeight( KSHORT(nHeight) );
+                        rInf.SetLineHeight( sal_uInt16(nHeight) );
                         // Height without extra spacing
-                        rInf.SetLineNettoHeight( KSHORT( pCurr->Height() ) );
+                        rInf.SetLineNettoHeight( sal_uInt16( pCurr->Height() ) );
                         return true;
                     }
                 }
@@ -2231,8 +2231,8 @@ bool SwTxtFormatter::ChkFlyUnderflow( SwTxtFormatInfo &rInf ) const
                 // The fly portion is not intersected by a fly anymore
                 if ( ! aInter.IsOver( aLine ) )
                 {
-                    rInf.SetLineHeight( KSHORT(nHeight) );
-                    rInf.SetLineNettoHeight( KSHORT( pCurr->Height() ) );
+                    rInf.SetLineHeight( sal_uInt16(nHeight) );
+                    rInf.SetLineNettoHeight( sal_uInt16( pCurr->Height() ) );
                     return true;
                 }
                 else
@@ -2246,8 +2246,8 @@ bool SwTxtFormatter::ChkFlyUnderflow( SwTxtFormatInfo &rInf ) const
                     if( ! aInter.HasArea() ||
                         ((SwFlyPortion*)pPos)->GetFixWidth() != aInter.Width() )
                     {
-                        rInf.SetLineHeight( KSHORT(nHeight) );
-                        rInf.SetLineNettoHeight( KSHORT( pCurr->Height() ) );
+                        rInf.SetLineHeight( sal_uInt16(nHeight) );
+                        rInf.SetLineNettoHeight( sal_uInt16( pCurr->Height() ) );
                         return true;
                     }
                 }
@@ -2386,7 +2386,7 @@ void SwTxtFormatter::CalcFlyWidth( SwTxtFormatInfo &rInf )
             // created: here and in MakeFlyDummies.
             // IsDummy() is evaluated in IsFirstTxtLine(), when moving lines
             // and in relation with DropCaps.
-            pFly->Height( KSHORT(aInter.Height()) );
+            pFly->Height( sal_uInt16(aInter.Height()) );
 
             // nNextTop now contains the margin's bottom edge, which we avoid
             // or the next margin's top edge, which we need to respect.
@@ -2398,11 +2398,11 @@ void SwTxtFormatter::CalcFlyWidth( SwTxtFormatInfo &rInf )
             if( nNextTop > aInter.Bottom() )
             {
                 SwTwips nH = nNextTop - aInter.Top();
-                if( nH < KSHRT_MAX )
-                    pFly->Height( KSHORT( nH ) );
+                if( nH < USHRT_MAX )
+                    pFly->Height( sal_uInt16( nH ) );
             }
             if( nAscent < pFly->Height() )
-                pFly->SetAscent( KSHORT(nAscent) );
+                pFly->SetAscent( sal_uInt16(nAscent) );
             else
                 pFly->SetAscent( pFly->Height() );
         }
@@ -2416,9 +2416,9 @@ void SwTxtFormatter::CalcFlyWidth( SwTxtFormatInfo &rInf )
             }
             else
             {
-                pFly->Height( KSHORT(aInter.Height()) );
+                pFly->Height( sal_uInt16(aInter.Height()) );
                 if( nAscent < pFly->Height() )
-                    pFly->SetAscent( KSHORT(nAscent) );
+                    pFly->SetAscent( sal_uInt16(nAscent) );
                 else
                     pFly->SetAscent( pFly->Height() );
             }
@@ -2492,7 +2492,7 @@ SwFlyCntPortion *SwTxtFormatter::NewFlyCntPortion( SwTxtFormatInfo &rInf,
     // we use this one when calculating the base, or the frame would be positioned
     // too much to the top, sliding down after all causing a repaint in an area
     // he actually never was in.
-    KSHORT nAscent = 0;
+    sal_uInt16 nAscent = 0;
 
     const bool bTxtFrmVertical = GetInfo().GetTxtFrm()->IsVertical();
 
diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx
index ba15c19..c046a8e 100644
--- a/sw/source/core/text/itrform2.hxx
+++ b/sw/source/core/text/itrform2.hxx
@@ -134,11 +134,11 @@ class SwTxtFormatter : public SwTxtPainter
     void InsertPortion( SwTxtFormatInfo &rInf, SwLinePortion *pPor ) const;
 
     // Guess height for the DropPortion
-    void GuessDropHeight( const MSHORT nLines );
+    void GuessDropHeight( const sal_uInt16 nLines );
 
 public:
     // Calculate the height for the DropPortion
-    void CalcDropHeight( const MSHORT nLines );
+    void CalcDropHeight( const sal_uInt16 nLines );
 
     // Calculates the paragraphs bottom, takes anchored objects within it into
     // account which have a wrap setting of "wrap at 1st paragraph"
@@ -188,7 +188,7 @@ public:
     void Insert( SwLineLayout *pLine );
 
     // The remaining height to the page border
-    KSHORT GetFrmRstHeight() const;
+    sal_uInt16 GetFrmRstHeight() const;
 
     // How wide would you be without any bounds (Flys etc.)?
     SwTwips _CalcFitToContent( );
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 5679010..c9f8ff1 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -94,7 +94,7 @@ SwLinePortion *SwTxtPainter::CalcPaintOfst( const SwRect &rPaint )
 
     // nPaintOfst wurde exakt auf das Ende eingestellt, deswegen <=
     // nPaintOfst ist dokumentglobal, deswegen nLeftMar aufaddieren
-    // const KSHORT nLeftMar = KSHORT(GetLeftMargin());
+    // const sal_uInt16 nLeftMar = sal_uInt16(GetLeftMargin());
     // 8310: painten von LineBreaks in leeren Zeilen.
     if( nPaintOfst && pCurr->Width() )
     {
@@ -177,7 +177,7 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
                      && GetDropLines() >= GetLineNr();
     }
 
-    KSHORT nTmpHeight, nTmpAscent;
+    sal_uInt16 nTmpHeight, nTmpAscent;
     CalcAscentAndHeight( nTmpAscent, nTmpHeight );
 
     // bClip decides if there's a need to clip
diff --git a/sw/source/core/text/itrtxt.cxx b/sw/source/core/text/itrtxt.cxx
index d417d33..0aa7075 100644
--- a/sw/source/core/text/itrtxt.cxx
+++ b/sw/source/core/text/itrtxt.cxx
@@ -62,7 +62,7 @@ void SwTxtIter::Init()
     nLineNr = 1;
 }
 
-void SwTxtIter::CalcAscentAndHeight( KSHORT &rAscent, KSHORT &rHeight ) const
+void SwTxtIter::CalcAscentAndHeight( sal_uInt16 &rAscent, sal_uInt16 &rHeight ) const
 {
     rHeight = GetLineHeight();
     rAscent = pCurr->GetAscent() + rHeight - pCurr->Height();
diff --git a/sw/source/core/text/itrtxt.hxx b/sw/source/core/text/itrtxt.hxx
index 49064f1..70db16c 100644
--- a/sw/source/core/text/itrtxt.hxx
+++ b/sw/source/core/text/itrtxt.hxx
@@ -40,8 +40,8 @@ protected:
     SwTwips nY;
     SwTwips nRegStart;          // The register's start position (Y)
     sal_Int32 nStart;          // Start in the text string, end = pCurr->GetLen()
-    KSHORT nRegDiff;            // Register's line distance
-    MSHORT nLineNr;             // Line number
+    sal_uInt16 nRegDiff;            // Register's line distance
+    sal_uInt16 nLineNr;             // Line number
     bool bPrev          : 1;
     bool bRegisterOn    : 1;    // Keep in register
     bool bOneBlock      : 1;    // Justified text: Dispose single words
@@ -84,13 +84,13 @@ public:
     inline const SwLineLayout *GetNext() const { return pCurr->GetNext(); }
            const SwLineLayout *GetPrev();
     inline sal_Int32 GetLength() const { return pCurr->GetLen(); }
-    inline MSHORT GetLineNr() const { return nLineNr; }
+    inline sal_uInt16 GetLineNr() const { return nLineNr; }
     inline sal_Int32 GetStart() const { return nStart; }
     inline sal_Int32 GetEnd() const { return GetStart() + GetLength(); }
     inline SwTwips Y() const { return nY; }
 
     inline SwTwips RegStart() const { return nRegStart; }
-    inline KSHORT RegDiff() const { return nRegDiff; }
+    inline sal_uInt16 RegDiff() const { return nRegDiff; }
     inline bool IsRegisterOn() const { return bRegisterOn; }
 
     inline SwTxtInfo &GetInfo() { return *pInf; }
@@ -113,8 +113,8 @@ public:
     // Truncates all after pCurr
     void TruncLines( bool bNoteFollow = false );
 
-    inline KSHORT GetLineHeight() const { return pCurr->GetRealHeight(); }
-    void CalcAscentAndHeight( KSHORT &rAscent, KSHORT &rHeight ) const;
+    inline sal_uInt16 GetLineHeight() const { return pCurr->GetRealHeight(); }
+    void CalcAscentAndHeight( sal_uInt16 &rAscent, sal_uInt16 &rHeight ) const;
 
     // Lots of trouble for querying pCurr == pPara
     inline bool IsFirstTxtLine() const
@@ -144,11 +144,11 @@ private:
           SwTwips nLeft;
           SwTwips nRight;
           SwTwips nFirst;
-          KSHORT  nDropLeft;
-          KSHORT  nDropHeight;
-          KSHORT  nDropDescent;
-          MSHORT  nDropLines;
-          MSHORT  nAdjust;
+          sal_uInt16  nDropLeft;
+          sal_uInt16  nDropHeight;
+          sal_uInt16  nDropDescent;
+          sal_uInt16  nDropLines;
+          sal_uInt16  nAdjust;
           // #i91133#
           SwTwips mnTabLeft;
 
@@ -156,7 +156,7 @@ protected:
     // For FormatQuoVadis
     inline void Right( const SwTwips nNew ) { nRight = nNew; }
     // For CalcFlyAdjust
-    inline void SetDropLeft( const KSHORT nNew ) { nDropLeft = nNew; }
+    inline void SetDropLeft( const sal_uInt16 nNew ) { nDropLeft = nNew; }
 
     void CtorInitTxtMargin( SwTxtFrm *pFrm, SwTxtSizeInfo *pInf );
     inline SwTxtMargin(SwTxtNode* pTxtNode)
@@ -188,9 +188,9 @@ public:
     inline bool IsOneBlock() const { return bOneBlock; }
     inline bool IsLastBlock() const { return bLastBlock; }
     inline bool IsLastCenter() const { return bLastCenter; }
-    inline MSHORT GetAdjust() const { return nAdjust; }
-    inline KSHORT GetLineWidth() const
-           { return KSHORT( Right() - GetLeftMargin() + 1 ); }
+    inline sal_uInt16 GetAdjust() const { return nAdjust; }
+    inline sal_uInt16 GetLineWidth() const
+           { return sal_uInt16( Right() - GetLeftMargin() + 1 ); }
     inline SwTwips GetLeftMin() const { return nFirst < nLeft ? nFirst : nLeft; }
     inline bool HasNegFirst() const { return nFirst < nLeft; }
 
@@ -200,13 +200,13 @@ public:
         return mnTabLeft;
     }
     // DropCaps
-    inline MSHORT GetDropLines() const { return nDropLines; }
-    inline void SetDropLines( const MSHORT nNew ) { nDropLines = nNew; }
-    inline KSHORT GetDropLeft() const { return nDropLeft; }
-    inline KSHORT GetDropHeight() const { return nDropHeight; }
-    inline void SetDropHeight( const KSHORT nNew ) { nDropHeight = nNew; }
-    inline KSHORT GetDropDescent() const { return nDropDescent; }
-    inline void SetDropDescent( const KSHORT nNew ) { nDropDescent = nNew; }
+    inline sal_uInt16 GetDropLines() const { return nDropLines; }
+    inline void SetDropLines( const sal_uInt16 nNew ) { nDropLines = nNew; }
+    inline sal_uInt16 GetDropLeft() const { return nDropLeft; }
+    inline sal_uInt16 GetDropHeight() const { return nDropHeight; }
+    inline void SetDropHeight( const sal_uInt16 nNew ) { nDropHeight = nNew; }
+    inline sal_uInt16 GetDropDescent() const { return nDropDescent; }
+    inline void SetDropDescent( const sal_uInt16 nNew ) { nDropDescent = nNew; }
     void DropInit();
 
     // Returns the TxtPos for start and end of the current line without whitespace
diff --git a/sw/source/core/text/noteurl.cxx b/sw/source/core/text/noteurl.cxx
index d19bc20..3d9c065 100644
--- a/sw/source/core/text/noteurl.cxx
+++ b/sw/source/core/text/noteurl.cxx
@@ -31,8 +31,8 @@ SwNoteURL *pNoteURL = NULL;
 void SwNoteURL::InsertURLNote( const OUString& rURL, const OUString& rTarget,
     const SwRect& rRect )
 {
-    MSHORT i;
-    MSHORT nCount = aList.size();
+    sal_uInt16 i;
+    sal_uInt16 nCount = aList.size();
     for( i = 0; i < nCount; i++ )
         if( rRect == aList[i].GetRect() )
             break;
@@ -47,11 +47,11 @@ void SwNoteURL::FillImageMap( ImageMap *pMap, const Point &rPos,
     const MapMode& rMap )
 {
     OSL_ENSURE( pMap, "FillImageMap: No ImageMap, no cookies!" );
-    MSHORT nCount = Count();
+    sal_uInt16 nCount = Count();
     if( nCount )
     {
         MapMode aMap( MAP_100TH_MM );
-        for( MSHORT i = 0; i < nCount; ++i )
+        for( sal_uInt16 i = 0; i < nCount; ++i )
         {
             const SwURLNote &rNote = GetURLNote( i );
             SwRect aSwRect( rNote.GetRect() );
diff --git a/sw/source/core/text/pordrop.hxx b/sw/source/core/text/pordrop.hxx
index a56d28b..815e9eb 100644
--- a/sw/source/core/text/pordrop.hxx
+++ b/sw/source/core/text/pordrop.hxx
@@ -62,36 +62,36 @@ class SwDropPortion : public SwTxtPortion
 {
     friend class SwDropCapCache;
     SwDropPortionPart* pPart; // due to script/attribute changes
-    MSHORT nLines;          // Line count
-    KSHORT nDropHeight;     // Height
-    KSHORT nDropDescent;    // Distance to the next line
-    KSHORT nDistance;       // Distance to the text
-    KSHORT nFix;            // Fixed position
+    sal_uInt16 nLines;          // Line count
+    sal_uInt16 nDropHeight;     // Height
+    sal_uInt16 nDropDescent;    // Distance to the next line
+    sal_uInt16 nDistance;       // Distance to the text
+    sal_uInt16 nFix;            // Fixed position
     short nX;               // X PaintOffset
     short nY;               // Y Offset
 
     bool FormatTxt( SwTxtFormatInfo &rInf );
     void PaintTxt( const SwTxtPaintInfo &rInf ) const;
 
-    inline void Fix( const KSHORT nNew ) { nFix = nNew; }
+    inline void Fix( const sal_uInt16 nNew ) { nFix = nNew; }
 public:
-    SwDropPortion( const MSHORT nLineCnt,
-                   const KSHORT nDropHeight,
-                   const KSHORT nDropDescent,
-                   const KSHORT nDistance );
+    SwDropPortion( const sal_uInt16 nLineCnt,
+                   const sal_uInt16 nDropHeight,
+                   const sal_uInt16 nDropDescent,
+                   const sal_uInt16 nDistance );
     virtual ~SwDropPortion();
 
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
             void PaintDrop( const SwTxtPaintInfo &rInf ) const;
     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
     virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const SAL_OVERRIDE;
-    virtual sal_Int32 GetCrsrOfst( const MSHORT nOfst ) const SAL_OVERRIDE;
+    virtual sal_Int32 GetCrsrOfst( const sal_uInt16 nOfst ) const SAL_OVERRIDE;
 
-    inline MSHORT GetLines() const { return nLines; }
-    inline KSHORT GetDistance() const { return nDistance; }
-    inline KSHORT GetDropHeight() const { return nDropHeight; }
-    inline KSHORT GetDropDescent() const { return nDropDescent; }
-    inline KSHORT GetDropLeft() const { return Width() + nFix; }
+    inline sal_uInt16 GetLines() const { return nLines; }
+    inline sal_uInt16 GetDistance() const { return nDistance; }
+    inline sal_uInt16 GetDropHeight() const { return nDropHeight; }
+    inline sal_uInt16 GetDropDescent() const { return nDropDescent; }
+    inline sal_uInt16 GetDropLeft() const { return Width() + nFix; }
 
     inline SwDropPortionPart* GetPart() const { return pPart; }
     inline void SetPart( SwDropPortionPart* pNew ) { pPart = pNew; }
diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index 14190ab..88630be 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -22,7 +22,7 @@
 #include <inftxt.hxx>
 #include <porexp.hxx>
 
-sal_Int32 SwExpandPortion::GetCrsrOfst( const MSHORT nOfst ) const
+sal_Int32 SwExpandPortion::GetCrsrOfst( const sal_uInt16 nOfst ) const
 { return SwLinePortion::GetCrsrOfst( nOfst ); }
 
 bool SwExpandPortion::GetExpTxt( const SwTxtSizeInfo&, OUString &rTxt ) const
@@ -104,7 +104,7 @@ SwLinePortion *SwBlankPortion::Compress() { return this; }
 // dann duerfen keine Underflows generiert werden!
 // Komplikationen bei Flys...
 
-MSHORT SwBlankPortion::MayUnderflow( const SwTxtFormatInfo &rInf,
+sal_uInt16 SwBlankPortion::MayUnderflow( const SwTxtFormatInfo &rInf,
     sal_Int32 nIdx, bool bUnderflow ) const
 {
     if( rInf.StopUnderflow() )
@@ -153,7 +153,7 @@ MSHORT SwBlankPortion::MayUnderflow( const SwTxtFormatInfo &rInf,
 // Format end of Line
 void SwBlankPortion::FormatEOL( SwTxtFormatInfo &rInf )
 {
-    MSHORT nMay = MayUnderflow( rInf, rInf.GetIdx() - nLineLength, true );
+    sal_uInt16 nMay = MayUnderflow( rInf, rInf.GetIdx() - nLineLength, true );
     if( nMay )
     {
         if( nMay > 1 )
@@ -216,11 +216,11 @@ void SwPostItsPortion::Paint( const SwTxtPaintInfo &rInf ) const
         rInf.DrawPostIts( *this, IsScript() );
 }
 
-KSHORT SwPostItsPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
+sal_uInt16 SwPostItsPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
 {
     // Nicht zu fassen: PostIts sind immer zu sehen.
     return rInf.OnWin() ?
-                (KSHORT)rInf.GetOpt().GetPostItsWidth( rInf.GetOut() ) : 0;
+                (sal_uInt16)rInf.GetOpt().GetPostItsWidth( rInf.GetOut() ) : 0;
 }
 
 bool SwPostItsPortion::Format( SwTxtFormatInfo &rInf )
diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx
index 6a2e99d..4e637ed 100644
--- a/sw/source/core/text/porexp.hxx
+++ b/sw/source/core/text/porexp.hxx
@@ -27,7 +27,7 @@ class SwExpandPortion : public SwTxtPortion
 public:
     inline  SwExpandPortion() { SetWhichPor( POR_EXP ); }
     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
-    virtual sal_Int32 GetCrsrOfst( const MSHORT nOfst ) const SAL_OVERRIDE;
+    virtual sal_Int32 GetCrsrOfst( const sal_uInt16 nOfst ) const SAL_OVERRIDE;
     virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
     virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const SAL_OVERRIDE;
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
@@ -55,7 +55,7 @@ public:
     virtual void FormatEOL( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
-    MSHORT MayUnderflow( const SwTxtFormatInfo &rInf, sal_Int32 nIdx,
+    sal_uInt16 MayUnderflow( const SwTxtFormatInfo &rInf, sal_Int32 nIdx,
         bool bUnderflow ) const;
 
     // Accessibility: pass information about this portion to the PortionHandler
@@ -71,7 +71,7 @@ public:
             SwPostItsPortion( bool bScrpt );
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
-    virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
+    virtual sal_uInt16 GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
     virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
     bool IsScript() const { return bScript; }
     OUTPUT_OPERATOR_OVERRIDE
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 9c1574c..aed4bc8 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -116,7 +116,7 @@ SwFldPortion::~SwFldPortion()
         pBlink->Delete( this );
 }
 
-KSHORT SwFldPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
+sal_uInt16 SwFldPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
 {
     // even though this is const, nViewWidth should be computed at the very end:
     SwFldPortion* pThis = (SwFldPortion*)this;
@@ -323,7 +323,7 @@ bool SwFldPortion::Format( SwTxtFormatInfo &rInf )
         // gesetzt und wird in nRest uebertragen. Ansonsten bleibt die
         // Laenge erhalten und wuerde auch in nRest einfliessen!
         SetLen(0);
-           const MSHORT nFollow = IsFollow() ? 0 : 1;
+        const sal_uInt16 nFollow = IsFollow() ? 0 : 1;
 
         // So komisch es aussieht, die Abfrage auf GetLen() muss wegen der
         // ExpandPortions _hinter_ aDiffTxt (vgl. SoftHyphs)
@@ -492,7 +492,7 @@ SwNumberPortion::SwNumberPortion( const OUString &rExpand,
                                   SwFont *pFont,
                                   const bool bLft,
                                   const bool bCntr,
-                                  const KSHORT nMinDst,
+                                  const sal_uInt16 nMinDst,
                                   const bool bLabelAlignmentPosAndSpaceModeActive )
         : SwFldPortion( rExpand, pFont ),
           nFixWidth(0),
@@ -505,7 +505,7 @@ SwNumberPortion::SwNumberPortion( const OUString &rExpand,
     SetCenter( bCntr );
 }
 
-sal_Int32 SwNumberPortion::GetCrsrOfst( const MSHORT ) const
+sal_Int32 SwNumberPortion::GetCrsrOfst( const sal_uInt16 ) const
 {
     return 0;
 }
@@ -587,10 +587,10 @@ bool SwNumberPortion::Format( SwTxtFormatInfo &rInf )
         if ( rInf.IsMulti() )
         {
             if ( Height() < nDiff )
-                Height( KSHORT( nDiff ) );
+                Height( sal_uInt16( nDiff ) );
         }
         else if( Width() < nDiff )
-            Width( KSHORT(nDiff) );
+            Width( sal_uInt16(nDiff) );
     }
     return bFull;
 }
@@ -625,7 +625,7 @@ void SwNumberPortion::Paint( const SwTxtPaintInfo &rInf ) const
     }
 
     // calculate the width of the number portion, including follows
-    const KSHORT nOldWidth = Width();
+    const sal_uInt16 nOldWidth = Width();
     sal_uInt16 nSumWidth = 0;
     sal_uInt16 nOffset = 0;
 
@@ -674,7 +674,7 @@ void SwNumberPortion::Paint( const SwTxtPaintInfo &rInf ) const
             // logical const: reset width
             SwLinePortion *pThis = (SwLinePortion*)this;
             bPaintSpace = bPaintSpace && nFixWidth < nOldWidth;
-            KSHORT nSpaceOffs = nFixWidth;
+            sal_uInt16 nSpaceOffs = nFixWidth;
             pThis->Width( nFixWidth );
 
             if( ( IsLeft() && ! rInf.GetTxtFrm()->IsRightToLeft() ) ||
@@ -690,7 +690,7 @@ void SwNumberPortion::Paint( const SwTxtPaintInfo &rInf ) const
                     if( IsCenter() )
                     {
                         /* #110778# a / 2 * 2 == a is not a tautology */
-                        KSHORT nTmpOffset = nOffset;
+                        sal_uInt16 nTmpOffset = nOffset;
                         nOffset /= 2;
                         if( nOffset < nMinDist )
                             nOffset = nTmpOffset - nMinDist;
@@ -731,7 +731,7 @@ SwBulletPortion::SwBulletPortion( const sal_Unicode cBullet,
                                   SwFont *pFont,
                                   const bool bLft,
                                   const bool bCntr,
-                                  const KSHORT nMinDst,
+                                  const sal_uInt16 nMinDst,
                                   const bool bLabelAlignmentPosAndSpaceModeActive )
     : SwNumberPortion( OUString(cBullet) + rBulletFollowedBy,
                        pFont, bLft, bCntr, nMinDst,
@@ -747,7 +747,7 @@ SwGrfNumPortion::SwGrfNumPortion(
         const OUString& rGraphicFollowedBy,
         const SvxBrushItem* pGrfBrush,
         const SwFmtVertOrient* pGrfOrient, const Size& rGrfSize,
-        const bool bLft, const bool bCntr, const KSHORT nMinDst,
+        const bool bLft, const bool bCntr, const sal_uInt16 nMinDst,
         const bool bLabelAlignmentPosAndSpaceModeActive ) :
     SwNumberPortion( rGraphicFollowedBy, NULL, bLft, bCntr, nMinDst,
                      bLabelAlignmentPosAndSpaceModeActive ),
@@ -778,7 +778,7 @@ SwGrfNumPortion::SwGrfNumPortion(
     Width( static_cast<sal_uInt16>(rGrfSize.Width() + 2 * GRFNUM_SECURE) );
     nFixWidth = Width();
     nGrfHeight = rGrfSize.Height() + 2 * GRFNUM_SECURE;
-    Height( KSHORT(nGrfHeight) );
+    Height( sal_uInt16(nGrfHeight) );
     bNoPaint = false;
 }
 
@@ -807,7 +807,7 @@ bool SwGrfNumPortion::Format( SwTxtFormatInfo &rInf )
 {
     SetHide( false );
 //    Width( nFixWidth );
-    KSHORT nFollowedByWidth( 0 );
+    sal_uInt16 nFollowedByWidth( 0 );
     if ( mbLabelAlignmentPosAndSpaceModeActive )
     {
         SwFldPortion::Format( rInf );
@@ -824,7 +824,7 @@ bool SwGrfNumPortion::Format( SwTxtFormatInfo &rInf )
 
     if( bFull )
     {
-        Width( rInf.Width() - (KSHORT)rInf.X() );
+        Width( rInf.Width() - (sal_uInt16)rInf.X() );
         if( bFly )
         {
             SetLen( 0 );
@@ -859,7 +859,7 @@ bool SwGrfNumPortion::Format( SwTxtFormatInfo &rInf )
     }
 
     if( Width() < nDiff )
-        Width( KSHORT(nDiff) );
+        Width( sal_uInt16(nDiff) );
     return bFull;
 }
 
@@ -888,7 +888,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const
 
     if( nFixWidth < Width() && !bTmpLeft )
     {
-        KSHORT nOffset = Width() - nFixWidth;
+        sal_uInt16 nOffset = Width() - nFixWidth;
         if( nOffset < nMinDist )
             nOffset = 0;
         else
@@ -907,7 +907,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const
 
     if( bReplace )
     {
-        KSHORT nTmpH = GetPortion() ? GetPortion()->GetAscent() : 120;
+        sal_uInt16 nTmpH = GetPortion() ? GetPortion()->GetAscent() : 120;
         aSize = Size( nTmpH, nTmpH );
         aPos.Y() = rInf.Y() - nTmpH;
     }
@@ -1298,7 +1298,7 @@ bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
     return bFull;
 }
 
-KSHORT SwCombinedPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
+sal_uInt16 SwCombinedPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const
 {
     if( !GetLen() ) // for the dummy part at the end of the line, where
         return 0;   // the combined portion doesn't fit.
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index 25adb36..ec74bb2 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -36,7 +36,7 @@ protected:
     SwFont  *pFnt;                  // For multi-line fields
     sal_Int32 nNextOffset;         // Offset of the follow in the original string
     sal_Int32 nNextScriptChg;
-    KSHORT  nViewWidth;             // Screen width for empty fields
+    sal_uInt16  nViewWidth;             // Screen width for empty fields
     bool bFollow : 1;           // 2nd or later part of a field
     bool bLeft : 1;             // Used by SwNumberPortion
     bool bHide : 1;             // Used by SwNumberPortion
@@ -72,7 +72,7 @@ public:
     // Empty fields are also allowed
     virtual SwLinePortion *Compress() SAL_OVERRIDE;
 
-    virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
+    virtual sal_uInt16 GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
 
     inline bool IsFollow() const { return bFollow; }
     inline void SetFollow( bool bNew ) { bFollow = bNew; }
@@ -126,8 +126,8 @@ public:
 class SwNumberPortion : public SwFldPortion
 {
 protected:
-    KSHORT  nFixWidth;      // See Glues
-    KSHORT  nMinDist;       // Minimal distance to the text
+    sal_uInt16  nFixWidth;      // See Glues
+    sal_uInt16  nMinDist;       // Minimal distance to the text
     bool    mbLabelAlignmentPosAndSpaceModeActive;
 
 public:
@@ -135,10 +135,10 @@ public:
                      SwFont *pFnt,
                      const bool bLeft,
                      const bool bCenter,
-                     const KSHORT nMinDst,
+                     const sal_uInt16 nMinDst,
                      const bool bLabelAlignmentPosAndSpaceModeActive );
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
-    virtual sal_Int32 GetCrsrOfst( const MSHORT nOfst ) const SAL_OVERRIDE;
+    virtual sal_Int32 GetCrsrOfst( const sal_uInt16 nOfst ) const SAL_OVERRIDE;
     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
 
     // Field cloner for SplitGlue
@@ -156,7 +156,7 @@ public:
                      SwFont *pFnt,
                      const bool bLeft,
                      const bool bCenter,
-                     const KSHORT nMinDst,
+                     const sal_uInt16 nMinDst,
                      const bool bLabelAlignmentPosAndSpaceModeActive );
     OUTPUT_OPERATOR_OVERRIDE
 };
@@ -176,7 +176,7 @@ public:
                      const Size& rGrfSize,
                      const bool bLeft,
                      const bool bCenter,
-                     const KSHORT nMinDst,
+                     const sal_uInt16 nMinDst,
                      const bool bLabelAlignmentPosAndSpaceModeActive );
     virtual ~SwGrfNumPortion();
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
@@ -220,7 +220,7 @@ public:
     SwCombinedPortion( const OUString &rExpand );
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
-    virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
+    virtual sal_uInt16 GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
     OUTPUT_OPERATOR_OVERRIDE
 };
 
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 9423539..6a4656f 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -412,7 +412,7 @@ void SwFlyCntPortion::SetBase( const SwTxtFrm& rFrm, const Point &rBase,
     }
 }
 
-sal_Int32 SwFlyCntPortion::GetFlyCrsrOfst( const KSHORT nOfst,
+sal_Int32 SwFlyCntPortion::GetFlyCrsrOfst( const sal_uInt16 nOfst,
     const Point &rPoint, SwPosition *pPos, SwCrsrMoveState* pCMS ) const
 {
     // Da die FlyCnt nicht an der Seite haengen, wird ihr
@@ -426,7 +426,7 @@ sal_Int32 SwFlyCntPortion::GetFlyCrsrOfst( const KSHORT nOfst,
         return 0;
 }
 
-sal_Int32 SwFlyCntPortion::GetCrsrOfst( const KSHORT nOfst ) const
+sal_Int32 SwFlyCntPortion::GetCrsrOfst( const sal_uInt16 nOfst ) const
 {
     // OSL_ENSURE( !this, "SwFlyCntPortion::GetCrsrOfst: use GetFlyCrsrOfst()" );
     return SwLinePortion::GetCrsrOfst( nOfst );
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index 3508258..1921c1b 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -30,12 +30,12 @@ struct SwCrsrMoveState;
 
 class SwFlyPortion : public SwFixPortion
 {
-    KSHORT nBlankWidth;
+    sal_uInt16 nBlankWidth;
 public:
     inline  SwFlyPortion( const SwRect &rFlyRect )
         : SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( POR_FLY ); }
-    inline KSHORT GetBlankWidth( ) const { return nBlankWidth; }
-    inline void SetBlankWidth( const KSHORT nNew ) { nBlankWidth = nNew; }
+    inline sal_uInt16 GetBlankWidth( ) const { return nBlankWidth; }
+    inline void SetBlankWidth( const sal_uInt16 nNew ) { nBlankWidth = nNew; }
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
     OUTPUT_OPERATOR_OVERRIDE
@@ -49,7 +49,7 @@ class SwFlyCntPortion : public SwLinePortion
     bool bDraw : 1;  // DrawContact?
     bool bMax : 1;   // Line adjustment and height == line height
     sal_uInt8 nAlign : 3; // Line adjustment? No, above, middle, bottom
-    virtual sal_Int32 GetCrsrOfst( const KSHORT nOfst ) const SAL_OVERRIDE;
+    virtual sal_Int32 GetCrsrOfst( const sal_uInt16 nOfst ) const SAL_OVERRIDE;
 
 public:
     // OD 29.07.2003 #110978# - use new datatype for parameter <nFlags>
@@ -79,7 +79,7 @@ public:
                   long nLnAscent, long nLnDescent,
                   long nFlyAscent, long nFlyDescent,
                   objectpositioning::AsCharFlags nFlags );
-    sal_Int32 GetFlyCrsrOfst( const KSHORT nOfst, const Point &rPoint,
+    sal_Int32 GetFlyCrsrOfst( const sal_uInt16 nOfst, const Point &rPoint,
                         SwPosition *pPos, SwCrsrMoveState* pCMS ) const;
     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx
index f2cf83f..51d5f75 100644
--- a/sw/source/core/text/porftn.hxx
+++ b/sw/source/core/text/porftn.hxx
@@ -27,14 +27,14 @@ class SwTxtFtn;
 class SwFtnPortion : public SwFldPortion
 {
     SwTxtFtn *pFtn;
-    KSHORT nOrigHeight;
+    sal_uInt16 nOrigHeight;
     // #i98418#
     bool mbPreferredScriptTypeSet;
     sal_uInt8 mnPreferredScriptType;
 public:
     SwFtnPortion( const OUString &rExpand, SwTxtFtn *pFtn,
-                  KSHORT nOrig = KSHRT_MAX );
-    KSHORT& Orig() { return nOrigHeight; }
+                  sal_uInt16 nOrig = USHRT_MAX );
+    sal_uInt16& Orig() { return nOrigHeight; }
 
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
     virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
@@ -84,7 +84,7 @@ class SwErgoSumPortion : public SwFldPortion
 {
 public:
     SwErgoSumPortion( const OUString &rExp, const OUString& rStr );
-    virtual sal_Int32 GetCrsrOfst( const KSHORT nOfst ) const SAL_OVERRIDE;
+    virtual sal_Int32 GetCrsrOfst( const sal_uInt16 nOfst ) const SAL_OVERRIDE;
     virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE;
 
     // Field cloner for SplitGlue
diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx
index 6ea87bc..66a4396 100644
--- a/sw/source/core/text/porglue.cxx
+++ b/sw/source/core/text/porglue.cxx
@@ -27,14 +27,14 @@
 #include "porfly.hxx"
 #include <comphelper/string.hxx>
 
-SwGluePortion::SwGluePortion( const KSHORT nInitFixWidth )
+SwGluePortion::SwGluePortion( const sal_uInt16 nInitFixWidth )
     : nFixWidth( nInitFixWidth )
 {
     PrtWidth( nFixWidth );
     SetWhichPor( POR_GLUE );
 }
 
-sal_Int32 SwGluePortion::GetCrsrOfst( const KSHORT nOfst ) const
+sal_Int32 SwGluePortion::GetCrsrOfst( const sal_uInt16 nOfst ) const
 {
     if( !GetLen() || nOfst > GetLen() || !Width() )
         return SwLinePortion::GetCrsrOfst( nOfst );
@@ -131,19 +131,19 @@ void SwGluePortion::Join( SwGluePortion *pVictim )
 
 // Wir erwarten ein framelokales SwRect !
 SwFixPortion::SwFixPortion( const SwRect &rRect )
-       :SwGluePortion( KSHORT(rRect.Width()) ), nFix( KSHORT(rRect.Left()) )
+       :SwGluePortion( sal_uInt16(rRect.Width()) ), nFix( sal_uInt16(rRect.Left()) )
 {
-    Height( KSHORT(rRect.Height()) );
+    Height( sal_uInt16(rRect.Height()) );
     SetWhichPor( POR_FIX );
 }
 
-SwFixPortion::SwFixPortion(const KSHORT nFixedWidth, const KSHORT nFixedPos)
+SwFixPortion::SwFixPortion(const sal_uInt16 nFixedWidth, const sal_uInt16 nFixedPos)
        : SwGluePortion(nFixedWidth), nFix(nFixedPos)
 {
     SetWhichPor( POR_FIX );
 }
 
-SwMarginPortion::SwMarginPortion( const KSHORT nFixedWidth )
+SwMarginPortion::SwMarginPortion( const sal_uInt16 nFixedWidth )
     :SwGluePortion( nFixedWidth )
 {
     SetWhichPor( POR_MARGIN );
@@ -182,8 +182,8 @@ void SwMarginPortion::AdjustRight( const SwLineLayout *pCurr )
             pRight->MoveAllGlue( pLeft );
             pRight = 0;
         }
-        KSHORT nRightGlue = pRight && 0 < pRight->GetPrtGlue()
-                          ? KSHORT(pRight->GetPrtGlue()) : 0;
+        sal_uInt16 nRightGlue = pRight && 0 < pRight->GetPrtGlue()
+                          ? sal_uInt16(pRight->GetPrtGlue()) : 0;
         // 2) balance left and right Glue
         //    But not for tabs ...
         if( pLeft && nRightGlue && !pRight->InTabGrp() )
diff --git a/sw/source/core/text/porglue.hxx b/sw/source/core/text/porglue.hxx
index 9c85686..e3cbb13 100644
--- a/sw/source/core/text/porglue.hxx
+++ b/sw/source/core/text/porglue.hxx
@@ -27,21 +27,21 @@ class SwLineLayout;
 class SwGluePortion : public SwLinePortion
 {
 private:
-    KSHORT nFixWidth;
+    sal_uInt16 nFixWidth;
 public:
-                SwGluePortion( const KSHORT nInitFixWidth );
+                SwGluePortion( const sal_uInt16 nInitFixWidth );
 
     void Join( SwGluePortion *pVictim );
 
     inline short GetPrtGlue() const;
-    inline KSHORT GetFixWidth() const { return nFixWidth; }
-    inline void SetFixWidth( const KSHORT nNew ) { nFixWidth = nNew; }
+    inline sal_uInt16 GetFixWidth() const { return nFixWidth; }
+    inline void SetFixWidth( const sal_uInt16 nNew ) { nFixWidth = nNew; }
     void MoveGlue( SwGluePortion *pTarget, const short nPrtGlue );
     inline void MoveAllGlue( SwGluePortion *pTarget );
     inline void MoveHalfGlue( SwGluePortion *pTarget );
     inline void AdjFixWidth();
     virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE;
-    virtual sal_Int32 GetCrsrOfst( const KSHORT nOfst ) const SAL_OVERRIDE;
+    virtual sal_Int32 GetCrsrOfst( const sal_uInt16 nOfst ) const SAL_OVERRIDE;
     virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const SAL_OVERRIDE;
     virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const SAL_OVERRIDE;
 
@@ -50,19 +50,19 @@ public:
 
 class SwFixPortion : public SwGluePortion
 {
-    KSHORT nFix;        // The width offset in the line
+    sal_uInt16 nFix;        // The width offset in the line
 public:
         SwFixPortion( const SwRect &rFlyRect );
-        SwFixPortion( const KSHORT nFixWidth, const KSHORT nFixPos );
-    inline void   Fix( const KSHORT nNewFix ) { nFix = nNewFix; }
-    inline KSHORT Fix() const { return nFix; }
+        SwFixPortion( const sal_uInt16 nFixWidth, const sal_uInt16 nFixPos );
+    inline void   Fix( const sal_uInt16 nNewFix ) { nFix = nNewFix; }
+    inline sal_uInt16 Fix() const { return nFix; }
     OUTPUT_OPERATOR_OVERRIDE
 };
 
 class SwMarginPortion : public SwGluePortion
 {
 public:
-        SwMarginPortion( const KSHORT nFixWidth );
+        SwMarginPortion( const sal_uInt16 nFixWidth );
         void AdjustRight( const SwLineLayout* pCurr );
     OUTPUT_OPERATOR_OVERRIDE
 };
diff --git a/sw/source/core/text/porhyph.hxx b/sw/source/core/text/porhyph.hxx
index 47c7707..996e4ec 100644
--- a/sw/source/core/text/porhyph.hxx
+++ b/sw/source/core/text/porhyph.hxx
@@ -58,8 +58,8 @@ public:
 class SwSoftHyphPortion : public SwHyphPortion
 {
     bool    bExpand;
-    KSHORT  nViewWidth;
-    KSHORT  nHyphWidth;
+    sal_uInt16  nViewWidth;
+    sal_uInt16  nHyphWidth;
 
 public:
     SwSoftHyphPortion();
@@ -71,7 +71,7 @@ public:
     inline void SetExpand( const bool bNew ) { bExpand = bNew; }
     bool IsExpand() const { return bExpand; }
 
-    virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
+    virtual sal_uInt16 GetViewWidth( const SwTxtSizeInfo &rInf ) const SAL_OVERRIDE;
 
     // Accessibility: pass information about this portion to the PortionHandler
     virtual void HandlePortion( SwPortionHandler& rPH ) const SAL_OVERRIDE;
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 0a650df..a080fb4 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -251,11 +251,11 @@ static bool lcl_HasOnlyBlanks( const OUString& rTxt, sal_Int32 nStt, sal_Int32 n
 // Swapped out from FormatLine()
 void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
 {
-    const KSHORT nLineWidth = rInf.RealWidth();
+    const sal_uInt16 nLineWidth = rInf.RealWidth();
 
-    KSHORT nFlyAscent = 0;
-    KSHORT nFlyHeight = 0;
-    KSHORT nFlyDescent = 0;
+    sal_uInt16 nFlyAscent = 0;
+    sal_uInt16 nFlyHeight = 0;
+    sal_uInt16 nFlyDescent = 0;
     bool bOnlyPostIts = true;
     SetHanging( false );
 
@@ -286,11 +286,11 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
         }
         else
         {
-            KSHORT nLineHeight = Height();
+            sal_uInt16 nLineHeight = Height();
             Init( GetPortion() );
             SwLinePortion *pPos = pPortion;
             SwLinePortion *pLast = this;
-            KSHORT nMaxDescent = 0;
+            sal_uInt16 nMaxDescent = 0;
 
             // A group is a segment in the portion chain of pCurr or a fixed
             // portion spanning to the end or the next fixed portion
@@ -347,8 +347,8 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
 
                 // We had an attribute change: Sum up/build maxima of length and mass
 
-                KSHORT nPosHeight = pPos->Height();
-                KSHORT nPosAscent = pPos->GetAscent();
+                sal_uInt16 nPosHeight = pPos->Height();
+                sal_uInt16 nPosAscent = pPos->GetAscent();
 
                 SAL_WARN_IF( nPosHeight < nPosAscent,
                         "sw.core", "SwLineLayout::CalcLine: bad ascent or height" );
@@ -381,7 +381,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
                         {
                             if( pPos->InNumberGrp() )
                             {
-                                KSHORT nTmp = rInf.GetFont()->GetAscent(
+                                sal_uInt16 nTmp = rInf.GetFont()->GetAscent(
                                                 rInf.GetVsh(), *rInf.GetOut() );
                                 if( nTmp > nPosAscent )
                                 {
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 64c8082..3784cda 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -82,7 +82,7 @@ private:
     SwLineLayout *pNext;                // The next Line
     std::vector<long>* pLLSpaceAdd;     // Used for justified alignment
     std::deque<sal_uInt16>* pKanaComp;  // Used for Kana compression
-    KSHORT nRealHeight;                 // The height resulting from line spacing and register
+    sal_uInt16 nRealHeight;                 // The height resulting from line spacing and register
     bool bFormatAdj : 1;
     bool bDummy     : 1;
     bool bFntChg    : 1;
@@ -155,8 +155,8 @@ public:
     // Collects the data for the line
     void CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf );
 
-    inline void SetRealHeight( KSHORT nNew ) { nRealHeight = nNew; }
-    inline KSHORT GetRealHeight() const { return nRealHeight; }
+    inline void SetRealHeight( sal_uInt16 nNew ) { nRealHeight = nNew; }
+    inline sal_uInt16 GetRealHeight() const { return nRealHeight; }
 
     // Creates the glue chain for short lines
     SwMarginPortion *CalcLeftMargin();
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index 24712bb..1e4ae55 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -31,7 +31,7 @@
 bool ChkChain( SwLinePortion *pStart )
 {
     SwLinePortion *pPor = pStart->GetPortion();
-    MSHORT nCount = 0;
+    sal_uInt16 nCount = 0;
     while( pPor )
     {
         ++nCount;
@@ -63,7 +63,7 @@ SwLinePortion *SwLinePortion::Compress()
     return GetLen() || Width() ? this : 0;
 }
 
-KSHORT SwLinePortion::GetViewWidth( const SwTxtSizeInfo & ) const
+sal_uInt16 SwLinePortion::GetViewWidth( const SwTxtSizeInfo & ) const
 {
     return 0;
 }
@@ -84,18 +84,18 @@ void SwLinePortion::PrePaint( const SwTxtPaintInfo& rInf,
     OSL_ENSURE( rInf.OnWin(), "SwLinePortion::PrePaint: don't prepaint on a printer");
     OSL_ENSURE( !Width(), "SwLinePortion::PrePaint: For Width()==0 only!");
 
-    const KSHORT nViewWidth = GetViewWidth( rInf );
+    const sal_uInt16 nViewWidth = GetViewWidth( rInf );
 
     if( ! nViewWidth )
         return;
 
-    const KSHORT nHalfView = nViewWidth / 2;
+    const sal_uInt16 nHalfView = nViewWidth / 2;
     sal_uInt16 nLastWidth = pLast->Width();
 
     if ( pLast->InSpaceGrp() && rInf.GetSpaceAdd() )
         nLastWidth = nLastWidth + (sal_uInt16)pLast->CalcSpacing( rInf.GetSpaceAdd(), rInf );
 
-    KSHORT nPos;
+    sal_uInt16 nPos;
     SwTxtPaintInfo aInf( rInf );
 
     const bool bBidiPor = ( rInf.GetTxtFrm()->IsRightToLeft() ) !=
@@ -108,25 +108,25 @@ void SwLinePortion::PrePaint( const SwTxtPaintInfo& rInf,
     switch ( nDir )
     {
     case 0 :
-        nPos = KSHORT( rInf.X() );
+        nPos = sal_uInt16( rInf.X() );
         if( nLastWidth > nHalfView )
             nPos += nLastWidth - nHalfView;
         aInf.X( nPos );
         break;
     case 900 :
-        nPos = KSHORT( rInf.Y() );
+        nPos = sal_uInt16( rInf.Y() );
         if( nLastWidth > nHalfView )
             nPos -= nLastWidth + nHalfView;
         aInf.Y( nPos );
         break;
     case 1800 :
-        nPos = KSHORT( rInf.X() );
+        nPos = sal_uInt16( rInf.X() );
         if( nLastWidth > nHalfView )
             nPos -= nLastWidth + nHalfView;
         aInf.X( nPos );
         break;
     case 2700 :
-        nPos = KSHORT( rInf.Y() );
+        nPos = sal_uInt16( rInf.Y() );
         if( nLastWidth > nHalfView )
             nPos += nLastWidth - nHalfView;
         aInf.Y( nPos );
@@ -222,7 +222,7 @@ SwLinePortion *SwLinePortion::FindPrevPortion( const SwLinePortion *pRoot )
     return pPos;
 }
 
-sal_Int32 SwLinePortion::GetCrsrOfst( const KSHORT nOfst ) const
+sal_Int32 SwLinePortion::GetCrsrOfst( const sal_uInt16 nOfst ) const
 {
     if( nOfst > ( PrtWidth() / 2 ) )
         return GetLen();
@@ -249,7 +249,7 @@ bool SwLinePortion::Format( SwTxtFormatInfo &rInf )
     const SwLinePortion *pLast = rInf.GetLast();
     Height( pLast->Height() );
     SetAscent( pLast->GetAscent() );
-    const KSHORT nNewWidth = static_cast<sal_uInt16>(rInf.X() + PrtWidth());
+    const sal_uInt16 nNewWidth = static_cast<sal_uInt16>(rInf.X() + PrtWidth());
     // Nur Portions mit echter Breite koennen ein true zurueckliefern
     // Notizen beispielsweise setzen niemals bFull==true
     if( rInf.Width() <= nNewWidth && PrtWidth() && ! IsKernPortion() )
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 1d27b8d..cb86657 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -63,11 +63,11 @@ protected:
     SwLinePortion *pPortion;
     // Count of chars and spaces on the line
     sal_Int32 nLineLength;
-    KSHORT nAscent;      // Maximum ascender
+    sal_uInt16 nAscent;      // Maximum ascender
 
     SwLinePortion();
 private:
-    MSHORT nWhichPor;       // Who's who?
+    sal_uInt16 nWhichPor;       // Who's who?
     bool m_bJoinBorderWithPrev;
     bool m_bJoinBorderWithNext;
 
@@ -84,13 +84,13 @@ public:
     inline sal_Int32 GetLen() const { return nLineLength; }
     inline void SetLen( const sal_Int32 nLen ) { nLineLength = nLen; }
     inline void SetPortion( SwLinePortion *pNew ){ pPortion = pNew; }
-    inline KSHORT &GetAscent() { return nAscent; }
-    inline KSHORT GetAscent() const { return nAscent; }
-    inline void SetAscent( const KSHORT nNewAsc ) { nAscent = nNewAsc; }
-    inline void  PrtWidth( KSHORT nNewWidth ) { Width( nNewWidth ); }
-    inline KSHORT PrtWidth() const { return Width(); }
-    inline void AddPrtWidth( const KSHORT nNew ) { Width( Width() + nNew ); }
-    inline void SubPrtWidth( const KSHORT nNew ) { Width( Width() - nNew ); }
+    inline sal_uInt16 &GetAscent() { return nAscent; }
+    inline sal_uInt16 GetAscent() const { return nAscent; }
+    inline void SetAscent( const sal_uInt16 nNewAsc ) { nAscent = nNewAsc; }
+    inline void  PrtWidth( sal_uInt16 nNewWidth ) { Width( nNewWidth ); }
+    inline sal_uInt16 PrtWidth() const { return Width(); }
+    inline void AddPrtWidth( const sal_uInt16 nNew ) { Width( Width() + nNew ); }
+    inline void SubPrtWidth( const sal_uInt16 nNew ) { Width( Width() - nNew ); }
 
     inline const SwPosSize &PrtSize() const { return *this; }
 
@@ -103,8 +103,8 @@ public:
     // Returns 0, if there's no payload
     virtual SwLinePortion *Compress();
 
-    inline void SetWhichPor( const MSHORT nNew )    { nWhichPor = nNew; }
-    inline MSHORT GetWhichPor( ) const        { return nWhichPor; }
+    inline void SetWhichPor( const sal_uInt16 nNew )    { nWhichPor = nNew; }
+    inline sal_uInt16 GetWhichPor( ) const        { return nWhichPor; }
 
 // Group queries
     inline bool InTxtGrp() const { return nWhichPor & PORGRP_TXT; }
@@ -155,7 +155,7 @@ public:
     SwLinePortion *FindPrevPortion( const SwLinePortion *pRoot );
     SwLinePortion *FindLastPortion();
 
-    virtual sal_Int32 GetCrsrOfst( const KSHORT nOfst ) const;
+    virtual sal_Int32 GetCrsrOfst( const sal_uInt16 nOfst ) const;
     virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
     void CalcTxtSize( const SwTxtSizeInfo &rInfo );
 
@@ -172,7 +172,7 @@ public:
     virtual bool GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const;
 
     // For SwFldPortion, SwSoftHyphPortion
-    virtual KSHORT GetViewWidth( const SwTxtSizeInfo &rInf ) const;
+    virtual sal_uInt16 GetViewWidth( const SwTxtSizeInfo &rInf ) const;
 
     // for text- and multi-portions
     virtual long CalcSpacing( long nSpaceAdd, const SwTxtSizeInfo &rInf ) const;
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 51fc583..ebd76e1 100644
--- a/sw/source/core/text/pormulti.cxx

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list