[Libreoffice-commits] core.git: chart2/source editeng/qa editeng/source include/editeng include/formula include/svx include/tools sc/inc sc/source sd/source starmath/source svtools/source svx/source sw/source vcl/source

Norbert Thiebaud nthiebaud at gmail.com
Sun Feb 2 23:44:54 PST 2014


 chart2/source/view/axes/VCartesianAxis.cxx                  |   13 
 editeng/qa/unit/core-test.cxx                               |   60 +-
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |   36 -
 editeng/source/accessibility/AccessibleStaticTextBase.cxx   |    2 
 editeng/source/editeng/editattr.hxx                         |    8 
 editeng/source/editeng/editdbg.cxx                          |    2 
 editeng/source/editeng/editdoc.cxx                          |  260 +++++-------
 editeng/source/editeng/editdoc.hxx                          |  192 ++++----
 editeng/source/editeng/editeng.cxx                          |   52 +-
 editeng/source/editeng/editobj.cxx                          |   14 
 editeng/source/editeng/editview.cxx                         |   18 
 editeng/source/editeng/edtspell.cxx                         |   32 -
 editeng/source/editeng/edtspell.hxx                         |   28 -
 editeng/source/editeng/eertfpar.cxx                         |    6 
 editeng/source/editeng/eertfpar.hxx                         |    6 
 editeng/source/editeng/impedit.cxx                          |   12 
 editeng/source/editeng/impedit.hxx                          |   68 +--
 editeng/source/editeng/impedit2.cxx                         |  258 ++++++-----
 editeng/source/editeng/impedit3.cxx                         |  235 +++++-----
 editeng/source/editeng/impedit4.cxx                         |   81 +--
 editeng/source/editeng/impedit5.cxx                         |    8 
 editeng/source/editeng/misspellrange.cxx                    |    4 
 editeng/source/editeng/section.cxx                          |    2 
 editeng/source/editeng/textconv.cxx                         |   16 
 editeng/source/outliner/outleeng.cxx                        |   12 
 editeng/source/outliner/outleeng.hxx                        |   12 
 editeng/source/outliner/outlin2.cxx                         |    8 
 editeng/source/outliner/outliner.cxx                        |   26 -
 editeng/source/outliner/outlvw.cxx                          |    8 
 editeng/source/rtf/svxrtf.cxx                               |    2 
 editeng/source/uno/unoedhlp.cxx                             |   44 +-
 editeng/source/uno/unoedprx.cxx                             |   78 +--
 editeng/source/uno/unofored.cxx                             |   38 -
 editeng/source/uno/unoforou.cxx                             |   42 -
 editeng/source/uno/unotext.cxx                              |   40 -
 editeng/source/uno/unotext2.cxx                             |    4 
 include/editeng/AccessibleEditableTextPara.hxx              |    2 
 include/editeng/editdata.hxx                                |   75 +--
 include/editeng/editeng.hxx                                 |   72 +--
 include/editeng/editstat.hxx                                |    8 
 include/editeng/editview.hxx                                |    8 
 include/editeng/eedata.hxx                                  |   10 
 include/editeng/misspellrange.hxx                           |   10 
 include/editeng/outliner.hxx                                |   44 +-
 include/editeng/section.hxx                                 |    8 
 include/editeng/svxrtf.hxx                                  |   12 
 include/editeng/unoedhlp.hxx                                |    2 
 include/editeng/unoedprx.hxx                                |   30 -
 include/editeng/unoedsrc.hxx                                |   36 -
 include/editeng/unofored.hxx                                |   30 -
 include/editeng/unoforou.hxx                                |   34 -
 include/editeng/unotext.hxx                                 |   32 -
 include/formula/token.hxx                                   |    4 
 include/svx/svdoutl.hxx                                     |    2 
 include/tools/solar.h                                       |    2 
 include/tools/string.hxx                                    |   31 -
 sc/inc/column.hxx                                           |    2 
 sc/inc/compiler.hxx                                         |    8 
 sc/inc/document.hxx                                         |    2 
 sc/inc/editutil.hxx                                         |    6 
 sc/inc/funcdesc.hxx                                         |    4 
 sc/inc/pch/precompiled_sc.hxx                               |    1 
 sc/inc/table.hxx                                            |    2 
 sc/source/core/data/attrib.cxx                              |    2 
 sc/source/core/data/column3.cxx                             |    2 
 sc/source/core/data/documen4.cxx                            |    2 
 sc/source/core/data/documen8.cxx                            |    2 
 sc/source/core/data/funcdesc.cxx                            |    2 
 sc/source/core/data/table3.cxx                              |    4 
 sc/source/core/inc/interpre.hxx                             |    3 
 sc/source/core/tool/address.cxx                             |    9 
 sc/source/core/tool/compiler.cxx                            |   17 
 sc/source/core/tool/ddelink.cxx                             |    2 
 sc/source/core/tool/editutil.cxx                            |   14 
 sc/source/core/tool/interpr1.cxx                            |   22 -
 sc/source/core/tool/interpr2.cxx                            |   10 
 sc/source/core/tool/interpr4.cxx                            |    2 
 sc/source/core/tool/rangenam.cxx                            |    4 
 sc/source/core/tool/token.cxx                               |    6 
 sc/source/filter/excel/tokstack.cxx                         |    2 
 sc/source/filter/excel/xehelper.cxx                         |   16 
 sc/source/filter/excel/xepivot.cxx                          |    2 
 sc/source/filter/excel/xicontent.cxx                        |    2 
 sc/source/filter/excel/xistring.cxx                         |    6 
 sc/source/filter/excel/xltools.cxx                          |    2 
 sc/source/filter/html/htmlexp.cxx                           |   10 
 sc/source/filter/inc/xistring.hxx                           |    4 
 sc/source/filter/inc/xlpivot.hxx                            |    2 
 sc/source/ui/app/inputhdl.cxx                               |   48 +-
 sc/source/ui/app/inputwin.cxx                               |    4 
 sc/source/ui/dbgui/scuiimoptdlg.cxx                         |    8 
 sc/source/ui/docshell/arealink.cxx                          |    2 
 sc/source/ui/docshell/docsh.cxx                             |    2 
 sc/source/ui/docshell/docsh8.cxx                            |    4 
 sc/source/ui/docshell/impex.cxx                             |   21 
 sc/source/ui/drawfunc/drtxtob.cxx                           |   11 
 sc/source/ui/inc/csvcontrol.hxx                             |    4 
 sc/source/ui/inc/rfindlst.hxx                               |    6 
 sc/source/ui/navipi/navipi.cxx                              |    2 
 sc/source/ui/pagedlg/scuitphfedit.cxx                       |   10 
 sc/source/ui/unoobj/fielduno.cxx                            |   17 
 sc/source/ui/view/editsh.cxx                                |    2 
 sc/source/ui/view/output2.cxx                               |    8 
 sc/source/ui/view/viewfun4.cxx                              |    2 
 sd/source/filter/html/htmlex.cxx                            |    8 
 sd/source/ui/view/Outliner.cxx                              |    2 
 starmath/source/accessibility.cxx                           |   36 -
 starmath/source/accessibility.hxx                           |   30 -
 svtools/source/edit/editsyntaxhighlighter.cxx               |    8 
 svx/source/accessibility/AccessibleEmptyEditSource.cxx      |   30 -
 svx/source/svdraw/svdotextdecomposition.cxx                 |   10 
 svx/source/svdraw/svdoutl.cxx                               |    2 
 sw/source/ui/uno/unotxdoc.cxx                               |    6 
 vcl/source/edit/texteng.cxx                                 |    2 
 114 files changed, 1293 insertions(+), 1345 deletions(-)

New commits:
commit 3cbfcee36dd16e451d76c561eaaaee0ff29b01a5
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sun Feb 2 22:16:48 2014 -0600

    xub_StrLen and tools/string.hxx final straw
    
    Thre is still some 0xffff limit left and possibly some
    less than gracefully handled overflow/error cases
    
    Change-Id: I00957ee3a30b02f73918ea49d7353056263dc638
    Reviewed-on: https://gerrit.libreoffice.org/7787
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index be3922b..71a816d 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -348,14 +348,15 @@ bool lcl_hasWordBreak( const Reference< drawing::XShape >& rxShape )
                     sal_Int32 nParaCount = pTextForwarder->GetParagraphCount();
                     for ( sal_Int32 nPara = 0; nPara < nParaCount; ++nPara )
                     {
-                        sal_uInt16 nLineCount = pTextForwarder->GetLineCount( nPara );
-                        for ( sal_uInt16 nLine = 0; nLine < nLineCount; ++nLine )
+                        sal_Int32 nLineCount = pTextForwarder->GetLineCount( nPara );
+                        for ( sal_Int32 nLine = 0; nLine < nLineCount; ++nLine )
                         {
-                            sal_uInt16 nLineStart = 0;
-                            sal_uInt16 nLineEnd = 0;
+                            sal_Int32 nLineStart = 0;
+                            sal_Int32 nLineEnd = 0;
                             pTextForwarder->GetLineBoundaries( nLineStart, nLineEnd, nPara, nLine );
-                            sal_uInt16 nWordStart = 0;
-                            sal_uInt16 nWordEnd = 0;
+                            assert(nLineStart >= 0);
+                            sal_Int32 nWordStart = 0;
+                            sal_Int32 nWordEnd = 0;
                             if ( pTextForwarder->GetWordIndices( nPara, nLineStart, nWordStart, nWordEnd ) &&
                                  ( nWordStart != nLineStart ) )
                             {
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 27b910e..bae28f4 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -403,26 +403,26 @@ void Test::testSectionAttributes()
 
         // First section should be 0-3 of paragraph 0, and it should only have boldness applied.
         const editeng::Section* pSecAttr = &aAttrs[0];
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnParagraph);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnStart);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pSecAttr->mnEnd);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pSecAttr->maAttributes.size());
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnParagraph);
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnStart);
+        CPPUNIT_ASSERT_EQUAL(3, (int)pSecAttr->mnEnd);
+        CPPUNIT_ASSERT_EQUAL(1, (int)pSecAttr->maAttributes.size());
         CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(*pSecAttr));
 
         // Second section should be 3-6, and it should be both bold and italic.
         pSecAttr = &aAttrs[1];
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnParagraph);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pSecAttr->mnStart);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(6), pSecAttr->mnEnd);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), pSecAttr->maAttributes.size());
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnParagraph);
+        CPPUNIT_ASSERT_EQUAL(3, (int)pSecAttr->mnStart);
+        CPPUNIT_ASSERT_EQUAL(6, (int)pSecAttr->mnEnd);
+        CPPUNIT_ASSERT_EQUAL(2, (int)pSecAttr->maAttributes.size());
         CPPUNIT_ASSERT_MESSAGE("This section must be bold and italic.", hasBold(*pSecAttr) && hasItalic(*pSecAttr));
 
         // Third section should be 6-9, and it should be only italic.
         pSecAttr = &aAttrs[2];
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnParagraph);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(6), pSecAttr->mnStart);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(9), pSecAttr->mnEnd);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pSecAttr->maAttributes.size());
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnParagraph);
+        CPPUNIT_ASSERT_EQUAL(6, (int)pSecAttr->mnStart);
+        CPPUNIT_ASSERT_EQUAL(9, (int)pSecAttr->mnEnd);
+        CPPUNIT_ASSERT_EQUAL(1, (int)pSecAttr->maAttributes.size());
         CPPUNIT_ASSERT_MESSAGE("This section must be italic.", hasItalic(*pSecAttr));
     }
 
@@ -452,37 +452,37 @@ void Test::testSectionAttributes()
 
         // 1st, 3rd and 5th sections should correspond with 1st, 3rd and 5th paragraphs.
         const editeng::Section* pSecAttr = &aAttrs[0];
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnParagraph);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnStart);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pSecAttr->mnEnd);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pSecAttr->maAttributes.size());
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnParagraph);
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnStart);
+        CPPUNIT_ASSERT_EQUAL(3, (int)pSecAttr->mnEnd);
+        CPPUNIT_ASSERT_EQUAL(1, (int)pSecAttr->maAttributes.size());
         CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(*pSecAttr));
 
         pSecAttr = &aAttrs[2];
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), pSecAttr->mnParagraph);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnStart);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pSecAttr->mnEnd);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pSecAttr->maAttributes.size());
+        CPPUNIT_ASSERT_EQUAL(2, (int)pSecAttr->mnParagraph);
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnStart);
+        CPPUNIT_ASSERT_EQUAL(3, (int)pSecAttr->mnEnd);
+        CPPUNIT_ASSERT_EQUAL(1, (int)pSecAttr->maAttributes.size());
         CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(*pSecAttr));
 
         pSecAttr = &aAttrs[4];
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), pSecAttr->mnParagraph);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnStart);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(5), pSecAttr->mnEnd);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pSecAttr->maAttributes.size());
+        CPPUNIT_ASSERT_EQUAL(4, (int)pSecAttr->mnParagraph);
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnStart);
+        CPPUNIT_ASSERT_EQUAL(5, (int)pSecAttr->mnEnd);
+        CPPUNIT_ASSERT_EQUAL(1, (int)pSecAttr->maAttributes.size());
         CPPUNIT_ASSERT_MESSAGE("This section must be bold.", hasBold(*pSecAttr));
 
         // The 2nd and 4th paragraphs should be empty.
         pSecAttr = &aAttrs[1];
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pSecAttr->mnParagraph);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnStart);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnEnd);
+        CPPUNIT_ASSERT_EQUAL(1, (int)pSecAttr->mnParagraph);
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnStart);
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnEnd);
         CPPUNIT_ASSERT_MESSAGE("Attribute array should be empty.", pSecAttr->maAttributes.empty());
 
         pSecAttr = &aAttrs[3];
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), pSecAttr->mnParagraph);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnStart);
-        CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), pSecAttr->mnEnd);
+        CPPUNIT_ASSERT_EQUAL(3, (int)pSecAttr->mnParagraph);
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnStart);
+        CPPUNIT_ASSERT_EQUAL(0, (int)pSecAttr->mnEnd);
         CPPUNIT_ASSERT_MESSAGE("Attribute array should be empty.", pSecAttr->maAttributes.empty());
     }
 }
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 001389b..7fc3f53 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -217,7 +217,7 @@ namespace accessibility
 
         rBoundary.startPos = rBoundary.endPos = -1;
 
