summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-05-08 18:12:32 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-06-28 12:00:06 +0000
commitda11528150df545a31df3c9863bd4c3925ccdf21 (patch)
treead7eb65227b7d03972637fcaf23a8b96cc1c55a4
parent7f50f4092b7beafa5545a9a783dde760b260df4c (diff)
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) Reviewed-on: https://gerrit.libreoffice.org/3838 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 2af1f5691e8d64afd5246d245d7876b5a2cd5cd8) Conflicts: editeng/inc/editeng/editeng.hxx editeng/inc/editeng/outliner.hxx editeng/inc/editeng/unoedprx.hxx editeng/inc/editeng/unoedsrc.hxx editeng/inc/editeng/unofored.hxx editeng/inc/editeng/unoforou.hxx editeng/inc/editeng/unotext.hxx editeng/source/accessibility/AccessibleHyperlink.cxx editeng/source/accessibility/AccessibleHyperlink.hxx editeng/source/editeng/editeng.cxx editeng/source/editeng/editobj.cxx editeng/source/editeng/editobj2.hxx editeng/source/editeng/impedit.hxx editeng/source/editeng/impedit3.cxx editeng/source/editeng/impedit4.cxx editeng/source/outliner/outleeng.cxx editeng/source/outliner/outleeng.hxx editeng/source/outliner/outliner.cxx editeng/source/outliner/outlvw.cxx editeng/source/uno/unoedprx.cxx editeng/source/uno/unofored.cxx editeng/source/uno/unoforou.cxx editeng/source/uno/unotext.cxx include/editeng/editobj.hxx sc/inc/editutil.hxx sc/qa/unit/subsequent_filters-test.cxx sc/source/core/data/cellvalue.cxx sc/source/core/tool/editutil.cxx sc/source/filter/xml/xmlcelli.hxx sc/source/ui/unoobj/fielduno.cxx sd/source/ui/inc/OutlineView.hxx sd/source/ui/view/drtxtob1.cxx starmath/source/accessibility.cxx starmath/source/accessibility.hxx svx/inc/svx/svdoutl.hxx svx/source/accessibility/AccessibleEmptyEditSource.cxx svx/source/sdr/properties/textproperties.cxx svx/source/svdraw/svdoutl.cxx Change-Id: I62d1b9c399cd709a4f93dbac31b219a61c46ec00 Reviewed-on: https://gerrit.libreoffice.org/4368 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--chart2/source/view/axes/VCartesianAxis.cxx4
-rw-r--r--editeng/inc/editeng/AccessibleParaManager.hxx20
-rw-r--r--editeng/inc/editeng/editdata.hxx50
-rw-r--r--editeng/inc/editeng/editeng.hxx122
-rw-r--r--editeng/inc/editeng/editobj.hxx20
-rw-r--r--editeng/inc/editeng/editview.hxx10
-rw-r--r--editeng/inc/editeng/outliner.hxx184
-rw-r--r--editeng/inc/editeng/outlobj.hxx6
-rw-r--r--editeng/inc/editeng/svxrtf.hxx8
-rw-r--r--editeng/inc/editeng/unoedhlp.hxx12
-rw-r--r--editeng/inc/editeng/unoedprx.hxx56
-rw-r--r--editeng/inc/editeng/unoedsrc.hxx56
-rw-r--r--editeng/inc/editeng/unofored.hxx48
-rw-r--r--editeng/inc/editeng/unoforou.hxx58
-rw-r--r--editeng/inc/editeng/unotext.hxx58
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx53
-rw-r--r--editeng/source/accessibility/AccessibleHyperlink.cxx2
-rw-r--r--editeng/source/accessibility/AccessibleHyperlink.hxx5
-rw-r--r--editeng/source/accessibility/AccessibleImageBullet.cxx6
-rw-r--r--editeng/source/accessibility/AccessibleParaManager.cxx81
-rw-r--r--editeng/source/accessibility/AccessibleStaticTextBase.cxx29
-rw-r--r--editeng/source/editeng/editdbg.cxx4
-rw-r--r--editeng/source/editeng/editdoc.cxx128
-rw-r--r--editeng/source/editeng/editdoc.hxx50
-rw-r--r--editeng/source/editeng/editeng.cxx160
-rw-r--r--editeng/source/editeng/editobj.cxx81
-rw-r--r--editeng/source/editeng/editobj2.hxx20
-rw-r--r--editeng/source/editeng/editundo.cxx18
-rw-r--r--editeng/source/editeng/editundo.hxx26
-rw-r--r--editeng/source/editeng/editview.cxx28
-rw-r--r--editeng/source/editeng/edtspell.cxx6
-rw-r--r--editeng/source/editeng/eehtml.cxx8
-rw-r--r--editeng/source/editeng/eertfpar.cxx22
-rw-r--r--editeng/source/editeng/eertfpar.hxx4
-rw-r--r--editeng/source/editeng/impedit.cxx37
-rw-r--r--editeng/source/editeng/impedit.hxx92
-rw-r--r--editeng/source/editeng/impedit2.cxx157
-rw-r--r--editeng/source/editeng/impedit3.cxx56
-rw-r--r--editeng/source/editeng/impedit4.cxx56
-rw-r--r--editeng/source/editeng/impedit5.cxx54
-rw-r--r--editeng/source/outliner/outleeng.cxx32
-rw-r--r--editeng/source/outliner/outleeng.hxx26
-rw-r--r--editeng/source/outliner/outlin2.cxx38
-rw-r--r--editeng/source/outliner/outliner.cxx222
-rw-r--r--editeng/source/outliner/outlobj.cxx22
-rw-r--r--editeng/source/outliner/outlundo.cxx14
-rw-r--r--editeng/source/outliner/outlundo.hxx18
-rw-r--r--editeng/source/outliner/outlvw.cxx139
-rw-r--r--editeng/source/outliner/paralist.cxx58
-rw-r--r--editeng/source/outliner/paralist.hxx27
-rw-r--r--editeng/source/rtf/svxrtf.cxx8
-rw-r--r--editeng/source/uno/unoedhlp.cxx8
-rw-r--r--editeng/source/uno/unoedprx.cxx70
-rw-r--r--editeng/source/uno/unofored.cxx54
-rw-r--r--editeng/source/uno/unoforou.cxx86
-rw-r--r--editeng/source/uno/unotext.cxx98
-rw-r--r--editeng/source/uno/unotext2.cxx4
-rw-r--r--filter/source/msfilter/msdffimp.cxx8
-rw-r--r--filter/source/msfilter/svdfppt.cxx2
-rw-r--r--forms/source/richtext/specialdispatchers.cxx4
-rw-r--r--sc/inc/editutil.hxx6
-rw-r--r--sc/source/core/data/attrib.cxx4
-rw-r--r--sc/source/core/data/column2.cxx4
-rw-r--r--sc/source/core/data/documen8.cxx2
-rw-r--r--sc/source/core/data/global.cxx4
-rw-r--r--sc/source/core/data/postit.cxx2
-rw-r--r--sc/source/core/tool/editutil.cxx22
-rw-r--r--sc/source/filter/excel/xehelper.cxx8
-rw-r--r--sc/source/filter/excel/xicontent.cxx4
-rw-r--r--sc/source/filter/html/htmlexp.cxx4
-rw-r--r--sc/source/ui/app/inputhdl.cxx50
-rw-r--r--sc/source/ui/app/inputwin.cxx2
-rw-r--r--sc/source/ui/app/transobj.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx8
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx12
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx4
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx16
-rw-r--r--sc/source/ui/view/editsh.cxx2
-rw-r--r--sc/source/ui/view/output2.cxx4
-rw-r--r--sc/source/ui/view/viewdata.cxx2
-rw-r--r--sc/source/ui/view/viewfun4.cxx6
-rw-r--r--sc/source/ui/view/viewfunc.cxx2
-rw-r--r--sd/source/core/sdpage_animations.cxx4
-rw-r--r--sd/source/core/text/textapi.cxx2
-rw-r--r--sd/source/filter/html/htmlex.cxx18
-rw-r--r--sd/source/filter/html/htmlex.hxx2
-rw-r--r--sd/source/filter/ppt/pptinanimations.cxx7
-rw-r--r--sd/source/filter/xml/sdtransform.cxx4
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx8
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx4
-rw-r--r--sd/source/ui/app/sdmod2.cxx2
-rw-r--r--sd/source/ui/dlg/dlgassim.cxx6
-rw-r--r--sd/source/ui/dlg/headerfooterdlg.cxx4
-rw-r--r--sd/source/ui/func/fuexpand.cxx20
-rw-r--r--sd/source/ui/func/fuinsfil.cxx14
-rw-r--r--sd/source/ui/func/fuprobjs.cxx4
-rw-r--r--sd/source/ui/func/fusumry.cxx4
-rw-r--r--sd/source/ui/func/futext.cxx2
-rw-r--r--sd/source/ui/inc/OutlineView.hxx6
-rw-r--r--sd/source/ui/unoidl/unosrch.cxx4
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx8
-rw-r--r--sd/source/ui/view/Outliner.cxx2
-rw-r--r--sd/source/ui/view/drawview.cxx6
-rw-r--r--sd/source/ui/view/drtxtob.cxx10
-rw-r--r--sd/source/ui/view/drtxtob1.cxx10
-rw-r--r--sd/source/ui/view/outlnvs2.cxx4
-rw-r--r--sd/source/ui/view/outlnvsh.cxx22
-rw-r--r--sd/source/ui/view/outlview.cxx44
-rw-r--r--sd/source/ui/view/sdview.cxx6
-rw-r--r--sd/source/ui/view/sdview2.cxx10
-rw-r--r--starmath/inc/edit.hxx2
-rw-r--r--starmath/source/accessibility.cxx52
-rw-r--r--starmath/source/accessibility.hxx48
-rw-r--r--starmath/source/cursor.cxx2
-rw-r--r--starmath/source/edit.cxx15
-rw-r--r--starmath/source/view.cxx5
-rw-r--r--svx/inc/svx/svdomeas.hxx2
-rw-r--r--svx/inc/svx/svdotext.hxx2
-rw-r--r--svx/inc/svx/svdoutl.hxx2
-rw-r--r--svx/source/accessibility/AccessibleEmptyEditSource.cxx48
-rw-r--r--svx/source/accessibility/AccessibleTextHelper.cxx24
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx2
-rw-r--r--svx/source/sdr/properties/textproperties.cxx34
-rw-r--r--svx/source/svdraw/svdedxv.cxx17
-rw-r--r--svx/source/svdraw/svdomeas.cxx2
-rw-r--r--svx/source/svdraw/svdotext.cxx4
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx8
-rw-r--r--svx/source/svdraw/svdotxat.cxx12
-rw-r--r--svx/source/svdraw/svdotxed.cxx2
-rw-r--r--svx/source/svdraw/svdotxfl.cxx2
-rw-r--r--svx/source/svdraw/svdoutl.cxx2
-rw-r--r--svx/source/svdraw/svdview.cxx4
-rw-r--r--svx/source/table/cell.cxx16
-rw-r--r--svx/source/table/svdotable.cxx4
-rw-r--r--svx/source/table/tablecontroller.cxx2
-rw-r--r--svx/source/table/tablertfimporter.cxx4
-rw-r--r--sw/inc/docufld.hxx2
-rw-r--r--sw/source/core/fields/docufld.cxx2
-rw-r--r--sw/source/filter/rtf/rtftbl.cxx4
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx10
-rw-r--r--sw/source/filter/rtf/swparrtf.hxx4
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx4
-rw-r--r--sw/source/filter/ww8/docxexport.cxx4
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx6
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx4
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx8
-rw-r--r--sw/source/ui/docvw/AnnotationWin.cxx4
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx3
-rw-r--r--sw/source/ui/docvw/SidebarWin.cxx2
-rw-r--r--sw/source/ui/shells/annotsh.cxx4
-rw-r--r--sw/source/ui/shells/drwtxtsh.cxx4
-rw-r--r--sw/source/ui/shells/langhelper.cxx2
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx8
154 files changed, 1866 insertions, 1770 deletions
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx
index 40b48862d7c1..5fe7ef3c8a88 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -324,8 +324,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/inc/editeng/AccessibleParaManager.hxx b/editeng/inc/editeng/AccessibleParaManager.hxx
index 90bc3d8a111d..a4c2c330a480 100644
--- a/editeng/inc/editeng/AccessibleParaManager.hxx
+++ b/editeng/inc/editeng/AccessibleParaManager.hxx
@@ -164,7 +164,7 @@ namespace accessibility
void SetNum( sal_Int32 nNumParas );
/** Get the number of paragraphs currently possible */
- sal_uInt32 GetNum() const;
+ sal_Int32 GetNum() const;
// iterators
VectorOfChildren::iterator begin();
@@ -173,25 +173,25 @@ namespace accessibility
VectorOfChildren::const_iterator end() const;
// dealing with single paragraphs (release reference, return reference etc)
- void Release( sal_uInt32 nPara );
+ void Release( sal_Int32 nPara );
/// Set focus to given child
void SetFocus( sal_Int32 nChild );
- void FireEvent( sal_uInt32 nPara,
+ void FireEvent( sal_Int32 nPara,
const sal_Int16 nEventId,
const ::com::sun::star::uno::Any& rNewValue = ::com::sun::star::uno::Any(),
const ::com::sun::star::uno::Any& rOldValue = ::com::sun::star::uno::Any() ) const;
static sal_Bool IsReferencable( WeakPara::HardRefType aChild );
- sal_Bool IsReferencable( sal_uInt32 nChild ) const;
+ sal_Bool IsReferencable( sal_Int32 nChild ) const;
static void ShutdownPara( const WeakChild& rChild );
Child CreateChild( sal_Int32 nChild,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& xFrontEnd,
SvxEditSourceAdapter& rEditSource,
- sal_uInt32 nParagraphIndex );
+ sal_Int32 nParagraphIndex );
- WeakChild GetChild( sal_uInt32 nParagraphIndex ) const;
+ WeakChild GetChild( sal_Int32 nParagraphIndex ) const;
// forwarder to all paragraphs
/// Make all children active and editable (or off)
@@ -217,7 +217,7 @@ namespace accessibility
@param nEndPara
Index of first paragraph to stop with releasing
*/
- void Release( sal_uInt32 nStartPara, sal_uInt32 nEndPara );
+ void Release( sal_Int32 nStartPara, sal_Int32 nEndPara );
/** Fire event for the given range of paragraphs
@@ -229,8 +229,8 @@ namespace accessibility
@param nEndPara
Index of first paragraph to stop with event firing
*/
- void FireEvent( sal_uInt32 nStartPara,
- sal_uInt32 nEndPara,
+ void FireEvent( sal_Int32 nStartPara,
+ sal_Int32 nEndPara,
const sal_Int16 nEventId,
const ::com::sun::star::uno::Any& rNewValue = ::com::sun::star::uno::Any(),
const ::com::sun::star::uno::Any& rOldValue = ::com::sun::star::uno::Any() ) const;
@@ -309,7 +309,7 @@ namespace accessibility
void InitChild( AccessibleEditableTextPara& rChild,
SvxEditSourceAdapter& rEditSource,
sal_Int32 nChild,
- sal_uInt32 nParagraphIndex ) const;
+ sal_Int32 nParagraphIndex ) const;
// vector the size of the paragraph number of the underlying EditEngine
VectorOfChildren maChildren;
diff --git a/editeng/inc/editeng/editdata.hxx b/editeng/inc/editeng/editdata.hxx
index ca2c1b74b497..025db173e3f4 100644
--- a/editeng/inc/editeng/editdata.hxx
+++ b/editeng/inc/editeng/editdata.hxx
@@ -40,10 +40,14 @@ enum EVAnchorMode {
ANCHOR_TOP_HCENTER, ANCHOR_VCENTER_HCENTER, ANCHOR_BOTTOM_HCENTER,
ANCHOR_TOP_RIGHT, ANCHOR_VCENTER_RIGHT, ANCHOR_BOTTOM_RIGHT };
-#define EE_PARA_NOT_FOUND 0xFFFF
-#define EE_PARA_APPEND 0xFFFF
-#define EE_PARA_ALL 0xFFFF
-#define EE_INDEX_NOT_FOUND 0xFFFF
+#define EE_PARA_NOT_FOUND SAL_MAX_INT32
+#define EE_PARA_APPEND SAL_MAX_INT32
+#define EE_PARA_ALL SAL_MAX_INT32
+#define EE_PARA_MAX_COUNT SAL_MAX_INT32
+
+#define EE_INDEX_NOT_FOUND SAL_MAX_UINT16
+#define EE_TEXTPOS_ALL SAL_MAX_UINT16
+#define EE_TEXTPOS_MAX_COUNT SAL_MAX_UINT16
EDITENG_DLLPUBLIC extern const size_t EE_APPEND;
@@ -96,7 +100,7 @@ class SfxStyleSheet;
struct EPosition
{
- sal_uInt16 nPara;
+ sal_Int32 nPara;
xub_StrLen nIndex;
EPosition() :
@@ -105,7 +109,7 @@ struct EPosition
{
}
- EPosition( sal_uInt16 nPara_, xub_StrLen nPos_ ) :
+ EPosition( sal_Int32 nPara_, xub_StrLen nPos_ ) :
nPara( nPara_ ),
nIndex( nPos_ )
{
@@ -114,14 +118,14 @@ struct EPosition
struct ESelection
{
- sal_uInt16 nStartPara;
+ sal_Int32 nStartPara;
xub_StrLen nStartPos;
- sal_uInt16 nEndPara;
+ sal_Int32 nEndPara;
xub_StrLen nEndPos;
ESelection() : nStartPara( 0 ), nStartPos( 0 ), nEndPara( 0 ), nEndPos( 0 ) {}
- ESelection( sal_uInt16 nStPara, xub_StrLen nStPos, sal_uInt16 nEPara, xub_StrLen nEPos ) :
+ ESelection( sal_Int32 nStPara, xub_StrLen nStPos, sal_Int32 nEPara, xub_StrLen nEPos ) :
nStartPara( nStPara ),
nStartPos( nStPos ),
nEndPara( nEPara ),
@@ -129,7 +133,7 @@ struct ESelection
{
}
- ESelection( sal_uInt16 nPara, xub_StrLen nPos ) :
+ ESelection( sal_Int32 nPara, xub_StrLen nPos ) :
nStartPara( nPara ),
nStartPos( nPos ),
nEndPara( nPara ),
@@ -198,7 +202,7 @@ inline void ESelection::Adjust()
if ( bSwap )
{
- sal_uInt16 nSPar = nStartPara; sal_uInt16 nSPos = nStartPos;
+ sal_Int32 nSPar = nStartPara; sal_uInt16 nSPos = nStartPos;
nStartPara = nEndPara; nStartPos = nEndPos;
nEndPara = nSPar; nEndPos = nSPos;
}
@@ -211,7 +215,7 @@ struct EDITENG_DLLPUBLIC EFieldInfo
EPosition aPosition;
EFieldInfo();
- EFieldInfo( const SvxFieldItem& rFieldItem, sal_uInt16 nPara, sal_uInt16 nPos );
+ EFieldInfo( const SvxFieldItem& rFieldItem, sal_Int32 nPara, sal_uInt16 nPos );
~EFieldInfo();
EFieldInfo( const EFieldInfo& );
@@ -279,18 +283,18 @@ struct EECharAttrib
{
const SfxPoolItem* pAttr;
- sal_uInt16 nPara;
+ sal_Int32 nPara;
xub_StrLen nStart;
xub_StrLen nEnd;
};
struct MoveParagraphsInfo
{
- sal_uInt16 nStartPara;
- sal_uInt16 nEndPara;
- sal_uInt16 nDestPara;
+ sal_Int32 nStartPara;
+ sal_Int32 nEndPara;
+ sal_Int32 nDestPara;
- MoveParagraphsInfo( sal_uInt16 nS, sal_uInt16 nE, sal_uInt16 nD )
+ MoveParagraphsInfo( sal_Int32 nS, sal_Int32 nE, sal_Int32 nD )
{ nStartPara = nS; nEndPara = nE; nDestPara = nD; }
};
@@ -300,10 +304,10 @@ struct MoveParagraphsInfo
struct PasteOrDropInfos
{
sal_uInt16 nAction;
- sal_uInt16 nStartPara;
- sal_uInt16 nEndPara;
+ sal_Int32 nStartPara;
+ sal_Int32 nEndPara;
- PasteOrDropInfos() : nAction(0), nStartPara(0xFFFF), nEndPara(0xFFFF) {}
+ PasteOrDropInfos() : nAction(0), nStartPara(0xFFFFFFFF), nEndPara(0xFFFFFFFF) {}
};
enum EENotifyType
@@ -354,10 +358,10 @@ struct EENotify
EditEngine* pEditEngine;
EditView* pEditView;
- sal_uInt16 nParagraph; // only valid in PARAGRAPHINSERTED/EE_NOTIFY_PARAGRAPHREMOVED
+ sal_Int32 nParagraph; // only valid in PARAGRAPHINSERTED/EE_NOTIFY_PARAGRAPHREMOVED
- sal_uInt16 nParam1;
- sal_uInt16 nParam2;
+ sal_Int32 nParam1;
+ sal_Int32 nParam2;
EENotify( EENotifyType eType )
{ eNotificationType = eType; pEditEngine = NULL; pEditView = NULL; nParagraph = EE_PARA_NOT_FOUND; nParam1 = 0; nParam2 = 0; }
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 0eb4b128c01b..126eaf99126f 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -223,7 +223,7 @@ public:
sal_uInt16 GetScriptType( const ESelection& rSelection ) const;
LanguageType GetLanguage(const EditPaM& rPaM) const;
- LanguageType GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const;
+ LanguageType GetLanguage( sal_Int32 nPara, sal_uInt16 nPos ) const;
void TransliterateText( const ESelection& rSelection, sal_Int32 nTransliterationMode );
EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode );
@@ -251,23 +251,23 @@ public:
sal_uInt32 GetTextHeightNTP() const;
sal_uInt32 CalcTextWidth();
- String GetText( sal_uInt16 nParagraph ) const;
- xub_StrLen GetTextLen( sal_uInt16 nParagraph ) const;
- sal_uInt32 GetTextHeight( sal_uInt16 nParagraph ) const;
+ String GetText( sal_Int32 nParagraph ) const;
+ xub_StrLen GetTextLen( sal_Int32 nParagraph ) const;
+ sal_uInt32 GetTextHeight( sal_Int32 nParagraph ) const;
- sal_uInt16 GetParagraphCount() const;
+ sal_Int32 GetParagraphCount() const;
- sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const;
- xub_StrLen GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- sal_uInt32 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine = 0 );
- ParagraphInfos GetParagraphInfos( sal_uInt16 nPara );
- sal_uInt16 FindParagraph( long nDocPosY );
+ sal_uInt16 GetLineCount( sal_Int32 nParagraph ) const;
+ xub_StrLen GetLineLen( sal_Int32 nParagraph, sal_uInt16 nLine ) const;
+ void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const;
+ sal_uInt16 GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ sal_uInt32 GetLineHeight( sal_Int32 nParagraph, sal_uInt16 nLine = 0 );
+ ParagraphInfos GetParagraphInfos( sal_Int32 nPara );
+ sal_Int32 FindParagraph( long nDocPosY );
EPosition FindDocPosition( const Point& rDocPos ) const;
Rectangle GetCharacterBounds( const EPosition& rPos ) const;
- String GetWord( sal_uInt16 nPara, xub_StrLen nIndex );
+ String GetWord( sal_Int32 nPara, xub_StrLen nIndex );
ESelection GetWord( const ESelection& rSelection, sal_uInt16 nWordType ) const;
@@ -275,33 +275,33 @@ public:
void SetText( const String& rStr );
EditTextObject* CreateTextObject();
- EditTextObject* CreateTextObject( sal_uInt16 nPara, sal_uInt16 nParas = 1 );
+ EditTextObject* CreateTextObject( sal_Int32 nPara, sal_Int32 nParas = 1 );
EditTextObject* CreateTextObject( const ESelection& rESelection );
void SetText( const EditTextObject& rTextObject );
- void RemoveParagraph( sal_uInt16 nPara );
- void InsertParagraph( sal_uInt16 nPara, const EditTextObject& rTxtObj );
- void InsertParagraph( sal_uInt16 nPara, const String& rText);
+ void RemoveParagraph( sal_Int32 nPara );
+ void InsertParagraph( sal_Int32 nPara, const EditTextObject& rTxtObj );
+ void InsertParagraph( sal_Int32 nPara, const String& rText);
- void SetText( sal_uInt16 nPara, const String& rText);
+ void SetText( sal_Int32 nPara, const String& rText);
- virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
- virtual const SfxItemSet& GetParaAttribs( sal_uInt16 nPara ) const;
+ virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
+ virtual const SfxItemSet& GetParaAttribs( sal_Int32 nPara ) const;
- void GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const;
+ void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const;
- SfxItemSet GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags = 0xFF ) const;
- SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All );
+ SfxItemSet GetAttribs( sal_Int32 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags = 0xFF ) const;
+ SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All );
- sal_Bool HasParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
- const SfxPoolItem& GetParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich );
+ sal_Bool HasParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const;
+ const SfxPoolItem& GetParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich );
- Font GetStandardFont( sal_uInt16 nPara );
- SvxFont GetStandardSvxFont( sal_uInt16 nPara );
+ Font GetStandardFont( sal_Int32 nPara );
+ SvxFont GetStandardSvxFont( sal_Int32 nPara );
void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
- void ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow = sal_True );
+ void ShowParagraph( sal_Int32 nParagraph, sal_Bool bShow = sal_True );
::svl::IUndoManager&
GetUndoManager();
@@ -328,10 +328,10 @@ public:
sal_Bool IsInSelectionMode() const;
void StripPortions();
- void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList );
+ void GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList );
- long GetFirstLineStartX( sal_uInt16 nParagraph );
- Point GetDocPosTopLeft( sal_uInt16 nParagraph );
+ long GetFirstLineStartX( sal_Int32 nParagraph );
+ Point GetDocPosTopLeft( sal_Int32 nParagraph );
Point GetDocPos( const Point& rPaperPos ) const;
sal_Bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder = 0 );
@@ -362,14 +362,14 @@ public:
sal_uInt32 GetControlWord() const;
void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
- void QuickRemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0 );
+ void QuickRemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0 );
void QuickMarkInvalid( const ESelection& rSel );
void QuickFormatDoc( sal_Bool bFull = sal_False );
void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
void QuickInsertLineBreak( const ESelection& rSel );
void QuickInsertText( const String& rText, const ESelection& rSel );
void QuickDelete( const ESelection& rSel );
- void QuickMarkToBeRepainted( sal_uInt16 nPara );
+ void QuickMarkToBeRepainted( sal_Int32 nPara );
void SetGlobalCharStretching( sal_uInt16 nX = 100, sal_uInt16 nY = 100 );
void GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY );
@@ -381,9 +381,9 @@ public:
SfxStyleSheetPool* GetStyleSheetPool();
void SetStyleSheet(const EditSelection& aSel, SfxStyleSheet* pStyle);
- void SetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle );
- const SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const;
- SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara );
+ void SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle );
+ const SfxStyleSheet* GetStyleSheet( sal_Int32 nPara ) const;
+ SfxStyleSheet* GetStyleSheet( sal_Int32 nPara );
void SetWordDelimiters( const String& rDelimiters );
String GetWordDelimiters() const;
@@ -429,10 +429,10 @@ public:
bool UpdateFieldsOnly();
void RemoveFields( sal_Bool bKeepFieldText, TypeId aType = NULL );
- sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
- EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
+ sal_uInt16 GetFieldCount( sal_Int32 nPara ) const;
+ EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const;
- sal_Bool IsRightToLeft( sal_uInt16 nPara ) const;
+ sal_Bool IsRightToLeft( sal_Int32 nPara ) const;
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >
CreateTransferable( const ESelection& rSelection ) const;
@@ -443,17 +443,17 @@ public:
void SetBeginPasteOrDropHdl( const Link& rLink );
void SetEndPasteOrDropHdl( const Link& rLink );
- virtual void PaintingFirstLine( sal_uInt16 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev );
- virtual void ParagraphInserted( sal_uInt16 nNewParagraph );
- virtual void ParagraphDeleted( sal_uInt16 nDeletedParagraph );
- virtual void ParagraphConnected( sal_uInt16 nLeftParagraph, sal_uInt16 nRightParagraph );
- virtual void ParaAttribsChanged( sal_uInt16 nParagraph );
+ virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev );
+ virtual void ParagraphInserted( sal_Int32 nNewParagraph );
+ virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph );
+ virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph );
+ virtual void ParaAttribsChanged( sal_Int32 nParagraph );
virtual void StyleSheetChanged( SfxStyleSheet* pStyle );
- virtual void ParagraphHeightChanged( sal_uInt16 nPara );
+ virtual void ParagraphHeightChanged( sal_Int32 nPara );
virtual void DrawingText(
const Point& rStartPos, const String& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray,
- const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
+ const SvxFont& rFont, sal_Int32 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -465,22 +465,22 @@ public:
virtual void DrawingTab(
const Point& rStartPos, long nWidth, const String& rChar,
- const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
+ const SvxFont& rFont, sal_Int32 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
bool bEndOfLine,
bool bEndOfParagraph,
const Color& rOverlineColor,
const Color& rTextLineColor);
virtual String GetUndoComment( sal_uInt16 nUndoId ) const;
- virtual sal_Bool FormattingParagraph( sal_uInt16 nPara );
+ virtual sal_Bool FormattingParagraph( sal_Int32 nPara );
virtual sal_Bool SpellNextDocument();
- virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
- virtual void FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
- virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos, Color*& rTxtColor, Color*& rFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos );
+ virtual void FieldSelected( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos );
+ virtual String CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos, Color*& rTxtColor, Color*& rFldColor );
// to be overloaded if access to bullet information needs to be provided
- virtual const SvxNumberFormat * GetNumberFormat( sal_uInt16 nPara ) const;
+ virtual const SvxNumberFormat * GetNumberFormat( sal_Int32 nPara ) const;
- virtual Rectangle GetBulletArea( sal_uInt16 nPara );
+ virtual Rectangle GetBulletArea( sal_Int32 nPara );
static SfxItemPool* CreatePool( sal_Bool bLoadRefCounts = sal_True );
static SfxItemPool& GetGlobalItemPool();
@@ -543,8 +543,8 @@ public:
ESelection CreateESelection(const EditSelection& rSel);
EditSelection CreateSelection(const ESelection& rSel);
- const SfxItemSet& GetBaseParaAttribs(sal_uInt16 nPara) const;
- void SetParaAttribsOnly(sal_uInt16 nPara, const SfxItemSet& rSet);
+ const SfxItemSet& GetBaseParaAttribs(sal_Int32 nPara) const;
+ void SetParaAttribsOnly(sal_Int32 nPara, const SfxItemSet& rSet);
void SetAttribs(const EditSelection& rSel, const SfxItemSet& rSet, sal_uInt8 nSpecial = 0);
String GetSelected(const EditSelection& rSel, const LineEnd eParaSep = LINEEND_LF) const;
@@ -552,7 +552,7 @@ public:
sal_uInt16 GetScriptType(const EditSelection& rSel) const;
- void RemoveParaPortion(size_t nNode);
+ void RemoveParaPortion(sal_Int32 nNode);
void SetCallParaInsertedOrDeleted(bool b);
bool IsCallParaInsertedOrDeleted() const;
@@ -560,15 +560,15 @@ public:
void AppendDeletedNodeInfo(DeletedNodeInfo* pInfo);
void UpdateSelections();
- void InsertContent(ContentNode* pNode, sal_uInt16 nPos);
- EditPaM SplitContent(sal_uInt16 nNode, sal_uInt16 nSepPos);
- EditPaM ConnectContents(sal_uInt16 nLeftNode, bool bBackward);
+ void InsertContent(ContentNode* pNode, sal_Int32 nPos);
+ EditPaM SplitContent(sal_Int32 nNode, sal_uInt16 nSepPos);
+ EditPaM ConnectContents(sal_Int32 nLeftNode, bool bBackward);
EditPaM InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem);
- EditSelection MoveParagraphs(const Range& rParagraphs, sal_uInt16 nNewPos, EditView* pCurView);
+ EditSelection MoveParagraphs(const Range& rParagraphs, sal_Int32 nNewPos, EditView* pCurView);
- void RemoveCharAttribs(sal_uInt16 nPara, sal_uInt16 nWhich = 0, bool bRemoveFeatures = false);
+ void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich = 0, bool bRemoveFeatures = false);
void RemoveCharAttribs(const EditSelection& rSel, bool bRemoveParaAttribs, sal_uInt16 nWhich = 0);
ViewsType& GetEditViews();
diff --git a/editeng/inc/editeng/editobj.hxx b/editeng/inc/editeng/editobj.hxx
index 2730b46b166f..7d5622ec1300 100644
--- a/editeng/inc/editeng/editobj.hxx
+++ b/editeng/inc/editeng/editobj.hxx
@@ -79,12 +79,12 @@ public:
static EditTextObject* Create( SvStream& rIStream,
SfxItemPool* pGlobalTextObjectPool = 0 );
- virtual size_t GetParagraphCount() const;
+ virtual sal_Int32 GetParagraphCount() const;
- virtual String GetText(size_t nParagraph) const;
- virtual void Insert(const EditTextObject& rObj, size_t nPara);
- virtual void RemoveParagraph(size_t nPara);
- virtual EditTextObject* CreateTextObject(size_t nPara, size_t nParas = 1) const;
+ virtual String GetText(sal_Int32 nParagraph) const;
+ virtual void Insert(const EditTextObject& rObj, sal_Int32 nPara);
+ virtual void RemoveParagraph(sal_Int32 nPara);
+ virtual EditTextObject* CreateTextObject(sal_Int32 nPara, sal_Int32 nParas = 1) const;
virtual sal_Bool HasPortionInfo() const;
virtual void ClearPortionInfo();
@@ -92,7 +92,7 @@ public:
virtual sal_Bool HasOnlineSpellErrors() const;
virtual sal_Bool HasCharAttribs( sal_uInt16 nWhich = 0 ) const;
- virtual void GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const;
+ virtual void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const;
virtual sal_Bool RemoveCharAttribs( sal_uInt16 nWhich = 0 );
virtual sal_Bool RemoveParaAttribs( sal_uInt16 nWhich = 0 );
@@ -103,12 +103,12 @@ public:
virtual const SvxFieldItem* GetField() const;
virtual sal_Bool HasField( TypeId aType = NULL ) const;
- virtual SfxItemSet GetParaAttribs(size_t nPara) const;
- virtual void SetParaAttribs(size_t nPara, const SfxItemSet& rAttribs);
+ virtual SfxItemSet GetParaAttribs(sal_Int32 nPara) const;
+ virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet& rAttribs);
virtual sal_Bool HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const;
- virtual void GetStyleSheet(size_t nPara, String& rName, SfxStyleFamily& eFamily) const;
- virtual void SetStyleSheet(size_t nPara, const String& rName, const SfxStyleFamily& eFamily);
+ virtual void GetStyleSheet(sal_Int32 nPara, String& rName, SfxStyleFamily& eFamily) const;
+ virtual void SetStyleSheet(sal_Int32 nPara, const String& rName, const SfxStyleFamily& eFamily);
virtual sal_Bool ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily,
const XubString& rNewName, SfxStyleFamily eNewFamily );
virtual void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName );
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index aea70fd87fba..8a4a7165b871 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -146,15 +146,15 @@ public:
void Redo();
// especially for Oliver Specht
- Point GetWindowPosTopLeft( sal_uInt16 nParagraph );
- void MoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos );
+ Point GetWindowPosTopLeft( sal_Int32 nParagraph );
+ void MoveParagraphs( Range aParagraphs, sal_Int32 nNewPos );
void MoveParagraphs( long nDiff );
const SfxItemSet& GetEmptyItemSet();
SfxItemSet GetAttribs();
void SetAttribs( const SfxItemSet& rSet );
void RemoveAttribs( sal_Bool bRemoveParaAttribs = sal_False, sal_uInt16 nWhich = 0 );
- void RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0 );
+ void RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0 );
void RemoveAttribsKeepLanguages( sal_Bool bRemoveParaAttribs = sal_False );
sal_uLong Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, sal_Bool bSelect = sal_False, SvKeyValueIterator* pHTTPHeaderAttrs = NULL );
@@ -199,8 +199,8 @@ public:
void InsertField( const SvxFieldItem& rFld );
const SvxFieldItem* GetFieldUnderMousePointer() const;
- const SvxFieldItem* GetFieldUnderMousePointer( sal_uInt16& nPara, xub_StrLen& nPos ) const;
- const SvxFieldItem* GetField( const Point& rPos, sal_uInt16* pnPara = NULL, xub_StrLen* pnPos = NULL ) const;
+ const SvxFieldItem* GetFieldUnderMousePointer( sal_Int32& nPara, xub_StrLen& nPos ) const;
+ const SvxFieldItem* GetField( const Point& rPos, sal_Int32* pnPara = NULL, xub_StrLen* pnPos = NULL ) const;
const SvxFieldItem* GetFieldAtSelection() const;
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index 61e6a411fbe8..41d6b3298a27 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -157,10 +157,10 @@ private:
struct ParaRange
{
- sal_uInt16 nStartPara;
- sal_uInt16 nEndPara;
+ sal_Int32 nStartPara;
+ sal_Int32 nEndPara;
- ParaRange( sal_uInt16 nS, sal_uInt16 nE ) { nStartPara = nS, nEndPara = nE; }
+ ParaRange( sal_Int32 nS, sal_Int32 nE ) { nStartPara = nS, nEndPara = nE; }
void Adjust();
sal_uInt16 Len() const { return 1 + ( ( nEndPara > nStartPara ) ? (nEndPara-nStartPara) : (nStartPara-nEndPara) ); }
@@ -170,7 +170,7 @@ inline void ParaRange::Adjust()
{
if ( nStartPara > nEndPara )
{
- sal_uInt16 nTmp = nStartPara;
+ sal_Int32 nTmp = nStartPara;
nStartPara = nEndPara;
nEndPara = nTmp;
}
@@ -190,9 +190,9 @@ private:
sal_Bool bInDragMode;
Point aDDStartPosRef;
Point aDDStartPosPix;
- sal_uLong nDDStartPara;
- sal_uLong nDDStartParaVisChildCount;
- sal_uLong nDDCurPara;
+ sal_Int32 nDDStartPara;
+ sal_Int32 nDDStartParaVisChildCount;
+ sal_Int32 nDDCurPara;
sal_uInt16 nDDStartDepth;
sal_uInt16 nDDCurDepth;
sal_uInt16 nDDMaxDepth;
@@ -218,16 +218,16 @@ private:
#ifdef _OUTLINER_CXX
- EDITENG_DLLPRIVATE void ImplExpandOrCollaps( sal_uInt16 nStartPara, sal_uInt16 nEndPara, sal_Bool bExpand );
+ EDITENG_DLLPRIVATE void ImplExpandOrCollaps( sal_Int32 nStartPara, sal_Int32 nEndPara, sal_Bool bExpand );
- EDITENG_DLLPRIVATE sal_uLong ImpCheckMousePos( const Point& rPosPixel, MouseTarget& reTarget);
- EDITENG_DLLPRIVATE void ImpToggleExpand( Paragraph* pParentPara );
+ EDITENG_DLLPRIVATE sal_Int32 ImpCheckMousePos( const Point& rPosPixel, MouseTarget& reTarget);
+ EDITENG_DLLPRIVATE void ImpToggleExpand( Paragraph* pParentPara );
EDITENG_DLLPRIVATE ParaRange ImpGetSelectedParagraphs( sal_Bool bIncludeHiddenChildren );
- EDITENG_DLLPRIVATE Pointer ImpGetMousePointer( MouseTarget eTarget );
- EDITENG_DLLPRIVATE sal_uInt16 ImpInitPaste( sal_uLong& rStart );
- EDITENG_DLLPRIVATE void ImpPasted( sal_uLong nStart, sal_uLong nPrevParaCount, sal_uInt16 nSize);
- EDITENG_DLLPRIVATE sal_uInt16 ImpCalcSelectedPages( sal_Bool bIncludeFirstSelected );
+ EDITENG_DLLPRIVATE Pointer ImpGetMousePointer( MouseTarget eTarget );
+ EDITENG_DLLPRIVATE sal_Int32 ImpInitPaste( sal_Int32& rStart );
+ EDITENG_DLLPRIVATE void ImpPasted( sal_Int32 nStart, sal_Int32 nPrevParaCount, sal_Int32 nSize);
+ EDITENG_DLLPRIVATE sal_Int32 ImpCalcSelectedPages( sal_Bool bIncludeFirstSelected );
EDITENG_DLLPRIVATE sal_Bool ImpIsIndentingPages();
#endif
@@ -265,12 +265,12 @@ public:
void CreateSelectionList (std::vector<Paragraph*> &aSelList) ;
// Retruns the number of selected paragraphs
- sal_uLong Select( Paragraph* pParagraph,
+ sal_Int32 Select( Paragraph* pParagraph,
sal_Bool bSelect=sal_True,
sal_Bool bWChildren=sal_True);
String GetSelected() const;
- void SelectRange( sal_uLong nFirst, sal_uInt16 nCount );
+ void SelectRange( sal_Int32 nFirst, sal_Int32 nCount );
void SetAttribs( const SfxItemSet& );
void Indent( short nDiff );
void AdjustDepth( short nDX ); // Later replace with Indent!
@@ -367,7 +367,7 @@ public:
const String& mrText;
sal_uInt16 mnTextStart;
sal_uInt16 mnTextLen;
- sal_uInt16 mnPara;
+ sal_Int32 mnPara;
xub_StrLen mnIndex;
const SvxFont& mrFont;
const sal_Int32* mpDXArray;
@@ -397,7 +397,7 @@ public:
sal_uInt16 nTxtStart,
sal_uInt16 nTxtLen,
const SvxFont& rFnt,
- sal_uInt16 nPar,
+ sal_Int32 nPar,
xub_StrLen nIdx,
const sal_Int32* pDXArr,
const EEngineData::WrongSpellVector* pWrongSpellVector,
@@ -452,14 +452,14 @@ public:
struct EDITENG_DLLPUBLIC PaintFirstLineInfo
{
- sal_uInt16 mnPara;
+ sal_Int32 mnPara;
const Point& mrStartPos;
long mnBaseLineY;
const Point& mrOrigin;
short mnOrientation;
OutputDevice* mpOutDev;
- PaintFirstLineInfo( sal_uInt16 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
+ PaintFirstLineInfo( sal_Int32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
: mnPara( nPara ), mrStartPos( rStartPos ), mnBaseLineY( nBaseLineY ), mrOrigin( rOrigin ), mnOrientation( nOrientation ), mpOutDev( pOutDev )
{}
};
@@ -477,7 +477,7 @@ private:
String aRepresentation;
- sal_uInt16 nPara;
+ sal_Int32 nPara;
xub_StrLen nPos;
sal_Bool bSimpleClick;
@@ -487,7 +487,7 @@ private:
SdrPage* mpSdrPage;
public:
- EditFieldInfo( Outliner* pOutl, const SvxFieldItem& rFItem, sal_uInt16 nPa, xub_StrLen nPo )
+ EditFieldInfo( Outliner* pOutl, const SvxFieldItem& rFItem, sal_Int32 nPa, xub_StrLen nPo )
: rFldItem( rFItem )
{
pOutliner = pOutl;
@@ -515,7 +515,7 @@ public:
void ClearFldColor()
{ delete pFldColor; pFldColor = 0; }
- sal_uInt16 GetPara() const { return nPara; }
+ sal_Int32 GetPara() const { return nPara; }
xub_StrLen GetPos() const { return nPos; }
sal_Bool IsSimpleClick() const { return bSimpleClick; }
@@ -536,7 +536,7 @@ struct EBulletInfo
String aText;
SvxFont aFont;
Graphic aGraphic;
- sal_uInt16 nParagraph;
+ sal_Int32 nParagraph;
Rectangle aBounds;
EBulletInfo() : bVisible( sal_False ), nType( 0 ), nParagraph( EE_PARA_NOT_FOUND ) {}
@@ -569,7 +569,7 @@ class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster
ViewList aViewList;
Paragraph* pHdlParagraph;
- sal_uLong mnFirstSelPage;
+ sal_Int32 mnFirstSelPage;
Link aDrawPortionHdl;
Link aDrawBulletHdl;
Link aExpandHdl;
@@ -587,11 +587,11 @@ class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster
Link maBeginPasteOrDropHdl;
Link maEndPasteOrDropHdl;
- sal_Int16 nDepthChangedHdlPrevDepth;
- sal_uInt16 mnDepthChangeHdlPrevFlags;
+ sal_Int32 nDepthChangedHdlPrevDepth;
+ sal_uInt16 mnDepthChangeHdlPrevFlags;
sal_Int16 nMaxDepth;
const sal_Int16 nMinDepth;
- sal_uInt16 nFirstPage;
+ sal_Int32 nFirstPage;
sal_uInt16 nOutlinerMode;
@@ -611,53 +611,53 @@ class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster
DECL_LINK( BeginPasteOrDropHdl, PasteOrDropInfos* );
DECL_LINK( EndPasteOrDropHdl, PasteOrDropInfos* );
DECL_LINK( EditEngineNotifyHdl, EENotify* );
- void ImplCheckParagraphs( sal_uInt16 nStart, sal_uInt16 nEnd );
- sal_Bool ImplHasBullet( sal_uInt16 nPara ) const;
- Size ImplGetBulletSize( sal_uInt16 nPara );
- sal_uInt16 ImplGetNumbering( sal_uInt16 nPara, const SvxNumberFormat* pParaFmt );
- void ImplCalcBulletText( sal_uInt16 nPara, sal_Bool bRecalcLevel, sal_Bool bRecalcChildren );
- String ImplGetBulletText( sal_uInt16 nPara );
- void ImplCheckNumBulletItem( sal_uInt16 nPara );
- void ImplInitDepth( sal_uInt16 nPara, sal_Int16 nDepth, sal_Bool bCreateUndo, sal_Bool bUndoAction = sal_False );
- void ImplSetLevelDependendStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pLevelStyle = NULL );
+ void ImplCheckParagraphs( sal_Int32 nStart, sal_Int32 nEnd );
+ sal_Bool ImplHasBullet( sal_Int32 nPara ) const;
+ Size ImplGetBulletSize( sal_Int32 nPara );
+ sal_uInt16 ImplGetNumbering( sal_Int32 nPara, const SvxNumberFormat* pParaFmt );
+ void ImplCalcBulletText( sal_Int32 nPara, sal_Bool bRecalcLevel, sal_Bool bRecalcChildren );
+ String ImplGetBulletText( sal_Int32 nPara );
+ void ImplCheckNumBulletItem( sal_Int32 nPara );
+ void ImplInitDepth( sal_Int32 nPara, sal_Int16 nDepth, sal_Bool bCreateUndo, sal_Bool bUndoAction = sal_False );
+ void ImplSetLevelDependendStyleSheet( sal_Int32 nPara, SfxStyleSheet* pLevelStyle = NULL );
void ImplBlockInsertionCallbacks( sal_Bool b );
- void ImplCheckStyleSheet( sal_uInt16 nPara, sal_Bool bReplaceExistingStyle );
- void ImpRecalcBulletIndent( sal_uLong nPara );
+ void ImplCheckStyleSheet( sal_Int32 nPara, sal_Bool bReplaceExistingStyle );
+ void ImpRecalcBulletIndent( sal_Int32 nPara );
- const SvxBulletItem& ImpGetBullet( sal_uLong nPara, sal_uInt16& );
- void ImpFilterIndents( sal_uLong nFirstPara, sal_uLong nLastPara );
- bool ImpConvertEdtToOut( sal_uInt32 nPara, EditView* pView = 0 );
+ const SvxBulletItem& ImpGetBullet( sal_Int32 nPara, sal_uInt16& );
+ void ImpFilterIndents( sal_Int32 nFirstPara, sal_Int32 nLastPara );
+ bool ImpConvertEdtToOut( sal_Int32 nPara, EditView* pView = 0 );
- void ImpTextPasted( sal_uLong nStartPara, sal_uInt16 nCount );
- long ImpCalcMaxBulletWidth( sal_uInt16 nPara, const SvxBulletItem& rBullet );
- Font ImpCalcBulletFont( sal_uInt16 nPara ) const;
- Rectangle ImpCalcBulletArea( sal_uInt16 nPara, sal_Bool bAdjust, sal_Bool bReturnPaperPos );
- long ImpGetTextIndent( sal_uLong nPara );
+ void ImpTextPasted( sal_Int32 nStartPara, sal_Int32 nCount );
+ long ImpCalcMaxBulletWidth( sal_Int32 nPara, const SvxBulletItem& rBullet );
+ Font ImpCalcBulletFont( sal_Int32 nPara ) const;
+ Rectangle ImpCalcBulletArea( sal_Int32 nPara, sal_Bool bAdjust, sal_Bool bReturnPaperPos );
+ long ImpGetTextIndent( sal_Int32 nPara );
sal_Bool ImpCanIndentSelectedPages( OutlinerView* pCurView );
sal_Bool ImpCanDeleteSelectedPages( OutlinerView* pCurView );
- sal_Bool ImpCanDeleteSelectedPages( OutlinerView* pCurView, sal_uInt16 nFirstPage, sal_uInt16 nPages );
+ sal_Bool ImpCanDeleteSelectedPages( OutlinerView* pCurView, sal_Int32 nFirstPage, sal_Int32 nPages );
sal_uInt16 ImplGetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; }
void ImplCheckDepth( sal_Int16& rnDepth ) const;
#endif
protected:
- void ParagraphInserted( sal_uInt16 nParagraph );
- void ParagraphDeleted( sal_uInt16 nParagraph );
- void ParaAttribsChanged( sal_uInt16 nParagraph );
+ void ParagraphInserted( sal_Int32 nParagraph );
+ void ParagraphDeleted( sal_Int32 nParagraph );
+ void ParaAttribsChanged( sal_Int32 nParagraph );
virtual void StyleSheetChanged( SfxStyleSheet* pStyle );
- void InvalidateBullet( Paragraph* pPara, sal_uLong nPara );
- void PaintBullet( sal_uInt16 nPara, const Point& rStartPos,
+ void InvalidateBullet( Paragraph* pPara, sal_Int32 nPara );
+ void PaintBullet( sal_Int32 nPara, const Point& rStartPos,
const Point& rOrigin, short nOrientation,
OutputDevice* pOutDev );
// used by OutlinerEditEng. Allows Outliner objects to provide
// bullet access to the EditEngine.
- virtual const SvxNumberFormat* GetNumberFormat( sal_uInt16 nPara ) const;
+ virtual const SvxNumberFormat* GetNumberFormat( sal_Int32 nPara ) const;
public:
@@ -676,7 +676,7 @@ public:
EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const;
sal_uInt16 GetScriptType( const ESelection& rSelection ) const;
- LanguageType GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const;
+ LanguageType GetLanguage( sal_Int32 nPara, sal_uInt16 nPos ) const;
void SetAsianCompressionMode( sal_uInt16 nCompressionMode );
@@ -690,13 +690,13 @@ public:
OutlinerView* GetView( size_t nIndex ) const;
size_t GetViewCount() const;
- Paragraph* Insert( const String& rText, sal_uLong nAbsPos = CONTAINER_APPEND, sal_Int16 nDepth = 0 );
+ Paragraph* Insert( const String& rText, sal_Int32 nAbsPos = EE_PARA_APPEND, sal_Int16 nDepth = 0 );
void SetText( const OutlinerParaObject& );
void AddText( const OutlinerParaObject& );
void SetText( const String& rText, Paragraph* pParagraph );
- String GetText( Paragraph* pPara, sal_uLong nParaCount=1 ) const;
+ String GetText( Paragraph* pPara, sal_Int32 nParaCount=1 ) const;
- OutlinerParaObject* CreateParaObject( sal_uInt16 nStartPara = 0, sal_uInt16 nParaCount = 0xFFFF ) const;
+ OutlinerParaObject* CreateParaObject( sal_Int32 nStartPara = 0, sal_Int32 nParaCount = EE_PARA_ALL ) const;
const SfxItemSet& GetEmptyItemSet() const;
@@ -718,17 +718,17 @@ public:
void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
- sal_uLong GetParagraphCount() const;
- Paragraph* GetParagraph( sal_uLong nAbsPos ) const;
+ sal_Int32 GetParagraphCount() const;
+ Paragraph* GetParagraph( sal_Int32 nAbsPos ) const;
sal_Bool HasParent( Paragraph* pParagraph ) const;
sal_Bool HasChildren( Paragraph* pParagraph ) const;
- sal_uLong GetChildCount( Paragraph* pParent ) const;
+ sal_Int32 GetChildCount( Paragraph* pParent ) const;
sal_Bool IsExpanded( Paragraph* pPara ) const;
Paragraph* GetParent( Paragraph* pParagraph ) const;
- sal_uLong GetAbsPos( Paragraph* pPara );
+ sal_Int32 GetAbsPos( Paragraph* pPara );
- sal_Int16 GetDepth( sal_uLong nPara ) const;
+ sal_Int16 GetDepth( sal_Int32 nPara ) const;
void SetDepth( Paragraph* pParagraph, sal_Int16 nNewDepth );
sal_Bool IsVisible( Paragraph* pPara ) const { return pPara->IsVisible(); }
@@ -761,8 +761,8 @@ public:
virtual void DepthChangedHdl();
void SetDepthChangedHdl(const Link& rLink){aDepthChangedHdl=rLink;}
Link GetDepthChangedHdl() const { return aDepthChangedHdl; }
- sal_Int16 GetPrevDepth() const { return nDepthChangedHdlPrevDepth; }
- sal_uInt16 GetPrevFlags() const { return mnDepthChangeHdlPrevFlags; }
+ sal_Int16 GetPrevDepth() const { return static_cast<sal_Int16>(nDepthChangedHdlPrevDepth); }
+ sal_uInt16 GetPrevFlags() const { return mnDepthChangeHdlPrevFlags; }
virtual long RemovingPagesHdl( OutlinerView* );
void SetRemovingPagesHdl(const Link& rLink){aRemovingPagesHdl=rLink;}
@@ -771,10 +771,10 @@ public:
void SetIndentingPagesHdl(const Link& rLink){aIndentingPagesHdl=rLink;}
Link GetIndentingPagesHdl() const { return aIndentingPagesHdl; }
// valid only in the two upper handlers
- sal_uInt16 GetSelPageCount() const { return nDepthChangedHdlPrevDepth; }
+ sal_Int32 GetSelPageCount() const { return nDepthChangedHdlPrevDepth; }
// valid only in the two upper handlers
- sal_uLong GetFirstSelPage() const { return mnFirstSelPage; }
+ sal_Int32 GetFirstSelPage() const { return mnFirstSelPage; }
void SetCalcFieldValueHdl(const Link& rLink ) { aCalcFieldValueHdl= rLink; }
Link GetCalcFieldValueHdl() const { return aCalcFieldValueHdl; }
@@ -805,8 +805,8 @@ public:
const Size& GetPaperSize() const;
void SetPaperSize( const Size& rSize );
- void SetFirstPageNumber( sal_uInt16 n ) { nFirstPage = n; }
- sal_uInt16 GetFirstPageNumber() const { return nFirstPage; }
+ void SetFirstPageNumber( sal_Int32 n ) { nFirstPage = n; }
+ sal_Int32 GetFirstPageNumber() const { return nFirstPage; }
void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon );
void SetPolygon( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon* pLinePolyPolygon);
@@ -828,17 +828,17 @@ public:
void ForceAutoColor( sal_Bool b );
sal_Bool IsForceAutoColor() const;
- EBulletInfo GetBulletInfo( sal_uInt16 nPara );
+ EBulletInfo GetBulletInfo( sal_Int32 nPara );
void SetWordDelimiters( const String& rDelimiters );
String GetWordDelimiters() const;
- String GetWord( sal_uInt16 nPara, xub_StrLen nIndex );
+ String GetWord( sal_Int32 nPara, xub_StrLen nIndex );
void StripPortions();
virtual void DrawingText(
const Point& rStartPos, const String& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen,
- const sal_Int32* pDXArray, const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
+ const sal_Int32* pDXArray, const SvxFont& rFont, sal_Int32 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -850,7 +850,7 @@ public:
virtual void DrawingTab(
const Point& rStartPos, long nWidth, const String& rChar,
- const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
+ const SvxFont& rFont, sal_Int32 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
bool bEndOfLine,
bool bEndOfParagraph,
const Color& rOverlineColor,
@@ -864,13 +864,13 @@ public:
sal_Bool IsInSelectionMode() const;
- void SetStyleSheet( sal_uLong nPara, SfxStyleSheet* pStyle );
- SfxStyleSheet* GetStyleSheet( sal_uLong nPara );
+ void SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle );
+ SfxStyleSheet* GetStyleSheet( sal_Int32 nPara );
- void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& );
- SfxItemSet GetParaAttribs( sal_uInt16 nPara );
+ void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& );
+ SfxItemSet GetParaAttribs( sal_Int32 nPara );
- void Remove( Paragraph* pPara, sal_uLong nParaCount );
+ void Remove( Paragraph* pPara, sal_Int32 nParaCount );
sal_Bool Expand( Paragraph* );
sal_Bool Collapse( Paragraph* );
@@ -890,9 +890,9 @@ public:
Link GetEndMovingHdl() const {return aEndMovingHdl;}
void SetEndMovingHdl( const Link& rLink){aEndMovingHdl=rLink;}
- sal_uLong GetLineCount( sal_uLong nParagraph ) const;
- sal_uInt16 GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const;
- sal_uLong GetLineHeight( sal_uLong nParagraph, sal_uLong nLine = 0 );
+ sal_uLong GetLineCount( sal_Int32 nParagraph ) const;
+ sal_uInt16 GetLineLen( sal_Int32 nParagraph, sal_uInt16 nLine ) const;
+ sal_uLong GetLineHeight( sal_Int32 nParagraph, sal_uInt16 nLine = 0 );
// nFormat must be a value from the enum EETextFormat (due to CLOOKS)
sal_uLong Read( SvStream& rInput, const String& rBaseURL, sal_uInt16, SvKeyValueIterator* pHTTPHeaderAttrs = NULL );
@@ -907,15 +907,15 @@ public:
// Only for EditEngine mode
void QuickInsertText( const String& rText, const ESelection& rSel );
void QuickDelete( const ESelection& rSel );
- void QuickRemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0 );
+ void QuickRemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0 );
void QuickFormatDoc( sal_Bool bFull = sal_False );
sal_Bool UpdateFields();
void RemoveFields( sal_Bool bKeepFieldText, TypeId aType = NULL );
- virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
- virtual void FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
- virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos, Color*& rTxtColor, Color*& rFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos );
+ virtual void FieldSelected( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos );
+ virtual String CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos, Color*& rTxtColor, Color*& rFldColor );
void SetSpeller( ::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XSpellChecker1 > &xSpeller );
@@ -948,8 +948,8 @@ public:
OutputDevice* GetRefDevice() const;
sal_uLong GetTextHeight() const;
- sal_uLong GetTextHeight( sal_uLong nParagraph ) const;
- Point GetDocPosTopLeft( sal_uLong nParagraph );
+ sal_uLong GetTextHeight( sal_Int32 nParagraph ) const;
+ Point GetDocPosTopLeft( sal_Int32 nParagraph );
Point GetDocPos( const Point& rPaperPos ) const;
sal_Bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder = 0 );
sal_Bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder, sal_Bool* pbBuuletPos );
@@ -963,7 +963,7 @@ public:
const EditEngine& GetEditEngine() const { return *((EditEngine*)pEditEngine); }
// this is needed for StarOffice Api
- void SetLevelDependendStyleSheet( sal_uInt16 nPara );
+ void SetLevelDependendStyleSheet( sal_Int32 nPara );
sal_uInt16 GetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; }
@@ -989,11 +989,11 @@ public:
void SetEndPasteOrDropHdl( const Link& rLink );
Link GetEndPasteOrDropHdl() const { return maEndPasteOrDropHdl; }
- virtual sal_Int16 GetNumberingStartValue( sal_uInt16 nPara );
- virtual void SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingStartValue );
+ virtual sal_Int16 GetNumberingStartValue( sal_Int32 nPara );
+ virtual void SetNumberingStartValue( sal_Int32 nPara, sal_Int16 nNumberingStartValue );
- virtual sal_Bool IsParaIsNumberingRestart( sal_uInt16 nPara );
- virtual void SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumberingRestart );
+ virtual sal_Bool IsParaIsNumberingRestart( sal_Int32 nPara );
+ virtual void SetParaIsNumberingRestart( sal_Int32 nPara, sal_Bool bParaIsNumberingRestart );
};
#endif
diff --git a/editeng/inc/editeng/outlobj.hxx b/editeng/inc/editeng/outlobj.hxx
index 73eb9b5b96d5..8aa45c2157d2 100644
--- a/editeng/inc/editeng/outlobj.hxx
+++ b/editeng/inc/editeng/outlobj.hxx
@@ -68,11 +68,11 @@ public:
void SetVertical(bool bNew);
// data read access
- sal_uInt32 Count() const;
- sal_Int16 GetDepth(sal_uInt16 nPara) const;
+ sal_Int32 Count() const;
+ sal_Int16 GetDepth(sal_Int32 nPara) const;
const EditTextObject& GetTextObject() const;
bool IsEditDoc() const;
- const ParagraphData& GetParagraphData(sal_uInt32 nIndex) const;
+ const ParagraphData& GetParagraphData(sal_Int32 nIndex) const;
// portion info support
void ClearPortionInfo();
diff --git a/editeng/inc/editeng/svxrtf.hxx b/editeng/inc/editeng/svxrtf.hxx
index 59336d46fb0f..073a0db0a8e9 100644
--- a/editeng/inc/editeng/svxrtf.hxx
+++ b/editeng/inc/editeng/svxrtf.hxx
@@ -59,7 +59,7 @@ class SvxNodeIdx
{
public:
virtual ~SvxNodeIdx() {}
- virtual sal_uLong GetIdx() const = 0;
+ virtual sal_Int32 GetIdx() const = 0;
virtual SvxNodeIdx* Clone() const = 0; // Cloning itself
};
@@ -68,7 +68,7 @@ class SvxPosition
public:
virtual ~SvxPosition() {}
- virtual sal_uLong GetNodeIdx() const = 0;
+ virtual sal_Int32 GetNodeIdx() const = 0;
virtual xub_StrLen GetCntIdx() const = 0;
virtual SvxPosition* Clone() const = 0; // Cloning itself
@@ -428,8 +428,8 @@ public:
void MoveFullNode(const SvxNodeIdx &rOldNode,
const SvxNodeIdx &rNewNode);
- sal_uLong GetSttNodeIdx() const { return pSttNd->GetIdx(); }
- sal_uLong GetEndNodeIdx() const { return pEndNd->GetIdx(); }
+ sal_Int32 GetSttNodeIdx() const { return pSttNd->GetIdx(); }
+ sal_Int32 GetEndNodeIdx() const { return pEndNd->GetIdx(); }
const SvxNodeIdx& GetSttNode() const { return *pSttNd; }
const SvxNodeIdx& GetEndNode() const { return *pEndNd; }
diff --git a/editeng/inc/editeng/unoedhlp.hxx b/editeng/inc/editeng/unoedhlp.hxx
index 25cf36f17356..7f8168de83c1 100644
--- a/editeng/inc/editeng/unoedhlp.hxx
+++ b/editeng/inc/editeng/unoedhlp.hxx
@@ -41,17 +41,17 @@ class EditEngine;
class EDITENG_DLLPUBLIC SvxEditSourceHint : public TextHint
{
private:
- sal_uLong mnStart;
- sal_uLong mnEnd;
+ sal_Int32 mnStart;
+ sal_Int32 mnEnd;
public:
TYPEINFO();
SvxEditSourceHint( sal_uLong nId );
- SvxEditSourceHint( sal_uLong nId, sal_uLong nValue, sal_uLong nStart=0, sal_uLong nEnd=0 );
+ SvxEditSourceHint( sal_uLong nId, sal_uLong nValue, sal_Int32 nStart=0, sal_Int32 nEnd=0 );
sal_uLong GetValue() const;
- sal_uLong GetStartValue() const;
- sal_uLong GetEndValue() const;
+ sal_Int32 GetStartValue() const;
+ sal_Int32 GetEndValue() const;
};
/** Helper class for common functionality in edit sources
@@ -92,7 +92,7 @@ public:
@return sal_True, if the range has been successfully determined
*/
- static sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_uInt16 nPara, sal_uInt16 nIndex );
+ static sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_Int32 nPara, sal_uInt16 nIndex );
/** Convert point from edit engine to user coordinate space
diff --git a/editeng/inc/editeng/unoedprx.hxx b/editeng/inc/editeng/unoedprx.hxx
index 83ed5090c5fd..6d59121cfc1d 100644
--- a/editeng/inc/editeng/unoedprx.hxx
+++ b/editeng/inc/editeng/unoedprx.hxx
@@ -33,20 +33,20 @@ public:
SvxAccessibleTextAdapter();
virtual ~SvxAccessibleTextAdapter();
- virtual sal_uInt16 GetParagraphCount() const;
- virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual sal_Int32 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_Int32 nParagraph ) const;
virtual String GetText( const ESelection& rSel ) const;
virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const;
- virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
- virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const;
+ virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
- virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
+ virtual void GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const;
- virtual sal_Int32 CalcLogicalIndex( sal_uInt16 nPara, sal_uInt16 nEEIndex );
- virtual sal_uInt16 CalcEditEngineIndex( sal_uInt16 nPara, sal_Int32 nLogicalIndex );
+ virtual sal_Int32 CalcLogicalIndex( sal_Int32 nPara, sal_uInt16 nEEIndex );
+ virtual sal_uInt16 CalcEditEngineIndex( sal_Int32 nPara, sal_Int32 nLogicalIndex );
virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
- virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const;
virtual void QuickInsertText( const String& rText, const ESelection& rSel );
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
@@ -55,46 +55,46 @@ public:
virtual SfxItemPool* GetPool() const;
- virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
- virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos );
virtual sal_Bool IsValid() const;
- virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
- virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
- virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
- virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
- virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const;
+ virtual LanguageType GetLanguage( sal_Int32, sal_uInt16 ) const;
+ virtual sal_uInt16 GetFieldCount( sal_Int32 nPara ) const;
+ virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const;
+ virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const;
+ virtual Rectangle GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ virtual Rectangle GetParaBounds( sal_Int32 nPara ) const;
virtual MapMode GetMapMode() const;
virtual OutputDevice* GetRefDevice() const;
- virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
- virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
- virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_uInt16& nIndex ) const;
+ virtual sal_Bool GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineCount( sal_Int32 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const;
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
- virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const;
- virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth );
+ virtual sal_Int16 GetDepth( sal_Int32 nPara ) const;
+ virtual sal_Bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth );
virtual const SfxItemSet* GetEmptyItemSetPtr();
// implementation functions for XParagraphAppend and XTextPortionAppend
// (not needed for accessibility, only for new import API)
virtual void AppendParagraph();
- virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
+ virtual xub_StrLen AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet &rSet );
//XTextCopy
virtual void CopyText(const SvxTextForwarder& rSource);
void SetForwarder( SvxTextForwarder& );
- sal_Bool HaveImageBullet( sal_uInt16 nPara ) const;
- sal_Bool HaveTextBullet( sal_uInt16 nPara ) const;
+ sal_Bool HaveImageBullet( sal_Int32 nPara ) const;
+ sal_Bool HaveTextBullet( sal_Int32 nPara ) const;
/** Query whether all text in given selection is editable
diff --git a/editeng/inc/editeng/unoedsrc.hxx b/editeng/inc/editeng/unoedsrc.hxx
index bb5044cc3e70..9b2956924b12 100644
--- a/editeng/inc/editeng/unoedsrc.hxx
+++ b/editeng/inc/editeng/unoedsrc.hxx
@@ -140,25 +140,25 @@ class EDITENG_DLLPUBLIC SvxTextForwarder
public:
virtual ~SvxTextForwarder();
- virtual sal_uInt16 GetParagraphCount() const = 0;
- virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const = 0;
+ virtual sal_Int32 GetParagraphCount() const = 0;
+ virtual sal_uInt16 GetTextLen( sal_Int32 nParagraph ) const = 0;
virtual String GetText( const ESelection& rSel ) const = 0;
virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const = 0;
- virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const = 0;
- virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) = 0;
+ virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const = 0;
+ virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) = 0;
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ) = 0;
- virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const = 0;
+ virtual void GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const = 0;
virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const = 0;
- virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const = 0;
+ virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const = 0;
virtual void QuickInsertText( const String& rText, const ESelection& rSel ) = 0;
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) = 0;
virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) = 0;
virtual void QuickInsertLineBreak( const ESelection& rSel ) = 0;
- virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ) = 0;
- virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos ) = 0;
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ) = 0;
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos ) = 0;
virtual SfxItemPool* GetPool() const = 0;
@@ -166,7 +166,7 @@ public:
// implementation functions for XParagraphAppend and XTextPortionAppend
virtual void AppendParagraph() = 0;
- virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet ) = 0;
+ virtual xub_StrLen AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet &rSet ) = 0;
// XTextCopy
virtual void CopyText(const SvxTextForwarder& rSource) = 0;
@@ -185,14 +185,14 @@ public:
@param nIndex[0 .. m-1]
Index of character to query language of
*/
- virtual LanguageType GetLanguage( sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+ virtual LanguageType GetLanguage( sal_Int32 nPara, sal_uInt16 nIndex ) const = 0;
/** Query number of fields in the underlying edit engine
@param nPara[0 .. n-1]
Index of paragraph to query field number in
*/
- virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const = 0;
+ virtual sal_uInt16 GetFieldCount( sal_Int32 nPara ) const = 0;
/** Query information for given field number in the underlying edit engine
@@ -202,14 +202,14 @@ public:
@param nField[0 .. m-1]
Index of field to query information of
*/
- virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const = 0;
+ virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const = 0;
/** Query information regarding bullets for given paragraph on the underlying edit engine
@param nPara[0 .. n-1]
Index of paragraph to query bullet info on
*/
- virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const = 0;
+ virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const = 0;
/** Query the bounding rectangle of the given character
@@ -232,7 +232,7 @@ public:
left corner of text. The coordinates returned here are to be
interpreted in the map mode given by GetMapMode().
*/
- virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+ virtual Rectangle GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const = 0;
/** Query the bounding rectangle of the given paragraph
@@ -243,7 +243,7 @@ public:
left corner of text. The coordinates returned here are to be
interpreted in the map mode given by GetMapMode().
*/
- virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const = 0;
+ virtual Rectangle GetParaBounds( sal_Int32 nPara ) const = 0;
/** Query the map mode of the underlying EditEngine/Outliner
@@ -280,7 +280,7 @@ public:
@return sal_True, if the point is over any text and both rPara and rIndex are valid
*/
- virtual sal_Bool GetIndexAtPoint( const Point& rPoint, sal_uInt16& rPara, sal_uInt16& rIndex ) const = 0;
+ virtual sal_Bool GetIndexAtPoint( const Point& rPoint, sal_Int32& rPara, sal_uInt16& rIndex ) const = 0;
/** Get the start and the end index of the word at the given index
@@ -305,7 +305,7 @@ public:
@return sal_True, if the result is non-empty
*/
- virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& rStart, sal_uInt16& rEnd ) const = 0;
+ virtual sal_Bool GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& rStart, sal_uInt16& rEnd ) const = 0;
/** Query range of similar attributes
@@ -322,7 +322,7 @@ public:
@return sal_True, if the range has been successfully determined
*/
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex ) const = 0;
/** Query number of lines in the formatted paragraph
@@ -332,7 +332,7 @@ public:
@return number of lines in given paragraph
*/
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const = 0;
+ virtual sal_uInt16 GetLineCount( sal_Int32 nPara ) const = 0;
/** Query line length
@@ -343,7 +343,7 @@ public:
Index of line in paragraph to query line length of
*/
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const = 0;
+ virtual sal_uInt16 GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const = 0;
/** Query bounds of line in paragraph
@@ -360,7 +360,7 @@ public:
Index of line in paragraph to query line length of
*/
- virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const = 0;
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const = 0;
/** Query the line number for a index in the paragraphs text
@@ -373,7 +373,7 @@ public:
@returns [0 .. k-1]
The line number of the chara in the paragraph
*/
- virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const = 0;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const = 0;
/** Delete given text range and reformat text
@@ -412,7 +412,7 @@ public:
@return the outline level of the given paragraph. The range is
[0,n), where n is the maximal outline level.
*/
- virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const = 0;
+ virtual sal_Int16 GetDepth( sal_Int32 nPara ) const = 0;
/** Set the outline depth of given paragraph
@@ -427,13 +427,13 @@ public:
failure are e.g. the text does not support outline level
(EditEngine), or the depth range is exceeded.
*/
- virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth ) = 0;
+ virtual sal_Bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth ) = 0;
- virtual sal_Int16 GetNumberingStartValue( sal_uInt16 nPara );
- virtual void SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingStartValue );
+ virtual sal_Int16 GetNumberingStartValue( sal_Int32 nPara );
+ virtual void SetNumberingStartValue( sal_Int32 nPara, sal_Int16 nNumberingStartValue );
- virtual sal_Bool IsParaIsNumberingRestart( sal_uInt16 nPara );
- virtual void SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumberingRestart );
+ virtual sal_Bool IsParaIsNumberingRestart( sal_Int32 nPara );
+ virtual void SetParaIsNumberingRestart( sal_Int32 nPara, sal_Bool bParaIsNumberingRestart );
};
/** Encapsulates the document view for the purpose of unified
diff --git a/editeng/inc/editeng/unofored.hxx b/editeng/inc/editeng/unofored.hxx
index 5c88119f3a8f..a3ccc46218e2 100644
--- a/editeng/inc/editeng/unofored.hxx
+++ b/editeng/inc/editeng/unofored.hxx
@@ -35,17 +35,17 @@ public:
SvxEditEngineForwarder( EditEngine& rEngine );
virtual ~SvxEditEngineForwarder();
- virtual sal_uInt16 GetParagraphCount() const;
- virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual sal_Int32 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_Int32 nParagraph ) const;
virtual String GetText( const ESelection& rSel ) const;
virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All ) const;
- virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
- virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const;
+ virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
- virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
+ virtual void GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const;
virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
- virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const;
virtual void QuickInsertText( const String& rText, const ESelection& rSel );
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
@@ -54,36 +54,36 @@ public:
virtual SfxItemPool* GetPool() const;
- virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
- virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos );
virtual sal_Bool IsValid() const;
- virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
- virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
- virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
- virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
- virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const;
+ virtual LanguageType GetLanguage( sal_Int32, sal_uInt16 ) const;
+ virtual sal_uInt16 GetFieldCount( sal_Int32 nPara ) const;
+ virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const;
+ virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const;
+ virtual Rectangle GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ virtual Rectangle GetParaBounds( sal_Int32 nPara ) const;
virtual MapMode GetMapMode() const;
virtual OutputDevice* GetRefDevice() const;
- virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
- virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
- virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_uInt16& nIndex ) const;
+ virtual sal_Bool GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineCount( sal_Int32 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const;
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
- virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const;
- virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth );
+ virtual sal_Int16 GetDepth( sal_Int32 nPara ) const;
+ virtual sal_Bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth );
virtual const SfxItemSet* GetEmptyItemSetPtr();
// implementation functions for XParagraphAppend and XTextPortionAppend
virtual void AppendParagraph();
- virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
+ virtual xub_StrLen AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet &rSet );
//XTextCopy
virtual void CopyText(const SvxTextForwarder& rSource);
};
diff --git a/editeng/inc/editeng/unoforou.hxx b/editeng/inc/editeng/unoforou.hxx
index 68ee89160944..0e03a70fae28 100644
--- a/editeng/inc/editeng/unoforou.hxx
+++ b/editeng/inc/editeng/unoforou.hxx
@@ -47,23 +47,23 @@ private:
mutable SfxItemSet* mpParaAttribsCache;
/** if we have a cached para attribute item set, this is the paragraph of it */
- mutable sal_uInt16 mnParaAttribsCache;
+ mutable sal_Int32 mnParaAttribsCache;
public:
SvxOutlinerForwarder( Outliner& rOutl, sal_Bool bOutlText = sal_False );
virtual ~SvxOutlinerForwarder();
- virtual sal_uInt16 GetParagraphCount() const;
- virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual sal_Int32 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_Int32 nParagraph ) const;
virtual String GetText( const ESelection& rSel ) const;
virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const;
- virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
- virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const;
+ virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
- virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
+ virtual void GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const;
virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
- virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const;
virtual void QuickInsertText( const String& rText, const ESelection& rSel );
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
@@ -72,38 +72,38 @@ public:
virtual SfxItemPool* GetPool() const;
- virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
- virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos );
virtual sal_Bool IsValid() const;
Outliner& GetOutliner() const { return rOutliner; }
- virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
- virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
- virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
- virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
- virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const;
+ virtual LanguageType GetLanguage( sal_Int32, sal_uInt16 ) const;
+ virtual sal_uInt16 GetFieldCount( sal_Int32 nPara ) const;
+ virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const;
+ virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const;
+ virtual Rectangle GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ virtual Rectangle GetParaBounds( sal_Int32 nPara ) const;
virtual MapMode GetMapMode() const;
virtual OutputDevice* GetRefDevice() const;
- virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
- virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
- virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nPara, sal_uInt16 nLine ) const;
- virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_uInt16& nIndex ) const;
+ virtual sal_Bool GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineCount( sal_Int32 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const;
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nPara, sal_uInt16 nLine ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
- virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const;
- virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth );
- virtual sal_Int16 GetNumberingStartValue( sal_uInt16 nPara );
- virtual void SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingStartValue );
+ virtual sal_Int16 GetDepth( sal_Int32 nPara ) const;
+ virtual sal_Bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth );
+ virtual sal_Int16 GetNumberingStartValue( sal_Int32 nPara );
+ virtual void SetNumberingStartValue( sal_Int32 nPara, sal_Int16 nNumberingStartValue );
- virtual sal_Bool IsParaIsNumberingRestart( sal_uInt16 nPara );
- virtual void SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumberingRestart );
+ virtual sal_Bool IsParaIsNumberingRestart( sal_Int32 nPara );
+ virtual void SetParaIsNumberingRestart( sal_Int32 nPara, sal_Bool bParaIsNumberingRestart );
/* this method flushes internal caches for this forwarder */
void flushCache();
@@ -112,7 +112,7 @@ public:
// implementation functions for XParagraphAppend and XTextPortionAppend
virtual void AppendParagraph();
- virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
+ virtual xub_StrLen AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet &rSet );
//XTextCopy
virtual void CopyText(const SvxTextForwarder& rSource);
};
diff --git a/editeng/inc/editeng/unotext.hxx b/editeng/inc/editeng/unotext.hxx
index 13ab909256ee..45e5122fbc8b 100644
--- a/editeng/inc/editeng/unotext.hxx
+++ b/editeng/inc/editeng/unotext.hxx
@@ -180,17 +180,17 @@ public:
virtual void UpdateData();
// SvxTextForwarder
- virtual sal_uInt16 GetParagraphCount() const;
- virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual sal_Int32 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_Int32 nParagraph ) const;
virtual String GetText( const ESelection& rSel ) const;
virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = 0 ) const;
- virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
- virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const;
+ virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
- virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
+ virtual void GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const;
sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
- sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+ sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const;
virtual SfxItemPool* GetPool() const;
@@ -199,38 +199,38 @@ public:
virtual void QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel );
virtual void QuickInsertLineBreak( const ESelection& rSel );
- virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
- virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos );
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos );
virtual sal_Bool IsValid() const;
virtual void SetNotifyHdl( const Link& );
- virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
- virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
- virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
- virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
- virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const;
+ virtual LanguageType GetLanguage( sal_Int32, sal_uInt16 ) const;
+ virtual sal_uInt16 GetFieldCount( sal_Int32 nPara ) const;
+ virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const;
+ virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const;
+ virtual Rectangle GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ virtual Rectangle GetParaBounds( sal_Int32 nPara ) const;
virtual MapMode GetMapMode() const;
virtual OutputDevice* GetRefDevice() const;
- virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
- virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
- virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_Bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_uInt16& nIndex ) const;
+ virtual sal_Bool GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineCount( sal_Int32 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const;
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
- virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const;
- virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth );
+ virtual sal_Int16 GetDepth( sal_Int32 nPara ) const;
+ virtual sal_Bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth );
virtual const SfxItemSet* GetEmptyItemSetPtr();
// implementation functions for XParagraphAppend and XTextPortionAppend
virtual void AppendParagraph();
- virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
+ virtual xub_StrLen AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet &rSet );
//XTextCopy
virtual void CopyText(const SvxTextForwarder& rSource);
};
@@ -494,7 +494,7 @@ class SvxUnoTextContentEnumeration : public ::cppu::WeakAggImplHelper1< ::com::s
private:
::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
SvxEditSource* mpEditSource;
- sal_uInt16 mnNextParagraph;
+ sal_Int32 mnNextParagraph;
const SvxUnoTextBase& mrText;
public:
@@ -518,7 +518,7 @@ class SvxUnoTextContent : public SvxUnoTextRangeBase,
friend class SvxUnoTextContentEnumeration;
private:
::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
- sal_uInt16 mnParagraph;
+ sal_Int32 mnParagraph;
const SvxUnoTextBase& mrParentText;
// for xComponent
@@ -531,7 +531,7 @@ protected:
using SvxUnoTextRangeBase::getPropertyValue;
public:
- SvxUnoTextContent( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw();
+ SvxUnoTextContent( const SvxUnoTextBase& rText, sal_Int32 nPara ) throw();
SvxUnoTextContent( const SvxUnoTextContent& rContent ) throw();
virtual ~SvxUnoTextContent() throw();
@@ -590,12 +590,12 @@ private:
SvxEditSource* mpEditSource;
::com::sun::star::uno::Reference< ::com::sun::star::text::XText > mxParentText;
const SvxUnoTextBase& mrParentText;
- sal_uInt16 mnParagraph;
+ sal_Int32 mnParagraph;
std::vector<sal_uInt16>* mpPortions;
sal_uInt16 mnNextPortion;
public:
- SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw();
+ SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rText, sal_Int32 nPara ) throw();
virtual ~SvxUnoTextRangeEnumeration() throw();
// ::com::sun::star::container::XEnumeration
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 602879ed7a9e..e6e39ad3c400 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 9d0143da5ec8..7dd703c738cd 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 ::rtl::OUString& rD )
+ AccessibleHyperlink::AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_Int32 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD )
: rTA( r )
{
pFld = p;
diff --git a/editeng/source/accessibility/AccessibleHyperlink.hxx b/editeng/source/accessibility/AccessibleHyperlink.hxx
index 30448b22833b..17ff2d02362b 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
::rtl::OUString aDescription;
public:
- AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_uInt16 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD );
+ AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_Int32 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD );
~AccessibleHyperlink();
// XAccessibleAction
diff --git a/editeng/source/accessibility/AccessibleImageBullet.cxx b/editeng/source/accessibility/AccessibleImageBullet.cxx
index 8d97477c9a81..0211e619c12b 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 f2150623ba68..7e78a9e3682f 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 6843dfe7d5c7..b7b268d0d71b 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) );
}
//------------------------------------------------------------------------
@@ -322,11 +322,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;
}
@@ -366,11 +373,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) );
}
}
@@ -378,11 +385,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 88aa0e3e8573..b0b780e6a847 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 80556b98c562..3f103b015198 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);
}
rtl::OUString EditDoc::GetSepStr( LineEnd eEnd )
@@ -2042,7 +2078,7 @@ rtl::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 rtl::OUString();
@@ -2054,8 +2090,8 @@ XubString EditDoc::GetText( LineEnd eEnd ) const
rtl_uString* newStr = comphelper::string::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 rtl::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 59e7ea11229d..dc12a6e192c3 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 rtl::OUString GetSepStr( LineEnd eEnd );
};
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 6a42c910ee67..7da4dc15472e 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, aBigRec, 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 )
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() );
}
-XubString EditEngine::CalcFieldValue( const SvxFieldItem&, sal_uInt16, sal_uInt16, Color*&, Color*& )
+XubString EditEngine::CalcFieldValue( const SvxFieldItem&, sal_Int32, sal_uInt16, Color*&, Color*& )
{
DBG_CHKTHIS( EditEngine, 0 );
return rtl::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 669f003fa607..20561cd7303d 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -194,30 +194,30 @@ EditTextObject::~EditTextObject()
DBG_DTOR( EE_EditTextObject, 0 );
}
-size_t EditTextObject::GetParagraphCount() const
+sal_Int32 EditTextObject::GetParagraphCount() const
{
OSL_FAIL( "Virtual method direct from EditTextObject!" );
return 0;
}
-String EditTextObject::GetText(size_t /* nParagraph */) const
+String EditTextObject::GetText(sal_Int32 /* nParagraph */) const
{
OSL_FAIL( "Virtual method direct from EditTextObject!" );
return String();
}
-void EditTextObject::Insert(const EditTextObject& /* rObj */, size_t /* nPara */)
+void EditTextObject::Insert(const EditTextObject& /* rObj */, sal_Int32 /* nPara */)
{
OSL_FAIL( "Virtual method direct from EditTextObject!" );
}
-EditTextObject* EditTextObject::CreateTextObject(size_t /*nPara*/, size_t /*nParas*/) const
+EditTextObject* EditTextObject::CreateTextObject(sal_Int32 /*nPara*/, sal_Int32 /*nParas*/) const
{
OSL_FAIL( "Virtual method direct from EditTextObject!" );
return 0;
}
-void EditTextObject::RemoveParagraph(size_t /*nPara*/)
+void EditTextObject::RemoveParagraph(sal_Int32 /*nPara*/)
{
OSL_FAIL( "Virtual method direct from EditTextObject!" );
}
@@ -245,7 +245,7 @@ sal_Bool EditTextObject::HasCharAttribs( sal_uInt16 ) const
return false;
}
-void EditTextObject::GetCharAttribs( sal_uInt16 /*nPara*/, std::vector<EECharAttrib>& /*rLst*/ ) const
+void EditTextObject::GetCharAttribs( sal_Int32 /*nPara*/, std::vector<EECharAttrib>& /*rLst*/ ) const
{
OSL_FAIL( "Virtual method direct from EditTextObject!" );
}
@@ -273,13 +273,13 @@ sal_Bool EditTextObject::HasField( TypeId /*aType*/ ) const
return false;
}
-SfxItemSet EditTextObject::GetParaAttribs(size_t /*nPara*/) const
+SfxItemSet EditTextObject::GetParaAttribs(sal_Int32 /*nPara*/) const
{
OSL_FAIL( "Virtual method direct from EditTextObject!" );
return SfxItemSet( *(SfxItemPool*)NULL );
}
-void EditTextObject::SetParaAttribs(size_t /*nPara*/, const SfxItemSet& /*rAttribs*/)
+void EditTextObject::SetParaAttribs(sal_Int32 /*nPara*/, const SfxItemSet& /*rAttribs*/)
{
OSL_FAIL( "Virtual method direct from EditTextObject!" );
}
@@ -302,12 +302,12 @@ sal_Bool EditTextObject::HasStyleSheet( const XubString& /*rName*/, SfxStyleFami
return false;
}
-void EditTextObject::GetStyleSheet(size_t /*nPara*/, String& /*rName*/, SfxStyleFamily& /*eFamily*/) const
+void EditTextObject::GetStyleSheet(sal_Int32 /*nPara*/, String& /*rName*/, SfxStyleFamily& /*eFamily*/) const
{
OSL_FAIL( "Virtual method direct from EditTextObject!" );
}
-void EditTextObject::SetStyleSheet(size_t /*nPara*/, const String& /*rName*/, const SfxStyleFamily& /*eFamily*/)
+void EditTextObject::SetStyleSheet(sal_Int32 /*nPara*/, const String& /*rName*/, const SfxStyleFamily& /*eFamily*/)
{
OSL_FAIL( "Virtual method direct from EditTextObject!" );
}
@@ -676,27 +676,33 @@ ContentInfo* BinTextObject::CreateAndInsertContent()
return &aContents.back();
}
-size_t BinTextObject::GetParagraphCount() const
+sal_Int32 BinTextObject::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 BinTextObject::GetText(size_t nPara) const
+String BinTextObject::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();
}
-void BinTextObject::Insert(const EditTextObject& rObj, size_t nDestPara)
+void BinTextObject::Insert(const EditTextObject& rObj, sal_Int32 nDestPara)
{
DBG_ASSERT( rObj.Which() == EE_FORMAT_BIN, "UTO: unknown Textobjekt" );
const BinTextObject& rBinObj = (const BinTextObject&)rObj;
- if (nDestPara > aContents.size())
- nDestPara = aContents.size();
+ if (static_cast<size_t>(nDestPara) > aContents.size())
+ nDestPara = static_cast<sal_Int32>(aContents.size());
const ContentInfosType& rCIs = rBinObj.aContents;
for (size_t i = 0, n = rCIs.size(); i < n; ++i)
@@ -710,9 +716,9 @@ void BinTextObject::Insert(const EditTextObject& rObj, size_t nDestPara)
ClearPortionInfo();
}
-EditTextObject* BinTextObject::CreateTextObject(size_t nPara, size_t nParas) const
+EditTextObject* BinTextObject::CreateTextObject(sal_Int32 nPara, sal_Int32 nParas) const
{
- if (nPara >= aContents.size() || !nParas)
+ if (nPara < 0 || static_cast<size_t>(nPara) >= aContents.size() || nParas <= 0)
return NULL;
// Only split the Pool, when a the Pool is set externally.
@@ -734,10 +740,10 @@ EditTextObject* BinTextObject::CreateTextObject(size_t nPara, size_t nParas) con
return pObj;
}
-void BinTextObject::RemoveParagraph(size_t nPara)
+void BinTextObject::RemoveParagraph(sal_Int32 nPara)
{
- DBG_ASSERT( nPara < aContents.size(), "BinTextObject::GetText: Paragraph does not exist!" );
- if (nPara >= aContents.size())
+ DBG_ASSERT( nPara >= 0 && static_cast<size_t>(nPara) < aContents.size(), "BinTextObject::GetText: Paragraph does not exist!" );
+ if (nPara < 0 || static_cast<size_t>(nPara) >= aContents.size())
return;
ContentInfosType::iterator it = aContents.begin();
@@ -791,8 +797,11 @@ sal_Bool BinTextObject::HasCharAttribs( sal_uInt16 _nWhich ) const
return false;
}
-void BinTextObject::GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const
+void BinTextObject::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)
@@ -878,14 +887,17 @@ sal_Bool BinTextObject::HasField( TypeId aType ) const
return false;
}
-SfxItemSet BinTextObject::GetParaAttribs(size_t nPara) const
+SfxItemSet BinTextObject::GetParaAttribs(sal_Int32 nPara) const
{
const ContentInfo& rC = aContents[nPara];
return rC.GetParaAttribs();
}
-void BinTextObject::SetParaAttribs(size_t nPara, const SfxItemSet& rAttribs)
+void BinTextObject::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();
@@ -895,7 +907,7 @@ sal_Bool BinTextObject::RemoveCharAttribs( sal_uInt16 _nWhich )
{
sal_Bool bChanged = false;
- for ( sal_uInt16 nPara = aContents.size(); nPara; )
+ for ( size_t nPara = aContents.size(); nPara; )
{
ContentInfo& rC = aContents[--nPara];
@@ -959,9 +971,9 @@ sal_Bool BinTextObject::HasStyleSheet( const XubString& rName, SfxStyleFamily eF
return false;
}
-void BinTextObject::GetStyleSheet(size_t nPara, String& rName, SfxStyleFamily& rFamily) const
+void BinTextObject::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];
@@ -969,9 +981,9 @@ void BinTextObject::GetStyleSheet(size_t nPara, String& rName, SfxStyleFamily& r
rFamily = rC.GetFamily();
}
-void BinTextObject::SetStyleSheet(size_t nPara, const String& rName, const SfxStyleFamily& rFamily)
+void BinTextObject::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];
@@ -1060,13 +1072,16 @@ void BinTextObject::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 = rtl::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];
@@ -1191,7 +1206,7 @@ void BinTextObject::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 4b89ade1a510..fb58f107272f 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -211,11 +211,11 @@ public:
void SetPortionInfo( XParaPortionList* pP )
{ pPortionInfo = pP; }
- virtual size_t GetParagraphCount() const;
- virtual String GetText(size_t nParagraph) const;
- virtual void Insert(const EditTextObject& rObj, size_t nPara);
- virtual EditTextObject* CreateTextObject(size_t nPara, size_t nParas = 1) const;
- virtual void RemoveParagraph(size_t nPara);
+ virtual sal_Int32 GetParagraphCount() const;
+ virtual String GetText(sal_Int32 nParagraph) const;
+ virtual void Insert(const EditTextObject& rObj, sal_Int32 nPara);
+ virtual EditTextObject* CreateTextObject(sal_Int32 nPara, sal_Int32 nParas = 1) const;
+ virtual void RemoveParagraph(sal_Int32 nPara);
virtual sal_Bool HasPortionInfo() const;
virtual void ClearPortionInfo();
@@ -223,7 +223,7 @@ public:
virtual sal_Bool HasOnlineSpellErrors() const;
virtual sal_Bool HasCharAttribs( sal_uInt16 nWhich = 0 ) const;
- virtual void GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const;
+ virtual void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const;
virtual sal_Bool RemoveCharAttribs( sal_uInt16 nWhich = 0 );
virtual sal_Bool RemoveParaAttribs( sal_uInt16 nWhich = 0 );
@@ -234,12 +234,12 @@ public:
virtual const SvxFieldItem* GetField() const;
virtual sal_Bool HasField( TypeId Type = NULL ) const;
- virtual SfxItemSet GetParaAttribs(size_t nPara) const;
- virtual void SetParaAttribs(size_t nPara, const SfxItemSet& rAttribs);
+ virtual SfxItemSet GetParaAttribs(sal_Int32 nPara) const;
+ virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet& rAttribs);
virtual sal_Bool HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const;
- virtual void GetStyleSheet(size_t nPara, String& rName, SfxStyleFamily& eFamily) const;
- virtual void SetStyleSheet(size_t nPara, const String& rName, const SfxStyleFamily& eFamily);
+ virtual void GetStyleSheet(sal_Int32 nPara, String& rName, SfxStyleFamily& eFamily) const;
+ virtual void SetStyleSheet(sal_Int32 nPara, const String& rName, const SfxStyleFamily& eFamily);
virtual sal_Bool ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily,
const String& rNewName, SfxStyleFamily eNewFamily );
virtual 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 22e00661d625..688b316ff074 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -148,7 +148,7 @@ rtl::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),
@@ -203,7 +203,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),
@@ -251,7 +251,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 ) );
}
@@ -268,7 +268,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) {}
@@ -394,7 +394,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() {}
@@ -418,7 +418,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 );
}
@@ -430,7 +430,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),
@@ -462,7 +462,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),
@@ -524,7 +524,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 dbd0e4e3e671..b5d3658bbe5e 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 980a6a0e8d0a..e0a338c28eeb 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -510,7 +510,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 );
@@ -600,7 +600,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 );
@@ -621,7 +621,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 );
@@ -641,8 +641,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 )
@@ -731,11 +730,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 ) )
@@ -1084,7 +1083,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 );
@@ -1198,18 +1197,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 );
@@ -1290,7 +1290,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 );
@@ -1299,7 +1299,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 4e44fe7772eb..8e8e977d2e22 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -712,7 +712,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&)
@@ -729,7 +729,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];
@@ -782,7 +782,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 cae0a756d057..62447dc157ea 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -223,7 +223,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 )
@@ -549,7 +549,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!
@@ -560,7 +560,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
@@ -586,7 +586,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 479b2f638fba..fc629d11cfd6 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -126,7 +126,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;
@@ -169,9 +169,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?!" );
@@ -289,7 +289,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--;
@@ -362,8 +362,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())
@@ -385,7 +385,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());
@@ -426,7 +426,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 ) );
@@ -607,7 +607,7 @@ void EditRTFParser::SkipGroup()
EditNodeIdx::EditNodeIdx(EditEngine* pEE, ContentNode* pNd) :
mpEditEngine(pEE), mpNode(pNd) {}
-sal_uLong EditNodeIdx::GetIdx() const
+sal_Int32 EditNodeIdx::GetIdx() const
{
return mpEditEngine->GetEditDoc().GetPos(mpNode);
}
@@ -630,7 +630,7 @@ SvxNodeIdx* EditPosition::MakeNodeIdx() const
return new EditNodeIdx(mpEditEngine, mpCurSel->Max().GetNode());
}
-sal_uLong EditPosition::GetNodeIdx() const
+sal_Int32 EditPosition::GetNodeIdx() const
{
ContentNode* pN = mpCurSel->Max().GetNode();
return mpEditEngine->GetEditDoc().GetPos(pN);
diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx
index d868b25514bb..32d97c0b2458 100644
--- a/editeng/source/editeng/eertfpar.hxx
+++ b/editeng/source/editeng/eertfpar.hxx
@@ -35,7 +35,7 @@ private:
public:
EditNodeIdx(EditEngine* pEE, ContentNode* pNd = NULL);
- virtual sal_uLong GetIdx() const;
+ virtual sal_Int32 GetIdx() const;
virtual SvxNodeIdx* Clone() const;
ContentNode* GetNode() { return mpNode; }
};
@@ -49,7 +49,7 @@ private:
public:
EditPosition(EditEngine* pIEE, EditSelection* pSel);
- virtual sal_uLong GetNodeIdx() const;
+ virtual sal_Int32 GetNodeIdx() const;
virtual sal_uInt16 GetCntIdx() const;
// clone
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 4caa60222e06..ceced7baccba 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -171,9 +171,9 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion )
ContentNode* pStartNode = aTmpSel.Min().GetNode();
ContentNode* pEndNode = aTmpSel.Max().GetNode();
- sal_uInt16 nStartPara = pEditEngine->GetEditDoc().GetPos( pStartNode );
- sal_uInt16 nEndPara = pEditEngine->GetEditDoc().GetPos( pEndNode );
- for ( sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ sal_Int32 nStartPara = pEditEngine->GetEditDoc().GetPos( pStartNode );
+ sal_Int32 nEndPara = pEditEngine->GetEditDoc().GetPos( pEndNode );
+ for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
ParaPortion* pTmpPortion = pEditEngine->GetParaPortions().SafeGetObject( nPara );
DBG_ASSERT( pTmpPortion, "Portion in Selection not found!" );
@@ -638,8 +638,8 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sa
EditPaM aPaM( aEditSelection.Max() );
sal_uInt16 nTextPortionStart = 0;
- sal_uInt16 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
- if (nPara == USHRT_MAX) // #i94322
+ sal_Int32 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
+ if (nPara == EE_PARA_NOT_FOUND) // #i94322
return;
const ParaPortion* pParaPortion = pEditEngine->GetParaPortions()[nPara];
@@ -1130,8 +1130,8 @@ String ImpEditView::SpellIgnoreOrAddWord( sal_Bool bAdd )
xDic->add( aWord, sal_False, String() );
}
EditDoc& rDoc = pEditEngine->GetEditDoc();
- sal_uInt16 nNodes = rDoc.Count();
- for ( sal_uInt16 n = 0; n < nNodes; n++ )
+ sal_Int32 nNodes = rDoc.Count();
+ for ( sal_Int32 n = 0; n < nNodes; n++ )
{
ContentNode* pNode = rDoc.GetObject( n );
pNode->GetWrongList()->MarkWrongsInvalid();
@@ -1158,7 +1158,7 @@ void ImpEditView::DeleteSelected()
ShowCursor( DoAutoScroll(), sal_True );
}
-const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_uInt16* pPara, sal_uInt16* pPos ) const
+const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_Int32* pPara, sal_uInt16* pPos ) const
{
if( !GetOutputArea().IsInside( rPos ) )
return 0;
@@ -1193,10 +1193,10 @@ const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_uInt16* pPara,
return NULL;
}
-sal_Bool ImpEditView::IsBulletArea( const Point& rPos, sal_uInt16* pPara )
+sal_Bool ImpEditView::IsBulletArea( const Point& rPos, sal_Int32* pPara )
{
if ( pPara )
- *pPara = 0xFFFF;
+ *pPara = EE_PARA_NOT_FOUND;
if( !GetOutputArea().IsInside( rPos ) )
return sal_False;
@@ -1206,7 +1206,7 @@ sal_Bool ImpEditView::IsBulletArea( const Point& rPos, sal_uInt16* pPara )
if ( aPaM.GetIndex() == 0 )
{
- sal_uInt16 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
+ sal_Int32 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
Rectangle aBulletArea = pEditEngine->GetBulletArea( nPara );
long nY = pEditEngine->GetDocPosTopLeft( nPara ).Y();
const ParaPortion* pParaPortion = pEditEngine->GetParaPortions()[nPara];
@@ -1341,9 +1341,9 @@ sal_Bool ImpEditView::IsInSelection( const EditPaM& rPaM )
aSel.Adjust( pEditEngine->GetEditDoc() );
- sal_uInt16 nStartNode = pEditEngine->GetEditDoc().GetPos( aSel.Min().GetNode() );
- sal_uInt16 nEndNode = pEditEngine->GetEditDoc().GetPos( aSel.Max().GetNode() );
- sal_uInt16 nCurNode = pEditEngine->GetEditDoc().GetPos( rPaM.GetNode() );
+ sal_Int32 nStartNode = pEditEngine->GetEditDoc().GetPos( aSel.Min().GetNode() );
+ sal_Int32 nEndNode = pEditEngine->GetEditDoc().GetPos( aSel.Max().GetNode() );
+ sal_Int32 nCurNode = pEditEngine->GetEditDoc().GetPos( rPaM.GetNode() );
if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) )
return sal_True;
@@ -1531,7 +1531,8 @@ void ImpEditView::dragGestureRecognized( const ::com::sun::star::datatransfer::d
else
{
// Field?!
- sal_uInt16 nPara, nPos;
+ sal_Int32 nPara;
+ sal_uInt16 nPos;
Point aMousePos = GetWindow()->PixelToLogic( aMousePosPixel );
const SvxFieldItem* pField = GetField( aMousePos, &nPara, &nPos );
if ( pField )
@@ -1553,7 +1554,7 @@ void ImpEditView::dragGestureRecognized( const ::com::sun::star::datatransfer::d
EditPaM aStartPaM( pEditEngine->GetEditDoc().GetObject( nPara ), 0 );
EditPaM aEndPaM( aStartPaM );
const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL );
- for ( sal_uInt16 n = nPara +1; n < pEditEngine->GetEditDoc().Count(); n++ )
+ for ( sal_Int32 n = nPara +1; n < pEditEngine->GetEditDoc().Count(); n++ )
{
const SfxInt16Item& rL = (const SfxInt16Item&) pEditEngine->GetParaAttrib( n, EE_PARA_OUTLLEVEL );
if ( rL.GetValue() > rLevel.GetValue() )
@@ -1612,7 +1613,7 @@ void ImpEditView::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSo
ESelection aNewSel( pDragAndDropInfo->aDropSel.nEndPara, pDragAndDropInfo->aDropSel.nEndPos,
pDragAndDropInfo->aDropSel.nEndPara, pDragAndDropInfo->aDropSel.nEndPos );
sal_Bool bBeforeSelection = aDropPos.IsLess( pDragAndDropInfo->aBeginDragSel );
- sal_uInt16 nParaDiff = pDragAndDropInfo->aBeginDragSel.nEndPara - pDragAndDropInfo->aBeginDragSel.nStartPara;
+ sal_Int32 nParaDiff = pDragAndDropInfo->aBeginDragSel.nEndPara - pDragAndDropInfo->aBeginDragSel.nStartPara;
if ( bBeforeSelection )
{
// Adjust aToBeDelSel.
@@ -1843,7 +1844,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge
pDragAndDropInfo->aDropDest = aPaM;
if ( pDragAndDropInfo->bOutlinerMode )
{
- sal_uInt16 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
+ sal_Int32 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
ParaPortion* pPPortion = pEditEngine->GetParaPortions().SafeGetObject( nPara );
long nDestParaStartY = pEditEngine->GetParaPortions().GetYOffset( pPPortion );
long nRel = aDocPos.Y() - nDestParaStartY;
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 0f1ee4359e73..1d3cbf9b3489 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -108,7 +108,7 @@ struct DragAndDropInfo
sal_uInt16 nCursorWidth;
ESelection aBeginDragSel;
EditPaM aDropDest;
- sal_uInt16 nOutlinerDropDest;
+ sal_Int32 nOutlinerDropDest;
ESelection aDropSel;
VirtualDevice* pBackground;
const SvxFieldItem* pField;
@@ -317,7 +317,7 @@ public:
void AddDragAndDropListeners();
void RemoveDragAndDropListeners();
- sal_Bool IsBulletArea( const Point& rPos, sal_uInt16* pPara );
+ sal_Bool IsBulletArea( const Point& rPos, sal_Int32* pPara );
// For the Selection Engine...
void CreateAnchor();
@@ -357,7 +357,7 @@ public:
sal_Bool IsWrongSpelledWord( const EditPaM& rPaM, sal_Bool bMarkIfWrong );
String SpellIgnoreOrAddWord( sal_Bool bAdd );
- const SvxFieldItem* GetField( const Point& rPos, sal_uInt16* pPara, sal_uInt16* pPos ) const;
+ const SvxFieldItem* GetField( const Point& rPos, sal_Int32* pPara, sal_uInt16* pPos ) const;
void DeleteSelected();
// If possible invalidate more than OutputArea, for the DrawingEngine text frame
@@ -519,7 +519,7 @@ private:
sal_uInt16 GetParaAttrib( sal_uInt8 nFunc, EditSelection aSel );
void SetCharAttrib( EditSelection aSel, const SfxPoolItem& rItem );
void ParaAttribsToCharAttribs( ContentNode* pNode );
- void GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const;
+ void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const;
EditTextObject* CreateBinTextObject( EditSelection aSelection, SfxItemPool*, sal_Bool bAllowBigObjects = sal_False, sal_uInt16 nBigObjStart = 0 );
EditSelection InsertBinTextObject( BinTextObject&, EditPaM aPaM );
@@ -528,7 +528,7 @@ private:
EditPaM Clear();
EditPaM RemoveText();
EditPaM RemoveText( EditSelection aEditSelection );
- sal_Bool CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY );
+ sal_Bool CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY );
void CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uInt32 nStartPosY );
sal_Bool FinishCreateLines( ParaPortion* pParaPortion );
void CalcCharPositions( ParaPortion* pParaPortion );
@@ -548,11 +548,11 @@ private:
EditPaM ImpInsertText(const EditSelection& aCurEditSelection, const String& rStr);
EditPaM ImpInsertFeature(const EditSelection& rCurSel, const SfxPoolItem& rItem);
void ImpRemoveChars( const EditPaM& rPaM, sal_uInt16 nChars, EditUndoRemoveChars* pCurUndo = 0 );
- void ImpRemoveParagraph( sal_uInt16 nPara );
- EditSelection ImpMoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos );
+ void ImpRemoveParagraph( sal_Int32 nPara );
+ EditSelection ImpMoveParagraphs( Range aParagraphs, sal_Int32 nNewPos );
EditPaM ImpFastInsertText( EditPaM aPaM, const String& rStr );
- EditPaM ImpFastInsertParagraph( sal_uInt16 nPara );
+ EditPaM ImpFastInsertParagraph( sal_Int32 nPara );
sal_Bool ImpCheckRefMapMode();
@@ -560,11 +560,11 @@ private:
void ImpFindKashidas( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, std::vector<sal_uInt16>& rArray );
- void InsertContent( ContentNode* pNode, sal_uInt16 nPos );
- EditPaM SplitContent( sal_uInt16 nNode, sal_uInt16 nSepPos );
- EditPaM ConnectContents( sal_uInt16 nLeftNode, sal_Bool bBackward );
+ void InsertContent( ContentNode* pNode, sal_Int32 nPos );
+ EditPaM SplitContent( sal_Int32 nNode, sal_uInt16 nSepPos );
+ EditPaM ConnectContents( sal_Int32 nLeftNode, sal_Bool bBackward );
- void ShowParagraph( sal_uInt16 nParagraph, bool bShow );
+ void ShowParagraph( sal_Int32 nParagraph, bool bShow );
EditPaM PageUp( const EditPaM& rPaM, EditView* pView);
EditPaM PageDown( const EditPaM& rPaM, EditView* pView);
@@ -588,16 +588,16 @@ private:
EditPaM CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, sal_Bool bStart );
- void InitScriptTypes( sal_uInt16 nPara );
+ void InitScriptTypes( sal_Int32 nPara );
sal_uInt16 GetScriptType( const EditPaM& rPaM, sal_uInt16* pEndPos = NULL ) const;
sal_uInt16 GetScriptType( const EditSelection& rSel ) const;
sal_Bool IsScriptChange( const EditPaM& rPaM ) const;
- sal_Bool HasScriptType( sal_uInt16 nPara, sal_uInt16 nType ) const;
+ sal_Bool HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const;
sal_Bool ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_uInt16 nStartPos, sal_Int32* pDXArray, sal_uInt16 n100thPercentFromMax, sal_Bool bManipulateDXArray );
void ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, long nRemainingWidth );
- void ImplInitLayoutMode( OutputDevice* pOutDev, sal_uInt16 nPara, sal_uInt16 nIndex );
+ void ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, sal_uInt16 nIndex );
void ImplInitDigitMode( OutputDevice* pOutDev, String* pString, xub_StrLen nStt, xub_StrLen nLen, LanguageType eLang );
EditPaM ReadText( SvStream& rInput, EditSelection aSel );
@@ -611,9 +611,9 @@ private:
sal_uInt32 WriteHTML( SvStream& rOutput, EditSelection aSel );
sal_uInt32 WriteBin( SvStream& rOutput, EditSelection aSel, sal_Bool bStoreUnicode = sal_False );
- void WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos,
+ void WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, sal_Int32 nPara, sal_uInt16 nPos,
std::vector<SvxFontItem*>& rFontTable, SvxColorList& rColorList );
- sal_Bool WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos,
+ sal_Bool WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_Int32 nPara, sal_uInt16 nPos,
std::vector<SvxFontItem*>& rFontTable, SvxColorList& rColorList );
sal_Int32 LogicToTwips( sal_Int32 n );
@@ -699,9 +699,9 @@ public:
EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const { return eDefaultHorizontalTextDirection; }
- void InitWritingDirections( sal_uInt16 nPara );
- sal_Bool IsRightToLeft( sal_uInt16 nPara ) const;
- sal_uInt8 GetRightToLeft( sal_uInt16 nPara, sal_uInt16 nChar, sal_uInt16* pStart = NULL, sal_uInt16* pEnd = NULL );
+ void InitWritingDirections( sal_Int32 nPara );
+ sal_Bool IsRightToLeft( sal_Int32 nPara ) const;
+ sal_uInt8 GetRightToLeft( sal_Int32 nPara, sal_uInt16 nChar, sal_uInt16* pStart = NULL, sal_uInt16* pEnd = NULL );
sal_Bool HasDifferentRTLLevels( const ContentNode* pNode );
void SetTextRanger( TextRanger* pRanger );
@@ -764,32 +764,32 @@ public:
EditSelection MoveCursor( const KeyEvent& rKeyEvent, EditView* pEditView );
- EditSelection MoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos, EditView* pCurView );
+ EditSelection MoveParagraphs( Range aParagraphs, sal_Int32 nNewPos, EditView* pCurView );
sal_uInt32 CalcTextHeight( sal_uInt32* pHeightNTP );
sal_uInt32 GetTextHeight() const;
sal_uInt32 GetTextHeightNTP() const;
sal_uInt32 CalcTextWidth( sal_Bool bIgnoreExtraSpace );
sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, sal_Bool bIgnoreExtraSpace );
- sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const;
- sal_uInt16 GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- sal_uInt16 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine );
- sal_uInt32 GetParaHeight( sal_uInt16 nParagraph );
-
- SfxItemSet GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags = 0xFF ) const;
+ sal_uInt16 GetLineCount( sal_Int32 nParagraph ) const;
+ sal_uInt16 GetLineLen( sal_Int32 nParagraph, sal_uInt16 nLine ) const;
+ void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const;
+ sal_uInt16 GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ sal_uInt16 GetLineHeight( sal_Int32 nParagraph, sal_uInt16 nLine );
+ sal_uInt32 GetParaHeight( sal_Int32 nParagraph );
+
+ SfxItemSet GetAttribs( sal_Int32 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags = 0xFF ) const;
SfxItemSet GetAttribs( EditSelection aSel, sal_Bool bOnlyHardAttrib = sal_False );
void SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_uInt8 nSpecial = 0 );
void RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich = 0 );
- void RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich = 0, sal_Bool bRemoveFeatures = sal_False );
+ void RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0, sal_Bool bRemoveFeatures = sal_False );
void SetFlatMode( sal_Bool bFlat );
- void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
- const SfxItemSet& GetParaAttribs( sal_uInt16 nPara ) const;
+ void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
+ const SfxItemSet& GetParaAttribs( sal_Int32 nPara ) const;
- bool HasParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
- const SfxPoolItem& GetParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+ bool HasParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const;
+ const SfxPoolItem& GetParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const;
Rectangle PaMtoEditCursor( EditPaM aPaM, sal_uInt16 nFlags = 0 );
Rectangle GetEditCursor( ParaPortion* pPortion, sal_uInt16 nIndex, sal_uInt16 nFlags = 0 );
@@ -809,9 +809,9 @@ public:
sal_Bool Redo( EditView* pView );
// OV-Special
- void InvalidateFromParagraph( sal_uInt16 nFirstInvPara );
- EditPaM InsertParagraph( sal_uInt16 nPara );
- EditSelection* SelectParagraph( sal_uInt16 nPara );
+ void InvalidateFromParagraph( sal_Int32 nFirstInvPara );
+ EditPaM InsertParagraph( sal_Int32 nPara );
+ EditSelection* SelectParagraph( sal_Int32 nPara );
void SetStatusEventHdl( const Link& rLink ) { aStatusHdlLink = rLink; }
Link GetStatusEventHdl() const { return aStatusHdlLink; }
@@ -826,7 +826,7 @@ public:
sal_Bool IsVisualCursorTravelingEnabled();
sal_Bool DoVisualCursorTraveling( const ContentNode* pNode );
- EditSelection ConvertSelection( sal_uInt16 nStartPara, sal_uInt16 nStartPos, sal_uInt16 nEndPara, sal_uInt16 nEndPos );
+ EditSelection ConvertSelection( sal_Int32 nStartPara, sal_uInt16 nStartPos, sal_Int32 nEndPara, sal_uInt16 nEndPos );
inline EPaM CreateEPaM( const EditPaM& rPaM );
inline EditPaM CreateEditPaM( const EPaM& rEPaM );
inline ESelection CreateESel( const EditSelection& rSel );
@@ -837,9 +837,9 @@ public:
SfxStyleSheetPool* GetStyleSheetPool() const { return pStylePool; }
void SetStyleSheet( EditSelection aSel, SfxStyleSheet* pStyle );
- void SetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle );
- const SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const;
- SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara );
+ void SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle );
+ const SfxStyleSheet* GetStyleSheet( sal_Int32 nPara ) const;
+ SfxStyleSheet* GetStyleSheet( sal_Int32 nPara );
void UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle );
void RemoveStyleFromParagraphs( SfxStyleSheet* pStyle );
@@ -945,9 +945,9 @@ public:
sal_Int32 GetSpaceBeforeAndMinLabelWidth( const ContentNode *pNode, sal_Int32 *pnSpaceBefore = 0, sal_Int32 *pnMinLabelWidth = 0 ) const;
const SvxLRSpaceItem& GetLRSpaceItem( ContentNode* pNode );
- SvxAdjust GetJustification( sal_uInt16 nPara ) const;
- SvxCellJustifyMethod GetJustifyMethod( sal_uInt16 nPara ) const;
- SvxCellVerJustify GetVerJustification( sal_uInt16 nPara ) const;
+ SvxAdjust GetJustification( sal_Int32 nPara ) const;
+ SvxCellJustifyMethod GetJustifyMethod( sal_Int32 nPara ) const;
+ SvxCellVerJustify GetVerJustification( sal_Int32 nPara ) const;
void SetCharStretching( sal_uInt16 nX, sal_uInt16 nY );
inline void GetCharStretching( sal_uInt16& rX, sal_uInt16& rY );
@@ -1069,14 +1069,14 @@ inline EditUndoManager& ImpEditEngine::GetUndoManager()
inline const ParaPortion* ImpEditEngine::FindParaPortion( const ContentNode* pNode ) const
{
- sal_uInt16 nPos = aEditDoc.GetPos( pNode );
+ sal_Int32 nPos = aEditDoc.GetPos( pNode );
DBG_ASSERT( nPos < GetParaPortions().Count(), "Portionloser Node?" );
return GetParaPortions()[ nPos ];
}
inline ParaPortion* ImpEditEngine::FindParaPortion( ContentNode* pNode )
{
- sal_uInt16 nPos = aEditDoc.GetPos( pNode );
+ sal_Int32 nPos = aEditDoc.GetPos( pNode );
DBG_ASSERT( nPos < GetParaPortions().Count(), "Portionloser Node?" );
return GetParaPortions()[ nPos ];
}
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 1c3e6584266f..86cf9335878d 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -230,8 +230,8 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode )
void ImpEditEngine::InitDoc(bool bKeepParaAttribs)
{
- sal_uInt16 nParas = aEditDoc.Count();
- for ( sal_uInt16 n = bKeepParaAttribs ? 1 : 0; n < nParas; n++ )
+ sal_Int32 nParas = aEditDoc.Count();
+ for ( sal_Int32 n = bKeepParaAttribs ? 1 : 0; n < nParas; n++ )
{
if ( aEditDoc[n]->GetStyleSheet() )
EndListening( *aEditDoc[n]->GetStyleSheet(), sal_False );
@@ -278,13 +278,13 @@ XubString ImpEditEngine::GetSelected( const EditSelection& rSel, const LineEnd e
ContentNode* pStartNode = aSel.Min().GetNode();
ContentNode* pEndNode = aSel.Max().GetNode();
- sal_uInt16 nStartNode = aEditDoc.GetPos( pStartNode );
- sal_uInt16 nEndNode = aEditDoc.GetPos( pEndNode );
+ sal_Int32 nStartNode = aEditDoc.GetPos( pStartNode );
+ sal_Int32 nEndNode = aEditDoc.GetPos( pEndNode );
OSL_ENSURE( nStartNode <= nEndNode, "Selection not sorted ?" );
// iterate over the paragraphs ...
- for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
OSL_ENSURE( aEditDoc.GetObject( nNode ), "Node not found: GetSelected" );
const ContentNode* pNode = aEditDoc.GetObject( nNode );
@@ -660,7 +660,7 @@ sal_Bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView
if ( pFld )
{
EditPaM aPaM( aCurSel.Max() );
- sal_uInt16 nPara = GetEditDoc().GetPos( aPaM.GetNode() );
+ sal_Int32 nPara = GetEditDoc().GetPos( aPaM.GetNode() );
GetEditEnginePtr()->FieldClicked( *pFld, nPara, aPaM.GetIndex() );
}
}
@@ -805,7 +805,7 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode* pNode )
OSL_ENSURE( pPortion, "ParaAttribsChanged: Portion?" );
pPortion->MarkSelectionInvalid( 0, pNode->Len() );
- sal_uInt16 nPara = aEditDoc.GetPos( pNode );
+ sal_Int32 nPara = aEditDoc.GetPos( pNode );
pEditEngine->ParaAttribsChanged( nPara );
ParaPortion* pNextPortion = GetParaPortions().SafeGetObject( nPara+1 );
@@ -994,7 +994,7 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM&
{
EditPaM aPaM( rPaM );
- sal_uInt16 nPara = GetEditDoc().GetPos( aPaM.GetNode() );
+ sal_Int32 nPara = GetEditDoc().GetPos( aPaM.GetNode() );
ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara );
sal_uInt16 nLine = pParaPortion->GetLines().FindLine( aPaM.GetIndex(), sal_False );
@@ -1050,7 +1050,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM
{
EditPaM aPaM( rPaM );
- sal_uInt16 nPara = GetEditDoc().GetPos( aPaM.GetNode() );
+ sal_Int32 nPara = GetEditDoc().GetPos( aPaM.GetNode() );
ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara );
sal_uInt16 nLine = pParaPortion->GetLines().FindLine( aPaM.GetIndex(), sal_False );
@@ -1486,7 +1486,7 @@ EditPaM ImpEditEngine::WordLeft( const EditPaM& rPaM, sal_Int16 nWordType )
if ( nCurrentPos == 0 )
{
// Previous paragraph...
- sal_uInt16 nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() );
+ sal_Int32 nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() );
ContentNode* pPrevNode = aEditDoc.GetObject( --nCurPara );
if ( pPrevNode )
{
@@ -1537,7 +1537,7 @@ EditPaM ImpEditEngine::WordRight( const EditPaM& rPaM, sal_Int16 nWordType )
if ( aNewPaM.GetIndex() >= nMax )
{
// Next paragraph ...
- sal_uInt16 nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() );
+ sal_Int32 nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() );
ContentNode* pNextNode = aEditDoc.GetObject( ++nCurPara );
if ( pNextNode )
{
@@ -1681,7 +1681,7 @@ static bool lcl_HasStrongLTR ( const String& rTxt, xub_StrLen nStart, xub_StrLe
-void ImpEditEngine::InitScriptTypes( sal_uInt16 nPara )
+void ImpEditEngine::InitScriptTypes( sal_Int32 nPara )
{
ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara );
ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos;
@@ -1824,7 +1824,7 @@ sal_uInt16 ImpEditEngine::GetScriptType( const EditPaM& rPaM, sal_uInt16* pEndPo
if ( rPaM.GetNode()->Len() )
{
- sal_uInt16 nPara = GetEditDoc().GetPos( rPaM.GetNode() );
+ sal_Int32 nPara = GetEditDoc().GetPos( rPaM.GetNode() );
const ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara );
if ( pParaPortion->aScriptInfos.empty() )
((ImpEditEngine*)this)->InitScriptTypes( nPara );
@@ -1852,10 +1852,10 @@ sal_uInt16 ImpEditEngine::GetScriptType( const EditSelection& rSel ) const
short nScriptType = 0;
- sal_uInt16 nStartPara = GetEditDoc().GetPos( aSel.Min().GetNode() );
- sal_uInt16 nEndPara = GetEditDoc().GetPos( aSel.Max().GetNode() );
+ sal_Int32 nStartPara = GetEditDoc().GetPos( aSel.Min().GetNode() );
+ sal_Int32 nEndPara = GetEditDoc().GetPos( aSel.Max().GetNode() );
- for ( sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
const ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara );
if ( pParaPortion->aScriptInfos.empty() )
@@ -1897,7 +1897,7 @@ sal_Bool ImpEditEngine::IsScriptChange( const EditPaM& rPaM ) const
if ( rPaM.GetNode()->Len() )
{
- sal_uInt16 nPara = GetEditDoc().GetPos( rPaM.GetNode() );
+ sal_Int32 nPara = GetEditDoc().GetPos( rPaM.GetNode() );
const ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara );
if ( pParaPortion->aScriptInfos.empty() )
((ImpEditEngine*)this)->InitScriptTypes( nPara );
@@ -1916,7 +1916,7 @@ sal_Bool ImpEditEngine::IsScriptChange( const EditPaM& rPaM ) const
return bScriptChange;
}
-sal_Bool ImpEditEngine::HasScriptType( sal_uInt16 nPara, sal_uInt16 nType ) const
+sal_Bool ImpEditEngine::HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const
{
bool bTypeFound = false;
@@ -1933,7 +1933,7 @@ sal_Bool ImpEditEngine::HasScriptType( sal_uInt16 nPara, sal_uInt16 nType ) cons
return bTypeFound;
}
-void ImpEditEngine::InitWritingDirections( sal_uInt16 nPara )
+void ImpEditEngine::InitWritingDirections( sal_Int32 nPara )
{
ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara );
WritingDirectionInfos& rInfos = pParaPortion->aWritingDirectionInfos;
@@ -1988,7 +1988,7 @@ void ImpEditEngine::InitWritingDirections( sal_uInt16 nPara )
}
-sal_Bool ImpEditEngine::IsRightToLeft( sal_uInt16 nPara ) const
+sal_Bool ImpEditEngine::IsRightToLeft( sal_Int32 nPara ) const
{
sal_Bool bR2L = sal_False;
const SvxFrameDirectionItem* pFrameDirItem = NULL;
@@ -2020,7 +2020,7 @@ sal_Bool ImpEditEngine::IsRightToLeft( sal_uInt16 nPara ) const
sal_Bool ImpEditEngine::HasDifferentRTLLevels( const ContentNode* pNode )
{
- sal_uInt16 nPara = GetEditDoc().GetPos( (ContentNode*)pNode );
+ sal_Int32 nPara = GetEditDoc().GetPos( (ContentNode*)pNode );
ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara );
sal_Bool bHasDifferentRTLLevels = sal_False;
@@ -2039,7 +2039,7 @@ sal_Bool ImpEditEngine::HasDifferentRTLLevels( const ContentNode* pNode )
}
-sal_uInt8 ImpEditEngine::GetRightToLeft( sal_uInt16 nPara, sal_uInt16 nPos, sal_uInt16* pStart, sal_uInt16* pEnd )
+sal_uInt8 ImpEditEngine::GetRightToLeft( sal_Int32 nPara, sal_uInt16 nPos, sal_uInt16* pStart, sal_uInt16* pEnd )
{
sal_uInt8 nRightToLeft = 0;
@@ -2067,7 +2067,7 @@ sal_uInt8 ImpEditEngine::GetRightToLeft( sal_uInt16 nPara, sal_uInt16 nPos, sal_
return nRightToLeft;
}
-SvxAdjust ImpEditEngine::GetJustification( sal_uInt16 nPara ) const
+SvxAdjust ImpEditEngine::GetJustification( sal_Int32 nPara ) const
{
SvxAdjust eJustification = SVX_ADJUST_LEFT;
@@ -2086,14 +2086,14 @@ SvxAdjust ImpEditEngine::GetJustification( sal_uInt16 nPara ) const
return eJustification;
}
-SvxCellJustifyMethod ImpEditEngine::GetJustifyMethod( sal_uInt16 nPara ) const
+SvxCellJustifyMethod ImpEditEngine::GetJustifyMethod( sal_Int32 nPara ) const
{
const SvxJustifyMethodItem& rItem = static_cast<const SvxJustifyMethodItem&>(
GetParaAttrib(nPara, EE_PARA_JUST_METHOD));
return static_cast<SvxCellJustifyMethod>(rItem.GetEnumValue());
}
-SvxCellVerJustify ImpEditEngine::GetVerJustification( sal_uInt16 nPara ) const
+SvxCellVerJustify ImpEditEngine::GetVerJustification( sal_Int32 nPara ) const
{
const SvxVerJustifyItem& rItem = static_cast<const SvxVerJustifyItem&>(
GetParaAttrib(nPara, EE_PARA_VER_JUST));
@@ -2136,7 +2136,7 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, sal_uInt16 nChars, Edit
TextModified();
}
-EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_uInt16 nNewPos )
+EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 nNewPos )
{
aOldPositions.Justify();
sal_Bool bValidAction = ( (long)nNewPos < aOldPositions.Min() ) || ( (long)nNewPos > aOldPositions.Max() );
@@ -2151,7 +2151,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_uInt16
return aSelection;
}
- size_t nParaCount = GetParaPortions().Count();
+ sal_Int32 nParaCount = GetParaPortions().Count();
if ( nNewPos >= nParaCount )
nNewPos = nParaCount;
@@ -2185,7 +2185,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_uInt16
pRecalc4 = GetParaPortions()[aOldPositions.Min()-1];
}
- MoveParagraphsInfo aMoveParagraphsInfo( sal::static_int_cast< sal_uInt16 >(aOldPositions.Min()), sal::static_int_cast< sal_uInt16 >(aOldPositions.Max()), nNewPos );
+ MoveParagraphsInfo aMoveParagraphsInfo( aOldPositions.Min(), aOldPositions.Max(), nNewPos );
aBeginMovingParagraphsHdl.Call( &aMoveParagraphsInfo );
if ( IsUndoEnabled() && !IsInUndo())
@@ -2195,18 +2195,18 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_uInt16
ParaPortion* pDestPortion = GetParaPortions().SafeGetObject( nNewPos );
ParaPortionList aTmpPortionList;
- for (sal_uInt16 i = (sal_uInt16)aOldPositions.Min(); i <= (sal_uInt16)aOldPositions.Max(); i++ )
+ for (sal_Int32 i = aOldPositions.Min(); i <= aOldPositions.Max(); i++ )
{
// always aOldPositions.Min(), since Remove().
ParaPortion* pTmpPortion = GetParaPortions().Release(aOldPositions.Min());
- aEditDoc.Release( (sal_uInt16)aOldPositions.Min() );
+ aEditDoc.Release( aOldPositions.Min() );
aTmpPortionList.Append(pTmpPortion);
}
- sal_uInt16 nRealNewPos = pDestPortion ? GetParaPortions().GetPos( pDestPortion ) : GetParaPortions().Count();
- OSL_ENSURE( nRealNewPos != USHRT_MAX, "ImpMoveParagraphs: Invalid Position!" );
+ sal_Int32 nRealNewPos = pDestPortion ? GetParaPortions().GetPos( pDestPortion ) : GetParaPortions().Count();
+ OSL_ENSURE( nRealNewPos != EE_PARA_NOT_FOUND, "ImpMoveParagraphs: Invalid Position!" );
- for (size_t i = 0; i < aTmpPortionList.Count(); ++i)
+ for (sal_Int32 i = 0; i < aTmpPortionList.Count(); ++i)
{
ParaPortion* pTmpPortion = aTmpPortionList[i];
if ( i == 0 )
@@ -2228,8 +2228,8 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_uInt16
EENotify aNotify( EE_NOTIFY_PARAGRAPHSMOVED );
aNotify.pEditEngine = GetEditEnginePtr();
aNotify.nParagraph = nNewPos;
- aNotify.nParam1 = sal::static_int_cast< sal_uInt16 >(aOldPositions.Min());
- aNotify.nParam2 = sal::static_int_cast< sal_uInt16 >(aOldPositions.Max());
+ aNotify.nParam1 = aOldPositions.Min();
+ aNotify.nParam2 = aOldPositions.Max();
CallNotify( aNotify );
}
@@ -2257,11 +2257,11 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_uInt16
EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, sal_Bool bBackward )
{
OSL_ENSURE( pLeft != pRight, "Join together the same paragraph ?" );
- OSL_ENSURE( aEditDoc.GetPos( pLeft ) != USHRT_MAX, "Inserted node not found (1)" );
- OSL_ENSURE( aEditDoc.GetPos( pRight ) != USHRT_MAX, "Inserted node not found (2)" );
+ OSL_ENSURE( aEditDoc.GetPos( pLeft ) != EE_PARA_NOT_FOUND, "Inserted node not found (1)" );
+ OSL_ENSURE( aEditDoc.GetPos( pRight ) != EE_PARA_NOT_FOUND, "Inserted node not found (2)" );
- sal_uInt16 nParagraphTobeDeleted = aEditDoc.GetPos( pRight );
- DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uLong)pRight, nParagraphTobeDeleted );
+ sal_Int32 nParagraphTobeDeleted = aEditDoc.GetPos( pRight );
+ DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uIntPtr)pRight, nParagraphTobeDeleted );
aDeletedNodes.push_back(pInf);
GetEditEnginePtr()->ParagraphConnected( aEditDoc.GetPos( pLeft ), aEditDoc.GetPos( pRight ) );
@@ -2320,7 +2320,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR
// By joining together the two, the left is although reformatted,
// however if its height does not change then the formatting receives
// the change of the total text hight too late...
- for ( sal_uInt16 n = nParagraphTobeDeleted; n < GetParaPortions().Count(); n++ )
+ for ( sal_Int32 n = nParagraphTobeDeleted; n < GetParaPortions().Count(); n++ )
{
ParaPortion* pPP = GetParaPortions()[n];
pPP->MarkSelectionInvalid( 0, pPP->GetNode()->Len() );
@@ -2434,14 +2434,14 @@ EditPaM ImpEditEngine::ImpDeleteSelection(const EditSelection& rCurSel)
OSL_ENSURE( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in ImpDeleteSelection" );
OSL_ENSURE( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index out of range in ImpDeleteSelection" );
- sal_uInt16 nStartNode = aEditDoc.GetPos( aStartPaM.GetNode() );
- sal_uInt16 nEndNode = aEditDoc.GetPos( aEndPaM.GetNode() );
+ sal_Int32 nStartNode = aEditDoc.GetPos( aStartPaM.GetNode() );
+ sal_Int32 nEndNode = aEditDoc.GetPos( aEndPaM.GetNode() );
- OSL_ENSURE( nEndNode != USHRT_MAX, "Start > End ?!" );
+ OSL_ENSURE( nEndNode != EE_PARA_NOT_FOUND, "Start > End ?!" );
OSL_ENSURE( nStartNode <= nEndNode, "Start > End ?!" );
// Remove all nodes in between ....
- for ( sal_uLong z = nStartNode+1; z < nEndNode; z++ )
+ for ( sal_Int32 z = nStartNode+1; z < nEndNode; z++ )
{
// Always nStartNode+1, due to Remove()!
ImpRemoveParagraph( nStartNode+1 );
@@ -2482,14 +2482,14 @@ EditPaM ImpEditEngine::ImpDeleteSelection(const EditSelection& rCurSel)
return aStartPaM;
}
-void ImpEditEngine::ImpRemoveParagraph( sal_uInt16 nPara )
+void ImpEditEngine::ImpRemoveParagraph( sal_Int32 nPara )
{
ContentNode* pNode = aEditDoc.GetObject( nPara );
ContentNode* pNextNode = aEditDoc.GetObject( nPara+1 );
OSL_ENSURE( pNode, "Blind Node in ImpRemoveParagraph" );
- DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uLong)pNode, nPara );
+ DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uIntPtr)pNode, nPara );
aDeletedNodes.push_back(pInf);
// The node is managed by the undo and possibly destroyed!
@@ -2842,9 +2842,10 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditSelection& rCurSel, bool bK
EditPaM ImpEditEngine::ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttribs )
{
- if ( aEditDoc.Count() >= 0xFFFE )
+ if ( aEditDoc.Count() >= EE_PARA_MAX_COUNT )
{
- OSL_FAIL( "Can't process more than 64K paragraphs!" );
+ SAL_WARN( "editeng", "ImpEditEngine::ImpInsertParaBreak - can't process more than "
+ << EE_PARA_MAX_COUNT << " paragraphs!");
return rPaM;
}
@@ -2889,7 +2890,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttrib
// Optimization: Do not place unnecessarily many getPos to Listen!
// Here, as in undo, but also in all other methods.
- sal_uInt16 nPos = GetParaPortions().GetPos( pPortion );
+ sal_Int32 nPos = GetParaPortions().GetPos( pPortion );
ParaPortion* pNewPortion = new ParaPortion( aPaM.GetNode() );
GetParaPortions().Insert(nPos+1, pNewPortion);
ParaAttribsChanged( pNewPortion->GetNode() );
@@ -2901,7 +2902,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttrib
return aPaM;
}
-EditPaM ImpEditEngine::ImpFastInsertParagraph( sal_uInt16 nPara )
+EditPaM ImpEditEngine::ImpFastInsertParagraph( sal_Int32 nPara )
{
if ( IsUndoEnabled() && !IsInUndo() )
{
@@ -2936,7 +2937,7 @@ EditPaM ImpEditEngine::InsertParaBreak( EditSelection aCurSel )
EditPaM aPaM( ImpInsertParaBreak( aCurSel ) );
if ( aStatus.DoAutoIndenting() )
{
- sal_uInt16 nPara = aEditDoc.GetPos( aPaM.GetNode() );
+ sal_Int32 nPara = aEditDoc.GetPos( aPaM.GetNode() );
OSL_ENSURE( nPara > 0, "AutoIndenting: Error!" );
XubString aPrevParaText( GetEditDoc().GetParaAsString( nPara-1 ) );
sal_uInt16 n = 0;
@@ -2968,8 +2969,8 @@ EditPaM ImpEditEngine::InsertField(const EditSelection& rCurSel, const SvxFieldI
sal_Bool ImpEditEngine::UpdateFields()
{
bool bChanges = false;
- sal_uInt16 nParas = GetEditDoc().Count();
- for ( sal_uInt16 nPara = 0; nPara < nParas; nPara++ )
+ sal_Int32 nParas = GetEditDoc().Count();
+ for ( sal_Int32 nPara = 0; nPara < nParas; nPara++ )
{
bool bChangesInPara = false;
ContentNode* pNode = GetEditDoc().GetObject( nPara );
@@ -3026,7 +3027,7 @@ Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, sal_uInt16 nFlags )
Rectangle aEditCursor;
long nY = 0;
- for ( sal_uInt16 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ )
+ for ( sal_Int32 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ )
{
ParaPortion* pPortion = GetParaPortions()[nPortion];
ContentNode* pNode = pPortion->GetNode();
@@ -3054,7 +3055,7 @@ EditPaM ImpEditEngine::GetPaM( Point aDocPos, sal_Bool bSmart )
long nY = 0;
long nTmpHeight;
EditPaM aPaM;
- sal_uInt16 nPortion;
+ sal_Int32 nPortion;
for ( nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ )
{
ParaPortion* pPortion = GetParaPortions()[nPortion];
@@ -3109,8 +3110,8 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( sal_Bool bIgnoreExtraSpace )
// --------------------------------------------------
// Over all the paragraphs ...
// --------------------------------------------------
- sal_uInt16 nParas = GetParaPortions().Count();
- for ( sal_uInt16 nPara = 0; nPara < nParas; nPara++ )
+ sal_Int32 nParas = GetParaPortions().Count();
+ for ( sal_Int32 nPara = 0; nPara < nParas; nPara++ )
{
ParaPortion* pPortion = GetParaPortions()[nPara];
if ( pPortion->IsVisible() )
@@ -3161,7 +3162,7 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( sal_Bool bIgnoreExtraSpace )
sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, sal_Bool bIgnoreExtraSpace )
{
- sal_uInt16 nPara = GetEditDoc().GetPos( pPortion->GetNode() );
+ sal_Int32 nPara = GetEditDoc().GetPos( pPortion->GetNode() );
// #114278# Saving both layout mode and language (since I'm
// potentially changing both)
@@ -3224,7 +3225,7 @@ sal_uInt32 ImpEditEngine::CalcTextHeight( sal_uInt32* pHeightNTP )
sal_uInt32 nY = 0;
sal_uInt32 nPH;
sal_uInt32 nEmptyHeight = 0;
- for ( sal_uInt16 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) {
+ for ( sal_Int32 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) {
ParaPortion* pPortion = GetParaPortions()[nPortion];
nPH = pPortion->GetHeight();
nY += nPH;
@@ -3242,9 +3243,9 @@ sal_uInt32 ImpEditEngine::CalcTextHeight( sal_uInt32* pHeightNTP )
return nY;
}
-sal_uInt16 ImpEditEngine::GetLineCount( sal_uInt16 nParagraph ) const
+sal_uInt16 ImpEditEngine::GetLineCount( sal_Int32 nParagraph ) const
{
- OSL_ENSURE( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
+ OSL_ENSURE( 0 <= nParagraph && nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
const ParaPortion* pPPortion = GetParaPortions().SafeGetObject( nParagraph );
OSL_ENSURE( pPPortion, "Paragraph not found: GetLineCount" );
if ( pPPortion )
@@ -3253,9 +3254,9 @@ sal_uInt16 ImpEditEngine::GetLineCount( sal_uInt16 nParagraph ) const
return 0xFFFF;
}
-xub_StrLen ImpEditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const
+xub_StrLen ImpEditEngine::GetLineLen( sal_Int32 nParagraph, sal_uInt16 nLine ) const
{
- OSL_ENSURE( nParagraph < GetParaPortions().Count(), "GetLineLen: Out of range" );
+ OSL_ENSURE( 0 <= nParagraph && nParagraph < GetParaPortions().Count(), "GetLineLen: Out of range" );
const ParaPortion* pPPortion = GetParaPortions().SafeGetObject( nParagraph );
OSL_ENSURE( pPPortion, "Paragraph not found: GetLineLen" );
if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) )
@@ -3268,9 +3269,9 @@ xub_StrLen ImpEditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine )
return 0xFFFF;
}
-void ImpEditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const
+void ImpEditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const
{
- OSL_ENSURE( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
+ OSL_ENSURE( 0 <= nParagraph && nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
const ParaPortion* pPPortion = GetParaPortions().SafeGetObject( nParagraph );
OSL_ENSURE( pPPortion, "Paragraph not found: GetLineBoundaries" );
rStart = rEnd = 0xFFFF; // default values in case of error
@@ -3283,7 +3284,7 @@ void ImpEditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uIn
}
}
-sal_uInt16 ImpEditEngine::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_uInt16 ImpEditEngine::GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
sal_uInt16 nLineNo = 0xFFFF;
const ContentNode* pNode = GetEditDoc().GetObject( nPara );
@@ -3310,9 +3311,9 @@ sal_uInt16 ImpEditEngine::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIn
return nLineNo;
}
-sal_uInt16 ImpEditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine )
+sal_uInt16 ImpEditEngine::GetLineHeight( sal_Int32 nParagraph, sal_uInt16 nLine )
{
- OSL_ENSURE( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
+ OSL_ENSURE( 0 <= nParagraph && nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" );
ParaPortion* pPPortion = GetParaPortions().SafeGetObject( nParagraph );
OSL_ENSURE( pPPortion, "Paragraph not found: GetLineHeight" );
if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) )
@@ -3325,7 +3326,7 @@ sal_uInt16 ImpEditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine
return 0xFFFF;
}
-sal_uInt32 ImpEditEngine::GetParaHeight( sal_uInt16 nParagraph )
+sal_uInt32 ImpEditEngine::GetParaHeight( sal_Int32 nParagraph )
{
sal_uInt32 nHeight = 0;
@@ -3356,7 +3357,7 @@ void ImpEditEngine::UpdateSelections()
{
// Use ParaPortions, as now also hidden paragraphs have to be
// taken into account!
- sal_uInt16 nPara = rInf.GetPosition();
+ sal_Int32 nPara = rInf.GetPosition();
ParaPortion* pPPortion = GetParaPortions().SafeGetObject( nPara );
if ( !pPPortion ) // Last paragraph
{
@@ -3365,8 +3366,8 @@ void ImpEditEngine::UpdateSelections()
}
OSL_ENSURE( pPPortion, "Empty Document in UpdateSelections ?" );
// Do not end up from a hidden paragraph:
- sal_uInt16 nCurPara = nPara;
- sal_uInt16 nLastPara = GetParaPortions().Count()-1;
+ sal_Int32 nCurPara = nPara;
+ sal_Int32 nLastPara = GetParaPortions().Count()-1;
while ( nPara <= nLastPara && !GetParaPortions()[nPara]->IsVisible() )
nPara++;
if ( nPara > nLastPara ) // then also backwards ...
@@ -3404,7 +3405,7 @@ void ImpEditEngine::UpdateSelections()
}
EditSelection ImpEditEngine::ConvertSelection(
- sal_uInt16 nStartPara, sal_uInt16 nStartPos, sal_uInt16 nEndPara, sal_uInt16 nEndPos )
+ sal_Int32 nStartPara, sal_uInt16 nStartPos, sal_Int32 nEndPara, sal_uInt16 nEndPos )
{
EditSelection aNewSelection;
@@ -3836,7 +3837,7 @@ Range ImpEditEngine::GetLineXPosStartEnd( const ParaPortion* pParaPortion, const
{
Range aLineXPosStartEnd;
- sal_uInt16 nPara = GetEditDoc().GetPos( pParaPortion->GetNode() );
+ sal_Int32 nPara = GetEditDoc().GetPos( pParaPortion->GetNode() );
if ( !IsRightToLeft( nPara ) )
{
aLineXPosStartEnd.Min() = pLine->GetStartPosX();
@@ -3873,7 +3874,7 @@ long ImpEditEngine::GetPortionXOffset(
}
}
- sal_uInt16 nPara = GetEditDoc().GetPos( pParaPortion->GetNode() );
+ sal_Int32 nPara = GetEditDoc().GetPos( pParaPortion->GetNode() );
sal_Bool bR2LPara = IsRightToLeft( nPara );
const TextPortion* pDestPortion = pParaPortion->GetTextPortions()[nTextPortion];
@@ -4100,7 +4101,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion )
pPortion->nHeight += nSBL;
}
- sal_uInt16 nPortion = GetParaPortions().GetPos( pPortion );
+ sal_Int32 nPortion = GetParaPortions().GetPos( pPortion );
if ( nPortion || aStatus.ULSpaceFirstParagraph() )
{
sal_uInt16 nUpper = GetYValue( rULItem.GetUpper() );
@@ -4287,7 +4288,7 @@ void ImpEditEngine::IndentBlock( EditView* pEditView, sal_Bool bRight )
{
ESelection aNewSel = aESel;
aNewSel.nStartPos = 0;
- aNewSel.nEndPos = 0xFFFF;
+ aNewSel.nEndPos = EE_TEXTPOS_ALL;
if ( aESel.nEndPos == 0 )
{
@@ -4300,7 +4301,7 @@ void ImpEditEngine::IndentBlock( EditView* pEditView, sal_Bool bRight )
pEditView->pImpEditView->GetEditSelection().Max() );
UndoActionStart( bRight ? EDITUNDO_INDENTBLOCK : EDITUNDO_UNINDENTBLOCK );
- for ( sal_uInt16 nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ )
+ for ( sal_Int32 nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ )
{
ContentNode* pNode = GetEditDoc().GetObject( nPara );
if ( bRight )
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index d56ea0e11faf..a247a2cd5265 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -350,7 +350,7 @@ void ImpEditEngine::CheckIdleFormatter()
void ImpEditEngine::FormatFullDoc()
{
- for ( sal_uInt16 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ )
+ for ( sal_Int32 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ )
GetParaPortions()[nPortion]->MarkSelectionInvalid( 0, GetParaPortions()[nPortion]->GetNode()->Len() );
FormatDoc();
}
@@ -377,7 +377,7 @@ void ImpEditEngine::FormatDoc()
sal_Bool bMapChanged = ImpCheckRefMapMode();
aInvalidRec = Rectangle(); // make empty
- for ( sal_uInt16 nPara = 0; nPara < GetParaPortions().Count(); nPara++ )
+ for ( sal_Int32 nPara = 0; nPara < GetParaPortions().Count(); nPara++ )
{
ParaPortion* pParaPortion = GetParaPortions()[nPara];
if ( pParaPortion->MustRepaint() || ( pParaPortion->IsInvalid() && pParaPortion->IsVisible() ) )
@@ -398,7 +398,7 @@ void ImpEditEngine::FormatDoc()
if ( !bGrow && GetTextRanger() )
{
// For a change in height all below must be reformatted ...
- for ( sal_uInt16 n = nPara+1; n < GetParaPortions().Count(); n++ )
+ for ( sal_Int32 n = nPara+1; n < GetParaPortions().Count(); n++ )
{
ParaPortion* pPP = GetParaPortions()[n];
pPP->MarkSelectionInvalid( 0, pPP->GetNode()->Len() );
@@ -532,7 +532,7 @@ void ImpEditEngine::CheckAutoPageSize()
{
// If ahead is centered / right or tabs ...
aStatus.GetStatusWord() |= !IsVertical() ? EE_STAT_TEXTWIDTHCHANGED : EE_STAT_TEXTHEIGHTCHANGED;
- for ( sal_uInt16 nPara = 0; nPara < GetParaPortions().Count(); nPara++ )
+ for ( sal_Int32 nPara = 0; nPara < GetParaPortions().Count(); nPara++ )
{
// Only paragraphs which are not aligned to the left need to be
// reformatted, the height can not be changed here anymore.
@@ -575,7 +575,7 @@ static sal_Int32 ImplCalculateFontIndependentLineSpacing( const sal_Int32 nFontH
return ( nFontHeight * 12 ) / 10; // + 20%
}
-sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY )
+sal_Bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
{
ParaPortion* pParaPortion = GetParaPortions()[nPara];
@@ -1631,7 +1631,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn
if ( !aStatus.IsOutliner() )
{
- sal_uInt16 nPara = GetParaPortions().GetPos( pParaPortion );
+ sal_Int32 nPara = GetParaPortions().GetPos( pParaPortion );
SvxAdjust eJustification = GetJustification( nPara );
long nMaxLineWidth = !IsVertical() ? aPaperSize.Width() : aPaperSize.Height();
nMaxLineWidth -= GetXValue( rLRItem.GetRight() );
@@ -1672,7 +1672,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn
}
else if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP )
{
- sal_uInt16 nPara = GetParaPortions().GetPos( pParaPortion );
+ sal_Int32 nPara = GetParaPortions().GetPos( pParaPortion );
if ( nPara || IsFixedCellHeight() || pTmpLine->GetStartPortion() ) // Not the very first line
{
// There are documents with PropLineSpace 0, why?
@@ -2503,7 +2503,7 @@ void ImpEditEngine::SetTextRanger( TextRanger* pRanger )
delete pTextRanger;
pTextRanger = pRanger;
- for ( sal_uInt16 nPara = 0; nPara < GetParaPortions().Count(); nPara++ )
+ for ( sal_Int32 nPara = 0; nPara < GetParaPortions().Count(); nPara++ )
{
ParaPortion* pParaPortion = GetParaPortions()[nPara];
pParaPortion->MarkSelectionInvalid( 0, pParaPortion->GetNode()->Len() );
@@ -2874,7 +2874,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta
// --------------------------------------------------
// Over all the paragraphs ...
// --------------------------------------------------
- for ( sal_uInt16 n = 0; n < GetParaPortions().Count(); n++ )
+ for ( sal_Int32 n = 0; n < GetParaPortions().Count(); n++ )
{
const ParaPortion* pPortion = GetParaPortions()[n];
DBG_ASSERT( pPortion, "NULL-Pointer in TokenList in Paint" );
@@ -3837,7 +3837,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b
}
-void ImpEditEngine::InsertContent( ContentNode* pNode, sal_uInt16 nPos )
+void ImpEditEngine::InsertContent( ContentNode* pNode, sal_Int32 nPos )
{
DBG_ASSERT( pNode, "NULL-Pointer in InsertContent! " );
DBG_ASSERT( IsInUndo(), "InsertContent only for Undo()!" );
@@ -3848,7 +3848,7 @@ void ImpEditEngine::InsertContent( ContentNode* pNode, sal_uInt16 nPos )
GetEditEnginePtr()->ParagraphInserted( nPos );
}
-EditPaM ImpEditEngine::SplitContent( sal_uInt16 nNode, sal_uInt16 nSepPos )
+EditPaM ImpEditEngine::SplitContent( sal_Int32 nNode, sal_uInt16 nSepPos )
{
ContentNode* pNode = aEditDoc.GetObject( nNode );
DBG_ASSERT( pNode, "Invalid Node in SplitContent" );
@@ -3858,7 +3858,7 @@ EditPaM ImpEditEngine::SplitContent( sal_uInt16 nNode, sal_uInt16 nSepPos )
return ImpInsertParaBreak( aPaM );
}
-EditPaM ImpEditEngine::ConnectContents( sal_uInt16 nLeftNode, sal_Bool bBackward )
+EditPaM ImpEditEngine::ConnectContents( sal_Int32 nLeftNode, sal_Bool bBackward )
{
ContentNode* pLeftNode = aEditDoc.GetObject( nLeftNode );
ContentNode* pRightNode = aEditDoc.GetObject( nLeftNode+1 );
@@ -3883,7 +3883,7 @@ void ImpEditEngine::SetUpdateMode( bool bUp, EditView* pCurView, sal_Bool bForce
FormatAndUpdate( pCurView );
}
-void ImpEditEngine::ShowParagraph( sal_uInt16 nParagraph, bool bShow )
+void ImpEditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow )
{
ParaPortion* pPPortion = GetParaPortions().SafeGetObject( nParagraph );
DBG_ASSERT( pPPortion, "ShowParagraph: Paragraph does not exist! ");
@@ -3935,7 +3935,7 @@ void ImpEditEngine::ShowParagraph( sal_uInt16 nParagraph, bool bShow )
}
}
-EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNewPos, EditView* pCurView )
+EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNewPos, EditView* pCurView )
{
DBG_ASSERT( GetParaPortions().Count() != 0, "No paragraphs found: MoveParagraphs" );
if ( GetParaPortions().Count() == 0 )
@@ -3954,8 +3954,8 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNe
{
// in this case one can redraw directly whithout invalidating the
// Portions
- sal_uInt16 nFirstPortion = Min( (sal_uInt16)aOldPositions.Min(), nNewPos );
- sal_uInt16 nLastPortion = Max( (sal_uInt16)aOldPositions.Max(), nNewPos );
+ sal_Int32 nFirstPortion = std::min( static_cast<sal_Int32>(aOldPositions.Min()), nNewPos );
+ sal_Int32 nLastPortion = std::max( static_cast<sal_Int32>(aOldPositions.Max()), nNewPos );
ParaPortion* pUpperPortion = GetParaPortions().SafeGetObject( nFirstPortion );
ParaPortion* pLowerPortion = GetParaPortions().SafeGetObject( nLastPortion );
@@ -3971,13 +3971,13 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNe
else
{
// redraw from the upper invalid position
- sal_uInt16 nFirstInvPara = Min( (sal_uInt16)aOldPositions.Min(), nNewPos );
+ sal_Int32 nFirstInvPara = std::min( static_cast<sal_Int32>(aOldPositions.Min()), nNewPos );
InvalidateFromParagraph( nFirstInvPara );
}
return aSel;
}
-void ImpEditEngine::InvalidateFromParagraph( sal_uInt16 nFirstInvPara )
+void ImpEditEngine::InvalidateFromParagraph( sal_Int32 nFirstInvPara )
{
// The following paragraphs are not invalidated, since ResetHeight()
// => size change => all the following are re-issued anyway.
@@ -4037,7 +4037,7 @@ ContentNode* ImpEditEngine::GetNextVisNode( ContentNode* pCurNode )
const ParaPortion* ImpEditEngine::GetPrevVisPortion( const ParaPortion* pCurPortion ) const
{
- sal_uInt16 nPara = GetParaPortions().GetPos( pCurPortion );
+ sal_Int32 nPara = GetParaPortions().GetPos( pCurPortion );
DBG_ASSERT( nPara < GetParaPortions().Count() , "Portion not found: GetPrevVisPortion" );
const ParaPortion* pPortion = nPara ? GetParaPortions()[--nPara] : 0;
while ( pPortion && !pPortion->IsVisible() )
@@ -4048,7 +4048,7 @@ const ParaPortion* ImpEditEngine::GetPrevVisPortion( const ParaPortion* pCurPort
const ParaPortion* ImpEditEngine::GetNextVisPortion( const ParaPortion* pCurPortion ) const
{
- sal_uInt16 nPara = GetParaPortions().GetPos( pCurPortion );
+ sal_Int32 nPara = GetParaPortions().GetPos( pCurPortion );
DBG_ASSERT( nPara < GetParaPortions().Count() , "Portion not found: GetPrevVisNode" );
const ParaPortion* pPortion = GetParaPortions().SafeGetObject( ++nPara );
while ( pPortion && !pPortion->IsVisible() )
@@ -4062,9 +4062,9 @@ long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const
long nTotalOccupiedHeight = 0;
sal_uInt16 nTotalLineCount = 0;
const ParaPortionList& rParaPortions = GetParaPortions();
- sal_uInt16 nParaCount = rParaPortions.Count();
+ sal_Int32 nParaCount = rParaPortions.Count();
- for (sal_uInt16 i = 0; i < nParaCount; ++i)
+ for (sal_Int32 i = 0; i < nParaCount; ++i)
{
if (GetVerJustification(i) != SVX_VER_JUSTIFY_BLOCK)
// All paragraphs must have the block justification set.
@@ -4105,7 +4105,7 @@ long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const
return nTotalSpace / (nTotalLineCount-1);
}
-EditPaM ImpEditEngine::InsertParagraph( sal_uInt16 nPara )
+EditPaM ImpEditEngine::InsertParagraph( sal_Int32 nPara )
{
EditPaM aPaM;
if ( nPara != 0 )
@@ -4125,7 +4125,7 @@ EditPaM ImpEditEngine::InsertParagraph( sal_uInt16 nPara )
return ImpInsertParaBreak( aPaM );
}
-EditSelection* ImpEditEngine::SelectParagraph( sal_uInt16 nPara )
+EditSelection* ImpEditEngine::SelectParagraph( sal_Int32 nPara )
{
EditSelection* pSel = 0;
ContentNode* pNode = GetEditDoc().GetObject( nPara );
@@ -4200,9 +4200,9 @@ const SvxNumberFormat* ImpEditEngine::GetNumberFormat( const ContentNode *pNode
if (pNode)
{
// get index of paragraph
- sal_uInt16 nPara = GetEditDoc().GetPos( const_cast< ContentNode * >(pNode) );
- DBG_ASSERT( nPara < USHRT_MAX, "node not found in array" );
- if (nPara < USHRT_MAX)
+ sal_Int32 nPara = GetEditDoc().GetPos( const_cast< ContentNode * >(pNode) );
+ DBG_ASSERT( nPara < EE_PARA_NOT_FOUND, "node not found in array" );
+ if (nPara < EE_PARA_NOT_FOUND)
{
// the called function may be overloaded by an OutlinerEditEng object to provide
// access to the SvxNumberFormat of the Outliner.
@@ -4304,7 +4304,7 @@ void ImpEditEngine::ImplInitDigitMode( OutputDevice* pOutDev, String* pString, x
}
}
-void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_uInt16 nPara, sal_uInt16 nIndex )
+void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, sal_uInt16 nIndex )
{
sal_Bool bCTL = sal_False;
sal_Bool bR2L = sal_False;
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index d66e1b55d31b..76f0246fdeb0 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -233,7 +233,7 @@ void ImpEditEngine::Write( SvStream& rOutput, EETextFormat eFormat, EditSelectio
sal_uInt32 ImpEditEngine::WriteText( SvStream& rOutput, EditSelection aSel )
{
- sal_uInt16 nStartNode, nEndNode;
+ sal_Int32 nStartNode, nEndNode;
sal_Bool bRange = aSel.HasRange();
if ( bRange )
{
@@ -248,7 +248,7 @@ sal_uInt32 ImpEditEngine::WriteText( SvStream& rOutput, EditSelection aSel )
}
// iterate over the paragraphs ...
- for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
ContentNode* pNode = aEditDoc.GetObject( nNode );
DBG_ASSERT( pNode, "Node not founden: Search&Replace" );
@@ -269,7 +269,7 @@ sal_uInt32 ImpEditEngine::WriteText( SvStream& rOutput, EditSelection aSel )
return rOutput.GetError();
}
-sal_Bool ImpEditEngine::WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos,
+sal_Bool ImpEditEngine::WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_Int32 nPara, sal_uInt16 nPos,
std::vector<SvxFontItem*>& rFontTable, SvxColorList& rColorList )
{
const SfxPoolItem* pAttrItem = rLst.First();
@@ -336,7 +336,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
if ( !IsFormatted() )
FormatDoc();
- sal_uInt16 nStartNode, nEndNode;
+ sal_Int32 nStartNode, nEndNode;
aSel.Adjust( aEditDoc );
nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
@@ -540,7 +540,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
// iterate over the paragraphs ...
rOutput << '{' << endl;
- for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
ContentNode* pNode = aEditDoc.GetObject( nNode );
DBG_ASSERT( pNode, "Node not found: Search&Replace" );
@@ -699,7 +699,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
}
-void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos,
+void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, sal_Int32 nPara, sal_uInt16 nPos,
std::vector<SvxFontItem*>& rFontTable, SvxColorList& rColorList )
{
sal_uInt16 nWhich = rItem.Which();
@@ -1029,7 +1029,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
if ( pTxtObj->IsOwnerOfPool() )
pTxtObj->GetPool()->SetDefaultMetric( (SfxMapUnit) eMapUnit );
- sal_uInt16 nStartNode, nEndNode;
+ sal_Int32 nStartNode, nEndNode;
sal_uInt32 nTextPortions = 0;
aSel.Adjust( aEditDoc );
@@ -1045,7 +1045,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
pTxtObj->SetScriptType( GetScriptType( aSel ) );
// iterate over the paragraphs ...
- sal_uInt16 nNode;
+ sal_Int32 nNode;
for ( nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
ContentNode* pNode = aEditDoc.GetObject( nNode );
@@ -1230,10 +1230,14 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed
bConvertItems = sal_True;
}
- size_t nContents = rTextObject.GetContents().size();
- sal_uInt16 nPara = aEditDoc.GetPos( aPaM.GetNode() );
+ // Before, paragraph count was of type sal_uInt16 so if nContents exceeded
+ // 0xFFFF this wouldn't had worked anyway, given that nPara is used to
+ // number paragraphs and is fearlessly incremented.
+ sal_Int32 nContents = static_cast<sal_Int32>(rTextObject.GetContents().size());
+ SAL_WARN_IF( nContents < 0, "editeng", "ImpEditEngine::InsertTextObject - contents overflow " << nContents);
+ sal_Int32 nPara = aEditDoc.GetPos( aPaM.GetNode() );
- for (size_t n = 0; n < nContents; ++n, ++nPara)
+ for (sal_Int32 n = 0; n < nContents; ++n, ++nPara)
{
ContentInfo* pC = &rTextObject.GetContents()[n];
sal_Bool bNewContent = aPaM.GetNode()->Len() ? sal_False: sal_True;
@@ -1483,8 +1487,8 @@ sal_Bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang )
{
sal_Bool bHasConvTxt = sal_False;
- sal_uInt16 nParas = pEditEngine->GetParagraphCount();
- for (sal_uInt16 k = 0; k < nParas; ++k)
+ sal_Int32 nParas = pEditEngine->GetParagraphCount();
+ for (sal_Int32 k = 0; k < nParas; ++k)
{
std::vector<sal_uInt16> aPortions;
pEditEngine->GetPortions( k, aPortions );
@@ -1661,7 +1665,7 @@ void ImpEditEngine::ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtL
if (bAllowImplicitChangesForNotConvertibleText &&
!pEditEngine->GetText( pConvInfo->aConvContinue.nPara ).Len())
{
- sal_uInt16 nPara = pConvInfo->aConvContinue.nPara;
+ sal_Int32 nPara = pConvInfo->aConvContinue.nPara;
ESelection aESel( nPara, 0, nPara, 0 );
// see comment for below same function call
SetLanguageAndFont( aESel,
@@ -1679,7 +1683,7 @@ void ImpEditEngine::ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtL
sal_uInt16 nCurPos = USHRT_MAX;
EPaM aCurStart = CreateEPaM( aCurSel.Min() );
std::vector<sal_uInt16> aPortions;
- pEditEngine->GetPortions( (sal_uInt16)aCurStart.nPara, aPortions );
+ pEditEngine->GetPortions( aCurStart.nPara, aPortions );
for ( size_t nPos = 0; nPos < aPortions.size(); ++nPos )
{
sal_uInt16 nEnd = aPortions[ nPos ];
@@ -2238,10 +2242,10 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel
sal_Bool bRestartTimer = sal_False;
ContentNode* pLastNode = aEditDoc.GetObject( aEditDoc.Count() - 1 );
- sal_uInt16 nNodes = GetEditDoc().Count();
- sal_uInt16 nInvalids = 0;
+ sal_Int32 nNodes = GetEditDoc().Count();
+ sal_Int32 nInvalids = 0;
Sequence< PropertyValue > aEmptySeq;
- for ( sal_uInt16 n = 0; n < nNodes; n++ )
+ for ( sal_Int32 n = 0; n < nNodes; n++ )
{
ContentNode* pNode = GetEditDoc().GetObject( n );
if ( pThisNodeOnly )
@@ -2580,8 +2584,8 @@ sal_Bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem,
sal_Bool bBack = rSearchItem.GetBackward();
sal_Bool bSearchInSelection = rSearchItem.GetSelection();
- sal_uInt16 nStartNode = aEditDoc.GetPos( rStartPos.GetNode() );
- sal_uInt16 nEndNode;
+ sal_Int32 nStartNode = aEditDoc.GetPos( rStartPos.GetNode() );
+ sal_Int32 nEndNode;
if ( bSearchInSelection )
{
nEndNode = aEditDoc.GetPos( bBack ? rSearchSelection.Min().GetNode() : rSearchSelection.Max().GetNode() );
@@ -2594,12 +2598,12 @@ sal_Bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem,
utl::TextSearch aSearcher( aSearchOptions );
// iterate over the paragraphs ...
- for ( sal_uInt16 nNode = nStartNode;
+ for ( sal_Int32 nNode = nStartNode;
bBack ? ( nNode >= nEndNode ) : ( nNode <= nEndNode) ;
bBack ? nNode-- : nNode++ )
{
// For backwards-search if nEndNode = 0:
- if ( nNode >= 0xFFFF )
+ if ( nNode < 0 )
return sal_False;
ContentNode* pNode = aEditDoc.GetObject( nNode );
@@ -2689,8 +2693,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
EditSelection aNewSel( aSel );
- const sal_uInt16 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
- const sal_uInt16 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
+ const sal_Int32 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
+ const sal_Int32 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
sal_Bool bChanges = sal_False;
sal_Bool bLenChanged = sal_False;
@@ -2699,7 +2703,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
utl::TransliterationWrapper aTranslitarationWrapper( ::comphelper::getProcessComponentContext(), nTransliterationMode );
sal_Bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode();
- for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
ContentNode* pNode = aEditDoc.GetObject( nNode );
const XubString& aNodeStr = pNode->GetString();
@@ -2965,7 +2969,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
if (aSel.Max().GetNode() == rData.aSelection.Max().GetNode())
aNewSel.Max().GetIndex() = aNewSel.Max().GetIndex() + nDiffs;
- sal_uInt16 nSelNode = aEditDoc.GetPos( rData.aSelection.Min().GetNode() );
+ sal_Int32 nSelNode = aEditDoc.GetPos( rData.aSelection.Min().GetNode() );
ParaPortion* pParaPortion = GetParaPortions()[nSelNode];
pParaPortion->MarkSelectionInvalid( rData.nStart,
std::max< sal_uInt16 >( rData.nStart + rData.nLen,
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx
index 0918594ee59d..e3ed4f7d8f2e 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -35,13 +35,13 @@ void ImpEditEngine::SetStyleSheetPool( SfxStyleSheetPool* pSPool )
}
}
-const SfxStyleSheet* ImpEditEngine::GetStyleSheet( sal_uInt16 nPara ) const
+const SfxStyleSheet* ImpEditEngine::GetStyleSheet( sal_Int32 nPara ) const
{
const ContentNode* pNode = aEditDoc.GetObject( nPara );
return pNode ? pNode->GetContentAttribs().GetStyleSheet() : NULL;
}
-SfxStyleSheet* ImpEditEngine::GetStyleSheet( sal_uInt16 nPara )
+SfxStyleSheet* ImpEditEngine::GetStyleSheet( sal_Int32 nPara )
{
ContentNode* pNode = aEditDoc.GetObject( nPara );
return pNode ? pNode->GetContentAttribs().GetStyleSheet() : NULL;
@@ -51,19 +51,19 @@ void ImpEditEngine::SetStyleSheet( EditSelection aSel, SfxStyleSheet* pStyle )
{
aSel.Adjust( aEditDoc );
- sal_uInt16 nStartPara = aEditDoc.GetPos( aSel.Min().GetNode() );
- sal_uInt16 nEndPara = aEditDoc.GetPos( aSel.Max().GetNode() );
+ sal_Int32 nStartPara = aEditDoc.GetPos( aSel.Min().GetNode() );
+ sal_Int32 nEndPara = aEditDoc.GetPos( aSel.Max().GetNode() );
sal_Bool _bUpdate = GetUpdateMode();
SetUpdateMode( sal_False );
- for ( sal_uInt16 n = nStartPara; n <= nEndPara; n++ )
+ for ( sal_Int32 n = nStartPara; n <= nEndPara; n++ )
SetStyleSheet( n, pStyle );
SetUpdateMode( _bUpdate, 0 );
}
-void ImpEditEngine::SetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle )
+void ImpEditEngine::SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle )
{
DBG_ASSERT( GetStyleSheetPool() || !pStyle, "SetStyleSheet: No StyleSheetPool registered!" );
ContentNode* pNode = aEditDoc.GetObject( nPara );
@@ -102,7 +102,7 @@ void ImpEditEngine::UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle )
CreateFont( aFontFromStyle, pStyle->GetItemSet() );
sal_Bool bUsed = sal_False;
- for ( sal_uInt16 nNode = 0; nNode < aEditDoc.Count(); nNode++ )
+ for ( sal_Int32 nNode = 0; nNode < aEditDoc.Count(); nNode++ )
{
ContentNode* pNode = aEditDoc.GetObject( nNode );
if ( pNode->GetStyleSheet() == pStyle )
@@ -125,7 +125,7 @@ void ImpEditEngine::UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle )
void ImpEditEngine::RemoveStyleFromParagraphs( SfxStyleSheet* pStyle )
{
- for ( sal_uInt16 nNode = 0; nNode < aEditDoc.Count(); nNode++ )
+ for ( sal_Int32 nNode = 0; nNode < aEditDoc.Count(); nNode++ )
{
ContentNode* pNode = aEditDoc.GetObject(nNode);
if ( pNode->GetStyleSheet() == pStyle )
@@ -184,8 +184,8 @@ EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const S
ESelection aESel( CreateESel( aSel ) );
- sal_uInt16 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
- sal_uInt16 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
+ sal_Int32 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
+ sal_Int32 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
DBG_ASSERT( nStartNode <= nEndNode, "CreateAttribUndo: Start > End ?!" );
@@ -203,7 +203,7 @@ EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const S
SfxItemPool* pPool = pUndo->GetNewAttribs().GetPool();
- for ( sal_uInt16 nPara = nStartNode; nPara <= nEndNode; nPara++ )
+ for ( sal_Int32 nPara = nStartNode; nPara <= nEndNode; nPara++ )
{
ContentNode* pNode = aEditDoc.GetObject( nPara );
DBG_ASSERT( aEditDoc.GetObject( nPara ), "Node not found: CreateAttribUndo" );
@@ -312,11 +312,11 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, sal_Bool bOnlyHardAttr
SfxItemSet aCurSet( GetEmptyItemSet() );
- sal_uInt16 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
- sal_uInt16 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
+ sal_Int32 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
+ sal_Int32 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
// iterate over the paragraphs ...
- for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
ContentNode* pNode = aEditDoc.GetObject( nNode );
DBG_ASSERT( aEditDoc.GetObject( nNode ), "Node not found: GetAttrib" );
@@ -397,7 +397,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, sal_Bool bOnlyHardAttr
}
-SfxItemSet ImpEditEngine::GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags ) const
+SfxItemSet ImpEditEngine::GetAttribs( sal_Int32 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags ) const
{
// Optimized function with less Puts(), which cause unnecessary cloning from default items.
// If this works, change GetAttribs( EditSelection ) to use this for each paragraph and merge the results!
@@ -498,8 +498,8 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_
if ( ( nSpecial == ATTRSPECIAL_WHOLEWORD ) && !aSel.HasRange() )
aSel = SelectWord( aSel, ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_False );
- sal_uInt16 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
- sal_uInt16 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
+ sal_Int32 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
+ sal_Int32 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
if ( IsUndoEnabled() && !IsInUndo() && aStatus.DoUndoAttribs() )
{
@@ -517,7 +517,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_
}
// iterate over the paragraphs ...
- for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
sal_Bool bParaAttribFound = sal_False;
sal_Bool bCharAttribFound = sal_False;
@@ -591,8 +591,8 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaA
{
aSel.Adjust( aEditDoc );
- sal_uInt16 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
- sal_uInt16 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
+ sal_Int32 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() );
+ sal_Int32 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() );
const SfxItemSet* _pEmptyItemSet = bRemoveParaAttribs ? &GetEmptyItemSet() : 0;
@@ -607,7 +607,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaA
}
// iterate over the paragraphs ...
- for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
ContentNode* pNode = aEditDoc.GetObject( nNode );
ParaPortion* pPortion = GetParaPortions()[nNode];
@@ -653,7 +653,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaA
}
}
-void ImpEditEngine::RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich, sal_Bool bRemoveFeatures )
+void ImpEditEngine::RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich, sal_Bool bRemoveFeatures )
{
ContentNode* pNode = aEditDoc.GetObject( nPara );
ParaPortion* pPortion = GetParaPortions().SafeGetObject( nPara );
@@ -682,7 +682,7 @@ void ImpEditEngine::RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich, sal_
pPortion->MarkSelectionInvalid( 0, pNode->Len() );
}
-void ImpEditEngine::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet )
+void ImpEditEngine::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
{
ContentNode* pNode = aEditDoc.GetObject( nPara );
@@ -712,14 +712,14 @@ void ImpEditEngine::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet )
}
}
-const SfxItemSet& ImpEditEngine::GetParaAttribs( sal_uInt16 nPara ) const
+const SfxItemSet& ImpEditEngine::GetParaAttribs( sal_Int32 nPara ) const
{
const ContentNode* pNode = aEditDoc.GetObject( nPara );
DBG_ASSERT( pNode, "Node not found: GetParaAttribs" );
return pNode->GetContentAttribs().GetItems();
}
-bool ImpEditEngine::HasParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const
+bool ImpEditEngine::HasParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
const ContentNode* pNode = aEditDoc.GetObject( nPara );
DBG_ASSERT( pNode, "Node not found: HasParaAttrib" );
@@ -727,7 +727,7 @@ bool ImpEditEngine::HasParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const
return pNode->GetContentAttribs().HasItem( nWhich );
}
-const SfxPoolItem& ImpEditEngine::GetParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const
+const SfxPoolItem& ImpEditEngine::GetParaAttrib( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
const ContentNode* pNode = aEditDoc.GetObject( nPara );
DBG_ASSERT( pNode, "Node not found: GetParaAttrib" );
@@ -735,7 +735,7 @@ const SfxPoolItem& ImpEditEngine::GetParaAttrib( sal_uInt16 nPara, sal_uInt16 nW
return pNode->GetContentAttribs().GetItem( nWhich );
}
-void ImpEditEngine::GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const
+void ImpEditEngine::GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const
{
rLst.clear();
const ContentNode* pNode = aEditDoc.GetObject( nPara );
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index 3fcaab1d209a..403134a15798 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -45,7 +45,7 @@ OutlinerEditEng::~OutlinerEditEng()
{
}
-void OutlinerEditEng::PaintingFirstLine( sal_uInt16 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
+void OutlinerEditEng::PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
{
if( GetControlWord() & EE_CNTRL_OUTLINER )
{
@@ -56,7 +56,7 @@ void OutlinerEditEng::PaintingFirstLine( sal_uInt16 nPara, const Point& rStartPo
pOwner->PaintBullet( nPara, rStartPos, rOrigin, nOrientation, pOutDev );
}
-const SvxNumberFormat* OutlinerEditEng::GetNumberFormat( sal_uInt16 nPara ) const
+const SvxNumberFormat* OutlinerEditEng::GetNumberFormat( sal_Int32 nPara ) const
{
const SvxNumberFormat* pFmt = NULL;
if (pOwner)
@@ -65,7 +65,7 @@ const SvxNumberFormat* OutlinerEditEng::GetNumberFormat( sal_uInt16 nPara ) cons
}
-Rectangle OutlinerEditEng::GetBulletArea( sal_uInt16 nPara )
+Rectangle OutlinerEditEng::GetBulletArea( sal_Int32 nPara )
{
Rectangle aBulletArea = Rectangle( Point(), Point() );
if ( nPara < pOwner->pParaList->GetParagraphCount() )
@@ -76,21 +76,21 @@ Rectangle OutlinerEditEng::GetBulletArea( sal_uInt16 nPara )
return aBulletArea;
}
-void OutlinerEditEng::ParagraphInserted( sal_uInt16 nNewParagraph )
+void OutlinerEditEng::ParagraphInserted( sal_Int32 nNewParagraph )
{
pOwner->ParagraphInserted( nNewParagraph );
EditEngine::ParagraphInserted( nNewParagraph );
}
-void OutlinerEditEng::ParagraphDeleted( sal_uInt16 nDeletedParagraph )
+void OutlinerEditEng::ParagraphDeleted( sal_Int32 nDeletedParagraph )
{
pOwner->ParagraphDeleted( nDeletedParagraph );
EditEngine::ParagraphDeleted( nDeletedParagraph );
}
-void OutlinerEditEng::ParagraphConnected( sal_uInt16 /*nLeftParagraph*/, sal_uInt16 nRightParagraph )
+void OutlinerEditEng::ParagraphConnected( sal_Int32 /*nLeftParagraph*/, sal_Int32 nRightParagraph )
{
if( pOwner && pOwner->IsUndoEnabled() && !const_cast<EditEngine&>(pOwner->GetEditEngine()).IsInUndo() )
{
@@ -108,7 +108,7 @@ void OutlinerEditEng::StyleSheetChanged( SfxStyleSheet* pStyle )
pOwner->StyleSheetChanged( pStyle );
}
-void OutlinerEditEng::ParaAttribsChanged( sal_uInt16 nPara )
+void OutlinerEditEng::ParaAttribsChanged( sal_Int32 nPara )
{
pOwner->ParaAttribsChanged( nPara );
}
@@ -148,7 +148,7 @@ XubString OutlinerEditEng::GetUndoComment( sal_uInt16 nUndoId ) const
}
void OutlinerEditEng::DrawingText( const Point& rStartPos, const XubString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen,
- const sal_Int32* pDXArray, const SvxFont& rFont, sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft,
+ const sal_Int32* pDXArray, const SvxFont& rFont, sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -163,7 +163,7 @@ void OutlinerEditEng::DrawingText( const Point& rStartPos, const XubString& rTex
}
void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const String& rChar,
- const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
+ const SvxFont& rFont, sal_Int32 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
bool bEndOfLine, bool bEndOfParagraph,
const Color& rOverlineColor, const Color& rTextLineColor)
{
@@ -171,23 +171,23 @@ void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const Str
bEndOfLine, bEndOfParagraph, rOverlineColor, rTextLineColor );
}
-void OutlinerEditEng::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos )
+void OutlinerEditEng::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos )
{
EditEngine::FieldClicked( rField, nPara, nPos ); // If URL
pOwner->FieldClicked( rField, nPara, nPos );
}
-void OutlinerEditEng::FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos )
+void OutlinerEditEng::FieldSelected( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos )
{
pOwner->FieldSelected( rField, nPara, nPos );
}
-XubString OutlinerEditEng::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
+XubString OutlinerEditEng::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
{
return pOwner->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
-void OutlinerEditEng::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet )
+void OutlinerEditEng::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
if( pPara )
@@ -195,13 +195,13 @@ void OutlinerEditEng::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet )
if ( !IsInUndo() && IsUndoEnabled() )
pOwner->UndoActionStart( OLUNDO_ATTR );
- EditEngine::SetParaAttribs( (sal_uInt16)nPara, rSet );
+ EditEngine::SetParaAttribs( nPara, rSet );
- pOwner->ImplCheckNumBulletItem( (sal_uInt16)nPara );
+ pOwner->ImplCheckNumBulletItem( nPara );
// #i100014#
// It is not a good idea to substract 1 from a count and cast the result
// to sal_uInt16 without check, if the count is 0.
- pOwner->ImplCheckParagraphs( (sal_uInt16)nPara, (sal_uInt16) (pOwner->pParaList->GetParagraphCount()) );
+ pOwner->ImplCheckParagraphs( nPara, pOwner->pParaList->GetParagraphCount() );
if ( !IsInUndo() && IsUndoEnabled() )
pOwner->UndoActionEnd( OLUNDO_ATTR );
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx
index ee075d347158..4ef36a0ec035 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -32,21 +32,21 @@ protected:
// derived from EditEngine. Allows Outliner objetcs to provide
// bullet access to the EditEngine.
- virtual const SvxNumberFormat* GetNumberFormat( sal_uInt16 nPara ) const;
+ virtual const SvxNumberFormat* GetNumberFormat( sal_Int32 nPara ) const;
public:
OutlinerEditEng( Outliner* pOwner, SfxItemPool* pPool );
~OutlinerEditEng();
- virtual void PaintingFirstLine( sal_uInt16 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev );
+ virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev );
- virtual void ParagraphInserted( sal_uInt16 nNewParagraph );
- virtual void ParagraphDeleted( sal_uInt16 nDeletedParagraph );
- virtual void ParagraphConnected( sal_uInt16 nLeftParagraph, sal_uInt16 nRightParagraph );
+ virtual void ParagraphInserted( sal_Int32 nNewParagraph );
+ virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph );
+ virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph );
virtual void DrawingText(
const Point& rStartPos, const XubString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray, const SvxFont& rFont,
- sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft,
+ sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -58,27 +58,27 @@ public:
virtual void DrawingTab(
const Point& rStartPos, long nWidth, const String& rChar,
- const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
+ const SvxFont& rFont, sal_Int32 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft,
bool bEndOfLine,
bool bEndOfParagraph,
const Color& rOverlineColor,
const Color& rTextLineColor);
virtual void StyleSheetChanged( SfxStyleSheet* pStyle );
- virtual void ParaAttribsChanged( sal_uInt16 nPara );
+ virtual void ParaAttribsChanged( sal_Int32 nPara );
virtual sal_Bool SpellNextDocument();
virtual XubString GetUndoComment( sal_uInt16 nUndoId ) const;
// for text conversion
virtual sal_Bool ConvertNextDocument();
- virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos );
- virtual void FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos );
- virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos );
+ virtual void FieldSelected( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos );
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor );
- virtual Rectangle GetBulletArea( sal_uInt16 nPara );
+ virtual Rectangle GetBulletArea( sal_Int32 nPara );
- virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
// belongs into class Outliner, move there before incompatible update!
Link aOutlinerNotifyHdl;
diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx
index 0d3a2daeb3b6..940a77e6eb95 100644
--- a/editeng/source/outliner/outlin2.cxx
+++ b/editeng/source/outliner/outlin2.cxx
@@ -195,7 +195,7 @@ String Outliner::GetWordDelimiters() const
return pEditEngine->GetWordDelimiters();
}
-String Outliner::GetWord( sal_uInt16 nPara, sal_uInt16 nIndex )
+String Outliner::GetWord( sal_Int32 nPara, sal_uInt16 nIndex )
{
DBG_CHKTHIS(Outliner,0);
return pEditEngine->GetWord( nPara, nIndex );
@@ -279,7 +279,7 @@ Paragraph* Outliner::GetParent( Paragraph* pParagraph ) const
return pParaList->GetParent( pParagraph );
}
-sal_uLong Outliner::GetChildCount( Paragraph* pParent ) const
+sal_Int32 Outliner::GetChildCount( Paragraph* pParent ) const
{
DBG_CHKTHIS(Outliner,0);
return pParaList->GetChildCount( pParent );
@@ -309,10 +309,10 @@ SfxStyleSheetPool* Outliner::GetStyleSheetPool()
return pEditEngine->GetStyleSheetPool();
}
-SfxStyleSheet* Outliner::GetStyleSheet( sal_uLong nPara )
+SfxStyleSheet* Outliner::GetStyleSheet( sal_Int32 nPara )
{
DBG_CHKTHIS(Outliner,0);
- return pEditEngine->GetStyleSheet( (sal_uInt16)nPara );
+ return pEditEngine->GetStyleSheet( nPara );
}
sal_Bool Outliner::IsInSelectionMode() const
@@ -375,25 +375,25 @@ sal_Bool Outliner::IsInUndo()
return pEditEngine->IsInUndo();
}
-sal_uLong Outliner::GetLineCount( sal_uLong nParagraph ) const
+sal_uLong Outliner::GetLineCount( sal_Int32 nParagraph ) const
{
DBG_CHKTHIS(Outliner,0);
- return pEditEngine->GetLineCount( (sal_uInt16)nParagraph );
+ return pEditEngine->GetLineCount( nParagraph );
}
-sal_uInt16 Outliner::GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const
+sal_uInt16 Outliner::GetLineLen( sal_Int32 nParagraph, sal_uInt16 nLine ) const
{
DBG_CHKTHIS(Outliner,0);
- return pEditEngine->GetLineLen( (sal_uInt16)nParagraph, nLine );
+ return pEditEngine->GetLineLen( nParagraph, nLine );
}
-sal_uLong Outliner::GetLineHeight( sal_uLong nParagraph, sal_uLong nLine )
+sal_uLong Outliner::GetLineHeight( sal_Int32 nParagraph, sal_uInt16 nLine )
{
DBG_CHKTHIS(Outliner,0);
- return pEditEngine->GetLineHeight( (sal_uInt16)nParagraph, (sal_uInt16)nLine );
+ return pEditEngine->GetLineHeight( nParagraph, nLine );
}
-void Outliner::QuickRemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich )
+void Outliner::QuickRemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich )
{
DBG_CHKTHIS(Outliner,0);
pEditEngine->QuickRemoveCharAttribs( nPara, nWhich );
@@ -489,10 +489,10 @@ OutputDevice* Outliner::GetRefDevice() const
return pEditEngine->GetRefDevice();
}
-sal_uLong Outliner::GetTextHeight( sal_uLong nParagraph ) const
+sal_uLong Outliner::GetTextHeight( sal_Int32 nParagraph ) const
{
DBG_CHKTHIS(Outliner,0);
- return pEditEngine->GetTextHeight((sal_uInt16)nParagraph );
+ return pEditEngine->GetTextHeight(nParagraph );
}
Point Outliner::GetDocPos( const Point& rPaperPos ) const
@@ -501,10 +501,10 @@ Point Outliner::GetDocPos( const Point& rPaperPos ) const
return pEditEngine->GetDocPos( rPaperPos );
}
-Point Outliner::GetDocPosTopLeft( sal_uLong nParagraph )
+Point Outliner::GetDocPosTopLeft( sal_Int32 nParagraph )
{
DBG_CHKTHIS(Outliner,0);
- return pEditEngine->GetDocPosTopLeft( (sal_uInt16)nParagraph );
+ return pEditEngine->GetDocPosTopLeft( nParagraph );
}
sal_Bool Outliner::IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder )
@@ -521,7 +521,7 @@ sal_Bool Outliner::IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder, sal_Bo
if ( !bTextPos )
{
Point aDocPos = GetDocPos( rPaperPos );
- sal_uInt16 nPara = pEditEngine->FindParagraph( aDocPos.Y() );
+ sal_Int32 nPara = pEditEngine->FindParagraph( aDocPos.Y() );
if ( ( nPara != EE_PARA_NOT_FOUND ) && ImplHasBullet( nPara ) )
{
Rectangle aBulArea = ImpCalcBulletArea( nPara, sal_True, sal_True );
@@ -580,8 +580,8 @@ void Outliner::SetGlobalCharStretching( sal_uInt16 nX, sal_uInt16 nY )
DBG_CHKTHIS(Outliner,0);
// reset bullet size
- sal_uInt16 nParagraphs = (sal_uInt16)pParaList->GetParagraphCount();
- for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ )
+ sal_Int32 nParagraphs = pParaList->GetParagraphCount();
+ for ( sal_Int32 nPara = 0; nPara < nParagraphs; nPara++ )
{
Paragraph* pPara = pParaList->GetParagraph( nPara );
if ( pPara )
@@ -644,7 +644,7 @@ sal_uInt16 Outliner::GetScriptType( const ESelection& rSelection ) const
return pEditEngine->GetScriptType( rSelection );
}
-LanguageType Outliner::GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const
+LanguageType Outliner::GetLanguage( sal_Int32 nPara, sal_uInt16 nPos ) const
{
DBG_CHKTHIS(Outliner,0);
return pEditEngine->GetLanguage( nPara, nPos );
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 6ddec874ca97..25cbea95fcf6 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -76,7 +76,7 @@ void Outliner::ImplCheckDepth( sal_Int16& rnDepth ) const
rnDepth = nMaxDepth;
}
-Paragraph* Outliner::Insert(const XubString& rText, sal_uLong nAbsPos, sal_Int16 nDepth)
+Paragraph* Outliner::Insert(const XubString& rText, sal_Int32 nAbsPos, sal_Int16 nDepth)
{
DBG_CHKTHIS(Outliner,0);
DBG_ASSERT(pParaList->GetParagraphCount(),"Insert:No Paras");
@@ -85,7 +85,7 @@ Paragraph* Outliner::Insert(const XubString& rText, sal_uLong nAbsPos, sal_Int16
ImplCheckDepth( nDepth );
- sal_uLong nParagraphCount = pParaList->GetParagraphCount();
+ sal_Int32 nParagraphCount = pParaList->GetParagraphCount();
if( nAbsPos > nParagraphCount )
nAbsPos = nParagraphCount;
@@ -110,9 +110,9 @@ Paragraph* Outliner::Insert(const XubString& rText, sal_uLong nAbsPos, sal_Int16
ImplBlockInsertionCallbacks( sal_True );
pPara = new Paragraph( nDepth );
pParaList->Insert( pPara, nAbsPos );
- pEditEngine->InsertParagraph( (sal_uInt16)nAbsPos, String() );
+ pEditEngine->InsertParagraph( nAbsPos, String() );
DBG_ASSERT(pPara==pParaList->GetParagraph(nAbsPos),"Insert:Failed");
- ImplInitDepth( (sal_uInt16)nAbsPos, nDepth, sal_False );
+ ImplInitDepth( nAbsPos, nDepth, sal_False );
pHdlParagraph = pPara;
ParagraphInsertedHdl();
pPara->nFlags |= PARAFLAG_HOLDDEPTH;
@@ -126,7 +126,7 @@ Paragraph* Outliner::Insert(const XubString& rText, sal_uLong nAbsPos, sal_Int16
}
-void Outliner::ParagraphInserted( sal_uInt16 nPara )
+void Outliner::ParagraphInserted( sal_Int32 nPara )
{
DBG_CHKTHIS(Outliner,0);
@@ -164,7 +164,7 @@ void Outliner::ParagraphInserted( sal_uInt16 nPara )
}
}
-void Outliner::ParagraphDeleted( sal_uInt16 nPara )
+void Outliner::ParagraphDeleted( sal_Int32 nPara )
{
DBG_CHKTHIS(Outliner,0);
@@ -244,8 +244,8 @@ void Outliner::SetMaxDepth( sal_Int16 nDepth, sal_Bool bCheckParagraphs )
if( bCheckParagraphs )
{
- sal_uInt16 nParagraphs = (sal_uInt16)pParaList->GetParagraphCount();
- for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ )
+ sal_Int32 nParagraphs = pParaList->GetParagraphCount();
+ for ( sal_Int32 nPara = 0; nPara < nParagraphs; nPara++ )
{
Paragraph* pPara = pParaList->GetParagraph( nPara );
if( pPara && pPara->GetDepth() > nMaxDepth )
@@ -257,7 +257,7 @@ void Outliner::SetMaxDepth( sal_Int16 nDepth, sal_Bool bCheckParagraphs )
}
}
-sal_Int16 Outliner::GetDepth( sal_uLong nPara ) const
+sal_Int16 Outliner::GetDepth( sal_Int32 nPara ) const
{
Paragraph* pPara = pParaList->GetParagraph( nPara );
DBG_ASSERT( pPara, "Outliner::GetDepth - Paragraph not found!" );
@@ -276,7 +276,7 @@ void Outliner::SetDepth( Paragraph* pPara, sal_Int16 nNewDepth )
mnDepthChangeHdlPrevFlags = pPara->nFlags;
pHdlParagraph = pPara;
- sal_uInt16 nPara = (sal_uInt16)GetAbsPos( pPara );
+ sal_Int32 nPara = GetAbsPos( pPara );
ImplInitDepth( nPara, nNewDepth, sal_True );
ImplCalcBulletText( nPara, sal_False, sal_False );
@@ -287,14 +287,14 @@ void Outliner::SetDepth( Paragraph* pPara, sal_Int16 nNewDepth )
}
}
-sal_Int16 Outliner::GetNumberingStartValue( sal_uInt16 nPara )
+sal_Int16 Outliner::GetNumberingStartValue( sal_Int32 nPara )
{
Paragraph* pPara = pParaList->GetParagraph( nPara );
DBG_ASSERT( pPara, "Outliner::GetNumberingStartValue - Paragraph not found!" );
return pPara ? pPara->GetNumberingStartValue() : -1;
}
-void Outliner::SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingStartValue )
+void Outliner::SetNumberingStartValue( sal_Int32 nPara, sal_Int16 nNumberingStartValue )
{
Paragraph* pPara = pParaList->GetParagraph( nPara );
DBG_ASSERT( pPara, "Outliner::GetNumberingStartValue - Paragraph not found!" );
@@ -306,22 +306,19 @@ void Outliner::SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingSta
pPara->IsParaIsNumberingRestart(), pPara->IsParaIsNumberingRestart() ) );
pPara->SetNumberingStartValue( nNumberingStartValue );
- // #i100014#
- // It is not a good idea to substract 1 from a count and cast the result
- // to sal_uInt16 without check, if the count is 0.
- ImplCheckParagraphs( nPara, (sal_uInt16) (pParaList->GetParagraphCount()) );
+ ImplCheckParagraphs( nPara, pParaList->GetParagraphCount() );
pEditEngine->SetModified();
}
}
-sal_Bool Outliner::IsParaIsNumberingRestart( sal_uInt16 nPara )
+sal_Bool Outliner::IsParaIsNumberingRestart( sal_Int32 nPara )
{
Paragraph* pPara = pParaList->GetParagraph( nPara );
DBG_ASSERT( pPara, "Outliner::IsParaIsNumberingRestart - Paragraph not found!" );
return pPara ? pPara->IsParaIsNumberingRestart() : sal_False;
}
-void Outliner::SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumberingRestart )
+void Outliner::SetParaIsNumberingRestart( sal_Int32 nPara, sal_Bool bParaIsNumberingRestart )
{
Paragraph* pPara = pParaList->GetParagraph( nPara );
DBG_ASSERT( pPara, "Outliner::SetParaIsNumberingRestart - Paragraph not found!" );
@@ -333,22 +330,18 @@ void Outliner::SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumb
pPara->IsParaIsNumberingRestart(), bParaIsNumberingRestart ) );
pPara->SetParaIsNumberingRestart( bParaIsNumberingRestart );
- // #i100014#
- // It is not a good idea to substract 1 from a count and cast the result
- // to sal_uInt16 without check, if the count is 0.
- ImplCheckParagraphs( nPara, (sal_uInt16) (pParaList->GetParagraphCount()) );
+ ImplCheckParagraphs( nPara, pParaList->GetParagraphCount() );
pEditEngine->SetModified();
}
}
-OutlinerParaObject* Outliner::CreateParaObject( sal_uInt16 nStartPara, sal_uInt16 nCount ) const
+OutlinerParaObject* Outliner::CreateParaObject( sal_Int32 nStartPara, sal_Int32 nCount ) const
{
DBG_CHKTHIS(Outliner,0);
- if ( sal::static_int_cast< sal_uLong >( nStartPara + nCount ) >
- pParaList->GetParagraphCount() )
- nCount = sal::static_int_cast< sal_uInt16 >(
- pParaList->GetParagraphCount() - nStartPara );
+ if ( static_cast<sal_uLong>(nStartPara) + nCount >
+ static_cast<sal_uLong>(pParaList->GetParagraphCount()) )
+ nCount = pParaList->GetParagraphCount() - nStartPara;
// When a new OutlinerParaObject is created because a paragraph is just beeing deleted,
// it can happen that the ParaList is not updated yet...
@@ -361,9 +354,9 @@ OutlinerParaObject* Outliner::CreateParaObject( sal_uInt16 nStartPara, sal_uInt1
EditTextObject* pText = pEditEngine->CreateTextObject( nStartPara, nCount );
const bool bIsEditDoc(OUTLINERMODE_TEXTOBJECT == ImplGetOutlinerMode());
ParagraphDataVector aParagraphDataVector(nCount);
- const sal_uInt16 nLastPara(nStartPara + nCount - 1);
+ const sal_Int32 nLastPara(nStartPara + nCount - 1);
- for(sal_uInt16 nPara(nStartPara); nPara <= nLastPara; nPara++)
+ for(sal_Int32 nPara(nStartPara); nPara <= nLastPara; nPara++)
{
aParagraphDataVector[nPara-nStartPara] = *GetParagraph(nPara);
}
@@ -384,7 +377,7 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara )
pEditEngine->SetUpdateMode( sal_False );
ImplBlockInsertionCallbacks( sal_True );
- sal_uInt16 nPara = (sal_uInt16)pParaList->GetAbsPos( pPara );
+ sal_Int32 nPara = pParaList->GetAbsPos( pPara );
if( !rText.Len() )
{
@@ -400,7 +393,7 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara )
sal_uInt16 nCount = comphelper::string::getTokenCount(aText, '\x0A');
sal_uInt16 nPos = 0;
- sal_uInt16 nInsPos = nPara+1;
+ sal_Int32 nInsPos = nPara+1;
while( nCount > nPos )
{
XubString aStr = aText.GetToken( nPos, '\x0A' );
@@ -461,7 +454,7 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara )
// pView == 0 -> Ignore tabs
-bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView)
+bool Outliner::ImpConvertEdtToOut( sal_Int32 nPara,EditView* pView)
{
DBG_CHKTHIS(Outliner,0);
@@ -469,19 +462,19 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView)
sal_uInt16 nTabs = 0;
ESelection aDelSel;
-// const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( (sal_uInt16)nPara );
+// const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( nPara );
// bool bAlreadyOutliner = rAttrs.GetItemState( EE_PARA_OUTLLRSPACE ) == SFX_ITEM_ON ? true : false;
XubString aName;
XubString aHeading_US( RTL_CONSTASCII_USTRINGPARAM( "heading" ) );
XubString aNumber_US( RTL_CONSTASCII_USTRINGPARAM( "Numbering" ) );
- XubString aStr( pEditEngine->GetText( (sal_uInt16)nPara ) );
+ XubString aStr( pEditEngine->GetText( nPara ) );
sal_Unicode* pPtr = (sal_Unicode*)aStr.GetBuffer();
sal_uInt16 nHeadingNumberStart = 0;
sal_uInt16 nNumberingNumberStart = 0;
- SfxStyleSheet* pStyle= pEditEngine->GetStyleSheet( (sal_uInt16)nPara );
+ SfxStyleSheet* pStyle= pEditEngine->GetStyleSheet( nPara );
if( pStyle )
{
aName = pStyle->GetName();
@@ -499,7 +492,7 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView)
( pPtr[0] != '\t' ) && ( pPtr[1] == '\t' ) )
{
// Extract Bullet and Tab
- aDelSel = ESelection( (sal_uInt16)nPara, 0, (sal_uInt16)nPara, 2 );
+ aDelSel = ESelection( nPara, 0, nPara, 2 );
}
sal_uInt16 nPos = nHeadingNumberStart ? nHeadingNumberStart : nNumberingNumberStart;
@@ -519,7 +512,7 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView)
}
// Remove tabs from the text
if( nTabs )
- aDelSel = ESelection( (sal_uInt16)nPara, 0, (sal_uInt16)nPara, nTabs );
+ aDelSel = ESelection( nPara, 0, nPara, nTabs );
}
if ( aDelSel.HasRange() )
@@ -533,11 +526,11 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView)
pEditEngine->QuickDelete( aDelSel );
}
- const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( sal::static_int_cast< sal_uInt16 >(nPara), EE_PARA_OUTLLEVEL );
+ const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL );
sal_Int16 nOutlLevel = rLevel.GetValue();
ImplCheckDepth( nOutlLevel );
- ImplInitDepth( sal::static_int_cast< sal_uInt16 >(nPara), nOutlLevel, sal_False );
+ ImplInitDepth( nPara, nOutlLevel, sal_False );
return bConverted;
}
@@ -564,7 +557,7 @@ void Outliner::SetText( const OutlinerParaObject& rPObj )
bFirstParaIsEmpty = sal_False;
pParaList->Clear( sal_True );
- for( sal_uInt16 nCurPara = 0; nCurPara < rPObj.Count(); nCurPara++ )
+ for( sal_Int32 nCurPara = 0; nCurPara < rPObj.Count(); nCurPara++ )
{
Paragraph* pPara = new Paragraph( rPObj.GetParagraphData(nCurPara));
ImplCheckDepth( pPara->nDepth );
@@ -573,10 +566,7 @@ void Outliner::SetText( const OutlinerParaObject& rPObj )
ImplCheckNumBulletItem( nCurPara );
}
- // #i100014#
- // It is not a good idea to substract 1 from a count and cast the result
- // to sal_uInt16 without check, if the count is 0.
- ImplCheckParagraphs( 0, (sal_uInt16) (pParaList->GetParagraphCount()) );
+ ImplCheckParagraphs( 0, pParaList->GetParagraphCount() );
EnableUndo( bUndo );
ImplBlockInsertionCallbacks( sal_False );
@@ -595,7 +585,7 @@ void Outliner::AddText( const OutlinerParaObject& rPObj )
pEditEngine->SetUpdateMode( sal_False );
ImplBlockInsertionCallbacks( sal_True );
- sal_uLong nPara;
+ sal_Int32 nPara;
if( bFirstParaIsEmpty )
{
pParaList->Clear( sal_True );
@@ -609,26 +599,23 @@ void Outliner::AddText( const OutlinerParaObject& rPObj )
}
bFirstParaIsEmpty = sal_False;
- for( sal_uInt16 n = 0; n < rPObj.Count(); n++ )
+ for( sal_Int32 n = 0; n < rPObj.Count(); n++ )
{
pPara = new Paragraph( rPObj.GetParagraphData(n) );
pParaList->Append(pPara);
- sal_uInt16 nP = sal::static_int_cast< sal_uInt16 >(nPara+n);
+ sal_Int32 nP = nPara+n;
DBG_ASSERT(pParaList->GetAbsPos(pPara)==nP,"AddText:Out of sync");
ImplInitDepth( nP, pPara->GetDepth(), sal_False );
}
DBG_ASSERT( pEditEngine->GetParagraphCount()==pParaList->GetParagraphCount(), "SetText: OutOfSync" );
- // #i100014#
- // It is not a good idea to substract 1 from a count and cast the result
- // to sal_uInt16 without check, if the count is 0.
- ImplCheckParagraphs( (sal_uInt16)nPara, (sal_uInt16) (pParaList->GetParagraphCount()) );
+ ImplCheckParagraphs( nPara, pParaList->GetParagraphCount() );
ImplBlockInsertionCallbacks( sal_False );
pEditEngine->SetUpdateMode( bUpdate );
}
-void Outliner::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos )
+void Outliner::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos )
{
DBG_CHKTHIS(Outliner,0);
@@ -641,7 +628,7 @@ void Outliner::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, sal_u
}
-void Outliner::FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos )
+void Outliner::FieldSelected( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos )
{
DBG_CHKTHIS(Outliner,0);
if ( !aFieldClickedHdl.IsSet() )
@@ -653,7 +640,7 @@ void Outliner::FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, sal_
}
-XubString Outliner::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
+XubString Outliner::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
{
DBG_CHKTHIS(Outliner,0);
if ( !aCalcFieldValueHdl.IsSet() )
@@ -677,26 +664,26 @@ XubString Outliner::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara
return aFldInfo.GetRepresentation();
}
-void Outliner::SetStyleSheet( sal_uLong nPara, SfxStyleSheet* pStyle )
+void Outliner::SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle )
{
DBG_CHKTHIS(Outliner,0);
Paragraph* pPara = pParaList->GetParagraph( nPara );
if (pPara)
{
- pEditEngine->SetStyleSheet( (sal_uInt16)nPara, pStyle );
+ pEditEngine->SetStyleSheet( nPara, pStyle );
pPara->nFlags |= PARAFLAG_SETBULLETTEXT;
- ImplCheckNumBulletItem( (sal_uInt16) nPara );
+ ImplCheckNumBulletItem( nPara );
}
}
-void Outliner::ImplCheckNumBulletItem( sal_uInt16 nPara )
+void Outliner::ImplCheckNumBulletItem( sal_Int32 nPara )
{
Paragraph* pPara = pParaList->GetParagraph( nPara );
if (pPara)
pPara->aBulSize.Width() = -1;
}
-void Outliner::ImplSetLevelDependendStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pLevelStyle )
+void Outliner::ImplSetLevelDependendStyleSheet( sal_Int32 nPara, SfxStyleSheet* pLevelStyle )
{
DBG_CHKTHIS(Outliner,0);
@@ -731,7 +718,7 @@ void Outliner::ImplSetLevelDependendStyleSheet( sal_uInt16 nPara, SfxStyleSheet*
}
}
-void Outliner::ImplInitDepth( sal_uInt16 nPara, sal_Int16 nDepth, sal_Bool bCreateUndo, sal_Bool bUndoAction )
+void Outliner::ImplInitDepth( sal_Int32 nPara, sal_Int16 nDepth, sal_Bool bCreateUndo, sal_Bool bUndoAction )
{
DBG_CHKTHIS(Outliner,0);
@@ -771,7 +758,7 @@ void Outliner::ImplInitDepth( sal_uInt16 nPara, sal_Int16 nDepth, sal_Bool bCrea
}
}
-void Outliner::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet )
+void Outliner::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
{
DBG_CHKTHIS(Outliner,0);
@@ -791,7 +778,7 @@ sal_Bool Outliner::Expand( Paragraph* pPara )
UndoActionStart( OLUNDO_EXPAND );
pUndo = new OLUndoExpand( this, OLUNDO_EXPAND );
pUndo->pParas = 0;
- pUndo->nCount = (sal_uInt16)pParaList->GetAbsPos( pPara );
+ pUndo->nCount = pParaList->GetAbsPos( pPara );
}
pHdlParagraph = pPara;
bIsExpanding = sal_True;
@@ -824,7 +811,7 @@ sal_Bool Outliner::Collapse( Paragraph* pPara )
UndoActionStart( OLUNDO_COLLAPSE );
pUndo = new OLUndoExpand( this, OLUNDO_COLLAPSE );
pUndo->pParas = 0;
- pUndo->nCount = (sal_uInt16)pParaList->GetAbsPos( pPara );
+ pUndo->nCount = pParaList->GetAbsPos( pPara );
}
pHdlParagraph = pPara;
@@ -843,7 +830,7 @@ sal_Bool Outliner::Collapse( Paragraph* pPara )
}
-Font Outliner::ImpCalcBulletFont( sal_uInt16 nPara ) const
+Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const
{
const SvxNumberFormat* pFmt = GetNumberFormat( nPara );
DBG_ASSERT( pFmt && ( pFmt->GetNumberingType() != SVX_NUM_BITMAP ) && ( pFmt->GetNumberingType() != SVX_NUM_NUMBER_NONE ), "ImpCalcBulletFont: Missing or BitmapBullet!" );
@@ -902,7 +889,7 @@ Font Outliner::ImpCalcBulletFont( sal_uInt16 nPara ) const
return aBulletFont;
}
-void Outliner::PaintBullet( sal_uInt16 nPara, const Point& rStartPos,
+void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
const Point& rOrigin, short nOrientation, OutputDevice* pOutDev )
{
DBG_CHKTHIS(Outliner,0);
@@ -1089,15 +1076,15 @@ void Outliner::PaintBullet( sal_uInt16 nPara, const Point& rStartPos,
}
}
-void Outliner::InvalidateBullet( Paragraph* /*pPara*/, sal_uLong nPara )
+void Outliner::InvalidateBullet( Paragraph* /*pPara*/, sal_Int32 nPara )
{
DBG_CHKTHIS(Outliner,0);
- long nLineHeight = (long)pEditEngine->GetLineHeight((sal_uInt16)nPara );
+ long nLineHeight = (long)pEditEngine->GetLineHeight(nPara );
for ( size_t i = 0, n = aViewList.size(); i < n; ++i )
{
OutlinerView* pView = aViewList[ i ];
- Point aPos( pView->pEditView->GetWindowPosTopLeft((sal_uInt16)nPara ) );
+ Point aPos( pView->pEditView->GetWindowPosTopLeft(nPara ) );
Rectangle aRect( pView->GetOutputArea() );
aRect.Right() = aPos.X();
aRect.Top() = aPos.Y();
@@ -1125,10 +1112,9 @@ sal_uLong Outliner::Read( SvStream& rInput, const String& rBaseURL, sal_uInt16 e
bFirstParaIsEmpty = sal_False;
- sal_uInt16 nParas = pEditEngine->GetParagraphCount();
+ sal_Int32 nParas = pEditEngine->GetParagraphCount();
pParaList->Clear( sal_True );
- sal_uInt16 n;
- for ( n = 0; n < nParas; n++ )
+ for ( sal_Int32 n = 0; n < nParas; n++ )
{
Paragraph* pPara = new Paragraph( 0 );
pParaList->Append(pPara);
@@ -1155,7 +1141,7 @@ sal_uLong Outliner::Read( SvStream& rInput, const String& rBaseURL, sal_uInt16 e
}
-void Outliner::ImpFilterIndents( sal_uLong nFirstPara, sal_uLong nLastPara )
+void Outliner::ImpFilterIndents( sal_Int32 nFirstPara, sal_Int32 nLastPara )
{
DBG_CHKTHIS(Outliner,0);
@@ -1163,7 +1149,7 @@ void Outliner::ImpFilterIndents( sal_uLong nFirstPara, sal_uLong nLastPara )
pEditEngine->SetUpdateMode( sal_False );
Paragraph* pLastConverted = NULL;
- for( sal_uLong nPara = nFirstPara; nPara <= nLastPara; nPara++ )
+ for( sal_Int32 nPara = nFirstPara; nPara <= nLastPara; nPara++ )
{
Paragraph* pPara = pParaList->GetParagraph( nPara );
if (pPara)
@@ -1178,7 +1164,7 @@ void Outliner::ImpFilterIndents( sal_uLong nFirstPara, sal_uLong nLastPara )
pPara->SetDepth( pLastConverted->GetDepth() );
}
- ImplInitDepth( (sal_uInt16)nPara, pPara->GetDepth(), sal_False );
+ ImplInitDepth( nPara, pPara->GetDepth(), sal_False );
}
}
@@ -1191,14 +1177,14 @@ void Outliner::ImpFilterIndents( sal_uLong nFirstPara, sal_uLong nLastPara )
return pEditEngine->GetUndoManager();
}
-void Outliner::ImpTextPasted( sal_uLong nStartPara, sal_uInt16 nCount )
+void Outliner::ImpTextPasted( sal_Int32 nStartPara, sal_Int32 nCount )
{
DBG_CHKTHIS(Outliner,0);
sal_Bool bUpdate = pEditEngine->GetUpdateMode();
pEditEngine->SetUpdateMode( sal_False );
- const sal_uLong nStart = nStartPara;
+ const sal_Int32 nStart = nStartPara;
Paragraph* pPara = pParaList->GetParagraph( nStartPara );
@@ -1223,14 +1209,14 @@ void Outliner::ImpTextPasted( sal_uLong nStartPara, sal_uInt16 nCount )
else // EditEngine mode
{
sal_Int16 nDepth = -1;
- const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( (sal_uInt16)nStartPara );
+ const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( nStartPara );
if ( rAttrs.GetItemState( EE_PARA_OUTLLEVEL ) == SFX_ITEM_ON )
{
const SfxInt16Item& rLevel = (const SfxInt16Item&) rAttrs.Get( EE_PARA_OUTLLEVEL );
nDepth = rLevel.GetValue();
}
if ( nDepth != GetDepth( nStartPara ) )
- ImplInitDepth( (sal_uInt16)nStartPara, nDepth, sal_False );
+ ImplInitDepth( nStartPara, nDepth, sal_False );
}
nCount--;
@@ -1407,20 +1393,20 @@ void Outliner::DepthChangedHdl()
}
-sal_uLong Outliner::GetAbsPos( Paragraph* pPara )
+sal_Int32 Outliner::GetAbsPos( Paragraph* pPara )
{
DBG_CHKTHIS(Outliner,0);
DBG_ASSERT(pPara,"GetAbsPos:No Para");
return pParaList->GetAbsPos( pPara );
}
-sal_uLong Outliner::GetParagraphCount() const
+sal_Int32 Outliner::GetParagraphCount() const
{
DBG_CHKTHIS(Outliner,0);
return pParaList->GetParagraphCount();
}
-Paragraph* Outliner::GetParagraph( sal_uLong nAbsPos ) const
+Paragraph* Outliner::GetParagraph( sal_Int32 nAbsPos ) const
{
DBG_CHKTHIS(Outliner,0);
return pParaList->GetParagraph( nAbsPos );
@@ -1432,12 +1418,12 @@ sal_Bool Outliner::HasChildren( Paragraph* pParagraph ) const
return pParaList->HasChildren( pParagraph );
}
-sal_Bool Outliner::ImplHasBullet( sal_uInt16 nPara ) const
+sal_Bool Outliner::ImplHasBullet( sal_Int32 nPara ) const
{
return GetNumberFormat(nPara) != 0;
}
-const SvxNumberFormat* Outliner::GetNumberFormat( sal_uInt16 nPara ) const
+const SvxNumberFormat* Outliner::GetNumberFormat( sal_Int32 nPara ) const
{
const SvxNumberFormat* pFmt = NULL;
@@ -1457,7 +1443,7 @@ const SvxNumberFormat* Outliner::GetNumberFormat( sal_uInt16 nPara ) const
return pFmt;
}
-Size Outliner::ImplGetBulletSize( sal_uInt16 nPara )
+Size Outliner::ImplGetBulletSize( sal_Int32 nPara )
{
Paragraph* pPara = pParaList->GetParagraph( nPara );
if (!pPara)
@@ -1492,13 +1478,11 @@ Size Outliner::ImplGetBulletSize( sal_uInt16 nPara )
return pPara->aBulSize;
}
-void Outliner::ImplCheckParagraphs( sal_uInt16 nStart, sal_uInt16 nEnd )
+void Outliner::ImplCheckParagraphs( sal_Int32 nStart, sal_Int32 nEnd )
{
DBG_CHKTHIS( Outliner, 0 );
- // i100014#
- // assure that the following for-loop does not loop forever
- for ( sal_uInt16 n = nStart; n < nEnd; n++ )
+ for ( sal_Int32 n = nStart; n < nEnd; n++ )
{
Paragraph* pPara = pParaList->GetParagraph( n );
if (pPara)
@@ -1513,14 +1497,14 @@ void Outliner::SetRefDevice( OutputDevice* pRefDev )
{
DBG_CHKTHIS(Outliner,0);
pEditEngine->SetRefDevice( pRefDev );
- for ( sal_uInt16 n = (sal_uInt16) pParaList->GetParagraphCount(); n; )
+ for ( sal_Int32 n = pParaList->GetParagraphCount(); n; )
{
Paragraph* pPara = pParaList->GetParagraph( --n );
pPara->Invalidate();
}
}
-void Outliner::ParaAttribsChanged( sal_uInt16 nPara )
+void Outliner::ParaAttribsChanged( sal_Int32 nPara )
{
DBG_CHKTHIS(Outliner,0);
@@ -1551,8 +1535,8 @@ void Outliner::StyleSheetChanged( SfxStyleSheet* pStyle )
// Here all the paragraphs, which had the said template, used to be
// hunted by a ImpRecalcParaAttribs, why?
// => only the Bullet-representation can really change...
- sal_uInt16 nParas = (sal_uInt16)pParaList->GetParagraphCount();
- for( sal_uInt16 nPara = 0; nPara < nParas; nPara++ )
+ sal_Int32 nParas = pParaList->GetParagraphCount();
+ for( sal_Int32 nPara = 0; nPara < nParas; nPara++ )
{
if ( pEditEngine->GetStyleSheet( nPara ) == pStyle )
{
@@ -1565,7 +1549,7 @@ void Outliner::StyleSheetChanged( SfxStyleSheet* pStyle )
}
}
-Rectangle Outliner::ImpCalcBulletArea( sal_uInt16 nPara, sal_Bool bAdjust, sal_Bool bReturnPaperPos )
+Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, sal_Bool bAdjust, sal_Bool bReturnPaperPos )
{
// Bullet area within the paragraph ...
Rectangle aBulletArea;
@@ -1673,7 +1657,7 @@ void Outliner::ExpandHdl()
aExpandHdl.Call( this );
}
-EBulletInfo Outliner::GetBulletInfo( sal_uInt16 nPara )
+EBulletInfo Outliner::GetBulletInfo( sal_Int32 nPara )
{
EBulletInfo aInfo;
@@ -1706,34 +1690,34 @@ EBulletInfo Outliner::GetBulletInfo( sal_uInt16 nPara )
return aInfo;
}
-XubString Outliner::GetText( Paragraph* pParagraph, sal_uLong nCount ) const
+XubString Outliner::GetText( Paragraph* pParagraph, sal_Int32 nCount ) const
{
DBG_CHKTHIS(Outliner,0);
XubString aText;
- sal_uInt16 nStartPara = (sal_uInt16) pParaList->GetAbsPos( pParagraph );
- for ( sal_uInt16 n = 0; n < nCount; n++ )
+ sal_Int32 nStartPara = pParaList->GetAbsPos( pParagraph );
+ for ( sal_Int32 n = 0; n < nCount; n++ )
{
aText += pEditEngine->GetText( nStartPara + n );
- if ( (n+1) < (sal_uInt16)nCount )
+ if ( (n+1) < nCount )
aText += '\n';
}
return aText;
}
-void Outliner::Remove( Paragraph* pPara, sal_uLong nParaCount )
+void Outliner::Remove( Paragraph* pPara, sal_Int32 nParaCount )
{
DBG_CHKTHIS(Outliner,0);
- sal_uLong nPos = pParaList->GetAbsPos( pPara );
+ sal_Int32 nPos = pParaList->GetAbsPos( pPara );
if( !nPos && ( nParaCount >= pParaList->GetParagraphCount() ) )
{
Clear();
}
else
{
- for( sal_uInt16 n = 0; n < (sal_uInt16)nParaCount; n++ )
- pEditEngine->RemoveParagraph( (sal_uInt16) nPos );
+ for( sal_Int32 n = 0; n < nParaCount; n++ )
+ pEditEngine->RemoveParagraph( nPos );
}
}
@@ -1746,7 +1730,7 @@ void Outliner::StripPortions()
}
void Outliner::DrawingText( const Point& rStartPos, const XubString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray,const SvxFont& rFont,
- sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft,
+ sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -1768,7 +1752,7 @@ void Outliner::DrawingText( const Point& rStartPos, const XubString& rText, sal_
}
void Outliner::DrawingTab( const Point& rStartPos, long nWidth, const String& rChar, const SvxFont& rFont,
- sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft, bool bEndOfLine, bool bEndOfParagraph,
+ sal_Int32 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft, bool bEndOfLine, bool bEndOfParagraph,
const Color& rOverlineColor, const Color& rTextLineColor)
{
if(aDrawPortionHdl.IsSet())
@@ -1786,7 +1770,7 @@ long Outliner::RemovingPagesHdl( OutlinerView* pView )
return aRemovingPagesHdl.IsSet() ? aRemovingPagesHdl.Call( pView ) : sal_True;
}
-sal_Bool Outliner::ImpCanDeleteSelectedPages( OutlinerView* pCurView, sal_uInt16 _nFirstPage, sal_uInt16 nPages )
+sal_Bool Outliner::ImpCanDeleteSelectedPages( OutlinerView* pCurView, sal_Int32 _nFirstPage, sal_Int32 nPages )
{
DBG_CHKTHIS(Outliner,0);
@@ -1796,7 +1780,7 @@ sal_Bool Outliner::ImpCanDeleteSelectedPages( OutlinerView* pCurView, sal_uInt16
return (sal_Bool)RemovingPagesHdl( pCurView );
}
-SfxItemSet Outliner::GetParaAttribs( sal_uInt16 nPara )
+SfxItemSet Outliner::GetParaAttribs( sal_Int32 nPara )
{
DBG_CHKTHIS(Outliner,0);
return pEditEngine->GetParaAttribs( nPara );
@@ -1806,8 +1790,8 @@ IMPL_LINK( Outliner, ParaVisibleStateChangedHdl, Paragraph*, pPara )
{
DBG_CHKTHIS(Outliner,0);
- sal_uLong nPara = pParaList->GetAbsPos( pPara );
- pEditEngine->ShowParagraph( (sal_uInt16)nPara, pPara->IsVisible() );
+ sal_Int32 nPara = pParaList->GetAbsPos( pPara );
+ pEditEngine->ShowParagraph( nPara, pPara->IsVisible() );
return 0;
}
@@ -1843,9 +1827,9 @@ IMPL_LINK( Outliner, EndMovingParagraphsHdl, MoveParagraphsInfo*, pInfos )
DBG_CHKTHIS(Outliner,0);
pParaList->MoveParagraphs( pInfos->nStartPara, pInfos->nDestPara, pInfos->nEndPara - pInfos->nStartPara + 1 );
- sal_uInt16 nChangesStart = Min( pInfos->nStartPara, pInfos->nDestPara );
- sal_uInt16 nParas = (sal_uInt16)pParaList->GetParagraphCount();
- for ( sal_uInt16 n = nChangesStart; n < nParas; n++ )
+ sal_Int32 nChangesStart = std::min( pInfos->nStartPara, pInfos->nDestPara );
+ sal_Int32 nParas = pParaList->GetParagraphCount();
+ for ( sal_Int32 n = nChangesStart; n < nParas; n++ )
ImplCalcBulletText( n, sal_False, sal_False );
if( !IsInUndo() )
@@ -1868,7 +1852,7 @@ static bool isSameNumbering( const SvxNumberFormat& rN1, const SvxNumberFormat&
return true;
}
-sal_uInt16 Outliner::ImplGetNumbering( sal_uInt16 nPara, const SvxNumberFormat* pParaFmt )
+sal_uInt16 Outliner::ImplGetNumbering( sal_Int32 nPara, const SvxNumberFormat* pParaFmt )
{
sal_uInt16 nNumber = pParaFmt->GetStart() - 1;
@@ -1916,12 +1900,11 @@ sal_uInt16 Outliner::ImplGetNumbering( sal_uInt16 nPara, const SvxNumberFormat*
return nNumber;
}
-void Outliner::ImplCalcBulletText( sal_uInt16 nPara, sal_Bool bRecalcLevel, sal_Bool bRecalcChildren )
+void Outliner::ImplCalcBulletText( sal_Int32 nPara, sal_Bool bRecalcLevel, sal_Bool bRecalcChildren )
{
DBG_CHKTHIS(Outliner,0);
Paragraph* pPara = pParaList->GetParagraph( nPara );
- sal_uInt16 nRelPos = 0xFFFF;
while ( pPara )
{
@@ -1948,9 +1931,6 @@ void Outliner::ImplCalcBulletText( sal_uInt16 nPara, sal_Bool bRecalcLevel, sal_
if ( bRecalcLevel )
{
- if ( nRelPos != 0xFFFF )
- nRelPos++;
-
sal_Int16 nDepth = pPara->GetDepth();
pPara = pParaList->GetParagraph( ++nPara );
if ( !bRecalcChildren )
@@ -1996,14 +1976,14 @@ void Outliner::SetFlatMode( sal_Bool bFlat )
if( bFlat != pEditEngine->IsFlatMode() )
{
- for ( sal_uInt16 nPara = (sal_uInt16)pParaList->GetParagraphCount(); nPara; )
+ for ( sal_Int32 nPara = pParaList->GetParagraphCount(); nPara; )
pParaList->GetParagraph( --nPara )->aBulSize.Width() = -1;
pEditEngine->SetFlatMode( bFlat );
}
}
-String Outliner::ImplGetBulletText( sal_uInt16 nPara )
+String Outliner::ImplGetBulletText( sal_Int32 nPara )
{
String aRes;
Paragraph* pPara = pParaList->GetParagraph( nPara );
@@ -2018,7 +1998,7 @@ String Outliner::ImplGetBulletText( sal_uInt16 nPara )
}
// this is needed for StarOffice Api
-void Outliner::SetLevelDependendStyleSheet( sal_uInt16 nPara )
+void Outliner::SetLevelDependendStyleSheet( sal_Int32 nPara )
{
SfxItemSet aOldAttrs( pEditEngine->GetParaAttribs( nPara ) );
ImplSetLevelDependendStyleSheet( nPara );
@@ -2088,7 +2068,7 @@ void Outliner::SetParaFlag( Paragraph* pPara, sal_uInt16 nFlag )
if( pPara && !pPara->HasFlag( nFlag ) )
{
if( IsUndoEnabled() && !IsInUndo() )
- InsertUndo( new OutlinerUndoChangeParaFlags( this, (sal_uInt16)GetAbsPos( pPara ), pPara->nFlags, pPara->nFlags|nFlag ) );
+ InsertUndo( new OutlinerUndoChangeParaFlags( this, GetAbsPos( pPara ), pPara->nFlags, pPara->nFlags|nFlag ) );
pPara->SetFlag( nFlag );
}
diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx
index dc39bd608738..46116162d3b6 100644
--- a/editeng/source/outliner/outlobj.cxx
+++ b/editeng/source/outliner/outlobj.cxx
@@ -184,14 +184,20 @@ void OutlinerParaObject::SetVertical(bool bNew)
}
}
-sal_uInt32 OutlinerParaObject::Count() const
+sal_Int32 OutlinerParaObject::Count() const
{
- return mpImplOutlinerParaObject->maParagraphDataVector.size();
+ size_t nSize = mpImplOutlinerParaObject->maParagraphDataVector.size();
+ if (nSize > EE_PARA_MAX_COUNT)
+ {
+ SAL_WARN( "editeng", "OutlinerParaObject::Count - overflow " << nSize);
+ return EE_PARA_MAX_COUNT;
+ }
+ return static_cast<sal_Int32>(nSize);
}
-sal_Int16 OutlinerParaObject::GetDepth(sal_uInt16 nPara) const
+sal_Int16 OutlinerParaObject::GetDepth(sal_Int32 nPara) const
{
- if(nPara < mpImplOutlinerParaObject->maParagraphDataVector.size())
+ if(0 <= nPara && static_cast<size_t>(nPara) < mpImplOutlinerParaObject->maParagraphDataVector.size())
{
return mpImplOutlinerParaObject->maParagraphDataVector[nPara].getDepth();
}
@@ -211,9 +217,9 @@ bool OutlinerParaObject::IsEditDoc() const
return mpImplOutlinerParaObject->mbIsEditDoc;
}
-const ParagraphData& OutlinerParaObject::GetParagraphData(sal_uInt32 nIndex) const
+const ParagraphData& OutlinerParaObject::GetParagraphData(sal_Int32 nIndex) const
{
- if(nIndex < mpImplOutlinerParaObject->maParagraphDataVector.size())
+ if(0 <= nIndex && static_cast<size_t>(nIndex) < mpImplOutlinerParaObject->maParagraphDataVector.size())
{
return mpImplOutlinerParaObject->maParagraphDataVector[nIndex];
}
@@ -248,12 +254,12 @@ void OutlinerParaObject::ChangeStyleSheetName(SfxStyleFamily eFamily,
void OutlinerParaObject::SetStyleSheets(sal_uInt16 nLevel, const OUString rNewName,
const SfxStyleFamily& rNewFamily)
{
- const sal_uInt32 nCount(mpImplOutlinerParaObject->maParagraphDataVector.size());
+ const sal_Int32 nCount(Count());
if(nCount)
{
ImplMakeUnique();
- sal_uInt16 nDecrementer(sal::static_int_cast< sal_uInt16 >(nCount));
+ sal_Int32 nDecrementer(nCount);
for(;nDecrementer;)
{
diff --git a/editeng/source/outliner/outlundo.cxx b/editeng/source/outliner/outlundo.cxx
index 0bf8cfb3e5d1..42d8d0748c5e 100644
--- a/editeng/source/outliner/outlundo.cxx
+++ b/editeng/source/outliner/outlundo.cxx
@@ -38,7 +38,7 @@ OutlinerUndoBase::OutlinerUndoBase( sal_uInt16 _nId, Outliner* pOutliner )
mpOutliner = pOutliner;
}
-OutlinerUndoChangeParaFlags::OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_uInt16 nPara, sal_uInt16 nOldFlags, sal_uInt16 nNewFlags )
+OutlinerUndoChangeParaFlags::OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_Int32 nPara, sal_uInt16 nOldFlags, sal_uInt16 nNewFlags )
: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner )
{
mnPara = nPara;
@@ -71,7 +71,7 @@ void OutlinerUndoChangeParaFlags::ImplChangeFlags( sal_uInt16 nFlags )
}
}
-OutlinerUndoChangeParaNumberingRestart::OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_uInt16 nPara,
+OutlinerUndoChangeParaNumberingRestart::OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_Int32 nPara,
sal_Int16 nOldNumberingStartValue, sal_Int16 nNewNumberingStartValue,
sal_Bool bOldParaIsNumberingRestart, sal_Bool bNewParaIsNumberingRestart )
: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner )
@@ -101,7 +101,7 @@ void OutlinerUndoChangeParaNumberingRestart::ImplApplyData( const ParaRestartDat
pOutliner->SetParaIsNumberingRestart( mnPara, rData.mbParaIsNumberingRestart );
}
-OutlinerUndoChangeDepth::OutlinerUndoChangeDepth( Outliner* pOutliner, sal_uInt16 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth )
+OutlinerUndoChangeDepth::OutlinerUndoChangeDepth( Outliner* pOutliner, sal_Int32 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth )
: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner )
{
mnPara = nPara;
@@ -125,7 +125,7 @@ void OutlinerUndoChangeDepth::Repeat()
}
-OutlinerUndoCheckPara::OutlinerUndoCheckPara( Outliner* pOutliner, sal_uInt16 nPara )
+OutlinerUndoCheckPara::OutlinerUndoCheckPara( Outliner* pOutliner, sal_Int32 nPara )
: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner )
{
mnPara = nPara;
@@ -183,7 +183,7 @@ void OLUndoExpand::Restore( sal_Bool bUndo )
bExpand = sal_True;
if( !pParas )
{
- pPara = pOutliner->GetParagraph( (sal_uLong)nCount );
+ pPara = pOutliner->GetParagraph( nCount );
if( bExpand )
pOutliner->Expand( pPara );
else
@@ -191,9 +191,9 @@ void OLUndoExpand::Restore( sal_Bool bUndo )
}
else
{
- for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++ )
+ for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ )
{
- pPara = pOutliner->GetParagraph( (sal_uLong)(pParas[nIdx]) );
+ pPara = pOutliner->GetParagraph( pParas[nIdx] );
if( bExpand )
pOutliner->Expand( pPara );
else
diff --git a/editeng/source/outliner/outlundo.hxx b/editeng/source/outliner/outlundo.hxx
index 7a901509c78e..c0c38c672fdc 100644
--- a/editeng/source/outliner/outlundo.hxx
+++ b/editeng/source/outliner/outlundo.hxx
@@ -38,14 +38,14 @@ public:
class OutlinerUndoChangeParaFlags : public OutlinerUndoBase
{
private:
- sal_uInt16 mnPara;
+ sal_Int32 mnPara;
sal_uInt16 mnOldFlags;
sal_uInt16 mnNewFlags;
void ImplChangeFlags( sal_uInt16 nFlags );
public:
- OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_uInt16 nPara, sal_uInt16 nOldDepth, sal_uInt16 nNewDepth );
+ OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_Int32 nPara, sal_uInt16 nOldDepth, sal_uInt16 nNewDepth );
virtual void Undo();
virtual void Redo();
@@ -54,7 +54,7 @@ public:
class OutlinerUndoChangeParaNumberingRestart : public OutlinerUndoBase
{
private:
- sal_uInt16 mnPara;
+ sal_Int32 mnPara;
struct ParaRestartData
{
@@ -67,7 +67,7 @@ private:
void ImplApplyData( const ParaRestartData& rData );
public:
- OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_uInt16 nPara,
+ OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_Int32 nPara,
sal_Int16 nOldNumberingStartValue, sal_Int16 mnNewNumberingStartValue,
sal_Bool nOldbParaIsNumberingRestart, sal_Bool nbNewParaIsNumberingRestart );
@@ -79,12 +79,12 @@ class OutlinerUndoChangeDepth : public OutlinerUndoBase
{
using SfxUndoAction::Repeat;
private:
- sal_uInt16 mnPara;
+ sal_Int32 mnPara;
sal_Int16 mnOldDepth;
sal_Int16 mnNewDepth;
public:
- OutlinerUndoChangeDepth( Outliner* pOutliner, sal_uInt16 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth );
+ OutlinerUndoChangeDepth( Outliner* pOutliner, sal_Int32 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth );
virtual void Undo();
virtual void Redo();
@@ -98,10 +98,10 @@ class OutlinerUndoCheckPara : public OutlinerUndoBase
{
using SfxUndoAction::Repeat;
private:
- sal_uInt16 mnPara;
+ sal_Int32 mnPara;
public:
- OutlinerUndoCheckPara( Outliner* pOutliner, sal_uInt16 nPara );
+ OutlinerUndoCheckPara( Outliner* pOutliner, sal_Int32 nPara );
virtual void Undo();
virtual void Redo();
@@ -126,7 +126,7 @@ public:
sal_uInt16* pParas; // 0 == nCount contains paragraph number
Outliner* pOutliner;
- sal_uInt16 nCount;
+ sal_Int32 nCount;
};
#endif
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index eb3f877fcde6..2345eaeec5a9 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -207,17 +207,21 @@ sal_Bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin )
if( !bSelection &&
aSel.nEndPos == pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) )
{
- sal_uLong nChildren = pOwner->pParaList->GetChildCount(pPara);
+ sal_Int32 nChildren = pOwner->pParaList->GetChildCount(pPara);
if( nChildren && !pOwner->pParaList->HasVisibleChildren(pPara))
{
pOwner->UndoActionStart( OLUNDO_INSERT );
- sal_uLong nTemp = aSel.nEndPara;
+ sal_Int32 nTemp = aSel.nEndPara;
nTemp += nChildren;
nTemp++; // insert above next Non-Child
- pOwner->Insert( String(),nTemp,pPara->GetDepth());
- // Position the cursor
- ESelection aTmpSel((sal_uInt16)nTemp,0,(sal_uInt16)nTemp,0);
- pEditView->SetSelection( aTmpSel );
+ SAL_WARN_IF( nTemp < 0, "editeng", "OutlinerView::PostKeyEvent - overflow");
+ if (nTemp >= 0)
+ {
+ pOwner->Insert( String(),nTemp,pPara->GetDepth());
+ // Position the cursor
+ ESelection aTmpSel(nTemp,0,nTemp,0);
+ pEditView->SetSelection( aTmpSel );
+ }
pEditView->ShowCursor( sal_True, sal_True );
pOwner->UndoActionEnd( OLUNDO_INSERT );
bKeyProcessed = sal_True;
@@ -229,12 +233,12 @@ sal_Bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin )
( aSel.nEndPos == pOwner->pEditEngine->GetTextLen(aSel.nEndPara) ) )
{
pOwner->UndoActionStart( OLUNDO_INSERT );
- sal_uLong nTemp = aSel.nEndPara;
+ sal_Int32 nTemp = aSel.nEndPara;
nTemp++;
pOwner->Insert( String(), nTemp, pPara->GetDepth()+1 );
// Position the cursor
- ESelection aTmpSel((sal_uInt16)nTemp,0,(sal_uInt16)nTemp,0);
+ ESelection aTmpSel(nTemp,0,nTemp,0);
pEditView->SetSelection( aTmpSel );
pEditView->ShowCursor( sal_True, sal_True );
pOwner->UndoActionEnd( OLUNDO_INSERT );
@@ -251,10 +255,10 @@ sal_Bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin )
}
-sal_uLong OutlinerView::ImpCheckMousePos(const Point& rPosPix, MouseTarget& reTarget)
+sal_Int32 OutlinerView::ImpCheckMousePos(const Point& rPosPix, MouseTarget& reTarget)
{
DBG_CHKTHIS(OutlinerView,0);
- sal_uLong nPara = EE_PARA_NOT_FOUND;
+ sal_Int32 nPara = EE_PARA_NOT_FOUND;
Point aMousePosWin = pEditView->GetWindow()->PixelToLogic( rPosPix );
if( !pEditView->GetOutputArea().IsInside( aMousePosWin ) )
@@ -326,18 +330,18 @@ sal_Bool OutlinerView::MouseButtonDown( const MouseEvent& rMEvt )
pEditView->GetWindow()->SetPointer( aPointer );
MouseTarget eTarget;
- sal_uLong nPara = ImpCheckMousePos( rMEvt.GetPosPixel(), eTarget );
+ sal_Int32 nPara = ImpCheckMousePos( rMEvt.GetPosPixel(), eTarget );
if ( eTarget == MouseBullet )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
sal_Bool bHasChildren = (pPara && pOwner->pParaList->HasChildren(pPara));
if( rMEvt.GetClicks() == 1 )
{
- sal_uLong nEndPara = nPara;
+ sal_Int32 nEndPara = nPara;
if ( bHasChildren && pOwner->pParaList->HasVisibleChildren(pPara) )
nEndPara += pOwner->pParaList->GetChildCount( pPara );
// The selection is inverted, so that EditEngine does not scroll
- ESelection aSel((sal_uInt16)nEndPara, 0xffff,(sal_uInt16)nPara, 0 );
+ ESelection aSel(nEndPara, EE_TEXTPOS_ALL, nPara, 0 );
pEditView->SetSelection( aSel );
}
else if( rMEvt.GetClicks() == 2 && bHasChildren )
@@ -383,27 +387,27 @@ void OutlinerView::ImpToggleExpand( Paragraph* pPara )
{
DBG_CHKTHIS(OutlinerView,0);
- sal_uInt16 nPara = (sal_uInt16) pOwner->pParaList->GetAbsPos( pPara );
+ sal_Int32 nPara = pOwner->pParaList->GetAbsPos( pPara );
pEditView->SetSelection( ESelection( nPara, 0, nPara, 0 ) );
ImplExpandOrCollaps( nPara, nPara, !pOwner->pParaList->HasVisibleChildren( pPara ) );
pEditView->ShowCursor();
}
-sal_uLong OutlinerView::Select( Paragraph* pParagraph, sal_Bool bSelect,
+sal_Int32 OutlinerView::Select( Paragraph* pParagraph, sal_Bool bSelect,
sal_Bool bWithChildren )
{
DBG_CHKTHIS(OutlinerView,0);
- sal_uLong nPara = pOwner->pParaList->GetAbsPos( pParagraph );
+ sal_Int32 nPara = pOwner->pParaList->GetAbsPos( pParagraph );
sal_uInt16 nEnd = 0;
if ( bSelect )
nEnd = 0xffff;
- sal_uLong nChildCount = 0;
+ sal_Int32 nChildCount = 0;
if ( bWithChildren )
nChildCount = pOwner->pParaList->GetChildCount( pParagraph );
- ESelection aSel( (sal_uInt16)nPara, 0,(sal_uInt16)(nPara+nChildCount), nEnd );
+ ESelection aSel( nPara, 0,nPara+nChildCount, nEnd );
pEditView->SetSelection( aSel );
return nChildCount+1;
}
@@ -424,7 +428,7 @@ void OutlinerView::SetAttribs( const SfxItemSet& rAttrs )
pEditView->SetAttribs( rAttrs );
// Update Bullet text
- for( sal_uInt16 nPara= aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
+ for( sal_Int32 nPara= aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
{
pOwner->ImplCheckNumBulletItem( nPara );
pOwner->ImplCalcBulletText( nPara, sal_False, sal_False );
@@ -452,10 +456,7 @@ ParaRange OutlinerView::ImpGetSelectedParagraphs( sal_Bool bIncludeHiddenChildre
{
Paragraph* pLast = pOwner->pParaList->GetParagraph( aParas.nEndPara );
if ( pOwner->pParaList->HasHiddenChildren( pLast ) )
- aParas.nEndPara =
- sal::static_int_cast< sal_uInt16 >(
- aParas.nEndPara +
- pOwner->pParaList->GetChildCount( pLast ) );
+ aParas.nEndPara = aParas.nEndPara + pOwner->pParaList->GetChildCount( pLast );
}
return aParas;
}
@@ -485,7 +486,7 @@ void OutlinerView::Indent( short nDiff )
sal_Int16 nMinDepth = -1; // Optimization: Not to recalculate to manny parargaphs when not really needed.
ParaRange aSel = ImpGetSelectedParagraphs( sal_True );
- for ( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
+ for ( sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
@@ -498,7 +499,7 @@ void OutlinerView::Indent( short nDiff )
if( (bPage && (nDiff == +1)) || (!bPage && (nDiff == -1) && (nOldDepth <= 0)) )
{
// Notify App
- pOwner->nDepthChangedHdlPrevDepth = (sal_Int16)nOldDepth;
+ pOwner->nDepthChangedHdlPrevDepth = nOldDepth;
pOwner->mnDepthChangeHdlPrevFlags = pPara->nFlags;
pOwner->pHdlParagraph = pPara;
@@ -562,7 +563,7 @@ void OutlinerView::Indent( short nDiff )
}
}
- pOwner->nDepthChangedHdlPrevDepth = (sal_Int16)nOldDepth;
+ pOwner->nDepthChangedHdlPrevDepth = nOldDepth;
pOwner->mnDepthChangeHdlPrevFlags = pPara->nFlags;
pOwner->pHdlParagraph = pPara;
@@ -582,8 +583,8 @@ void OutlinerView::Indent( short nDiff )
}
}
- sal_uInt16 nParas = (sal_uInt16)pOwner->pParaList->GetParagraphCount();
- for ( sal_uInt16 n = aSel.nEndPara+1; n < nParas; n++ )
+ sal_Int32 nParas = pOwner->pParaList->GetParagraphCount();
+ for ( sal_Int32 n = aSel.nEndPara+1; n < nParas; n++ )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( n );
if ( pPara->GetDepth() < nMinDepth )
@@ -633,17 +634,17 @@ void OutlinerView::Collapse()
void OutlinerView::ExpandAll()
{
DBG_CHKTHIS( OutlinerView, 0 );
- ImplExpandOrCollaps( 0, (sal_uInt16)(pOwner->pParaList->GetParagraphCount()-1), sal_True );
+ ImplExpandOrCollaps( 0, pOwner->pParaList->GetParagraphCount()-1, sal_True );
}
void OutlinerView::CollapseAll()
{
DBG_CHKTHIS(OutlinerView,0);
- ImplExpandOrCollaps( 0, (sal_uInt16)(pOwner->pParaList->GetParagraphCount()-1), sal_False );
+ ImplExpandOrCollaps( 0, pOwner->pParaList->GetParagraphCount()-1, sal_False );
}
-void OutlinerView::ImplExpandOrCollaps( sal_uInt16 nStartPara, sal_uInt16 nEndPara, sal_Bool bExpand )
+void OutlinerView::ImplExpandOrCollaps( sal_Int32 nStartPara, sal_Int32 nEndPara, sal_Bool bExpand )
{
DBG_CHKTHIS( OutlinerView, 0 );
@@ -654,7 +655,7 @@ void OutlinerView::ImplExpandOrCollaps( sal_uInt16 nStartPara, sal_uInt16 nEndPa
if( bUndo )
pOwner->UndoActionStart( bExpand ? OLUNDO_EXPAND : OLUNDO_COLLAPSE );
- for ( sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
sal_Bool bDone = bExpand ? pOwner->Expand( pPara ) : pOwner->Collapse( pPara );
@@ -694,7 +695,7 @@ void OutlinerView::InsertText( const OutlinerParaObject& rParaObj )
pOwner->UndoActionStart( OLUNDO_INSERT );
pOwner->pEditEngine->SetUpdateMode( sal_False );
- sal_uLong nStart, nParaCount;
+ sal_Int32 nStart, nParaCount;
nParaCount = pOwner->pEditEngine->GetParagraphCount();
sal_uInt16 nSize = ImpInitPaste( nStart );
pEditView->InsertText( rParaObj.GetTextObject() );
@@ -734,9 +735,9 @@ void OutlinerView::PasteSpecial()
if ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT )
{
- const sal_uInt16 nParaCount = pOwner->pEditEngine->GetParagraphCount();
+ const sal_Int32 nParaCount = pOwner->pEditEngine->GetParagraphCount();
- for( sal_uInt16 nPara = 0; nPara < nParaCount; nPara++ )
+ for( sal_Int32 nPara = 0; nPara < nParaCount; nPara++ )
pOwner->ImplSetLevelDependendStyleSheet( nPara );
}
@@ -752,7 +753,7 @@ void OutlinerView::CreateSelectionList (std::vector<Paragraph*> &aSelList)
ParaRange aParas = ImpGetSelectedParagraphs( sal_True );
- for ( sal_uInt16 nPara = aParas.nStartPara; nPara <= aParas.nEndPara; nPara++ )
+ for ( sal_Int32 nPara = aParas.nStartPara; nPara <= aParas.nEndPara; nPara++ )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
aSelList.push_back(pPara);
@@ -796,29 +797,27 @@ Pointer OutlinerView::GetPointer( const Point& rPosPixel )
}
-sal_uInt16 OutlinerView::ImpInitPaste( sal_uLong& rStart )
+sal_Int32 OutlinerView::ImpInitPaste( sal_Int32& rStart )
{
DBG_CHKTHIS(OutlinerView,0);
pOwner->bPasting = sal_True;
ESelection aSelection( pEditView->GetSelection() );
aSelection.Adjust();
rStart = aSelection.nStartPara;
- sal_uInt16 nSize = aSelection.nEndPara - aSelection.nStartPara + 1;
+ sal_Int32 nSize = aSelection.nEndPara - aSelection.nStartPara + 1;
return nSize;
}
-void OutlinerView::ImpPasted( sal_uLong nStart, sal_uLong nPrevParaCount, sal_uInt16 nSize)
+void OutlinerView::ImpPasted( sal_Int32 nStart, sal_Int32 nPrevParaCount, sal_Int32 nSize)
{
DBG_CHKTHIS(OutlinerView,0);
pOwner->bPasting = sal_False;
- sal_uLong nCurParaCount = (sal_uLong)pOwner->pEditEngine->GetParagraphCount();
+ sal_Int32 nCurParaCount = pOwner->pEditEngine->GetParagraphCount();
if( nCurParaCount < nPrevParaCount )
- nSize = sal::static_int_cast< sal_uInt16 >(
- nSize - ( nPrevParaCount - nCurParaCount ) );
+ nSize = nSize - ( nPrevParaCount - nCurParaCount );
else
- nSize = sal::static_int_cast< sal_uInt16 >(
- nSize + ( nCurParaCount - nPrevParaCount ) );
+ nSize = nSize + ( nCurParaCount - nPrevParaCount );
pOwner->ImpTextPasted( nStart, nSize );
}
@@ -830,38 +829,38 @@ void OutlinerView::Command( const CommandEvent& rCEvt )
}
-void OutlinerView::SelectRange( sal_uLong nFirst, sal_uInt16 nCount )
+void OutlinerView::SelectRange( sal_Int32 nFirst, sal_Int32 nCount )
{
DBG_CHKTHIS(OutlinerView,0);
- sal_uLong nLast = nFirst+nCount;
- nCount = (sal_uInt16)pOwner->pParaList->GetParagraphCount();
+ sal_Int32 nLast = nFirst+nCount;
+ nCount = pOwner->pParaList->GetParagraphCount();
if( nLast <= nCount )
nLast = nCount - 1;
- ESelection aSel( (sal_uInt16)nFirst, 0, (sal_uInt16)nLast, 0xffff );
+ ESelection aSel( nFirst, 0, nLast, EE_TEXTPOS_ALL );
pEditView->SetSelection( aSel );
}
-sal_uInt16 OutlinerView::ImpCalcSelectedPages( sal_Bool bIncludeFirstSelected )
+sal_Int32 OutlinerView::ImpCalcSelectedPages( sal_Bool bIncludeFirstSelected )
{
DBG_CHKTHIS(OutlinerView,0);
ESelection aSel( pEditView->GetSelection() );
aSel.Adjust();
- sal_uInt16 nPages = 0;
- sal_uInt16 nFirstPage = 0xFFFF;
- sal_uInt16 nStartPara = aSel.nStartPara;
+ sal_Int32 nPages = 0;
+ sal_Int32 nFirstPage = EE_PARA_MAX_COUNT;
+ sal_Int32 nStartPara = aSel.nStartPara;
if ( !bIncludeFirstSelected )
nStartPara++; // All paragraphs after StartPara will be deleted
- for ( sal_uInt16 nPara = nStartPara; nPara <= aSel.nEndPara; nPara++ )
+ for ( sal_Int32 nPara = nStartPara; nPara <= aSel.nEndPara; nPara++ )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
DBG_ASSERT(pPara, "ImpCalcSelectedPages: invalid Selection? ");
if( pPara->HasFlag(PARAFLAG_ISPAGE) )
{
nPages++;
- if( nFirstPage == 0xFFFF )
+ if( nFirstPage == EE_PARA_MAX_COUNT )
nFirstPage = nPara;
}
}
@@ -889,7 +888,7 @@ void OutlinerView::ToggleBullets()
sal_Int16 nDepth = -2;
- for ( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
+ for ( sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
DBG_ASSERT(pPara, "OutlinerView::ToggleBullets(), illegal selection?");
@@ -914,12 +913,11 @@ void OutlinerView::ToggleBullets()
}
}
- // #i100014#
- // It is not a good idea to substract 1 from a count and cast the result
- // to sal_uInt16 without check, if the count is 0.
- sal_uInt16 nParaCount = (sal_uInt16) (pOwner->pParaList->GetParagraphCount());
+ sal_Int32 nParaCount = pOwner->pParaList->GetParagraphCount();
pOwner->ImplCheckParagraphs( aSel.nStartPara, nParaCount );
- pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nParaCount, 0 ) );
+
+ sal_Int32 nEndPara = (nParaCount > 0) ? nParaCount-1 : nParaCount;
+ pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nEndPara, 0 ) );
pOwner->pEditEngine->SetUpdateMode( bUpdate );
@@ -936,7 +934,7 @@ void OutlinerView::EnableBullets()
const bool bUpdate = pOwner->pEditEngine->GetUpdateMode();
pOwner->pEditEngine->SetUpdateMode( sal_False );
- for ( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
+ for ( sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
DBG_ASSERT(pPara, "OutlinerView::ToggleBullets(), illegal selection?");
@@ -947,13 +945,12 @@ void OutlinerView::EnableBullets()
}
}
- // #i100014#
- // It is not a good idea to substract 1 from a count and cast the result
- // to sal_uInt16 without check, if the count is 0.
- sal_uInt16 nParaCount = (sal_uInt16) (pOwner->pParaList->GetParagraphCount());
+ sal_Int32 nParaCount = pOwner->pParaList->GetParagraphCount();
pOwner->ImplCheckParagraphs( aSel.nStartPara, nParaCount );
- pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nParaCount, 0 ) );
+
+ sal_Int32 nEndPara = (nParaCount > 0) ? nParaCount-1 : nParaCount;
+ pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nEndPara, 0 ) );
pOwner->pEditEngine->SetUpdateMode( bUpdate );
@@ -981,7 +978,7 @@ void OutlinerView::RemoveAttribs( sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich
// Loop through all paragraphs and set indentation and level
ESelection aSel = pEditView->GetSelection();
aSel.Adjust();
- for ( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
+ for ( sal_Int32 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
pOwner->ImplInitDepth( nPara, pPara->GetDepth(), sal_False, sal_False );
@@ -1235,17 +1232,17 @@ void OutlinerView::ExecuteSpellPopup( const Point& rPosPixel, Link* pStartDlg )
sal_uLong OutlinerView::Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, sal_Bool bSelect, SvKeyValueIterator* pHTTPHeaderAttrs )
{
DBG_CHKTHIS(OutlinerView,0);
- sal_uInt16 nOldParaCount = pEditView->GetEditEngine()->GetParagraphCount();
+ sal_Int32 nOldParaCount = pEditView->GetEditEngine()->GetParagraphCount();
ESelection aOldSel = pEditView->GetSelection();
aOldSel.Adjust();
sal_uLong nRet = pEditView->Read( rInput, rBaseURL, eFormat, bSelect, pHTTPHeaderAttrs );
long nParaDiff = pEditView->GetEditEngine()->GetParagraphCount() - nOldParaCount;
- sal_uInt16 nChangesStart = aOldSel.nStartPara;
- sal_uInt16 nChangesEnd = sal::static_int_cast< sal_uInt16 >(nChangesStart + nParaDiff + (aOldSel.nEndPara-aOldSel.nStartPara));
+ sal_Int32 nChangesStart = aOldSel.nStartPara;
+ sal_Int32 nChangesEnd = nChangesStart + nParaDiff + (aOldSel.nEndPara-aOldSel.nStartPara);
- for ( sal_uInt16 n = nChangesStart; n <= nChangesEnd; n++ )
+ for ( sal_Int32 n = nChangesStart; n <= nChangesEnd; n++ )
{
if ( eFormat == EE_FORMAT_BIN )
{
diff --git a/editeng/source/outliner/paralist.cxx b/editeng/source/outliner/paralist.cxx
index 1bad842dc95f..cbe10764790f 100644
--- a/editeng/source/outliner/paralist.cxx
+++ b/editeng/source/outliner/paralist.cxx
@@ -126,28 +126,38 @@ void ParagraphList::Clear( sal_Bool bDestroyParagraphs )
void ParagraphList::Append( Paragraph* pPara)
{
+ SAL_WARN_IF( maEntries.size() >= EE_PARA_MAX_COUNT, "editeng", "ParagraphList::Append - overflow");
maEntries.push_back(pPara);
}
-void ParagraphList::Insert( Paragraph* pPara, sal_uLong nAbsPos)
+void ParagraphList::Insert( Paragraph* pPara, sal_Int32 nAbsPos)
{
- OSL_ASSERT(nAbsPos != ULONG_MAX && nAbsPos <= maEntries.size());
+ SAL_WARN_IF( nAbsPos < 0 || (maEntries.size() < static_cast<size_t>(nAbsPos) && nAbsPos != EE_PARA_APPEND),
+ "editeng", "ParagraphList::Insert - bad insert position " << nAbsPos);
+ SAL_WARN_IF( maEntries.size() >= EE_PARA_MAX_COUNT, "editeng", "ParagraphList::Insert - overflow");
- maEntries.insert(maEntries.begin()+nAbsPos,pPara);
+ if (nAbsPos < 0 || maEntries.size() <= static_cast<size_t>(nAbsPos))
+ Append( pPara);
+ else
+ maEntries.insert(maEntries.begin()+nAbsPos,pPara);
}
-void ParagraphList::Remove( sal_uLong nPara )
+void ParagraphList::Remove( sal_Int32 nPara )
{
- OSL_ASSERT(nPara < maEntries.size());
+ if (nPara < 0 || maEntries.size() <= static_cast<size_t>(nPara))
+ {
+ SAL_WARN( "editeng", "ParagraphList::Remove - out of bounds " << nPara);
+ return;
+ }
maEntries.erase(maEntries.begin() + nPara );
}
-void ParagraphList::MoveParagraphs( sal_uLong nStart, sal_uLong nDest, sal_uLong _nCount )
+void ParagraphList::MoveParagraphs( sal_Int32 nStart, sal_Int32 nDest, sal_Int32 _nCount )
{
- OSL_ASSERT(nStart < maEntries.size() && nDest < maEntries.size());
+ OSL_ASSERT(static_cast<size_t>(nStart) < maEntries.size() && static_cast<size_t>(nDest) < maEntries.size());
- if ( ( nDest < nStart ) || ( nDest >= ( nStart + _nCount ) ) )
+ if ( (( nDest < nStart ) || ( nDest >= ( nStart + _nCount ) )) && nStart >= 0 && nDest >= 0 && _nCount >= 0 )
{
std::vector<Paragraph*> aParas;
std::vector<Paragraph*>::iterator iterBeg = maEntries.begin() + nStart;
@@ -172,29 +182,29 @@ void ParagraphList::MoveParagraphs( sal_uLong nStart, sal_uLong nDest, sal_uLong
sal_Bool ParagraphList::HasChildren( Paragraph* pParagraph ) const
{
- sal_uLong n = GetAbsPos( pParagraph );
+ sal_Int32 n = GetAbsPos( pParagraph );
Paragraph* pNext = GetParagraph( ++n );
return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) ) ? sal_True : sal_False;
}
sal_Bool ParagraphList::HasHiddenChildren( Paragraph* pParagraph ) const
{
- sal_uLong n = GetAbsPos( pParagraph );
+ sal_Int32 n = GetAbsPos( pParagraph );
Paragraph* pNext = GetParagraph( ++n );
return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && !pNext->IsVisible() ) ? sal_True : sal_False;
}
sal_Bool ParagraphList::HasVisibleChildren( Paragraph* pParagraph ) const
{
- sal_uLong n = GetAbsPos( pParagraph );
+ sal_Int32 n = GetAbsPos( pParagraph );
Paragraph* pNext = GetParagraph( ++n );
return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && pNext->IsVisible() ) ? sal_True : sal_False;
}
-sal_uLong ParagraphList::GetChildCount( Paragraph* pParent ) const
+sal_Int32 ParagraphList::GetChildCount( Paragraph* pParent ) const
{
- sal_uLong nChildCount = 0;
- sal_uLong n = GetAbsPos( pParent );
+ sal_Int32 nChildCount = 0;
+ sal_Int32 n = GetAbsPos( pParent );
Paragraph* pPara = GetParagraph( ++n );
while ( pPara && ( pPara->GetDepth() > pParent->GetDepth() ) )
{
@@ -207,7 +217,7 @@ sal_uLong ParagraphList::GetChildCount( Paragraph* pParent ) const
Paragraph* ParagraphList::GetParent( Paragraph* pParagraph /*, sal_uInt16& rRelPos */ ) const
{
/* rRelPos = 0 */;
- sal_uLong n = GetAbsPos( pParagraph );
+ sal_Int32 n = GetAbsPos( pParagraph );
Paragraph* pPrev = GetParagraph( --n );
while ( pPrev && ( pPrev->GetDepth() >= pParagraph->GetDepth() ) )
{
@@ -221,10 +231,10 @@ Paragraph* ParagraphList::GetParent( Paragraph* pParagraph /*, sal_uInt16& rRelP
void ParagraphList::Expand( Paragraph* pParent )
{
- sal_uLong nChildCount = GetChildCount( pParent );
- sal_uLong nPos = GetAbsPos( pParent );
+ sal_Int32 nChildCount = GetChildCount( pParent );
+ sal_Int32 nPos = GetAbsPos( pParent );
- for ( sal_uLong n = 1; n <= nChildCount; n++ )
+ for ( sal_Int32 n = 1; n <= nChildCount; n++ )
{
Paragraph* pPara = GetParagraph( nPos+n );
if ( !( pPara->IsVisible() ) )
@@ -237,10 +247,10 @@ void ParagraphList::Expand( Paragraph* pParent )
void ParagraphList::Collapse( Paragraph* pParent )
{
- sal_uLong nChildCount = GetChildCount( pParent );
- sal_uLong nPos = GetAbsPos( pParent );
+ sal_Int32 nChildCount = GetChildCount( pParent );
+ sal_Int32 nPos = GetAbsPos( pParent );
- for ( sal_uLong n = 1; n <= nChildCount; n++ )
+ for ( sal_Int32 n = 1; n <= nChildCount; n++ )
{
Paragraph* pPara = GetParagraph( nPos+n );
if ( pPara->IsVisible() )
@@ -251,9 +261,9 @@ void ParagraphList::Collapse( Paragraph* pParent )
}
}
-sal_uLong ParagraphList::GetAbsPos( Paragraph* pParent ) const
+sal_Int32 ParagraphList::GetAbsPos( Paragraph* pParent ) const
{
- sal_uLong pos = 0;
+ sal_Int32 pos = 0;
std::vector<Paragraph*>::const_iterator iter;
for (iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++pos)
{
@@ -261,7 +271,7 @@ sal_uLong ParagraphList::GetAbsPos( Paragraph* pParent ) const
return pos;
}
- return ~0;
+ return EE_PARA_NOT_FOUND;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/outliner/paralist.hxx b/editeng/source/outliner/paralist.hxx
index 5e51aea1bf96..d8abf686f518 100644
--- a/editeng/source/outliner/paralist.hxx
+++ b/editeng/source/outliner/paralist.hxx
@@ -20,6 +20,9 @@
#ifndef _PARALIST_HXX
#define _PARALIST_HXX
+#include <sal/config.h>
+#include <sal/log.hxx>
+
#include <vector>
#include <tools/link.hxx>
@@ -31,28 +34,34 @@ class ParagraphList
public:
void Clear( sal_Bool bDestroyParagraphs );
- sal_uInt32 GetParagraphCount() const
+ sal_Int32 GetParagraphCount() const
{
- return maEntries.size();
+ size_t nSize = maEntries.size();
+ if (nSize > SAL_MAX_INT32)
+ {
+ SAL_WARN( "editeng", "ParagraphList::GetParagraphCount - overflow " << nSize);
+ return SAL_MAX_INT32;
+ }
+ return nSize;
}
- Paragraph* GetParagraph( sal_uLong nPos ) const
+ Paragraph* GetParagraph( sal_Int32 nPos ) const
{
- return nPos < maEntries.size() ? maEntries[nPos] : NULL;
+ return 0 <= nPos && static_cast<size_t>(nPos) < maEntries.size() ? maEntries[nPos] : NULL;
}
- sal_uLong GetAbsPos( Paragraph* pParent ) const;
+ sal_Int32 GetAbsPos( Paragraph* pParent ) const;
void Append( Paragraph *pPara);
- void Insert( Paragraph* pPara, sal_uLong nAbsPos);
- void Remove( sal_uLong nPara );
- void MoveParagraphs( sal_uLong nStart, sal_uLong nDest, sal_uLong nCount );
+ void Insert( Paragraph* pPara, sal_Int32 nAbsPos);
+ void Remove( sal_Int32 nPara );
+ void MoveParagraphs( sal_Int32 nStart, sal_Int32 nDest, sal_Int32 nCount );
Paragraph* GetParent( Paragraph* pParagraph /*, sal_uInt16& rRelPos */ ) const;
sal_Bool HasChildren( Paragraph* pParagraph ) const;
sal_Bool HasHiddenChildren( Paragraph* pParagraph ) const;
sal_Bool HasVisibleChildren( Paragraph* pParagraph ) const;
- sal_uLong GetChildCount( Paragraph* pParagraph ) const;
+ sal_Int32 GetChildCount( Paragraph* pParagraph ) const;
void Expand( Paragraph* pParent );
void Collapse( Paragraph* pParent );
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index baccbdeb87ea..7d06b96c4c04 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -895,7 +895,7 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack
SvxRTFItemStackType *pAkt = aAttrStack.empty() ? 0 : aAttrStack.back();
do { // middle check loop
- sal_uLong nOldSttNdIdx = pOld->pSttNd->GetIdx();
+ sal_Int32 nOldSttNdIdx = pOld->pSttNd->GetIdx();
if( !pOld->pChildList &&
((!pOld->aAttrSet.Count() && !pOld->nStyleNo ) ||
(nOldSttNdIdx == pInsPos->GetNodeIdx() &&
@@ -929,7 +929,7 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack
if( bCrsrBack )
{
// at the beginning of a paragraph? Move back one position
- sal_uLong nNd = pInsPos->GetNodeIdx();
+ sal_Int32 nNd = pInsPos->GetNodeIdx();
MovePos( sal_False );
// if can not move backward then later dont move forward !
bCrsrBack = nNd != pInsPos->GetNodeIdx();
@@ -1225,8 +1225,8 @@ void SvxRTFItemStackType::MoveFullNode(const SvxNodeIdx &rOldNode,
}
//And the same for all the children
- sal_uInt16 nCount = pChildList ? pChildList->size() : 0;
- for (sal_uInt16 i = 0; i < nCount; ++i)
+ sal_Int32 nCount = pChildList ? pChildList->size() : 0;
+ for (sal_Int32 i = 0; i < nCount; ++i)
{
SvxRTFItemStackType* pStk = &(*pChildList)[i];
pStk->MoveFullNode(rOldNode, rNewNode);
diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx
index 4e371bc9fac0..cb6acfdde10d 100644
--- a/editeng/source/uno/unoedhlp.cxx
+++ b/editeng/source/uno/unoedhlp.cxx
@@ -32,7 +32,7 @@ SvxEditSourceHint::SvxEditSourceHint( sal_uLong _nId ) :
{
}
-SvxEditSourceHint::SvxEditSourceHint( sal_uLong _nId, sal_uLong nValue, sal_uLong nStart, sal_uLong nEnd ) :
+SvxEditSourceHint::SvxEditSourceHint( sal_uLong _nId, sal_uLong nValue, sal_Int32 nStart, sal_Int32 nEnd ) :
TextHint( _nId, nValue ),
mnStart( nStart),
mnEnd( nEnd )
@@ -44,12 +44,12 @@ sal_uLong SvxEditSourceHint::GetValue() const
return TextHint::GetValue();
}
-sal_uLong SvxEditSourceHint::GetStartValue() const
+sal_Int32 SvxEditSourceHint::GetStartValue() const
{
return mnStart;
}
-sal_uLong SvxEditSourceHint::GetEndValue() const
+sal_Int32 SvxEditSourceHint::GetEndValue() const
{
return mnEnd;
}
@@ -104,7 +104,7 @@ sal_uLong SvxEditSourceHint::GetEndValue() const
return ::std::auto_ptr<SfxHint>( new SfxHint() );
}
-sal_Bool SvxEditSourceHelper::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_uInt16 nPara, sal_uInt16 nIndex )
+sal_Bool SvxEditSourceHelper::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_Int32 nPara, sal_uInt16 nIndex )
{
std::vector<EECharAttrib> aCharAttribs;
diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx
index 1eb478837072..8e160d0757c2 100644
--- a/editeng/source/uno/unoedprx.cxx
+++ b/editeng/source/uno/unoedprx.cxx
@@ -66,11 +66,11 @@ public:
~SvxAccessibleTextIndex() {};
// Get/Set current paragraph
- void SetParagraph( sal_uInt16 nPara )
+ void SetParagraph( sal_Int32 nPara )
{
mnPara = nPara;
}
- sal_uInt16 GetParagraph() const { return mnPara; }
+ sal_Int32 GetParagraph() const { return mnPara; }
/** Set the index in the UAA semantic
@@ -81,7 +81,7 @@ public:
The text forwarder to use in the calculations
*/
void SetIndex( sal_Int32 nIndex, const SvxTextForwarder& rTF );
- void SetIndex( sal_uInt16 nPara, sal_Int32 nIndex, const SvxTextForwarder& rTF ) { SetParagraph(nPara); SetIndex(nIndex, rTF); }
+ void SetIndex( sal_Int32 nPara, sal_Int32 nIndex, const SvxTextForwarder& rTF ) { SetParagraph(nPara); SetIndex(nIndex, rTF); }
sal_Int32 GetIndex() const { return mnIndex; }
/** Set the index in the edit engine semantic
@@ -96,7 +96,7 @@ public:
The text forwarder to use in the calculations
*/
void SetEEIndex( sal_uInt16 nEEIndex, const SvxTextForwarder& rTF );
- void SetEEIndex( sal_uInt16 nPara, sal_uInt16 nEEIndex, const SvxTextForwarder& rTF ) { SetParagraph(nPara); SetEEIndex(nEEIndex, rTF); }
+ void SetEEIndex( sal_Int32 nPara, sal_uInt16 nEEIndex, const SvxTextForwarder& rTF ) { SetParagraph(nPara); SetEEIndex(nEEIndex, rTF); }
sal_uInt16 GetEEIndex() const;
void SetFieldOffset( sal_Int32 nOffset, sal_Int32 nLen ) { mnFieldOffset = nOffset; mnFieldLen = nLen; }
@@ -115,7 +115,7 @@ public:
sal_Bool IsEditableRange( const SvxAccessibleTextIndex& rEnd ) const;
private:
- sal_uInt16 mnPara;
+ sal_Int32 mnPara;
sal_Int32 mnIndex;
sal_Int32 mnEEIndex;
sal_Int32 mnFieldOffset;
@@ -438,14 +438,14 @@ SvxAccessibleTextAdapter::~SvxAccessibleTextAdapter()
{
}
-sal_uInt16 SvxAccessibleTextAdapter::GetParagraphCount() const
+sal_Int32 SvxAccessibleTextAdapter::GetParagraphCount() const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
return mrTextForwarder->GetParagraphCount();
}
-sal_uInt16 SvxAccessibleTextAdapter::GetTextLen( sal_uInt16 nParagraph ) const
+sal_uInt16 SvxAccessibleTextAdapter::GetTextLen( sal_Int32 nParagraph ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -492,8 +492,8 @@ String SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const
sStr = sStr.Copy(0, static_cast< sal_uInt16 > (sStr.Len() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset())) );
}
- EBulletInfo aBulletInfo1 = GetBulletInfo( static_cast< sal_uInt16 >(aStartIndex.GetParagraph()) );
- EBulletInfo aBulletInfo2 = GetBulletInfo( static_cast< sal_uInt16 >(aEndIndex.GetParagraph()) );
+ EBulletInfo aBulletInfo1 = GetBulletInfo( aStartIndex.GetParagraph() );
+ EBulletInfo aBulletInfo2 = GetBulletInfo( aEndIndex.GetParagraph() );
if( aStartIndex.InBullet() )
{
@@ -554,14 +554,14 @@ SfxItemSet SvxAccessibleTextAdapter::GetAttribs( const ESelection& rSel, sal_Boo
bOnlyHardAttrib );
}
-SfxItemSet SvxAccessibleTextAdapter::GetParaAttribs( sal_uInt16 nPara ) const
+SfxItemSet SvxAccessibleTextAdapter::GetParaAttribs( sal_Int32 nPara ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
return mrTextForwarder->GetParaAttribs( nPara );
}
-void SvxAccessibleTextAdapter::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet )
+void SvxAccessibleTextAdapter::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -573,7 +573,7 @@ void SvxAccessibleTextAdapter::RemoveAttribs( const ESelection& , sal_Bool , sal
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
}
-void SvxAccessibleTextAdapter::GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const
+void SvxAccessibleTextAdapter::GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -594,7 +594,7 @@ sal_uInt16 SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, sal_u
nWhich );
}
-sal_uInt16 SvxAccessibleTextAdapter::GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const
+sal_uInt16 SvxAccessibleTextAdapter::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -663,21 +663,21 @@ SfxItemPool* SvxAccessibleTextAdapter::GetPool() const
return mrTextForwarder->GetPool();
}
-XubString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
+XubString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
return mrTextForwarder->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
-void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos )
+void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos )
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
mrTextForwarder->FieldClicked( rField, nPara, nPos );
}
-sal_Int32 SvxAccessibleTextAdapter::CalcLogicalIndex( sal_uInt16 nPara, sal_uInt16 nEEIndex )
+sal_Int32 SvxAccessibleTextAdapter::CalcLogicalIndex( sal_Int32 nPara, sal_uInt16 nEEIndex )
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -686,7 +686,7 @@ sal_Int32 SvxAccessibleTextAdapter::CalcLogicalIndex( sal_uInt16 nPara, sal_uInt
return aIndex.GetIndex();
}
-sal_uInt16 SvxAccessibleTextAdapter::CalcEditEngineIndex( sal_uInt16 nPara, sal_Int32 nLogicalIndex )
+sal_uInt16 SvxAccessibleTextAdapter::CalcEditEngineIndex( sal_Int32 nPara, sal_Int32 nLogicalIndex )
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -707,7 +707,7 @@ sal_Bool SvxAccessibleTextAdapter::IsValid() const
return sal_False;
}
-LanguageType SvxAccessibleTextAdapter::GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const
+LanguageType SvxAccessibleTextAdapter::GetLanguage( sal_Int32 nPara, sal_uInt16 nPos ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -718,28 +718,28 @@ LanguageType SvxAccessibleTextAdapter::GetLanguage( sal_uInt16 nPara, sal_uInt16
return mrTextForwarder->GetLanguage( nPara, aIndex.GetEEIndex() );
}
-sal_uInt16 SvxAccessibleTextAdapter::GetFieldCount( sal_uInt16 nPara ) const
+sal_uInt16 SvxAccessibleTextAdapter::GetFieldCount( sal_Int32 nPara ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
return mrTextForwarder->GetFieldCount( nPara );
}
-EFieldInfo SvxAccessibleTextAdapter::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const
+EFieldInfo SvxAccessibleTextAdapter::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
return mrTextForwarder->GetFieldInfo( nPara, nField );
}
-EBulletInfo SvxAccessibleTextAdapter::GetBulletInfo( sal_uInt16 nPara ) const
+EBulletInfo SvxAccessibleTextAdapter::GetBulletInfo( sal_Int32 nPara ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
return mrTextForwarder->GetBulletInfo( nPara );
}
-Rectangle SvxAccessibleTextAdapter::GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+Rectangle SvxAccessibleTextAdapter::GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -799,7 +799,7 @@ Rectangle SvxAccessibleTextAdapter::GetCharBounds( sal_uInt16 nPara, sal_uInt16
return aRect;
}
-Rectangle SvxAccessibleTextAdapter::GetParaBounds( sal_uInt16 nPara ) const
+Rectangle SvxAccessibleTextAdapter::GetParaBounds( sal_Int32 nPara ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -834,7 +834,7 @@ OutputDevice* SvxAccessibleTextAdapter::GetRefDevice() const
return mrTextForwarder->GetRefDevice();
}
-sal_Bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, sal_uInt16& nPara, sal_uInt16& nIndex ) const
+sal_Bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, sal_Int32& nPara, sal_uInt16& nIndex ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -909,7 +909,7 @@ sal_Bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, sal_uIn
return sal_True;
}
-sal_Bool SvxAccessibleTextAdapter::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const
+sal_Bool SvxAccessibleTextAdapter::GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -964,7 +964,7 @@ sal_Bool SvxAccessibleTextAdapter::GetWordIndices( sal_uInt16 nPara, sal_uInt16
return sal_True;
}
-sal_Bool SvxAccessibleTextAdapter::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_Bool SvxAccessibleTextAdapter::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -1016,14 +1016,14 @@ sal_Bool SvxAccessibleTextAdapter::GetAttributeRun( sal_uInt16& nStartIndex, sal
return sal_True;
}
-sal_uInt16 SvxAccessibleTextAdapter::GetLineCount( sal_uInt16 nPara ) const
+sal_uInt16 SvxAccessibleTextAdapter::GetLineCount( sal_Int32 nPara ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
return mrTextForwarder->GetLineCount( nPara );
}
-sal_uInt16 SvxAccessibleTextAdapter::GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const
+sal_uInt16 SvxAccessibleTextAdapter::GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -1049,12 +1049,12 @@ sal_uInt16 SvxAccessibleTextAdapter::GetLineLen( sal_uInt16 nPara, sal_uInt16 nL
return static_cast< sal_uInt16 >(aEndIndex.GetIndex());
}
-void SvxAccessibleTextAdapter::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const
+void SvxAccessibleTextAdapter::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const
{
mrTextForwarder->GetLineBoundaries( rStart, rEnd, nParagraph, nLine );
}
-sal_uInt16 SvxAccessibleTextAdapter::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_uInt16 SvxAccessibleTextAdapter::GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
return mrTextForwarder->GetLineNumberAtIndex( nPara, nIndex );
}
@@ -1092,14 +1092,14 @@ sal_Bool SvxAccessibleTextAdapter::QuickFormatDoc( sal_Bool bFull )
return mrTextForwarder->QuickFormatDoc( bFull );
}
-sal_Int16 SvxAccessibleTextAdapter::GetDepth( sal_uInt16 nPara ) const
+sal_Int16 SvxAccessibleTextAdapter::GetDepth( sal_Int32 nPara ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
return mrTextForwarder->GetDepth( nPara );
}
-sal_Bool SvxAccessibleTextAdapter::SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth )
+sal_Bool SvxAccessibleTextAdapter::SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth )
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -1111,7 +1111,7 @@ void SvxAccessibleTextAdapter::SetForwarder( SvxTextForwarder& rForwarder )
mrTextForwarder = &rForwarder;
}
-sal_Bool SvxAccessibleTextAdapter::HaveImageBullet( sal_uInt16 nPara ) const
+sal_Bool SvxAccessibleTextAdapter::HaveImageBullet( sal_Int32 nPara ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -1129,7 +1129,7 @@ sal_Bool SvxAccessibleTextAdapter::HaveImageBullet( sal_uInt16 nPara ) const
}
}
-sal_Bool SvxAccessibleTextAdapter::HaveTextBullet( sal_uInt16 nPara ) const
+sal_Bool SvxAccessibleTextAdapter::HaveTextBullet( sal_Int32 nPara ) const
{
DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder");
@@ -1178,7 +1178,7 @@ void SvxAccessibleTextAdapter::AppendParagraph()
OSL_FAIL( "not implemented" );
}
-xub_StrLen SvxAccessibleTextAdapter::AppendTextPortion( sal_uInt16, const String &, const SfxItemSet & )
+xub_StrLen SvxAccessibleTextAdapter::AppendTextPortion( sal_Int32, const String &, const SfxItemSet & )
{
OSL_FAIL( "not implemented" );
return 0;
diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx
index 39d2012be8aa..daee7d17777d 100644
--- a/editeng/source/uno/unofored.cxx
+++ b/editeng/source/uno/unofored.cxx
@@ -46,12 +46,12 @@ SvxEditEngineForwarder::~SvxEditEngineForwarder()
// the EditEngine may need to be deleted from the outside
}
-sal_uInt16 SvxEditEngineForwarder::GetParagraphCount() const
+sal_Int32 SvxEditEngineForwarder::GetParagraphCount() const
{
return rEditEngine.GetParagraphCount();
}
-sal_uInt16 SvxEditEngineForwarder::GetTextLen( sal_uInt16 nParagraph ) const
+sal_uInt16 SvxEditEngineForwarder::GetTextLen( sal_Int32 nParagraph ) const
{
return rEditEngine.GetTextLen( nParagraph );
}
@@ -89,7 +89,7 @@ SfxItemSet SvxEditEngineForwarder::GetAttribs( const ESelection& rSel, sal_Bool
}
}
-SfxItemSet SvxEditEngineForwarder::GetParaAttribs( sal_uInt16 nPara ) const
+SfxItemSet SvxEditEngineForwarder::GetParaAttribs( sal_Int32 nPara ) const
{
SfxItemSet aSet( rEditEngine.GetParaAttribs( nPara ) );
@@ -107,7 +107,7 @@ SfxItemSet SvxEditEngineForwarder::GetParaAttribs( sal_uInt16 nPara ) const
return aSet;
}
-void SvxEditEngineForwarder::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet )
+void SvxEditEngineForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
{
rEditEngine.SetParaAttribs( nPara, rSet );
}
@@ -122,7 +122,7 @@ SfxItemPool* SvxEditEngineForwarder::GetPool() const
return rEditEngine.GetEmptyItemSet().GetPool();
}
-void SvxEditEngineForwarder::GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const
+void SvxEditEngineForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const
{
rEditEngine.GetPortions( nPara, rList );
}
@@ -154,12 +154,12 @@ sal_Bool SvxEditEngineForwarder::IsValid() const
return rEditEngine.GetUpdateMode();
}
-XubString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
+XubString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
{
return rEditEngine.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
-void SvxEditEngineForwarder::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos )
+void SvxEditEngineForwarder::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos )
{
rEditEngine.FieldClicked( rField, nPara, nPos );
}
@@ -173,7 +173,7 @@ sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection&
SfxItemState eState = SFX_ITEM_DEFAULT;
// check all paragraphs inside the selection
- for( sal_uInt16 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ )
+ for( sal_Int32 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ )
{
SfxItemState eParaState = SFX_ITEM_DEFAULT;
@@ -262,33 +262,33 @@ sal_uInt16 SvxEditEngineForwarder::GetItemState( const ESelection& rSel, sal_uIn
return GetSvxEditEngineItemState( rEditEngine, rSel, nWhich );
}
-sal_uInt16 SvxEditEngineForwarder::GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const
+sal_uInt16 SvxEditEngineForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
const SfxItemSet& rSet = rEditEngine.GetParaAttribs( nPara );
return rSet.GetItemState( nWhich );
}
-LanguageType SvxEditEngineForwarder::GetLanguage( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+LanguageType SvxEditEngineForwarder::GetLanguage( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
return rEditEngine.GetLanguage(nPara, nIndex);
}
-sal_uInt16 SvxEditEngineForwarder::GetFieldCount( sal_uInt16 nPara ) const
+sal_uInt16 SvxEditEngineForwarder::GetFieldCount( sal_Int32 nPara ) const
{
return rEditEngine.GetFieldCount(nPara);
}
-EFieldInfo SvxEditEngineForwarder::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const
+EFieldInfo SvxEditEngineForwarder::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
{
return rEditEngine.GetFieldInfo( nPara, nField );
}
-EBulletInfo SvxEditEngineForwarder::GetBulletInfo( sal_uInt16 ) const
+EBulletInfo SvxEditEngineForwarder::GetBulletInfo( sal_Int32 ) const
{
return EBulletInfo();
}
-Rectangle SvxEditEngineForwarder::GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+Rectangle SvxEditEngineForwarder::GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
// #101701#
// EditEngine's 'internal' methods like GetCharacterBounds()
@@ -336,7 +336,7 @@ Rectangle SvxEditEngineForwarder::GetCharBounds( sal_uInt16 nPara, sal_uInt16 nI
}
}
-Rectangle SvxEditEngineForwarder::GetParaBounds( sal_uInt16 nPara ) const
+Rectangle SvxEditEngineForwarder::GetParaBounds( sal_Int32 nPara ) const
{
const Point aPnt = rEditEngine.GetDocPosTopLeft( nPara );
sal_uLong nWidth;
@@ -374,7 +374,7 @@ OutputDevice* SvxEditEngineForwarder::GetRefDevice() const
return rEditEngine.GetRefDevice();
}
-sal_Bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, sal_uInt16& nPara, sal_uInt16& nIndex ) const
+sal_Bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_uInt16& nIndex ) const
{
Size aSize( rEditEngine.CalcTextWidth(), rEditEngine.GetTextHeight() );
::std::swap( aSize.Width(), aSize.Height() );
@@ -390,7 +390,7 @@ sal_Bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, sal_uInt16&
return sal_True;
}
-sal_Bool SvxEditEngineForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const
+sal_Bool SvxEditEngineForwarder::GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const
{
ESelection aRes = rEditEngine.GetWord( ESelection(nPara, nIndex, nPara, nIndex), com::sun::star::i18n::WordType::DICTIONARY_WORD );
@@ -406,27 +406,27 @@ sal_Bool SvxEditEngineForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nI
return sal_False;
}
-sal_Bool SvxEditEngineForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_Bool SvxEditEngineForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex ) const
{
return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rEditEngine, nPara, nIndex );
}
-sal_uInt16 SvxEditEngineForwarder::GetLineCount( sal_uInt16 nPara ) const
+sal_uInt16 SvxEditEngineForwarder::GetLineCount( sal_Int32 nPara ) const
{
return rEditEngine.GetLineCount(nPara);
}
-sal_uInt16 SvxEditEngineForwarder::GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const
+sal_uInt16 SvxEditEngineForwarder::GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const
{
return rEditEngine.GetLineLen(nPara, nLine);
}
-void SvxEditEngineForwarder::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nPara, sal_uInt16 nLine ) const
+void SvxEditEngineForwarder::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nPara, sal_uInt16 nLine ) const
{
rEditEngine.GetLineBoundaries(rStart, rEnd, nPara, nLine);
}
-sal_uInt16 SvxEditEngineForwarder::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_uInt16 SvxEditEngineForwarder::GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
return rEditEngine.GetLineNumberAtIndex(nPara, nIndex);
}
@@ -455,13 +455,13 @@ sal_Bool SvxEditEngineForwarder::InsertText( const String& rStr, const ESelectio
return sal_True;
}
-sal_Int16 SvxEditEngineForwarder::GetDepth( sal_uInt16 ) const
+sal_Int16 SvxEditEngineForwarder::GetDepth( sal_Int32 ) const
{
// EditEngine does not support outline depth
return -1;
}
-sal_Bool SvxEditEngineForwarder::SetDepth( sal_uInt16, sal_Int16 nNewDepth )
+sal_Bool SvxEditEngineForwarder::SetDepth( sal_Int32, sal_Int16 nNewDepth )
{
// EditEngine does not support outline depth
return nNewDepth == -1 ? sal_True : sal_False;
@@ -477,13 +477,13 @@ void SvxEditEngineForwarder::AppendParagraph()
rEditEngine.InsertParagraph( rEditEngine.GetParagraphCount(), String::EmptyString() );
}
-xub_StrLen SvxEditEngineForwarder::AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet & /*rSet*/ )
+xub_StrLen SvxEditEngineForwarder::AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet & /*rSet*/ )
{
xub_StrLen nLen = 0;
- sal_uInt16 nParaCount = rEditEngine.GetParagraphCount();
+ sal_Int32 nParaCount = rEditEngine.GetParagraphCount();
DBG_ASSERT( nPara < nParaCount, "paragraph index out of bounds" );
- if (/*0 <= nPara && */nPara < nParaCount)
+ if (0 <= nPara && nPara < nParaCount)
{
nLen = rEditEngine.GetTextLen( nPara );
rEditEngine.QuickInsertText( rText, ESelection( nPara, nLen, nPara, nLen ) );
diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx
index f320851da662..35310f1338c8 100644
--- a/editeng/source/uno/unoforou.cxx
+++ b/editeng/source/uno/unoforou.cxx
@@ -53,12 +53,12 @@ SvxOutlinerForwarder::~SvxOutlinerForwarder()
flushCache();
}
-sal_uInt16 SvxOutlinerForwarder::GetParagraphCount() const
+sal_Int32 SvxOutlinerForwarder::GetParagraphCount() const
{
- return (sal_uInt16)rOutliner.GetParagraphCount();
+ return rOutliner.GetParagraphCount();
}
-sal_uInt16 SvxOutlinerForwarder::GetTextLen( sal_uInt16 nParagraph ) const
+sal_uInt16 SvxOutlinerForwarder::GetTextLen( sal_Int32 nParagraph ) const
{
return rOutliner.GetEditEngine().GetTextLen( nParagraph );
}
@@ -136,7 +136,7 @@ SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, sal_Bool bO
return aSet;
}
-SfxItemSet SvxOutlinerForwarder::GetParaAttribs( sal_uInt16 nPara ) const
+SfxItemSet SvxOutlinerForwarder::GetParaAttribs( sal_Int32 nPara ) const
{
if( mpParaAttribsCache )
{
@@ -166,7 +166,7 @@ SfxItemSet SvxOutlinerForwarder::GetParaAttribs( sal_uInt16 nPara ) const
return *mpParaAttribsCache;
}
-void SvxOutlinerForwarder::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet )
+void SvxOutlinerForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
{
flushCache();
@@ -190,7 +190,7 @@ SfxItemPool* SvxOutlinerForwarder::GetPool() const
return rOutliner.GetEmptyItemSet().GetPool();
}
-void SvxOutlinerForwarder::GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const
+void SvxOutlinerForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const
{
((EditEngine&)rOutliner.GetEditEngine()).GetPortions( nPara, rList );
}
@@ -226,12 +226,12 @@ void SvxOutlinerForwarder::QuickSetAttribs( const SfxItemSet& rSet, const ESelec
rOutliner.QuickSetAttribs( rSet, rSel );
}
-XubString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
+XubString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
{
return rOutliner.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
}
-void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos )
+void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, xub_StrLen nPos )
{
rOutliner.FieldClicked( rField, nPara, nPos );
}
@@ -250,7 +250,7 @@ sal_uInt16 SvxOutlinerForwarder::GetItemState( const ESelection& rSel, sal_uInt1
return GetSvxEditEngineItemState( (EditEngine&)rOutliner.GetEditEngine(), rSel, nWhich );
}
-sal_uInt16 SvxOutlinerForwarder::GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const
+sal_uInt16 SvxOutlinerForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
const SfxItemSet& rSet = rOutliner.GetParaAttribs( nPara );
return rSet.GetItemState( nWhich );
@@ -272,27 +272,27 @@ void SvxOutlinerForwarder::flushCache()
}
}
-LanguageType SvxOutlinerForwarder::GetLanguage( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+LanguageType SvxOutlinerForwarder::GetLanguage( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
return rOutliner.GetLanguage(nPara, nIndex);
}
-sal_uInt16 SvxOutlinerForwarder::GetFieldCount( sal_uInt16 nPara ) const
+sal_uInt16 SvxOutlinerForwarder::GetFieldCount( sal_Int32 nPara ) const
{
return rOutliner.GetEditEngine().GetFieldCount(nPara);
}
-EFieldInfo SvxOutlinerForwarder::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const
+EFieldInfo SvxOutlinerForwarder::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
{
return rOutliner.GetEditEngine().GetFieldInfo( nPara, nField );
}
-EBulletInfo SvxOutlinerForwarder::GetBulletInfo( sal_uInt16 nPara ) const
+EBulletInfo SvxOutlinerForwarder::GetBulletInfo( sal_Int32 nPara ) const
{
return rOutliner.GetBulletInfo( nPara );
}
-Rectangle SvxOutlinerForwarder::GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+Rectangle SvxOutlinerForwarder::GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
// EditEngine's 'internal' methods like GetCharacterBounds()
// don't rotate for vertical text.
@@ -339,7 +339,7 @@ Rectangle SvxOutlinerForwarder::GetCharBounds( sal_uInt16 nPara, sal_uInt16 nInd
}
}
-Rectangle SvxOutlinerForwarder::GetParaBounds( sal_uInt16 nPara ) const
+Rectangle SvxOutlinerForwarder::GetParaBounds( sal_Int32 nPara ) const
{
Point aPnt = rOutliner.GetDocPosTopLeft( nPara );
Size aSize = rOutliner.CalcTextSize();
@@ -371,7 +371,7 @@ OutputDevice* SvxOutlinerForwarder::GetRefDevice() const
return rOutliner.GetRefDevice();
}
-sal_Bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_uInt16& nPara, sal_uInt16& nIndex ) const
+sal_Bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_uInt16& nIndex ) const
{
Size aSize( rOutliner.CalcTextSize() );
::std::swap( aSize.Width(), aSize.Height() );
@@ -387,7 +387,7 @@ sal_Bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_uInt16& n
return sal_True;
}
-sal_Bool SvxOutlinerForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const
+sal_Bool SvxOutlinerForwarder::GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const
{
ESelection aRes = rOutliner.GetEditEngine().GetWord( ESelection(nPara, nIndex, nPara, nIndex), com::sun::star::i18n::WordType::DICTIONARY_WORD );
@@ -403,27 +403,27 @@ sal_Bool SvxOutlinerForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nInd
return sal_False;
}
-sal_Bool SvxOutlinerForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_Bool SvxOutlinerForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex ) const
{
return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rOutliner.GetEditEngine(), nPara, nIndex );
}
-sal_uInt16 SvxOutlinerForwarder::GetLineCount( sal_uInt16 nPara ) const
+sal_uInt16 SvxOutlinerForwarder::GetLineCount( sal_Int32 nPara ) const
{
return static_cast < sal_uInt16 >( rOutliner.GetLineCount(nPara) );
}
-sal_uInt16 SvxOutlinerForwarder::GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const
+sal_uInt16 SvxOutlinerForwarder::GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const
{
return rOutliner.GetLineLen(nPara, nLine);
}
-void SvxOutlinerForwarder::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nPara, sal_uInt16 nLine ) const
+void SvxOutlinerForwarder::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nPara, sal_uInt16 nLine ) const
{
return rOutliner.GetEditEngine().GetLineBoundaries( rStart, rEnd, nPara, nLine );
}
-sal_uInt16 SvxOutlinerForwarder::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_uInt16 SvxOutlinerForwarder::GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
return rOutliner.GetEditEngine().GetLineNumberAtIndex( nPara, nIndex );
}
@@ -453,9 +453,9 @@ sal_Bool SvxOutlinerForwarder::InsertText( const String& rStr, const ESelection&
return sal_True;
}
-sal_Int16 SvxOutlinerForwarder::GetDepth( sal_uInt16 nPara ) const
+sal_Int16 SvxOutlinerForwarder::GetDepth( sal_Int32 nPara ) const
{
- DBG_ASSERT( nPara < GetParagraphCount(), "SvxOutlinerForwarder::GetDepth: Invalid paragraph index");
+ DBG_ASSERT( 0 <= nPara && nPara < GetParagraphCount(), "SvxOutlinerForwarder::GetDepth: Invalid paragraph index");
Paragraph* pPara = rOutliner.GetParagraph( nPara );
@@ -467,11 +467,11 @@ sal_Int16 SvxOutlinerForwarder::GetDepth( sal_uInt16 nPara ) const
return nLevel;
}
-sal_Bool SvxOutlinerForwarder::SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth )
+sal_Bool SvxOutlinerForwarder::SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth )
{
- DBG_ASSERT( nPara < GetParagraphCount(), "SvxOutlinerForwarder::SetDepth: Invalid paragraph index");
+ DBG_ASSERT( 0 <= nPara && nPara < GetParagraphCount(), "SvxOutlinerForwarder::SetDepth: Invalid paragraph index");
- if( (nNewDepth >= -1) && (nNewDepth <= 9) && (nPara < GetParagraphCount()) )
+ if( (nNewDepth >= -1) && (nNewDepth <= 9) && (0 <= nPara && nPara < GetParagraphCount()) )
{
Paragraph* pPara = rOutliner.GetParagraph( nPara );
if( pPara )
@@ -489,9 +489,9 @@ sal_Bool SvxOutlinerForwarder::SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth )
return sal_False;
}
-sal_Int16 SvxOutlinerForwarder::GetNumberingStartValue( sal_uInt16 nPara )
+sal_Int16 SvxOutlinerForwarder::GetNumberingStartValue( sal_Int32 nPara )
{
- if( nPara < GetParagraphCount() )
+ if( 0 <= nPara && nPara < GetParagraphCount() )
{
return rOutliner.GetNumberingStartValue( nPara );
}
@@ -502,9 +502,9 @@ sal_Int16 SvxOutlinerForwarder::GetNumberingStartValue( sal_uInt16 nPara )
}
}
-void SvxOutlinerForwarder::SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingStartValue )
+void SvxOutlinerForwarder::SetNumberingStartValue( sal_Int32 nPara, sal_Int16 nNumberingStartValue )
{
- if( nPara < GetParagraphCount() )
+ if( 0 <= nPara && nPara < GetParagraphCount() )
{
rOutliner.SetNumberingStartValue( nPara, nNumberingStartValue );
}
@@ -514,9 +514,9 @@ void SvxOutlinerForwarder::SetNumberingStartValue( sal_uInt16 nPara, sal_Int16
}
}
-sal_Bool SvxOutlinerForwarder::IsParaIsNumberingRestart( sal_uInt16 nPara )
+sal_Bool SvxOutlinerForwarder::IsParaIsNumberingRestart( sal_Int32 nPara )
{
- if( nPara < GetParagraphCount() )
+ if( 0 <= nPara && nPara < GetParagraphCount() )
{
return rOutliner.IsParaIsNumberingRestart( nPara );
}
@@ -527,9 +527,9 @@ sal_Bool SvxOutlinerForwarder::IsParaIsNumberingRestart( sal_uInt16 nPara )
}
}
-void SvxOutlinerForwarder::SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumberingRestart )
+void SvxOutlinerForwarder::SetParaIsNumberingRestart( sal_Int32 nPara, sal_Bool bParaIsNumberingRestart )
{
- if( nPara < GetParagraphCount() )
+ if( 0 <= nPara && nPara < GetParagraphCount() )
{
rOutliner.SetParaIsNumberingRestart( nPara, bParaIsNumberingRestart );
}
@@ -551,14 +551,14 @@ void SvxOutlinerForwarder::AppendParagraph()
rEditEngine.InsertParagraph( rEditEngine.GetParagraphCount(), String::EmptyString() );
}
-xub_StrLen SvxOutlinerForwarder::AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet & /*rSet*/ )
+xub_StrLen SvxOutlinerForwarder::AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet & /*rSet*/ )
{
xub_StrLen nLen = 0;
EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
- sal_uInt16 nParaCount = rEditEngine.GetParagraphCount();
- DBG_ASSERT( nPara < nParaCount, "paragraph index out of bounds" );
- if (/*0 <= nPara && */nPara < nParaCount)
+ sal_Int32 nParaCount = rEditEngine.GetParagraphCount();
+ DBG_ASSERT( 0 <= nPara && nPara < nParaCount, "paragraph index out of bounds" );
+ if (0 <= nPara && nPara < nParaCount)
{
nLen = rEditEngine.GetTextLen( nPara );
rEditEngine.QuickInsertText( rText, ESelection( nPara, nLen, nPara, nLen ) );
@@ -580,21 +580,21 @@ void SvxOutlinerForwarder::CopyText(const SvxTextForwarder& rSource)
//------------------------------------------------------------------------
-sal_Int16 SvxTextForwarder::GetNumberingStartValue( sal_uInt16 )
+sal_Int16 SvxTextForwarder::GetNumberingStartValue( sal_Int32 )
{
return -1;
}
-void SvxTextForwarder::SetNumberingStartValue( sal_uInt16, sal_Int16 )
+void SvxTextForwarder::SetNumberingStartValue( sal_Int32, sal_Int16 )
{
}
-sal_Bool SvxTextForwarder::IsParaIsNumberingRestart( sal_uInt16 )
+sal_Bool SvxTextForwarder::IsParaIsNumberingRestart( sal_Int32 )
{
return sal_False;
}
-void SvxTextForwarder::SetParaIsNumberingRestart( sal_uInt16, sal_Bool )
+void SvxTextForwarder::SetParaIsNumberingRestart( sal_Int32, sal_Bool )
{
}
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 659f0f163978..bdbf68a7fa4b 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -138,7 +138,7 @@ void GetSelection( struct ESelection& rSel, SvxTextForwarder* pForwarder ) throw
DBG_ASSERT( pForwarder, "I need a valid SvxTextForwarder!" );
if( pForwarder )
{
- sal_Int16 nParaCount = pForwarder->GetParagraphCount();
+ sal_Int32 nParaCount = pForwarder->GetParagraphCount();
if(nParaCount>0)
nParaCount--;
@@ -151,7 +151,7 @@ void CheckSelection( struct ESelection& rSel, SvxTextForwarder* pForwarder ) thr
DBG_ASSERT( pForwarder, "I need a valid SvxTextForwarder!" );
if( pForwarder )
{
- if( rSel.nStartPara == 0xffff )
+ if( rSel.nStartPara == EE_PARA_MAX_COUNT )
{
::GetSelection( rSel, pForwarder );
}
@@ -273,7 +273,7 @@ void SvxUnoTextRangeBase::SetEditSource( SvxEditSource* pSource ) throw()
mpEditSource = pSource;
- maSelection.nStartPara = 0xffff;
+ maSelection.nStartPara = EE_PARA_MAX_COUNT;
if( mpEditSource )
mpEditSource->addRange( this );
@@ -474,9 +474,9 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValue( const OUString& PropertyNa
while( nPara <= nEndPara )
{
// we have a paragraph
- SfxItemSet aSet( pForwarder->GetParaAttribs( (sal_uInt16)nPara ) );
+ SfxItemSet aSet( pForwarder->GetParaAttribs( nPara ) );
setPropertyValue( pMap, aValue, maSelection, aSet, aSet );
- pForwarder->SetParaAttribs( (sal_uInt16)nPara, aSet );
+ pForwarder->SetParaAttribs( nPara, aSet );
nPara++;
}
}
@@ -595,9 +595,9 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::getPropertyValue(const OUString& Property
{
const ESelection& rSel = GetSelection();
text::TextRangeSelection aSel;
- aSel.Start.Paragraph = static_cast<sal_Int32>(rSel.nStartPara);
+ aSel.Start.Paragraph = rSel.nStartPara;
aSel.Start.PositionInParagraph = static_cast<sal_Int32>(rSel.nStartPos);
- aSel.End.Paragraph = static_cast<sal_Int32>(rSel.nEndPara);
+ aSel.End.Paragraph = rSel.nEndPara;
aSel.End.PositionInParagraph = static_cast<sal_Int32>(rSel.nEndPos);
return uno::makeAny(aSel);
}
@@ -620,7 +620,7 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::_getPropertyValue(const OUString& Propert
{
SfxItemSet* pAttribs = NULL;
if( nPara != -1 )
- pAttribs = pForwarder->GetParaAttribs( (sal_uInt16)nPara ).Clone();
+ pAttribs = pForwarder->GetParaAttribs( nPara ).Clone();
else
pAttribs = pForwarder->GetAttribs( GetSelection() ).Clone();
@@ -829,7 +829,7 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValues( const uno::Sequence< ::rt
{
if( NULL == pNewParaSet )
{
- const SfxItemSet aSet( pForwarder->GetParaAttribs( (sal_uInt16)nTempPara ) );
+ const SfxItemSet aSet( pForwarder->GetParaAttribs( nTempPara ) );
pOldParaSet = new SfxItemSet( aSet );
pNewParaSet = new SfxItemSet( *pOldParaSet->GetPool(), pOldParaSet->GetRanges() );
}
@@ -857,9 +857,9 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValues( const uno::Sequence< ::rt
{
while( nTempPara <= nEndPara )
{
- SfxItemSet aSet( pForwarder->GetParaAttribs( (sal_uInt16)nTempPara ) );
+ SfxItemSet aSet( pForwarder->GetParaAttribs( nTempPara ) );
aSet.Put( *pNewParaSet );
- pForwarder->SetParaAttribs( (sal_uInt16)nTempPara, aSet );
+ pForwarder->SetParaAttribs( nTempPara, aSet );
nTempPara++;
}
bNeedsUpdate = sal_True;
@@ -905,7 +905,7 @@ uno::Sequence< uno::Any > SAL_CALL SvxUnoTextRangeBase::_getPropertyValues( cons
{
SfxItemSet* pAttribs = NULL;
if( nPara != -1 )
- pAttribs = pForwarder->GetParaAttribs( (sal_uInt16)nPara ).Clone();
+ pAttribs = pForwarder->GetParaAttribs( nPara ).Clone();
else
pAttribs = pForwarder->GetAttribs( GetSelection() ).Clone();
@@ -973,7 +973,7 @@ beans::PropertyState SAL_CALL SvxUnoTextRangeBase::_getPropertyState(const SfxIt
while( *pWhichId )
{
if(nPara != -1)
- eTempItemState = pForwarder->GetItemState( (sal_uInt16)nPara, *pWhichId );
+ eTempItemState = pForwarder->GetItemState( nPara, *pWhichId );
else
eTempItemState = pForwarder->GetItemState( GetSelection(), *pWhichId );
@@ -1022,7 +1022,7 @@ beans::PropertyState SAL_CALL SvxUnoTextRangeBase::_getPropertyState(const SfxIt
if( nWID != 0 )
{
if( nPara != -1 )
- eItemState = pForwarder->GetItemState( (sal_uInt16)nPara, nWID );
+ eItemState = pForwarder->GetItemState( nPara, nWID );
else
eItemState = pForwarder->GetItemState( GetSelection(), nWID );
}
@@ -1073,7 +1073,7 @@ uno::Sequence< beans::PropertyState > SvxUnoTextRangeBase::_getPropertyStates(co
SfxItemSet* pSet = NULL;
if( nPara != -1 )
{
- pSet = new SfxItemSet( pForwarder->GetParaAttribs( (sal_uInt16)nPara ) );
+ pSet = new SfxItemSet( pForwarder->GetParaAttribs( nPara ) );
}
else
{
@@ -1247,7 +1247,7 @@ void SvxUnoTextRangeBase::_setPropertyToDefault(SvxTextForwarder* pForwarder, co
}
if(nPara != -1)
- pForwarder->SetParaAttribs( (sal_uInt16)nPara, aSet );
+ pForwarder->SetParaAttribs( nPara, aSet );
else
pForwarder->QuickSetAttribs( aSet, GetSelection() );
@@ -1377,7 +1377,7 @@ sal_Bool SvxUnoTextRangeBase::GoLeft(sal_Int16 nCount, sal_Bool Expand) throw()
// #75098# use end position, as in Writer (start is anchor, end is cursor)
sal_uInt16 nNewPos = maSelection.nEndPos;
- sal_uInt16 nNewPar = maSelection.nEndPara;
+ sal_Int32 nNewPar = maSelection.nEndPara;
sal_Bool bOk = sal_True;
SvxTextForwarder* pForwarder = NULL;
@@ -1417,10 +1417,10 @@ sal_Bool SvxUnoTextRangeBase::GoRight(sal_Int16 nCount, sal_Bool Expand) throw(
CheckSelection( maSelection, pForwarder );
sal_uInt16 nNewPos = maSelection.nEndPos + nCount; //! Overflow???
- sal_uInt16 nNewPar = maSelection.nEndPara;
+ sal_Int32 nNewPar = maSelection.nEndPara;
sal_Bool bOk = sal_True;
- sal_uInt16 nParCount = pForwarder->GetParagraphCount();
+ sal_Int32 nParCount = pForwarder->GetParagraphCount();
sal_uInt16 nThisLen = pForwarder->GetTextLen( nNewPar );
while ( nNewPos > nThisLen && bOk )
{
@@ -1465,7 +1465,7 @@ void SvxUnoTextRangeBase::GotoEnd(sal_Bool Expand) throw()
if( pForwarder )
{
- sal_uInt16 nPar = pForwarder->GetParagraphCount();
+ sal_Int32 nPar = pForwarder->GetParagraphCount();
if (nPar)
--nPar;
@@ -2074,7 +2074,7 @@ void SvxPropertyValuesToItemSet(
const uno::Sequence< beans::PropertyValue > rPropertyVaules,
const SfxItemPropertySet *pPropSet,
SvxTextForwarder *pForwarder /*needed for WID_NUMLEVEL*/,
- sal_uInt16 nPara /*needed for WID_NUMLEVEL*/)
+ sal_Int32 nPara /*needed for WID_NUMLEVEL*/)
throw(lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException)
{
sal_Int32 nProps = rPropertyVaules.getLength();
@@ -2162,12 +2162,12 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::finishParagraph(
SvxTextForwarder *pTextForwarder = pEditSource ? pEditSource->GetTextForwarder() : 0;
if (pTextForwarder)
{
- sal_uInt16 nParaCount = pTextForwarder->GetParagraphCount();
+ sal_Int32 nParaCount = pTextForwarder->GetParagraphCount();
DBG_ASSERT( nParaCount > 0, "paragraph count is 0 or negative" );
pTextForwarder->AppendParagraph();
// set properties for the previously last paragraph
- sal_uInt16 nPara = nParaCount - 1;
+ sal_Int32 nPara = nParaCount - 1;
ESelection aSel( nPara, 0, nPara, 0 );
SfxItemSet aItemSet( *pTextForwarder->GetEmptyItemSetPtr() );
SvxPropertyValuesToItemSet( aItemSet, rCharAndParaProps,
@@ -2204,9 +2204,9 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::appendTextPortion(
uno::Reference< text::XTextRange > xRet;
if (pTextForwarder)
{
- sal_uInt16 nParaCount = pTextForwarder->GetParagraphCount();
+ sal_Int32 nParaCount = pTextForwarder->GetParagraphCount();
DBG_ASSERT( nParaCount > 0, "paragraph count is 0 or negative" );
- sal_uInt16 nPara = nParaCount - 1;
+ sal_Int32 nPara = nParaCount - 1;
SfxItemSet aSet( pTextForwarder->GetParaAttribs( nPara ) );
xub_StrLen nStart = pTextForwarder->AppendTextPortion( nPara, rText, aSet );
pEditSource->UpdateData();
@@ -2431,12 +2431,12 @@ void SvxDummyTextSource::UpdateData()
{
}
-sal_uInt16 SvxDummyTextSource::GetParagraphCount() const
+sal_Int32 SvxDummyTextSource::GetParagraphCount() const
{
return 0;
}
-sal_uInt16 SvxDummyTextSource::GetTextLen( sal_uInt16 ) const
+sal_uInt16 SvxDummyTextSource::GetTextLen( sal_Int32 ) const
{
return 0;
}
@@ -2454,12 +2454,12 @@ SfxItemSet SvxDummyTextSource::GetAttribs( const ESelection&, sal_Bool ) const
return SfxItemSet(EditEngine::GetGlobalItemPool());
}
-SfxItemSet SvxDummyTextSource::GetParaAttribs( sal_uInt16 ) const
+SfxItemSet SvxDummyTextSource::GetParaAttribs( sal_Int32 ) const
{
return GetAttribs(ESelection());
}
-void SvxDummyTextSource::SetParaAttribs( sal_uInt16, const SfxItemSet& )
+void SvxDummyTextSource::SetParaAttribs( sal_Int32, const SfxItemSet& )
{
}
@@ -2467,7 +2467,7 @@ void SvxDummyTextSource::RemoveAttribs( const ESelection& , sal_Bool , sal_uInt1
{
}
-void SvxDummyTextSource::GetPortions( sal_uInt16, std::vector<sal_uInt16>& ) const
+void SvxDummyTextSource::GetPortions( sal_Int32, std::vector<sal_uInt16>& ) const
{
}
@@ -2476,7 +2476,7 @@ sal_uInt16 SvxDummyTextSource::GetItemState( const ESelection&, sal_uInt16 ) con
return 0;
}
-sal_uInt16 SvxDummyTextSource::GetItemState( sal_uInt16, sal_uInt16 ) const
+sal_uInt16 SvxDummyTextSource::GetItemState( sal_Int32, sal_uInt16 ) const
{
return 0;
}
@@ -2502,12 +2502,12 @@ void SvxDummyTextSource::QuickInsertLineBreak( const ESelection& )
{
};
-XubString SvxDummyTextSource::CalcFieldValue( const SvxFieldItem&, sal_uInt16, sal_uInt16, Color*&, Color*& )
+XubString SvxDummyTextSource::CalcFieldValue( const SvxFieldItem&, sal_Int32, sal_uInt16, Color*&, Color*& )
{
return XubString();
}
-void SvxDummyTextSource::FieldClicked( const SvxFieldItem&, sal_uInt16, xub_StrLen )
+void SvxDummyTextSource::FieldClicked( const SvxFieldItem&, sal_Int32, xub_StrLen )
{
}
@@ -2520,32 +2520,32 @@ void SvxDummyTextSource::SetNotifyHdl( const Link& )
{
}
-LanguageType SvxDummyTextSource::GetLanguage( sal_uInt16, sal_uInt16 ) const
+LanguageType SvxDummyTextSource::GetLanguage( sal_Int32, sal_uInt16 ) const
{
return LANGUAGE_DONTKNOW;
}
-sal_uInt16 SvxDummyTextSource::GetFieldCount( sal_uInt16 ) const
+sal_uInt16 SvxDummyTextSource::GetFieldCount( sal_Int32 ) const
{
return 0;
}
-EFieldInfo SvxDummyTextSource::GetFieldInfo( sal_uInt16, sal_uInt16 ) const
+EFieldInfo SvxDummyTextSource::GetFieldInfo( sal_Int32, sal_uInt16 ) const
{
return EFieldInfo();
}
-EBulletInfo SvxDummyTextSource::GetBulletInfo( sal_uInt16 ) const
+EBulletInfo SvxDummyTextSource::GetBulletInfo( sal_Int32 ) const
{
return EBulletInfo();
}
-Rectangle SvxDummyTextSource::GetCharBounds( sal_uInt16, sal_uInt16 ) const
+Rectangle SvxDummyTextSource::GetCharBounds( sal_Int32, sal_uInt16 ) const
{
return Rectangle();
}
-Rectangle SvxDummyTextSource::GetParaBounds( sal_uInt16 ) const
+Rectangle SvxDummyTextSource::GetParaBounds( sal_Int32 ) const
{
return Rectangle();
}
@@ -2560,37 +2560,37 @@ OutputDevice* SvxDummyTextSource::GetRefDevice() const
return NULL;
}
-sal_Bool SvxDummyTextSource::GetIndexAtPoint( const Point&, sal_uInt16&, sal_uInt16& ) const
+sal_Bool SvxDummyTextSource::GetIndexAtPoint( const Point&, sal_Int32&, sal_uInt16& ) const
{
return sal_False;
}
-sal_Bool SvxDummyTextSource::GetWordIndices( sal_uInt16, sal_uInt16, sal_uInt16&, sal_uInt16& ) const
+sal_Bool SvxDummyTextSource::GetWordIndices( sal_Int32, sal_uInt16, sal_uInt16&, sal_uInt16& ) const
{
return sal_False;
}
-sal_Bool SvxDummyTextSource::GetAttributeRun( sal_uInt16&, sal_uInt16&, sal_uInt16, sal_uInt16 ) const
+sal_Bool SvxDummyTextSource::GetAttributeRun( sal_uInt16&, sal_uInt16&, sal_Int32, sal_uInt16 ) const
{
return sal_False;
}
-sal_uInt16 SvxDummyTextSource::GetLineCount( sal_uInt16 ) const
+sal_uInt16 SvxDummyTextSource::GetLineCount( sal_Int32 ) const
{
return 0;
}
-sal_uInt16 SvxDummyTextSource::GetLineLen( sal_uInt16, sal_uInt16 ) const
+sal_uInt16 SvxDummyTextSource::GetLineLen( sal_Int32, sal_uInt16 ) const
{
return 0;
}
-void SvxDummyTextSource::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 /*nParagraph*/, sal_uInt16 /*nLine*/ ) const
+void SvxDummyTextSource::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 /*nParagraph*/, sal_uInt16 /*nLine*/ ) const
{
rStart = rEnd = 0;
}
-sal_uInt16 SvxDummyTextSource::GetLineNumberAtIndex( sal_uInt16 /*nPara*/, sal_uInt16 /*nIndex*/ ) const
+sal_uInt16 SvxDummyTextSource::GetLineNumberAtIndex( sal_Int32 /*nPara*/, sal_uInt16 /*nIndex*/ ) const
{
return 0;
}
@@ -2600,12 +2600,12 @@ sal_Bool SvxDummyTextSource::QuickFormatDoc( sal_Bool )
return sal_False;
}
-sal_Int16 SvxDummyTextSource::GetDepth( sal_uInt16 ) const
+sal_Int16 SvxDummyTextSource::GetDepth( sal_Int32 ) const
{
return -1;
}
-sal_Bool SvxDummyTextSource::SetDepth( sal_uInt16, sal_Int16 nNewDepth )
+sal_Bool SvxDummyTextSource::SetDepth( sal_Int32, sal_Int16 nNewDepth )
{
return nNewDepth == 0 ? sal_True : sal_False;
}
@@ -2629,7 +2629,7 @@ void SvxDummyTextSource::AppendParagraph()
{
}
-xub_StrLen SvxDummyTextSource::AppendTextPortion( sal_uInt16, const String &, const SfxItemSet & )
+xub_StrLen SvxDummyTextSource::AppendTextPortion( sal_Int32, const String &, const SfxItemSet & )
{
return 0;
}
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index 886b99e23e7a..4c6f57004a63 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -98,7 +98,7 @@ uno::Any SvxUnoTextContentEnumeration::nextElement(void) throw( container::NoSuc
// class SvxUnoTextContent
// ====================================================================
-SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw()
+SvxUnoTextContent::SvxUnoTextContent( const SvxUnoTextBase& rText, sal_Int32 nPara ) throw()
: SvxUnoTextRangeBase(rText)
, mnParagraph(nPara)
, mrParentText(rText)
@@ -384,7 +384,7 @@ uno::Sequence< OUString > SAL_CALL SvxUnoTextContent::getSupportedServiceNames()
// class SvxUnoTextRangeEnumeration
// ====================================================================
-SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rText, sal_uInt16 nPara ) throw()
+SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration( const SvxUnoTextBase& rText, sal_Int32 nPara ) throw()
: mxParentText( const_cast<SvxUnoTextBase*>(&rText) ),
mrParentText( rText ),
mnParagraph( nPara ),
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 381311259b2a..ac5e58fdc7de 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3471,7 +3471,7 @@ void SvxMSDffManager::ReadObjText( const String& rText, SdrObject* pObj ) const
rOutliner.SetUpdateMode( sal_False );
rOutliner.SetVertical( pText->IsVerticalWriting() );
- sal_uInt16 nParaIndex = 0;
+ sal_Int32 nParaIndex = 0;
sal_Int32 nParaSize;
const sal_Unicode* pCurrent, *pBuf = rText.GetBuffer();
const sal_Unicode* pEnd = rText.GetBuffer() + rText.Len();
@@ -4233,7 +4233,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
rOutliner.SetText( *pParaObj );
VirtualDevice aVirDev( 1 );
aVirDev.SetMapMode( MAP_100TH_MM );
- sal_uInt32 i, nParagraphs = rOutliner.GetParagraphCount();
+ sal_Int32 i, nParagraphs = rOutliner.GetParagraphCount();
if ( nParagraphs )
{
sal_Bool bCreateNewParaObject = sal_False;
@@ -4242,9 +4242,9 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
sal_Bool bIsRTL = aVirDev.GetTextIsRTL( rOutliner.GetText( rOutliner.GetParagraph( i ) ), 0, STRING_LEN );
if ( bIsRTL )
{
- SfxItemSet aSet2( rOutliner.GetParaAttribs( (sal_uInt16)i ) );
+ SfxItemSet aSet2( rOutliner.GetParaAttribs( i ) );
aSet2.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
- rOutliner.SetParaAttribs( (sal_uInt16)i, aSet2 );
+ rOutliner.SetParaAttribs( i, aSet2 );
bCreateNewParaObject = sal_True;
}
}
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index beb774b52579..83e32a9d8700 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2243,7 +2243,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
nCurrentIndex += nCharacters;
}
}
- sal_uInt16 nParaIndex = (sal_uInt16)pTextObj->GetCurrentIndex();
+ sal_Int32 nParaIndex = pTextObj->GetCurrentIndex();
SfxStyleSheet* pS = ( ppStyleSheetAry ) ? ppStyleSheetAry[ pPara->pParaSet->mnDepth ] : pSheet;
ESelection aSelection( nParaIndex, 0, nParaIndex, 0 );
diff --git a/forms/source/richtext/specialdispatchers.cxx b/forms/source/richtext/specialdispatchers.cxx
index ef1168c2a7a8..759618843ea6 100644
--- a/forms/source/richtext/specialdispatchers.cxx
+++ b/forms/source/richtext/specialdispatchers.cxx
@@ -68,10 +68,10 @@ namespace frm
if ( !pEngine )
return;
- sal_uInt16 nParagraphs = pEngine->GetParagraphCount();
+ sal_Int32 nParagraphs = pEngine->GetParagraphCount();
if ( nParagraphs )
{
- sal_uInt16 nLastParaNumber = nParagraphs - 1;
+ sal_Int32 nLastParaNumber = nParagraphs - 1;
xub_StrLen nParaLen = pEngine->GetTextLen( nLastParaNumber );
getEditView()->SetSelection( ESelection( 0, 0, nLastParaNumber, nParaLen ) );
}
diff --git a/sc/inc/editutil.hxx b/sc/inc/editutil.hxx
index 5fbf6dc8eb1c..973c01d3d4ec 100644
--- a/sc/inc/editutil.hxx
+++ b/sc/inc/editutil.hxx
@@ -205,8 +205,8 @@ public:
void SetExecuteURL(bool bSet) { bExecuteURL = bSet; }
- virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16, sal_uInt16 );
- virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor );
+ virtual void FieldClicked( const SvxFieldItem& rField, sal_Int32, sal_uInt16 );
+ virtual String CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor );
};
@@ -218,7 +218,7 @@ private:
public:
ScHeaderEditEngine( SfxItemPool* pEnginePool, sal_Bool bDeleteEnginePool = false );
- virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor );
+ virtual String CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor );
void SetNumType(SvxNumType eNew) { aData.eNumType = eNew; }
void SetData(const ScHeaderFieldData& rNew) { aData = rNew; }
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index 8bb813a0a81c..614a256e5053 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -756,8 +756,8 @@ static void lcl_SetSpace( String& rStr, const ESelection& rSel )
static bool lcl_ConvertFields(EditEngine& rEng, const String* pCommands)
{
bool bChange = false;
- sal_uInt16 nParCnt = rEng.GetParagraphCount();
- for (sal_uInt16 nPar = 0; nPar<nParCnt; nPar++)
+ sal_Int32 nParCnt = rEng.GetParagraphCount();
+ for (sal_Int32 nPar = 0; nPar<nParCnt; nPar++)
{
String aStr = rEng.GetText( nPar );
xub_StrLen nPos;
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index c782f89ed53b..bee92eda57a4 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -955,8 +955,8 @@ void ScColumn::RemoveEditAttribs( SCROW nStartRow, SCROW nEndRow )
pDocument->ApplyAsianEditSettings( *pEngine );
}
pEngine->SetText( *pData );
- sal_uInt16 nParCount = pEngine->GetParagraphCount();
- for (sal_uInt16 nPar=0; nPar<nParCount; nPar++)
+ sal_Int32 nParCount = pEngine->GetParagraphCount();
+ for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
{
pEngine->QuickRemoveCharAttribs( nPar );
const SfxItemSet& rOld = pEngine->GetParaAttribs( nPar );
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index b83b63f1f995..aa0ff0e3d0e3 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1561,7 +1561,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp
}
pEngine->ClearModifyFlag();
- sal_uInt16 nLastPar = pEngine->GetParagraphCount();
+ sal_Int32 nLastPar = pEngine->GetParagraphCount();
if (nLastPar)
--nLastPar;
xub_StrLen nTxtLen = pEngine->GetTextLen(nLastPar);
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 74ba29bb6331..75d20be604c4 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -902,10 +902,10 @@ sal_Bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1,
if ( pObj1 && pObj2 )
{
// first test for equal text content
- sal_uInt16 nParCount = pObj1->GetParagraphCount();
+ sal_Int32 nParCount = pObj1->GetParagraphCount();
if ( nParCount != pObj2->GetParagraphCount() )
return false;
- for (sal_uInt16 nPar=0; nPar<nParCount; nPar++)
+ for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
if ( pObj1->GetText(nPar) != pObj2->GetText(nPar) )
return false;
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index d3e06705319e..29dd75b934ee 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -557,7 +557,7 @@ OUString ScPostIt::GetText() const
if( const EditTextObject* pEditObj = GetEditTextObject() )
{
OUStringBuffer aBuffer;
- for( sal_uInt16 nPara = 0, nParaCount = pEditObj->GetParagraphCount(); nPara < nParaCount; ++nPara )
+ for( sal_Int32 nPara = 0, nParaCount = pEditObj->GetParagraphCount(); nPara < nParaCount; ++nPara )
{
if( nPara > 0 )
aBuffer.append( sal_Unicode( '\n' ) );
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 5fd4de45de96..661ecf6c8bcd 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -70,8 +70,8 @@ String ScEditUtil::ModifyDelimiters( const String& rOld )
static String lcl_GetDelimitedString( const EditEngine& rEngine, const sal_Char c )
{
String aRet;
- sal_uInt16 nParCount = rEngine.GetParagraphCount();
- for (sal_uInt16 nPar=0; nPar<nParCount; nPar++)
+ sal_Int32 nParCount = rEngine.GetParagraphCount();
+ for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
{
if (nPar > 0)
aRet += c;
@@ -324,8 +324,8 @@ void ScEditEngineDefaulter::SetDefaults( const SfxItemSet& rSet, sal_Bool bRemem
sal_Bool bUpdateMode = GetUpdateMode();
if ( bUpdateMode )
SetUpdateMode( false );
- sal_uInt16 nPara = GetParagraphCount();
- for ( sal_uInt16 j=0; j<nPara; j++ )
+ sal_Int32 nPara = GetParagraphCount();
+ for ( sal_Int32 j=0; j<nPara; j++ )
{
SetParaAttribs( j, rNewSet );
}
@@ -445,8 +445,8 @@ void ScEditEngineDefaulter::RepeatDefaults()
{
if ( pDefaults )
{
- sal_uInt16 nPara = GetParagraphCount();
- for ( sal_uInt16 j=0; j<nPara; j++ )
+ sal_Int32 nPara = GetParagraphCount();
+ for ( sal_Int32 j=0; j<nPara; j++ )
SetParaAttribs( j, *pDefaults );
}
}
@@ -457,8 +457,8 @@ void ScEditEngineDefaulter::RemoveParaAttribs()
sal_Bool bUpdateMode = GetUpdateMode();
if ( bUpdateMode )
SetUpdateMode( false );
- sal_uInt16 nParCount = GetParagraphCount();
- for (sal_uInt16 nPar=0; nPar<nParCount; nPar++)
+ sal_Int32 nParCount = GetParagraphCount();
+ for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
{
const SfxItemSet& rParaAttribs = GetParaAttribs( nPar );
sal_uInt16 nWhich;
@@ -634,7 +634,7 @@ ScHeaderEditEngine::ScHeaderEditEngine( SfxItemPool* pEnginePoolP, sal_Bool bDel
}
String ScHeaderEditEngine::CalcFieldValue( const SvxFieldItem& rField,
- sal_uInt16 /* nPara */, sal_uInt16 /* nPos */,
+ sal_Int32 /* nPara */, sal_uInt16 /* nPos */,
Color*& /* rTxtColor */, Color*& /* rFldColor */ )
{
const SvxFieldData* pFieldData = rField.GetField();
@@ -704,7 +704,7 @@ ScFieldEditEngine::ScFieldEditEngine(
}
String ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField,
- sal_uInt16 /* nPara */, sal_uInt16 /* nPos */,
+ sal_Int32 /* nPara */, sal_uInt16 /* nPos */,
Color*& rTxtColor, Color*& /* rFldColor */ )
{
rtl::OUString aRet;
@@ -781,7 +781,7 @@ String ScFieldEditEngine::CalcFieldValue( const SvxFieldItem& rField,
return aRet;
}
-void ScFieldEditEngine::FieldClicked( const SvxFieldItem& rField, sal_uInt16, sal_uInt16 )
+void ScFieldEditEngine::FieldClicked( const SvxFieldItem& rField, sal_Int32, sal_uInt16 )
{
const SvxFieldData* pFld = rField.GetField();
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index 81e9ac2fa52a..305b497efea3 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -437,8 +437,8 @@ XclExpStringRef lclCreateFormattedString(
sal_Int16 nLastScript = XclExpStringHelper::GetLeadingScriptType( rRoot, rEE.GetText() );
// process all paragraphs
- sal_uInt16 nParaCount = rEE.GetParagraphCount();
- for( sal_uInt16 nPara = 0; nPara < nParaCount; ++nPara )
+ sal_Int32 nParaCount = rEE.GetParagraphCount();
+ for( sal_Int32 nPara = 0; nPara < nParaCount; ++nPara )
{
ESelection aSel( nPara, 0 );
String aParaText( rEE.GetText( nPara ) );
@@ -716,8 +716,8 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico
pFontList = pInfoItem->GetFontList();
}
- sal_uInt16 nParaCount = mrEE.GetParagraphCount();
- for( sal_uInt16 nPara = 0; nPara < nParaCount; ++nPara )
+ sal_Int32 nParaCount = mrEE.GetParagraphCount();
+ for( sal_Int32 nPara = 0; nPara < nParaCount; ++nPara )
{
ESelection aSel( nPara, 0 );
String aParaText;
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 7e09fb4decce..937f3c5b87f9 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -183,7 +183,7 @@ void lclInsertUrl( const XclImpRoot& rRoot, const String& rUrl, SCCOL nScCol, SC
if( pEditObj )
{
rEE.SetText( *pEditObj );
- rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), ESelection( 0, 0, 0xFFFF, 0 ) );
+ rEE.QuickInsertField( SvxFieldItem( aUrlField, EE_FEATURE_FIELD ), ESelection( 0, 0, EE_PARA_ALL, 0 ) );
}
else
{
@@ -193,7 +193,7 @@ void lclInsertUrl( const XclImpRoot& rRoot, const String& rUrl, SCCOL nScCol, SC
{
SfxItemSet aItemSet( rEE.GetEmptyItemSet() );
pPattern->FillEditItemSet( &aItemSet );
- rEE.QuickSetAttribs( aItemSet, ESelection( 0, 0, 0xFFFF, 0 ) );
+ rEE.QuickSetAttribs( aItemSet, ESelection( 0, 0, EE_PARA_ALL, 0 ) );
}
}
SAL_WNODEPRECATED_DECLARATIONS_PUSH
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 5045dd7daee9..f6b9387c1398 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -1212,7 +1212,7 @@ sal_Bool ScHTMLExport::WriteFieldText( const ScEditCell* pCell )
// text and anchor of URL fields, Doc-Engine is a ScFieldEditEngine
EditEngine& rEngine = pDoc->GetEditEngine();
rEngine.SetText( *pData );
- sal_uInt16 nParas = rEngine.GetParagraphCount();
+ sal_Int32 nParas = rEngine.GetParagraphCount();
if ( nParas )
{
ESelection aSel( 0, 0, nParas-1, rEngine.GetTextLen( nParas-1 ) );
@@ -1225,7 +1225,7 @@ sal_Bool ScHTMLExport::WriteFieldText( const ScEditCell* pCell )
{
sal_Bool bOldUpdateMode = rEngine.GetUpdateMode();
rEngine.SetUpdateMode( sal_True ); // no portions if not formatted
- for ( sal_uInt16 nPar=0; nPar < nParas; nPar++ )
+ for ( sal_Int32 nPar=0; nPar < nParas; nPar++ )
{
if ( nPar > 0 )
TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak );
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 11cca6dd7afb..69f214d5ddf7 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -814,7 +814,7 @@ void ScInputHandler::ShowTipCursor()
if ( bFormulaMode && pActiveView && pFormulaDataPara && pEngine->GetParagraphCount() == 1 )
{
- String aFormula = pEngine->GetText( (sal_uInt16) 0 );
+ String aFormula = pEngine->GetText( 0 );
ESelection aSel = pActiveView->GetSelection();
aSel.Adjust();
if( aSel.nEndPos )
@@ -1041,7 +1041,7 @@ void ScInputHandler::UseFormulaData()
// Formeln duerfen nur 1 Absatz haben
if ( pActiveView && pFormulaData && pEngine->GetParagraphCount() == 1 )
{
- String aTotal = pEngine->GetText( (sal_uInt16) 0 );
+ String aTotal = pEngine->GetText( 0 );
ESelection aSel = pActiveView->GetSelection();
aSel.Adjust();
@@ -1248,7 +1248,7 @@ static void lcl_CompleteFunction( EditView* pView, const String& rInsert, bool&
// schon eine Klammer steht (z.B. wenn der Funktionsname geaendert wurde).
ESelection aWordSel = pView->GetSelection();
- String aOld = pView->GetEditEngine()->GetText((sal_uInt16)0);
+ String aOld = pView->GetEditEngine()->GetText(0);
sal_Unicode cNext = aOld.GetChar(aWordSel.nEndPos);
if ( cNext == '(' )
{
@@ -1385,7 +1385,7 @@ void ScInputHandler::FormulaPreview()
{
String aPart = pActiveView->GetSelected();
if (!aPart.Len())
- aPart = pEngine->GetText((sal_uInt16)0);
+ aPart = pEngine->GetText(0);
ScDocument* pDoc = pActiveViewSh->GetViewData()->GetDocShell()->GetDocument();
aValue = lcl_Calculate( aPart, pDoc, aCursorPos );
}
@@ -1482,7 +1482,7 @@ bool ScInputHandler::CursorAtClosingPar()
{
ESelection aSel = pActiveView->GetSelection();
xub_StrLen nPos = aSel.nStartPos;
- String aFormula = pEngine->GetText((sal_uInt16)0);
+ String aFormula = pEngine->GetText(0);
if ( nPos < aFormula.Len() && aFormula.GetChar(nPos) == ')' )
return true;
}
@@ -1550,7 +1550,7 @@ void ScInputHandler::UseColData() // beim Tippen
ESelection aSel = pActiveView->GetSelection();
aSel.Adjust();
- sal_uInt16 nParCnt = pEngine->GetParagraphCount();
+ sal_Int32 nParCnt = pEngine->GetParagraphCount();
if ( aSel.nEndPara+1 == nParCnt )
{
xub_StrLen nParLen = pEngine->GetTextLen( aSel.nEndPara );
@@ -1625,7 +1625,7 @@ void ScInputHandler::NextAutoEntry( bool bBack )
ESelection aSel = pActiveView->GetSelection();
aSel.Adjust();
- sal_uInt16 nParCnt = pEngine->GetParagraphCount();
+ sal_Int32 nParCnt = pEngine->GetParagraphCount();
if ( aSel.nEndPara+1 == nParCnt && aSel.nStartPara == aSel.nEndPara )
{
rtl::OUString aText = GetEditText(pEngine);
@@ -1698,7 +1698,7 @@ void ScInputHandler::UpdateParenthesis()
// Das Zeichen links vom Cursor wird angeschaut
xub_StrLen nPos = aSel.nStartPos - 1;
- String aFormula = pEngine->GetText((sal_uInt16)0);
+ String aFormula = pEngine->GetText(0);
sal_Unicode c = aFormula.GetChar(nPos);
if ( c == '(' || c == ')' )
{
@@ -1712,8 +1712,8 @@ void ScInputHandler::UpdateParenthesis()
if (bParenthesisShown)
{
// alte Hervorhebung wegnehmen
- sal_uInt16 nCount = pEngine->GetParagraphCount();
- for (sal_uInt16 i=0; i<nCount; i++)
+ sal_Int32 nCount = pEngine->GetParagraphCount();
+ for (sal_Int32 i=0; i<nCount; i++)
pEngine->QuickRemoveCharAttribs( i, EE_CHAR_WEIGHT );
}
@@ -1739,8 +1739,8 @@ void ScInputHandler::UpdateParenthesis()
if ( bParenthesisShown && !bFound && pTableView )
{
- sal_uInt16 nCount = pEngine->GetParagraphCount();
- for (sal_uInt16 i=0; i<nCount; i++)
+ sal_Int32 nCount = pEngine->GetParagraphCount();
+ for (sal_Int32 i=0; i<nCount; i++)
pTableView->RemoveCharAttribs( i, EE_CHAR_WEIGHT );
}
@@ -1911,8 +1911,8 @@ void ScInputHandler::RemoveRangeFinder()
// pRangeFindList und Farben loeschen
pEngine->SetUpdateMode(false);
- sal_uInt16 nCount = pEngine->GetParagraphCount(); // koennte gerade neu eingefuegt worden sein
- for (sal_uInt16 i=0; i<nCount; i++)
+ sal_Int32 nCount = pEngine->GetParagraphCount(); // koennte gerade neu eingefuegt worden sein
+ for (sal_Int32 i=0; i<nCount; i++)
pEngine->QuickRemoveCharAttribs( i, EE_CHAR_COLOR );
pEngine->SetUpdateMode(true);
@@ -2102,7 +2102,7 @@ static void lcl_SetTopSelection( EditView* pEditView, ESelection& rSel )
OSL_ENSURE( rSel.nStartPara==0 && rSel.nEndPara==0, "SetTopSelection: Para != 0" );
EditEngine* pEngine = pEditView->GetEditEngine();
- sal_uInt16 nCount = pEngine->GetParagraphCount();
+ sal_Int32 nCount = pEngine->GetParagraphCount();
if (nCount > 1)
{
xub_StrLen nParLen = pEngine->GetTextLen(rSel.nStartPara);
@@ -2262,9 +2262,9 @@ void ScInputHandler::UpdateFormulaMode()
SfxApplication* pSfxApp = SFX_APP();
if ( pEngine->GetParagraphCount() == 1 &&
- ( pEngine->GetText((sal_uInt16)0).GetChar(0) == '=' ||
- pEngine->GetText((sal_uInt16)0).GetChar(0) == '+' ||
- pEngine->GetText((sal_uInt16)0).GetChar(0) == '-' ) &&
+ ( pEngine->GetText(0).GetChar(0) == '=' ||
+ pEngine->GetText(0).GetChar(0) == '+' ||
+ pEngine->GetText(0).GetChar(0) == '-' ) &&
!bProtected )
{
if (!bFormulaMode)
@@ -2413,7 +2413,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode )
}
}
- sal_uInt16 nPara = pEngine->GetParagraphCount()-1;
+ sal_Int32 nPara = pEngine->GetParagraphCount()-1;
xub_StrLen nLen = pEngine->GetText(nPara).Len();
sal_uInt16 nCount = pEngine->GetViewCount();
@@ -2471,7 +2471,7 @@ static void lcl_SelectionToEnd( EditView* pView )
if ( pView )
{
EditEngine* pEngine = pView->GetEditEngine();
- sal_uInt16 nParCnt = pEngine->GetParagraphCount();
+ sal_Int32 nParCnt = pEngine->GetParagraphCount();
if ( nParCnt == 0 )
nParCnt = 1;
ESelection aSel( nParCnt-1, pEngine->GetTextLen(nParCnt-1) ); // empty selection, cursor at the end
@@ -2597,13 +2597,13 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
if ( bModified && !bForget ) // was wird eingeben (Text/Objekt) ?
{
- sal_uInt16 nParCnt = pEngine->GetParagraphCount();
+ sal_Int32 nParCnt = pEngine->GetParagraphCount();
if ( nParCnt == 0 )
nParCnt = 1;
bool bUniformAttribs = true;
SfxItemSet aPara1Attribs = pEngine->GetAttribs(0, 0, pEngine->GetTextLen(0));
- for (sal_uInt16 nPara = 1; nPara < nParCnt; ++nPara)
+ for (sal_Int32 nPara = 1; nPara < nParCnt; ++nPara)
{
SfxItemSet aPara2Attribs = pEngine->GetAttribs(nPara, 0, pEngine->GetTextLen(nPara));
if (!(aPara1Attribs == aPara2Attribs))
@@ -3758,7 +3758,7 @@ bool ScInputHandler::GetTextAndFields( ScEditEngineDefaulter& rDestEngine )
{
// Feldbefehle enthalten?
- sal_uInt16 nParCnt = pEngine->GetParagraphCount();
+ sal_Int32 nParCnt = pEngine->GetParagraphCount();
SfxItemSet aSet = pEngine->GetAttribs( ESelection(0,0,nParCnt,0) );
SfxItemState eFieldState = aSet.GetItemState( EE_FEATURE_FIELD, false );
if ( eFieldState == SFX_ITEM_DONTCARE || eFieldState == SFX_ITEM_SET )
@@ -3771,14 +3771,14 @@ bool ScInputHandler::GetTextAndFields( ScEditEngineDefaulter& rDestEngine )
// Attribute loeschen
- for (sal_uInt16 i=0; i<nParCnt; i++)
+ for (sal_Int32 i=0; i<nParCnt; i++)
rDestEngine.QuickRemoveCharAttribs( i );
// Absaetze zusammenfassen
while ( nParCnt > 1 )
{
- xub_StrLen nLen = rDestEngine.GetTextLen( (sal_uInt16)0 );
+ xub_StrLen nLen = rDestEngine.GetTextLen( 0 );
ESelection aSel( 0,nLen, 1,0 );
rDestEngine.QuickInsertText( rtl::OUString(' '), aSel ); // Umbruch durch Space ersetzen
--nParCnt;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 7ece5d92f669..b9d157dde24c 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -729,7 +729,7 @@ void ScInputWindow::SwitchToTextWin()
EditView* pView = aTextWindow.GetEditView();
if (pView)
{
- sal_uInt16 nPara = pView->GetEditEngine()->GetParagraphCount() ? ( pView->GetEditEngine()->GetParagraphCount() - 1 ) : 0;
+ sal_Int32 nPara = pView->GetEditEngine()->GetParagraphCount() ? ( pView->GetEditEngine()->GetParagraphCount() - 1 ) : 0;
xub_StrLen nLen = pView->GetEditEngine()->GetTextLen( nPara );
ESelection aSel( nPara, nLen, nPara, nLen );
pView->SetSelection( aSel ); // set cursor to end of text
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 3560ac1f1906..a5174f7c7478 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -425,7 +425,7 @@ sal_Bool ScTransferObj::WriteObject( SotStorageStreamRef& rxOStm, void* pUserObj
// write old format without support for unicode characters.
// Get the data from the EditEngine's transferable instead.
- sal_uInt16 nParCnt = pEngine->GetParagraphCount();
+ sal_Int32 nParCnt = pEngine->GetParagraphCount();
if ( nParCnt == 0 )
nParCnt = 1;
ESelection aSel( 0, 0, nParCnt-1, pEngine->GetTextLen(nParCnt-1) );
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index bbd6c961bdb0..831dcf634f93 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -893,10 +893,10 @@ void ScDocFunc::NotifyInputHandler( const ScAddress& rPos )
struct ScMyRememberItem
{
- sal_uInt16 nIndex;
+ sal_Int32 nIndex;
SfxItemSet aItemSet;
- ScMyRememberItem(const SfxItemSet& rItemSet, sal_uInt16 nTempIndex) :
+ ScMyRememberItem(const SfxItemSet& rItemSet, sal_Int32 nTempIndex) :
nIndex(nTempIndex), aItemSet(rItemSet) {}
};
@@ -928,8 +928,8 @@ sal_Bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngi
// not only alignment, so the object doesn't contain the cell attributes as
// paragraph attributes. Before remove the attributes store they in a list to
// set they back to the EditEngine.
- sal_uInt16 nCount = rEngine.GetParagraphCount();
- for (sal_uInt16 i=0; i<nCount; i++)
+ sal_Int32 nCount = rEngine.GetParagraphCount();
+ for (sal_Int32 i=0; i<nCount; i++)
{
const SfxItemSet& rOld = rEngine.GetParaAttribs( i );
if ( rOld.Count() )
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index c2dd01731beb..7649830cb1d2 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -198,8 +198,8 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
case SID_SELECTALL:
{
- sal_uLong nCount = pOutliner->GetParagraphCount();
- ESelection aSel( 0,0,(sal_uInt16)nCount,0 );
+ sal_Int32 nCount = pOutliner->GetParagraphCount();
+ ESelection aSel( 0,0,nCount,0 );
pOutView->SetSelection( aSel );
}
break;
@@ -604,12 +604,12 @@ static void lcl_RemoveFields( OutlinerView& rOutView )
//! GetPortions and GetAttribs should be const!
EditEngine& rEditEng = (EditEngine&)pOutliner->GetEditEngine();
- sal_uLong nParCount = pOutliner->GetParagraphCount();
- for (sal_uLong nPar=0; nPar<nParCount; nPar++)
+ sal_Int32 nParCount = pOutliner->GetParagraphCount();
+ for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
if ( nPar >= aSel.nStartPara && nPar <= aSel.nEndPara )
{
std::vector<sal_uInt16> aPortions;
- rEditEng.GetPortions( (sal_uInt16)nPar, aPortions );
+ rEditEng.GetPortions( nPar, aPortions );
//! GetPortions should use xub_StrLen instead of USHORT
for ( size_t nPos = aPortions.size(); nPos; )
@@ -622,7 +622,7 @@ static void lcl_RemoveFields( OutlinerView& rOutView )
( nPar > aSel.nStartPara || nStart >= aSel.nStartPos ) &&
( nPar < aSel.nEndPara || nEnd <= aSel.nEndPos ) )
{
- ESelection aFieldSel( (sal_uInt16)nPar, nStart, (sal_uInt16)nPar, nEnd );
+ ESelection aFieldSel( nPar, nStart, nPar, nEnd );
SfxItemSet aSet = rEditEng.GetAttribs( aFieldSel );
if ( aSet.GetItemState( EE_FEATURE_FIELD ) == SFX_ITEM_ON )
{
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index cd6699f02ddf..1c8dbc098f65 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -143,8 +143,8 @@ EditTextObject* ScEditWindow::CreateTextObject()
// (GetAttribs beim Format-Dialog-Aufruf gibt immer gesetzte Items zurueck)
const SfxItemSet& rEmpty = pEdEngine->GetEmptyItemSet();
- sal_uInt16 nParCnt = pEdEngine->GetParagraphCount();
- for (sal_uInt16 i=0; i<nParCnt; i++)
+ sal_Int32 nParCnt = pEdEngine->GetParagraphCount();
+ for (sal_Int32 i=0; i<nParCnt; i++)
pEdEngine->SetParaAttribs( i, rEmpty );
return pEdEngine->CreateTextObject();
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index dd97c91e62fb..3a1b4dc33564 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -173,7 +173,7 @@ class ScUnoEditEngine : public ScEditEngineDefaulter
sal_uInt16 nFieldCount;
sal_Int32 mnFieldType;
SvxFieldData* pFound; // lokale Kopie
- sal_uInt16 nFieldPar;
+ sal_Int32 nFieldPar;
xub_StrLen nFieldPos;
sal_uInt16 nFieldIndex;
@@ -182,14 +182,14 @@ public:
~ScUnoEditEngine();
//! nPos should be xub_StrLen
- virtual String CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+ virtual String CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
Color*& rTxtColor, Color*& rFldColor );
sal_uInt16 CountFields();
SvxFieldData* FindByIndex(sal_uInt16 nIndex);
- SvxFieldData* FindByPos(sal_uInt16 nPar, xub_StrLen nPos, sal_Int32 nType);
+ SvxFieldData* FindByPos(sal_Int32 nPar, xub_StrLen nPos, sal_Int32 nType);
- sal_uInt16 GetFieldPar() const { return nFieldPar; }
+ sal_Int32 GetFieldPar() const { return nFieldPar; }
xub_StrLen GetFieldPos() const { return nFieldPos; }
};
@@ -214,7 +214,7 @@ ScUnoEditEngine::~ScUnoEditEngine()
}
String ScUnoEditEngine::CalcFieldValue( const SvxFieldItem& rField,
- sal_uInt16 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor )
+ sal_Int32 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor )
{
String aRet(EditEngine::CalcFieldValue( rField, nPara, nPos, rTxtColor, rFldColor ));
if (eMode != SC_UNO_COLLECT_NONE)
@@ -266,7 +266,7 @@ SvxFieldData* ScUnoEditEngine::FindByIndex(sal_uInt16 nIndex)
return pFound;
}
-SvxFieldData* ScUnoEditEngine::FindByPos(sal_uInt16 nPar, xub_StrLen nPos, sal_Int32 nType)
+SvxFieldData* ScUnoEditEngine::FindByPos(sal_Int32 nPar, xub_StrLen nPos, sal_Int32 nType)
{
eMode = SC_UNO_COLLECT_FINDPOS;
nFieldPar = nPar;
@@ -343,7 +343,7 @@ uno::Reference<text::XTextField> ScCellFieldsObj::GetObjectByIndex_Impl(sal_Int3
if (!pData)
return uno::Reference<text::XTextField>();
- sal_uInt16 nPar = aTempEngine.GetFieldPar();
+ sal_Int32 nPar = aTempEngine.GetFieldPar();
xub_StrLen nPos = aTempEngine.GetFieldPos();
ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Feld ist 1 Zeichen
@@ -524,7 +524,7 @@ uno::Reference<text::XTextField> ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_In
uno::Reference<text::XTextRange> xTemp(xText, uno::UNO_QUERY);
xTextRange = xTemp;
- sal_uInt16 nPar = aTempEngine.GetFieldPar();
+ sal_Int32 nPar = aTempEngine.GetFieldPar();
xub_StrLen nPos = aTempEngine.GetFieldPos();
ESelection aSelection( nPar, nPos, nPar, nPos+1 ); // Field is 1 character
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index b24342ea3f21..210555e7e369 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -304,7 +304,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
case SID_SELECTALL:
{
- sal_uInt16 nPar = pEngine->GetParagraphCount();
+ sal_Int32 nPar = pEngine->GetParagraphCount();
if (nPar)
{
xub_StrLen nLen = pEngine->GetTextLen(nPar-1);
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 6fa83c32c95d..afc7f4a0be54 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2082,8 +2082,8 @@ static void lcl_ScaleFonts( EditEngine& rEngine, long nPercent )
if ( bUpdateMode )
rEngine.SetUpdateMode( false );
- sal_uInt16 nParCount = rEngine.GetParagraphCount();
- for (sal_uInt16 nPar=0; nPar<nParCount; nPar++)
+ sal_Int32 nParCount = rEngine.GetParagraphCount();
+ for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
{
std::vector<sal_uInt16> aPortions;
rEngine.GetPortions( nPar, aPortions );
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index c1ce5ff2dc65..c04199ea5711 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1326,7 +1326,7 @@ void ScViewData::EditGrowY( sal_Bool bInitial )
// because this occurs in the normal progress of editing a formula.
// Subsequent calls with empty text might involve changed attributes (including
// font height), so they are treated like normal text.
- String aText = pEngine->GetText( (sal_uInt16) 0 );
+ String aText = pEngine->GetText( 0 );
if ( ( aText.Len() == 0 && bInitial ) || aText.GetChar(0) == (sal_Unicode)'=' )
nAllowedExtra = SC_GROWY_BIG_EXTRA;
}
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 229bafc7969d..968b84680ef6 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -106,7 +106,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
aEditView.InsertText( rxTransferable, String(), sal_True );
}
- sal_uLong nParCnt = pEngine->GetParagraphCount();
+ sal_Int32 nParCnt = pEngine->GetParagraphCount();
if (nParCnt)
{
SCROW nEndRow = nStartRow + static_cast<SCROW>(nParCnt) - 1;
@@ -125,7 +125,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
// Temporarily turn off undo generation for this lot
bool bUndoEnabled = pDoc->IsUndoEnabled();
pDoc->EnableUndo( false );
- for( sal_uInt16 n = 0; n < nParCnt; n++ )
+ for( sal_Int32 n = 0; n < nParCnt; n++ )
{
EditTextObject* pObject = pEngine->CreateTextObject( n );
EnterData( nStartCol, nRow, nTab, pObject, true );
@@ -745,7 +745,7 @@ void ScViewFunc::InsertBookmark( const String& rDescription, const String& rURL,
}
}
- sal_uInt16 nPara = aEngine.GetParagraphCount();
+ sal_Int32 nPara = aEngine.GetParagraphCount();
if (nPara)
--nPara;
xub_StrLen nTxtLen = aEngine.GetTextLen(nPara);
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 2ff86f12178f..3bc50a8c5928 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -647,7 +647,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
if ( !bSimple && aEngine.GetParagraphCount() == 1 )
{
- String aParStr = aEngine.GetText( (sal_uInt16) 0 );
+ String aParStr = aEngine.GetText( 0 );
if ( aParStr.GetChar(0) == '=' )
bSimple = sal_True;
}
diff --git a/sd/source/core/sdpage_animations.cxx b/sd/source/core/sdpage_animations.cxx
index b895906189bf..c4bede4c4fa0 100644
--- a/sd/source/core/sdpage_animations.cxx
+++ b/sd/source/core/sdpage_animations.cxx
@@ -109,6 +109,8 @@ void SdPage::onParagraphInserted( ::Outliner* pOutliner, Paragraph* pPara, SdrOb
{
ParagraphTarget aTarget;
aTarget.Shape = Reference< XShape >( pObj->getUnoShape(), UNO_QUERY );
+ /* FIXME: Paragraph should be sal_Int32, though more than 64k
+ * paragrapsh at a shape are unlikely.. */
aTarget.Paragraph = (sal_Int16)pOutliner->GetAbsPos( pPara );
getMainSequence()->insertTextRange( makeAny( aTarget ) );
@@ -122,6 +124,8 @@ void SdPage::onParagraphRemoving( ::Outliner* pOutliner, Paragraph* pPara, SdrOb
{
ParagraphTarget aTarget;
aTarget.Shape = Reference< XShape >( pObj->getUnoShape(), UNO_QUERY );
+ /* FIXME: Paragraph should be sal_Int32, though more than 64k
+ * paragrapsh at a shape are unlikely.. */
aTarget.Paragraph = (sal_Int16)pOutliner->GetAbsPos( pPara );
getMainSequence()->disposeTextRange( makeAny( aTarget ) );
diff --git a/sd/source/core/text/textapi.cxx b/sd/source/core/text/textapi.cxx
index 82aa311f2c63..b179a73f65d5 100644
--- a/sd/source/core/text/textapi.cxx
+++ b/sd/source/core/text/textapi.cxx
@@ -172,7 +172,7 @@ void TextApiObject::SetText( OutlinerParaObject& rText )
pModel->AddUndo( new UndoTextAPIChanged( *pModel, this ) );
mpSource->SetText( rText );
- maSelection.nStartPara = 0xffff;
+ maSelection.nStartPara = EE_PARA_MAX_COUNT;
}
String TextApiObject::GetText()
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index 4335dc0b448a..a3f1298ee349 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -340,7 +340,7 @@ String HtmlState::SetLink( const String& aLink, const String& aTarget )
// class HtmlExport Methoden
// *********************************************************************
-static String getParagraphStyle( SdrOutliner* pOutliner, sal_uInt16 nPara )
+static String getParagraphStyle( SdrOutliner* pOutliner, sal_Int32 nPara )
{
SfxItemSet aParaSet( pOutliner->GetParaAttribs( nPara ) );
@@ -1216,19 +1216,19 @@ String HtmlExport::CreateTextForPage( SdrOutliner* pOutliner,
pOutliner->Clear();
pOutliner->SetText( *pOPO );
- sal_uLong nCount = pOutliner->GetParagraphCount();
+ sal_Int32 nCount = pOutliner->GetParagraphCount();
Paragraph* pPara = NULL;
sal_Int16 nActDepth = -1;
String aParaText;
- for (sal_uLong nPara = 0; nPara < nCount; nPara++)
+ for (sal_Int32 nPara = 0; nPara < nCount; nPara++)
{
pPara = pOutliner->GetParagraph(nPara);
if(pPara == 0)
continue;
- const sal_Int16 nDepth = (sal_uInt16) pOutliner->GetDepth( (sal_uInt16) nPara );
+ const sal_Int16 nDepth = (sal_uInt16) pOutliner->GetDepth( nPara );
aParaText = ParagraphToHTMLString(pOutliner,nPara,rBackgroundColor);
if(aParaText.Len() == 0)
@@ -1313,8 +1313,8 @@ String HtmlExport::CreateTextForNotesPage( SdrOutliner* pOutliner,
pOutliner->Clear();
pOutliner->SetText( *pOPO );
- sal_uLong nCount = pOutliner->GetParagraphCount();
- for (sal_uLong nPara = 0; nPara < nCount; nPara++)
+ sal_Int32 nCount = pOutliner->GetParagraphCount();
+ for (sal_Int32 nPara = 0; nPara < nCount; nPara++)
{
aStr.AppendAscii("<p style=\"");
aStr.Append( getParagraphStyle( pOutliner, nPara ) );
@@ -1331,7 +1331,7 @@ String HtmlExport::CreateTextForNotesPage( SdrOutliner* pOutliner,
// =====================================================================
// Wandelt einen Paragraphen des Outliners in Html
// =====================================================================
-String HtmlExport::ParagraphToHTMLString( SdrOutliner* pOutliner, sal_uLong nPara, const Color& rBackgroundColor )
+String HtmlExport::ParagraphToHTMLString( SdrOutliner* pOutliner, sal_Int32 nPara, const Color& rBackgroundColor )
{
String aStr;
@@ -1349,14 +1349,14 @@ String HtmlExport::ParagraphToHTMLString( SdrOutliner* pOutliner, sal_uLong nPar
HtmlState aState( (mbUserAttr || mbDocColors) ? maTextColor : Color(COL_BLACK) );
std::vector<sal_uInt16> aPortionList;
- rEditEngine.GetPortions( (sal_uInt16) nPara, aPortionList );
+ rEditEngine.GetPortions( nPara, aPortionList );
sal_uInt16 nPos1 = 0;
for( std::vector<sal_uInt16>::const_iterator it( aPortionList.begin() ); it != aPortionList.end(); ++it )
{
sal_uInt16 nPos2 = *it;
- ESelection aSelection( (sal_uInt16) nPara, nPos1, (sal_uInt16) nPara, nPos2);
+ ESelection aSelection( nPara, nPos1, nPara, nPos2);
SfxItemSet aSet( rEditEngine.GetAttribs( aSelection ) );
diff --git a/sd/source/filter/html/htmlex.hxx b/sd/source/filter/html/htmlex.hxx
index 6993cdbbce1e..c04d0fb7ae47 100644
--- a/sd/source/filter/html/htmlex.hxx
+++ b/sd/source/filter/html/htmlex.hxx
@@ -179,7 +179,7 @@ class HtmlExport
String CreateNavBar( sal_uInt16 nSdPage, bool bIsText ) const;
String CreateBodyTag() const;
- String ParagraphToHTMLString( SdrOutliner* pOutliner, sal_uLong nPara, const Color& rBackgroundColor );
+ String ParagraphToHTMLString( SdrOutliner* pOutliner, sal_Int32 nPara, const Color& rBackgroundColor );
String TextAttribToHTMLString( SfxItemSet* pSet, HtmlState* pState, const Color& rBackgroundColor );
String CreateTextForTitle( SdrOutliner* pOutliner, SdPage* pPage, const Color& rBackgroundColor );
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index c314e4fafda6..e25d94893079 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -3077,9 +3077,9 @@ sal_Int32 AnimationImporter::importTargetElementContainer( const Atom* pAtom, An
const EditTextObject& rEditTextObject = pOPO->GetTextObject();
- const sal_uInt16 nParaCount = rEditTextObject.GetParagraphCount();
+ const sal_Int32 nParaCount = rEditTextObject.GetParagraphCount();
- sal_uInt16 nPara = 0;
+ sal_Int32 nPara = 0;
while( (nPara < nParaCount) && (begin > 0) )
{
@@ -3093,7 +3093,8 @@ sal_Int32 AnimationImporter::importTargetElementContainer( const Atom* pAtom, An
{
ParagraphTarget aParaTarget;
rTarget >>= aParaTarget.Shape;
- aParaTarget.Paragraph = nPara;
+ /* FIXME: Paragraph should be sal_Int32 as well */
+ aParaTarget.Paragraph = static_cast<sal_Int16>(nPara);
rTarget = makeAny( aParaTarget );
rSubType = ShapeAnimationSubType::ONLY_TEXT;
diff --git a/sd/source/filter/xml/sdtransform.cxx b/sd/source/filter/xml/sdtransform.cxx
index 42e70de3158d..165e638b97f9 100644
--- a/sd/source/filter/xml/sdtransform.cxx
+++ b/sd/source/filter/xml/sdtransform.cxx
@@ -193,11 +193,11 @@ void SdTransformOOo2xDocument::transformTextShape( SdrTextObj& rTextShape )
{
mrOutliner.SetText( *pOPO );
- sal_uInt32 nCount = mrOutliner.GetParagraphCount();
+ sal_Int32 nCount = mrOutliner.GetParagraphCount();
bool bChange = false;
- for(sal_uInt16 nPara = 0; nPara < nCount; nPara++)
+ for(sal_Int32 nPara = 0; nPara < nCount; nPara++)
{
SfxItemSet aParaSet( mrOutliner.GetParaAttribs( nPara ) );
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index 89d69aa8385c..bae7366ae716 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -476,9 +476,9 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
aStr.Append( sQuote );
aStr.Append( rtl::OUString("\"\n") );
- sal_uInt16 nParaCount = comphelper::string::getTokenCount(aStr, '\n');
- for( sal_uInt16 nPara = 0; nPara < nParaCount; nPara++ )
- pOutliner->Insert( aStr.GetToken( nPara, '\n' ), LIST_APPEND, -1 );
+ sal_Int32 nParaCount = comphelper::string::getTokenCount(aStr, '\n');
+ for( sal_Int32 nPara = 0; nPara < nParaCount; nPara++ )
+ pOutliner->Insert( aStr.GetToken( nPara, '\n' ), EE_PARA_APPEND, -1 );
if( pOutliner->GetParagraphCount() > 1 )
{
@@ -486,7 +486,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( SfxRequest& rReq )
aAnswerSet.Put(SvxPostureItem(ITALIC_NORMAL,EE_CHAR_ITALIC));
ESelection aSel;
- aSel.nEndPara = (sal_uInt16)pOutliner->GetParagraphCount()-2;
+ aSel.nEndPara = pOutliner->GetParagraphCount()-2;
aSel.nEndPos = pOutliner->GetText( pOutliner->GetParagraph( aSel.nEndPara ) ).Len();
pOutliner->QuickSetAttribs( aAnswerSet, aSel );
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index 6573ea0f46ca..98e6f3b46fd6 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -363,7 +363,7 @@ void AnnotationWindow::InitControls()
void AnnotationWindow::StartEdit()
{
- getView()->SetSelection(ESelection(0xFFFF,0xFFFF,0xFFFF,0xFFFF));
+ getView()->SetSelection(ESelection(EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT,EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT));
getView()->ShowCursor();
}
@@ -468,7 +468,7 @@ void AnnotationWindow::SetLanguage(const SvxLanguageItem &aNewItem)
Engine()->SetModifyHdl( Link() );
ESelection aOld = getView()->GetSelection();
- ESelection aNewSelection( 0, 0, (sal_uInt16)Engine()->GetParagraphCount()-1, USHRT_MAX );
+ ESelection aNewSelection( 0, 0, Engine()->GetParagraphCount()-1, EE_TEXTPOS_ALL );
getView()->SetSelection( aNewSelection );
SfxItemSet aEditAttr(getView()->GetAttribs());
aEditAttr.Put(aNewItem);
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 4978b4fc1257..f78da91b2ce9 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -99,7 +99,7 @@ static SdPage* GetCurrentPage( sd::ViewShell* pViewSh, EditFieldInfo* pInfo, boo
int nPgNum = 0;
Outliner* pOutl = pSdView->GetOutliner();
long nPos = pInfo->GetPara();
- sal_uLong nParaPos = 0;
+ sal_Int32 nParaPos = 0;
for( Paragraph* pPara = pOutl->GetParagraph( 0 ); pPara && nPos >= 0; pPara = pOutl->GetParagraph( ++nParaPos ), nPos-- )
{
diff --git a/sd/source/ui/dlg/dlgassim.cxx b/sd/source/ui/dlg/dlgassim.cxx
index af99541a6d2c..8f430dc403e2 100644
--- a/sd/source/ui/dlg/dlgassim.cxx
+++ b/sd/source/ui/dlg/dlgassim.cxx
@@ -141,14 +141,14 @@ void SdPageListControl::Fill( SdDrawDocument* pDoc )
pOutliner->Clear();
pOutliner->SetText( *pOPO );
- sal_uLong nCount = pOutliner->GetParagraphCount();
+ sal_Int32 nCount = pOutliner->GetParagraphCount();
Paragraph* pPara = NULL;
- for (sal_uLong nPara = 0; nPara < nCount; nPara++)
+ for (sal_Int32 nPara = 0; nPara < nCount; nPara++)
{
pPara = pOutliner->GetParagraph(nPara);
- if(pPara && pOutliner->GetDepth( (sal_uInt16) nPara ) == 0 )
+ if(pPara && pOutliner->GetDepth( nPara ) == 0 )
{
String aParaText = pOutliner->GetText(pPara);
if(aParaText.Len() != 0)
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index b0dd5a25b365..b086b248a380 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -753,8 +753,8 @@ void HeaderFooterTabPage::GetOrSetDateTimeLanguage( LanguageType &rLanguage, boo
EFieldInfo aFieldInfo;
aFieldInfo.pFieldItem = NULL;
- sal_uInt16 nParaCount = pEdit->GetParagraphCount();
- sal_uInt16 nPara;
+ sal_Int32 nParaCount = pEdit->GetParagraphCount();
+ sal_Int32 nPara;
for( nPara = 0; (nPara < nParaCount) && (aFieldInfo.pFieldItem == NULL); nPara++ )
{
sal_uInt16 nFieldCount = pEdit->GetFieldCount( nPara );
diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx
index c29c498f4a1d..06c7a641f753 100644
--- a/sd/source/ui/func/fuexpand.cxx
+++ b/sd/source/ui/func/fuexpand.cxx
@@ -121,9 +121,9 @@ void FuExpandPage::DoExecute( SfxRequest& )
// Harte Absatz- und Zeichenattribute entfernen
SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
- sal_uLong nParaCount1 = pOutl->GetParagraphCount();
+ sal_Int32 nParaCount1 = pOutl->GetParagraphCount();
- for (sal_uInt16 nPara = 0; nPara < nParaCount1; nPara++)
+ for (sal_Int32 nPara = 0; nPara < nParaCount1; nPara++)
{
pOutl->QuickRemoveCharAttribs(nPara);
pOutl->SetParaAttribs(nPara, aEmptyEEAttr);
@@ -134,8 +134,8 @@ void FuExpandPage::DoExecute( SfxRequest& )
while (pPara)
{
- sal_uLong nParaPos = pOutl->GetAbsPos( pPara );
- sal_Int16 nDepth = pOutl->GetDepth( (sal_uInt16) nParaPos );
+ sal_Int32 nParaPos = pOutl->GetAbsPos( pPara );
+ sal_Int16 nDepth = pOutl->GetDepth( nParaPos );
if ( nDepth == 0 )
{
// Seite mit Titel & Gliederung!
@@ -186,7 +186,7 @@ void FuExpandPage::DoExecute( SfxRequest& )
// Title-Textobjekt erstellen
SdrTextObj* pTextObj = (SdrTextObj*) pPage->GetPresObj(PRESOBJ_TITLE);
- OutlinerParaObject* pOutlinerParaObject = pOutl->CreateParaObject( (sal_uInt16) nParaPos, 1);
+ OutlinerParaObject* pOutlinerParaObject = pOutl->CreateParaObject( nParaPos, 1);
pOutlinerParaObject->SetOutlinerMode(OUTLINERMODE_TITLEOBJECT);
if( pOutlinerParaObject->GetDepth(0) != -1 )
@@ -210,7 +210,7 @@ void FuExpandPage::DoExecute( SfxRequest& )
SfxStyleSheet* pSheet = pPage->GetStyleSheetForPresObj(PRESOBJ_TITLE);
pTextObj->NbcSetStyleSheet(pSheet, sal_False);
- sal_uLong nChildCount = pOutl->GetChildCount(pPara);
+ sal_Int32 nChildCount = pOutl->GetChildCount(pPara);
if (nChildCount > 0)
{
@@ -218,18 +218,18 @@ void FuExpandPage::DoExecute( SfxRequest& )
SdrTextObj* pOutlineObj = (SdrTextObj*) pPage->GetPresObj(PRESOBJ_OUTLINE);
pPara = pOutl->GetParagraph( ++nParaPos );
- OutlinerParaObject* pOPO = pOutl->CreateParaObject( (sal_uInt16) nParaPos, (sal_uInt16) nChildCount);
+ OutlinerParaObject* pOPO = pOutl->CreateParaObject( nParaPos, nChildCount);
SdrOutliner* pTempOutl = SdrMakeOutliner( OUTLINERMODE_OUTLINEOBJECT, mpDoc );
pTempOutl->SetText( *pOPO );
- sal_uLong nParaCount2 = pTempOutl->GetParagraphCount();
- sal_uLong nPara;
+ sal_Int32 nParaCount2 = pTempOutl->GetParagraphCount();
+ sal_Int32 nPara;
for( nPara = 0; nPara < nParaCount2; nPara++ )
{
pTempOutl->SetDepth (
pTempOutl->GetParagraph( nPara ),
- pTempOutl->GetDepth((sal_uInt16) nPara ) - 1);
+ pTempOutl->GetDepth( nPara ) - 1);
}
delete pOPO;
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index 0f68a38e283c..0f1b6912e919 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -575,14 +575,14 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
while( !pDocliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
pPara = pDocliner->GetParent(pPara);
- sal_uLong nTargetPos = pDocliner->GetAbsPos(pPara) + 1;
+ sal_Int32 nTargetPos = pDocliner->GetAbsPos(pPara) + 1;
// Layout der Vorgaengerseite uebernehmen
sal_uInt16 nPage = 0;
pPara = pDocliner->GetParagraph( pDocliner->GetAbsPos( pPara ) - 1 );
while (pPara)
{
- sal_uLong nPos = pDocliner->GetAbsPos( pPara );
+ sal_Int32 nPos = pDocliner->GetAbsPos( pPara );
if ( pDocliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
nPage++;
pPara = pDocliner->GetParagraph( nPos - 1 );
@@ -619,14 +619,14 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
}
else
{
- sal_uLong nParaCount = pOutliner->GetParagraphCount();
+ sal_Int32 nParaCount = pOutliner->GetParagraphCount();
// fuer Fortschrittsanzeige: Anzahl der Ebene-0-Absaetze
sal_uInt16 nNewPages = 0;
pPara = pOutliner->GetParagraph( 0 );
while (pPara)
{
- sal_uLong nPos = pOutliner->GetAbsPos( pPara );
+ sal_Int32 nPos = pOutliner->GetAbsPos( pPara );
if( pOutliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
nNewPages++;
pPara = pOutliner->GetParagraph( ++nPos );
@@ -643,13 +643,13 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
pDocliner->GetUndoManager().EnterListAction(
String(SdResId(STR_UNDO_INSERT_FILE)), String() );
- sal_uLong nSourcePos = 0;
+ sal_Int32 nSourcePos = 0;
SfxStyleSheet* pStyleSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
Paragraph* pSourcePara = pOutliner->GetParagraph( 0 );
while (pSourcePara)
{
- sal_uLong nPos = pOutliner->GetAbsPos( pSourcePara );
- sal_Int16 nDepth = pOutliner->GetDepth( (sal_uInt16) nPos );
+ sal_Int32 nPos = pOutliner->GetAbsPos( pSourcePara );
+ sal_Int16 nDepth = pOutliner->GetDepth( nPos );
// den letzte Absatz nur uebernehmen, wenn er gefuellt ist
if (nSourcePos < nParaCount - 1 ||
diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx
index cfb3f2f7a44d..f137a83d8a6c 100644
--- a/sd/source/ui/func/fuprobjs.cxx
+++ b/sd/source/ui/func/fuprobjs.cxx
@@ -95,14 +95,14 @@ void FuPresentationObjects::DoExecute( SfxRequest& )
std::vector<Paragraph*>::const_iterator iter = aSelList.begin();
Paragraph* pPara = aSelList.empty() ? NULL : *iter;
- nDepth = pOutl->GetDepth((sal_uInt16)pOutl->GetAbsPos( pPara ) );
+ nDepth = pOutl->GetDepth(pOutl->GetAbsPos( pPara ) );
bool bPage = pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE );
while( iter != aSelList.end() )
{
pPara = *iter;
- nTmp = pOutl->GetDepth((sal_uInt16) pOutl->GetAbsPos( pPara ) );
+ nTmp = pOutl->GetDepth( pOutl->GetAbsPos( pPara ) );
if( nDepth != nTmp )
{
diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx
index 2d0bda1131f5..077534cbe140 100644
--- a/sd/source/ui/func/fusumry.cxx
+++ b/sd/source/ui/func/fusumry.cxx
@@ -200,9 +200,9 @@ void FuSummaryPage::DoExecute( SfxRequest& )
// Harte Absatz- und Zeichenattribute entfernen
SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
- sal_uLong nParaCount = pOutl->GetParagraphCount();
+ sal_Int32 nParaCount = pOutl->GetParagraphCount();
- for (sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
+ for (sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
{
pOutl->SetStyleSheet( nPara, pStyle );
pOutl->QuickRemoveCharAttribs(nPara);
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 49c4b1aa46ad..74f8ec29700f 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -1072,7 +1072,7 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, sal_Bool bQuickDrag)
if (!GetTextObj()->GetOutlinerParaObject() && mpView->GetTextEditOutliner())
{
::Outliner* pOutl = mpView->GetTextEditOutliner();
- sal_uLong nParaAnz = pOutl->GetParagraphCount();
+ sal_Int32 nParaAnz = pOutl->GetParagraphCount();
Paragraph* p1stPara = pOutl->GetParagraph( 0 );
if (nParaAnz==1 && p1stPara)
diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx
index a948d991a914..3baa8b06fe08 100644
--- a/sd/source/ui/inc/OutlineView.hxx
+++ b/sd/source/ui/inc/OutlineView.hxx
@@ -156,7 +156,7 @@ public:
/** creates and inserts an empty slide for the given paragraph. */
SdPage* InsertSlideForParagraph( Paragraph* pPara );
- void UpdateParagraph( sal_uInt16 nPara );
+ void UpdateParagraph( sal_Int32 nPara );
protected:
virtual void OnBeginPasteOrDrop( PasteOrDropInfos* pInfos );
@@ -184,8 +184,8 @@ private:
std::vector<Paragraph*> maOldParaOrder;
std::vector<Paragraph*> maSelectedParas;
- sal_uInt16 mnPagesToProcess; // fuer die Fortschrittsanzeige
- sal_uInt16 mnPagesProcessed;
+ sal_Int32 mnPagesToProcess; // for the progress bar
+ sal_Int32 mnPagesProcessed;
sal_Bool mbFirstPaint;
diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx
index 62d685107254..13287a9144ba 100644
--- a/sd/source/ui/unoidl/unosrch.cxx
+++ b/sd/source/ui/unoidl/unosrch.cxx
@@ -602,8 +602,8 @@ uno::Reference< text::XTextRange > SdUnoSearchReplaceShape::Search( uno::Refere
{
if( nStartPos <= nTextLen && nEndPos <= nTextLen )
{
- ESelection aSelection( (sal_uInt16)pConvertPara[nStartPos], (sal_uInt16)pConvertPos[nStartPos],
- (sal_uInt16)pConvertPara[nEndPos], (sal_uInt16)pConvertPos[nEndPos] );
+ ESelection aSelection( pConvertPara[nStartPos], (sal_uInt16)pConvertPos[nStartPos],
+ pConvertPara[nEndPos], (sal_uInt16)pConvertPos[nEndPos] );
SvxUnoTextRange *pRange;
SvxUnoTextBase* pParent = SvxUnoTextBase::getImplementation( xParent );
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index 18268ccfd031..bf845ae31545 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1752,7 +1752,7 @@ private:
pTextObj = dynamic_cast<SdrTextObj*>(pPage->GetPresObj(PRESOBJ_TEXT)); // Untertitel vorhanden?
}
- sal_uLong nParaCount1 = pOutliner->GetParagraphCount();
+ sal_Int32 nParaCount1 = pOutliner->GetParagraphCount();
if (pTextObj!=NULL
&& !pTextObj->IsEmptyPresObj()
@@ -1767,7 +1767,7 @@ private:
for (sal_Int32 nPara=nParaCount1; nPara<nParaCount2; ++nPara)
{
Paragraph* pP = pOutliner->GetParagraph(nPara);
- if (pP!=NULL && pOutliner->GetDepth((sal_uInt16)nPara) > 0)
+ if (pP!=NULL && pOutliner->GetDepth(nPara) > 0)
pOutliner->SetDepth(pP, 0);
}
}
@@ -1779,9 +1779,9 @@ private:
// the current page.
if (nH > nPageH && pPara!=NULL)
{
- sal_uLong nCnt = pOutliner->GetAbsPos(
+ sal_Int32 nCnt = pOutliner->GetAbsPos(
pOutliner->GetParagraph( pOutliner->GetParagraphCount() - 1 ) );
- sal_uLong nParaPos = pOutliner->GetAbsPos( pPara );
+ sal_Int32 nParaPos = pOutliner->GetAbsPos( pPara );
nCnt -= nParaPos;
pPara = pOutliner->GetParagraph( ++nParaPos );
if ( nCnt && pPara )
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index b2ab27dd03af..f1c14017cd2b 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1416,7 +1416,7 @@ ESelection Outliner::GetSearchStartPosition (void)
{
// Retrieve the position after the last character in the last
// paragraph.
- sal_uInt16 nParagraphCount = static_cast<sal_uInt16>(GetParagraphCount());
+ sal_Int32 nParagraphCount = GetParagraphCount();
if (nParagraphCount == 0)
aPosition = ESelection();
else
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 54097ab33b4d..008304ccd2dd 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -216,8 +216,8 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
while (pPara)
{
- sal_uLong nParaPos = pOutliner->GetAbsPos( pPara );
- sal_Int16 nDepth = pOutliner->GetDepth( (sal_uInt16) nParaPos );
+ sal_Int32 nParaPos = pOutliner->GetAbsPos( pPara );
+ sal_Int16 nDepth = pOutliner->GetDepth( nParaPos );
String aName(rPage.GetLayoutName());
aName += (sal_Unicode)(' ');
aName += String::CreateFromInt32( (nDepth <= 0) ? 1 : nDepth + 1 );
@@ -258,7 +258,7 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet,
pPara = iter != aSelList.rend() ? *iter : NULL;
if( !pPara && nDepth > 0 && rSet.GetItemState( EE_PARA_NUMBULLET ) == SFX_ITEM_ON &&
- pOutliner->GetDepth( (sal_uInt16) pOutliner->GetAbsPos(*(aSelList.begin())) ) > 0 )
+ pOutliner->GetDepth( pOutliner->GetAbsPos(*(aSelList.begin())) ) > 0 )
pPara = pOutliner->GetParagraph( 0 ); // Put NumBulletItem in outline level 1
}
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 7980f144de0b..13a162940005 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -277,7 +277,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
{
pPara = *iter;
- sal_Int16 nDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) );
+ sal_Int16 nDepth = pOutl->GetDepth( pOutl->GetAbsPos( pPara ) );
if (nDepth > 0 || (bOutlineViewSh && (nDepth <= 0) && !pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE )) )
{
@@ -422,17 +422,17 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
{
ESelection aSel = pOLV->GetSelection();
aSel.Adjust();
- sal_uLong nStartPara = aSel.nStartPara;
- sal_uLong nEndPara = aSel.nEndPara;
+ sal_Int32 nStartPara = aSel.nStartPara;
+ sal_Int32 nEndPara = aSel.nEndPara;
if( !aSel.HasRange() )
{
nStartPara = 0;
nEndPara = pOLV->GetOutliner()->GetParagraphCount() - 1;
}
long nUpper = 0L;
- for( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ for( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
- const SfxItemSet& rItems = pOLV->GetOutliner()->GetParaAttribs( (sal_uInt16)nPara );
+ const SfxItemSet& rItems = pOLV->GetOutliner()->GetParaAttribs( nPara );
const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) rItems.Get( EE_PARA_ULSPACE );
nUpper = Max( nUpper, (long)rItem.GetUpper() );
}
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index f801b719f0f1..36fc8495b508 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -137,14 +137,14 @@ void TextObjectBar::Execute( SfxRequest &rReq )
{
ESelection aSel = pOLV->GetSelection();
aSel.Adjust();
- sal_uLong nStartPara = aSel.nStartPara;
- sal_uLong nEndPara = aSel.nEndPara;
+ sal_Int32 nStartPara = aSel.nStartPara;
+ sal_Int32 nEndPara = aSel.nEndPara;
if( !aSel.HasRange() )
{
nStartPara = 0;
nEndPara = pOLV->GetOutliner()->GetParagraphCount() - 1;
}
- for( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ for( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
SfxStyleSheet* pStyleSheet = NULL;
if (pOLV->GetOutliner() != NULL)
@@ -152,7 +152,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
if (pStyleSheet != NULL)
{
SfxItemSet aAttr( pStyleSheet->GetItemSet() );
- SfxItemSet aTmpSet( pOLV->GetOutliner()->GetParaAttribs( (sal_uInt16) nPara ) );
+ SfxItemSet aTmpSet( pOLV->GetOutliner()->GetParaAttribs( nPara ) );
aAttr.Put( aTmpSet, sal_False ); // sal_False= InvalidItems nicht als Default, sondern als "Loecher" betrachten
const SvxULSpaceItem& rItem = (const SvxULSpaceItem&) aAttr.Get( EE_PARA_ULSPACE );
SvxULSpaceItem* pNewItem = (SvxULSpaceItem*) rItem.Clone();
@@ -180,7 +180,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
SfxItemSet aNewAttrs( aAttr );
aNewAttrs.Put( *pNewItem );
delete pNewItem;
- pOLV->GetOutliner()->SetParaAttribs( (sal_uInt16)nPara, aNewAttrs );
+ pOLV->GetOutliner()->SetParaAttribs( nPara, aNewAttrs );
}
}
}
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index a514bb20ead7..22ab971d16f6 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -221,10 +221,10 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq)
case SID_SELECTALL:
{
::Outliner* pOutl = pOlView->GetOutliner();
- sal_uLong nParaCount = pOutl->GetParagraphCount();
+ sal_Int32 nParaCount = pOutl->GetParagraphCount();
if (nParaCount > 0)
{
- pOutlinerView->SelectRange( 0, (sal_uInt16) nParaCount );
+ pOutlinerView->SelectRange( 0, nParaCount );
}
Cancel();
}
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 6469ef017270..c01ac0e35d36 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -812,7 +812,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
// allow 'Select All'?
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_SELECTALL ) )
{
- sal_uLong nParaCount = pOutl->GetParagraphCount();
+ sal_Int32 nParaCount = pOutl->GetParagraphCount();
sal_Bool bDisable = nParaCount == 0;
if (!bDisable && nParaCount == 1)
{
@@ -861,14 +861,14 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
Paragraph* pPara = *iter;
sal_Int16 nDepth;
- sal_Int16 nTmpDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) );
+ sal_Int16 nTmpDepth = pOutl->GetDepth( pOutl->GetAbsPos( pPara ) );
bool bPage = pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE );
while (iter != aSelList.begin())
{
pPara = *iter;
- nDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) );
+ nDepth = pOutl->GetDepth( pOutl->GetAbsPos( pPara ) );
if( nDepth != nTmpDepth || bPage != pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ))
bUnique = sal_False;
@@ -917,7 +917,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
// otherwise look through all paragraphs
if (bDisableCollapseAll || bDisableExpandAll)
{
- sal_uLong nParaPos = 0;
+ sal_Int32 nParaPos = 0;
Paragraph* pPara = pOutl->GetParagraph( nParaPos );
while (pPara && (bDisableCollapseAll || bDisableExpandAll))
{
@@ -1819,7 +1819,7 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara )
// if we have a title object and a text, set the text
if( pTO )
{
- pOPO = pOutliner->CreateParaObject( (sal_uInt16) pOutliner->GetAbsPos( pPara ), 1 );
+ pOPO = pOutliner->CreateParaObject( pOutliner->GetAbsPos( pPara ), 1 );
pOPO->SetOutlinerMode( OUTLINERMODE_TITLEOBJECT );
pOPO->SetVertical( pTO->IsVerticalWriting() );
if( pTO->GetOutlinerParaObject() && (pOPO->GetTextObject() == pTO->GetOutlinerParaObject()->GetTextObject()) )
@@ -1900,9 +1900,9 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara )
}
// how many paragraphs in the outline?
- sal_uLong nTitlePara = pOutliner->GetAbsPos( pPara );
- sal_uLong nPara = nTitlePara + 1;
- sal_uLong nParasInLayout = 0L;
+ sal_Int32 nTitlePara = pOutliner->GetAbsPos( pPara );
+ sal_Int32 nPara = nTitlePara + 1;
+ sal_Int32 nParasInLayout = 0L;
pPara = pOutliner->GetParagraph( nPara );
while( pPara && !pOutliner->HasParaFlag(pPara, PARAFLAG_ISPAGE) )
{
@@ -1913,7 +1913,7 @@ bool OutlineViewShell::UpdateOutlineObject( SdPage* pPage, Paragraph* pPara )
{
// create an OutlinerParaObject
pPara = pOutliner->GetParagraph( nTitlePara + 1 );
- pOPO = pOutliner->CreateParaObject( (sal_uInt16) nTitlePara + 1, (sal_uInt16) nParasInLayout );
+ pOPO = pOutliner->CreateParaObject( nTitlePara + 1, nParasInLayout );
}
if( pOPO )
@@ -2004,10 +2004,10 @@ sal_uLong OutlineViewShell::Read(SvStream& rInput, const String& rBaseURL, sal_u
SfxStyleSheet* pTitleSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE );
SfxStyleSheet* pOutlSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE );
- sal_uInt16 nParaCount = (sal_uInt16)pOutl->GetParagraphCount();
+ sal_Int32 nParaCount = pOutl->GetParagraphCount();
if ( nParaCount > 0 )
{
- for ( sal_uInt16 nPara = 0; nPara < nParaCount; nPara++ )
+ for ( sal_Int32 nPara = 0; nPara < nParaCount; nPara++ )
{
pOlView->UpdateParagraph( nPara );
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index ff1db686eb06..c9c946227607 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -433,7 +433,7 @@ IMPL_LINK( OutlineView, ParagraphInsertedHdl, ::Outliner *, pOutliner )
Paragraph* pPara = pOutliner->GetHdlParagraph();
- sal_uInt16 nAbsPos = (sal_uInt16)mrOutliner.GetAbsPos( pPara );
+ sal_Int32 nAbsPos = mrOutliner.GetAbsPos( pPara );
UpdateParagraph( nAbsPos );
@@ -661,7 +661,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
pParagraph = *iter;
if( !pOutliner->HasParaFlag( pParagraph, PARAFLAG_ISPAGE ) &&
- (pOutliner->GetDepth( (sal_uInt16) pOutliner->GetAbsPos( pParagraph ) ) <= 0) )
+ (pOutliner->GetDepth( pOutliner->GetAbsPos( pParagraph ) ) <= 0) )
mnPagesToProcess++;
}
@@ -761,7 +761,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
}
pOutliner->UpdateFields();
}
- else if ( (pOutliner->GetPrevDepth() == 1) && ( pOutliner->GetDepth( (sal_uInt16) pOutliner->GetAbsPos( pPara ) ) == 2 ) )
+ else if ( (pOutliner->GetPrevDepth() == 1) && ( pOutliner->GetDepth( pOutliner->GetAbsPos( pPara ) ) == 2 ) )
{
// how many titles are in front of the title paragraph in question?
sal_Int32 nPos = -1L;
@@ -801,8 +801,8 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
if( pPage )
{
SfxStyleSheet* pStyleSheet = NULL;
- sal_uLong nPara = pOutliner->GetAbsPos( pPara );
- sal_Int16 nDepth = pOutliner->GetDepth( (sal_uInt16) nPara );
+ sal_Int32 nPara = pOutliner->GetAbsPos( pPara );
+ sal_Int16 nDepth = pOutliner->GetDepth( nPara );
bool bSubTitle = pPage->GetPresObj(PRESOBJ_TEXT) != NULL;
if( pOutliner->HasParaFlag(pPara, PARAFLAG_ISPAGE) )
@@ -829,7 +829,7 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
// before we set the style sheet we need to preserve the bullet item
// since all items will be deleted while setting a new style sheet
- SfxItemSet aOldAttrs( pOutliner->GetParaAttribs( (sal_uInt16)nPara ) );
+ SfxItemSet aOldAttrs( pOutliner->GetParaAttribs( nPara ) );
pOutliner->SetStyleSheet( nPara, pStyleSheet );
@@ -837,9 +837,9 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner )
if ( pOutliner->GetPrevDepth() != -1 && nDepth != -1 &&
aOldAttrs.GetItemState( EE_PARA_NUMBULLET ) == SFX_ITEM_ON )
{
- SfxItemSet aAttrs( pOutliner->GetParaAttribs( (sal_uInt16)nPara ) );
+ SfxItemSet aAttrs( pOutliner->GetParaAttribs( nPara ) );
aAttrs.Put( *aOldAttrs.GetItem( EE_PARA_NUMBULLET ) );
- pOutliner->SetParaAttribs( (sal_uInt16)nPara, aAttrs );
+ pOutliner->SetParaAttribs( nPara, aAttrs );
}
}
}
@@ -918,7 +918,7 @@ IMPL_LINK( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner )
// select the pages belonging to the paragraphs on level 0 to select
sal_uInt16 nPos = 0;
- sal_uLong nParaPos = 0;
+ sal_Int32 nParaPos = 0;
Paragraph* pPara = pOutliner->GetParagraph( 0 );
std::vector<Paragraph*>::const_iterator fiter;
@@ -958,7 +958,7 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner )
// look for the first of the selected paragraphs in the new ordering
sal_uInt16 nPosNewOrder = 0;
- sal_uLong nParaPos = 0;
+ sal_Int32 nParaPos = 0;
Paragraph* pPara = pOutliner->GetParagraph( 0 );
Paragraph* pPrev = NULL;
while (pPara && pPara != pSearchIt)
@@ -1214,7 +1214,7 @@ void OutlineView::FillOutliner()
mrOutliner.SetDepth(pPara, -1);
// do not apply hard attributes from the previous paragraph
- mrOutliner.SetParaAttribs( (sal_uInt16)mrOutliner.GetAbsPos(pPara),
+ mrOutliner.SetParaAttribs( mrOutliner.GetAbsPos(pPara),
mrOutliner.GetEmptyItemSet() );
mrOutliner.SetStyleSheet( mrOutliner.GetAbsPos( pPara ), pPage->GetStyleSheetForPresObj( PRESOBJ_TITLE ) );
@@ -1222,9 +1222,9 @@ void OutlineView::FillOutliner()
mrOutliner.SetParaFlag( pPara, PARAFLAG_ISPAGE );
- sal_uLong nPara = mrOutliner.GetAbsPos( pPara );
+ sal_Int32 nPara = mrOutliner.GetAbsPos( pPara );
- UpdateParagraph( (sal_uInt16)nPara );
+ UpdateParagraph( nPara );
// remember paragraph of currently selected page
if (pPage->IsSelected())
@@ -1242,14 +1242,14 @@ void OutlineView::FillOutliner()
OutlinerParaObject* pOPO = pTO->GetOutlinerParaObject();
if (pOPO)
{
- sal_uInt16 nParaCount1 = (sal_uInt16)mrOutliner.GetParagraphCount();
+ sal_Int32 nParaCount1 = mrOutliner.GetParagraphCount();
sal_Bool bVertical = pOPO->IsVertical();
pOPO->SetVertical( sal_False );
mrOutliner.AddText(*pOPO);
pOPO->SetVertical( bVertical );
- sal_uInt16 nParaCount2 = (sal_uInt16)mrOutliner.GetParagraphCount();
- for (sal_uInt16 n = nParaCount1; n < nParaCount2; n++)
+ sal_Int32 nParaCount2 = mrOutliner.GetParagraphCount();
+ for (sal_Int32 n = nParaCount1; n < nParaCount2; n++)
{
if( bSubTitle )
{
@@ -1288,7 +1288,7 @@ void OutlineView::FillOutliner()
IMPL_LINK_NOARG(OutlineView, RemovingPagesHdl)
{
- sal_uInt16 nNumOfPages = mrOutliner.GetSelPageCount();
+ sal_Int32 nNumOfPages = mrOutliner.GetSelPageCount();
if (nNumOfPages > PROCESS_WITH_PROGRESS_THRESHOLD)
{
@@ -1373,7 +1373,7 @@ Paragraph* OutlineView::GetParagraphForPage( ::Outliner& rOutl, SdPage* pPage )
// we finde the actual page
sal_uInt32 nPagesToSkip = (pPage->GetPageNum() - 1) >> 1;
- sal_uInt32 nParaPos = 0;
+ sal_Int32 nParaPos = 0;
Paragraph* pPara = rOutl.GetParagraph( 0 );
while( pPara )
{
@@ -1445,7 +1445,7 @@ void OutlineView::SetSelectedPages()
// select the pages belonging to the paragraphs on level 0 to select
sal_uInt16 nPos = 0;
- sal_uLong nParaPos = 0;
+ sal_Int32 nParaPos = 0;
Paragraph *pPara = mrOutliner.GetParagraph( 0 );
std::vector<Paragraph*>::const_iterator fiter;
@@ -1821,7 +1821,7 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo)
if( pPara && mrOutliner.HasParaFlag(pPara,PARAFLAG_ISPAGE) )
{
long nPage = 0; // todo, printing??
- for ( sal_uInt16 n = 0; n <= pInfo->mnPara; n++ )
+ for ( sal_Int32 n = 0; n <= pInfo->mnPara; n++ )
{
Paragraph* p = mrOutliner.GetParagraph( n );
if ( mrOutliner.HasParaFlag(p,PARAFLAG_ISPAGE) )
@@ -1896,7 +1896,7 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo)
// --------------------------------------------------------------------
-void OutlineView::UpdateParagraph( sal_uInt16 nPara )
+void OutlineView::UpdateParagraph( sal_Int32 nPara )
{
SfxItemSet aNewAttrs2( mrOutliner.GetParaAttribs( nPara ) );
aNewAttrs2.Put( maLRSpaceItem );
@@ -1916,7 +1916,7 @@ void OutlineView::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
SdPage* pPage = 0;
SfxStyleSheetBasePool* pStylePool = GetDoc().GetStyleSheetPool();
- for( sal_uInt16 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
+ for( sal_Int32 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
{
Paragraph* pPara = mrOutliner.GetParagraph( nPara );
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 5ab7bc0e6782..ce38668da005 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -648,7 +648,7 @@ void View::SelectAll()
{
OutlinerView* pOLV = GetTextEditOutlinerView();
const ::Outliner* pOutliner = GetTextEditOutliner();
- pOLV->SelectRange( 0, (sal_uInt16) pOutliner->GetParagraphCount() );
+ pOLV->SelectRange( 0, pOutliner->GetParagraphCount() );
}
else
{
@@ -1241,7 +1241,7 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
// new paragraph, depending on the paragraph depth
SfxStyleSheetBasePool* pStylePool = GetDoc().GetStyleSheetPool();
- for ( sal_uInt16 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
+ for ( sal_Int32 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
{
sal_Int16 nDepth = pOutliner->GetDepth( nPara );
@@ -1264,7 +1264,7 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
else
{
// just put the object style on each new paragraph
- for ( sal_uInt16 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
+ for ( sal_Int32 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
{
pOutliner->SetStyleSheet( nPara, pStyleSheet );
}
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index e664c01473e2..d94fcceb6e26 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -321,13 +321,13 @@ void View::DoPaste (::Window* pWindow)
pOutliner->SetUpdateMode( sal_False );
const EditEngine& rEdit = pOutliner->GetEditEngine();
- const int nParaCount = rEdit.GetParagraphCount();
+ const sal_Int32 nParaCount = rEdit.GetParagraphCount();
- for( int nPara = nParaCount - 2; nPara >= 0; nPara-- )
+ for( sal_Int32 nPara = nParaCount - 2; nPara >= 0; nPara-- )
{
- const sal_uInt16 nParaLen = (sal_uInt16)rEdit.GetTextLen( (sal_uInt16)nPara );
- pOutliner->QuickDelete( ESelection( (sal_uInt16)nPara, nParaLen, (sal_uInt16)nPara+1, 0 ) );
- pOutliner->QuickInsertLineBreak( ESelection( (sal_uInt16)nPara, nParaLen, (sal_uInt16)nPara, nParaLen ) );
+ const sal_uInt16 nParaLen = (sal_uInt16)rEdit.GetTextLen( nPara );
+ pOutliner->QuickDelete( ESelection( nPara, nParaLen, nPara+1, 0 ) );
+ pOutliner->QuickInsertLineBreak( ESelection( nPara, nParaLen, nPara, nParaLen ) );
}
DBG_ASSERT( rEdit.GetParagraphCount() <= 1, "Titelobjekt contains hard line breaks" );
diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx
index be7b52d8c397..6bc64d5f1f2c 100644
--- a/starmath/inc/edit.hxx
+++ b/starmath/inc/edit.hxx
@@ -41,7 +41,7 @@ class CommandEvent;
/**************************************************************************/
void SmGetLeftSelectionPart(const ESelection &rSelection,
- sal_uInt16 &nPara, sal_uInt16 &nPos);
+ sal_Int32 &nPara, sal_uInt16 &nPos);
/**************************************************************************/
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index d88d4906e808..6b9b268a2c58 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -977,13 +977,13 @@ IMPL_LINK(SmTextForwarder, NotifyHdl, EENotify*, aNotify)
return 0;
}
-sal_uInt16 SmTextForwarder::GetParagraphCount() const
+sal_Int32 SmTextForwarder::GetParagraphCount() const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
return pEditEngine ? pEditEngine->GetParagraphCount() : 0;
}
-sal_uInt16 SmTextForwarder::GetTextLen( sal_uInt16 nParagraph ) const
+sal_uInt16 SmTextForwarder::GetTextLen( sal_Int32 nParagraph ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
return pEditEngine ? pEditEngine->GetTextLen( nParagraph ) : 0;
@@ -1028,7 +1028,7 @@ SfxItemSet SmTextForwarder::GetAttribs( const ESelection& rSel, sal_Bool bOnlyHa
}
}
-SfxItemSet SmTextForwarder::GetParaAttribs( sal_uInt16 nPara ) const
+SfxItemSet SmTextForwarder::GetParaAttribs( sal_Int32 nPara ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
OSL_ENSURE( pEditEngine, "EditEngine missing" );
@@ -1049,7 +1049,7 @@ SfxItemSet SmTextForwarder::GetParaAttribs( sal_uInt16 nPara ) const
return aSet;
}
-void SmTextForwarder::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet )
+void SmTextForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
if (pEditEngine)
@@ -1069,7 +1069,7 @@ void SmTextForwarder::RemoveAttribs( const ESelection& rSelection, sal_Bool bRem
pEditEngine->RemoveAttribs( rSelection, bRemoveParaAttribs, nWhich );
}
-void SmTextForwarder::GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const
+void SmTextForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
if (pEditEngine)
@@ -1112,7 +1112,7 @@ sal_Bool SmTextForwarder::IsValid() const
return pEditEngine ? pEditEngine->GetUpdateMode() : sal_False;
}
-XubString SmTextForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
+XubString SmTextForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor )
{
XubString aTxt;
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
@@ -1121,7 +1121,7 @@ XubString SmTextForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_uInt1
return aTxt;
}
-void SmTextForwarder::FieldClicked(const SvxFieldItem&, sal_uInt16, sal_uInt16)
+void SmTextForwarder::FieldClicked(const SvxFieldItem&, sal_Int32, sal_uInt16)
{
}
@@ -1134,7 +1134,7 @@ static sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESel
SfxItemState eState = SFX_ITEM_DEFAULT;
// check all paragraphs inside the selection
- for( sal_uInt16 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ )
+ for( sal_Int32 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ )
{
SfxItemState eParaState = SFX_ITEM_DEFAULT;
@@ -1226,7 +1226,7 @@ sal_uInt16 SmTextForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWh
return nState;
}
-sal_uInt16 SmTextForwarder::GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const
+sal_uInt16 SmTextForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
{
sal_uInt16 nState = SFX_ITEM_DISABLED;
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
@@ -1238,30 +1238,30 @@ sal_uInt16 SmTextForwarder::GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich )
return nState;
}
-LanguageType SmTextForwarder::GetLanguage( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+LanguageType SmTextForwarder::GetLanguage( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
return pEditEngine ? pEditEngine->GetLanguage(nPara, nIndex) : LANGUAGE_NONE;
}
-sal_uInt16 SmTextForwarder::GetFieldCount( sal_uInt16 nPara ) const
+sal_uInt16 SmTextForwarder::GetFieldCount( sal_Int32 nPara ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
return pEditEngine ? pEditEngine->GetFieldCount(nPara) : 0;
}
-EFieldInfo SmTextForwarder::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const
+EFieldInfo SmTextForwarder::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
return pEditEngine ? pEditEngine->GetFieldInfo( nPara, nField ) : EFieldInfo();
}
-EBulletInfo SmTextForwarder::GetBulletInfo( sal_uInt16 /*nPara*/ ) const
+EBulletInfo SmTextForwarder::GetBulletInfo( sal_Int32 /*nPara*/ ) const
{
return EBulletInfo();
}
-Rectangle SmTextForwarder::GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+Rectangle SmTextForwarder::GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
Rectangle aRect(0,0,0,0);
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
@@ -1285,7 +1285,7 @@ Rectangle SmTextForwarder::GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex )
return aRect;
}
-Rectangle SmTextForwarder::GetParaBounds( sal_uInt16 nPara ) const
+Rectangle SmTextForwarder::GetParaBounds( sal_Int32 nPara ) const
{
Rectangle aRect(0,0,0,0);
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
@@ -1313,7 +1313,7 @@ OutputDevice* SmTextForwarder::GetRefDevice() const
return pEditEngine ? pEditEngine->GetRefDevice() : 0;
}
-sal_Bool SmTextForwarder::GetIndexAtPoint( const Point& rPos, sal_uInt16& nPara, sal_uInt16& nIndex ) const
+sal_Bool SmTextForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_uInt16& nIndex ) const
{
sal_Bool bRes = sal_False;
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
@@ -1327,7 +1327,7 @@ sal_Bool SmTextForwarder::GetIndexAtPoint( const Point& rPos, sal_uInt16& nPara,
return bRes;
}
-sal_Bool SmTextForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const
+sal_Bool SmTextForwarder::GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const
{
sal_Bool bRes = sal_False;
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
@@ -1348,7 +1348,7 @@ sal_Bool SmTextForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, s
return bRes;
}
-sal_Bool SmTextForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_Bool SmTextForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
return pEditEngine ?
@@ -1356,25 +1356,25 @@ sal_Bool SmTextForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16&
: sal_False;
}
-sal_uInt16 SmTextForwarder::GetLineCount( sal_uInt16 nPara ) const
+sal_uInt16 SmTextForwarder::GetLineCount( sal_Int32 nPara ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
return pEditEngine ? pEditEngine->GetLineCount(nPara) : 0;
}
-sal_uInt16 SmTextForwarder::GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const
+sal_uInt16 SmTextForwarder::GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
return pEditEngine ? pEditEngine->GetLineLen(nPara, nLine) : 0;
}
-void SmTextForwarder::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nPara, sal_uInt16 nLine ) const
+void SmTextForwarder::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nPara, sal_uInt16 nLine ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
pEditEngine->GetLineBoundaries(rStart, rEnd, nPara, nLine);
}
-sal_uInt16 SmTextForwarder::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const
+sal_uInt16 SmTextForwarder::GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nIndex ) const
{
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
return pEditEngine ? pEditEngine->GetLineNumberAtIndex(nPara, nIndex) : 0;
@@ -1392,13 +1392,13 @@ sal_Bool SmTextForwarder::QuickFormatDoc( sal_Bool /*bFull*/ )
return bRes;
}
-sal_Int16 SmTextForwarder::GetDepth( sal_uInt16 /*nPara*/ ) const
+sal_Int16 SmTextForwarder::GetDepth( sal_Int32 /*nPara*/ ) const
{
// math has no outliner...
return -1;
}
-sal_Bool SmTextForwarder::SetDepth( sal_uInt16 /*nPara*/, sal_Int16 nNewDepth )
+sal_Bool SmTextForwarder::SetDepth( sal_Int32 /*nPara*/, sal_Int16 nNewDepth )
{
// math has no outliner...
return -1 == nNewDepth; // is it the value from 'GetDepth' ?
@@ -1447,12 +1447,12 @@ void SmTextForwarder::AppendParagraph()
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
if (pEditEngine)
{
- sal_uInt16 nParaCount = pEditEngine->GetParagraphCount();
+ sal_Int32 nParaCount = pEditEngine->GetParagraphCount();
pEditEngine->InsertParagraph( nParaCount, String() );
}
}
-xub_StrLen SmTextForwarder::AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet )
+xub_StrLen SmTextForwarder::AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet &rSet )
{
xub_StrLen nRes = 0;
EditEngine *pEditEngine = rEditAcc.GetEditEngine();
diff --git a/starmath/source/accessibility.hxx b/starmath/source/accessibility.hxx
index cac3fdc0a170..4232c8922cdb 100644
--- a/starmath/source/accessibility.hxx
+++ b/starmath/source/accessibility.hxx
@@ -201,17 +201,17 @@ public:
SmTextForwarder( SmEditAccessible& rAcc, SmEditSource & rSource );
virtual ~SmTextForwarder();
- virtual sal_uInt16 GetParagraphCount() const;
- virtual sal_uInt16 GetTextLen( sal_uInt16 nParagraph ) const;
+ virtual sal_Int32 GetParagraphCount() const;
+ virtual sal_uInt16 GetTextLen( sal_Int32 nParagraph ) const;
virtual String GetText( const ESelection& rSel ) const;
virtual SfxItemSet GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib = EditEngineAttribs_All ) const;
- virtual SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const;
- virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet );
+ virtual SfxItemSet GetParaAttribs( sal_Int32 nPara ) const;
+ virtual void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet );
virtual void RemoveAttribs( const ESelection& rSelection, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich );
- virtual void GetPortions( sal_uInt16 nPara, std::vector<sal_uInt16>& rList ) const;
+ virtual void GetPortions( sal_Int32 nPara, std::vector<sal_uInt16>& rList ) const;
virtual sal_uInt16 GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const;
- virtual sal_uInt16 GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const;
+ virtual sal_uInt16 GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const;
virtual void QuickInsertText( const String& rText, const ESelection& rSel );
virtual void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel );
@@ -220,36 +220,36 @@ public:
virtual SfxItemPool* GetPool() const;
- virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
- virtual void FieldClicked(const SvxFieldItem&, sal_uInt16, sal_uInt16);
+ virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor );
+ virtual void FieldClicked(const SvxFieldItem&, sal_Int32, sal_uInt16);
virtual sal_Bool IsValid() const;
- virtual LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const;
- virtual sal_uInt16 GetFieldCount( sal_uInt16 nPara ) const;
- virtual EFieldInfo GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const;
- virtual EBulletInfo GetBulletInfo( sal_uInt16 nPara ) const;
- virtual Rectangle GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual Rectangle GetParaBounds( sal_uInt16 nPara ) const;
+ virtual LanguageType GetLanguage( sal_Int32, sal_uInt16 ) const;
+ virtual sal_uInt16 GetFieldCount( sal_Int32 nPara ) const;
+ virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const;
+ virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const;
+ virtual Rectangle GetCharBounds( sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ virtual Rectangle GetParaBounds( sal_Int32 nPara ) const;
virtual MapMode GetMapMode() const;
virtual OutputDevice* GetRefDevice() const;
- virtual sal_Bool GetIndexAtPoint( const Point&, sal_uInt16& nPara, sal_uInt16& nIndex ) const;
- virtual sal_Bool GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
- virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const;
- virtual sal_uInt16 GetLineCount( sal_uInt16 nPara ) const;
- virtual sal_uInt16 GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const;
- virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const;
- virtual sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nLine ) const;
+ virtual sal_Bool GetIndexAtPoint( const Point&, sal_Int32& nPara, sal_uInt16& nIndex ) const;
+ virtual sal_Bool GetWordIndices( sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const;
+ virtual sal_Bool GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nPara, sal_uInt16 nIndex ) const;
+ virtual sal_uInt16 GetLineCount( sal_Int32 nPara ) const;
+ virtual sal_uInt16 GetLineLen( sal_Int32 nPara, sal_uInt16 nLine ) const;
+ virtual void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_Int32 nParagraph, sal_uInt16 nLine ) const;
+ virtual sal_uInt16 GetLineNumberAtIndex( sal_Int32 nPara, sal_uInt16 nLine ) const;
virtual sal_Bool Delete( const ESelection& );
virtual sal_Bool InsertText( const String&, const ESelection& );
virtual sal_Bool QuickFormatDoc( sal_Bool bFull=sal_False );
- virtual sal_Int16 GetDepth( sal_uInt16 nPara ) const;
- virtual sal_Bool SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth );
+ virtual sal_Int16 GetDepth( sal_Int32 nPara ) const;
+ virtual sal_Bool SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth );
virtual const SfxItemSet* GetEmptyItemSetPtr();
// implementation functions for XParagraphAppend and XTextPortionAppend
virtual void AppendParagraph();
- virtual xub_StrLen AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet &rSet );
+ virtual xub_StrLen AppendTextPortion( sal_Int32 nPara, const String &rText, const SfxItemSet &rSet );
virtual void CopyText(const SvxTextForwarder& rSource);
};
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 4c91b8a2b26a..a3830a5b31ac 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1466,7 +1466,7 @@ void SmCursor::EndEdit(){
SmNodeToTextVisitor(pTree, formula);
//pTree->CreateTextFromNode(formula);
pDocShell->aText = formula;
- pDocShell->GetEditEngine().QuickInsertText( formula, ESelection( 0, 0, EE_PARA_ALL, EE_PARA_ALL ) );
+ pDocShell->GetEditEngine().QuickInsertText( formula, ESelection( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL ) );
pDocShell->GetEditEngine().QuickFormatDoc();
}
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index b6d83e0f6e9f..fdb87286fe38 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -64,7 +64,7 @@ using namespace com::sun::star::uno;
void SmGetLeftSelectionPart(const ESelection &rSel,
- sal_uInt16 &nPara, sal_uInt16 &nPos)
+ sal_Int32 &nPara, sal_uInt16 &nPos)
// returns paragraph number and position of the selections left part
{
// compare start and end of selection and use the one that comes first
@@ -271,11 +271,12 @@ IMPL_LINK(SmEditWindow, CursorMoveTimerHdl, Timer *, EMPTYARG /*pTimer*/)
if (pView)
{
// get row and column to look for
- sal_uInt16 nRow, nCol;
+ sal_Int32 nRow;
+ sal_uInt16 nCol;
SmGetLeftSelectionPart(aNewSelection, nRow, nCol);
nRow++;
nCol++;
- pView->GetGraphicWindow().SetCursorPos(nRow, nCol);
+ pView->GetGraphicWindow().SetCursorPos(static_cast<sal_uInt16>(nRow), nCol);
aOldSelection = aNewSelection;
}
}
@@ -702,8 +703,8 @@ void SmEditWindow::SelectAll()
OSL_ENSURE( pEditView, "NULL pointer" );
if (pEditView)
{
- // 0xFFFF as last two parameters refers to the end of the text
- pEditView->SetSelection( ESelection( 0, 0, 0xFFFF, 0xFFFF ) );
+ // ALL as last two parameters refers to the end of the text
+ pEditView->SetSelection( ESelection( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL ) );
}
}
@@ -762,7 +763,7 @@ void SmEditWindow::SelNextMark()
{
ESelection eSelection = pEditView->GetSelection();
sal_Int32 nPos = eSelection.nEndPos;
- sal_uInt16 nCounts = pEditEngine->GetParagraphCount();
+ sal_Int32 nCounts = pEditEngine->GetParagraphCount();
while (eSelection.nEndPara < nCounts)
{
@@ -793,7 +794,7 @@ void SmEditWindow::SelPrevMark()
sal_Int32 nMax = eSelection.nStartPos;
OUString aText(pEditEngine->GetText(eSelection.nStartPara));
OUString aMark("<?>");
- sal_uInt16 nCounts = pEditEngine->GetParagraphCount();
+ sal_Int32 nCounts = pEditEngine->GetParagraphCount();
do
{
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 2c12b3c4cdef..a380d5871ab6 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -392,11 +392,12 @@ void SmGraphicWindow::Paint(const Rectangle&)
const SmEditWindow *pEdit = pViewShell->GetEditWindow();
if (pEdit)
{ // get new position for formula-cursor (for possible altered formula)
- sal_uInt16 nRow, nCol;
+ sal_Int32 nRow;
+ sal_uInt16 nCol;
SmGetLeftSelectionPart(pEdit->GetSelection(), nRow, nCol);
nRow++;
nCol++;
- const SmNode *pFound = SetCursorPos(nRow, nCol);
+ const SmNode *pFound = SetCursorPos(static_cast<sal_uInt16>(nRow), nCol);
SmModule *pp = SM_MOD();
if (pFound && pp->GetConfig()->IsShowFormulaCursor())
diff --git a/svx/inc/svx/svdomeas.hxx b/svx/inc/svx/svdomeas.hxx
index 439ceb25682d..39018d17cf5f 100644
--- a/svx/inc/svx/svdomeas.hxx
+++ b/svx/inc/svx/svdomeas.hxx
@@ -144,7 +144,7 @@ public:
virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject);
virtual OutlinerParaObject* GetOutlinerParaObject() const;
- virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+ virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
bool bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const;
// #i97878#
diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx
index 551cf58382f1..ece56d7c3c69 100644
--- a/svx/inc/svx/svdotext.hxx
+++ b/svx/inc/svx/svdotext.hxx
@@ -472,7 +472,7 @@ public:
virtual void NbcReformatText();
virtual void ReformatText();
- virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+ virtual bool CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
bool bEdit, Color*& rpTxtColor, Color*& rpFldColor, String& rRet) const;
virtual SdrObject* DoConvertToPolyObj(sal_Bool bBezier, bool bAddText) const;
diff --git a/svx/inc/svx/svdoutl.hxx b/svx/inc/svx/svdoutl.hxx
index 43d5468c259a..9c52d8d37e24 100644
--- a/svx/inc/svx/svdoutl.hxx
+++ b/svx/inc/svx/svdoutl.hxx
@@ -44,7 +44,7 @@ public:
void setVisualizedPage(const SdrPage* pPage) { if(pPage != mpVisualizedPage) mpVisualizedPage = pPage; }
const SdrPage* getVisualizedPage() const { return mpVisualizedPage; }
- virtual String CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor);
+ virtual String CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor);
};
#endif //_SVDOUTL_HXX
diff --git a/svx/source/accessibility/AccessibleEmptyEditSource.cxx b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
index 778f67fda9c6..ec3730105810 100644
--- a/svx/source/accessibility/AccessibleEmptyEditSource.cxx
+++ b/svx/source/accessibility/AccessibleEmptyEditSource.cxx
@@ -95,8 +95,8 @@ namespace accessibility
SfxBroadcaster& GetBroadcaster() const { return *(const_cast<AccessibleEmptyEditSource_Impl*>(this)); }
// SvxTextForwarder
- sal_uInt16 GetParagraphCount() const { return 1; }
- sal_uInt16 GetTextLen( sal_uInt16 /*nParagraph*/ ) const { return 0; }
+ sal_Int32 GetParagraphCount() const { return 1; }
+ sal_uInt16 GetTextLen( sal_Int32 /*nParagraph*/ ) const { return 0; }
String GetText( const ESelection& /*rSel*/ ) const { return String(); }
SfxItemSet GetAttribs( const ESelection& /*rSel*/, sal_Bool /*bOnlyHardAttrib*/ = 0 ) const
{
@@ -105,13 +105,13 @@ namespace accessibility
// a deleted Pool by design.
return SfxItemSet(SdrObject::GetGlobalDrawObjectItemPool());
}
- SfxItemSet GetParaAttribs( sal_uInt16 /*nPara*/ ) const { return GetAttribs(ESelection()); }
- void SetParaAttribs( sal_uInt16 /*nPara*/, const SfxItemSet& /*rSet*/ ) {}
+ SfxItemSet GetParaAttribs( sal_Int32 /*nPara*/ ) const { return GetAttribs(ESelection()); }
+ void SetParaAttribs( sal_Int32 /*nPara*/, const SfxItemSet& /*rSet*/ ) {}
void RemoveAttribs( const ESelection& /*rSelection*/, sal_Bool /*bRemoveParaAttribs*/, sal_uInt16 /*nWhich*/ ){}
- void GetPortions( sal_uInt16 /*nPara*/, std::vector<sal_uInt16>& /*rList*/ ) const {}
+ void GetPortions( sal_Int32 /*nPara*/, std::vector<sal_uInt16>& /*rList*/ ) const {}
sal_uInt16 GetItemState( const ESelection& /*rSel*/, sal_uInt16 /*nWhich*/ ) const { return 0; }
- sal_uInt16 GetItemState( sal_uInt16 /*nPara*/, sal_uInt16 /*nWhich*/ ) const { return 0; }
+ sal_uInt16 GetItemState( sal_Int32 /*nPara*/, sal_uInt16 /*nWhich*/ ) const { return 0; }
SfxItemPool* GetPool() const { return NULL; }
@@ -123,35 +123,35 @@ namespace accessibility
const SfxItemSet * GetEmptyItemSetPtr() { return 0; }
void AppendParagraph() {}
- xub_StrLen AppendTextPortion( sal_uInt16 /*nPara*/, const String & /*rText*/, const SfxItemSet & /*rSet*/ ) { return 0; }
+ xub_StrLen AppendTextPortion( sal_Int32 /*nPara*/, const String & /*rText*/, const SfxItemSet & /*rSet*/ ) { return 0; }
//XTextCopy
void CopyText(const SvxTextForwarder& ){}
- XubString CalcFieldValue( const SvxFieldItem& /*rField*/, sal_uInt16 /*nPara*/, sal_uInt16 /*nPos*/, Color*& /*rpTxtColor*/, Color*& /*rpFldColor*/ )
+ XubString CalcFieldValue( const SvxFieldItem& /*rField*/, sal_Int32 /*nPara*/, sal_uInt16 /*nPos*/, Color*& /*rpTxtColor*/, Color*& /*rpFldColor*/ )
{
return XubString();
}
- void FieldClicked( const SvxFieldItem&, sal_uInt16, xub_StrLen ) {;}
+ void FieldClicked( const SvxFieldItem&, sal_Int32, xub_StrLen ) {;}
sal_Bool IsValid() const { return sal_True; }
void SetNotifyHdl( const Link& ) {}
- LanguageType GetLanguage( sal_uInt16, sal_uInt16 ) const { return LANGUAGE_DONTKNOW; }
- sal_uInt16 GetFieldCount( sal_uInt16 ) const { return 0; }
- EFieldInfo GetFieldInfo( sal_uInt16, sal_uInt16 ) const { return EFieldInfo(); }
- EBulletInfo GetBulletInfo( sal_uInt16 ) const { return EBulletInfo(); }
- Rectangle GetCharBounds( sal_uInt16, sal_uInt16 ) const { return Rectangle(); }
- Rectangle GetParaBounds( sal_uInt16 ) const { return Rectangle(); }
+ LanguageType GetLanguage( sal_Int32, sal_uInt16 ) const { return LANGUAGE_DONTKNOW; }
+ sal_uInt16 GetFieldCount( sal_Int32 ) const { return 0; }
+ EFieldInfo GetFieldInfo( sal_Int32, sal_uInt16 ) const { return EFieldInfo(); }
+ EBulletInfo GetBulletInfo( sal_Int32 ) const { return EBulletInfo(); }
+ Rectangle GetCharBounds( sal_Int32, sal_uInt16 ) const { return Rectangle(); }
+ Rectangle GetParaBounds( sal_Int32 ) const { return Rectangle(); }
MapMode GetMapMode() const { return MapMode(); }
OutputDevice* GetRefDevice() const { return NULL; }
- sal_Bool GetIndexAtPoint( const Point&, sal_uInt16&, sal_uInt16& ) const { return sal_False; }
- sal_Bool GetWordIndices( sal_uInt16, sal_uInt16, sal_uInt16&, sal_uInt16& ) const { return sal_False; }
- sal_Bool GetAttributeRun( sal_uInt16&, sal_uInt16&, sal_uInt16, sal_uInt16 ) const { return sal_False; }
- sal_uInt16 GetLineCount( sal_uInt16 nPara ) const { return nPara == 0 ? 1 : 0; }
- sal_uInt16 GetLineLen( sal_uInt16, sal_uInt16 ) const { return 0; }
- void GetLineBoundaries( /*out*/sal_uInt16 & rStart, /*out*/sal_uInt16 & rEnd, sal_uInt16 /*nParagraph*/, sal_uInt16 /*nLine*/ ) const { rStart = rEnd = 0; }
- sal_uInt16 GetLineNumberAtIndex( sal_uInt16 /*nPara*/, sal_uInt16 /*nIndex*/ ) const { return 0; }
+ sal_Bool GetIndexAtPoint( const Point&, sal_Int32&, sal_uInt16& ) const { return sal_False; }
+ sal_Bool GetWordIndices( sal_Int32, sal_uInt16, sal_uInt16&, sal_uInt16& ) const { return sal_False; }
+ sal_Bool GetAttributeRun( sal_uInt16&, sal_uInt16&, sal_Int32, sal_uInt16 ) const { return sal_False; }
+ sal_uInt16 GetLineCount( sal_Int32 nPara ) const { return nPara == 0 ? 1 : 0; }
+ sal_uInt16 GetLineLen( sal_Int32, sal_uInt16 ) const { return 0; }
+ void GetLineBoundaries( /*out*/sal_uInt16 & rStart, /*out*/sal_uInt16 & rEnd, sal_Int32 /*nParagraph*/, sal_uInt16 /*nLine*/ ) const { rStart = rEnd = 0; }
+ sal_uInt16 GetLineNumberAtIndex( sal_Int32 /*nPara*/, sal_uInt16 /*nIndex*/ ) const { return 0; }
// the following two methods would, strictly speaking, require
// a switch to a real EditSource, too. Fortunately, the
@@ -164,8 +164,8 @@ namespace accessibility
sal_Bool Delete( const ESelection& ) { return sal_False; }
sal_Bool InsertText( const String&, const ESelection& ) { return sal_False; }
sal_Bool QuickFormatDoc( sal_Bool ) { return sal_True; }
- sal_Int16 GetDepth( sal_uInt16 ) const { return -1; }
- sal_Bool SetDepth( sal_uInt16, sal_Int16 ) { return sal_True; }
+ sal_Int16 GetDepth( sal_Int32 ) const { return -1; }
+ sal_Bool SetDepth( sal_Int32, sal_Int16 ) { return sal_True; }
Rectangle GetVisArea() const { return Rectangle(); }
Point LogicToPixel( const Point& rPoint, const MapMode& /*rMapMode*/ ) const { return rPoint; }
diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx
index 08ed92b17720..ad5748478351 100644
--- a/svx/source/accessibility/AccessibleTextHelper.cxx
+++ b/svx/source/accessibility/AccessibleTextHelper.cxx
@@ -257,7 +257,7 @@ namespace accessibility
AccessibleTextHelper_Impl::AccessibleTextHelper_Impl() :
mxFrontEnd( NULL ),
- maLastSelection( EE_PARA_NOT_FOUND,EE_PARA_NOT_FOUND,EE_PARA_NOT_FOUND,EE_PARA_NOT_FOUND ),
+ maLastSelection( EE_PARA_NOT_FOUND,EE_INDEX_NOT_FOUND,EE_PARA_NOT_FOUND,EE_INDEX_NOT_FOUND ),
mnFirstVisibleChild( -1 ),
mnLastVisibleChild( -2 ),
mnStartIndex( 0 ),
@@ -562,7 +562,7 @@ namespace accessibility
OSL_TRACE("AccessibleTextHelper_Impl::UpdateSelection(): Parent has focus!");
}
- sal_uInt16 nMaxValidParaIndex( static_cast< sal_uInt16 >( GetTextForwarder().GetParagraphCount() ) - 1 );
+ sal_Int32 nMaxValidParaIndex( GetTextForwarder().GetParagraphCount() - 1 );
// notify all affected paragraphs (TODO: may be suboptimal,
// since some paragraphs might stay selected)
@@ -674,7 +674,7 @@ namespace accessibility
ESelection aTmpSel( aSelection );
aTmpSel.Adjust();
// first submit event for new and changed selection
- sal_uInt32 nPara = aTmpSel.nStartPara;
+ sal_Int32 nPara = aTmpSel.nStartPara;
for ( ; nPara <= aTmpSel.nEndPara; ++nPara )
{
if ( nPara < aTmpLastSel.nStartPara ||
@@ -835,7 +835,7 @@ namespace accessibility
DBG_ASSERT(nCurrPara >= 0 && nCurrPara <= USHRT_MAX,
"AccessibleTextHelper_Impl::UpdateVisibleChildren: index value overflow");
- aTmpBB = rCacheTF.GetParaBounds( static_cast< sal_uInt16 >( nCurrPara ) );
+ aTmpBB = rCacheTF.GetParaBounds( nCurrPara );
// convert to screen coordinates
aParaBB = ::accessibility::AccessibleEditableTextPara::LogicToPixel( aTmpBB, rCacheTF.GetMapMode(), rCacheVF );
@@ -1102,13 +1102,13 @@ namespace accessibility
@return number of changed paragraphs, -1 for
"every paragraph changed"
*/
- int GetNumberOfParasChanged() { return mnParasChanged; }
+ sal_Int32 GetNumberOfParasChanged() { return mnParasChanged; }
/** Query index of last added/removed paragraph
@return index of lastly added paragraphs, -1 for none
added so far.
*/
- int GetParaIndex() { return mnParaIndex; }
+ sal_Int32 GetParaIndex() { return mnParaIndex; }
/** Query hint id of last interesting event
@return hint id of last interesting event (REMOVED/INSERTED).
@@ -1119,9 +1119,9 @@ namespace accessibility
/** number of paragraphs changed during queue processing. -1 for
"every paragraph changed"
*/
- int mnParasChanged;
+ sal_Int32 mnParasChanged;
/// index of paragraph added/removed last
- int mnParaIndex;
+ sal_Int32 mnParaIndex;
/// TextHint ID (removed/inserted) of last interesting event
int mnHintId;
};
@@ -1302,7 +1302,7 @@ namespace accessibility
// #108900# Delegate change event to children
AccessibleTextHelper_ChildrenTextChanged aNotifyChildrenFunctor;
- if( nPara == static_cast<sal_Int32>(EE_PARA_ALL) )
+ if( nPara == EE_PARA_ALL )
{
// #108900# Call every child
::std::for_each( maParaManager.begin(), maParaManager.end(),
@@ -1374,8 +1374,8 @@ namespace accessibility
// change children state
maParaManager.SetActive( sal_False );
- maLastSelection = ESelection( EE_PARA_NOT_FOUND, EE_PARA_NOT_FOUND,
- EE_PARA_NOT_FOUND, EE_PARA_NOT_FOUND);
+ maLastSelection = ESelection( EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND,
+ EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND);
break;
}
default:
@@ -1697,7 +1697,7 @@ namespace accessibility
DBG_ASSERT(nChild >= 0 && nChild <= USHRT_MAX,
"AccessibleTextHelper_Impl::getAccessibleAt: index value overflow");
- Rectangle aParaBounds( rCacheTF.GetParaBounds( static_cast< sal_uInt16 > (nChild) ) );
+ Rectangle aParaBounds( rCacheTF.GetParaBounds( nChild ) );
if( aParaBounds.IsInside( aLogPoint ) )
return getAccessibleChild( nChild - mnFirstVisibleChild + GetStartIndex() );
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 8bbf160f0ca4..ad9d8014edf7 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -106,7 +106,7 @@ sal_Bool InitializeFontWorkData( const SdrObject* pCustomShape, const sal_uInt16
sal_Int32 nParagraphsLeft = rTextObj.GetParagraphCount();
rFWData.nMaxParagraphsPerTextArea = ( ( nParagraphsLeft - 1 ) / nTextAreaCount ) + 1;
- sal_Int16 j = 0;
+ sal_Int32 j = 0;
while( nParagraphsLeft && nTextAreaCount )
{
FWTextArea aTextArea;
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index db1a34a849d8..023e05cae937 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -108,9 +108,9 @@ namespace sdr
pOutliner->SetText(*pParaObj);
}
- sal_uInt32 nParaCount(pOutliner->GetParagraphCount());
+ sal_Int32 nParaCount(pOutliner->GetParagraphCount());
- for(sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
+ for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
{
SfxItemSet aSet(pOutliner->GetParaAttribs(nPara));
aSet.Put(rSet);
@@ -128,7 +128,7 @@ namespace sdr
mpItemSet->Put(aNewSet);
}
- OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount);
+ OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount);
pOutliner->Clear();
rObj.NbcSetOutlinerParaObjectForText(pTemp,pText);
@@ -180,14 +180,14 @@ namespace sdr
if( pParaObj )
{
rOutliner.SetText(*pParaObj);
- sal_uInt32 nParaCount(rOutliner.GetParagraphCount());
+ sal_Int32 nParaCount(rOutliner.GetParagraphCount());
if(nParaCount)
{
- ESelection aSelection( 0, 0, EE_PARA_ALL, EE_PARA_ALL);
+ ESelection aSelection( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL);
rOutliner.RemoveAttribs(aSelection, sal_True, 0);
- OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount);
+ OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, nParaCount);
rOutliner.Clear();
rObj.NbcSetOutlinerParaObjectForText( pTemp, pText );
@@ -257,11 +257,11 @@ namespace sdr
// apply StyleSheet to all paragraphs
rOutliner.SetText(*pParaObj);
- sal_uInt32 nParaCount(rOutliner.GetParagraphCount());
+ sal_Int32 nParaCount(rOutliner.GetParagraphCount());
if(nParaCount)
{
- for(sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
+ for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
{
SfxItemSet* pTempSet = 0L;
@@ -278,7 +278,7 @@ namespace sdr
{
String aNewStyleSheetName(GetStyleSheet()->GetName());
aNewStyleSheetName.Erase(aNewStyleSheetName.Len() - 1, 1);
- sal_Int16 nDepth = rOutliner.GetDepth((sal_uInt16)nPara);
+ sal_Int16 nDepth = rOutliner.GetDepth(nPara);
aNewStyleSheetName += String::CreateFromInt32( nDepth <= 0 ? 1 : nDepth + 1);
SdrModel* pModel = rObj.GetModel();
@@ -328,7 +328,7 @@ namespace sdr
if(nW >= EE_ITEMS_START && nW <= EE_ITEMS_END)
{
- rOutliner.QuickRemoveCharAttribs((sal_uInt16)nPara, nW);
+ rOutliner.QuickRemoveCharAttribs(nPara, nW);
}
}
pItem = aIter.NextItem();
@@ -342,7 +342,7 @@ namespace sdr
}
}
- OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount);
+ OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, nParaCount);
rOutliner.Clear();
rObj.NbcSetOutlinerParaObjectForText(pTemp, pText);
}
@@ -417,13 +417,13 @@ namespace sdr
pOutliner->SetText(*pParaObj);
- sal_uInt32 nParaCount(pOutliner->GetParagraphCount());
+ sal_Int32 nParaCount(pOutliner->GetParagraphCount());
if(nParaCount)
{
sal_Bool bBurnIn(sal_False);
- for(sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
+ for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
{
SfxStyleSheet* pSheet = pOutliner->GetStyleSheet(nPara);
@@ -457,7 +457,7 @@ namespace sdr
{
EditEngine* pEditEngine = const_cast<EditEngine*>(&(pOutliner->GetEditEngine()));
std::vector<EECharAttrib> aAttribs;
- pEditEngine->GetCharAttribs((sal_uInt16)nPara, aAttribs);
+ pEditEngine->GetCharAttribs(nPara, aAttribs);
for(std::vector<EECharAttrib>::iterator i = aAttribs.begin(); i < aAttribs.end(); ++i)
{
@@ -486,7 +486,7 @@ namespace sdr
SfxItemSet aColorSet(*aSet.GetPool(), EE_CHAR_COLOR, EE_CHAR_COLOR );
aColorSet.Put(aSet, sal_False);
- ESelection aSel((sal_uInt16)nPara, 0);
+ ESelection aSel(nPara, 0);
for(std::vector<EECharAttrib>::iterator i = aAttribs.begin(); i < aAttribs.end(); ++i)
{
@@ -501,7 +501,7 @@ namespace sdr
}
}
- aSel.nEndPos = pEditEngine->GetTextLen((sal_uInt16)nPara);
+ aSel.nEndPos = pEditEngine->GetTextLen(nPara);
if(aSel.nStartPos != aSel.nEndPos)
{
@@ -525,7 +525,7 @@ namespace sdr
if(bBurnIn)
{
- OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount);
+ OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount);
rObj.NbcSetOutlinerParaObjectForText(pTemp,pText);
}
}
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index f047b7839959..15365ead6ad9 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1249,11 +1249,11 @@ sal_Bool SdrObjEditView::ImpIsTextEditAllSelected() const
{
if(SdrTextObj::HasTextImpl( pTextEditOutliner ) )
{
- const sal_uInt32 nParaAnz=pTextEditOutliner->GetParagraphCount();
+ const sal_Int32 nParaAnz=pTextEditOutliner->GetParagraphCount();
Paragraph* pLastPara=pTextEditOutliner->GetParagraph( nParaAnz > 1 ? nParaAnz - 1 : 0 );
ESelection aESel(pTextEditOutlinerView->GetSelection());
- if (aESel.nStartPara==0 && aESel.nStartPos==0 && aESel.nEndPara==sal_uInt16(nParaAnz-1))
+ if (aESel.nStartPara==0 && aESel.nStartPos==0 && aESel.nEndPara==(nParaAnz-1))
{
XubString aStr(pTextEditOutliner->GetText(pLastPara));
@@ -1261,7 +1261,7 @@ sal_Bool SdrObjEditView::ImpIsTextEditAllSelected() const
bRet = sal_True;
}
// in case the selection was done backwards
- if (!bRet && aESel.nEndPara==0 && aESel.nEndPos==0 && aESel.nStartPara==sal_uInt16(nParaAnz-1))
+ if (!bRet && aESel.nEndPara==0 && aESel.nEndPos==0 && aESel.nStartPara==(nParaAnz-1))
{
XubString aStr(pTextEditOutliner->GetText(pLastPara));
@@ -1550,9 +1550,8 @@ sal_Bool SdrObjEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDon
{
Outliner* pOutliner = pTextEditOutlinerView->GetOutliner();
- const sal_uIntPtr nParaCount = pOutliner->GetParagraphCount();
- sal_uIntPtr nPara;
- for( nPara = 0; nPara < nParaCount; nPara++ )
+ const sal_Int32 nParaCount = pOutliner->GetParagraphCount();
+ for( sal_Int32 nPara = 0; nPara < nParaCount; nPara++ )
{
pOutliner->SetStyleSheet( nPara, pStyleSheet );
}
@@ -1916,11 +1915,11 @@ void SdrObjEditView::ApplyFormatPaintBrushToText( SfxItemSet& rFormatSet, SdrTex
SdrOutliner& rOutliner = rTextObj.ImpGetDrawOutliner();
rOutliner.SetText(*pParaObj);
- sal_uInt32 nParaCount(rOutliner.GetParagraphCount());
+ sal_Int32 nParaCount(rOutliner.GetParagraphCount());
if(nParaCount)
{
- for(sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
+ for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
{
if( !bNoCharacterFormats )
rOutliner.QuickRemoveCharAttribs( nPara, /* remove all */0 );
@@ -1930,7 +1929,7 @@ void SdrObjEditView::ApplyFormatPaintBrushToText( SfxItemSet& rFormatSet, SdrTex
rOutliner.SetParaAttribs(nPara, aSet);
}
- OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount);
+ OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, nParaCount);
rOutliner.Clear();
rTextObj.NbcSetOutlinerParaObjectForText(pTemp,pText);
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index a2ad1574dca5..f85c5cd1b094 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -571,7 +571,7 @@ basegfx::B2DPolyPolygon SdrMeasureObj::ImpCalcXPoly(const ImpMeasurePoly& rPol)
return aRetval;
}
-bool SdrMeasureObj::CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+bool SdrMeasureObj::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
bool bEdit,
Color*& rpTxtColor, Color*& rpFldColor, XubString& rRet) const
{
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 7a662aa645a2..3edc37bdf3f1 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -468,7 +468,7 @@ bool SdrTextObj::HasTextImpl( SdrOutliner* pOutliner )
if(pOutliner)
{
Paragraph* p1stPara=pOutliner->GetParagraph( 0 );
- sal_uIntPtr nParaAnz=pOutliner->GetParagraphCount();
+ sal_Int32 nParaAnz=pOutliner->GetParagraphCount();
if(p1stPara==NULL)
nParaAnz=0;
@@ -843,7 +843,7 @@ OutlinerParaObject* SdrTextObj::GetEditOutlinerParaObject() const
OutlinerParaObject* pPara=NULL;
if( HasTextImpl( pEdtOutl ) )
{
- sal_uInt16 nParaAnz = static_cast< sal_uInt16 >( pEdtOutl->GetParagraphCount() );
+ sal_Int32 nParaAnz = pEdtOutl->GetParagraphCount();
pPara = pEdtOutl->CreateParaObject(0, nParaAnz);
}
return pPara;
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 2bb9e7a6193a..097b47639177 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -74,7 +74,7 @@ namespace
String maText;
xub_StrLen mnTextStart;
xub_StrLen mnTextLength;
- sal_uInt16 mnParagraph;
+ sal_Int32 mnParagraph;
xub_StrLen mnIndex;
SvxFont maFont;
::std::vector< double > maDblDXArray; // double DXArray, font size independent -> unit coordinate system
@@ -127,7 +127,7 @@ namespace
const String& getText() const { return maText; }
xub_StrLen getTextStart() const { return mnTextStart; }
xub_StrLen getTextLength() const { return mnTextLength; }
- sal_uInt16 getParagraph() const { return mnParagraph; }
+ sal_Int32 getParagraph() const { return mnParagraph; }
xub_StrLen getIndex() const { return mnIndex; }
const SvxFont& getFont() const { return maFont; }
bool isRTL() const { return mbRTL; }
@@ -705,7 +705,7 @@ void SdrTextObj::impDecomposePathTextPrimitive(
// get loop count
sal_uInt32 nLoopCount(rPathPolyPolygon.count());
- if(rOutliner.GetParagraphCount() < nLoopCount)
+ if(static_cast<sal_uInt32>(rOutliner.GetParagraphCount()) < nLoopCount)
{
nLoopCount = rOutliner.GetParagraphCount();
}
@@ -730,7 +730,7 @@ void SdrTextObj::impDecomposePathTextPrimitive(
{
const impPathTextPortion& rCandidate = rPathTextPortions[b];
- if(rCandidate.getParagraph() == a)
+ if(static_cast<sal_uInt32>(rCandidate.getParagraph()) == a)
{
aParagraphTextPortions.push_back(&rCandidate);
}
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index 30ee13c1adb4..e4877dd649fa 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -234,9 +234,9 @@ void SdrTextObj::ImpSetTextStyleSheetListeners()
const EditTextObject& rTextObj=pOutlinerParaObject->GetTextObject();
XubString aStyleName;
SfxStyleFamily eStyleFam;
- sal_uInt16 nParaAnz=rTextObj.GetParagraphCount();
+ sal_Int32 nParaAnz=rTextObj.GetParagraphCount();
- for(sal_uInt16 nParaNum(0); nParaNum < nParaAnz; nParaNum++)
+ for(sal_Int32 nParaNum(0); nParaNum < nParaAnz; nParaNum++)
{
rTextObj.GetStyleSheet(nParaNum, aStyleName, eStyleFam);
@@ -335,7 +335,7 @@ void SdrTextObj::RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>&
pOutliner->SetText(*pOutlinerParaObject);
}
- ESelection aSelAll( 0, 0, 0xffff, 0xffff );
+ ESelection aSelAll( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL );
std::vector<sal_uInt16>::const_iterator aIter( rCharWhichIds.begin() );
while( aIter != rCharWhichIds.end() )
{
@@ -344,8 +344,8 @@ void SdrTextObj::RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>&
if(!pEdtOutl || (pText != getActiveText()) )
{
- const sal_uInt32 nParaCount = pOutliner->GetParagraphCount();
- OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount);
+ const sal_Int32 nParaCount = pOutliner->GetParagraphCount();
+ OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount);
pOutliner->Clear();
NbcSetOutlinerParaObjectForText(pTemp, pText);
}
@@ -364,7 +364,7 @@ bool SdrTextObj::HasText() const
if( pOPO )
{
const EditTextObject& rETO = pOPO->GetTextObject();
- sal_uInt16 nParaCount = rETO.GetParagraphCount();
+ sal_Int32 nParaCount = rETO.GetParagraphCount();
if( nParaCount > 0 )
bHasText = (nParaCount > 1) || (rETO.GetText( 0 ).Len() != 0);
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index a92b17cdc0b6..07f72bf7a6a2 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -234,7 +234,7 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
// to make the gray field background vanish again
rOutl.UpdateFields();
- sal_uInt16 nParaAnz = static_cast< sal_uInt16 >( rOutl.GetParagraphCount() );
+ sal_Int32 nParaAnz = rOutl.GetParagraphCount();
pNewText = rOutl.CreateParaObject( 0, nParaAnz );
// need to end edit mode early since SetOutlinerParaObject already
diff --git a/svx/source/svdraw/svdotxfl.cxx b/svx/source/svdraw/svdotxfl.cxx
index d83419f590d9..264f5e4ac36c 100644
--- a/svx/source/svdraw/svdotxfl.cxx
+++ b/svx/source/svdraw/svdotxfl.cxx
@@ -40,7 +40,7 @@ void SdrRegisterFieldClasses()
///////////////////////////////////////////////////////////////////////////////////////////////// */
-bool SdrTextObj::CalcFieldValue(const SvxFieldItem& /*rField*/, sal_uInt16 /*nPara*/, sal_uInt16 /*nPos*/,
+bool SdrTextObj::CalcFieldValue(const SvxFieldItem& /*rField*/, sal_Int32 /*nPara*/, sal_uInt16 /*nPos*/,
bool /*bEdit*/, Color*& /*rpTxtColor*/, Color*& /*rpFldColor*/, XubString& /*rRet*/) const
{
return false;
diff --git a/svx/source/svdraw/svdoutl.cxx b/svx/source/svdraw/svdoutl.cxx
index f7bd33e70725..35bf43038d86 100644
--- a/svx/source/svdraw/svdoutl.cxx
+++ b/svx/source/svdraw/svdoutl.cxx
@@ -74,7 +74,7 @@ void SdrOutliner::SetTextObjNoInit( const SdrTextObj* pObj )
mpTextObj.reset( const_cast< SdrTextObj* >(pObj) );
}
-XubString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+XubString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
Color*& rpTxtColor, Color*& rpFldColor)
{
bool bOk = false;
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 1b1f0c3ad967..aa267b0e60cc 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1228,7 +1228,7 @@ XubString SdrView::GetStatusText()
ESelection aSel(pTextEditOutlinerView->GetSelection());
long nPar=aSel.nEndPara,nLin=0,nCol=aSel.nEndPos;
if (aSel.nEndPara>0) {
- for (sal_uInt16 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) {
+ for (sal_Int32 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) {
nLin+=pTextEditOutliner->GetLineCount(nParaNum);
}
}
@@ -1345,7 +1345,7 @@ SdrViewContext SdrView::GetContext() const
void SdrView::MarkAll()
{
if (IsTextEdit()) {
- GetTextEditOutlinerView()->SetSelection(ESelection(0,0,0xFFFF,0xFFFF));
+ GetTextEditOutlinerView()->SetSelection(ESelection(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL));
#ifdef DBG_UTIL
if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
#endif
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 9a52903d6de7..a44301a2580b 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -259,9 +259,9 @@ namespace sdr
pOutliner->SetText(*pParaObj);
}
- sal_uInt32 nParaCount(pOutliner->GetParagraphCount());
+ sal_Int32 nParaCount(pOutliner->GetParagraphCount());
- for(sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
+ for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
{
SfxItemSet aSet(pOutliner->GetParaAttribs(nPara));
aSet.Put(rSet);
@@ -279,7 +279,7 @@ namespace sdr
mpItemSet->Put(aNewSet);
}
- OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount);
+ OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount);
pOutliner->Clear();
mxCell->SetOutlinerParaObject(pTemp);
@@ -751,7 +751,7 @@ SdrTextHorzAdjust Cell::GetTextHorizontalAdjust() const
void Cell::SetOutlinerParaObject( OutlinerParaObject* pTextObject )
{
SdrText::SetOutlinerParaObject( pTextObject );
- maSelection.nStartPara = 0xffff;
+ maSelection.nStartPara = EE_PARA_MAX_COUNT;
if( pTextObject == 0 )
ForceOutlinerParaObject( OUTLINERMODE_TEXTOBJECT );
@@ -1595,14 +1595,14 @@ void SAL_CALL Cell::setAllPropertiesToDefault( ) throw (RuntimeException)
if( pParaObj )
{
rOutliner.SetText(*pParaObj);
- sal_uInt32 nParaCount(rOutliner.GetParagraphCount());
+ sal_Int32 nParaCount(rOutliner.GetParagraphCount());
if(nParaCount)
{
- ESelection aSelection( 0, 0, EE_PARA_ALL, EE_PARA_ALL);
+ ESelection aSelection( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL);
rOutliner.RemoveAttribs(aSelection, sal_True, 0);
- OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount);
+ OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, nParaCount);
rOutliner.Clear();
SetOutlinerParaObject(pTemp);
@@ -1732,7 +1732,7 @@ Reference< XTextRange > SAL_CALL Cell::getEnd( ) throw (RuntimeException)
OUString SAL_CALL Cell::getString( ) throw (RuntimeException)
{
- maSelection.nStartPara = 0xffff;
+ maSelection.nStartPara = EE_PARA_MAX_COUNT;
return SvxUnoTextBase::getString();
}
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 9bf226865958..2518b6c26ba9 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1834,7 +1834,7 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl)
OutlinerParaObject* pNewText = 0;
Paragraph* p1stPara = rOutl.GetParagraph( 0 );
- sal_uInt32 nParaAnz = rOutl.GetParagraphCount();
+ sal_Int32 nParaAnz = rOutl.GetParagraphCount();
if(p1stPara)
{
@@ -1856,7 +1856,7 @@ void SdrTableObj::EndTextEdit(SdrOutliner& rOutl)
if(nParaAnz != 0)
{
// create new text object
- pNewText = rOutl.CreateParaObject( 0, (sal_uInt16)nParaAnz );
+ pNewText = rOutl.CreateParaObject( 0, nParaAnz );
}
}
SetOutlinerParaObject(pNewText);
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 1cdf9e0040e5..bbadab679ae9 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -1649,7 +1649,7 @@ void SvxTableController::EditCell( const CellPos& rPos, ::Window* pWindow, const
if(!pTableObj->GetOutlinerParaObject() && mpView->GetTextEditOutliner())
{
::Outliner* pOutl = mpView->GetTextEditOutliner();
- sal_uIntPtr nParaAnz = pOutl->GetParagraphCount();
+ sal_Int32 nParaAnz = pOutl->GetParagraphCount();
Paragraph* p1stPara = pOutl->GetParagraph( 0 );
if(nParaAnz==1 && p1stPara)
diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx
index 0d0392eeeb6f..33c8c41a05ea 100644
--- a/svx/source/table/tablertfimporter.cxx
+++ b/svx/source/table/tablertfimporter.cxx
@@ -108,7 +108,7 @@ private:
int mnLastToken;
bool mbNewDef;
- sal_uInt16 mnStartPara;
+ sal_Int32 mnStartPara;
sal_Int32 mnColCnt;
sal_Int32 mnRowCnt;
@@ -273,7 +273,7 @@ void SdrTableRTFParser::FillTable()
if( xCellInfo->maItemSet.GetItemState(SDRATTR_TABLE_BORDER,sal_False,&pPoolItem)==SFX_ITEM_SET)
xCell->SetMergedItem( *pPoolItem );
- OutlinerParaObject* pTextObject = mpOutliner->CreateParaObject( (sal_uInt16)xCellInfo->mnStartPara, (sal_uInt16)xCellInfo->mnParaCount );
+ OutlinerParaObject* pTextObject = mpOutliner->CreateParaObject( xCellInfo->mnStartPara, xCellInfo->mnParaCount );
if( pTextObject )
{
SdrOutliner& rOutliner=mrTableObj.ImpGetDrawOutliner();
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 35ea4c156154..34e211806cf5 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -556,7 +556,7 @@ public:
const OutlinerParaObject* GetTextObject() const;
void SetTextObject( OutlinerParaObject* pText );
- sal_uInt32 GetNumberOfParagraphs() const;
+ sal_Int32 GetNumberOfParagraphs() const;
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index ebee25966357..db1fd81b0003 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1850,7 +1850,7 @@ void SwPostItField::SetTextObject( OutlinerParaObject* pText )
mpText = pText;
}
-sal_uInt32 SwPostItField::GetNumberOfParagraphs() const
+sal_Int32 SwPostItField::GetNumberOfParagraphs() const
{
return (mpText) ? mpText->Count() : 1;
}
diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx
index ae920d449e7d..f4107d4a3523 100644
--- a/sw/source/filter/rtf/rtftbl.cxx
+++ b/sw/source/filter/rtf/rtftbl.cxx
@@ -867,7 +867,7 @@ void SwRTFParser::NewTblLine()
pBox = pLns->back()->GetTabBoxes().front();
- sal_uLong nOldPos = pPam->GetPoint()->nNode.GetIndex();
+ sal_Int32 nOldPos = pPam->GetPoint()->nNode.GetIndex();
pPam->GetPoint()->nNode = *pBox->GetSttNd();
pPam->Move( fnMoveForward );
m_nCurrentBox = 0;
@@ -909,7 +909,7 @@ void SwRTFParser::NewTblLine()
SvxRTFItemStack& rAttrStk = GetAttrStack();
const SvxRTFItemStackType* pStk;
for( size_t n = 0; n < rAttrStk.size(); ++n )
- if( ( pStk = rAttrStk[ n ])->GetSttNodeIdx() == sal_uLong(nOldPos) &&
+ if( ( pStk = rAttrStk[ n ])->GetSttNodeIdx() == nOldPos &&
!pStk->GetSttCnt() )
((SvxRTFItemStackType*)pStk)->SetStartPos( SwxPosition( pPam ) );
}
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 13216ca96723..25a1dc0657fb 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -3643,7 +3643,7 @@ void SwRTFParser::ReadHeaderFooter( int nToken, SwPageDesc* pPageDesc )
// wurde an der Position ein Escapement aufgespannt, so entferne
// das jetzt. Fussnoten sind bei uns immer hochgestellt.
SvxRTFItemStackType* pTmp = aSaveStack.empty() ? 0 : aSaveStack.back();
- if( pTmp && pTmp->GetSttNodeIdx() ==
+ if( pTmp && static_cast<sal_uLong>(pTmp->GetSttNodeIdx()) ==
pPam->GetPoint()->nNode.GetIndex() &&
pTmp->GetSttCnt() == nPos )
pTmp->GetAttrSet().ClearItem( RES_CHRATR_ESCAPEMENT );
@@ -4168,7 +4168,7 @@ void SwRTFParser::DelLastNode()
{
SvxRTFItemStackType* pStkEntry = (SvxRTFItemStackType*)
GetAttrStack()[ --n ];
- if( nNodeIdx == pStkEntry->GetSttNode().GetIdx() )
+ if( nNodeIdx == static_cast<sal_uLong>(pStkEntry->GetSttNode().GetIdx()) )
{
if( !bMove )
{
@@ -4205,7 +4205,7 @@ void SwRTFParser::UnknownAttrToken( int nToken, SfxItemSet* pSet )
// Crsr nicht mehr in der Tabelle ?
if( !pPam->GetNode()->FindTableNode() && _do )
{
- sal_uLong nOldPos = pPam->GetPoint()->nNode.GetIndex();
+ sal_Int32 nOldPos = pPam->GetPoint()->nNode.GetIndex();
// dann wieder in die letzte Box setzen
// (kann durch einlesen von Flys geschehen!)
@@ -4385,7 +4385,7 @@ bool BookmarkPosition::operator==(const BookmarkPosition rhs)
return(maMkNode.GetIndex() == rhs.maMkNode.GetIndex() && mnMkCntnt == rhs.mnMkCntnt);
}
-sal_uLong SwNodeIdx::GetIdx() const
+sal_Int32 SwNodeIdx::GetIdx() const
{
return aIdx.GetIndex();
}
@@ -4405,7 +4405,7 @@ SvxNodeIdx* SwxPosition::MakeNodeIdx() const
return new SwNodeIdx( pPam->GetPoint()->nNode );
}
-sal_uLong SwxPosition::GetNodeIdx() const
+sal_Int32 SwxPosition::GetNodeIdx() const
{
return pPam->GetPoint()->nNode.GetIndex();
}
diff --git a/sw/source/filter/rtf/swparrtf.hxx b/sw/source/filter/rtf/swparrtf.hxx
index b60dc50933e3..c4cb1c32d4e8 100644
--- a/sw/source/filter/rtf/swparrtf.hxx
+++ b/sw/source/filter/rtf/swparrtf.hxx
@@ -69,7 +69,7 @@ class SwNodeIdx : public SvxNodeIdx
SwNodeIndex aIdx;
public:
SwNodeIdx( const SwNodeIndex& rIdx ) : aIdx( rIdx ) {}
- virtual sal_uLong GetIdx() const;
+ virtual sal_Int32 GetIdx() const;
virtual SvxNodeIdx* Clone() const;
};
@@ -94,7 +94,7 @@ class SwxPosition : public SvxPosition
public:
SwxPosition( SwPaM* pCrsr ) : pPam( pCrsr ) {}
- virtual sal_uLong GetNodeIdx() const;
+ virtual sal_Int32 GetNodeIdx() const;
virtual xub_StrLen GetCntIdx() const;
// erzeuge von sich selbst eine Kopie
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index a233f1281e40..9cab8f63e94f 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2477,11 +2477,11 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj)
const EditTextObject& rEditObj = rParaObj.GetTextObject();
MSWord_SdrAttrIter aAttrIter( m_rExport, rEditObj, TXT_HFTXTBOX );
- sal_uInt16 nPara = rEditObj.GetParagraphCount();
+ sal_Int32 nPara = rEditObj.GetParagraphCount();
m_pSerializer->startElementNS( XML_w, XML_textbox, FSEND );
m_pSerializer->startElementNS( XML_w, XML_txbxContent, FSEND );
- for (sal_uInt16 n = 0; n < nPara; ++n)
+ for (sal_Int32 n = 0; n < nPara; ++n)
{
if( n )
aAttrIter.NextPara( n );
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 0cbb453f0fa7..1d1a22bf0415 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -751,8 +751,8 @@ void DocxExport::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTy
const EditTextObject& rEditObj = rParaObj.GetTextObject();
MSWord_SdrAttrIter aAttrIter( *this, rEditObj, nTyp );
- sal_uInt16 nPara = rEditObj.GetParagraphCount();
- for( sal_uInt16 n = 0; n < nPara; ++n )
+ sal_Int32 nPara = rEditObj.GetParagraphCount();
+ for( sal_Int32 n = 0; n < nPara; ++n )
{
if( n )
aAttrIter.NextPara( n );
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 91fe3002b267..eabf06e03811 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -530,10 +530,10 @@ void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj)
const EditTextObject& rEditObj = rParaObj.GetTextObject();
MSWord_SdrAttrIter aAttrIter( m_rExport, rEditObj, TXT_HFTXTBOX );
- sal_uInt16 nPara = rEditObj.GetParagraphCount();
+ sal_Int32 nPara = rEditObj.GetParagraphCount();
m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHPTXT).append(' ');
- for (sal_uInt16 n = 0; n < nPara; ++n)
+ for (sal_Int32 n = 0; n < nPara; ++n)
{
if( n )
aAttrIter.NextPara( n );
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 3263817c0759..86051f2cabb5 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -844,7 +844,7 @@ MSWord_SdrAttrIter::MSWord_SdrAttrIter( MSWordExportBase& rWr,
NextPara( 0 );
}
-void MSWord_SdrAttrIter::NextPara( sal_uInt16 nPar )
+void MSWord_SdrAttrIter::NextPara( sal_Int32 nPar )
{
nPara = nPar;
// Attributwechsel an Pos 0 wird ignoriert, da davon ausgegangen
@@ -1124,9 +1124,9 @@ void WW8Export::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTyp
const EditTextObject& rEditObj = rParaObj.GetTextObject();
MSWord_SdrAttrIter aAttrIter( *this, rEditObj, nTyp );
- sal_uInt16 nPara = rEditObj.GetParagraphCount();
+ sal_Int32 nPara = rEditObj.GetParagraphCount();
sal_uInt8 bNul = 0;
- for( sal_uInt16 n = 0; n < nPara; ++n )
+ for( sal_Int32 n = 0; n < nPara; ++n )
{
if( n )
aAttrIter.NextPara( n );
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 165274023890..2856c5ba1d92 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1393,7 +1393,7 @@ private:
std::vector<EECharAttrib> aTxtAtrArr;
std::vector<const EECharAttrib*> aChrTxtAtrArr;
std::vector<rtl_TextEncoding> aChrSetArr;
- sal_uInt16 nPara;
+ sal_Int32 nPara;
xub_StrLen nAktSwPos;
xub_StrLen nTmpSwPos; // for HasItem()
rtl_TextEncoding eNdChrSet;
@@ -1409,7 +1409,7 @@ private:
public:
MSWord_SdrAttrIter( MSWordExportBase& rWr, const EditTextObject& rEditObj,
sal_uInt8 nType );
- void NextPara( sal_uInt16 nPar );
+ void NextPara( sal_Int32 nPar );
void OutParaAttr(bool bCharAttr);
void OutEEField(const SfxPoolItem& rHt);
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index c432363ab79c..073377a239b1 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -464,9 +464,9 @@ SdrObject* SwWW8ImplReader::ReadPolyLine( WW8_DPHEAD* pHd, const WW8_DO* pDo,
ESelection SwWW8ImplReader::GetESelection( long nCpStart, long nCpEnd )
{
- sal_uInt16 nPCnt = mpDrawEditEngine->GetParagraphCount();
- sal_uInt16 nSP = 0;
- sal_uInt16 nEP = 0;
+ sal_Int32 nPCnt = mpDrawEditEngine->GetParagraphCount();
+ sal_Int32 nSP = 0;
+ sal_Int32 nEP = 0;
while( (nSP < nPCnt)
&& (nCpStart >= mpDrawEditEngine->GetTextLen( nSP ) + 1) )
{
@@ -481,7 +481,7 @@ ESelection SwWW8ImplReader::GetESelection( long nCpStart, long nCpEnd )
nCpEnd -= mpDrawEditEngine->GetTextLen( nEP ) + 1;
nEP++;
}
- return ESelection( nSP, (sal_uInt16)nCpStart, nEP, (sal_uInt16)nCpEnd );
+ return ESelection( nSP, nCpStart, nEP, nCpEnd );
}
// InsertTxbxStyAttrs() setzt die Style-Attribute in den uebergebenen ItemSet.
diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx
index b5eb64c74f83..f2a1ea26c711 100644
--- a/sw/source/ui/docvw/AnnotationWin.cxx
+++ b/sw/source/ui/docvw/AnnotationWin.cxx
@@ -242,12 +242,12 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText)
GetOutlinerView()->InsertText(rtl::OUString("..."),false);
GetOutlinerView()->InsertText(rtl::OUString("\"\n"),false);
- GetOutlinerView()->SetSelection(ESelection(0x0,0x0,0xFFFF,0xFFFF));
+ GetOutlinerView()->SetSelection(ESelection(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL));
SfxItemSet aAnswerSet( DocView().GetDocShell()->GetPool() );
aAnswerSet.Put(SvxFontHeightItem(200,80,EE_CHAR_FONTHEIGHT));
aAnswerSet.Put(SvxPostureItem(ITALIC_NORMAL,EE_CHAR_ITALIC));
GetOutlinerView()->SetAttribs(aAnswerSet);
- GetOutlinerView()->SetSelection(ESelection(0xFFFF,0xFFFF,0xFFFF,0xFFFF));
+ GetOutlinerView()->SetSelection(ESelection(EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT,EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT));
//remove all attributes and reset our standard ones
GetOutlinerView()->GetEditView().RemoveAttribsKeepLanguages(true);
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 4a37c000bb04..33c72db50808 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -1768,7 +1768,8 @@ sal_uInt16 SwPostItMgr::SearchReplace(const SwFmtFld &pFld, const ::com::sun::st
if (bSrchForward)
pWin->GetOutlinerView()->SetSelection(ESelection(0,0,0,0));
else
- pWin->GetOutlinerView()->SetSelection(ESelection(0xFFFF,0xFFFF,0xFFFF,0xFFFF));
+ pWin->GetOutlinerView()->SetSelection(
+ ESelection(EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT,EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT));
SvxSearchItem aItem(SID_SEARCH_ITEM );
aItem.SetSearchOptions(rSearchOptions);
aItem.SetBackward(!bSrchForward);
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index c0417adb9eff..17c0aead3cb4 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -762,7 +762,7 @@ void SwSidebarWin::SetLanguage(const SvxLanguageItem aNewItem)
Engine()->SetModifyHdl( Link() );
ESelection aOld = GetOutlinerView()->GetSelection();
- ESelection aNewSelection( 0, 0, (sal_uInt16)Engine()->GetParagraphCount()-1, USHRT_MAX );
+ ESelection aNewSelection( 0, 0, Engine()->GetParagraphCount()-1, EE_TEXTPOS_ALL );
GetOutlinerView()->SetSelection( aNewSelection );
SfxItemSet aEditAttr(GetOutlinerView()->GetAttribs());
aEditAttr.Put(aNewItem);
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index 117a0d20b267..4cf79c584c1e 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -256,9 +256,9 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
Outliner * pOutliner = pOLV->GetOutliner();
if(pOutliner)
{
- sal_uLong nParaCount = pOutliner->GetParagraphCount();
+ sal_Int32 nParaCount = pOutliner->GetParagraphCount();
if (nParaCount > 0)
- pOLV->SelectRange(0L, sal_uInt16(nParaCount) );
+ pOLV->SelectRange(0L, nParaCount );
}
break;
}
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 281c5323531e..6d62d1fea580 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -446,9 +446,9 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq)
SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner();
if(pOutliner)
{
- sal_uLong nParaCount = pOutliner->GetParagraphCount();
+ sal_Int32 nParaCount = pOutliner->GetParagraphCount();
if (nParaCount > 0)
- pOLV->SelectRange(0L, sal_uInt16(nParaCount) );
+ pOLV->SelectRange(0L, nParaCount );
}
}
break;
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx
index 469aed3e78fa..c66a472d758b 100644
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
@@ -592,7 +592,7 @@ namespace SwLangHelper
void SelectPara( EditView &rEditView, const ESelection &rCurSel )
{
- ESelection aParaSel( rCurSel.nStartPara, 0, rCurSel.nStartPara, USHRT_MAX );
+ ESelection aParaSel( rCurSel.nStartPara, 0, rCurSel.nStartPara, EE_TEXTPOS_ALL );
rEditView.SetSelection( aParaSel );
}
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index ceca2337472a..eb44eb4c7ae8 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -3243,12 +3243,12 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
if(pOutliner)
{
EditEngine& rEditEng = (EditEngine&)pOutliner->GetEditEngine();
- sal_uLong nParCount = pOutliner->GetParagraphCount();
- for (sal_uLong nPar=0; nPar<nParCount; nPar++)
+ sal_Int32 nParCount = pOutliner->GetParagraphCount();
+ for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
{
//every paragraph
std::vector<sal_uInt16> aPortions;
- rEditEng.GetPortions( (sal_uInt16)nPar, aPortions );
+ rEditEng.GetPortions( nPar, aPortions );
for ( size_t nPos = aPortions.size(); nPos; )
{
@@ -3256,7 +3256,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
--nPos;
sal_uInt16 nEnd = aPortions[ nPos ];
sal_uInt16 nStart = nPos ? aPortions[ nPos - 1 ] : 0;
- ESelection aSelection( (sal_uInt16)nPar, nStart, (sal_uInt16)nPar, nEnd );
+ ESelection aSelection( nPar, nStart, nPar, nEnd );
SfxItemSet aAttr = rEditEng.GetAttribs( aSelection );
LanguageType nLang = LANGUAGE_DONTKNOW;