[Libreoffice-commits] core.git: chart2/source editeng/source filter/source forms/source include/editeng include/svx sc/inc sc/qa sc/source sd/source starmath/inc starmath/source svx/source sw/inc sw/source
Eike Rathke
erack at redhat.com
Fri May 10 07:02:02 PDT 2013
chart2/source/view/axes/VCartesianAxis.cxx | 4
editeng/source/accessibility/AccessibleEditableTextPara.cxx | 53 +-
editeng/source/accessibility/AccessibleHyperlink.cxx | 2
editeng/source/accessibility/AccessibleHyperlink.hxx | 5
editeng/source/accessibility/AccessibleImageBullet.cxx | 6
editeng/source/accessibility/AccessibleParaManager.cxx | 81 ++--
editeng/source/accessibility/AccessibleStaticTextBase.cxx | 29 -
editeng/source/editeng/editdbg.cxx | 4
editeng/source/editeng/editdoc.cxx | 128 ++++---
editeng/source/editeng/editdoc.hxx | 50 +-
editeng/source/editeng/editeng.cxx | 160 ++++----
editeng/source/editeng/editobj.cxx | 63 ++-
editeng/source/editeng/editobj2.hxx | 16
editeng/source/editeng/editundo.cxx | 18
editeng/source/editeng/editundo.hxx | 26 -
editeng/source/editeng/editview.cxx | 28 -
editeng/source/editeng/edtspell.cxx | 6
editeng/source/editeng/eehtml.cxx | 8
editeng/source/editeng/eertfpar.cxx | 22 -
editeng/source/editeng/eertfpar.hxx | 4
editeng/source/editeng/impedit.cxx | 37 +-
editeng/source/editeng/impedit.hxx | 92 ++---
editeng/source/editeng/impedit2.cxx | 157 ++++----
editeng/source/editeng/impedit3.cxx | 56 +--
editeng/source/editeng/impedit4.cxx | 56 +--
editeng/source/editeng/impedit5.cxx | 54 +-
editeng/source/outliner/outleeng.cxx | 32 -
editeng/source/outliner/outleeng.hxx | 26 -
editeng/source/outliner/outlin2.cxx | 38 +-
editeng/source/outliner/outliner.cxx | 218 +++++-------
editeng/source/outliner/outlobj.cxx | 22 -
editeng/source/outliner/outlundo.cxx | 14
editeng/source/outliner/outlundo.hxx | 18
editeng/source/outliner/outlvw.cxx | 135 +++----
editeng/source/outliner/paralist.cxx | 58 +--
editeng/source/outliner/paralist.hxx | 27 -
editeng/source/rtf/svxrtf.cxx | 8
editeng/source/uno/unoedhlp.cxx | 8
editeng/source/uno/unoedprx.cxx | 68 +--
editeng/source/uno/unofored.cxx | 54 +-
editeng/source/uno/unoforou.cxx | 86 ++--
editeng/source/uno/unotext.cxx | 98 ++---
editeng/source/uno/unotext2.cxx | 4
filter/source/msfilter/msdffimp.cxx | 8
filter/source/msfilter/svdfppt.cxx | 2
forms/source/richtext/specialdispatchers.cxx | 4
include/editeng/AccessibleParaManager.hxx | 20 -
include/editeng/editdata.hxx | 50 +-
include/editeng/editeng.hxx | 122 +++---
include/editeng/editobj.hxx | 14
include/editeng/editview.hxx | 10
include/editeng/outliner.hxx | 184 +++++-----
include/editeng/outlobj.hxx | 6
include/editeng/svxrtf.hxx | 8
include/editeng/unoedhlp.hxx | 12
include/editeng/unoedprx.hxx | 54 +-
include/editeng/unoedsrc.hxx | 56 +--
include/editeng/unofored.hxx | 48 +-
include/editeng/unoforou.hxx | 58 +--
include/editeng/unotext.hxx | 58 +--
include/svx/svdomeas.hxx | 2
include/svx/svdotext.hxx | 2
include/svx/svdoutl.hxx | 2
sc/inc/editutil.hxx | 6
sc/qa/unit/subsequent_filters-test.cxx | 14
sc/source/core/data/attrib.cxx | 4
sc/source/core/data/cellvalue.cxx | 4
sc/source/core/data/column2.cxx | 4
sc/source/core/data/documen8.cxx | 2
sc/source/core/data/global.cxx | 4
sc/source/core/data/postit.cxx | 2
sc/source/core/tool/editutil.cxx | 29 -
sc/source/filter/excel/xehelper.cxx | 8
sc/source/filter/excel/xicontent.cxx | 4
sc/source/filter/html/htmlexp.cxx | 4
sc/source/filter/xml/xmlcelli.hxx | 2
sc/source/ui/app/inputhdl.cxx | 50 +-
sc/source/ui/app/inputwin.cxx | 2
sc/source/ui/app/transobj.cxx | 2
sc/source/ui/docshell/docfunc.cxx | 8
sc/source/ui/drawfunc/drtxtob.cxx | 12
sc/source/ui/pagedlg/tphfedit.cxx | 4
sc/source/ui/unoobj/fielduno.cxx | 16
sc/source/ui/view/editsh.cxx | 2
sc/source/ui/view/output2.cxx | 4
sc/source/ui/view/viewdata.cxx | 2
sc/source/ui/view/viewfun4.cxx | 6
sc/source/ui/view/viewfunc.cxx | 2
sd/source/core/sdpage_animations.cxx | 4
sd/source/core/text/textapi.cxx | 2
sd/source/filter/html/htmlex.cxx | 18
sd/source/filter/html/htmlex.hxx | 2
sd/source/filter/ppt/pptinanimations.cxx | 7
sd/source/filter/xml/sdtransform.cxx | 4
sd/source/ui/annotations/annotationmanager.cxx | 8
sd/source/ui/annotations/annotationwindow.cxx | 4
sd/source/ui/app/sdmod2.cxx | 2
sd/source/ui/dlg/dlgassim.cxx | 6
sd/source/ui/dlg/headerfooterdlg.cxx | 4
sd/source/ui/func/fuexpand.cxx | 20 -
sd/source/ui/func/fuinsfil.cxx | 14
sd/source/ui/func/fuprobjs.cxx | 4
sd/source/ui/func/fusumry.cxx | 4
sd/source/ui/func/futext.cxx | 2
sd/source/ui/inc/OutlineView.hxx | 6
sd/source/ui/unoidl/unosrch.cxx | 4
sd/source/ui/view/DocumentRenderer.cxx | 8
sd/source/ui/view/Outliner.cxx | 2
sd/source/ui/view/drawview.cxx | 6
sd/source/ui/view/drtxtob.cxx | 10
sd/source/ui/view/drtxtob1.cxx | 10
sd/source/ui/view/outlnvs2.cxx | 4
sd/source/ui/view/outlnvsh.cxx | 22 -
sd/source/ui/view/outlview.cxx | 44 +-
sd/source/ui/view/sdview.cxx | 6
sd/source/ui/view/sdview2.cxx | 10
starmath/inc/edit.hxx | 2
starmath/source/accessibility.cxx | 52 +-
starmath/source/accessibility.hxx | 48 +-
starmath/source/cursor.cxx | 2
starmath/source/edit.cxx | 15
starmath/source/view.cxx | 5
svx/source/accessibility/AccessibleEmptyEditSource.cxx | 48 +-
svx/source/accessibility/AccessibleTextHelper.cxx | 24 -
svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 2
svx/source/sdr/properties/textproperties.cxx | 34 -
svx/source/svdraw/svdedxv.cxx | 17
svx/source/svdraw/svdomeas.cxx | 2
svx/source/svdraw/svdotext.cxx | 4
svx/source/svdraw/svdotextpathdecomposition.cxx | 8
svx/source/svdraw/svdotxat.cxx | 12
svx/source/svdraw/svdotxed.cxx | 2
svx/source/svdraw/svdotxfl.cxx | 2
svx/source/svdraw/svdoutl.cxx | 2
svx/source/svdraw/svdview.cxx | 4
svx/source/table/cell.cxx | 16
svx/source/table/svdotable.cxx | 4
svx/source/table/tablecontroller.cxx | 2
svx/source/table/tablertfimporter.cxx | 4
sw/inc/docufld.hxx | 2
sw/source/core/fields/docufld.cxx | 2
sw/source/filter/ww8/docxattributeoutput.cxx | 4
sw/source/filter/ww8/docxexport.cxx | 4
sw/source/filter/ww8/rtfsdrexport.cxx | 4
sw/source/filter/ww8/wrtw8esh.cxx | 6
sw/source/filter/ww8/wrtww8.hxx | 4
sw/source/filter/ww8/ww8graf.cxx | 8
sw/source/ui/docvw/AnnotationWin.cxx | 4
sw/source/ui/docvw/PostItMgr.cxx | 3
sw/source/ui/docvw/SidebarWin.cxx | 2
sw/source/ui/shells/annotsh.cxx | 4
sw/source/ui/shells/drwtxtsh.cxx | 4
sw/source/ui/shells/langhelper.cxx | 2
sw/source/ui/uno/unotxdoc.cxx | 8
154 files changed, 1851 insertions(+), 1754 deletions(-)
New commits:
commit 2af1f5691e8d64afd5246d245d7876b5a2cd5cd8
Author: Eike Rathke <erack at redhat.com>
Date: Wed May 8 18:12:32 2013 +0200
resolved fdo#35756 import more than 64k HTML table cells
Enhanced EditEngine to be able to hold more than 64k paragraphs. Used
also in RTF import Calc and Writer, so that could benefit as well.
* changed all EditEngine,Outliner,... related paragraph index/count
variables from sal_uInt16 to sal_Int32
* sal_Int32 instead of sal_uInt32 to match accessibility API
* matched some Outliner methods' paragraph parameters from sal_uLong
to sal_Int32
* containers capable to hold size_t nevertheless are limited to a
maximum of sal_Int32
* changed definition of EE_PARA_NOT_FOUND and EE_PARA_ALL to
SAL_MAX_INT32
+ added EE_PARA_MAX_COUNT and EE_TEXTPOS_MAX_COUNT to initialize
ESelection with what previously were hard coded 0xFFFF all over the
place
+ for similar reason added EE_TEXTPOS_ALL corresponding to EE_PARA_ALL
to initialize an ESelection spanning all available text like
aSel(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL)
Change-Id: I62d1b9c399cd709a4f93dbac31b219a61c46ec00
Reviewed-on: https://gerrit.libreoffice.org/3838
Tested-by: LibreOffice gerrit bot <gerrit at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 55ebf3c..5e193ac 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -351,8 +351,8 @@ bool lcl_hasWordBreak( const Reference< drawing::XShape >& rxShape )
SvxTextForwarder* pTextForwarder = pTextEditSource->GetTextForwarder();
if ( pTextForwarder )
{
- sal_uInt16 nParaCount = pTextForwarder->GetParagraphCount();
- for ( sal_uInt16 nPara = 0; nPara < nParaCount; ++nPara )
+ 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 )
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 634a91c..9702c44 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -178,11 +178,11 @@ namespace accessibility
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
- DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
+ DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= SAL_MAX_INT32,
"AccessibleEditableTextPara::getLocale: paragraph index value overflow");
// return locale of first character in the paragraph
- return LanguageTag(GetTextForwarder().GetLanguage( static_cast< sal_uInt16 >( GetParagraphIndex() ), 0 )).getLocale();
+ return LanguageTag(GetTextForwarder().GetLanguage( GetParagraphIndex(), 0 )).getLocale();
}
void AccessibleEditableTextPara::implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex )
@@ -220,16 +220,16 @@ namespace accessibility
SvxTextForwarder& rCacheTF = GetTextForwarder();
const sal_Int32 nParaIndex = GetParagraphIndex();
- DBG_ASSERT(nParaIndex >= 0 && nParaIndex <= USHRT_MAX,
+ DBG_ASSERT(nParaIndex >= 0 && nParaIndex <= SAL_MAX_INT32,
"AccessibleEditableTextPara::implGetLineBoundary: paragraph index value overflow");
- const sal_Int32 nTextLen = rCacheTF.GetTextLen( static_cast< sal_uInt16 >( nParaIndex ) );
+ const sal_Int32 nTextLen = rCacheTF.GetTextLen( nParaIndex );
CheckPosition(nIndex);
rBoundary.startPos = rBoundary.endPos = -1;
- const sal_uInt16 nLineCount=rCacheTF.GetLineCount( static_cast< sal_uInt16 >( nParaIndex ) );
+ const sal_uInt16 nLineCount=rCacheTF.GetLineCount( nParaIndex );
if( nIndex == nTextLen )
{
@@ -237,7 +237,7 @@ namespace accessibility
if( nLineCount <= 1 )
rBoundary.startPos = 0;
else
- rBoundary.startPos = nTextLen - rCacheTF.GetLineLen( static_cast< sal_uInt16 >( nParaIndex ),
+ rBoundary.startPos = nTextLen - rCacheTF.GetLineLen( nParaIndex,
nLineCount-1 );
rBoundary.endPos = nTextLen;
@@ -249,11 +249,11 @@ namespace accessibility
sal_Int32 nCurIndex;
for( nLine=0, nCurIndex=0; nLine<nLineCount; ++nLine )
{
- nCurIndex += rCacheTF.GetLineLen( static_cast< sal_uInt16 >( nParaIndex ), nLine);
+ nCurIndex += rCacheTF.GetLineLen( nParaIndex, nLine);
if( nCurIndex > nIndex )
{
- rBoundary.startPos = nCurIndex - rCacheTF.GetLineLen(static_cast< sal_uInt16 >( nParaIndex ), nLine);
+ rBoundary.startPos = nCurIndex - rCacheTF.GetLineLen( nParaIndex, nLine);
rBoundary.endPos = nCurIndex;
break;
}
@@ -394,10 +394,10 @@ namespace accessibility
// check overflow
DBG_ASSERT(nStartEEIndex >= 0 && nStartEEIndex <= USHRT_MAX &&
nEndEEIndex >= 0 && nEndEEIndex <= USHRT_MAX &&
- GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
+ GetParagraphIndex() >= 0 && GetParagraphIndex() <= SAL_MAX_INT32,
"AccessibleEditableTextPara::MakeSelection: index value overflow");
- sal_uInt16 nParaIndex = static_cast< sal_uInt16 >( GetParagraphIndex() );
+ sal_Int32 nParaIndex = GetParagraphIndex();
return ESelection( nParaIndex, static_cast< sal_uInt16 >( nStartEEIndex ),
nParaIndex, static_cast< sal_uInt16 >( nEndEEIndex ) );
}
@@ -449,7 +449,7 @@ namespace accessibility
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
ESelection aSelection;
- sal_uInt16 nPara = static_cast< sal_uInt16 > ( GetParagraphIndex() );
+ sal_Int32 nPara = GetParagraphIndex();
if( !GetEditViewForwarder().GetSelection( aSelection ) )
return sal_False;
@@ -620,10 +620,10 @@ namespace accessibility
{
DBG_CHKTHIS( AccessibleEditableTextPara, NULL );
- DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
+ DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= SAL_MAX_INT32,
"AccessibleEditableTextPara::HaveChildren: paragraph index value overflow");
- return GetTextForwarder().HaveImageBullet( static_cast< sal_uInt16 >(GetParagraphIndex()) );
+ return GetTextForwarder().HaveImageBullet( GetParagraphIndex() );
}
Rectangle AccessibleEditableTextPara::LogicToPixel( const Rectangle& rRect, const MapMode& rMapMode, SvxViewForwarder& rForwarder )
@@ -729,12 +729,12 @@ namespace accessibility
DBG_ASSERT(nIndex >= 0 && nIndex <= USHRT_MAX,
"AccessibleEditableTextPara::GetAttributeRun: index value overflow");
- DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
+ DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= SAL_MAX_INT32,
"AccessibleEditableTextPara::getLocale: paragraph index value overflow");
return GetTextForwarder().GetAttributeRun( nStartIndex,
nEndIndex,
- static_cast< sal_uInt16 >(GetParagraphIndex()),
+ GetParagraphIndex(),
static_cast< sal_uInt16 >(nIndex) );
}
@@ -963,7 +963,7 @@ namespace accessibility
SolarMutexGuard aGuard;
- DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
+ DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= SAL_MAX_INT32,
"AccessibleEditableTextPara::contains: index value overflow");
awt::Rectangle aTmpRect = getBounds();
@@ -1014,11 +1014,11 @@ namespace accessibility
SolarMutexGuard aGuard;
- DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX,
+ DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= SAL_MAX_INT32,
"AccessibleEditableTextPara::getBounds: index value overflow");
SvxTextForwarder& rCacheTF = GetTextForwarder();
- Rectangle aRect = rCacheTF.GetParaBounds( static_cast< sal_uInt16 >( GetParagraphIndex() ) );
+ Rectangle aRect = rCacheTF.GetParaBounds( GetParagraphIndex() );
// convert to screen coordinates
Rectangle aScreenRect = AccessibleEditableTextPara::LogicToPixel( aRect,
@@ -1272,7 +1272,8 @@ namespace accessibility
SolarMutexGuard aGuard;
- sal_uInt16 nPara, nIndex;
+ sal_Int32 nPara;
+ sal_uInt16 nIndex;
// offset from surrounding cell/shape
Point aOffset( GetEEOffset() );
@@ -1283,7 +1284,7 @@ namespace accessibility
Point aLogPoint( GetViewForwarder().PixelToLogic( aPoint, rCacheTF.GetMapMode() ) );
// re-offset to parent (paragraph)
- Rectangle aParaRect = rCacheTF.GetParaBounds( static_cast< sal_uInt16 >( GetParagraphIndex() ) );
+ Rectangle aParaRect = rCacheTF.GetParaBounds( GetParagraphIndex() );
aLogPoint.Move( aParaRect.Left(), aParaRect.Top() );
if( rCacheTF.GetIndexAtPoint( aLogPoint, nPara, nIndex ) &&
@@ -1423,7 +1424,7 @@ namespace accessibility
// implGetAttributeRunBoundary() method there
case AccessibleTextType::ATTRIBUTE_RUN:
{
- const sal_Int32 nTextLen = GetTextForwarder().GetTextLen( static_cast< sal_uInt16 >( GetParagraphIndex() ) );
+ const sal_Int32 nTextLen = GetTextForwarder().GetTextLen( GetParagraphIndex() );
if( nIndex == nTextLen )
{
@@ -1471,7 +1472,7 @@ namespace accessibility
// implGetAttributeRunBoundary() method there
case AccessibleTextType::ATTRIBUTE_RUN:
{
- const sal_Int32 nTextLen = GetTextForwarder().GetTextLen( static_cast< sal_uInt16 >( GetParagraphIndex() ) );
+ const sal_Int32 nTextLen = GetTextForwarder().GetTextLen( GetParagraphIndex() );
sal_uInt16 nStartIndex, nEndIndex;
if( nIndex == nTextLen )
@@ -2104,8 +2105,8 @@ namespace accessibility
if (bValidPara)
{
// we explicitly allow for the index to point at the character right behind the text
- if (0 <= nIndex && nIndex <= rCacheTF.GetTextLen( static_cast< sal_uInt16 >(nPara) ))
- nRes = rCacheTF.GetLineNumberAtIndex( static_cast< sal_uInt16 >(nPara), static_cast< sal_uInt16 >(nIndex) );
+ if (0 <= nIndex && nIndex <= rCacheTF.GetTextLen( nPara ))
+ nRes = rCacheTF.GetLineNumberAtIndex( nPara, static_cast< sal_uInt16 >(nIndex) );
else
throw lang::IndexOutOfBoundsException();
}
@@ -2124,10 +2125,10 @@ namespace accessibility
DBG_ASSERT( bValidPara, "getTextAtLineNumber: current paragraph index out of range" );
if (bValidPara)
{
- if (0 <= nLineNo && nLineNo < rCacheTF.GetLineCount( static_cast< sal_uInt16 >(nPara) ))
+ if (0 <= nLineNo && nLineNo < rCacheTF.GetLineCount( nPara ))
{
sal_uInt16 nStart = 0, nEnd = 0;
- rCacheTF.GetLineBoundaries( nStart, nEnd, static_cast< sal_uInt16 >(nPara), static_cast< sal_uInt16 >(nLineNo) );
+ rCacheTF.GetLineBoundaries( nStart, nEnd, nPara, static_cast< sal_uInt16 >(nLineNo) );
if (nStart != 0xFFFF && nEnd != 0xFFFF)
{
try
diff --git a/editeng/source/accessibility/AccessibleHyperlink.cxx b/editeng/source/accessibility/AccessibleHyperlink.cxx
index 86e72d4..0407c88 100644
--- a/editeng/source/accessibility/AccessibleHyperlink.cxx
+++ b/editeng/source/accessibility/AccessibleHyperlink.cxx
@@ -39,7 +39,7 @@ using namespace ::com::sun::star;
namespace accessibility
{
- AccessibleHyperlink::AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_uInt16 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const OUString& rD )
+ AccessibleHyperlink::AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_Int32 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const OUString& rD )
: rTA( r )
{
pFld = p;
diff --git a/editeng/source/accessibility/AccessibleHyperlink.hxx b/editeng/source/accessibility/AccessibleHyperlink.hxx
index 8157a2a..4e0f178 100644
--- a/editeng/source/accessibility/AccessibleHyperlink.hxx
+++ b/editeng/source/accessibility/AccessibleHyperlink.hxx
@@ -43,12 +43,13 @@ namespace accessibility
SvxAccessibleTextAdapter& rTA;
SvxFieldItem* pFld;
- sal_uInt16 nPara, nRealIdx; // EE values
+ sal_Int32 nPara; // EE values
+ sal_uInt16 nRealIdx; // EE values
sal_Int32 nStartIdx, nEndIdx; // translated values
OUString aDescription;
public:
- AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_uInt16 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const OUString& rD );
+ AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_Int32 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const OUString& rD );
~AccessibleHyperlink();
// XAccessibleAction
diff --git a/editeng/source/accessibility/AccessibleImageBullet.cxx b/editeng/source/accessibility/AccessibleImageBullet.cxx
index 177ccef..3e9c2e2 100644
--- a/editeng/source/accessibility/AccessibleImageBullet.cxx
+++ b/editeng/source/accessibility/AccessibleImageBullet.cxx
@@ -206,7 +206,7 @@ namespace accessibility
"AccessibleImageBullet::getLocale: paragraph index value overflow");
// return locale of first character in the paragraph
- return LanguageTag(GetTextForwarder().GetLanguage( static_cast< sal_uInt16 >( GetParagraphIndex() ), 0 )).getLocale();
+ return LanguageTag(GetTextForwarder().GetLanguage( GetParagraphIndex(), 0 )).getLocale();
}
void SAL_CALL AccessibleImageBullet::addAccessibleEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException)
@@ -259,8 +259,8 @@ namespace accessibility
"AccessibleEditableTextPara::getBounds: index value overflow");
SvxTextForwarder& rCacheTF = GetTextForwarder();
- EBulletInfo aBulletInfo = rCacheTF.GetBulletInfo( static_cast< sal_uInt16 > (GetParagraphIndex()) );
- Rectangle aParentRect = rCacheTF.GetParaBounds( static_cast< sal_uInt16 >( GetParagraphIndex() ) );
+ EBulletInfo aBulletInfo = rCacheTF.GetBulletInfo( GetParagraphIndex() );
+ Rectangle aParentRect = rCacheTF.GetParaBounds( GetParagraphIndex() );
if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND &&
aBulletInfo.bVisible &&
diff --git a/editeng/source/accessibility/AccessibleParaManager.cxx b/editeng/source/accessibility/AccessibleParaManager.cxx
index c3c24d6..08d6bf0 100644
--- a/editeng/source/accessibility/AccessibleParaManager.cxx
+++ b/editeng/source/accessibility/AccessibleParaManager.cxx
@@ -78,9 +78,15 @@ namespace accessibility
mnFocusedChild = -1;
}
- sal_uInt32 AccessibleParaManager::GetNum() const
+ sal_Int32 AccessibleParaManager::GetNum() const
{
- return maChildren.size();
+ size_t nSize = maChildren.size();
+ if (nSize > SAL_MAX_INT32)
+ {
+ SAL_WARN( "editeng", "AccessibleParaManager::GetNum - overflow " << nSize);
+ return SAL_MAX_INT32;
+ }
+ return static_cast<sal_Int32>(nSize);
}
AccessibleParaManager::VectorOfChildren::iterator AccessibleParaManager::begin()
@@ -103,11 +109,12 @@ namespace accessibility
return maChildren.end();
}
- void AccessibleParaManager::Release( sal_uInt32 nPara )
+ void AccessibleParaManager::Release( sal_Int32 nPara )
{
- DBG_ASSERT( maChildren.size() > nPara, "AccessibleParaManager::Release: invalid index" );
+ DBG_ASSERT( 0 <= nPara && maChildren.size() > static_cast<size_t>(nPara),
+ "AccessibleParaManager::Release: invalid index" );
- if( maChildren.size() > nPara )
+ if( 0 <= nPara && maChildren.size() > static_cast<size_t>(nPara) )
{
ShutdownPara( GetChild( nPara ) );
@@ -116,14 +123,15 @@ namespace accessibility
}
}
- void AccessibleParaManager::FireEvent( sal_uInt32 nPara,
+ void AccessibleParaManager::FireEvent( sal_Int32 nPara,
const sal_Int16 nEventId,
const uno::Any& rNewValue,
const uno::Any& rOldValue ) const
{
- DBG_ASSERT( maChildren.size() > nPara, "AccessibleParaManager::FireEvent: invalid index" );
+ DBG_ASSERT( 0 <= nPara && maChildren.size() > static_cast<size_t>(nPara),
+ "AccessibleParaManager::FireEvent: invalid index" );
- if( maChildren.size() > nPara )
+ if( 0 <= nPara && maChildren.size() > static_cast<size_t>(nPara) )
{
WeakPara::HardRefType maChild( GetChild( nPara ).first.get() );
if( maChild.is() )
@@ -136,11 +144,12 @@ namespace accessibility
return aChild.is();
}
- sal_Bool AccessibleParaManager::IsReferencable( sal_uInt32 nChild ) const
+ sal_Bool AccessibleParaManager::IsReferencable( sal_Int32 nChild ) const
{
- DBG_ASSERT( maChildren.size() > nChild, "AccessibleParaManager::IsReferencable: invalid index" );
+ DBG_ASSERT( 0 <= nChild && maChildren.size() > static_cast<size_t>(nChild),
+ "AccessibleParaManager::IsReferencable: invalid index" );
- if( maChildren.size() > nChild )
+ if( 0 <= nChild && maChildren.size() > static_cast<size_t>(nChild) )
{
// retrieve hard reference from weak one
return IsReferencable( GetChild( nChild ).first.get() );
@@ -151,11 +160,12 @@ namespace accessibility
}
}
- AccessibleParaManager::WeakChild AccessibleParaManager::GetChild( sal_uInt32 nParagraphIndex ) const
+ AccessibleParaManager::WeakChild AccessibleParaManager::GetChild( sal_Int32 nParagraphIndex ) const
{
- DBG_ASSERT( maChildren.size() > nParagraphIndex, "AccessibleParaManager::GetChild: invalid index" );
+ DBG_ASSERT( 0 <= nParagraphIndex && maChildren.size() > static_cast<size_t>(nParagraphIndex),
+ "AccessibleParaManager::GetChild: invalid index" );
- if( maChildren.size() > nParagraphIndex )
+ if( 0 <= nParagraphIndex && maChildren.size() > static_cast<size_t>(nParagraphIndex) )
{
return maChildren[ nParagraphIndex ];
}
@@ -168,11 +178,12 @@ namespace accessibility
AccessibleParaManager::Child AccessibleParaManager::CreateChild( sal_Int32 nChild,
const uno::Reference< XAccessible >& xFrontEnd,
SvxEditSourceAdapter& rEditSource,
- sal_uInt32 nParagraphIndex )
+ sal_Int32 nParagraphIndex )
{
- DBG_ASSERT( maChildren.size() > nParagraphIndex, "AccessibleParaManager::CreateChild: invalid index" );
+ DBG_ASSERT( 0 <= nParagraphIndex && maChildren.size() > static_cast<size_t>(nParagraphIndex),
+ "AccessibleParaManager::CreateChild: invalid index" );
- if( maChildren.size() > nParagraphIndex )
+ if( 0 <= nParagraphIndex && maChildren.size() > static_cast<size_t>(nParagraphIndex) )
{
// retrieve hard reference from weak one
WeakPara::HardRefType aChild( GetChild( nParagraphIndex ).first.get() );
@@ -240,7 +251,7 @@ namespace accessibility
void AccessibleParaManager::InitChild( AccessibleEditableTextPara& rChild,
SvxEditSourceAdapter& rEditSource,
sal_Int32 nChild,
- sal_uInt32 nParagraphIndex ) const
+ sal_Int32 nParagraphIndex ) const
{
rChild.SetEditSource( &rEditSource );
rChild.SetIndexInParent( nChild );
@@ -254,7 +265,7 @@ namespace accessibility
rChild.SetState( AccessibleStateType::EDITABLE );
}
- if( mnFocusedChild == static_cast<sal_Int32>(nParagraphIndex) )
+ if( mnFocusedChild == nParagraphIndex )
rChild.SetState( AccessibleStateType::FOCUSED );
// add states passed from outside
@@ -331,17 +342,20 @@ namespace accessibility
const uno::Any& mrOldValue;
};
- void AccessibleParaManager::FireEvent( sal_uInt32 nStartPara,
- sal_uInt32 nEndPara,
+ void AccessibleParaManager::FireEvent( sal_Int32 nStartPara,
+ sal_Int32 nEndPara,
const sal_Int16 nEventId,
const uno::Any& rNewValue,
const uno::Any& rOldValue ) const
{
- DBG_ASSERT( maChildren.size() > nStartPara &&
- maChildren.size() >= nEndPara , "AccessibleParaManager::FireEvent: invalid index" );
-
- if( maChildren.size() > nStartPara &&
- maChildren.size() >= nEndPara )
+ DBG_ASSERT( 0 <= nStartPara && 0 <= nEndPara &&
+ maChildren.size() > static_cast<size_t>(nStartPara) &&
+ maChildren.size() >= static_cast<size_t>(nEndPara) ,
+ "AccessibleParaManager::FireEvent: invalid index" );
+
+ if( 0 <= nStartPara && 0 <= nEndPara &&
+ maChildren.size() > static_cast<size_t>(nStartPara) &&
+ maChildren.size() >= static_cast<size_t>(nEndPara) )
{
VectorOfChildren::const_iterator front = maChildren.begin();
VectorOfChildren::const_iterator back = front;
@@ -367,13 +381,16 @@ namespace accessibility
}
};
- void AccessibleParaManager::Release( sal_uInt32 nStartPara, sal_uInt32 nEndPara )
+ void AccessibleParaManager::Release( sal_Int32 nStartPara, sal_Int32 nEndPara )
{
- DBG_ASSERT( maChildren.size() > nStartPara &&
- maChildren.size() >= nEndPara, "AccessibleParaManager::Release: invalid index" );
-
- if( maChildren.size() > nStartPara &&
- maChildren.size() >= nEndPara )
+ DBG_ASSERT( 0 <= nStartPara && 0 <= nEndPara &&
+ maChildren.size() > static_cast<size_t>(nStartPara) &&
+ maChildren.size() >= static_cast<size_t>(nEndPara),
+ "AccessibleParaManager::Release: invalid index" );
+
+ if( 0 <= nStartPara && 0 <= nEndPara &&
+ maChildren.size() > static_cast<size_t>(nStartPara) &&
+ maChildren.size() >= static_cast<size_t>(nEndPara) )
{
VectorOfChildren::iterator front = maChildren.begin();
VectorOfChildren::iterator back = front;
diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
index 0a66b4c..c7a3c9b 100644
--- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
@@ -86,14 +86,14 @@ namespace accessibility
ESelection MakeSelection( sal_Int32 nStartPara, sal_Int32 nStartIndex,
sal_Int32 nEndPara, sal_Int32 nEndIndex )
{
- DBG_ASSERT(nStartPara >= 0 && nStartPara <= USHRT_MAX &&
+ DBG_ASSERT(nStartPara >= 0 && nStartPara <= SAL_MAX_INT32 &&
nStartIndex >= 0 && nStartIndex <= USHRT_MAX &&
- nEndPara >= 0 && nEndPara <= USHRT_MAX &&
+ nEndPara >= 0 && nEndPara <= SAL_MAX_INT32 &&
nEndIndex >= 0 && nEndIndex <= USHRT_MAX ,
"AccessibleStaticTextBase_Impl::MakeSelection: index value overflow");
- return ESelection( static_cast< sal_uInt16 >(nStartPara), static_cast< sal_uInt16 >(nStartIndex),
- static_cast< sal_uInt16 >(nEndPara), static_cast< sal_uInt16 >(nEndIndex) );
+ return ESelection( nStartPara, static_cast< sal_uInt16 >(nStartIndex),
+ nEndPara, static_cast< sal_uInt16 >(nEndIndex) );
}
//------------------------------------------------------------------------
@@ -321,11 +321,18 @@ namespace accessibility
sal_Int32 AccessibleStaticTextBase_Impl::Internal2Index( EPosition nEEIndex ) const
{
+ // XXX checks for overflow and returns maximum if so
sal_Int32 aRes(0);
- int i;
- for(i=0; i<nEEIndex.nPara; ++i)
- aRes += GetParagraph(i).getCharacterCount();
+ for(sal_Int32 i=0; i<nEEIndex.nPara; ++i)
+ {
+ sal_Int32 nCount = GetParagraph(i).getCharacterCount();
+ if (SAL_MAX_INT32 - aRes > nCount)
+ return SAL_MAX_INT32;
+ aRes += nCount;
+ }
+ if (SAL_MAX_INT32 - aRes > nEEIndex.nIndex)
+ return SAL_MAX_INT32;
return aRes + nEEIndex.nIndex;
}
@@ -365,11 +372,11 @@ namespace accessibility
if( nCurrIndex > nFlatIndex )
{
// check overflow
- DBG_ASSERT(nCurrPara >= 0 && nCurrPara <= USHRT_MAX &&
+ DBG_ASSERT(nCurrPara >= 0 && nCurrPara <= SAL_MAX_INT32 &&
nFlatIndex - nCurrIndex + nCurrCount >= 0 && nFlatIndex - nCurrIndex + nCurrCount <= USHRT_MAX ,
"AccessibleStaticTextBase_Impl::Index2Internal: index value overflow");
- return EPosition( static_cast< sal_uInt16 >(nCurrPara), static_cast< sal_uInt16 >(nFlatIndex - nCurrIndex + nCurrCount) );
+ return EPosition( nCurrPara, static_cast< sal_uInt16 >(nFlatIndex - nCurrIndex + nCurrCount) );
}
}
@@ -377,11 +384,11 @@ namespace accessibility
if( bExclusive && nCurrIndex == nFlatIndex )
{
// check overflow
- DBG_ASSERT(nCurrPara >= 0 && nCurrPara <= USHRT_MAX &&
+ DBG_ASSERT(nCurrPara > 0 && nCurrPara <= SAL_MAX_INT32 &&
nFlatIndex - nCurrIndex + nCurrCount >= 0 && nFlatIndex - nCurrIndex + nCurrCount <= USHRT_MAX ,
"AccessibleStaticTextBase_Impl::Index2Internal: index value overflow");
- return EPosition( static_cast< sal_uInt16 >(nCurrPara-1), static_cast< sal_uInt16 >(nFlatIndex - nCurrIndex + nCurrCount) );
+ return EPosition( nCurrPara-1, static_cast< sal_uInt16 >(nFlatIndex - nCurrIndex + nCurrCount) );
}
// not found? Out of bounds
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index 3f36098..e088215 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -323,7 +323,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox )
fprintf( fp, "================================================================================" );
fprintf( fp, "\n================== Document ================================================" );
fprintf( fp, "\n================================================================================" );
- for ( sal_uInt16 nPortion = 0; nPortion < pEE->pImpEditEngine->GetParaPortions(). Count(); nPortion++)
+ for ( sal_Int32 nPortion = 0; nPortion < pEE->pImpEditEngine->GetParaPortions().Count(); nPortion++)
{
ParaPortion* pPPortion = pEE->pImpEditEngine->GetParaPortions()[nPortion];
fprintf( fp, "\nParagraph %i: Length = %i, Invalid = %i\nText = '%s'",
@@ -463,7 +463,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox )
aR = pV->GetVisArea();
fprintf( fp, "\n VisArea: nX=%li, nY=%li, dX=%li, dY=%li", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() );
ESelection aSel = pV->GetSelection();
- fprintf( fp, "\n Selection: Start=%u,%u, End=%u,%u", aSel.nStartPara, aSel.nStartPos, aSel.nEndPara, aSel.nEndPos );
+ fprintf( fp, "\n Selection: Start=%d,%u, End=%d,%u", aSel.nStartPara, aSel.nStartPos, aSel.nEndPara, aSel.nEndPos );
}
if ( pEE->GetActiveView() )
{
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 06afc77..65de34a3 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -702,8 +702,8 @@ size_t FastGetPos(const _Array& rArray, const _Val* p, size_t& rLastPos)
if (&rArray.at(nIdx) == p)
return rLastPos = nIdx;
- // 0xFFFF is used to signify "not found" condition. We need to change this.
- return std::numeric_limits<sal_uInt16>::max();
+ // XXX "not found" condition for sal_Int32 indexes
+ return EE_PARA_NOT_FOUND;
}
}
@@ -716,33 +716,48 @@ ParaPortionList::~ParaPortionList()
{
}
-sal_uInt16 ParaPortionList::GetPos(const ParaPortion* p) const
+sal_Int32 ParaPortionList::GetPos(const ParaPortion* p) const
{
return FastGetPos(maPortions, p, nLastCache);
}
-ParaPortion* ParaPortionList::operator [](size_t nPos)
+ParaPortion* ParaPortionList::operator [](sal_Int32 nPos)
{
- return nPos < maPortions.size() ? &maPortions[nPos] : NULL;
+ return 0 <= nPos && static_cast<size_t>(nPos) < maPortions.size() ? &maPortions[nPos] : NULL;
}
-const ParaPortion* ParaPortionList::operator [](size_t nPos) const
+const ParaPortion* ParaPortionList::operator [](sal_Int32 nPos) const
{
- return nPos < maPortions.size() ? &maPortions[nPos] : NULL;
+ return 0 <= nPos && static_cast<size_t>(nPos) < maPortions.size() ? &maPortions[nPos] : NULL;
}
-ParaPortion* ParaPortionList::Release(size_t nPos)
+ParaPortion* ParaPortionList::Release(sal_Int32 nPos)
{
+ if (nPos < 0 || maPortions.size() <= static_cast<size_t>(nPos))
+ {
+ SAL_WARN( "editeng", "ParaPortionList::Release - out of bounds pos " << nPos);
+ return NULL;
+ }
return maPortions.release(maPortions.begin()+nPos).release();
}
-void ParaPortionList::Remove(size_t nPos)
+void ParaPortionList::Remove(sal_Int32 nPos)
{
+ if (nPos < 0 || maPortions.size() <= static_cast<size_t>(nPos))
+ {
+ SAL_WARN( "editeng", "ParaPortionList::Remove - out of bounds pos " << nPos);
+ return;
+ }
maPortions.erase(maPortions.begin()+nPos);
}
-void ParaPortionList::Insert(size_t nPos, ParaPortion* p)
+void ParaPortionList::Insert(sal_Int32 nPos, ParaPortion* p)
{
+ if (nPos < 0 || maPortions.size() < static_cast<size_t>(nPos))
+ {
+ SAL_WARN( "editeng", "ParaPortionList::Insert - out of bounds pos " << nPos);
+ return;
+ }
maPortions.insert(maPortions.begin()+nPos, p);
}
@@ -751,9 +766,15 @@ void ParaPortionList::Append(ParaPortion* p)
maPortions.push_back(p);
}
-size_t ParaPortionList::Count() const
+sal_Int32 ParaPortionList::Count() const
{
- return maPortions.size();
+ size_t nSize = maPortions.size();
+ if (nSize > SAL_MAX_INT32)
+ {
+ SAL_WARN( "editeng", "ParaPortionList::Count - overflow " << nSize);
+ return SAL_MAX_INT32;
+ }
+ return nSize;
}
void ParaPortionList::Reset()
@@ -775,26 +796,26 @@ long ParaPortionList::GetYOffset(const ParaPortion* pPPortion) const
return nHeight;
}
-sal_uInt16 ParaPortionList::FindParagraph(long nYOffset) const
+sal_Int32 ParaPortionList::FindParagraph(long nYOffset) const
{
long nY = 0;
for (size_t i = 0, n = maPortions.size(); i < n; ++i)
{
nY += maPortions[i].GetHeight(); // should also be correct even in bVisible!
if ( nY > nYOffset )
- return i;
+ return i <= SAL_MAX_INT32 ? static_cast<sal_Int32>(i) : SAL_MAX_INT32;
}
return EE_PARA_NOT_FOUND;
}
-const ParaPortion* ParaPortionList::SafeGetObject(size_t nPos) const
+const ParaPortion* ParaPortionList::SafeGetObject(sal_Int32 nPos) const
{
- return nPos < maPortions.size() ? &maPortions[nPos] : NULL;
+ return 0 <= nPos && static_cast<size_t>(nPos) < maPortions.size() ? &maPortions[nPos] : NULL;
}
-ParaPortion* ParaPortionList::SafeGetObject(size_t nPos)
+ParaPortion* ParaPortionList::SafeGetObject(sal_Int32 nPos)
{
- return nPos < maPortions.size() ? &maPortions[nPos] : NULL;
+ return 0 <= nPos && static_cast<size_t>(nPos) < maPortions.size() ? &maPortions[nPos] : NULL;
}
#if OSL_DEBUG_LEVEL > 2
@@ -1230,11 +1251,11 @@ sal_Bool EditSelection::Adjust( const EditDoc& rNodes )
const ContentNode* pStartNode = aStartPaM.GetNode();
const ContentNode* pEndNode = aEndPaM.GetNode();
- sal_uInt16 nStartNode = rNodes.GetPos( pStartNode );
- sal_uInt16 nEndNode = rNodes.GetPos( pEndNode );
+ sal_Int32 nStartNode = rNodes.GetPos( pStartNode );
+ sal_Int32 nEndNode = rNodes.GetPos( pEndNode );
- DBG_ASSERT( nStartNode != USHRT_MAX, "Node out of range in Adjust(1)" );
- DBG_ASSERT( nEndNode != USHRT_MAX, "Node out of range in Adjust(2)" );
+ DBG_ASSERT( nStartNode != SAL_MAX_INT32, "Node out of range in Adjust(1)" );
+ DBG_ASSERT( nEndNode != SAL_MAX_INT32, "Node out of range in Adjust(2)" );
sal_Bool bSwap = sal_False;
if ( nStartNode > nEndNode )
@@ -1963,7 +1984,7 @@ void EditDoc::CreateDefFont( sal_Bool bUseStyles )
aDefFont.SetVertical( IsVertical() );
aDefFont.SetOrientation( IsVertical() ? 2700 : 0 );
- for ( sal_uInt16 nNode = 0; nNode < Count(); nNode++ )
+ for ( sal_Int32 nNode = 0; nNode < Count(); nNode++ )
{
ContentNode* pNode = GetObject( nNode );
pNode->GetCharAttribs().GetDefFont() = aDefFont;
@@ -1976,55 +1997,70 @@ static const sal_Unicode aCR[] = { 0x0d, 0x00 };
static const sal_Unicode aLF[] = { 0x0a, 0x00 };
static const sal_Unicode aCRLF[] = { 0x0d, 0x0a, 0x00 };
-size_t EditDoc::GetPos(const ContentNode* p) const
+sal_Int32 EditDoc::GetPos(const ContentNode* p) const
{
return FastGetPos(maContents, p, nLastCache);
}
-const ContentNode* EditDoc::GetObject(size_t nPos) const
+const ContentNode* EditDoc::GetObject(sal_Int32 nPos) const
{
- return nPos < maContents.size() ? &maContents[nPos] : NULL;
+ return 0 <= nPos && static_cast<size_t>(nPos) < maContents.size() ? &maContents[nPos] : NULL;
}
-ContentNode* EditDoc::GetObject(size_t nPos)
+ContentNode* EditDoc::GetObject(sal_Int32 nPos)
{
- return nPos < maContents.size() ? &maContents[nPos] : NULL;
+ return 0 <= nPos && static_cast<size_t>(nPos) < maContents.size() ? &maContents[nPos] : NULL;
}
-const ContentNode* EditDoc::operator[](size_t nPos) const
+const ContentNode* EditDoc::operator[](sal_Int32 nPos) const
{
return GetObject(nPos);
}
-ContentNode* EditDoc::operator[](size_t nPos)
+ContentNode* EditDoc::operator[](sal_Int32 nPos)
{
return GetObject(nPos);
}
-void EditDoc::Insert(size_t nPos, ContentNode* p)
+void EditDoc::Insert(sal_Int32 nPos, ContentNode* p)
{
+ if (nPos < 0 || nPos == SAL_MAX_INT32)
+ {
+ SAL_WARN( "editeng", "EditDoc::Insert - overflow pos " << nPos);
+ return;
+ }
maContents.insert(maContents.begin()+nPos, p);
}
-void EditDoc::Remove(size_t nPos)
+void EditDoc::Remove(sal_Int32 nPos)
{
- if (nPos >= maContents.size())
+ if (nPos < 0 || static_cast<size_t>(nPos) >= maContents.size())
+ {
+ SAL_WARN( "editeng", "EditDoc::Remove - out of bounds pos " << nPos);
return;
-
+ }
maContents.erase(maContents.begin() + nPos);
}
-void EditDoc::Release(size_t nPos)
+void EditDoc::Release(sal_Int32 nPos)
{
- if (nPos >= maContents.size())
+ if (nPos < 0 || static_cast<size_t>(nPos) >= maContents.size())
+ {
+ SAL_WARN( "editeng", "EditDoc::Release - out of bounds pos " << nPos);
return;
-
+ }
maContents.release(maContents.begin() + nPos).release();
}
-size_t EditDoc::Count() const
+sal_Int32 EditDoc::Count() const
{
- return maContents.size();
+ size_t 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);
}
OUString EditDoc::GetSepStr( LineEnd eEnd )
@@ -2042,7 +2078,7 @@ OUString EditDoc::GetSepStr( LineEnd eEnd )
XubString EditDoc::GetText( LineEnd eEnd ) const
{
sal_uLong nLen = GetTextLen();
- size_t nNodes = Count();
+ sal_Int32 nNodes = Count();
if (nNodes == 0)
return OUString();
@@ -2054,8 +2090,8 @@ XubString EditDoc::GetText( LineEnd eEnd ) const
rtl_uString* newStr = rtl_uString_alloc(nLen);
sal_Unicode* pCur = newStr->buffer;
- size_t nLastNode = nNodes-1;
- for ( sal_uInt16 nNode = 0; nNode < nNodes; nNode++ )
+ sal_Int32 nLastNode = nNodes-1;
+ for ( sal_Int32 nNode = 0; nNode < nNodes; nNode++ )
{
String aTmp( GetParaAsString( GetObject(nNode) ) );
memcpy( pCur, aTmp.GetBuffer(), aTmp.Len()*sizeof(sal_Unicode) );
@@ -2070,7 +2106,7 @@ XubString EditDoc::GetText( LineEnd eEnd ) const
return OUString(newStr, SAL_NO_ACQUIRE);
}
-XubString EditDoc::GetParaAsString( sal_uInt16 nNode ) const
+XubString EditDoc::GetParaAsString( sal_Int32 nNode ) const
{
return GetParaAsString( GetObject( nNode ) );
}
@@ -2136,7 +2172,7 @@ EditPaM EditDoc::GetEndPaM() const
sal_uLong EditDoc::GetTextLen() const
{
sal_uLong nLen = 0;
- for ( sal_uInt16 nNode = 0; nNode < Count(); nNode++ )
+ for ( sal_Int32 nNode = 0; nNode < Count(); nNode++ )
{
const ContentNode* pNode = GetObject( nNode );
nLen += pNode->Len();
@@ -2225,7 +2261,7 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs )
{
DBG_ASSERT( aPaM.GetNode(), "Blinder PaM in EditDoc::InsertParaBreak" );
ContentNode* pCurNode = aPaM.GetNode();
- sal_uInt16 nPos = GetPos( pCurNode );
+ sal_Int32 nPos = GetPos( pCurNode );
XubString aStr = aPaM.GetNode()->Copy( aPaM.GetIndex() );
aPaM.GetNode()->Erase( aPaM.GetIndex() );
@@ -2292,7 +2328,7 @@ EditPaM EditDoc::ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight )
// the one to the right disappears.
RemoveItemsFromPool(*pRight);
- sal_uInt16 nRight = GetPos( pRight );
+ sal_Int32 nRight = GetPos( pRight );
Remove( nRight );
SetModified(true);
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index e4f370a..485d976 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -54,11 +54,11 @@ class EditDoc;
struct EPaM
{
- sal_uInt16 nPara;
+ sal_Int32 nPara;
sal_uInt16 nIndex;
EPaM() { nPara = 0; nIndex = 0; }
- EPaM( sal_uInt16 nP, sal_uInt16 nI ) { nPara = nP; nIndex = nI; }
+ EPaM( sal_Int32 nP, sal_uInt16 nI ) { nPara = nP; nIndex = nI; }
EPaM( const EPaM& r) { nPara = r.nPara; nIndex = r.nIndex; }
EPaM& operator = ( const EPaM& r ) { nPara = r.nPara; nIndex = r.nIndex; return *this; }
inline sal_Bool operator == ( const EPaM& r ) const;
@@ -649,20 +649,20 @@ public:
void Reset();
long GetYOffset(const ParaPortion* pPPortion) const;
- sal_uInt16 FindParagraph(long nYOffset) const;
+ sal_Int32 FindParagraph(long nYOffset) const;
- const ParaPortion* SafeGetObject(size_t nPos) const;
- ParaPortion* SafeGetObject(size_t nPos);
+ const ParaPortion* SafeGetObject(sal_Int32 nPos) const;
+ ParaPortion* SafeGetObject(sal_Int32 nPos);
- sal_uInt16 GetPos(const ParaPortion* p) const;
- ParaPortion* operator[](size_t nPos);
- const ParaPortion* operator[](size_t nPos) const;
+ sal_Int32 GetPos(const ParaPortion* p) const;
+ ParaPortion* operator[](sal_Int32 nPos);
+ const ParaPortion* operator[](sal_Int32 nPos) const;
- ParaPortion* Release(size_t nPos);
- void Remove(size_t nPos);
- void Insert(size_t nPos, ParaPortion* p);
+ ParaPortion* Release(sal_Int32 nPos);
+ void Remove(sal_Int32 nPos);
+ void Insert(sal_Int32 nPos, ParaPortion* p);
void Append(ParaPortion* p);
- size_t Count() const;
+ sal_Int32 Count() const;
#if OSL_DEBUG_LEVEL > 2
// temporary:
@@ -711,15 +711,15 @@ class DeletedNodeInfo
{
private:
sal_uIntPtr nInvalidAdressPtr;
- sal_uInt16 nInvalidParagraph;
+ sal_Int32 nInvalidParagraph;
public:
- DeletedNodeInfo( sal_uIntPtr nInvAdr, sal_uInt16 nPos )
+ DeletedNodeInfo( sal_uIntPtr nInvAdr, sal_Int32 nPos )
{ nInvalidAdressPtr = nInvAdr;
nInvalidParagraph = nPos; }
sal_uIntPtr GetInvalidAdress() const { return nInvalidAdressPtr; }
- sal_uInt16 GetPosition() const { return nInvalidParagraph; }
+ sal_Int32 GetPosition() const { return nInvalidParagraph; }
};
// -------------------------------------------------------------------------
@@ -778,7 +778,7 @@ public:
String GetText( LineEnd eEnd ) const;
sal_uLong GetTextLen() const;
- XubString GetParaAsString( sal_uInt16 nNode ) const;
+ XubString GetParaAsString( sal_Int32 nNode ) const;
XubString GetParaAsString(const ContentNode* pNode, sal_uInt16 nStartPos = 0, sal_uInt16 nEndPos = 0xFFFF, bool bResolveFields = true) const;
EditPaM GetStartPaM() const;
@@ -796,17 +796,17 @@ public:
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 );
- size_t GetPos(const ContentNode* pNode) const;
- const ContentNode* GetObject(size_t nPos) const;
- ContentNode* GetObject(size_t nPos);
- size_t Count() const;
- const ContentNode* operator[](size_t nPos) const;
- ContentNode* operator[](size_t nPos);
- void Insert(size_t nPos, ContentNode* p);
+ sal_Int32 GetPos(const ContentNode* pNode) const;
+ const ContentNode* GetObject(sal_Int32 nPos) const;
+ ContentNode* GetObject(sal_Int32 nPos);
+ sal_Int32 Count() const;
+ const ContentNode* operator[](sal_Int32 nPos) const;
+ ContentNode* operator[](sal_Int32 nPos);
+ void Insert(sal_Int32 nPos, ContentNode* p);
/// deletes
- void Remove(size_t nPos);
+ void Remove(sal_Int32 nPos);
/// does not delete
- void Release(size_t nPos);
+ void Release(sal_Int32 nPos);
static OUString GetSepStr( LineEnd eEnd );
};
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 4a242ba..1edc5ae 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -513,7 +513,7 @@ LanguageType EditEngine::GetLanguage(const EditPaM& rPaM) const
return pImpEditEngine->GetLanguage(rPaM);
}
-LanguageType EditEngine::GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const
+LanguageType EditEngine::GetLanguage( sal_Int32 nPara, sal_uInt16 nPos ) const
{
DBG_CHKTHIS( EditEngine, 0 );
ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara );
@@ -625,13 +625,13 @@ sal_uInt32 EditEngine::GetTextLen() const
return pImpEditEngine->GetEditDoc().GetTextLen();
}
-sal_uInt16 EditEngine::GetParagraphCount() const
+sal_Int32 EditEngine::GetParagraphCount() const
{
DBG_CHKTHIS( EditEngine, 0 );
return pImpEditEngine->aEditDoc.Count();
}
-sal_uInt16 EditEngine::GetLineCount( sal_uInt16 nParagraph ) const
+sal_uInt16 EditEngine::GetLineCount( sal_Int32 nParagraph ) const
{
DBG_CHKTHIS( EditEngine, 0 );
if ( !pImpEditEngine->IsFormatted() )
@@ -639,7 +639,7 @@ sal_uInt16 EditEngine::GetLineCount( sal_uInt16 nParagraph ) const
return pImpEditEngine->GetLineCount( nParagraph );
}
-sal_uInt16 EditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const
+sal_uInt16 EditEngine::GetLineLen( sal_Int32 nParagraph, sal_uInt16 nLine ) const
{
DBG_CHKTHIS( EditEngine, 0 );
if ( !pImpEditEngine->IsFormatted() )
@@ -647,7 +647,7 @@ sal_uInt16 EditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) con
return pImpEditEngine->GetLineLen( nParagraph, nLine );
}
-void EditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const
+void EditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const
{
DBG_CHKTHIS( EditEngine, 0 );
if ( !pImpEditEngine->IsFormatted() )
@@ -655,7 +655,7 @@ void EditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16
return pImpEditEngine->GetLineBoundaries( rStart, rEnd, nParagraph, nLine );
}
-sal_uInt16 EditEngine::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_uInt16 EditEngine::GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
DBG_CHKTHIS( EditEngine, 0 );
if ( !pImpEditEngine->IsFormatted() )
@@ -663,7 +663,7 @@ sal_uInt16 EditEngine::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex
return pImpEditEngine->GetLineNumberAtIndex( nPara, nIndex );
}
-sal_uInt32 EditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine )
+sal_uInt32 EditEngine::GetLineHeight( sal_Int32 nParagraph, sal_uInt16 nLine )
{
DBG_CHKTHIS( EditEngine, 0 );
// If someone calls GetLineHeight() with an empty Engine.
@@ -672,7 +672,7 @@ sal_uInt32 EditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine )
return pImpEditEngine->GetLineHeight( nParagraph, nLine );
}
-sal_uInt32 EditEngine::GetTextHeight( sal_uInt16 nParagraph ) const
+sal_uInt32 EditEngine::GetTextHeight( sal_Int32 nParagraph ) const
{
DBG_CHKTHIS( EditEngine, 0 );
@@ -683,7 +683,7 @@ sal_uInt32 EditEngine::GetTextHeight( sal_uInt16 nParagraph ) const
return nHeight;
}
-XubString EditEngine::GetWord( sal_uInt16 nPara, sal_uInt16 nIndex )
+XubString EditEngine::GetWord( sal_Int32 nPara, sal_uInt16 nIndex )
{
ESelection aESel( nPara, nIndex, nPara, nIndex );
EditSelection aSel( pImpEditEngine->CreateSel( aESel ) );
@@ -736,7 +736,7 @@ sal_uInt16 EditEngine::GetScriptType(const EditSelection& rSel) const
return pImpEditEngine->GetScriptType(rSel);
}
-void EditEngine::RemoveParaPortion(size_t nNode)
+void EditEngine::RemoveParaPortion(sal_Int32 nNode)
{
pImpEditEngine->GetParaPortions().Remove(nNode);
}
@@ -761,17 +761,17 @@ void EditEngine::UpdateSelections()
pImpEditEngine->UpdateSelections();
}
-void EditEngine::InsertContent(ContentNode* pNode, sal_uInt16 nPos)
+void EditEngine::InsertContent(ContentNode* pNode, sal_Int32 nPos)
{
pImpEditEngine->InsertContent(pNode, nPos);
}
-EditPaM EditEngine::SplitContent(sal_uInt16 nNode, sal_uInt16 nSepPos)
+EditPaM EditEngine::SplitContent(sal_Int32 nNode, sal_uInt16 nSepPos)
{
return pImpEditEngine->SplitContent(nNode, nSepPos);
}
-EditPaM EditEngine::ConnectContents(sal_uInt16 nLeftNode, bool bBackward)
+EditPaM EditEngine::ConnectContents(sal_Int32 nLeftNode, bool bBackward)
{
return pImpEditEngine->ConnectContents(nLeftNode, bBackward);
}
@@ -781,12 +781,12 @@ EditPaM EditEngine::InsertFeature(const EditSelection& rEditSelection, const Sfx
return pImpEditEngine->ImpInsertFeature(rEditSelection, rItem);
}
-EditSelection EditEngine::MoveParagraphs(const Range& rParagraphs, sal_uInt16 nNewPos, EditView* pCurView)
+EditSelection EditEngine::MoveParagraphs(const Range& rParagraphs, sal_Int32 nNewPos, EditView* pCurView)
{
return pImpEditEngine->MoveParagraphs(rParagraphs, nNewPos, pCurView);
}
-void EditEngine::RemoveCharAttribs(sal_uInt16 nPara, sal_uInt16 nWhich, bool bRemoveFeatures)
+void EditEngine::RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich, bool bRemoveFeatures)
{
pImpEditEngine->RemoveCharAttribs(nPara, nWhich, bRemoveFeatures);
}
@@ -963,12 +963,12 @@ EditSelection EditEngine::CreateSelection(const ESelection& rSel)
return pImpEditEngine->CreateSel(rSel);
}
-const SfxItemSet& EditEngine::GetBaseParaAttribs(sal_uInt16 nPara) const
+const SfxItemSet& EditEngine::GetBaseParaAttribs(sal_Int32 nPara) const
{
return pImpEditEngine->GetParaAttribs(nPara);
}
-void EditEngine::SetParaAttribsOnly(sal_uInt16 nPara, const SfxItemSet& rSet)
+void EditEngine::SetParaAttribsOnly(sal_Int32 nPara, const SfxItemSet& rSet)
{
pImpEditEngine->SetParaAttribs(nPara, rSet);
}
@@ -1080,11 +1080,11 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
{
if ( rKeyEvent.GetKeyCode().IsMod1() && rKeyEvent.GetKeyCode().IsMod2() )
{
- sal_uInt16 nParas = GetParagraphCount();
+ sal_Int32 nParas = GetParagraphCount();
Point aPos;
Point aViewStart( pEditView->GetOutputArea().TopLeft() );
long n20 = 40 * pImpEditEngine->nOnePixelInRef;
- for ( sal_uInt16 n = 0; n < nParas; n++ )
+ for ( sal_Int32 n = 0; n < nParas; n++ )
{
long nH = GetTextHeight( n );
Point P1( aViewStart.X() + n20 + n20*(n%2), aViewStart.Y() + aPos.Y() );
@@ -1191,7 +1191,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
// now on and that will be all. Otherwise continue as usual.
// ...
- sal_uInt16 nPara = pImpEditEngine->GetEditDoc().GetPos( pNode );
+ sal_Int32 nPara = pImpEditEngine->GetEditDoc().GetPos( pNode );
SfxBoolItem aBulletState( (const SfxBoolItem&) pImpEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) );
bool bBulletIsVisible = aBulletState.GetValue() ? true : false;
@@ -1579,7 +1579,7 @@ void EditEngine::SetText( const EditTextObject& rTextObject )
pImpEditEngine->LeaveBlockNotifications();
}
-void EditEngine::ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow )
+void EditEngine::ShowParagraph( sal_Int32 nParagraph, sal_Bool bShow )
{
DBG_CHKTHIS( EditEngine, 0 );
pImpEditEngine->ShowParagraph( nParagraph, bShow );
@@ -1646,10 +1646,10 @@ void EditEngine::SetEndPasteOrDropHdl( const Link& rLink )
pImpEditEngine->aEndPasteOrDropHdl = rLink;
}
-EditTextObject* EditEngine::CreateTextObject( sal_uInt16 nPara, sal_uInt16 nParas )
+EditTextObject* EditEngine::CreateTextObject( sal_Int32 nPara, sal_Int32 nParas )
{
DBG_CHKTHIS( EditEngine, 0 );
- DBG_ASSERT( nPara < pImpEditEngine->GetEditDoc().Count(), "CreateTextObject: Startpara out of Range" );
+ DBG_ASSERT( 0 <= nPara && nPara < pImpEditEngine->GetEditDoc().Count(), "CreateTextObject: Startpara out of Range" );
DBG_ASSERT( nParas <= pImpEditEngine->GetEditDoc().Count() - nPara, "CreateTextObject: Endpara out of Range" );
ContentNode* pStartNode = pImpEditEngine->GetEditDoc().GetObject( nPara );
@@ -1667,7 +1667,7 @@ EditTextObject* EditEngine::CreateTextObject( sal_uInt16 nPara, sal_uInt16 nPara
return 0;
}
-void EditEngine::RemoveParagraph( sal_uInt16 nPara )
+void EditEngine::RemoveParagraph( sal_Int32 nPara )
{
DBG_CHKTHIS( EditEngine, 0 );
DBG_ASSERT( pImpEditEngine->GetEditDoc().Count() > 1, "The first paragraph should not be deleted!" );
@@ -1687,7 +1687,7 @@ void EditEngine::RemoveParagraph( sal_uInt16 nPara )
}
}
-sal_uInt16 EditEngine::GetTextLen( sal_uInt16 nPara ) const
+sal_uInt16 EditEngine::GetTextLen( sal_Int32 nPara ) const
{
DBG_CHKTHIS( EditEngine, 0 );
ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara );
@@ -1697,11 +1697,11 @@ sal_uInt16 EditEngine::GetTextLen( sal_uInt16 nPara ) const
return 0;
}
-XubString EditEngine::GetText( sal_uInt16 nPara ) const
+XubString EditEngine::GetText( sal_Int32 nPara ) const
{
DBG_CHKTHIS( EditEngine, 0 );
XubString aStr;
- if ( nPara < pImpEditEngine->GetEditDoc().Count() )
+ if ( 0 <= nPara && nPara < pImpEditEngine->GetEditDoc().Count() )
aStr = pImpEditEngine->GetEditDoc().GetParaAsString( nPara );
return aStr;
}
@@ -1744,12 +1744,12 @@ sal_Bool EditEngine::IsInSelectionMode() const
pImpEditEngine->GetSelEngine().IsInSelection() );
}
-void EditEngine::InsertParagraph( sal_uInt16 nPara, const EditTextObject& rTxtObj )
+void EditEngine::InsertParagraph( sal_Int32 nPara, const EditTextObject& rTxtObj )
{
DBG_CHKTHIS( EditEngine, 0 );
if ( nPara > GetParagraphCount() )
{
- DBG_ASSERTWARNING( nPara == USHRT_MAX, "Paragraph number to large, but not LIST_APPEND!" );
+ DBG_ASSERTWARNING( nPara == EE_PARA_APPEND, "Paragraph number too large, but not EE_PARA_APPEND!" );
nPara = GetParagraphCount();
}
@@ -1767,12 +1767,12 @@ void EditEngine::InsertParagraph( sal_uInt16 nPara, const EditTextObject& rTxtOb
pImpEditEngine->FormatAndUpdate();
}
-void EditEngine::InsertParagraph( sal_uInt16 nPara, const XubString& rTxt )
+void EditEngine::InsertParagraph( sal_Int32 nPara, const XubString& rTxt )
{
DBG_CHKTHIS( EditEngine, 0 );
if ( nPara > GetParagraphCount() )
{
- DBG_ASSERTWARNING( nPara == USHRT_MAX, "Paragraph number to large, but not LIST_APPEND!" );
+ DBG_ASSERTWARNING( nPara == EE_PARA_APPEND, "Paragraph number too large, but not EE_PARA_APPEND!" );
nPara = GetParagraphCount();
}
@@ -1786,7 +1786,7 @@ void EditEngine::InsertParagraph( sal_uInt16 nPara, const XubString& rTxt )
pImpEditEngine->FormatAndUpdate();
}
-void EditEngine::SetText( sal_uInt16 nPara, const XubString& rTxt )
+void EditEngine::SetText( sal_Int32 nPara, const XubString& rTxt )
{
DBG_CHKTHIS( EditEngine, 0 );
EditSelection* pSel = pImpEditEngine->SelectParagraph( nPara );
@@ -1800,32 +1800,32 @@ void EditEngine::SetText( sal_uInt16 nPara, const XubString& rTxt )
}
}
-void EditEngine::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet )
+void EditEngine::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
{
DBG_CHKTHIS( EditEngine, 0 );
pImpEditEngine->SetParaAttribs( nPara, rSet );
pImpEditEngine->FormatAndUpdate();
}
-const SfxItemSet& EditEngine::GetParaAttribs( sal_uInt16 nPara ) const
+const SfxItemSet& EditEngine::GetParaAttribs( sal_Int32 nPara ) const
{
DBG_CHKTHIS( EditEngine, 0 );
return pImpEditEngine->GetParaAttribs( nPara );
}
-sal_Bool EditEngine::HasParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const
+sal_Bool EditEngine::HasParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
DBG_CHKTHIS( EditEngine, 0 );
return pImpEditEngine->HasParaAttrib( nPara, nWhich );
}
-const SfxPoolItem& EditEngine::GetParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich )
+const SfxPoolItem& EditEngine::GetParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich )
{
DBG_CHKTHIS( EditEngine, 0 );
return pImpEditEngine->GetParaAttrib( nPara, nWhich );
}
-void EditEngine::GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const
+void EditEngine::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const
{
DBG_CHKTHIS( EditEngine, 0 );
pImpEditEngine->GetCharAttribs( nPara, rLst );
@@ -1839,7 +1839,7 @@ SfxItemSet EditEngine::GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAtt
return pImpEditEngine->GetAttribs( aSel, bOnlyHardAttrib );
}
-SfxItemSet EditEngine::GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags ) const
+SfxItemSet EditEngine::GetAttribs( sal_Int32 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags ) const
{
DBG_CHKTHIS( EditEngine, 0 );
return pImpEditEngine->GetAttribs( nPara, nStart, nEnd, nFlags );
@@ -1856,13 +1856,13 @@ void EditEngine::RemoveAttribs( const ESelection& rSelection, sal_Bool bRemovePa
pImpEditEngine->FormatAndUpdate();
}
-Font EditEngine::GetStandardFont( sal_uInt16 nPara )
+Font EditEngine::GetStandardFont( sal_Int32 nPara )
{
DBG_CHKTHIS( EditEngine, 0 );
return GetStandardSvxFont( nPara );
}
-SvxFont EditEngine::GetStandardSvxFont( sal_uInt16 nPara )
+SvxFont EditEngine::GetStandardSvxFont( sal_Int32 nPara )
{
DBG_CHKTHIS( EditEngine, 0 );
ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara );
@@ -1882,7 +1882,7 @@ void EditEngine::StripPortions()
pImpEditEngine->Paint( &aTmpDev, aBigRect, Point(), sal_True );
}
-void EditEngine::GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList )
+void EditEngine::GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList )
{
if ( !pImpEditEngine->IsFormatted() )
pImpEditEngine->FormatFullDoc();
@@ -1953,8 +1953,8 @@ void EditEngine::SetControlWord( sal_uInt32 nWord )
if ( bSpellingChanged && ( nWord & EE_CNTRL_ONLINESPELLING ) )
{
// Create WrongList, start timer...
- sal_uInt16 nNodes = pImpEditEngine->GetEditDoc().Count();
- for ( sal_uInt16 n = 0; n < nNodes; n++ )
+ sal_Int32 nNodes = pImpEditEngine->GetEditDoc().Count();
+ for ( sal_Int32 n = 0; n < nNodes; n++ )
{
ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( n );
pNode->CreateWrongList();
@@ -1965,8 +1965,8 @@ void EditEngine::SetControlWord( sal_uInt32 nWord )
else
{
long nY = 0;
- sal_uInt16 nNodes = pImpEditEngine->GetEditDoc().Count();
- for ( sal_uInt16 n = 0; n < nNodes; n++ )
+ sal_Int32 nNodes = pImpEditEngine->GetEditDoc().Count();
+ for ( sal_Int32 n = 0; n < nNodes; n++ )
{
ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( n );
const ParaPortion* pPortion = pImpEditEngine->GetParaPortions()[n];
@@ -1994,7 +1994,7 @@ sal_uInt32 EditEngine::GetControlWord() const
return pImpEditEngine->aStatus.GetControlWord();
}
-long EditEngine::GetFirstLineStartX( sal_uInt16 nParagraph )
+long EditEngine::GetFirstLineStartX( sal_Int32 nParagraph )
{
DBG_CHKTHIS( EditEngine, 0 );
@@ -2022,7 +2022,7 @@ Point EditEngine::GetDocPos( const Point& rPaperPos ) const
return aDocPos;
}
-Point EditEngine::GetDocPosTopLeft( sal_uInt16 nParagraph )
+Point EditEngine::GetDocPosTopLeft( sal_Int32 nParagraph )
{
DBG_CHKTHIS( EditEngine, 0 );
const ParaPortion* pPPortion = pImpEditEngine->GetParaPortions().SafeGetObject( nParagraph );
@@ -2058,7 +2058,7 @@ Point EditEngine::GetDocPosTopLeft( sal_uInt16 nParagraph )
return aPoint;
}
-const SvxNumberFormat* EditEngine::GetNumberFormat( sal_uInt16 nPara ) const
+const SvxNumberFormat* EditEngine::GetNumberFormat( sal_Int32 nPara ) const
{
// derived objects may overload this function to give access to
// bullet information (see Outliner)
@@ -2066,7 +2066,7 @@ const SvxNumberFormat* EditEngine::GetNumberFormat( sal_uInt16 nPara ) const
return 0;
}
-sal_Bool EditEngine::IsRightToLeft( sal_uInt16 nPara ) const
+sal_Bool EditEngine::IsRightToLeft( sal_Int32 nPara ) const
{
DBG_CHKTHIS( EditEngine, 0 );
return pImpEditEngine->IsRightToLeft( nPara );
@@ -2131,7 +2131,7 @@ void EditEngine::QuickMarkInvalid( const ESelection& rSel )
DBG_CHKTHIS( EditEngine, 0 );
DBG_ASSERT( rSel.nStartPara < pImpEditEngine->GetEditDoc().Count(), "MarkInvalid: Start out of Range!" );
DBG_ASSERT( rSel.nEndPara < pImpEditEngine->GetEditDoc().Count(), "MarkInvalid: End out of Range!" );
- for ( sal_uInt16 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ )
+ for ( sal_Int32 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ )
{
ParaPortion* pPortion = pImpEditEngine->GetParaPortions().SafeGetObject( nPara );
if ( pPortion )
@@ -2159,7 +2159,7 @@ void EditEngine::QuickDelete( const ESelection& rSel )
pImpEditEngine->ImpDeleteSelection( aSel );
}
-void EditEngine::QuickMarkToBeRepainted( sal_uInt16 nPara )
+void EditEngine::QuickMarkToBeRepainted( sal_Int32 nPara )
{
DBG_CHKTHIS( EditEngine, 0 );
ParaPortion* pPortion = pImpEditEngine->GetParaPortions().SafeGetObject( nPara );
@@ -2199,7 +2199,7 @@ void EditEngine::QuickFormatDoc( sal_Bool bFull )
pImpEditEngine->UpdateViews( NULL );
}
-void EditEngine::QuickRemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich )
+void EditEngine::QuickRemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich )
{
DBG_CHKTHIS( EditEngine, 0 );
pImpEditEngine->RemoveCharAttribs( nPara, nWhich );
@@ -2210,19 +2210,19 @@ void EditEngine::SetStyleSheet(const EditSelection& aSel, SfxStyleSheet* pStyle)
pImpEditEngine->SetStyleSheet(aSel, pStyle);
}
-void EditEngine::SetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle )
+void EditEngine::SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle )
{
DBG_CHKTHIS( EditEngine, 0 );
pImpEditEngine->SetStyleSheet( nPara, pStyle );
}
-const SfxStyleSheet* EditEngine::GetStyleSheet( sal_uInt16 nPara ) const
+const SfxStyleSheet* EditEngine::GetStyleSheet( sal_Int32 nPara ) const
{
DBG_CHKTHIS( EditEngine, 0 );
return pImpEditEngine->GetStyleSheet( nPara );
}
-SfxStyleSheet* EditEngine::GetStyleSheet( sal_uInt16 nPara )
+SfxStyleSheet* EditEngine::GetStyleSheet( sal_Int32 nPara )
{
DBG_CHKTHIS( EditEngine, 0 );
return pImpEditEngine->GetStyleSheet( nPara );
@@ -2368,9 +2368,9 @@ void EditEngine::GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY ) const
sal_Bool EditEngine::ShouldCreateBigTextObject() const
{
DBG_CHKTHIS( EditEngine, 0 );
- sal_uInt16 nTextPortions = 0;
- sal_uInt16 nParas = pImpEditEngine->GetEditDoc().Count();
- for ( sal_uInt16 nPara = 0; nPara < nParas; nPara++ )
+ sal_uInt32 nTextPortions = 0;
+ sal_Int32 nParas = pImpEditEngine->GetEditDoc().Count();
+ for ( sal_Int32 nPara = 0; nPara < nParas; nPara++ )
{
ParaPortion* pParaPortion = pImpEditEngine->GetParaPortions()[nPara];
nTextPortions = nTextPortions + pParaPortion->GetTextPortions().Count();
@@ -2378,7 +2378,7 @@ sal_Bool EditEngine::ShouldCreateBigTextObject() const
return ( nTextPortions >= pImpEditEngine->GetBigTextObjectStart() ) ? sal_True : sal_False;
}
-sal_uInt16 EditEngine::GetFieldCount( sal_uInt16 nPara ) const
+sal_uInt16 EditEngine::GetFieldCount( sal_Int32 nPara ) const
{
sal_uInt16 nFields = 0;
ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara );
@@ -2396,7 +2396,7 @@ sal_uInt16 EditEngine::GetFieldCount( sal_uInt16 nPara ) const
return nFields;
}
-EFieldInfo EditEngine::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const
+EFieldInfo EditEngine::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
{
ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara );
if ( pNode )
@@ -2446,8 +2446,8 @@ void EditEngine::RemoveFields( sal_Bool bKeepFieldText, TypeId aType )
if ( bKeepFieldText )
pImpEditEngine->UpdateFields();
- sal_uInt16 nParas = pImpEditEngine->GetEditDoc().Count();
- for ( sal_uInt16 nPara = 0; nPara < nParas; nPara++ )
+ sal_Int32 nParas = pImpEditEngine->GetEditDoc().Count();
+ for ( sal_Int32 nPara = 0; nPara < nParas; nPara++ )
{
ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara );
const CharAttribList::AttribsType& rAttrs = pNode->GetCharAttribs().GetAttribs();
@@ -2472,8 +2472,8 @@ void EditEngine::RemoveFields( sal_Bool bKeepFieldText, TypeId aType )
sal_Bool EditEngine::HasOnlineSpellErrors() const
{
DBG_CHKTHIS( EditEngine, 0 );
- sal_uInt16 nNodes = pImpEditEngine->GetEditDoc().Count();
- for ( sal_uInt16 n = 0; n < nNodes; n++ )
+ sal_Int32 nNodes = pImpEditEngine->GetEditDoc().Count();
+ for ( sal_Int32 n = 0; n < nNodes; n++ )
{
ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( n );
if ( pNode->GetWrongList() && !pNode->GetWrongList()->empty() )
@@ -2495,7 +2495,7 @@ void EditEngine::CompleteOnlineSpelling()
}
}
-sal_uInt16 EditEngine::FindParagraph( long nDocPosY )
+sal_Int32 EditEngine::FindParagraph( long nDocPosY )
{
return pImpEditEngine->GetParaPortions().FindParagraph( nDocPosY );
}
@@ -2529,7 +2529,7 @@ Rectangle EditEngine::GetCharacterBounds( const EPosition& rPos ) const
return aBounds;
}
-ParagraphInfos EditEngine::GetParagraphInfos( sal_uInt16 nPara )
+ParagraphInfos EditEngine::GetParagraphInfos( sal_Int32 nPara )
{
DBG_CHKTHIS( EditEngine, 0 );
@@ -2571,7 +2571,7 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_uInt16 nPara )
// ====================== Virtual Methods ========================
// =====================================================================
void EditEngine::DrawingText( const Point&, const XubString&, sal_uInt16, sal_uInt16,
- const sal_Int32*, const SvxFont&, sal_uInt16, sal_uInt16, sal_uInt8,
+ const sal_Int32*, const SvxFont&, sal_Int32, sal_uInt16, sal_uInt8,
const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, bool,
const ::com::sun::star::lang::Locale*, const Color&, const Color&)
@@ -2581,7 +2581,7 @@ void EditEngine::DrawingText( const Point&, const XubString&, sal_uInt16, sal_uI
void EditEngine::DrawingTab( const Point& /*rStartPos*/, long /*nWidth*/,
const String& /*rChar*/, const SvxFont& /*rFont*/,
- sal_uInt16 /*nPara*/, xub_StrLen /*nIndex*/,
+ sal_Int32 /*nPara*/, xub_StrLen /*nIndex*/,
sal_uInt8 /*nRightToLeft*/, bool /*bEndOfLine*/,
bool /*bEndOfParagraph*/, const Color& /*rOverlineColor*/,
const Color& /*rTextLineColor*/)
@@ -2589,12 +2589,12 @@ void EditEngine::DrawingTab( const Point& /*rStartPos*/, long /*nWidth*/,
DBG_CHKTHIS( EditEngine, 0 );
}
-void EditEngine::PaintingFirstLine( sal_uInt16, const Point&, long, const Point&, short, OutputDevice* )
+void EditEngine::PaintingFirstLine( sal_Int32, const Point&, long, const Point&, short, OutputDevice* )
{
DBG_CHKTHIS( EditEngine, 0 );
}
-void EditEngine::ParagraphInserted( sal_uInt16 nPara )
+void EditEngine::ParagraphInserted( sal_Int32 nPara )
{
DBG_CHKTHIS( EditEngine, 0 );
@@ -2607,7 +2607,7 @@ void EditEngine::ParagraphInserted( sal_uInt16 nPara )
}
}
-void EditEngine::ParagraphDeleted( sal_uInt16 nPara )
+void EditEngine::ParagraphDeleted( sal_Int32 nPara )
{
DBG_CHKTHIS( EditEngine, 0 );
@@ -2619,19 +2619,19 @@ void EditEngine::ParagraphDeleted( sal_uInt16 nPara )
pImpEditEngine->CallNotify( aNotify );
}
}
-void EditEngine::ParagraphConnected( sal_uInt16 /*nLeftParagraph*/, sal_uInt16 /*nRightParagraph*/ )
+void EditEngine::ParagraphConnected( sal_Int32 /*nLeftParagraph*/, sal_Int32 /*nRightParagraph*/ )
{
DBG_CHKTHIS( EditEngine, 0 );
}
-sal_Bool EditEngine::FormattingParagraph( sal_uInt16 )
+sal_Bool EditEngine::FormattingParagraph( sal_Int32 )
{
// return sal_True, if the Attribute was changed ...
DBG_CHKTHIS( EditEngine, 0 );
return sal_False;
}
-void EditEngine::ParaAttribsChanged( sal_uInt16 /* nParagraph */ )
+void EditEngine::ParaAttribsChanged( sal_Int32 /* nParagraph */ )
{
DBG_CHKTHIS( EditEngine, 0 );
}
@@ -2641,7 +2641,7 @@ void EditEngine::StyleSheetChanged( SfxStyleSheet* /* pStyle */ )
DBG_CHKTHIS( EditEngine, 0 );
}
-void EditEngine::ParagraphHeightChanged( sal_uInt16 nPara )
+void EditEngine::ParagraphHeightChanged( sal_Int32 nPara )
{
DBG_CHKTHIS( EditEngine, 0 );
@@ -2707,23 +2707,23 @@ XubString EditEngine::GetUndoComment( sal_uInt16 nId ) const
return aComment;
}
-Rectangle EditEngine::GetBulletArea( sal_uInt16 )
+Rectangle EditEngine::GetBulletArea( sal_Int32 )
{
return Rectangle( Point(), Point() );
}
-OUString EditEngine::CalcFieldValue( const SvxFieldItem&, sal_uInt16, sal_uInt16, Color*&, Color*& )
+OUString EditEngine::CalcFieldValue( const SvxFieldItem&, sal_Int32, sal_uInt16, Color*&, Color*& )
{
DBG_CHKTHIS( EditEngine, 0 );
return OUString(' ');
}
-void EditEngine::FieldClicked( const SvxFieldItem&, sal_uInt16, sal_uInt16 )
+void EditEngine::FieldClicked( const SvxFieldItem&, sal_Int32, sal_uInt16 )
{
DBG_CHKTHIS( EditEngine, 0 );
}
-void EditEngine::FieldSelected( const SvxFieldItem&, sal_uInt16, sal_uInt16 )
+void EditEngine::FieldSelected( const SvxFieldItem&, sal_Int32, sal_uInt16 )
{
DBG_CHKTHIS( EditEngine, 0 );
}
@@ -2936,7 +2936,7 @@ EFieldInfo::EFieldInfo()
}
-EFieldInfo::EFieldInfo( const SvxFieldItem& rFieldItem, sal_uInt16 nPara, sal_uInt16 nPos ) : aPosition( nPara, nPos )
+EFieldInfo::EFieldInfo( const SvxFieldItem& rFieldItem, sal_Int32 nPara, sal_uInt16 nPos ) : aPosition( nPara, nPos )
{
pFieldItem = new SvxFieldItem( rFieldItem );
}
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 8231396..2dd86b9 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -221,12 +221,12 @@ EditTextObject::~EditTextObject()
delete mpImpl;
}
-size_t EditTextObject::GetParagraphCount() const
+sal_Int32 EditTextObject::GetParagraphCount() const
{
return mpImpl->GetParagraphCount();
}
-String EditTextObject::GetText(size_t nPara) const
+String EditTextObject::GetText(sal_Int32 nPara) const
{
return mpImpl->GetText(nPara);
}
@@ -241,7 +241,7 @@ bool EditTextObject::HasOnlineSpellErrors() const
return mpImpl->HasOnlineSpellErrors();
}
-void EditTextObject::GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const
+void EditTextObject::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const
{
mpImpl->GetCharAttribs(nPara, rLst);
}
@@ -256,7 +256,7 @@ const SvxFieldItem* EditTextObject::GetField() const
return mpImpl->GetField();
}
-const SvxFieldData* EditTextObject::GetFieldData(size_t nPara, size_t nPos, sal_Int32 nType) const
+const SvxFieldData* EditTextObject::GetFieldData(sal_Int32 nPara, size_t nPos, sal_Int32 nType) const
{
return mpImpl->GetFieldData(nPara, nPos, nType);
}
@@ -266,7 +266,7 @@ bool EditTextObject::HasField( sal_Int32 nType ) const
return mpImpl->HasField(nType);
}
-const SfxItemSet& EditTextObject::GetParaAttribs(size_t nPara) const
+const SfxItemSet& EditTextObject::GetParaAttribs(sal_Int32 nPara) const
{
return mpImpl->GetParaAttribs(nPara);
}
@@ -276,12 +276,12 @@ bool EditTextObject::RemoveCharAttribs( sal_uInt16 nWhich )
return mpImpl->RemoveCharAttribs(nWhich);
}
-void EditTextObject::GetStyleSheet(size_t nPara, String& rName, SfxStyleFamily& eFamily) const
+void EditTextObject::GetStyleSheet(sal_Int32 nPara, String& rName, SfxStyleFamily& eFamily) const
{
mpImpl->GetStyleSheet(nPara, rName, eFamily);
}
-void EditTextObject::SetStyleSheet(size_t nPara, const String& rName, const SfxStyleFamily& eFamily)
+void EditTextObject::SetStyleSheet(sal_Int32 nPara, const String& rName, const SfxStyleFamily& eFamily)
{
mpImpl->SetStyleSheet(nPara, rName, eFamily);
}
@@ -635,14 +635,20 @@ ContentInfo* EditTextObjectImpl::CreateAndInsertContent()
return &aContents.back();
}
-size_t EditTextObjectImpl::GetParagraphCount() const
+sal_Int32 EditTextObjectImpl::GetParagraphCount() const
{
- return aContents.size();
+ size_t nSize = aContents.size();
+ if (nSize > EE_PARA_MAX_COUNT)
+ {
+ SAL_WARN( "editeng", "EditTextObjectImpl::GetParagraphCount - overflow " << nSize);
+ return EE_PARA_MAX_COUNT;
+ }
+ return static_cast<sal_Int32>(nSize);
}
-String EditTextObjectImpl::GetText(size_t nPara) const
+String EditTextObjectImpl::GetText(sal_Int32 nPara) const
{
- if (nPara >= aContents.size())
+ if (nPara < 0 || static_cast<size_t>(nPara) >= aContents.size())
return String();
return aContents[nPara].GetText();
@@ -668,8 +674,11 @@ bool EditTextObjectImpl::HasOnlineSpellErrors() const
return false;
}
-void EditTextObjectImpl::GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const
+void EditTextObjectImpl::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const
{
+ if (nPara < 0 || static_cast<size_t>(nPara) >= aContents.size())
+ return;
+
rLst.clear();
const ContentInfo& rC = aContents[nPara];
for (size_t nAttr = 0; nAttr < rC.aAttribs.size(); ++nAttr)
@@ -708,9 +717,9 @@ const SvxFieldItem* EditTextObjectImpl::GetField() const
return 0;
}
-const SvxFieldData* EditTextObjectImpl::GetFieldData(size_t nPara, size_t nPos, sal_Int32 nType) const
+const SvxFieldData* EditTextObjectImpl::GetFieldData(sal_Int32 nPara, size_t nPos, sal_Int32 nType) const
{
- if (nPara >= aContents.size())
+ if (nPara < 0 || static_cast<size_t>(nPara) >= aContents.size())
return NULL;
const ContentInfo& rC = aContents[nPara];
@@ -768,14 +777,17 @@ bool EditTextObjectImpl::HasField( sal_Int32 nType ) const
return false;
}
-const SfxItemSet& EditTextObjectImpl::GetParaAttribs(size_t nPara) const
+const SfxItemSet& EditTextObjectImpl::GetParaAttribs(sal_Int32 nPara) const
{
const ContentInfo& rC = aContents[nPara];
return rC.GetParaAttribs();
}
-void EditTextObjectImpl::SetParaAttribs(size_t nPara, const SfxItemSet& rAttribs)
+void EditTextObjectImpl::SetParaAttribs(sal_Int32 nPara, const SfxItemSet& rAttribs)
{
+ if (nPara < 0 || static_cast<size_t>(nPara) >= aContents.size())
+ return;
+
ContentInfo& rC = aContents[nPara];
rC.GetParaAttribs().Set(rAttribs);
ClearPortionInfo();
@@ -785,7 +797,7 @@ bool EditTextObjectImpl::RemoveCharAttribs( sal_uInt16 _nWhich )
{
bool bChanged = false;
- for ( sal_uInt16 nPara = aContents.size(); nPara; )
+ for ( size_t nPara = aContents.size(); nPara; )
{
ContentInfo& rC = aContents[--nPara];
@@ -807,9 +819,9 @@ bool EditTextObjectImpl::RemoveCharAttribs( sal_uInt16 _nWhich )
return bChanged;
}
-void EditTextObjectImpl::GetStyleSheet(size_t nPara, String& rName, SfxStyleFamily& rFamily) const
+void EditTextObjectImpl::GetStyleSheet(sal_Int32 nPara, String& rName, SfxStyleFamily& rFamily) const
{
- if (nPara >= aContents.size())
+ if (nPara < 0 || static_cast<size_t>(nPara) >= aContents.size())
return;
const ContentInfo& rC = aContents[nPara];
@@ -817,9 +829,9 @@ void EditTextObjectImpl::GetStyleSheet(size_t nPara, String& rName, SfxStyleFami
rFamily = rC.GetFamily();
}
-void EditTextObjectImpl::SetStyleSheet(size_t nPara, const String& rName, const SfxStyleFamily& rFamily)
+void EditTextObjectImpl::SetStyleSheet(sal_Int32 nPara, const String& rName, const SfxStyleFamily& rFamily)
{
- if (nPara >= aContents.size())
+ if (nPara < 0 || static_cast<size_t>(nPara) >= aContents.size())
return;
ContentInfo& rC = aContents[nPara];
@@ -908,13 +920,16 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
// The number of paragraphs ...
size_t nParagraphs = aContents.size();
- rOStream << static_cast<sal_uInt16>(nParagraphs);
+ // FIXME: this truncates, check usage of stream and if it can be changed,
+ // i.e. is not persistent, adapt this and reader.
+ sal_uInt16 nParagraphs_Stream = static_cast<sal_uInt16>(nParagraphs);
+ rOStream << nParagraphs_Stream;
sal_Unicode nUniChar = CH_FEATURE;
char cFeatureConverted = OString(&nUniChar, 1, eEncoding).toChar();
// The individual paragraphs ...
- for (size_t nPara = 0; nPara < nParagraphs; ++nPara)
+ for (size_t nPara = 0; nPara < nParagraphs_Stream; ++nPara)
{
const ContentInfo& rC = aContents[nPara];
@@ -1039,7 +1054,7 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
rOStream << static_cast<sal_Bool>(bStoreUnicodeStrings);
if ( bStoreUnicodeStrings )
{
- for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ )
+ for ( size_t nPara = 0; nPara < nParagraphs_Stream; nPara++ )
{
const ContentInfo& rC = aContents[nPara];
sal_uInt16 nL = rC.GetText().Len();
diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx
index c1aa77f..3e056f1 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -208,28 +208,28 @@ public:
void SetPortionInfo( XParaPortionList* pP )
{ pPortionInfo = pP; }
- size_t GetParagraphCount() const;
- String GetText(size_t nParagraph) const;
+ sal_Int32 GetParagraphCount() const;
+ String GetText(sal_Int32 nParagraph) const;
void ClearPortionInfo();
bool HasOnlineSpellErrors() const;
- void GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const;
+ void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const;
bool RemoveCharAttribs( sal_uInt16 nWhich = 0 );
bool IsFieldObject() const;
const SvxFieldItem* GetField() const;
- const SvxFieldData* GetFieldData(size_t nPara, size_t nPos, sal_Int32 nType) const;
+ const SvxFieldData* GetFieldData(sal_Int32 nPara, size_t nPos, sal_Int32 nType) const;
bool HasField( sal_Int32 nType = com::sun::star::text::textfield::Type::UNSPECIFIED ) const;
- const SfxItemSet& GetParaAttribs(size_t nPara) const;
- void SetParaAttribs(size_t nPara, const SfxItemSet& rAttribs);
+ const SfxItemSet& GetParaAttribs(sal_Int32 nPara) const;
+ void SetParaAttribs(sal_Int32 nPara, const SfxItemSet& rAttribs);
- void GetStyleSheet(size_t nPara, String& rName, SfxStyleFamily& eFamily) const;
- void SetStyleSheet(size_t nPara, const String& rName, const SfxStyleFamily& eFamily);
+ void GetStyleSheet(sal_Int32 nPara, String& rName, SfxStyleFamily& eFamily) const;
+ void SetStyleSheet(sal_Int32 nPara, const String& rName, const SfxStyleFamily& eFamily);
bool ChangeStyleSheets(
const XubString& rOldName, SfxStyleFamily eOldFamily, const String& rNewName, SfxStyleFamily eNewFamily );
void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName );
diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx
index 9365fe2..2f548e3 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -145,7 +145,7 @@ OUString EditUndo::GetComment() const
}
EditUndoDelContent::EditUndoDelContent(
- EditEngine* pEE, ContentNode* pNode, size_t nPortion) :
+ EditEngine* pEE, ContentNode* pNode, sal_Int32 nPortion) :
EditUndo(EDITUNDO_DELCONTENT, pEE),
bDelObject(true),
nNode(nPortion),
@@ -200,7 +200,7 @@ void EditUndoDelContent::Redo()
}
EditUndoConnectParas::EditUndoConnectParas(
- EditEngine* pEE, sal_uInt16 nN, sal_uInt16 nSP,
+ EditEngine* pEE, sal_Int32 nN, sal_uInt16 nSP,
const SfxItemSet& rLeftParaAttribs, const SfxItemSet& rRightParaAttribs,
const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, bool bBkwrd) :
EditUndo(EDITUNDO_CONNECTPARAS, pEE),
@@ -248,7 +248,7 @@ void EditUndoConnectParas::Undo()
if (GetEditEngine()->GetStyleSheetPool())
{
if ( aLeftStyleName.Len() )
- GetEditEngine()->SetStyleSheet( (sal_uInt16)nNode, (SfxStyleSheet*)GetEditEngine()->GetStyleSheetPool()->Find( aLeftStyleName, eLeftStyleFamily ) );
+ GetEditEngine()->SetStyleSheet( nNode, (SfxStyleSheet*)GetEditEngine()->GetStyleSheetPool()->Find( aLeftStyleName, eLeftStyleFamily ) );
if ( aRightStyleName.Len() )
GetEditEngine()->SetStyleSheet( nNode+1, (SfxStyleSheet*)GetEditEngine()->GetStyleSheetPool()->Find( aRightStyleName, eRightStyleFamily ) );
}
@@ -265,7 +265,7 @@ void EditUndoConnectParas::Redo()
}
EditUndoSplitPara::EditUndoSplitPara(
- EditEngine* pEE, sal_uInt16 nN, sal_uInt16 nSP) :
+ EditEngine* pEE, sal_Int32 nN, sal_uInt16 nSP) :
EditUndo(EDITUNDO_SPLITPARA, pEE),
nNode(nN), nSepPos(nSP) {}
@@ -391,7 +391,7 @@ void EditUndoInsertFeature::Redo()
}
EditUndoMoveParagraphs::EditUndoMoveParagraphs(
- EditEngine* pEE, const Range& rParas, sal_uInt16 n) :
+ EditEngine* pEE, const Range& rParas, sal_Int32 n) :
EditUndo(EDITUNDO_MOVEPARAGRAPHS, pEE), nParagraphs(rParas), nDest(n) {}
EditUndoMoveParagraphs::~EditUndoMoveParagraphs() {}
@@ -415,7 +415,7 @@ void EditUndoMoveParagraphs::Undo()
else
nTmpDest += aTmpRange.Len();
- EditSelection aNewSel = GetEditEngine()->MoveParagraphs(aTmpRange, (sal_uInt16)nTmpDest, 0);
+ EditSelection aNewSel = GetEditEngine()->MoveParagraphs(aTmpRange, nTmpDest, 0);
GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel );
}
@@ -427,7 +427,7 @@ void EditUndoMoveParagraphs::Redo()
}
EditUndoSetStyleSheet::EditUndoSetStyleSheet(
- EditEngine* pEE, sal_uInt16 nP, const String& rPrevName, SfxStyleFamily ePrevFam,
+ EditEngine* pEE, sal_Int32 nP, const String& rPrevName, SfxStyleFamily ePrevFam,
const String& rNewName, SfxStyleFamily eNewFam, const SfxItemSet& rPrevParaAttribs) :
EditUndo(EDITUNDO_STYLESHEET, pEE),
aPrevName(rPrevName),
@@ -459,7 +459,7 @@ void EditUndoSetStyleSheet::Redo()
}
EditUndoSetParaAttribs::EditUndoSetParaAttribs(
- EditEngine* pEE, sal_uInt16 nP, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems) :
+ EditEngine* pEE, sal_Int32 nP, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems) :
EditUndo(EDITUNDO_PARAATTRIBS, pEE),
nPara(nP),
aPrevItems(rPrevItems),
@@ -521,7 +521,7 @@ void EditUndoSetAttribs::Undo()
DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
EditEngine* pEE = GetEditEngine();
bool bFields = false;
- for ( sal_uInt16 nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ )
+ for ( sal_Int32 nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ )
{
const ContentAttribsInfo& rInf = aPrevAttribs[nPara-aESel.nStartPara];
diff --git a/editeng/source/editeng/editundo.hxx b/editeng/source/editeng/editundo.hxx
index 0b1ed79..834a9c4 100644
--- a/editeng/source/editeng/editundo.hxx
+++ b/editeng/source/editeng/editundo.hxx
@@ -34,12 +34,12 @@ class EditUndoDelContent : public EditUndo
{
private:
bool bDelObject;
- size_t nNode;
+ sal_Int32 nNode;
ContentNode* pContentNode; // Points to the valid,
// undestroyed object!
public:
- EditUndoDelContent(EditEngine* pEE, ContentNode* pNode, size_t nPortion);
+ EditUndoDelContent(EditEngine* pEE, ContentNode* pNode, sal_Int32 nPortion);
virtual ~EditUndoDelContent();
virtual void Undo();
@@ -52,8 +52,8 @@ public:
class EditUndoConnectParas : public EditUndo
{
private:
- sal_uInt16 nNode;
- sal_uInt16 nSepPos;
+ sal_Int32 nNode;
+ sal_uInt16 nSepPos;
SfxItemSet aLeftParaAttribs;
SfxItemSet aRightParaAttribs;
@@ -66,7 +66,7 @@ private:
bool bBackward;
public:
- EditUndoConnectParas(EditEngine* pEE, sal_uInt16 nNode, sal_uInt16 nSepPos,
+ EditUndoConnectParas(EditEngine* pEE, sal_Int32 nNode, sal_uInt16 nSepPos,
const SfxItemSet& rLeftParaAttribs, const SfxItemSet& rRightParaAttribs,
const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, bool bBackward);
virtual ~EditUndoConnectParas();
@@ -81,11 +81,11 @@ public:
class EditUndoSplitPara : public EditUndo
{
private:
- sal_uInt16 nNode;
+ sal_Int32 nNode;
sal_uInt16 nSepPos;
public:
- EditUndoSplitPara(EditEngine* pEE, sal_uInt16 nNode, sal_uInt16 nSepPos);
+ EditUndoSplitPara(EditEngine* pEE, sal_Int32 nNode, sal_uInt16 nSepPos);
~EditUndoSplitPara();
virtual void Undo();
@@ -156,10 +156,10 @@ class EditUndoMoveParagraphs: public EditUndo
{
private:
Range nParagraphs;
- sal_uInt16 nDest;
+ sal_Int32 nDest;
public:
- EditUndoMoveParagraphs(EditEngine* pEE, const Range& rParas, sal_uInt16 nDest);
+ EditUndoMoveParagraphs(EditEngine* pEE, const Range& rParas, sal_Int32 nDest);
virtual ~EditUndoMoveParagraphs();
virtual void Undo();
@@ -172,7 +172,7 @@ public:
class EditUndoSetStyleSheet: public EditUndo
{
private:
- sal_uInt16 nPara;
+ sal_Int32 nPara;
String aPrevName;
String aNewName;
SfxStyleFamily ePrevFamily;
@@ -180,7 +180,7 @@ private:
SfxItemSet aPrevParaAttribs;
public:
- EditUndoSetStyleSheet(EditEngine* pEE, sal_uInt16 nPara,
+ EditUndoSetStyleSheet(EditEngine* pEE, sal_Int32 nPara,
const String& rPrevName, SfxStyleFamily ePrevFamily,
const String& rNewName, SfxStyleFamily eNewFamily,
const SfxItemSet& rPrevParaAttribs);
@@ -196,12 +196,12 @@ public:
class EditUndoSetParaAttribs: public EditUndo
{
private:
- sal_uInt16 nPara;
+ sal_Int32 nPara;
SfxItemSet aPrevItems;
SfxItemSet aNewItems;
public:
- EditUndoSetParaAttribs(EditEngine* pEE, sal_uInt16 nPara, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems);
+ EditUndoSetParaAttribs(EditEngine* pEE, sal_Int32 nPara, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems);
virtual ~EditUndoSetParaAttribs();
virtual void Undo();
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index b6d9a6c..d7616d1 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -509,7 +509,7 @@ void EditView::RemoveAttribs( sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich )
PIMPE->FormatAndUpdate( this );
}
-void EditView::RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich )
+void EditView::RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich )
{
DBG_CHKTHIS( EditView, 0 );
DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
@@ -599,7 +599,7 @@ void EditView::PasteSpecial()
pImpEditView->Paste(aClipBoard, sal_True );
}
-Point EditView::GetWindowPosTopLeft( sal_uInt16 nParagraph )
+Point EditView::GetWindowPosTopLeft( sal_Int32 nParagraph )
{
DBG_CHKTHIS( EditView, 0 );
DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
@@ -620,7 +620,7 @@ XubString EditView::GetSelected()
return PIMPEE->GetSelected( pImpEditView->GetEditSelection() );
}
-void EditView::MoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos )
+void EditView::MoveParagraphs( Range aParagraphs, sal_Int32 nNewPos )
{
DBG_CHKTHIS( EditView, 0 );
DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
@@ -640,8 +640,7 @@ void EditView::MoveParagraphs( long nDiff )
if ( nDiff > 0 )
nDest++;
DBG_ASSERT( ( nDest >= 0 ) && ( nDest <= pImpEditView->pEditEngine->GetParagraphCount() ), "MoveParagraphs - wrong Parameters!" );
- MoveParagraphs( aRange,
- sal::static_int_cast< sal_uInt16 >( nDest ) );
+ MoveParagraphs( aRange, sal::static_int_cast< sal_Int32 >( nDest ) );
}
void EditView::SetBackgroundColor( const Color& rColor )
@@ -730,11 +729,11 @@ SfxStyleSheet* EditView::GetStyleSheet()
EditSelection aSel( pImpEditView->GetEditSelection() );
aSel.Adjust( PIMPE->GetEditDoc() );
- sal_uInt16 nStartPara = PIMPE->GetEditDoc().GetPos( aSel.Min().GetNode() );
- sal_uInt16 nEndPara = PIMPE->GetEditDoc().GetPos( aSel.Max().GetNode() );
+ sal_Int32 nStartPara = PIMPE->GetEditDoc().GetPos( aSel.Min().GetNode() );
+ sal_Int32 nEndPara = PIMPE->GetEditDoc().GetPos( aSel.Max().GetNode() );
SfxStyleSheet* pStyle = NULL;
- for ( sal_uInt16 n = nStartPara; n <= nEndPara; n++ )
+ for ( sal_Int32 n = nStartPara; n <= nEndPara; n++ )
{
SfxStyleSheet* pTmpStyle = PIMPE->GetStyleSheet( n );
if ( ( n != nStartPara ) && ( pStyle != pTmpStyle ) )
@@ -1083,7 +1082,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
{
ESelection aSel = GetSelection();
aSel.nStartPos = 0;
- aSel.nEndPos = 0xFFFF;
+ aSel.nEndPos = EE_TEXTPOS_ALL;
SetSelection( aSel );
}
SetAttribs( aAttrs );
@@ -1197,18 +1196,19 @@ void EditView::InsertField( const SvxFieldItem& rFld )
const SvxFieldItem* EditView::GetFieldUnderMousePointer() const
{
DBG_CHKTHIS( EditView, 0 );
- sal_uInt16 nPara, nPos;
+ sal_Int32 nPara;
+ sal_uInt16 nPos;
return GetFieldUnderMousePointer( nPara, nPos );
}
-const SvxFieldItem* EditView::GetField( const Point& rPos, sal_uInt16* pPara, sal_uInt16* pPos ) const
+const SvxFieldItem* EditView::GetField( const Point& rPos, sal_Int32* pPara, sal_uInt16* pPos ) const
{
DBG_CHKTHIS( EditView, 0 );
DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
return pImpEditView->GetField( rPos, pPara, pPos );
}
-const SvxFieldItem* EditView::GetFieldUnderMousePointer( sal_uInt16& nPara, sal_uInt16& nPos ) const
+const SvxFieldItem* EditView::GetFieldUnderMousePointer( sal_Int32& nPara, sal_uInt16& nPos ) const
{
DBG_CHKTHIS( EditView, 0 );
DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 );
@@ -1289,7 +1289,7 @@ void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList )
if( aSel.HasRange() )
{
- for( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
+ for( sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
{
std::vector<sal_uInt16> aPortions;
rEditEngine.GetPortions( nPara, aPortions );
@@ -1298,7 +1298,7 @@ void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList )
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 : 0xffff;
+ const sal_uInt16 nEndPos = (nPara == aSel.nEndPara) ? aSel.nEndPos : EE_TEXTPOS_ALL;
for ( size_t nPos = 0; nPos < aPortions.size(); ++nPos )
{
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index d1d91f1..5e9503e 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -687,7 +687,7 @@ const String* EdtAutoCorrDoc::GetPrevPara( sal_Bool )
bAllowUndoAction = sal_False; // Not anymore ...
EditDoc& rNodes = mpEditEngine->GetEditDoc();
- sal_uInt16 nPos = rNodes.GetPos( pCurNode );
+ sal_Int32 nPos = rNodes.GetPos( pCurNode );
// Special case: Bullet => Paragraph start => simply return NULL...
const SfxBoolItem& rBulletState = (const SfxBoolItem&)
@@ -704,7 +704,7 @@ const String* EdtAutoCorrDoc::GetPrevPara( sal_Bool )
if ( bBullet )
return NULL;
- for ( sal_uInt16 n = nPos; n; )
+ for ( sal_Int32 n = nPos; n; )
{
n--;
ContentNode* pNode = rNodes[n];
@@ -757,7 +757,7 @@ LanguageType EdtAutoCorrDoc::GetLanguage( sal_uInt16 nPos, sal_Bool ) const
void EdtAutoCorrDoc::ImplStartUndoAction()
{
- sal_uInt16 nPara = mpEditEngine->GetEditDoc().GetPos( pCurNode );
+ sal_Int32 nPara = mpEditEngine->GetEditDoc().GetPos( pCurNode );
ESelection aSel( nPara, nCursor, nPara, nCursor );
mpEditEngine->UndoActionStart( EDITUNDO_INSERT, aSel );
bUndoAction = sal_True;
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index dacf258..31b0e43 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -220,7 +220,7 @@ void EditHTMLParser::NextToken( int nToken )
case HTML_CENTER_ON:
case HTML_CENTER_OFF:
{
- sal_uInt16 nNode = mpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() );
+ sal_Int32 nNode = mpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() );
SfxItemSet aItems( aCurSel.Max().GetNode()->GetContentAttribs().GetItems() );
aItems.ClearItem( EE_PARA_JUST );
if ( nToken == HTML_CENTER_ON )
@@ -546,7 +546,7 @@ void EditHTMLParser::ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSe
}
ContentNode* pSN = aStartPaM.GetNode();
- sal_uInt16 nStartNode = mpEditEngine->GetEditDoc().GetPos( pSN );
+ sal_Int32 nStartNode = mpEditEngine->GetEditDoc().GetPos( pSN );
// If an attribute goes from 0 to current Paragraph length,
// then it should be a paragraph attribute!
@@ -557,7 +557,7 @@ void EditHTMLParser::ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSe
// not really HTML:
#ifdef DBG_UTIL
ContentNode* pEN = aEndPaM.GetNode();
- sal_uInt16 nEndNode = mpEditEngine->GetEditDoc().GetPos( pEN );
+ sal_Int32 nEndNode = mpEditEngine->GetEditDoc().GetPos( pEN );
DBG_ASSERT( nStartNode == nEndNode, "ImpSetAttribs: Several paragraphs?" );
#endif
@@ -583,7 +583,7 @@ void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel )
// Enough for Calc, would have to be clarified with StyleSheets
// that they should also be in the app so that when they are feed
// in a different engine still are here ...
- sal_uInt16 nNode = mpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() );
+ sal_Int32 nNode = mpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() );
SfxItemSet aItems( aCurSel.Max().GetNode()->GetContentAttribs().GetItems() );
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index 3d64a99..9d1220c 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -112,7 +112,7 @@ SvParserState EditRTFParser::CallParser()
if ( nLastAction == ACTION_INSERTPARABRK )
{
ContentNode* pCurNode = aCurSel.Max().GetNode();
- sal_uInt16 nPara = mpEditEngine->GetEditDoc().GetPos(pCurNode);
+ sal_Int32 nPara = mpEditEngine->GetEditDoc().GetPos(pCurNode);
ContentNode* pPrevNode = mpEditEngine->GetEditDoc().GetObject(nPara-1);
DBG_ASSERT( pPrevNode, "Invalid RTF-Document?!" );
EditSelection aSel;
@@ -155,9 +155,9 @@ void EditRTFParser::AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& r
SvxFontItem aFontItem( aDefFont.GetFamily(), aDefFont.GetName(),
aDefFont.GetStyleName(), aDefFont.GetPitch(), aDefFont.GetCharSet(), EE_CHAR_FONTINFO );
- sal_uInt16 nStartPara = mpEditEngine->GetEditDoc().GetPos( rStart.GetNode() );
- sal_uInt16 nEndPara = mpEditEngine->GetEditDoc().GetPos( rEnd.GetNode() );
- for ( sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ sal_Int32 nStartPara = mpEditEngine->GetEditDoc().GetPos( rStart.GetNode() );
+ sal_Int32 nEndPara = mpEditEngine->GetEditDoc().GetPos( rEnd.GetNode() );
+ for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
ContentNode* pNode = mpEditEngine->GetEditDoc().GetObject( nPara );
DBG_ASSERT( pNode, "AddRTFDefaultValues - No paragraph?!" );
@@ -275,7 +275,7 @@ void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos,
// This "\pard" always apply on the right paragraph.
ContentNode* pN = aCurSel.Max().GetNode();
- sal_uInt16 nCurPara = mpEditEngine->GetEditDoc().GetPos( pN );
+ sal_Int32 nCurPara = mpEditEngine->GetEditDoc().GetPos( pN );
DBG_ASSERT( nCurPara != 0, "Paragraph equal to 0: SetEnfPrevPara" );
if ( nCurPara )
nCurPara--;
@@ -348,8 +348,8 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
ContentNode* pSN = aStartPaM.GetNode();
ContentNode* pEN = aEndPaM.GetNode();
- sal_uInt16 nStartNode = mpEditEngine->GetEditDoc().GetPos( pSN );
- sal_uInt16 nEndNode = mpEditEngine->GetEditDoc().GetPos( pEN );
+ sal_Int32 nStartNode = mpEditEngine->GetEditDoc().GetPos( pSN );
+ sal_Int32 nEndNode = mpEditEngine->GetEditDoc().GetPos( pEN );
sal_Int16 nOutlLevel = 0xff;
if (rSet.StyleNo() && mpEditEngine->GetStyleSheetPool() && mpEditEngine->IsImportRTFStyleSheetsSet())
@@ -371,7 +371,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
// Note: Selection can reach over several paragraphs.
// All Complete paragraphs are paragraph attributes ...
- for ( sal_uInt16 z = nStartNode+1; z < nEndNode; z++ )
+ for ( sal_Int32 z = nStartNode+1; z < nEndNode; z++ )
{
DBG_ASSERT(mpEditEngine->GetEditDoc().GetObject(z), "Node does not exist yet(RTF)");
mpEditEngine->SetParaAttribsOnly(z, rSet.GetAttrSet());
@@ -412,7 +412,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
// OutlLevel...
if ( nOutlLevel != 0xff )
{
- for ( sal_uInt16 n = nStartNode; n <= nEndNode; n++ )
+ for ( sal_Int32 n = nStartNode; n <= nEndNode; n++ )
{
ContentNode* pNode = mpEditEngine->GetEditDoc().GetObject( n );
pNode->GetContentAttribs().GetItems().Put( SfxInt16Item( EE_PARA_OUTLLEVEL, nOutlLevel ) );
@@ -593,7 +593,7 @@ void EditRTFParser::SkipGroup()
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list