-        const sal_uInt16 nLineCount=rCacheTF.GetLineCount( nParaIndex );
+        const sal_Int32 nLineCount=rCacheTF.GetLineCount( nParaIndex );
 
         if( nIndex == nTextLen )
         {
@@ -233,7 +233,7 @@ namespace accessibility
         else
         {
             // normal line search
-            sal_uInt16 nLine;
+            sal_Int32 nLine;
             sal_Int32 nCurIndex;
             for( nLine=0, nCurIndex=0; nLine<nLineCount; ++nLine )
             {
@@ -650,9 +650,9 @@ namespace accessibility
         }
     }
 
-    sal_Bool AccessibleEditableTextPara::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nIndex )
+    sal_Bool AccessibleEditableTextPara::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nIndex )
     {
-        DBG_ASSERT(nIndex >= 0 && nIndex <= USHRT_MAX,
+        DBG_ASSERT(nIndex >= 0 && nIndex <= SAL_MAX_INT32,
                    "AccessibleEditableTextPara::GetAttributeRun: index value overflow");
 
         DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= SAL_MAX_INT32,
@@ -1398,7 +1398,7 @@ namespace accessibility
         SolarMutexGuard aGuard;
 
         sal_Int32 nPara;
-        sal_uInt16 nIndex;
+        sal_Int32 nIndex;
 
         // offset from surrounding cell/shape
         Point aOffset( GetEEOffset() );
@@ -1821,7 +1821,7 @@ namespace accessibility
                 }
                 else
                 {
-                    sal_uInt16 nStartIndex, nEndIndex;
+                    sal_Int32 nStartIndex, nEndIndex;
                     //For the bullet paragraph, the bullet string is ingnored for IAText::attributes() function.
                     SvxTextForwarder&   rCacheTF = GetTextForwarder();
                     // MT IA2: Not used? sal_Int32 nBulletLen = 0;
@@ -1852,7 +1852,7 @@ namespace accessibility
                 CheckPosition(nIndex);
         if (nIndex != 0  && nIndex == getCharacterCount())
             --nIndex;
-                sal_uInt16 nLine, nLineCount=rCacheTF.GetLineCount( nParaIndex );
+                sal_Int32 nLine, nLineCount=rCacheTF.GetLineCount( nParaIndex );
                 sal_Int32 nCurIndex;
                 //the problem is that rCacheTF.GetLineLen() will include the bullet length. But for the bullet line,
                 //the text value doesn't contain the bullet characters. all of the bullet and numbering info are exposed
@@ -1921,7 +1921,7 @@ namespace accessibility
             case AccessibleTextType::ATTRIBUTE_RUN:
             {
                 const sal_Int32 nTextLen = GetTextForwarder().GetTextLen( GetParagraphIndex() );
-                sal_uInt16 nStartIndex, nEndIndex;
+                sal_Int32 nStartIndex, nEndIndex;
 
                 if( nIndex == nTextLen )
                 {
@@ -1958,7 +1958,7 @@ namespace accessibility
 
                 CheckPosition(nIndex);
 
-                sal_uInt16 nLine, nLineCount=rCacheTF.GetLineCount( static_cast< sal_uInt16 >( nParaIndex ) );
+                sal_Int32 nLine, nLineCount=rCacheTF.GetLineCount( nParaIndex );
                 //the problem is that rCacheTF.GetLineLen() will include the bullet length. But for the bullet line,
                 //the text value doesn't contain the bullet characters. all of the bullet and numbering info are exposed
                 //by the IAText::attributes(). So here must do special support for bullet line.
@@ -1981,7 +1981,7 @@ namespace accessibility
                         nLastLineLen = nCurLineLen - nBulletLen;
                     else
                         nLastLineLen = nCurLineLen;
-                    nCurLineLen = rCacheTF.GetLineLen(static_cast< sal_uInt16 >( nParaIndex ), nLine);
+                    nCurLineLen = rCacheTF.GetLineLen( nParaIndex, nLine);
                     //nCurIndex += nCurLineLen;
                     if (nLine == 0)
                         nCurIndex += nCurLineLen - nBulletLen;
@@ -2083,7 +2083,7 @@ namespace accessibility
         {
             case AccessibleTextType::ATTRIBUTE_RUN:
             {
-                sal_uInt16 nStartIndex, nEndIndex;
+                sal_Int32 nStartIndex, nEndIndex;
 
                 if( GetAttributeRun(nStartIndex, nEndIndex, nIndex) )
                 {
@@ -2109,7 +2109,7 @@ namespace accessibility
 
                 CheckPosition(nIndex);
 
-                sal_uInt16 nLine, nLineCount=rCacheTF.GetLineCount( static_cast< sal_uInt16 >( nParaIndex ) );
+                sal_Int32 nLine, nLineCount = rCacheTF.GetLineCount( nParaIndex );
                 sal_Int32 nCurIndex;
                 //the problem is that rCacheTF.GetLineLen() will include the bullet length. But for the bullet line,
                 //the text value doesn't contain the bullet characters. all of the bullet and numbering info are exposed
@@ -2128,7 +2128,7 @@ namespace accessibility
                         }
                     }
                     //nCurIndex += rCacheTF.GetLineLen(static_cast< sal_uInt16 >( nParaIndex ), nLine);
-                    sal_Int32 nLineLen = rCacheTF.GetLineLen( static_cast< sal_uInt16 >( nParaIndex ), nLine);
+                    sal_Int32 nLineLen = rCacheTF.GetLineLen( nParaIndex, nLine);
 
                     if (nLine == 0)
                         nCurIndex += nLineLen - nBulletLen;
@@ -2139,7 +2139,7 @@ namespace accessibility
                         nLine < nLineCount-1 )
                     {
                         aResult.SegmentStart = nCurIndex;
-                        aResult.SegmentEnd = nCurIndex + rCacheTF.GetLineLen(static_cast< sal_uInt16 >( nParaIndex ), nLine+1);
+                        aResult.SegmentEnd = nCurIndex + rCacheTF.GetLineLen( nParaIndex, nLine+1);
                         aResult.SegmentText = GetTextRange( aResult.SegmentStart + nBulletLen, aResult.SegmentEnd + nBulletLen);
                         break;
                     }
@@ -2780,7 +2780,7 @@ namespace accessibility
         {
             // we explicitly allow for the index to point at the character right behind the text
             if (0 <= nIndex && nIndex <= rCacheTF.GetTextLen( nPara ))
-                nRes = rCacheTF.GetLineNumberAtIndex( nPara, static_cast< sal_uInt16 >(nIndex) );
+                nRes = rCacheTF.GetLineNumberAtIndex( nPara, nIndex );
             else
                 throw lang::IndexOutOfBoundsException();
         }
@@ -2800,9 +2800,9 @@ namespace accessibility
         {
             if (0 <= nLineNo && nLineNo < rCacheTF.GetLineCount( nPara ))
             {
-                sal_uInt16 nStart = 0, nEnd = 0;
-                rCacheTF.GetLineBoundaries( nStart, nEnd, nPara, static_cast< sal_uInt16 >(nLineNo) );
-                if (nStart != 0xFFFF && nEnd != 0xFFFF)
+                sal_Int32 nStart = 0, nEnd = 0;
+                rCacheTF.GetLineBoundaries( nStart, nEnd, nPara, nLineNo );
+                if (nStart >= 0 && nEnd >=  0)
                 {
                     try
                     {
diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
index d7fa158..74dfa9f 100644
--- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
@@ -926,7 +926,7 @@ namespace accessibility
         else if ( AccessibleTextType::ATTRIBUTE_RUN == aTextType )
         {
               SvxAccessibleTextAdapter& rTextForwarder = mpImpl->GetParagraph( aPos.nIndex ).GetTextForwarder();
-              sal_uInt16 nStartIndex, nEndIndex;
+              sal_Int32 nStartIndex, nEndIndex;
               if ( rTextForwarder.GetAttributeRun( nStartIndex, nEndIndex, aPos.nPara, aPos.nIndex, sal_True ) )
               {
                      aResult.SegmentText = getTextRange( nStartIndex, nEndIndex );
diff --git a/editeng/source/editeng/editattr.hxx b/editeng/source/editeng/editattr.hxx
index 3917427..035efda 100644
--- a/editeng/source/editeng/editattr.hxx
+++ b/editeng/source/editeng/editattr.hxx
@@ -117,28 +117,28 @@ inline sal_uInt16 EditCharAttrib::GetLen() const
 
 inline void EditCharAttrib::MoveForward( sal_uInt16 nDiff )
 {
-    DBG_ASSERT( ((long)nEnd + nDiff) <= 0xFFFF, "EditCharAttrib: MoveForward?!" );
+    DBG_ASSERT( SAL_MAX_INT32 - nDiff > nEnd, "EditCharAttrib: MoveForward?!" );
     nStart = nStart + nDiff;
     nEnd = nEnd + nDiff;
 }
 
 inline void EditCharAttrib::MoveBackward( sal_uInt16 nDiff )
 {
-    DBG_ASSERT( ((long)nStart - nDiff) >= 0, "EditCharAttrib: MoveBackward?!" );
+    DBG_ASSERT( (nStart - nDiff) >= 0, "EditCharAttrib: MoveBackward?!" );
     nStart = nStart - nDiff;
     nEnd = nEnd - nDiff;
 }
 
 inline void EditCharAttrib::Expand( sal_uInt16 nDiff )
 {
-    DBG_ASSERT( ( ((long)nEnd + nDiff) <= (long)0xFFFF ), "EditCharAttrib: Expand?!" );
+    DBG_ASSERT( SAL_MAX_INT32 - nDiff > nEnd, "EditCharAttrib: Expand?!" );
     DBG_ASSERT( !bFeature, "Please do not expand any features!" );
     nEnd = nEnd + nDiff;
 }
 
 inline void EditCharAttrib::Collaps( sal_uInt16 nDiff )
 {
-    DBG_ASSERT( (long)nEnd - nDiff >= (long)nStart, "EditCharAttrib: Collaps?!" );
+    DBG_ASSERT( nEnd - nDiff >= nStart, "EditCharAttrib: Collaps?!" );
     DBG_ASSERT( !bFeature, "Please do not shrink any Features!" );
     nEnd = nEnd - nDiff;
 }
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index ed1ca6e..a857cb8 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -371,7 +371,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox )
         aPortionStr.append("\nA");
         aPortionStr.append(static_cast<sal_Int32>(nPortion));
         aPortionStr.append(": ");
-        sal_uLong n = 0;
+        sal_Int32 n = 0;
         for ( z = 0; z < nTextPortions; z++ )
         {
             TextPortion* pPortion = pPPortion->GetTextPortions()[z];
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index a581781..4732c62 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -252,7 +252,7 @@ const sal_uInt16 aV5Map[] = {
     4035, 4036, 4037, 4038
 };
 
-EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE )
+EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sal_Int32 nS, sal_Int32 nE )
 {
     // Create a new attribute in the pool
     const SfxPoolItem& rNew = rPool.Put( rAttr );
@@ -407,25 +407,25 @@ void TextPortionList::Reset()
     maPortions.clear();
 }
 
-void TextPortionList::DeleteFromPortion(size_t nDelFrom)
+void TextPortionList::DeleteFromPortion(sal_Int32 nDelFrom)
 {
-    DBG_ASSERT( ( nDelFrom < maPortions.size() ) || ( (nDelFrom == 0) && maPortions.empty() ), "DeleteFromPortion: Out of range" );
+    DBG_ASSERT( ( nDelFrom < (sal_Int32)maPortions.size() ) || ( (nDelFrom == 0) && maPortions.empty() ), "DeleteFromPortion: Out of range" );
     PortionsType::iterator it = maPortions.begin();
     std::advance(it, nDelFrom);
     maPortions.erase(it, maPortions.end());
 }
 
-size_t TextPortionList::Count() const
+sal_Int32 TextPortionList::Count() const
 {
-    return maPortions.size();
+    return (sal_Int32)maPortions.size();
 }
 
-const TextPortion* TextPortionList::operator[](size_t nPos) const
+const TextPortion* TextPortionList::operator[](sal_Int32 nPos) const
 {
     return &maPortions[nPos];
 }
 
-TextPortion* TextPortionList::operator[](size_t nPos)
+TextPortion* TextPortionList::operator[](sal_Int32 nPos)
 {
     return &maPortions[nPos];
 }
@@ -435,12 +435,12 @@ void TextPortionList::Append(TextPortion* p)
     maPortions.push_back(p);
 }
 
-void TextPortionList::Insert(size_t nPos, TextPortion* p)
+void TextPortionList::Insert(sal_Int32 nPos, TextPortion* p)
 {
     maPortions.insert(maPortions.begin()+nPos, p);
 }
 
-void TextPortionList::Remove(size_t nPos)
+void TextPortionList::Remove(sal_Int32 nPos)
 {
     maPortions.erase(maPortions.begin()+nPos);
 }
@@ -460,24 +460,24 @@ public:
 
 }
 
-size_t TextPortionList::GetPos(const TextPortion* p) const
+sal_Int32 TextPortionList::GetPos(const TextPortion* p) const
 {
     PortionsType::const_iterator it =
         std::find_if(maPortions.begin(), maPortions.end(), FindTextPortionByAddress(p));
 
     if (it == maPortions.end())
-        return std::numeric_limits<size_t>::max(); // not found.
+        return std::numeric_limits<sal_Int32>::max(); // not found.
 
     return std::distance(maPortions.begin(), it);
 }
 
-size_t TextPortionList::FindPortion(
-    sal_uInt16 nCharPos, sal_uInt16& nPortionStart, bool bPreferStartingPortion) const
+sal_Int32 TextPortionList::FindPortion(
+    sal_Int32 nCharPos, sal_Int32& nPortionStart, bool bPreferStartingPortion) const
 {
     // When nCharPos at portion limit, the left portion is found
-    sal_uInt16 nTmpPos = 0;
-    size_t n = maPortions.size();
-    for (size_t i = 0; i < n; ++i)
+    sal_Int32 nTmpPos = 0;
+    sal_Int32 n = maPortions.size();
+    for (sal_Int32 i = 0; i < n; ++i)
     {
         const TextPortion& rPortion = maPortions[i];
         nTmpPos = nTmpPos + rPortion.GetLen();
@@ -495,10 +495,10 @@ size_t TextPortionList::FindPortion(
     return n - 1;
 }
 
-sal_uInt16 TextPortionList::GetStartPos(size_t nPortion)
+sal_Int32 TextPortionList::GetStartPos(sal_Int32 nPortion)
 {
-    sal_uInt16 nPos = 0;
-    for (size_t i = 0; i < nPortion; ++i)
+    sal_Int32 nPos = 0;
+    for (sal_Int32 i = 0; i < nPortion; ++i)
     {
         const TextPortion& rPortion = maPortions[i];
         nPos = nPos + rPortion.GetLen();
@@ -524,7 +524,7 @@ ExtraPortionInfo::~ExtraPortionInfo()
     delete[] pOrgDXArray;
 }
 
-void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, sal_uInt16 nLen )
+void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, sal_Int32 nLen )
 {
     delete[] pOrgDXArray;
     pOrgDXArray = new sal_Int32[nLen];
@@ -551,7 +551,7 @@ ParaPortion::~ParaPortion()
 {
 }
 
-void ParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff )
+void ParaPortion::MarkInvalid( sal_Int32 nStart, sal_Int32 nDiff )
 {
     if ( bInvalid == sal_False )
     {
@@ -577,7 +577,7 @@ void ParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff )
         {
 //          nInvalidPosEnd = pNode->Len();
             DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" );
-            nInvalidPosStart = std::min( nInvalidPosStart, (sal_uInt16) ( nDiff < 0 ? nStart+nDiff : nDiff ) );
+            nInvalidPosStart = std::min( nInvalidPosStart, ( nDiff < 0 ? nStart+nDiff : nDiff ) );
             nInvalidDiff = 0;
             bSimple = sal_False;
         }
@@ -587,7 +587,7 @@ void ParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff )
     aWritingDirectionInfos.clear();
 }
 
-void ParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /* nEnd */ )
+void ParaPortion::MarkSelectionInvalid( sal_Int32 nStart, sal_Int32 /* nEnd */ )
 {
     if ( bInvalid == sal_False )
     {
@@ -606,15 +606,15 @@ void ParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /* nEnd */
     aWritingDirectionInfos.clear();
 }
 
-sal_uInt16 ParaPortion::GetLineNumber( sal_uInt16 nIndex ) const
+sal_Int32 ParaPortion::GetLineNumber( sal_Int32 nIndex ) const
 {
     DBG_ASSERTWARNING( aLineList.Count(), "Empty ParaPortion in GetLine!" );
     DBG_ASSERT( bVisible, "Why GetLine() on an invisible paragraph?" );
 
-    for ( sal_uInt16 nLine = 0; nLine < aLineList.Count(); nLine++ )
+    for ( sal_Int32 nLine = 0; nLine < aLineList.Count(); nLine++ )
     {
         if ( aLineList[nLine]->IsIn( nIndex ) )
-            return nLine;
+            return (sal_Int32)nLine;
     }
 
     // Then it should be at the end of the last line!
@@ -627,16 +627,16 @@ void ParaPortion::SetVisible( sal_Bool bMakeVisible )
     bVisible = bMakeVisible;
 }
 
-void ParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine )
+void ParaPortion::CorrectValuesBehindLastFormattedLine( sal_Int32 nLastFormattedLine )
 {
-    sal_uInt16 nLines = aLineList.Count();
+    sal_Int32 nLines = aLineList.Count();
     DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Empty Portion?" );
     if ( nLastFormattedLine < ( nLines - 1 ) )
     {
         const EditLine* pLastFormatted = aLineList[ nLastFormattedLine ];
         const EditLine* pUnformatted = aLineList[ nLastFormattedLine+1 ];
-        short nPortionDiff = pUnformatted->GetStartPortion() - pLastFormatted->GetEndPortion();
-        short nTextDiff = pUnformatted->GetStart() - pLastFormatted->GetEnd();
+        sal_Int32 nPortionDiff = pUnformatted->GetStartPortion() - pLastFormatted->GetEndPortion();
+        sal_Int32 nTextDiff = pUnformatted->GetStart() - pLastFormatted->GetEnd();
         nTextDiff++;    // LastFormatted->GetEnd() was included => 1 deducted too much!
 
         // The first unformatted must begin exactly one Portion behind the last
@@ -647,19 +647,15 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormatte
         int nTDiff = -( nTextDiff-1 );
         if ( nPDiff || nTDiff )
         {
-            for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ )
+            for ( sal_Int32 nL = nLastFormattedLine+1; nL < nLines; nL++ )
             {
                 EditLine* pLine = aLineList[ nL ];
 
-                pLine->GetStartPortion() = sal::static_int_cast< sal_uInt16 >(
-                    pLine->GetStartPortion() + nPDiff);
-                pLine->GetEndPortion() = sal::static_int_cast< sal_uInt16 >(
-                    pLine->GetEndPortion() + nPDiff);
+                pLine->GetStartPortion() = pLine->GetStartPortion() + nPDiff;
+                pLine->GetEndPortion() = pLine->GetEndPortion() + nPDiff;
 
-                pLine->GetStart() = sal::static_int_cast< sal_uInt16 >(
-                    pLine->GetStart() + nTDiff);
-                pLine->GetEnd() = sal::static_int_cast< sal_uInt16 >(
-                    pLine->GetEnd() + nTDiff);
+                pLine->GetStart() = pLine->GetStart() + nTDiff;
+                pLine->GetEnd() = pLine->GetEnd() + nTDiff;
 
                 pLine->SetValid();
             }
@@ -673,22 +669,22 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormatte
 namespace {
 
 template<typename _Array, typename _Val>
-size_t FastGetPos(const _Array& rArray, const _Val* p, size_t& rLastPos)
+sal_Int32 FastGetPos(const _Array& rArray, const _Val* p, sal_Int32& rLastPos)
 {
-    size_t nArrayLen = rArray.size();
+    sal_Int32 nArrayLen = rArray.size();
 
     // Through certain filter code-paths we do a lot of appends, which in
     // turn call GetPos - creating some N^2 nightmares. If we have a
     // non-trivially large list, do a few checks from the end first.
     if (rLastPos > 16 && nArrayLen > 16)
     {
-        size_t nEnd;
+        sal_Int32 nEnd;
         if (rLastPos > nArrayLen - 2)
             nEnd = nArrayLen;
         else
             nEnd = rLastPos + 2;
 
-        for (size_t nIdx = rLastPos - 2; nIdx < nEnd; ++nIdx)
+        for (sal_Int32 nIdx = rLastPos - 2; nIdx < nEnd; ++nIdx)
         {
             if (&rArray.at(nIdx) == p)
             {
@@ -698,7 +694,7 @@ size_t FastGetPos(const _Array& rArray, const _Val* p, size_t& rLastPos)
         }
     }
     // The world's lamest linear search from svarray ...
-    for (size_t nIdx = 0; nIdx < nArrayLen; ++nIdx)
+    for (sal_Int32 nIdx = 0; nIdx < nArrayLen; ++nIdx)
         if (&rArray.at(nIdx) == p)
             return rLastPos = nIdx;
 
@@ -723,17 +719,17 @@ sal_Int32 ParaPortionList::GetPos(const ParaPortion* p) const
 
 ParaPortion* ParaPortionList::operator [](sal_Int32 nPos)
 {
-    return 0 <= nPos && static_cast<size_t>(nPos) < maPortions.size() ? &maPortions[nPos] : NULL;
+    return 0 <= nPos && nPos < (sal_Int32)maPortions.size() ? &maPortions[nPos] : NULL;
 }
 
 const ParaPortion* ParaPortionList::operator [](sal_Int32 nPos) const
 {
-    return 0 <= nPos && static_cast<size_t>(nPos) < maPortions.size() ? &maPortions[nPos] : NULL;
+    return 0 <= nPos && nPos < (sal_Int32)maPortions.size() ? &maPortions[nPos] : NULL;
 }
 
 ParaPortion* ParaPortionList::Release(sal_Int32 nPos)
 {
-    if (nPos < 0 || maPortions.size() <= static_cast<size_t>(nPos))
+    if (nPos < 0 || (sal_Int32)maPortions.size() <= nPos)
     {
         SAL_WARN( "editeng", "ParaPortionList::Release - out of bounds pos " << nPos);
         return NULL;
@@ -743,7 +739,7 @@ ParaPortion* ParaPortionList::Release(sal_Int32 nPos)
 
 void ParaPortionList::Remove(sal_Int32 nPos)
 {
-    if (nPos < 0 || maPortions.size() <= static_cast<size_t>(nPos))
+    if (nPos < 0 || (sal_Int32)maPortions.size() <= nPos)
     {
         SAL_WARN( "editeng", "ParaPortionList::Remove - out of bounds pos " << nPos);
         return;
@@ -753,7 +749,7 @@ void ParaPortionList::Remove(sal_Int32 nPos)
 
 void ParaPortionList::Insert(sal_Int32 nPos, ParaPortion* p)
 {
-    if (nPos < 0 || maPortions.size() < static_cast<size_t>(nPos))
+    if (nPos < 0 || (sal_Int32)maPortions.size() < nPos)
     {
         SAL_WARN( "editeng", "ParaPortionList::Insert - out of bounds pos " << nPos);
         return;
@@ -768,7 +764,7 @@ void ParaPortionList::Append(ParaPortion* p)
 
 sal_Int32 ParaPortionList::Count() const
 {
-    size_t nSize = maPortions.size();
+    sal_Int32 nSize = maPortions.size();
     if (nSize > SAL_MAX_INT32)
     {
         SAL_WARN( "editeng", "ParaPortionList::Count - overflow " << nSize);
@@ -785,7 +781,7 @@ void ParaPortionList::Reset()
 long ParaPortionList::GetYOffset(const ParaPortion* pPPortion) const
 {
     long nHeight = 0;
-    for (size_t i = 0, n = maPortions.size(); i < n; ++i)
+    for (sal_Int32 i = 0, n = maPortions.size(); i < n; ++i)
     {
         const ParaPortion* pTmpPortion = &maPortions[i];
         if ( pTmpPortion == pPPortion )
@@ -799,7 +795,7 @@ long ParaPortionList::GetYOffset(const ParaPortion* pPPortion) const
 sal_Int32 ParaPortionList::FindParagraph(long nYOffset) const
 {
     long nY = 0;
-    for (size_t i = 0, n = maPortions.size(); i < n; ++i)
+    for (sal_Int32 i = 0, n = maPortions.size(); i < n; ++i)
     {
         nY += maPortions[i].GetHeight(); // should also be correct even in bVisible!
         if ( nY > nYOffset )
@@ -810,19 +806,19 @@ sal_Int32 ParaPortionList::FindParagraph(long nYOffset) const
 
 const ParaPortion* ParaPortionList::SafeGetObject(sal_Int32 nPos) const
 {
-    return 0 <= nPos && static_cast<size_t>(nPos) < maPortions.size() ? &maPortions[nPos] : NULL;
+    return 0 <= nPos && nPos < (sal_Int32)maPortions.size() ? &maPortions[nPos] : NULL;
 }
 
 ParaPortion* ParaPortionList::SafeGetObject(sal_Int32 nPos)
 {
-    return 0 <= nPos && static_cast<size_t>(nPos) < maPortions.size() ? &maPortions[nPos] : NULL;
+    return 0 <= nPos && nPos < (sal_Int32)maPortions.size() ? &maPortions[nPos] : NULL;
 }
 
 #if OSL_DEBUG_LEVEL > 2
 void ParaPortionList::DbgCheck( EditDoc& rDoc)
 {
     DBG_ASSERT( Count() == rDoc.Count(), "ParaPortionList::DbgCheck() - Count() unequal!" );
-    for ( sal_uInt16 i = 0; i < Count(); i++ )
+    for ( sal_Int32 i = 0; i < Count(); i++ )
     {
         DBG_ASSERT( SafeGetObject(i), "ParaPortionList::DbgCheck() - Null-Pointer in List!" );
         DBG_ASSERT( GetObject(i)->GetNode(), "ParaPortionList::DbgCheck() - Null-Pointer in List(2)!" );
@@ -1064,11 +1060,11 @@ Size EditLine::CalcTextSize( ParaPortion& rParaPortion )
     Size aTmpSz;
     TextPortion* pPortion;
 
-    sal_uInt16 nIndex = GetStart();
+    sal_Int32 nIndex = GetStart();
 
     DBG_ASSERT( rParaPortion.GetTextPortions().Count(), "GetTextSize before CreatePortions !" );
 
-    for ( sal_uInt16 n = nStartPortion; n <= nEndPortion; n++ )
+    for ( sal_Int32 n = nStartPortion; n <= nEndPortion; n++ )
     {
         pPortion = rParaPortion.GetTextPortions()[n];
         switch ( pPortion->GetKind() )
@@ -1110,18 +1106,18 @@ void EditLineList::Reset()
     maLines.clear();
 }
 
-void EditLineList::DeleteFromLine(size_t nDelFrom)
+void EditLineList::DeleteFromLine(sal_Int32 nDelFrom)
 {
-    DBG_ASSERT( nDelFrom <= (maLines.size() - 1), "DeleteFromLine: Out of range" );
+    DBG_ASSERT( nDelFrom <= ((sal_Int32)maLines.size() - 1), "DeleteFromLine: Out of range" );
     LinesType::iterator it = maLines.begin();
     std::advance(it, nDelFrom);
     maLines.erase(it, maLines.end());
 }
 
-size_t EditLineList::FindLine(sal_uInt16 nChar, bool bInclEnd)
+sal_Int32 EditLineList::FindLine(sal_Int32 nChar, bool bInclEnd)
 {
-    size_t n = maLines.size();
-    for (size_t i = 0; i < n; ++i)
+    sal_Int32 n = maLines.size();
+    for (sal_Int32 i = 0; i < n; ++i)
     {
         const EditLine& rLine = maLines[i];
         if ( (bInclEnd && (rLine.GetEnd() >= nChar)) ||
@@ -1135,17 +1131,17 @@ size_t EditLineList::FindLine(sal_uInt16 nChar, bool bInclEnd)
     return n - 1;
 }
 
-size_t EditLineList::Count() const
+sal_Int32 EditLineList::Count() const
 {
     return maLines.size();
 }
 
-const EditLine* EditLineList::operator[](size_t nPos) const
+const EditLine* EditLineList::operator[](sal_Int32 nPos) const
 {
     return &maLines[nPos];
 }
 
-EditLine* EditLineList::operator[](size_t nPos)
+EditLine* EditLineList::operator[](sal_Int32 nPos)
 {
     return &maLines[nPos];
 }
@@ -1155,7 +1151,7 @@ void EditLineList::Append(EditLine* p)
     maLines.push_back(p);
 }
 
-void EditLineList::Insert(size_t nPos, EditLine* p)
+void EditLineList::Insert(sal_Int32 nPos, EditLine* p)
 {
     maLines.insert(maLines.begin()+nPos, p);
 }
@@ -1306,7 +1302,7 @@ ContentNode::~ContentNode()
 {
 }
 
-void ContentNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew, SfxItemPool& rItemPool )
+void ContentNode::ExpandAttribs( sal_Int32 nIndex, sal_Int32 nNew, SfxItemPool& rItemPool )
 {
     if ( !nNew )
         return;
@@ -1320,7 +1316,7 @@ void ContentNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew, SfxItemPool
     bool bResort = false;
     bool bExpandedEmptyAtIndexNull = false;
 
-    size_t nAttr = 0;
+    sal_Int32 nAttr = 0;
     CharAttribList::AttribsType& rAttribs = aCharAttribList.GetAttribs();
     EditCharAttrib* pAttrib = GetAttrib(rAttribs, nAttr);
     while ( pAttrib )
@@ -1442,7 +1438,7 @@ void ContentNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew, SfxItemPool
 #endif
 }
 
-void ContentNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted, SfxItemPool& rItemPool )
+void ContentNode::CollapsAttribs( sal_Int32 nIndex, sal_Int32 nDeleted, SfxItemPool& rItemPool )
 {
     if ( !nDeleted )
         return;
@@ -1451,9 +1447,9 @@ void ContentNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted, SfxIte
     // can also the order of the start list be change!
     bool bResort = false;
     bool bDelAttr = false;
-    sal_uInt16 nEndChanges = nIndex+nDeleted;
+    sal_Int32 nEndChanges = nIndex+nDeleted;
 
-    size_t nAttr = 0;
+    sal_Int32 nAttr = 0;
     CharAttribList::AttribsType& rAttribs = aCharAttribList.GetAttribs();
     EditCharAttrib* pAttrib = GetAttrib(rAttribs, nAttr);
     while ( pAttrib )
@@ -1534,9 +1530,9 @@ void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool,
 {
     DBG_ASSERT( pPrevNode, "Copy of attributes to a null pointer?" );
 
-    sal_uInt16 nCut = pPrevNode->Len();
+    sal_Int32 nCut = pPrevNode->Len();
 
-    size_t nAttr = 0;
+    sal_Int32 nAttr = 0;
     CharAttribList::AttribsType& rPrevAttribs = pPrevNode->GetCharAttribs().GetAttribs();
     EditCharAttrib* pAttrib = GetAttrib(rPrevAttribs, nAttr);
     while ( pAttrib )
@@ -1586,13 +1582,13 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode )
 {
     DBG_ASSERT( pNextNode, "Copy of attributes to a null pointer?" );
 
-    sal_uInt16 nNewStart = maString.getLength();
+    sal_Int32 nNewStart = maString.getLength();
 
 #if OSL_DEBUG_LEVEL > 2
     OSL_ENSURE( aCharAttribList.DbgCheckAttribs(), "Attribute before AppendAttribs broken" );
 #endif
 
-    size_t nAttr = 0;
+    sal_Int32 nAttr = 0;
     CharAttribList::AttribsType& rNextAttribs = pNextNode->GetCharAttribs().GetAttribs();
     EditCharAttrib* pAttrib = GetAttrib(rNextAttribs, nAttr);
     while ( pAttrib )
@@ -1602,7 +1598,7 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode )
         if ( ( pAttrib->GetStart() == 0 ) && ( !pAttrib->IsFeature() ) )
         {
             // Attributes can possibly be summarized as:
-            size_t nTmpAttr = 0;
+            sal_Int32 nTmpAttr = 0;
             EditCharAttrib* pTmpAttrib = GetAttrib( aCharAttribList.GetAttribs(), nTmpAttr );
             while ( !bMelted && pTmpAttrib )
             {
@@ -1671,12 +1667,12 @@ void ContentNode::SetStyleSheet( SfxStyleSheet* pS, sal_Bool bRecalcFont )
         CreateDefFont();
 }
 
-bool ContentNode::IsFeature( sal_uInt16 nPos ) const
+bool ContentNode::IsFeature( sal_Int32 nPos ) const
 {
     return maString[nPos] == CH_FEATURE;
 }
 
-sal_uInt16 ContentNode::Len() const
+sal_Int32 ContentNode::Len() const
 {
     return maString.getLength();
 }
@@ -1686,12 +1682,12 @@ const OUString& ContentNode::GetString() const
     return maString;
 }
 
-void ContentNode::SetChar(sal_uInt16 nPos, sal_Unicode c)
+void ContentNode::SetChar(sal_Int32 nPos, sal_Unicode c)
 {
     maString = maString.replaceAt(nPos, 1, OUString(c));
 }
 
-void ContentNode::Insert(const OUString& rStr, sal_uInt16 nPos)
+void ContentNode::Insert(const OUString& rStr, sal_Int32 nPos)
 {
     maString = maString.replaceAt(nPos, 0, rStr);
 }
@@ -1701,27 +1697,27 @@ void ContentNode::Append(const OUString& rStr)
     maString += rStr;
 }
 
-void ContentNode::Erase(sal_uInt16 nPos)
+void ContentNode::Erase(sal_Int32 nPos)
 {
     maString = maString.copy(0, nPos);
 }
 
-void ContentNode::Erase(sal_uInt16 nPos, sal_uInt16 nCount)
+void ContentNode::Erase(sal_Int32 nPos, sal_Int32 nCount)
 {
     maString = maString.replaceAt(nPos, nCount, "");
 }
 
-OUString ContentNode::Copy(sal_uInt16 nPos) const
+OUString ContentNode::Copy(sal_Int32 nPos) const
 {
     return maString.copy(nPos);
 }
 
-OUString ContentNode::Copy(sal_uInt16 nPos, sal_uInt16 nCount) const
+OUString ContentNode::Copy(sal_Int32 nPos, sal_Int32 nCount) const
 {
     return maString.copy(nPos, nCount);
 }
 
-sal_Unicode ContentNode::GetChar(sal_uInt16 nPos) const
+sal_Unicode ContentNode::GetChar(sal_Int32 nPos) const
 {
     return maString[nPos];
 }
@@ -1846,7 +1842,7 @@ const SfxPoolItem* ItemList::First()
 
 const SfxPoolItem* ItemList::Next()
 {
-    if ( CurrentItem + 1 < aItemPool.size() )
+    if ( CurrentItem + 1 < (sal_Int32)aItemPool.size() )
     {
         ++CurrentItem;
         return aItemPool[ CurrentItem ];
@@ -1911,7 +1907,7 @@ void EditDoc::ImplDestroyContents()
 
 void EditDoc::RemoveItemsFromPool(const ContentNode& rNode)
 {
-    for (size_t nAttr = 0; nAttr < rNode.GetCharAttribs().Count(); ++nAttr)
+    for (sal_Int32 nAttr = 0; nAttr < rNode.GetCharAttribs().Count(); ++nAttr)
     {
         const EditCharAttrib& rAttr = rNode.GetCharAttribs().GetAttribs()[nAttr];
         GetItemPool().Remove(*rAttr.GetItem());
@@ -2016,12 +2012,12 @@ sal_Int32 EditDoc::GetPos(const ContentNode* p) const
 
 const ContentNode* EditDoc::GetObject(sal_Int32 nPos) const
 {
-    return 0 <= nPos && static_cast<size_t>(nPos) < maContents.size() ? &maContents[nPos] : NULL;
+    return 0 <= nPos && nPos < (sal_Int32)maContents.size() ? &maContents[nPos] : NULL;
 }
 
 ContentNode* EditDoc::GetObject(sal_Int32 nPos)
 {
-    return 0 <= nPos && static_cast<size_t>(nPos) < maContents.size() ? &maContents[nPos] : NULL;
+    return 0 <= nPos && nPos < (sal_Int32)maContents.size() ? &maContents[nPos] : NULL;
 }
 
 const ContentNode* EditDoc::operator[](sal_Int32 nPos) const
@@ -2046,7 +2042,7 @@ void EditDoc::Insert(sal_Int32 nPos, ContentNode* p)
 
 void EditDoc::Remove(sal_Int32 nPos)
 {
-    if (nPos < 0 || static_cast<size_t>(nPos) >= maContents.size())
+    if (nPos < 0 || nPos >= (sal_Int32)maContents.size())
     {
         SAL_WARN( "editeng", "EditDoc::Remove - out of bounds pos " << nPos);
         return;
@@ -2056,7 +2052,7 @@ void EditDoc::Remove(sal_Int32 nPos)
 
 void EditDoc::Release(sal_Int32 nPos)
 {
-    if (nPos < 0 || static_cast<size_t>(nPos) >= maContents.size())
+    if (nPos < 0 || nPos >= (sal_Int32)maContents.size())
     {
         SAL_WARN( "editeng", "EditDoc::Release - out of bounds pos " << nPos);
         return;
@@ -2066,13 +2062,13 @@ void EditDoc::Release(sal_Int32 nPos)
 
 sal_Int32 EditDoc::Count() const
 {
-    size_t nSize = maContents.size();
+    sal_Int32 nSize = maContents.size();
     if (nSize > SAL_MAX_INT32)
     {
         SAL_WARN( "editeng", "EditDoc::Count - overflow " << nSize);
         return SAL_MAX_INT32;
     }
-    return static_cast<sal_Int32>(nSize);
+    return nSize;
 }
 
 OUString EditDoc::GetSepStr( LineEnd eEnd )
@@ -2121,19 +2117,19 @@ OUString EditDoc::GetParaAsString( sal_Int32 nNode ) const
 }
 
 OUString EditDoc::GetParaAsString(
-    const ContentNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, bool bResolveFields) const
+    const ContentNode* pNode, sal_Int32 nStartPos, sal_Int32 nEndPos, bool bResolveFields) const
 {
-    if ( nEndPos > pNode->Len() )
+    if ( nEndPos < 0 || nEndPos > pNode->Len() )
         nEndPos = pNode->Len();
 
     DBG_ASSERT( nStartPos <= nEndPos, "Start and End reversed?" );
 
-    sal_uInt16 nIndex = nStartPos;
+    sal_Int32 nIndex = nStartPos;
     OUString aStr;
     const EditCharAttrib* pNextFeature = pNode->GetCharAttribs().FindFeature( nIndex );
     while ( nIndex < nEndPos )
     {
-        sal_uInt16 nEnd = nEndPos;
+        sal_Int32 nEnd = nEndPos;
         if ( pNextFeature && ( pNextFeature->GetStart() < nEnd ) )
             nEnd = pNextFeature->GetStart();
         else
@@ -2186,7 +2182,7 @@ sal_uLong EditDoc::GetTextLen() const
         nLen += pNode->Len();
         // Fields can be longer than the placeholder in the Node
         const CharAttribList::AttribsType& rAttrs = pNode->GetCharAttribs().GetAttribs();
-        for (size_t nAttr = rAttrs.size(); nAttr; )
+        for (sal_Int32 nAttr = rAttrs.size(); nAttr; )
         {
             const EditCharAttrib& rAttr = rAttrs[--nAttr];
             if (rAttr.Which() == EE_FEATURE_FIELD)
@@ -2349,7 +2345,7 @@ EditPaM EditDoc::ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight )
     return aPaM;
 }
 
-EditPaM EditDoc::RemoveChars( EditPaM aPaM, sal_uInt16 nChars )
+EditPaM EditDoc::RemoveChars( EditPaM aPaM, sal_Int32 nChars )
 {
     // Maybe remove Features!
     aPaM.GetNode()->Erase( aPaM.GetIndex(), nChars );
@@ -2360,7 +2356,7 @@ EditPaM EditDoc::RemoveChars( EditPaM aPaM, sal_uInt16 nChars )
     return aPaM;
 }
 
-void EditDoc::InsertAttribInSelection( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem )
+void EditDoc::InsertAttribInSelection( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, const SfxPoolItem& rPoolItem )
 {
     DBG_ASSERT( pNode, "What to do with the attribute?" );
     DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribute to large!" );
@@ -2397,14 +2393,14 @@ void EditDoc::InsertAttribInSelection( ContentNode* pNode, sal_uInt16 nStart, sa
     SetModified(true);
 }
 
-sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nWhich )
+sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt16 nWhich )
 {
     EditCharAttrib* pStarting;
     EditCharAttrib* pEnding;
     return RemoveAttribs( pNode, nStart, nEnd, pStarting, pEnding, nWhich );
 }
 
-sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich )
+sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich )
 {
 
     DBG_ASSERT( pNode, "What to do with the attribute?" );
@@ -2420,7 +2416,7 @@ sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt
     DBG_ASSERT( nStart <= nEnd, "Small miscalculations in InsertAttribInSelection" );
 
     // iterate over the attributes ...
-    size_t nAttr = 0;
+    sal_Int32 nAttr = 0;
     CharAttribList::AttribsType& rAttribs = pNode->GetCharAttribs().GetAttribs();
     EditCharAttrib* pAttr = GetAttrib(rAttribs, nAttr);
     while ( pAttr )
@@ -2482,7 +2478,7 @@ sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt
                 }
                 else // Attribute must be split ...
                 {
-                    sal_uInt16 nOldEnd = pAttr->GetEnd();
+                    sal_Int32 nOldEnd = pAttr->GetEnd();
                     pAttr->GetEnd() = nStart;
                     rpEnding = pAttr;
                     InsertAttrib( *pAttr->GetItem(), pNode, nEnd, nOldEnd );
@@ -2513,7 +2509,7 @@ sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt
     return bChanged;
 }
 
-void EditDoc::InsertAttrib( const SfxPoolItem& rPoolItem, ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd )
+void EditDoc::InsertAttrib( const SfxPoolItem& rPoolItem, ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd )
 {
     // This method no longer checks whether a corresponding attribute already
     // exists at this place!
@@ -2524,7 +2520,7 @@ void EditDoc::InsertAttrib( const SfxPoolItem& rPoolItem, ContentNode* pNode, sa
     SetModified( true );
 }
 
-void EditDoc::InsertAttrib( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem )
+void EditDoc::InsertAttrib( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, const SfxPoolItem& rPoolItem )
 {
     if ( nStart != nEnd )
     {
@@ -2548,7 +2544,7 @@ void EditDoc::InsertAttrib( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nE
             if ( pAttr->IsInside( nStart ) )    // split
             {
                 // check again if really splitting, or return !
-                sal_uInt16 nOldEnd = pAttr->GetEnd();
+                sal_Int32 nOldEnd = pAttr->GetEnd();
                 pAttr->GetEnd() = nStart;
                 EditCharAttrib* pNew = MakeCharAttrib( GetItemPool(), *(pAttr->GetItem()), nStart, nOldEnd );
                 rAttrList.InsertAttrib(pNew);
@@ -2567,7 +2563,7 @@ void EditDoc::InsertAttrib( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nE
     SetModified( true );
 }
 
-void EditDoc::FindAttribs( ContentNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet )
+void EditDoc::FindAttribs( ContentNode* pNode, sal_Int32 nStartPos, sal_Int32 nEndPos, SfxItemSet& rCurSet )
 {
     DBG_ASSERT( pNode, "Where to search?" );
     DBG_ASSERT( nStartPos <= nEndPos, "Invalid region!" );
@@ -2707,12 +2703,12 @@ void CharAttribList::InsertAttrib( EditCharAttrib* pAttrib )
     // (InsertBinTextObject!) binary search would not be optimal here.
     // => Would bring something!
 
-    const sal_uInt16 nStart = pAttrib->GetStart(); // may be better for Comp.Opt.
+    const sal_Int32 nStart = pAttrib->GetStart(); // may be better for Comp.Opt.
 
     if ( pAttrib->IsEmpty() )
         bHasEmptyAttribs = true;
 
-    for (size_t i = 0, n = aAttribs.size(); i < n; ++i)
+    for (sal_Int32 i = 0, n = aAttribs.size(); i < n; ++i)
     {
         const EditCharAttrib& rCurAttrib = aAttribs[i];
         if (rCurAttrib.GetStart() > nStart)
@@ -2732,10 +2728,10 @@ void CharAttribList::ResortAttribs()
 
 void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool )
 {
-    for (size_t i = 0; i < aAttribs.size(); ++i)
+    for (sal_Int32 i = 0; i < (sal_Int32)aAttribs.size(); ++i)
     {
         EditCharAttrib& rAttr = aAttribs[i];
-        for (size_t nNext = i+1; nNext < aAttribs.size(); ++nNext)
+        for (sal_Int32 nNext = i+1; nNext < (sal_Int32)aAttribs.size(); ++nNext)
         {
             EditCharAttrib& rNext = aAttribs[nNext];
             if (!rAttr.IsFeature() && rNext.GetStart() == rAttr.GetEnd() && rNext.Which() == rAttr.Which())
@@ -2756,12 +2752,12 @@ void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool )
     }
 }
 
-size_t CharAttribList::Count() const
+sal_Int32 CharAttribList::Count() const
 {
     return aAttribs.size();
 }
 
-const EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) const
+const EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos ) const
 {
     // Backwards, if one ends where the next starts.
     // => The starting one is the valid one ...
@@ -2775,7 +2771,7 @@ const EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16
     return NULL;
 }
 
-EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
+EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos )
 {
     // Backwards, if one ends where the next starts.
     // => The starting one is the valid one ...
@@ -2789,7 +2785,7 @@ EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
     return NULL;
 }
 
-const EditCharAttrib* CharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos ) const
+const EditCharAttrib* CharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_Int32 nFromPos ) const
 {
     DBG_ASSERT( nWhich, "FindNextAttrib: Which?" );
     AttribsType::const_iterator it = aAttribs.begin(), itEnd = aAttribs.end();
@@ -2802,7 +2798,7 @@ const EditCharAttrib* CharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_uIn
     return NULL;
 }
 
-bool CharAttribList::HasAttrib( sal_uInt16 nStartPos, sal_uInt16 nEndPos ) const
+bool CharAttribList::HasAttrib( sal_Int32 nStartPos, sal_Int32 nEndPos ) const
 {
     AttribsType::const_reverse_iterator it = aAttribs.rbegin(), itEnd = aAttribs.rend();
     for (; it != itEnd; ++it)
@@ -2846,9 +2842,9 @@ void CharAttribList::Remove(const EditCharAttrib* p)
         aAttribs.erase(it);
 }
 
-void CharAttribList::Remove(size_t nPos)
+void CharAttribList::Remove(sal_Int32 nPos)
 {
-    if (nPos >= aAttribs.size())
+    if (nPos >= (sal_Int32)aAttribs.size())
         return;
 
     aAttribs.erase(aAttribs.begin()+nPos);
@@ -2866,7 +2862,7 @@ void CharAttribList::SetHasEmptyAttribs(bool b)
     bHasEmptyAttribs = b;
 }
 
-bool CharAttribList::HasBoundingAttrib( sal_uInt16 nBound ) const
+bool CharAttribList::HasBoundingAttrib( sal_Int32 nBound ) const
 {
     // Backwards, if one ends where the next starts.
     // => The starting one is the valid one ...
@@ -2883,7 +2879,7 @@ bool CharAttribList::HasBoundingAttrib( sal_uInt16 nBound ) const
     return false;
 }
 
-const EditCharAttrib* CharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) const
+const EditCharAttrib* CharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_Int32 nPos ) const
 {
     if ( !bHasEmptyAttribs )
         return NULL;
@@ -2898,7 +2894,7 @@ const EditCharAttrib* CharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uI
     return NULL;
 }
 
-EditCharAttrib* CharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
+EditCharAttrib* CharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_Int32 nPos )
 {
     if ( !bHasEmptyAttribs )
         return NULL;
@@ -2917,9 +2913,9 @@ namespace {
 
 class FindByStartPos : std::unary_function<EditCharAttrib, bool>
 {
-    sal_uInt16 mnPos;
+    sal_Int32 mnPos;
 public:
-    FindByStartPos(sal_uInt16 nPos) : mnPos(nPos) {}
+    FindByStartPos(sal_Int32 nPos) : mnPos(nPos) {}
     bool operator() (const EditCharAttrib& r) const
     {
         return r.GetStart() >= mnPos;
@@ -2928,7 +2924,7 @@ public:
 
 }
 
-const EditCharAttrib* CharAttribList::FindFeature( sal_uInt16 nPos ) const
+const EditCharAttrib* CharAttribList::FindFeature( sal_Int32 nPos ) const
 {
     // First, find the first attribute that starts at or after specified position.
     AttribsType::const_iterator it =
@@ -2996,23 +2992,23 @@ SvxColorList::SvxColorList()
 
 SvxColorList::~SvxColorList()
 {
-    for ( size_t i = 0, n = aColorList.size(); i < n; ++i )
+    for ( sal_Int32 i = 0, n = aColorList.size(); i < n; ++i )
         delete aColorList[ i ];
     aColorList.clear();
 }
 
-size_t SvxColorList::GetId( const SvxColorItem& rColorItem )
+sal_Int32 SvxColorList::GetId( const SvxColorItem& rColorItem )
 {
-    for ( size_t i = 0, n = aColorList.size(); i < n; ++i )
+    for ( sal_Int32 i = 0, n = aColorList.size(); i < n; ++i )
         if ( *aColorList[ i ] == rColorItem )
             return i;
     DBG_WARNING( "Color not found: GetId()" );
     return 0;
 }
 
-void SvxColorList::Insert( SvxColorItem* pItem, size_t nIndex )
+void SvxColorList::Insert( SvxColorItem* pItem, sal_Int32 nIndex )
 {
-    if ( nIndex >= aColorList.size() )
+    if ( nIndex >= (sal_Int32)aColorList.size() )
     {
         aColorList.push_back( pItem );
     }
@@ -3024,9 +3020,9 @@ void SvxColorList::Insert( SvxColorItem* pItem, size_t nIndex )
     }
 }
 
-SvxColorItem* SvxColorList::GetObject( size_t nIndex )
+SvxColorItem* SvxColorList::GetObject( sal_Int32 nIndex )
 {
-    return ( nIndex >= aColorList.size() ) ? NULL : aColorList[ nIndex ];
+    return ( nIndex >= (sal_Int32)aColorList.size() ) ? NULL : aColorList[ nIndex ];
 }
 
 EditEngineItemPool::EditEngineItemPool( sal_Bool bPersistenRefCounts )
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index 1c8bdf2..aa317f5 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -48,7 +48,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent =
 sal_uInt16 GetScriptItemId( sal_uInt16 nItemId, short nScriptType );
 sal_Bool IsScriptItemValid( sal_uInt16 nItemId, short nScriptType );
 
-EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE );
+EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sal_Int32 nS, sal_Int32 nE );
 
 class ContentNode;
 class EditDoc;
@@ -80,10 +80,10 @@ inline sal_Bool EPaM::operator == ( const EPaM& r ) const
 struct ScriptTypePosInfo
 {
     short   nScriptType;
-    sal_uInt16  nStartPos;
-    sal_uInt16  nEndPos;
+    sal_Int32  nStartPos;
+    sal_Int32  nEndPos;
 
-    ScriptTypePosInfo( short _Type, sal_uInt16 _Start, sal_uInt16 _End )
+    ScriptTypePosInfo( short _Type, sal_Int32 _Start, sal_Int32 _End )
     : nScriptType(_Type)
     , nStartPos(_Start)
     , nEndPos(_End)
@@ -96,10 +96,10 @@ typedef std::deque< ScriptTypePosInfo > ScriptTypePosInfos;
 struct WritingDirectionInfo
 {
     sal_uInt8   nType;
-    sal_uInt16  nStartPos;
-    sal_uInt16  nEndPos;
+    sal_Int32  nStartPos;
+    sal_Int32  nEndPos;
 
-    WritingDirectionInfo( sal_uInt8 _Type, sal_uInt16 _Start, sal_uInt16 _End )
+    WritingDirectionInfo( sal_uInt8 _Type, sal_Int32 _Start, sal_Int32 _End )
     : nType(_Type)
     , nStartPos(_Start)
     , nEndPos(_End)
@@ -142,10 +142,10 @@ public:
             SvxColorList();
             ~SvxColorList();
 
-    size_t  GetId( const SvxColorItem& rColor );
-    size_t  Count() { return aColorList.size(); };
-    void    Insert( SvxColorItem* pItem, size_t nIndex );
-    SvxColorItem* GetObject( size_t nIndex );
+    sal_Int32  GetId( const SvxColorItem& rColor );
+    sal_Int32  Count() { return aColorList.size(); };
+    void    Insert( SvxColorItem* pItem, sal_Int32 nIndex );
+    SvxColorItem* GetObject( sal_Int32 nIndex );
 };
 
 //  ----------------------------------------------------------------------
@@ -157,13 +157,13 @@ class ItemList
 private:
     typedef std::vector<const SfxPoolItem*> DummyItemList;
     DummyItemList aItemPool;
-    size_t  CurrentItem;
+    sal_Int32  CurrentItem;
 
 public:
     ItemList();
     const SfxPoolItem*  First();
     const SfxPoolItem*  Next();
-    size_t              Count() { return aItemPool.size(); };
+    sal_Int32              Count() { return aItemPool.size(); };
     void                Insert( const SfxPoolItem* pItem );
     void                Clear() { aItemPool.clear(); };
 };
@@ -215,18 +215,18 @@ public:
     void            DeleteEmptyAttribs(  SfxItemPool& rItemPool );
     void            RemoveItemsFromPool( SfxItemPool* pItemPool );
 
-    const EditCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) const;
-    EditCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos );
-    const EditCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos ) const;
-    const EditCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) const;
-    EditCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos );
-    const EditCharAttrib* FindFeature( sal_uInt16 nPos ) const;
+    const EditCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos ) const;
+    EditCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_Int32 nPos );
+    const EditCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_Int32 nFromPos ) const;
+    const EditCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_Int32 nPos ) const;
+    EditCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_Int32 nPos );
+    const EditCharAttrib* FindFeature( sal_Int32 nPos ) const;
 
 
     void            ResortAttribs();
     void            OptimizeRanges( SfxItemPool& rItemPool );
 
-    size_t Count() const;
+    sal_Int32 Count() const;
 
     void            InsertAttrib( EditCharAttrib* pAttrib );
 
@@ -234,14 +234,14 @@ public:
 
     bool            HasEmptyAttribs() const { return bHasEmptyAttribs; }
     void SetHasEmptyAttribs(bool b);
-    bool HasBoundingAttrib( sal_uInt16 nBound ) const;
-    bool HasAttrib( sal_uInt16 nStartPos, sal_uInt16 nEndPos ) const;
+    bool HasBoundingAttrib( sal_Int32 nBound ) const;
+    bool HasAttrib( sal_Int32 nStartPos, sal_Int32 nEndPos ) const;
 
     AttribsType& GetAttribs();
     const AttribsType& GetAttribs() const;
 
     void Remove(const EditCharAttrib* p);
-    void Remove(size_t nPos);
+    void Remove(sal_Int32 nPos);
     void Release(const EditCharAttrib* p);
 
 #if OSL_DEBUG_LEVEL > 2
@@ -271,8 +271,8 @@ public:
     CharAttribList& GetCharAttribs()        { return aCharAttribList; }
     const CharAttribList& GetCharAttribs() const { return aCharAttribList; }
 
-    void            ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNewChars, SfxItemPool& rItemPool );
-    void            CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDelChars, SfxItemPool& rItemPool );
+    void            ExpandAttribs( sal_Int32 nIndex, sal_Int32 nNewChars, SfxItemPool& rItemPool );
+    void            CollapsAttribs( sal_Int32 nIndex, sal_Int32 nDelChars, SfxItemPool& rItemPool );
     void            AppendAttribs( ContentNode* pNextNode );
     void            CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, sal_Bool bKeepEndingAttribs );
 
@@ -291,19 +291,19 @@ public:
     void            CreateWrongList();
     void            DestroyWrongList();
 
-    bool IsFeature( sal_uInt16 nPos ) const;
+    bool IsFeature( sal_Int32 nPos ) const;
 
-    sal_uInt16 Len() const;
+    sal_Int32 Len() const;
     const OUString& GetString() const;
 
-    void SetChar(sal_uInt16 nPos, sal_Unicode c);
-    void Insert(const OUString& rStr, sal_uInt16 nPos);
+    void SetChar(sal_Int32 nPos, sal_Unicode c);
+    void Insert(const OUString& rStr, sal_Int32 nPos);
     void Append(const OUString& rStr);
-    void Erase(sal_uInt16 nPos);
-    void Erase(sal_uInt16 nPos, sal_uInt16 nCount);
-    OUString Copy(sal_uInt16 nPos) const;
-    OUString Copy(sal_uInt16 nPos, sal_uInt16 nCount) const;
-    sal_Unicode GetChar(sal_uInt16 nPos) const;
+    void Erase(sal_Int32 nPos);
+    void Erase(sal_Int32 nPos, sal_Int32 nCount);
+    OUString Copy(sal_Int32 nPos) const;
+    OUString Copy(sal_Int32 nPos, sal_Int32 nCount) const;
+    sal_Unicode GetChar(sal_Int32 nPos) const;
 };
 
 // -------------------------------------------------------------------------
@@ -372,7 +372,7 @@ struct ExtraPortionInfo
             ExtraPortionInfo();
             ~ExtraPortionInfo();
 
-    void    SaveOrgDXArray( const sal_Int32* pDXArray, sal_uInt16 nLen );
+    void    SaveOrgDXArray( const sal_Int32* pDXArray, sal_Int32 nLen );
 };
 
 
@@ -383,7 +383,7 @@ class TextPortion
 {
 private:
     ExtraPortionInfo*   pExtraInfos;
-    sal_uInt16              nLen;
+    sal_Int32              nLen;
     Size                aOutSz;
     sal_uInt8               nKind;
     sal_uInt8                nRightToLeft;
@@ -401,7 +401,7 @@ private:
                 }
 
 public:
-                TextPortion( sal_uInt16 nL )
+                TextPortion( sal_Int32 nL )
                 : pExtraInfos( NULL )
                 , nLen( nL )
                 , aOutSz( -1, -1 )
@@ -422,8 +422,8 @@ public:
                 }
 
 
-    sal_uInt16      GetLen() const              { return nLen; }
-    void        SetLen( sal_uInt16 nL )         { nLen = nL; }
+    sal_Int32      GetLen() const              { return nLen; }
+    void        SetLen( sal_Int32 nL )         { nLen = nL; }
 
     Size&       GetSize()                   { return aOutSz; }
     const Size& GetSize() const             { return aOutSz; }
@@ -457,18 +457,18 @@ public:
             ~TextPortionList();
 
     void    Reset();
-    size_t FindPortion(
-        sal_uInt16 nCharPos, sal_uInt16& rPortionStart, bool bPreferStartingPortion = false) const;
-    sal_uInt16 GetStartPos(size_t nPortion);
-    void DeleteFromPortion(size_t nDelFrom);
-    size_t Count() const;
-    const TextPortion* operator[](size_t nPos) const;
-    TextPortion* operator[](size_t nPos);
+    sal_Int32 FindPortion(
+        sal_Int32 nCharPos, sal_Int32& rPortionStart, bool bPreferStartingPortion = false) const;
+    sal_Int32 GetStartPos(sal_Int32 nPortion);
+    void DeleteFromPortion(sal_Int32 nDelFrom);
+    sal_Int32 Count() const;
+    const TextPortion* operator[](sal_Int32 nPos) const;
+    TextPortion* operator[](sal_Int32 nPos);
 
     void Append(TextPortion* p);
-    void Insert(size_t nPos, TextPortion* p);
-    void Remove(size_t nPos);
-    size_t GetPos(const TextPortion* p) const;
+    void Insert(sal_Int32 nPos, TextPortion* p);
+    void Remove(sal_Int32 nPos);
+    sal_Int32 GetPos(const TextPortion* p) const;
 };
 
 class ParaPortion;
@@ -485,10 +485,10 @@ private:
     CharPosArrayType aPositions;
     long            nTxtWidth;
     sal_uInt16          nStartPosX;
-    sal_uInt16          nStart;     // could be replaced by nStartPortion
-    sal_uInt16          nEnd;       // could be replaced by nEndPortion
-    sal_uInt16          nStartPortion;
-    sal_uInt16          nEndPortion;
+    sal_Int32          nStart;     // could be replaced by nStartPortion
+    sal_Int32          nEnd;       // could be replaced by nEndPortion
+    sal_Int32          nStartPortion;
+    sal_Int32          nEndPortion;
     sal_uInt16          nHeight;    //  Total height of the line
     sal_uInt16          nTxtHeight; // Pure Text height
     sal_uInt16          nCrsrHeight;    // For contour flow high lines => cursor is large.
@@ -501,27 +501,27 @@ public:
                     EditLine( const EditLine& );
                     ~EditLine();
 
-    sal_Bool            IsIn( sal_uInt16 nIndex ) const
+    sal_Bool            IsIn( sal_Int32 nIndex ) const
                         { return ( (nIndex >= nStart ) && ( nIndex < nEnd ) ); }
 
-    sal_Bool            IsIn( sal_uInt16 nIndex, sal_Bool bInclEnd ) const
+    sal_Bool            IsIn( sal_Int32 nIndex, sal_Bool bInclEnd ) const
                         { return ( ( nIndex >= nStart ) && ( bInclEnd ? ( nIndex <= nEnd ) : ( nIndex < nEnd ) ) ); }
 
-    void            SetStart( sal_uInt16 n )            { nStart = n; }
-    sal_uInt16          GetStart() const                { return nStart; }
-    sal_uInt16&         GetStart()                      { return nStart; }
+    void            SetStart( sal_Int32 n )            { nStart = n; }
+    sal_Int32          GetStart() const                { return nStart; }
+    sal_Int32&         GetStart()                      { return nStart; }
 
-    void            SetEnd( sal_uInt16 n )              { nEnd = n; }
-    sal_uInt16          GetEnd() const                  { return nEnd; }
-    sal_uInt16&         GetEnd()                        { return nEnd; }
+    void            SetEnd( sal_Int32 n )              { nEnd = n; }
+    sal_Int32          GetEnd() const                  { return nEnd; }
+    sal_Int32&         GetEnd()                        { return nEnd; }
 
-    void            SetStartPortion( sal_uInt16 n )     { nStartPortion = n; }
-    sal_uInt16          GetStartPortion() const         { return nStartPortion; }
-    sal_uInt16&         GetStartPortion()               { return nStartPortion; }
+    void            SetStartPortion( sal_Int32 n )     { nStartPortion = n; }
+    sal_Int32          GetStartPortion() const         { return nStartPortion; }
+    sal_Int32&         GetStartPortion()               { return nStartPortion; }
 
-    void            SetEndPortion( sal_uInt16 n )       { nEndPortion = n; }
-    sal_uInt16          GetEndPortion() const           { return nEndPortion; }
-    sal_uInt16&         GetEndPortion()                 { return nEndPortion; }
+    void            SetEndPortion( sal_Int32 n )       { nEndPortion = n; }
+    sal_Int32          GetEndPortion() const           { return nEndPortion; }
+    sal_Int32&         GetEndPortion()                 { return nEndPortion; }
 
     void            SetHeight( sal_uInt16 nH, sal_uInt16 nTxtH = 0, sal_uInt16 nCrsrH = 0 );
     sal_uInt16          GetHeight() const               { return nHeight; }
@@ -537,7 +537,7 @@ public:
     void            SetHangingPunctuation( bool b )     { bHangingPunctuation = b; }
     bool            IsHangingPunctuation() const        { return bHangingPunctuation; }
 
-    sal_uInt16          GetLen() const                  { return nEnd - nStart; }
+    sal_Int32          GetLen() const                  { return nEnd - nStart; }
 
     sal_uInt16          GetStartPosX() const            { return nStartPosX; }
     void            SetStartPosX( long start );
@@ -574,14 +574,14 @@ public:
             ~EditLineList();
 
     void Reset();
-    void DeleteFromLine(size_t nDelFrom);
-    size_t FindLine(sal_uInt16 nChar, bool bInclEnd);
-    size_t Count() const;
-    const EditLine* operator[](size_t nPos) const;
-    EditLine* operator[](size_t nPos);
+    void DeleteFromLine(sal_Int32 nDelFrom);
+    sal_Int32 FindLine(sal_Int32 nChar, bool bInclEnd);
+    sal_Int32 Count() const;
+    const EditLine* operator[](sal_Int32 nPos) const;
+    EditLine* operator[](sal_Int32 nPos);
 
     void Append(EditLine* p);
-    void Insert(size_t nPos, EditLine* p);
+    void Insert(sal_Int32 nPos, EditLine* p);
 };
 
 // -------------------------------------------------------------------------
@@ -599,10 +599,10 @@ private:
     ScriptTypePosInfos      aScriptInfos;
     WritingDirectionInfos   aWritingDirectionInfos;
 
-    sal_uInt16              nInvalidPosStart;
-    sal_uInt16              nFirstLineOffset;   // For Writer-LineSpacing-Interpretation
-    sal_uInt16              nBulletX;
-    short                   nInvalidDiff;
+    sal_Int32              nInvalidPosStart;
+    sal_Int32              nFirstLineOffset;   // For Writer-LineSpacing-Interpretation
+    sal_uInt16             nBulletX;
+    sal_Int32              nInvalidDiff;
 
     sal_Bool                bInvalid            : 1;
     sal_Bool                bSimple             : 1;    // only linear Tap
@@ -615,7 +615,7 @@ public:
                         ParaPortion( ContentNode* pNode );
                         ~ParaPortion();
 
-    sal_uInt16 GetLineNumber( sal_uInt16 nIndex ) const;
+    sal_Int32 GetLineNumber( sal_Int32 nIndex ) const;
 
     EditLineList&       GetLines()                  { return aLineList; }
     const EditLineList& GetLines() const { return aLineList; }
@@ -630,8 +630,8 @@ public:
     sal_uInt16              GetBulletX() const          { return nBulletX; }
     void                SetBulletX( sal_uInt16 n )      { nBulletX = n; }
 
-    void                MarkInvalid( sal_uInt16 nStart, short nDiff);
-    void                MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 nEnd );
+    void                MarkInvalid( sal_Int32 nStart, sal_Int32 nDiff);
+    void                MarkSelectionInvalid( sal_Int32 nStart, sal_Int32 nEnd );
 
     void                SetVisible( sal_Bool bVisible );
     bool                IsVisible() const { return bVisible; }
@@ -639,17 +639,17 @@ public:
     sal_Bool            IsEmpty() { return GetTextPortions().Count() == 1 && GetTextPortions()[0]->GetLen() == 0; }
 
     long                GetHeight() const           { return ( bVisible ? nHeight : 0 ); }
-    sal_uInt16              GetFirstLineOffset() const  { return ( bVisible ? nFirstLineOffset : 0 ); }
+    sal_Int32           GetFirstLineOffset() const  { return ( bVisible ? nFirstLineOffset : 0 ); }
     void                ResetHeight()   { nHeight = 0; nFirstLineOffset = 0; }
 
     ContentNode*        GetNode() const             { return pNode; }
     TextPortionList&    GetTextPortions()           { return aTextPortionList; }
     const TextPortionList& GetTextPortions() const { return aTextPortionList; }
 
-    sal_uInt16              GetInvalidPosStart() const  { return nInvalidPosStart; }
+    sal_Int32           GetInvalidPosStart() const  { return nInvalidPosStart; }
     short               GetInvalidDiff() const      { return nInvalidDiff; }
 
-    void                CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine );
+    void                CorrectValuesBehindLastFormattedLine( sal_Int32 nLastFormattedLine );
 #if OSL_DEBUG_LEVEL > 2
     sal_Bool                DbgCheckTextPortions();
 #endif
@@ -660,7 +660,7 @@ public:
 // -------------------------------------------------------------------------
 class ParaPortionList
 {
-    mutable size_t nLastCache;
+    mutable sal_Int32 nLastCache;
     boost::ptr_vector<ParaPortion> maPortions;
 public:
                     ParaPortionList();
@@ -749,7 +749,7 @@ public:
 class EditDoc
 {
 private:
-    mutable size_t nLastCache;
+    mutable sal_Int32 nLastCache;
     boost::ptr_vector<ContentNode> maContents;
 
     SfxItemPool*    pItemPool;
@@ -792,7 +792,7 @@ public:
 
     EditPaM         Clear();
     EditPaM         RemoveText();
-    EditPaM         RemoveChars( EditPaM aPaM, sal_uInt16 nChars );
+    EditPaM         RemoveChars( EditPaM aPaM, sal_Int32 nChars );
     EditPaM         InsertText( EditPaM aPaM, const OUString& rStr );
     EditPaM         InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs );
     EditPaM         InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem );
@@ -802,7 +802,7 @@ public:
     sal_uLong       GetTextLen() const;
 
     OUString       GetParaAsString( sal_Int32 nNode ) const;
-    OUString       GetParaAsString(const ContentNode* pNode, sal_uInt16 nStartPos = 0, sal_uInt16 nEndPos = 0xFFFF, bool bResolveFields = true) const;
+    OUString       GetParaAsString(const ContentNode* pNode, sal_Int32 nStartPos = 0, sal_Int32 nEndPos = -1, bool bResolveFields = true) const;
 
     EditPaM GetStartPaM() const;
     EditPaM GetEndPaM() const;
@@ -812,12 +812,12 @@ public:
 
     void RemoveItemsFromPool(const ContentNode& rNode);
 
-    void            InsertAttrib( const SfxPoolItem& rItem, ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd );
-    void            InsertAttrib( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem );
-    void            InsertAttribInSelection( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem );
-    sal_Bool            RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nWhich = 0 );
-    sal_Bool            RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 );
-    void            FindAttribs( ContentNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet );
+    void            InsertAttrib( const SfxPoolItem& rItem, ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd );
+    void            InsertAttrib( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, const SfxPoolItem& rPoolItem );
+    void            InsertAttribInSelection( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, const SfxPoolItem& rPoolItem );
+    sal_Bool            RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt16 nWhich = 0 );
+    sal_Bool            RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 );
+    void            FindAttribs( ContentNode* pNode, sal_Int32 nStartPos, sal_Int32 nEndPos, SfxItemSet& rCurSet );
 
     sal_Int32 GetPos(const ContentNode* pNode) const;
     const ContentNode* GetObject(sal_Int32 nPos) const;
@@ -834,9 +834,9 @@ public:
     static OUString GetSepStr( LineEnd eEnd );
 };
 
-inline EditCharAttrib* GetAttrib(CharAttribList::AttribsType& rAttribs, size_t nAttr)
+inline EditCharAttrib* GetAttrib(CharAttribList::AttribsType& rAttribs, sal_Int32 nAttr)
 {
-    return (nAttr < rAttribs.size()) ? &rAttribs[nAttr] : NULL;
+    return (nAttr < (sal_Int32)rAttribs.size()) ? &rAttribs[nAttr] : NULL;
 }
 
 bool CheckOrderedList(const CharAttribList::AttribsType& rAttribs, bool bStart);
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 1ba3329..9e6807f 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -477,7 +477,7 @@ LanguageType EditEngine::GetLanguage(const EditPaM& rPaM) const
     return pImpEditEngine->GetLanguage(rPaM);
 }
 
-LanguageType EditEngine::GetLanguage( sal_Int32 nPara, sal_uInt16 nPos ) const
+LanguageType EditEngine::GetLanguage( sal_Int32 nPara, sal_Int32 nPos ) const
 {
     ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara );
     DBG_ASSERT( pNode, "GetLanguage - nPara is invalid!" );
@@ -579,35 +579,35 @@ sal_Int32 EditEngine::GetParagraphCount() const
     return pImpEditEngine->aEditDoc.Count();
 }
 
-sal_uInt16 EditEngine::GetLineCount( sal_Int32 nParagraph ) const
+sal_Int32 EditEngine::GetLineCount( sal_Int32 nParagraph ) const
 {
     if ( !pImpEditEngine->IsFormatted() )
         pImpEditEngine->FormatDoc();
     return pImpEditEngine->GetLineCount( nParagraph );
 }
 
-sal_uInt16 EditEngine::GetLineLen( sal_Int32 nParagraph, sal_uInt16 nLine ) const
+sal_Int32 EditEngine::GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const
 {
     if ( !pImpEditEngine->IsFormatted() )
         pImpEditEngine->FormatDoc();
     return pImpEditEngine->GetLineLen( nParagraph, nLine );
 }
 
-void EditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const
+void EditEngine::GetLineBoundaries( /*out*/sal_Int32& rStart, /*out*/sal_Int32& rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const
 {
     if ( !pImpEditEngine->IsFormatted() )
         pImpEditEngine->FormatDoc();
     return pImpEditEngine->GetLineBoundaries( rStart, rEnd, nParagraph, nLine );
 }
 
-sal_uInt16 EditEngine::GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const
+sal_Int32 EditEngine::GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const
 {
     if ( !pImpEditEngine->IsFormatted() )
         pImpEditEngine->FormatDoc();
     return pImpEditEngine->GetLineNumberAtIndex( nPara, nIndex );
 }
 
-sal_uInt32 EditEngine::GetLineHeight( sal_Int32 nParagraph, sal_uInt16 nLine )
+sal_uInt32 EditEngine::GetLineHeight( sal_Int32 nParagraph, sal_Int32 nLine )
 {
     // If someone calls GetLineHeight() with an empty Engine.
     if ( !pImpEditEngine->IsFormatted() )
@@ -625,7 +625,7 @@ sal_uInt32 EditEngine::GetTextHeight( sal_Int32 nParagraph ) const
      return nHeight;
 }
 
-OUString EditEngine::GetWord( sal_Int32 nPara, sal_uInt16 nIndex )
+OUString EditEngine::GetWord( sal_Int32 nPara, sal_Int32 nIndex )
 {
     ESelection aESel( nPara, nIndex, nPara, nIndex );
     EditSelection aSel( pImpEditEngine->CreateSel( aESel ) );
@@ -708,7 +708,7 @@ void EditEngine::InsertContent(ContentNode* pNode, sal_Int32 nPos)
     pImpEditEngine->InsertContent(pNode, nPos);
 }
 
-EditPaM EditEngine::SplitContent(sal_Int32 nNode, sal_uInt16 nSepPos)
+EditPaM EditEngine::SplitContent(sal_Int32 nNode, sal_Int32 nSepPos)
 {
     return pImpEditEngine->SplitContent(nNode, nSepPos);
 }
@@ -828,7 +828,7 @@ EditSelection EditEngine::SelectWord(
 }
 
 long EditEngine::GetXPos(
-        const ParaPortion* pParaPortion, const EditLine* pLine, sal_uInt16 nIndex, bool bPreferPortionStart) const
+        const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart) const
 {
     return pImpEditEngine->GetXPos(pParaPortion, pLine, nIndex, bPreferPortionStart);
 }
@@ -885,7 +885,7 @@ const ParaPortionList& EditEngine::GetParaPortions() const
 }
 
 void EditEngine::SeekCursor(
-        ContentNode* pNode, sal_uInt16 nPos, SvxFont& rFont, OutputDevice* pOut, sal_uInt16 nIgnoreWhich)
+        ContentNode* pNode, sal_Int32 nPos, SvxFont& rFont, OutputDevice* pOut, sal_uInt16 nIgnoreWhich)
 {
     pImpEditEngine->SeekCursor(pNode, nPos, rFont, pOut, nIgnoreWhich);
 }
@@ -1377,7 +1377,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
         ( !IsVertical() && ( nCode != KEY_LEFT ) && ( nCode != KEY_RIGHT ) ) ||
          ( IsVertical() && ( nCode != KEY_UP ) && ( nCode != KEY_DOWN ) ))
     {
-        pEditView->pImpEditView->SetCursorBidiLevel( 0xFFFF );
+        pEditView->pImpEditView->SetCursorBidiLevel( CURSOR_BIDILEVEL_DONTKNOW );
     }
 
     if ( bSetCursorFlags )
@@ -1601,7 +1601,7 @@ void EditEngine::RemoveParagraph( sal_Int32 nPara )
     }
 }
 
-sal_uInt16 EditEngine::GetTextLen( sal_Int32 nPara ) const
+sal_Int32 EditEngine::GetTextLen( sal_Int32 nPara ) const
 {
     ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara );
     DBG_ASSERT( pNode, "Paragraph not found: GetTextLen" );
@@ -1736,7 +1736,7 @@ SfxItemSet EditEngine::GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAtt
     return pImpEditEngine->GetAttribs( aSel, bOnlyHardAttrib );
 }
 
-SfxItemSet EditEngine::GetAttribs( sal_Int32 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags ) const
+SfxItemSet EditEngine::GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt8 nFlags ) const
 {
     return pImpEditEngine->GetAttribs( nPara, nStart, nEnd, nFlags );
 }
@@ -1774,7 +1774,7 @@ void EditEngine::StripPortions()
     pImpEditEngine->Paint( &aTmpDev, aBigRect, Point(), sal_True );
 }
 
-void EditEngine::GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList )
+void EditEngine::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList )
 {
     if ( !pImpEditEngine->IsFormatted() )
         pImpEditEngine->FormatFullDoc();
@@ -1782,9 +1782,9 @@ void EditEngine::GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList )
     const ParaPortion* pParaPortion = pImpEditEngine->GetParaPortions().SafeGetObject( nPara );
     if ( pParaPortion )
     {
-        sal_uInt16 nEnd = 0;
-        sal_uInt16 nTextPortions = pParaPortion->GetTextPortions().Count();
-        for ( sal_uInt16 n = 0; n < nTextPortions; n++ )
+        sal_Int32 nEnd = 0;
+        sal_Int32 nTextPortions = pParaPortion->GetTextPortions().Count();
+        for ( sal_Int32 n = 0; n < nTextPortions; n++ )
         {
             nEnd = nEnd + pParaPortion->GetTextPortions()[n]->GetLen();
             rList.push_back( nEnd );
@@ -1977,7 +1977,7 @@ sal_Bool EditEngine::IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder )
             const ParaPortion* pParaPortion = pImpEditEngine->FindParaPortion( aPaM.GetNode() );
             DBG_ASSERT( pParaPortion, "ParaPortion?" );
 
-            sal_uInt16 nLine = pParaPortion->GetLineNumber( aPaM.GetIndex() );
+            sal_Int32 nLine = pParaPortion->GetLineNumber( aPaM.GetIndex() );
             const EditLine* pLine = pParaPortion->GetLines()[nLine];
             Range aLineXPosStartEnd = pImpEditEngine->GetLineXPosStartEnd( pParaPortion, pLine );
             if ( ( aDocPos.X() >= aLineXPosStartEnd.Min() - nBorder ) &&
@@ -2232,7 +2232,7 @@ void EditEngine::GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY ) const
 
 sal_Bool EditEngine::ShouldCreateBigTextObject() const
 {
-    sal_uInt32 nTextPortions = 0;
+    sal_Int32 nTextPortions = 0;
     sal_Int32 nParas = pImpEditEngine->GetEditDoc().Count();
     for ( sal_Int32 nPara = 0; nPara < nParas; nPara++  )
     {
@@ -2428,8 +2428,8 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_Int32 nPara )
 // =====================================================================
 // ======================    Virtual Methods    ========================
 // =====================================================================
-void EditEngine::DrawingText( const Point&, const OUString&, sal_uInt16, sal_uInt16,
-    const sal_Int32*, const SvxFont&, sal_Int32, sal_uInt16, sal_uInt8,
+void EditEngine::DrawingText( const Point&, const OUString&, sal_Int32, sal_Int32,
+    const sal_Int32*, const SvxFont&, sal_Int32, sal_Int32, sal_uInt8,
     const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, bool,
     const ::com::sun::star::lang::Locale*, const Color&, const Color&)
 
@@ -2438,7 +2438,7 @@ void EditEngine::DrawingText( const Point&, const OUString&, sal_uInt16, sal_uIn
 
 void EditEngine::DrawingTab( const Point& /*rStartPos*/, long /*nWidth*/,
                                       const OUString& /*rChar*/, const SvxFont& /*rFont*/,
-                                      sal_Int32 /*nPara*/, xub_StrLen /*nIndex*/,
+                                      sal_Int32 /*nPara*/, sal_Int32 /*nIndex*/,
                                       sal_uInt8 /*nRightToLeft*/, bool /*bEndOfLine*/,
                                       bool /*bEndOfParagraph*/, const Color& /*rOverlineColor*/,
                                       const Color& /*rTextLineColor*/)
@@ -2559,16 +2559,16 @@ Rectangle EditEngine::GetBulletArea( sal_Int32 )
     return Rectangle( Point(), Point() );
 }
 
-OUString EditEngine::CalcFieldValue( const SvxFieldItem&, sal_Int32, sal_uInt16, Color*&, Color*& )
+OUString EditEngine::CalcFieldValue( const SvxFieldItem&, sal_Int32, sal_Int32, Color*&, Color*& )
 {
     return OUString(' ');
 }
 
-void EditEngine::FieldClicked( const SvxFieldItem&, sal_Int32, sal_uInt16 )
+void EditEngine::FieldClicked( const SvxFieldItem&, sal_Int32, sal_Int32 )
 {
 }
 
-void EditEngine::FieldSelected( const SvxFieldItem&, sal_Int32, sal_uInt16 )
+void EditEngine::FieldSelected( const SvxFieldItem&, sal_Int32, sal_Int32 )
 {
 }
 
@@ -2781,7 +2781,7 @@ EFieldInfo::EFieldInfo()
 }
 
 
-EFieldInfo::EFieldInfo( const SvxFieldItem& rFieldItem, sal_Int32 nPara, sal_uInt16 nPos ) : aPosition( nPara, nPos )
+EFieldInfo::EFieldInfo( const SvxFieldItem& rFieldItem, sal_Int32 nPara, sal_Int32 nPos ) : aPosition( nPara, nPos )
 {
     pFieldItem = new SvxFieldItem( rFieldItem );
 }
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index e812547..24cc1a8 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -892,9 +892,9 @@ namespace {
 
 class FindByParagraph : std::unary_function<editeng::Section, bool>
 {
-    size_t mnPara;
+    sal_Int32 mnPara;
 public:
-    FindByParagraph(size_t nPara) : mnPara(nPara) {}
+    FindByParagraph(sal_Int32 nPara) : mnPara(nPara) {}
     bool operator() (const editeng::Section& rAttr) const
     {
         return rAttr.mnParagraph == mnPara;
@@ -903,10 +903,10 @@ public:
 
 class FindBySectionStart : std::unary_function<editeng::Section, bool>
 {
-    size_t mnPara;
-    size_t mnStart;
+    sal_Int32 mnPara;
+    sal_Int32 mnStart;
 public:
-    FindBySectionStart(size_t nPara, size_t nStart) : mnPara(nPara), mnStart(nStart) {}
+    FindBySectionStart(sal_Int32 nPara, sal_Int32 nStart) : mnPara(nPara), mnStart(nStart) {}
     bool operator() (const editeng::Section& rAttr) const
     {
         return rAttr.mnParagraph == mnPara && rAttr.mnStart == mnStart;
@@ -982,7 +982,7 @@ void EditTextObjectImpl::GetAllSections( std::vector<editeng::Section>& rAttrs )
 
     // Go through all formatted paragraphs, and store format items.
     std::vector<editeng::Section>::iterator itAttr = aAttrs.begin();
-    for (size_t nPara = 0; nPara < aContents.size(); ++nPara)
+    for (sal_Int32 nPara = 0; nPara < (sal_Int32)aContents.size(); ++nPara)
     {
         const ContentInfo& rC = aContents[nPara];
 
@@ -998,7 +998,7 @@ void EditTextObjectImpl::GetAllSections( std::vector<editeng::Section>& rAttrs )
             if (!pItem)
                 continue;
 
-            size_t nStart = rXAttr.GetStart(), nEnd = rXAttr.GetEnd();
+            sal_Int32 nStart = rXAttr.GetStart(), nEnd = rXAttr.GetEnd();
             std::vector<editeng::Section>::iterator itCurAttr = itAttr;
 
             // Find the container whose start position matches.
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index b32e3f6..fdedb5f 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -717,7 +717,7 @@ void EditView::StartTextConversion(
 }
 
 
-sal_uInt16 EditView::StartSearchAndReplace( const SvxSearchItem& rSearchItem )
+sal_Int32 EditView::StartSearchAndReplace( const SvxSearchItem& rSearchItem )
 {
     return PIMPEE->StartSearchAndReplace( this, rSearchItem );
 }
@@ -1047,16 +1047,16 @@ void EditView::InsertField( const SvxFieldItem& rFld )
 const SvxFieldItem* EditView::GetFieldUnderMousePointer() const
 {
     sal_Int32 nPara;
-    sal_uInt16 nPos;
+    sal_Int32 nPos;
     return GetFieldUnderMousePointer( nPara, nPos );
 }
 
-const SvxFieldItem* EditView::GetField( const Point& rPos, sal_Int32* pPara, sal_uInt16* pPos ) const
+const SvxFieldItem* EditView::GetField( const Point& rPos, sal_Int32* pPara, sal_Int32* pPos ) const
 {
     return pImpEditView->GetField( rPos, pPara, pPos );
 }
 
-const SvxFieldItem* EditView::GetFieldUnderMousePointer( sal_Int32& nPara, sal_uInt16& nPos ) const
+const SvxFieldItem* EditView::GetFieldUnderMousePointer( sal_Int32& nPara, sal_Int32& nPos ) const
 {
     Point aPos = pImpEditView->GetWindow()->GetPointerPosPixel();
     aPos = pImpEditView->GetWindow()->PixelToLogic( aPos );
@@ -1133,19 +1133,19 @@ void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList )
     {
         for( sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
         {
-            std::vector<sal_uInt16> aPortions;
+            std::vector<sal_Int32> aPortions;
             rEditEngine.GetPortions( nPara, aPortions );
 
             if( aPortions.empty() )
                 aPortions.push_back( rEditEngine.GetTextLen(nPara) );
 
-            const sal_uInt16 nBeginPos = (nPara == aSel.nStartPara) ? aSel.nStartPos : 0;
-            const sal_uInt16 nEndPos = (nPara == aSel.nEndPara) ? aSel.nEndPos : EE_TEXTPOS_ALL;
+            const sal_Int32 nBeginPos = (nPara == aSel.nStartPara) ? aSel.nStartPos : 0;
+            const sal_Int32 nEndPos = (nPara == aSel.nEndPara) ? aSel.nEndPos : EE_TEXTPOS_ALL;
 
             for ( size_t nPos = 0; nPos < aPortions.size(); ++nPos )
             {
-                sal_uInt16 nPortionEnd   = aPortions[ nPos ];
-                sal_uInt16 nPortionStart = nPos > 0 ? aPortions[ nPos - 1 ] : 0;
+                sal_Int32 nPortionEnd   = aPortions[ nPos ];
+                sal_Int32 nPortionStart = nPos > 0 ? aPortions[ nPos - 1 ] : 0;
 
                 if( (nPortionEnd < nBeginPos) || (nPortionStart > nEndPos) )
                     continue;
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index e838c4e..160a77e 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -197,7 +197,7 @@ void EditSpellWrapper::CheckSpellTo()
     }
 }
 
-size_t WrongList::Valid = std::numeric_limits<size_t>::max();
+sal_Int32 WrongList::Valid = std::numeric_limits<sal_Int32>::max();
 
 WrongList::WrongList() : mnInvalidStart(0), mnInvalidEnd(Valid) {}
 
@@ -229,7 +229,7 @@ void WrongList::SetValid()
     mnInvalidEnd = 0;
 }
 
-void WrongList::SetInvalidRange( size_t nStart, size_t nEnd )
+void WrongList::SetInvalidRange( sal_Int32 nStart, sal_Int32 nEnd )
 {
     if (mnInvalidStart == Valid || nStart < mnInvalidStart)
         mnInvalidStart = nStart;
@@ -238,13 +238,13 @@ void WrongList::SetInvalidRange( size_t nStart, size_t nEnd )
         mnInvalidEnd = nEnd;
 }
 
-void WrongList::ResetInvalidRange( size_t nStart, size_t nEnd )
+void WrongList::ResetInvalidRange( sal_Int32 nStart, sal_Int32 nEnd )
 {
     mnInvalidStart = nStart;
     mnInvalidEnd = nEnd;
 }
 
-void WrongList::TextInserted( size_t nPos, size_t nLength, bool bPosIsSep )
+void WrongList::TextInserted( sal_Int32 nPos, sal_Int32 nLength, bool bPosIsSep )
 {
     if (IsValid())
     {
@@ -261,7 +261,7 @@ void WrongList::TextInserted( size_t nPos, size_t nLength, bool bPosIsSep )
             mnInvalidEnd = nPos + nLength;
     }
 
-    for (size_t i = 0, n = maRanges.size(); i < n; ++i)
+    for (sal_Int32 i = 0, n = (sal_Int32)maRanges.size(); i < n; ++i)
     {
         editeng::MisspellRange& rWrong = maRanges[i];
         bool bRefIsValid = true;
@@ -313,9 +313,9 @@ void WrongList::TextInserted( size_t nPos, size_t nLength, bool bPosIsSep )
     SAL_WARN_IF(DbgIsBuggy(), "editeng", "InsertWrong: WrongList broken!");
 }
 
-void WrongList::TextDeleted( size_t nPos, size_t nLength )
+void WrongList::TextDeleted( sal_Int32 nPos, sal_Int32 nLength )
 {
-    size_t nEndPos = nPos + nLength;
+    sal_Int32 nEndPos = nPos + nLength;
     if (IsValid())
     {
         sal_uInt16 nNewInvalidStart = nPos ? nPos - 1 : 0;
@@ -381,7 +381,7 @@ void WrongList::TextDeleted( size_t nPos, size_t nLength )
     SAL_WARN_IF(DbgIsBuggy(), "editeng", "TextDeleted: WrongList broken!");
 }
 
-bool WrongList::NextWrong( size_t& rnStart, size_t& rnEnd ) const
+bool WrongList::NextWrong( sal_Int32& rnStart, sal_Int32& rnEnd ) const
 {
     /*
         rnStart get the start position, is possibly adjusted wrt. Wrong start
@@ -399,7 +399,7 @@ bool WrongList::NextWrong( size_t& rnStart, size_t& rnEnd ) const
     return false;
 }
 
-bool WrongList::HasWrong( size_t nStart, size_t nEnd ) const
+bool WrongList::HasWrong( sal_Int32 nStart, sal_Int32 nEnd ) const
 {
     for (WrongList::const_iterator i = begin(); i != end(); ++i)
     {
@@ -411,7 +411,7 @@ bool WrongList::HasWrong( size_t nStart, size_t nEnd ) const
     return false;
 }
 
-bool WrongList::HasAnyWrong( size_t nStart, size_t nEnd ) const
+bool WrongList::HasAnyWrong( sal_Int32 nStart, sal_Int32 nEnd ) const
 {
     for (WrongList::const_iterator i = begin(); i != end(); ++i)
     {
@@ -423,12 +423,16 @@ bool WrongList::HasAnyWrong( size_t nStart, size_t nEnd ) const
     return false;
 }
 
-void WrongList::ClearWrongs( size_t nStart, size_t nEnd,
-            const ContentNode* pNode )
+void WrongList::ClearWrongs( sal_Int32 nStart, sal_Int32 nEnd,
+                             const ContentNode* pNode )
 {
+    if(nEnd < 0)
+    {
+        nEnd = SAL_MAX_INT32;
+    }
     for (WrongList::iterator i = begin(); i != end(); )
     {
-        if (i->mnEnd > nStart && i->mnStart < nEnd)
+        if ((i->mnEnd > nStart) && (i->mnStart < nEnd))
         {
             if (i->mnEnd > nEnd) // Runs out
             {
@@ -457,7 +461,7 @@ void WrongList::ClearWrongs( size_t nStart, size_t nEnd,
     SAL_WARN_IF(DbgIsBuggy(), "editeng", "ClearWrongs: WrongList broken!");
 }
 
-void WrongList::InsertWrong( size_t nStart, size_t nEnd )
+void WrongList::InsertWrong( sal_Int32 nStart, sal_Int32 nEnd )
 {
     WrongList::iterator nPos = end();
     for (WrongList::iterator i = begin(); i != end(); ++i)
diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx
index 4951e79..2af8d1f 100644
--- a/editeng/source/editeng/edtspell.hxx
+++ b/editeng/source/editeng/edtspell.hxx
@@ -70,11 +70,11 @@ public:
  */
 class WrongList
 {
-    static size_t Valid;
+    static sal_Int32 Valid;
 
     std::vector<editeng::MisspellRange> maRanges;
-    size_t mnInvalidStart;
-    size_t mnInvalidEnd;
+    sal_Int32 mnInvalidStart;
+    sal_Int32 mnInvalidEnd;
 
     bool DbgIsBuggy() const;
 
@@ -91,20 +91,20 @@ public:
 
     bool IsValid() const;
     void SetValid();
-    void SetInvalidRange( size_t nStart, size_t nEnd );
-    void ResetInvalidRange( size_t nStart, size_t nEnd );
+    void SetInvalidRange( sal_Int32 nStart, sal_Int32 nEnd );
+    void ResetInvalidRange( sal_Int32 nStart, sal_Int32 nEnd );
 
-    size_t GetInvalidStart() const { return mnInvalidStart; }
-    size_t GetInvalidEnd() const   { return mnInvalidEnd; }
+    sal_Int32 GetInvalidStart() const { return mnInvalidStart; }
+    sal_Int32 GetInvalidEnd() const   { return mnInvalidEnd; }
 
-    void TextInserted( size_t nPos, size_t nLength, bool bPosIsSep );
-    void TextDeleted( size_t nPos, size_t nLength );
+    void TextInserted( sal_Int32 nPos, sal_Int32 nLength, bool bPosIsSep );
+    void TextDeleted( sal_Int32 nPos, sal_Int32 nLength );
 
-    void InsertWrong( size_t nStart, size_t nEnd );
-    bool NextWrong( size_t& rnStart, size_t& rnEnd ) const;
-    bool HasWrong( size_t nStart, size_t nEnd ) const;
-    bool HasAnyWrong( size_t nStart, size_t nEnd ) const;
-    void ClearWrongs( size_t nStart, size_t nEnd, const ContentNode* pNode );
+    void InsertWrong( sal_Int32 nStart, sal_Int32 nEnd );
+    bool NextWrong( sal_Int32& rnStart, sal_Int32& rnEnd ) const;
+    bool HasWrong( sal_Int32 nStart, sal_Int32 nEnd ) const;
+    bool HasAnyWrong( sal_Int32 nStart, sal_Int32 nEnd ) const;
+    void ClearWrongs( sal_Int32 nStart, sal_Int32 nEnd, const ContentNode* pNode );
     void MarkWrongsInvalid();
 
     WrongList*  Clone() const;
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index c336a53..ce5bbcf 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -268,7 +268,7 @@ void EditRTFParser::MovePos( int bForward )
 }
 
 void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos,
-                                    sal_uInt16& rCntPos )
+                                    sal_Int32& rCntPos )
 {
     // The Intention is to: determine the current insert position of the
     //                      previous paragraph and set the end from this.
@@ -285,7 +285,7 @@ void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos,
     rCntPos = pPrevNode->Len();
 }
 
-bool EditRTFParser::IsEndPara( SvxNodeIdx* pNd, sal_uInt16 nCnt ) const
+bool EditRTFParser::IsEndPara( SvxNodeIdx* pNd, sal_Int32 nCnt ) const
 {
     return ( nCnt == ( ((EditNodeIdx*)pNd)->GetNode()->Len()) );
 }
@@ -622,7 +622,7 @@ sal_Int32 EditPosition::GetNodeIdx() const
     return mpEditEngine->GetEditDoc().GetPos(pN);
 }
 
-sal_uInt16 EditPosition::GetCntIdx() const
+sal_Int32 EditPosition::GetCntIdx() const
 {
     return mpCurSel->Max().GetIndex();
 }
diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx
index 206a262..df7d7d79 100644
--- a/editeng/source/editeng/eertfpar.hxx
+++ b/editeng/source/editeng/eertfpar.hxx
@@ -50,7 +50,7 @@ public:
     EditPosition(EditEngine* pIEE, EditSelection* pSel);
 
     virtual sal_Int32   GetNodeIdx() const;
-    virtual sal_uInt16  GetCntIdx() const;
+    virtual sal_Int32   GetCntIdx() const;
 
     // clone
     virtual SvxPosition* Clone() const;
@@ -81,12 +81,12 @@ protected:
     virtual void        InsertText();
     virtual void        MovePos( int bForward = sal_True );
     virtual void        SetEndPrevPara( SvxNodeIdx*& rpNodePos,
-                                            sal_uInt16& rCntPos );
+                                            sal_Int32& rCntPos );
 
     virtual void        UnknownAttrToken( int nToken, SfxItemSet* pSet );
     virtual void        NextToken( int nToken );
     virtual void        SetAttrInDoc( SvxRTFItemStackType &rSet );
-    virtual bool        IsEndPara( SvxNodeIdx* pNd, sal_uInt16 nCnt ) const;
+    virtual bool        IsEndPara( SvxNodeIdx* pNd, sal_Int32 nCnt ) const;
     virtual void        CalcValue();
     void                CreateStyleSheets();
     SfxStyleSheet*      CreateStyleSheet( SvxRTFStyleType* pRTFStyle );
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 5b50170..b91f9b1 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -256,8 +256,8 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion, OutputD
             }
             else
             {
-                sal_uInt16 nTmpStartIndex = nStartIndex;
-                sal_uInt16 nWritingDirStart, nTmpEndIndex;
+                sal_Int32 nTmpStartIndex = nStartIndex;
+                sal_Int32 nWritingDirStart, nTmpEndIndex;
 
                 while ( nTmpStartIndex < nEndIndex )
                 {
@@ -652,7 +652,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sa
 
     EditPaM aPaM( aEditSelection.Max() );
 
-    sal_uInt16 nTextPortionStart = 0;
+    sal_Int32 nTextPortionStart = 0;
     sal_Int32 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
     if (nPara == EE_PARA_NOT_FOUND) // #i94322
         return;
@@ -680,7 +680,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sa
             // If we are behind a portion, and the next portion has other direction, we must change position...
             aEditCursor.Left() = aEditCursor.Right() = pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, GETCRSR_TXTONLY|GETCRSR_PREFERPORTIONSTART ).Left();
 
-            sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, true );
+            sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, true );
             const TextPortion* pTextPortion = pParaPortion->GetTextPortions()[nTextPortion];
             if ( pTextPortion->GetKind() == PORTIONKIND_TAB )
             {
@@ -1173,7 +1173,7 @@ void ImpEditView::DeleteSelected()
     ShowCursor( DoAutoScroll(), sal_True );
 }
 
-const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_Int32* pPara, sal_uInt16* pPos ) const
+const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_Int32* pPara, sal_Int32* pPos ) const
 {
     if( !GetOutputArea().IsInside( rPos ) )
         return 0;
@@ -1547,7 +1547,7 @@ void ImpEditView::dragGestureRecognized( const ::com::sun::star::datatransfer::d
     {
         // Field?!
         sal_Int32 nPara;
-        sal_uInt16 nPos;
+        sal_Int32 nPos;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list