summaryrefslogtreecommitdiff
path: root/svtools/source/edit
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/edit')
-rw-r--r--svtools/source/edit/editsyntaxhighlighter.cxx26
-rw-r--r--svtools/source/edit/makefile.mk71
-rw-r--r--svtools/source/edit/svmedit.cxx278
-rw-r--r--svtools/source/edit/svmedit2.cxx14
-rw-r--r--svtools/source/edit/sychconv.cxx20
-rw-r--r--svtools/source/edit/syntaxhighlight.cxx213
-rw-r--r--svtools/source/edit/textdat2.hxx138
-rw-r--r--svtools/source/edit/textdata.cxx76
-rw-r--r--svtools/source/edit/textdoc.cxx163
-rw-r--r--svtools/source/edit/textdoc.hxx62
-rw-r--r--svtools/source/edit/texteng.cxx676
-rw-r--r--svtools/source/edit/textund2.hxx32
-rw-r--r--svtools/source/edit/textundo.cxx75
-rw-r--r--svtools/source/edit/textundo.hxx8
-rw-r--r--svtools/source/edit/textview.cxx442
-rw-r--r--svtools/source/edit/txtattr.cxx2
-rw-r--r--svtools/source/edit/xtextedt.cxx86
17 files changed, 1149 insertions, 1233 deletions
diff --git a/svtools/source/edit/editsyntaxhighlighter.cxx b/svtools/source/edit/editsyntaxhighlighter.cxx
index 14a737a99e60..bc81a96ea142 100644
--- a/svtools/source/edit/editsyntaxhighlighter.cxx
+++ b/svtools/source/edit/editsyntaxhighlighter.cxx
@@ -32,7 +32,7 @@
#include <svtools/svmedit.hxx>
#include <svtools/xtextedt.hxx>
#include <svtools/editsyntaxhighlighter.hxx>
-#include "../../inc/txtattr.hxx"
+#include <svtools/txtattr.hxx>
MultiLineEditSyntaxHighlight::MultiLineEditSyntaxHighlight( Window* pParent, WinBits nWinStyle,
@@ -69,12 +69,12 @@ void MultiLineEditSyntaxHighlight::SetText(const String& rNewText)
UpdateData();
}
-void MultiLineEditSyntaxHighlight::DoBracketHilight(USHORT aKey)
+void MultiLineEditSyntaxHighlight::DoBracketHilight(sal_uInt16 aKey)
{
TextSelection aCurrentPos = GetTextView()->GetSelection();
xub_StrLen aStartPos = aCurrentPos.GetStart().GetIndex();
- ULONG nStartPara = aCurrentPos.GetStart().GetPara();
- USHORT aCount = 0;
+ sal_uLong nStartPara = aCurrentPos.GetStart().GetPara();
+ sal_uInt16 aCount = 0;
int aChar = -1;
switch (aKey)
@@ -110,16 +110,16 @@ void MultiLineEditSyntaxHighlight::DoBracketHilight(USHORT aKey)
continue;
String aLine( GetTextEngine()->GetText( aPara ) );
- for (USHORT i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (USHORT)(aLine.Len()-1); i>0; --i)
+ for (sal_uInt16 i = ((unsigned long)aPara==nStartPara) ? aStartPos-1 : (sal_uInt16)(aLine.Len()-1); i>0; --i)
{
if (aLine.GetChar(i)==aChar)
{
if (!aCount)
{
- GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), aPara, i, i+1, TRUE );
- GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), aPara, i, i+1, TRUE );
- GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), nStartPara, aStartPos, aStartPos, TRUE );
- GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), nStartPara, aStartPos, aStartPos, TRUE );
+ GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), aPara, i, i+1, sal_True );
+ GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), aPara, i, i+1, sal_True );
+ GetTextEngine()->SetAttrib( TextAttribFontWeight( WEIGHT_ULTRABOLD ), nStartPara, aStartPos, aStartPos, sal_True );
+ GetTextEngine()->SetAttrib( TextAttribFontColor( Color(0,0,0) ), nStartPara, aStartPos, aStartPos, sal_True );
return;
}
else
@@ -185,19 +185,19 @@ void MultiLineEditSyntaxHighlight::UpdateData()
{
// syntax highlighting
// this must be possible improved by using notifychange correctly
- BOOL bTempModified = GetTextEngine()->IsModified();
+ sal_Bool bTempModified = GetTextEngine()->IsModified();
for (unsigned int nLine=0; nLine < GetTextEngine()->GetParagraphCount(); nLine++)
{
String aLine( GetTextEngine()->GetText( nLine ) );
aHighlighter.notifyChange( nLine, 0, &aLine, 1 );
- GetTextEngine()->RemoveAttribs( nLine, TRUE );
+ GetTextEngine()->RemoveAttribs( nLine, sal_True );
HighlightPortions aPortions;
aHighlighter.getHighlightPortions( nLine, aLine, aPortions );
- for ( USHORT i = 0; i < aPortions.Count(); i++ )
+ for ( size_t i = 0; i < aPortions.size(); i++ )
{
HighlightPortion& r = aPortions[i];
- GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, TRUE );
+ GetTextEngine()->SetAttrib( TextAttribFontColor( GetColorValue(r.tokenType) ), nLine, r.nBegin, r.nEnd, sal_True );
}
}
GetTextView()->ShowCursor( false, true );
diff --git a/svtools/source/edit/makefile.mk b/svtools/source/edit/makefile.mk
deleted file mode 100644
index 9aacde1bfc73..000000000000
--- a/svtools/source/edit/makefile.mk
+++ /dev/null
@@ -1,71 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME=svtools
-TARGET=edit
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/svt.pmk
-
-# --- Files --------------------------------------------------------
-
-SLOFILES= \
- $(SLO)$/svmedit.obj \
- $(SLO)$/svmedit2.obj \
- $(SLO)$/sychconv.obj \
- $(SLO)$/syntaxhighlight.obj \
- $(SLO)$/textdata.obj \
- $(SLO)$/textdoc.obj \
- $(SLO)$/texteng.obj \
- $(SLO)$/textundo.obj \
- $(SLO)$/textview.obj \
- $(SLO)$/textwindowpeer.obj \
- $(SLO)$/txtattr.obj \
- $(SLO)$/xtextedt.obj \
- $(SLO)$/editsyntaxhighlighter.obj
-
-EXCEPTIONSFILES= \
- $(SLO)$/editsyntaxhighlighter.obj \
- $(SLO)$/svmedit.obj \
- $(SLO)$/svmedit2.obj \
- $(SLO)$/sychconv.obj \
- $(SLO)$/syntaxhighlight.obj \
- $(SLO)$/textdata.obj \
- $(SLO)$/textdoc.obj \
- $(SLO)$/texteng.obj \
- $(SLO)$/textundo.obj \
- $(SLO)$/textview.obj \
- $(SLO)$/textwindowpeer.obj \
- $(SLO)$/xtextedt.obj
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
diff --git a/svtools/source/edit/svmedit.cxx b/svtools/source/edit/svmedit.cxx
index 6fcc61dd467b..2e45ae38172b 100644
--- a/svtools/source/edit/svmedit.cxx
+++ b/svtools/source/edit/svmedit.cxx
@@ -66,11 +66,11 @@ private:
ExtTextEngine* mpExtTextEngine;
ExtTextView* mpExtTextView;
- BOOL mbInMBDown;
- BOOL mbFocusSelectionHide;
- BOOL mbIgnoreTab;
- BOOL mbActivePopup;
- BOOL mbSelectOnTab;
+ sal_Bool mbInMBDown;
+ sal_Bool mbFocusSelectionHide;
+ sal_Bool mbIgnoreTab;
+ sal_Bool mbActivePopup;
+ sal_Bool mbSelectOnTab;
public:
TextWindow( Window* pParent );
@@ -92,17 +92,17 @@ public:
virtual void GetFocus();
virtual void LoseFocus();
- BOOL IsAutoFocusHide() const { return mbFocusSelectionHide; }
- void SetAutoFocusHide( BOOL bAutoHide ) { mbFocusSelectionHide = bAutoHide; }
+ sal_Bool IsAutoFocusHide() const { return mbFocusSelectionHide; }
+ void SetAutoFocusHide( sal_Bool bAutoHide ) { mbFocusSelectionHide = bAutoHide; }
- BOOL IsIgnoreTab() const { return mbIgnoreTab; }
- void SetIgnoreTab( BOOL bIgnore ) { mbIgnoreTab = bIgnore; }
+ sal_Bool IsIgnoreTab() const { return mbIgnoreTab; }
+ void SetIgnoreTab( sal_Bool bIgnore ) { mbIgnoreTab = bIgnore; }
void DisableSelectionOnFocus() {mbSelectOnTab = sal_False;}
virtual
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >
- GetComponentInterface(BOOL bCreate = TRUE);
+ GetComponentInterface(sal_Bool bCreate = sal_True);
};
@@ -132,17 +132,17 @@ public:
ImpSvMEdit( MultiLineEdit* pSvMultiLineEdit, WinBits nWinStyle );
~ImpSvMEdit();
- void SetModified( BOOL bMod );
- BOOL IsModified() const;
+ void SetModified( sal_Bool bMod );
+ sal_Bool IsModified() const;
- void SetReadOnly( BOOL bRdOnly );
- BOOL IsReadOnly() const;
+ void SetReadOnly( sal_Bool bRdOnly );
+ sal_Bool IsReadOnly() const;
void SetMaxTextLen( xub_StrLen nLen );
xub_StrLen GetMaxTextLen() const;
- void SetInsertMode( BOOL bInsert );
- BOOL IsInsertMode() const;
+ void SetInsertMode( sal_Bool bInsert );
+ sal_Bool IsInsertMode() const;
void InsertText( const String& rStr );
String GetSelected() const;
@@ -164,13 +164,13 @@ public:
void Resize();
void GetFocus();
- BOOL HandleCommand( const CommandEvent& rCEvt );
+ sal_Bool HandleCommand( const CommandEvent& rCEvt );
- void Enable( BOOL bEnable );
+ void Enable( sal_Bool bEnable );
Size CalcMinimumSize() const;
- Size CalcSize( USHORT nColumns, USHORT nLines ) const;
- void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
+ Size CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const;
+ void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const;
void SetAlign( WinBits nWinStyle );
@@ -198,27 +198,27 @@ ImpSvMEdit::ImpSvMEdit( MultiLineEdit* pEdt, WinBits nWinStyle )
void ImpSvMEdit::ImpUpdateSrollBarVis( WinBits nWinStyle )
{
- const BOOL bHaveVScroll = (NULL != mpVScrollBar);
- const BOOL bHaveHScroll = (NULL != mpHScrollBar);
- const BOOL bHaveScrollBox = (NULL != mpScrollBox);
+ const sal_Bool bHaveVScroll = (NULL != mpVScrollBar);
+ const sal_Bool bHaveHScroll = (NULL != mpHScrollBar);
+ const sal_Bool bHaveScrollBox = (NULL != mpScrollBox);
- BOOL bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL;
- const BOOL bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL;
+ sal_Bool bNeedVScroll = ( nWinStyle & WB_VSCROLL ) == WB_VSCROLL;
+ const sal_Bool bNeedHScroll = ( nWinStyle & WB_HSCROLL ) == WB_HSCROLL;
- const BOOL bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL;
+ const sal_Bool bAutoVScroll = ( nWinStyle & WB_AUTOVSCROLL ) == WB_AUTOVSCROLL;
if ( !bNeedVScroll && bAutoVScroll )
{
TextEngine& rEngine( *mpTextWindow->GetTextEngine() );
- ULONG nOverallTextHeight(0);
- for ( ULONG i=0; i<rEngine.GetParagraphCount(); ++i )
+ sal_uLong nOverallTextHeight(0);
+ for ( sal_uLong i=0; i<rEngine.GetParagraphCount(); ++i )
nOverallTextHeight += rEngine.GetTextHeight( i );
- if ( nOverallTextHeight > (ULONG)mpTextWindow->GetOutputSizePixel().Height() )
+ if ( nOverallTextHeight > (sal_uLong)mpTextWindow->GetOutputSizePixel().Height() )
bNeedVScroll = true;
}
- const BOOL bNeedScrollBox = bNeedVScroll && bNeedHScroll;
+ const sal_Bool bNeedScrollBox = bNeedVScroll && bNeedHScroll;
- BOOL bScrollbarsChanged = false;
+ sal_Bool bScrollbarsChanged = false;
if ( bHaveVScroll != bNeedVScroll )
{
delete mpVScrollBar;
@@ -269,22 +269,22 @@ void ImpSvMEdit::InitFromStyle( WinBits nWinStyle )
SetAlign( nWinStyle );
if ( nWinStyle & WB_NOHIDESELECTION )
- mpTextWindow->SetAutoFocusHide( FALSE );
+ mpTextWindow->SetAutoFocusHide( sal_False );
else
- mpTextWindow->SetAutoFocusHide( TRUE );
+ mpTextWindow->SetAutoFocusHide( sal_True );
if ( nWinStyle & WB_READONLY )
- mpTextWindow->GetTextView()->SetReadOnly( TRUE );
+ mpTextWindow->GetTextView()->SetReadOnly( sal_True );
else
- mpTextWindow->GetTextView()->SetReadOnly( FALSE );
+ mpTextWindow->GetTextView()->SetReadOnly( sal_False );
if ( nWinStyle & WB_IGNORETAB )
{
- mpTextWindow->SetIgnoreTab( TRUE );
+ mpTextWindow->SetIgnoreTab( sal_True );
}
else
{
- mpTextWindow->SetIgnoreTab( FALSE );
+ mpTextWindow->SetIgnoreTab( sal_False );
// #103667# MultiLineEdit has the flag, but focusable window also needs this flag
WinBits nStyle = mpTextWindow->GetStyle();
nStyle |= WINDOW_DLGCTRL_MOD1TAB;
@@ -305,14 +305,14 @@ void ImpSvMEdit::ImpSetScrollBarRanges()
{
if ( mpVScrollBar )
{
- ULONG nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
+ sal_uLong nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
mpVScrollBar->SetRange( Range( 0, (long)nTextHeight-1 ) );
}
if ( mpHScrollBar )
{
-// ULONG nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
+// sal_uLong nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
// Es gibt kein Notify bei Breiten-Aenderung...
-// ULONG nW = Max( (ULONG)mpTextWindow->GetOutputSizePixel().Width()*5, (ULONG)nTextWidth );
+// sal_uLong nW = Max( (sal_uLong)mpTextWindow->GetOutputSizePixel().Width()*5, (sal_uLong)nTextWidth );
// mpHScrollBar->SetRange( Range( 0, (long)nW ) );
mpHScrollBar->SetRange( Range( 0, (long)mnTextWidth-1 ) );
}
@@ -365,7 +365,7 @@ IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar )
nDiffX = mpTextWindow->GetTextView()->GetStartDocPos().X() - pCurScrollBar->GetThumbPos();
mpTextWindow->GetTextView()->Scroll( nDiffX, nDiffY );
- // mpTextWindow->GetTextView()->ShowCursor( FALSE, TRUE );
+ // mpTextWindow->GetTextView()->ShowCursor( sal_False, sal_True );
return 0;
}
@@ -379,7 +379,7 @@ IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar )
void ImpSvMEdit::SetAlign( WinBits nWinStyle )
{
- BOOL bRTL = Application::GetSettings().GetLayoutRTL();
+ sal_Bool bRTL = Application::GetSettings().GetLayoutRTL();
mpTextWindow->GetTextEngine()->SetRightToLeft( bRTL );
if ( nWinStyle & WB_CENTER )
@@ -396,28 +396,28 @@ void ImpSvMEdit::SetTextWindowOffset( const Point& rOffset )
Resize();
}
-void ImpSvMEdit::SetModified( BOOL bMod )
+void ImpSvMEdit::SetModified( sal_Bool bMod )
{
mpTextWindow->GetTextEngine()->SetModified( bMod );
}
-BOOL ImpSvMEdit::IsModified() const
+sal_Bool ImpSvMEdit::IsModified() const
{
return mpTextWindow->GetTextEngine()->IsModified();
}
-void ImpSvMEdit::SetInsertMode( BOOL bInsert )
+void ImpSvMEdit::SetInsertMode( sal_Bool bInsert )
{
mpTextWindow->GetTextView()->SetInsertMode( bInsert );
}
-void ImpSvMEdit::SetReadOnly( BOOL bRdOnly )
+void ImpSvMEdit::SetReadOnly( sal_Bool bRdOnly )
{
mpTextWindow->GetTextView()->SetReadOnly( bRdOnly );
// Farbe anpassen ???????????????????????????
}
-BOOL ImpSvMEdit::IsReadOnly() const
+sal_Bool ImpSvMEdit::IsReadOnly() const
{
return mpTextWindow->GetTextView()->IsReadOnly();
}
@@ -534,10 +534,10 @@ void ImpSvMEdit::Paste()
void ImpSvMEdit::SetText( const String& rStr )
{
- BOOL bWasModified = mpTextWindow->GetTextEngine()->IsModified();
+ sal_Bool bWasModified = mpTextWindow->GetTextEngine()->IsModified();
mpTextWindow->GetTextEngine()->SetText( rStr );
if ( !bWasModified )
- mpTextWindow->GetTextEngine()->SetModified( FALSE );
+ mpTextWindow->GetTextEngine()->SetModified( sal_False );
mpTextWindow->GetTextView()->SetSelection( TextSelection() );
@@ -594,7 +594,7 @@ void ImpSvMEdit::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( mpHScrollBar )
{
- ULONG nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
+ sal_uLong nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
if ( nWidth != mnTextWidth )
{
mnTextWidth = sal::static_int_cast< xub_StrLen >(nWidth);
@@ -626,9 +626,9 @@ void ImpSvMEdit::SetSelection( const Selection& rSelection )
long nEnd = Max( aNewSelection.Min(), aNewSelection.Max() );
TextSelection aTextSel;
- ULONG nPara = 0;
- USHORT nChar = 0;
- USHORT x = 0;
+ sal_uLong nPara = 0;
+ sal_uInt16 nChar = 0;
+ sal_uInt16 x = 0;
while ( x <= nEnd )
{
if ( x == aNewSelection.Min() )
@@ -657,7 +657,7 @@ const Selection& ImpSvMEdit::GetSelection() const
ExtTextEngine* pExtTextEngine = mpTextWindow->GetTextEngine();
// Absaetze davor:
- ULONG n;
+ sal_uLong n;
for ( n = 0; n < aTextSel.GetStart().GetPara(); n++ )
{
maSelection.Min() += pExtTextEngine->GetTextLen( n );
@@ -692,7 +692,7 @@ Size ImpSvMEdit::CalcMinimumSize() const
return aSz;
}
-Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
+Size ImpSvMEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
static const sal_Unicode sampleText[] = { 'X', '\0' };
@@ -719,16 +719,16 @@ Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
return aSz;
}
-void ImpSvMEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+void ImpSvMEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
static const sal_Unicode sampleText[] = { 'x', '\0' };
Size aOutSz = mpTextWindow->GetOutputSizePixel();
Size aCharSz( mpTextWindow->GetTextWidth( sampleText ), mpTextWindow->GetTextHeight() );
- rnCols = (USHORT) (aOutSz.Width()/aCharSz.Width());
- rnLines = (USHORT) (aOutSz.Height()/aCharSz.Height());
+ rnCols = (sal_uInt16) (aOutSz.Width()/aCharSz.Width());
+ rnLines = (sal_uInt16) (aOutSz.Height()/aCharSz.Height());
}
-void ImpSvMEdit::Enable( BOOL bEnable )
+void ImpSvMEdit::Enable( sal_Bool bEnable )
{
mpTextWindow->Enable( bEnable );
if ( mpHScrollBar )
@@ -737,15 +737,15 @@ void ImpSvMEdit::Enable( BOOL bEnable )
mpVScrollBar->Enable( bEnable );
}
-BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt )
+sal_Bool ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( ( rCEvt.GetCommand() == COMMAND_WHEEL ) ||
( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) ||
( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) )
{
mpTextWindow->HandleScrollCommand( rCEvt, mpHScrollBar, mpVScrollBar );
- bDone = TRUE;
+ bDone = sal_True;
}
return bDone;
}
@@ -753,12 +753,12 @@ BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt )
TextWindow::TextWindow( Window* pParent ) : Window( pParent )
{
- mbInMBDown = FALSE;
- mbSelectOnTab = TRUE;
- mbFocusSelectionHide = FALSE;
- mbIgnoreTab = FALSE;
- mbActivePopup = FALSE;
- mbSelectOnTab = TRUE;
+ mbInMBDown = sal_False;
+ mbSelectOnTab = sal_True;
+ mbFocusSelectionHide = sal_False;
+ mbIgnoreTab = sal_False;
+ mbActivePopup = sal_False;
+ mbSelectOnTab = sal_True;
SetPointer( Pointer( POINTER_TEXT ) );
@@ -769,7 +769,7 @@ TextWindow::TextWindow( Window* pParent ) : Window( pParent )
mpExtTextEngine->SetLocale( GetSettings().GetLocale() );
mpExtTextView = new ExtTextView( mpExtTextEngine, this );
mpExtTextEngine->InsertView( mpExtTextView );
- mpExtTextEngine->EnableUndo( TRUE );
+ mpExtTextEngine->EnableUndo( sal_True );
mpExtTextView->ShowCursor();
Color aBackgroundColor = GetSettings().GetStyleSettings().GetWorkspaceColor();
@@ -791,11 +791,11 @@ void TextWindow::MouseMove( const MouseEvent& rMEvt )
void TextWindow::MouseButtonDown( const MouseEvent& rMEvt )
{
- mbInMBDown = TRUE; // Dann im GetFocus nicht alles selektieren wird
+ mbInMBDown = sal_True; // Dann im GetFocus nicht alles selektieren wird
mpExtTextView->MouseButtonDown( rMEvt );
Window::MouseButtonDown( rMEvt );
GrabFocus();
- mbInMBDown = FALSE;
+ mbInMBDown = sal_False;
}
void TextWindow::MouseButtonUp( const MouseEvent& rMEvt )
@@ -806,29 +806,29 @@ void TextWindow::MouseButtonUp( const MouseEvent& rMEvt )
void TextWindow::KeyInput( const KeyEvent& rKEvent )
{
- BOOL bDone = FALSE;
- USHORT nCode = rKEvent.GetKeyCode().GetCode();
+ sal_Bool bDone = sal_False;
+ sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode();
if ( nCode == com::sun::star::awt::Key::SELECT_ALL ||
( (nCode == KEY_A) && rKEvent.GetKeyCode().IsMod1() && !rKEvent.GetKeyCode().IsMod2() )
)
{
mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) );
- bDone = TRUE;
+ bDone = sal_True;
}
else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() )
{
if ( Edit::GetGetSpecialCharsFunction() )
{
// Damit die Selektion erhalten bleibt
- mbActivePopup = TRUE;
+ mbActivePopup = sal_True;
XubString aChars = Edit::GetGetSpecialCharsFunction()( this, GetFont() );
if ( aChars.Len() )
{
mpExtTextView->InsertText( aChars );
- mpExtTextView->GetTextEngine()->SetModified( TRUE );
+ mpExtTextView->GetTextEngine()->SetModified( sal_True );
}
- mbActivePopup = FALSE;
- bDone = TRUE;
+ mbActivePopup = sal_False;
+ bDone = sal_True;
}
}
else if ( nCode == KEY_TAB )
@@ -864,33 +864,33 @@ void TextWindow::Command( const CommandEvent& rCEvt )
pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES );
if ( !mpExtTextView->HasSelection() )
{
- pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_COPY, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_COPY, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
}
if ( mpExtTextView->IsReadOnly() )
{
- pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_PASTE, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
- pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_PASTE, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, sal_False );
+ pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, sal_False );
}
if ( !mpExtTextView->GetTextEngine()->HasUndoManager() || !mpExtTextView->GetTextEngine()->GetUndoManager().GetUndoActionCount() )
{
- pPopup->EnableItem( SV_MENU_EDIT_UNDO, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_UNDO, sal_False );
}
// if ( ( maSelection.Min() == 0 ) && ( maSelection.Max() == maText.Len() ) )
// {
-// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, FALSE );
+// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, sal_False );
// }
if ( !Edit::GetGetSpecialCharsFunction() )
{
- USHORT nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
+ sal_uInt16 nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
pPopup->RemoveItem( nPos );
pPopup->RemoveItem( nPos-1 );
}
- mbActivePopup = TRUE;
+ mbActivePopup = sal_True;
Point aPos = rCEvt.GetMousePosPixel();
if ( !rCEvt.IsMouseEvent() )
{
@@ -899,26 +899,26 @@ void TextWindow::Command( const CommandEvent& rCEvt )
aPos = Point( aSize.Width()/2, aSize.Height()/2 );
}
// pPopup->RemoveDisabledEntries();
- USHORT n = pPopup->Execute( this, aPos );
+ sal_uInt16 n = pPopup->Execute( this, aPos );
Edit::DeletePopupMenu( pPopup );
switch ( n )
{
case SV_MENU_EDIT_UNDO: mpExtTextView->Undo();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_CUT: mpExtTextView->Cut();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_COPY: mpExtTextView->Copy();
break;
case SV_MENU_EDIT_PASTE: mpExtTextView->Paste();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_DELETE: mpExtTextView->DeleteSelected();
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
break;
case SV_MENU_EDIT_SELECTALL: mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) );
@@ -929,13 +929,13 @@ void TextWindow::Command( const CommandEvent& rCEvt )
if ( aChars.Len() )
{
mpExtTextView->InsertText( aChars );
- mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->SetModified( sal_True );
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
}
}
break;
}
- mbActivePopup = FALSE;
+ mbActivePopup = sal_False;
}
else
{
@@ -949,19 +949,19 @@ void TextWindow::GetFocus()
Window::GetFocus();
if ( !mbActivePopup )
{
- BOOL bGotoCursor = !mpExtTextView->IsReadOnly();
+ sal_Bool bGotoCursor = !mpExtTextView->IsReadOnly();
if ( mbFocusSelectionHide && IsReallyVisible() && !mpExtTextView->IsReadOnly()
&& ( mbSelectOnTab &&
(!mbInMBDown || ( GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_FOCUS ) )) )
{
// Alles selektieren, aber nicht scrollen
- BOOL bAutoScroll = mpExtTextView->IsAutoScroll();
- mpExtTextView->SetAutoScroll( FALSE );
+ sal_Bool bAutoScroll = mpExtTextView->IsAutoScroll();
+ mpExtTextView->SetAutoScroll( sal_False );
mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) );
mpExtTextView->SetAutoScroll( bAutoScroll );
- bGotoCursor = FALSE;
+ bGotoCursor = sal_False;
}
- mpExtTextView->SetPaintSelection( TRUE );
+ mpExtTextView->SetPaintSelection( sal_True );
mpExtTextView->ShowCursor( bGotoCursor );
}
}
@@ -971,12 +971,12 @@ void TextWindow::LoseFocus()
Window::LoseFocus();
if ( mbFocusSelectionHide && !mbActivePopup )
- mpExtTextView->SetPaintSelection( FALSE );
+ mpExtTextView->SetPaintSelection( sal_False );
}
// virtual
::css::uno::Reference< ::css::awt::XWindowPeer >
-TextWindow::GetComponentInterface(BOOL bCreate)
+TextWindow::GetComponentInterface(sal_Bool bCreate)
{
::css::uno::Reference< ::css::awt::XWindowPeer > xPeer(
Window::GetComponentInterface(false));
@@ -993,10 +993,10 @@ MultiLineEdit::MultiLineEdit( Window* pParent, WinBits nWinStyle )
{
SetType( WINDOW_MULTILINEEDIT );
pImpSvMEdit = new ImpSvMEdit( this, nWinStyle );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
pUpdateDataTimer = 0;
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
SetStyle( ImplInitStyle( nWinStyle ) );
}
@@ -1006,10 +1006,10 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId )
SetType( WINDOW_MULTILINEEDIT );
WinBits nWinStyle = rResId.GetWinBits();
pImpSvMEdit = new ImpSvMEdit( this, nWinStyle );
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
pUpdateDataTimer = 0;
- USHORT nMaxLen = Edit::GetMaxTextLen();
+ sal_uInt16 nMaxLen = Edit::GetMaxTextLen();
if ( nMaxLen )
SetMaxTextLen( nMaxLen );
@@ -1018,7 +1018,7 @@ MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId )
if ( IsVisible() )
pImpSvMEdit->Resize();
- SetCompoundControl( TRUE );
+ SetCompoundControl( sal_True );
SetStyle( ImplInitStyle( nWinStyle ) );
// Base Edit ctor could call Show already, but that would cause problems
@@ -1053,7 +1053,7 @@ WinBits MultiLineEdit::ImplInitStyle( WinBits nStyle )
}
-void MultiLineEdit::ImplInitSettings( BOOL /*bFont*/, BOOL /*bForeground*/, BOOL bBackground )
+void MultiLineEdit::ImplInitSettings( sal_Bool /*bFont*/, sal_Bool /*bForeground*/, sal_Bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -1085,7 +1085,7 @@ void MultiLineEdit::ImplInitSettings( BOOL /*bFont*/, BOOL /*bForeground*/, BOOL
{
if( IsPaintTransparent() )
{
- pImpSvMEdit->GetTextWindow()->SetPaintTransparent( TRUE );
+ pImpSvMEdit->GetTextWindow()->SetPaintTransparent( sal_True );
pImpSvMEdit->GetTextWindow()->SetBackground();
pImpSvMEdit->GetTextWindow()->SetControlBackground();
SetBackground();
@@ -1127,20 +1127,20 @@ void MultiLineEdit::UpdateData()
void MultiLineEdit::SetModifyFlag()
{
- pImpSvMEdit->SetModified( TRUE );
+ pImpSvMEdit->SetModified( sal_True );
}
void MultiLineEdit::ClearModifyFlag()
{
- pImpSvMEdit->SetModified( FALSE );
+ pImpSvMEdit->SetModified( sal_False );
}
-BOOL MultiLineEdit::IsModified() const
+sal_Bool MultiLineEdit::IsModified() const
{
return pImpSvMEdit->IsModified();
}
-void MultiLineEdit::EnableUpdateData( ULONG nTimeout )
+void MultiLineEdit::EnableUpdateData( sal_uLong nTimeout )
{
if ( !nTimeout )
DisableUpdateData();
@@ -1155,7 +1155,7 @@ void MultiLineEdit::EnableUpdateData( ULONG nTimeout )
}
}
-void MultiLineEdit::SetReadOnly( BOOL bReadOnly )
+void MultiLineEdit::SetReadOnly( sal_Bool bReadOnly )
{
pImpSvMEdit->SetReadOnly( bReadOnly );
Edit::SetReadOnly( bReadOnly );
@@ -1169,7 +1169,7 @@ void MultiLineEdit::SetReadOnly( BOOL bReadOnly )
SetStyle( nStyle );
}
-BOOL MultiLineEdit::IsReadOnly() const
+sal_Bool MultiLineEdit::IsReadOnly() const
{
return pImpSvMEdit->IsReadOnly();
}
@@ -1300,7 +1300,7 @@ Size MultiLineEdit::CalcAdjustedSize( const Size& rPrefSize ) const
return aSz;
}
-Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
+Size MultiLineEdit::CalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const
{
Size aSz = pImpSvMEdit->CalcSize( nColumns, nLines );
@@ -1311,7 +1311,7 @@ Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
return aSz;
}
-void MultiLineEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+void MultiLineEdit::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const
{
pImpSvMEdit->GetMaxVisColumnsAndLines( rnCols, rnLines );
}
@@ -1321,7 +1321,7 @@ void MultiLineEdit::StateChanged( StateChangedType nType )
if( nType == STATE_CHANGE_ENABLE )
{
pImpSvMEdit->Enable( IsEnabled() );
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
}
else if( nType == STATE_CHANGE_READONLY )
{
@@ -1330,23 +1330,23 @@ void MultiLineEdit::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_ZOOM )
{
pImpSvMEdit->GetTextWindow()->SetZoom( GetZoom() );
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Resize();
}
else if ( nType == STATE_CHANGE_CONTROLFONT )
{
- ImplInitSettings( TRUE, FALSE, FALSE );
+ ImplInitSettings( sal_True, sal_False, sal_False );
Resize();
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( FALSE, TRUE, FALSE );
+ ImplInitSettings( sal_False, sal_True, sal_False );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( FALSE, FALSE, TRUE );
+ ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
else if ( nType == STATE_CHANGE_STYLE )
@@ -1358,7 +1358,7 @@ void MultiLineEdit::StateChanged( StateChangedType nType )
{
if( IsPaintTransparent() )
{
- pImpSvMEdit->GetTextWindow()->SetPaintTransparent( TRUE );
+ pImpSvMEdit->GetTextWindow()->SetPaintTransparent( sal_True );
pImpSvMEdit->GetTextWindow()->SetBackground();
pImpSvMEdit->GetTextWindow()->SetControlBackground();
SetBackground();
@@ -1374,7 +1374,7 @@ void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE) )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Resize();
Invalidate();
}
@@ -1382,14 +1382,14 @@ void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt )
Control::DataChanged( rDCEvt );
}
-void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- ImplInitSettings( TRUE, TRUE, TRUE );
+ ImplInitSettings( sal_True, sal_True, sal_True );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
Font aFont = pImpSvMEdit->GetTextWindow()->GetDrawPixelFont( pDev );
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
OutDevType eOutDevType = pDev->GetOutDevType();
pDev->Push();
@@ -1400,8 +1400,8 @@ void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSi
// Border/Background
pDev->SetLineColor();
pDev->SetFillColor();
- BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
- BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ sal_Bool bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ sal_Bool bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
if ( bBorder || bBackground )
{
Rectangle aRect( aPos, aSize );
@@ -1435,7 +1435,7 @@ void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSi
XubString aText = GetText();
Size aTextSz( pDev->GetTextWidth( aText ), pDev->GetTextHeight() );
- ULONG nLines = (ULONG) (aSize.Height() / aTextSz.Height());
+ sal_uLong nLines = (sal_uLong) (aSize.Height() / aTextSz.Height());
if ( !nLines )
nLines = 1;
aTextSz.Height() = nLines*aTextSz.Height();
@@ -1589,24 +1589,24 @@ ScrollBar* MultiLineEdit::GetVScrollBar() const
return pImpSvMEdit->GetVScrollBar();
}
-void MultiLineEdit::EnableFocusSelectionHide( BOOL bHide )
+void MultiLineEdit::EnableFocusSelectionHide( sal_Bool bHide )
{
pImpSvMEdit->GetTextWindow()->SetAutoFocusHide( bHide );
}
-BOOL MultiLineEdit::IsFocusSelectionHideEnabled() const
+sal_Bool MultiLineEdit::IsFocusSelectionHideEnabled() const
{
return pImpSvMEdit->GetTextWindow()->IsAutoFocusHide();
}
-void MultiLineEdit::SetLeftMargin( USHORT n )
+void MultiLineEdit::SetLeftMargin( sal_uInt16 n )
{
if ( GetTextEngine() )
GetTextEngine()->SetLeftMargin( n );
}
-USHORT MultiLineEdit::GetLeftMargin() const
+sal_uInt16 MultiLineEdit::GetLeftMargin() const
{
if ( GetTextEngine() )
return GetTextEngine()->GetLeftMargin();
@@ -1614,7 +1614,7 @@ USHORT MultiLineEdit::GetLeftMargin() const
return 0;
}
-void MultiLineEdit::SetRightToLeft( BOOL bRightToLeft )
+void MultiLineEdit::SetRightToLeft( sal_Bool bRightToLeft )
{
if ( GetTextEngine() )
{
@@ -1623,9 +1623,9 @@ void MultiLineEdit::SetRightToLeft( BOOL bRightToLeft )
}
}
-BOOL MultiLineEdit::IsRightToLeft() const
+sal_Bool MultiLineEdit::IsRightToLeft() const
{
- BOOL bRightToLeft = FALSE;
+ sal_Bool bRightToLeft = sal_False;
if ( GetTextEngine() )
bRightToLeft = GetTextEngine()->IsRightToLeft();
@@ -1635,7 +1635,7 @@ BOOL MultiLineEdit::IsRightToLeft() const
// virtual
::css::uno::Reference< ::css::awt::XWindowPeer >
-MultiLineEdit::GetComponentInterface(BOOL bCreate)
+MultiLineEdit::GetComponentInterface(sal_Bool bCreate)
{
::css::uno::Reference< ::css::awt::XWindowPeer > xPeer(
Edit::GetComponentInterface(false));
diff --git a/svtools/source/edit/svmedit2.cxx b/svtools/source/edit/svmedit2.cxx
index 1241eef2089e..bb496e47a7ef 100644
--- a/svtools/source/edit/svmedit2.cxx
+++ b/svtools/source/edit/svmedit2.cxx
@@ -50,32 +50,32 @@ ExtMultiLineEdit::~ExtMultiLineEdit()
{
}
-void ExtMultiLineEdit::InsertText( const String& rNew, BOOL )
+void ExtMultiLineEdit::InsertText( const String& rNew, sal_Bool )
{
- GetTextView()->InsertText( rNew, FALSE );
+ GetTextView()->InsertText( rNew, sal_False );
}
-void ExtMultiLineEdit::SetAutoScroll( BOOL bAutoScroll )
+void ExtMultiLineEdit::SetAutoScroll( sal_Bool bAutoScroll )
{
GetTextView()->SetAutoScroll( bAutoScroll );
}
-void ExtMultiLineEdit::EnableCursor( BOOL bEnable )
+void ExtMultiLineEdit::EnableCursor( sal_Bool bEnable )
{
GetTextView()->EnableCursor( bEnable );
}
-void ExtMultiLineEdit::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd )
+void ExtMultiLineEdit::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd )
{
GetTextEngine()->SetAttrib( rAttr, nPara, nStart, nEnd );
}
-void ExtMultiLineEdit::SetLeftMargin( USHORT nLeftMargin )
+void ExtMultiLineEdit::SetLeftMargin( sal_uInt16 nLeftMargin )
{
GetTextEngine()->SetLeftMargin( nLeftMargin );
}
-ULONG ExtMultiLineEdit::GetParagraphCount() const
+sal_uLong ExtMultiLineEdit::GetParagraphCount() const
{
return GetTextEngine()->GetParagraphCount();
}
diff --git a/svtools/source/edit/sychconv.cxx b/svtools/source/edit/sychconv.cxx
index e8d0d75cd6e0..c20ebd962acd 100644
--- a/svtools/source/edit/sychconv.cxx
+++ b/svtools/source/edit/sychconv.cxx
@@ -28,17 +28,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include "sychconv.hxx"
+#include <svtools/sychconv.hxx>
#include <vcl/outdev.hxx>
-BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev )
+sal_Bool SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev )
{
// hibyte 0 = exact matching
// 1 = little differences,
// 2 = the converted character does not look like the original but got the same meaning
// 3 = the destination does not match looking and meaning of the original
- static USHORT const aWingdingsToStarBatsTable[ 256 - 32 ] =
+ static sal_uInt16 const aWingdingsToStarBatsTable[ 256 - 32 ] =
{
0x0020, 0x0238, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0174, 0x02BA, 0x017B, 0x017C, 0x037C, 0x037C, 0x037C, 0x037C,
0x0000, 0x0000, 0x0372, 0x0272, 0x0372, 0x0000, 0x0000, 0x0374, 0x0279, 0x0000, 0x027A, 0x0000, 0x0178, 0x0278, 0x0000, 0x0137,
@@ -56,7 +56,7 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p
0x01AF, 0x01B2, 0x01B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0150, 0x0032, 0x0033, 0x0034, 0x01C8
};
- static USHORT const aMonotypeSortsToStarBatsTable[ 256 - 32 ]=
+ static sal_uInt16 const aMonotypeSortsToStarBatsTable[ 256 - 32 ]=
{
0x0020, 0x00cb, 0x00cb, 0x00cb, 0x00cb, 0x0074, 0x00ba, 0x0021, 0x00cc, 0x007b, 0x0036, 0x007d, 0x007e, 0x0037, 0x0038, 0x0038,
0x0039, 0x0038, 0x0038, 0x0039, 0x003a, 0x004f, 0x0050, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0086, 0x0086, 0x0086,
@@ -74,9 +74,9 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p
0x0000, 0x00af, 0x0035, 0x00dc, 0x00da, 0x00dc, 0x00db, 0x00da, 0x00dc, 0x00db, 0x00dc, 0x00dc, 0x00dc, 0x00dc, 0x00af, 0x0000
};
- const USHORT* pTransTable = NULL;
+ const sal_uInt16* pTransTable = NULL;
- BOOL bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : FALSE;
+ sal_Bool bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : sal_False;
if ( !bIsAvailable )
{
if ( rFont.GetName().CompareToAscii( RTL_CONSTASCII_STRINGPARAM( "Wingdings" ) ) == COMPARE_EQUAL )
@@ -87,20 +87,20 @@ BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* p
if ( pTransTable )
{
sal_Unicode c;
- for ( UINT16 i = rString.Len(); i--; )
+ for ( sal_uInt16 i = rString.Len(); i--; )
{
c = rString.GetChar( i );
c -= 32;
- c = ( ((UINT16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ];
+ c = ( ((sal_uInt16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ];
if ( !c ) // if character is out of range or not matching
c = 0xA5; // we will default a StarBats-Bullet
rString.SetChar( i, c );
}
rFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
rFont.SetName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "StarBats" ) ) );
- return TRUE;
+ return sal_True;
}
- else return FALSE;
+ else return sal_False;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/edit/syntaxhighlight.cxx b/svtools/source/edit/syntaxhighlight.cxx
index f326eb0ec8a5..f859e9930cf9 100644
--- a/svtools/source/edit/syntaxhighlight.cxx
+++ b/svtools/source/edit/syntaxhighlight.cxx
@@ -35,9 +35,6 @@
#include <tools/debug.hxx>
-SV_IMPL_VARARR(HighlightPortions, HighlightPortion)
-
-
// ##########################################################################
// ATTENTION: all these words needs to be in small caps
// ##########################################################################
@@ -260,22 +257,22 @@ class BasicSimpleCharClass
static LetterTable aLetterTable;
public:
- static BOOL isAlpha( sal_Unicode c, bool bCompatible )
+ static sal_Bool isAlpha( sal_Unicode c, bool bCompatible )
{
- BOOL bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
+ sal_Bool bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
|| (bCompatible && aLetterTable.isLetter( c ));
return bRet;
}
- static BOOL isDigit( sal_Unicode c )
+ static sal_Bool isDigit( sal_Unicode c )
{
- BOOL bRet = (c >= '0' && c <= '9');
+ sal_Bool bRet = (c >= '0' && c <= '9');
return bRet;
}
- static BOOL isAlphaNumeric( sal_Unicode c, bool bCompatible )
+ static sal_Bool isAlphaNumeric( sal_Unicode c, bool bCompatible )
{
- BOOL bRet = isDigit( c ) || isAlpha( c, bCompatible );
+ sal_Bool bRet = isDigit( c ) || isAlpha( c, bCompatible );
return bRet;
}
};
@@ -287,68 +284,68 @@ LetterTable::LetterTable( void )
for( int i = 0 ; i < 256 ; ++i )
IsLetterTab[i] = false;
- IsLetterTab[0xC0] = true; // À , CAPITAL LETTER A WITH GRAVE ACCENT
- IsLetterTab[0xC1] = true; // Á , CAPITAL LETTER A WITH ACUTE ACCENT
- IsLetterTab[0xC2] = true; // Â , CAPITAL LETTER A WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xC3] = true; // Ã , CAPITAL LETTER A WITH TILDE
- IsLetterTab[0xC4] = true; // Ä , CAPITAL LETTER A WITH DIAERESIS
- IsLetterTab[0xC5] = true; // Å , CAPITAL LETTER A WITH RING ABOVE
- IsLetterTab[0xC6] = true; // Æ , CAPITAL LIGATURE AE
- IsLetterTab[0xC7] = true; // Ç , CAPITAL LETTER C WITH CEDILLA
- IsLetterTab[0xC8] = true; // È , CAPITAL LETTER E WITH GRAVE ACCENT
- IsLetterTab[0xC9] = true; // É , CAPITAL LETTER E WITH ACUTE ACCENT
- IsLetterTab[0xCA] = true; // Ê , CAPITAL LETTER E WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xCB] = true; // Ë , CAPITAL LETTER E WITH DIAERESIS
- IsLetterTab[0xCC] = true; // Ì , CAPITAL LETTER I WITH GRAVE ACCENT
- IsLetterTab[0xCD] = true; // Í , CAPITAL LETTER I WITH ACUTE ACCENT
- IsLetterTab[0xCE] = true; // Î , CAPITAL LETTER I WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xCF] = true; // Ï , CAPITAL LETTER I WITH DIAERESIS
- IsLetterTab[0xD0] = true; // Ð , CAPITAL LETTER ETH
- IsLetterTab[0xD1] = true; // Ñ , CAPITAL LETTER N WITH TILDE
- IsLetterTab[0xD2] = true; // Ò , CAPITAL LETTER O WITH GRAVE ACCENT
- IsLetterTab[0xD3] = true; // Ó , CAPITAL LETTER O WITH ACUTE ACCENT
- IsLetterTab[0xD4] = true; // Ô , CAPITAL LETTER O WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xD5] = true; // Õ , CAPITAL LETTER O WITH TILDE
- IsLetterTab[0xD6] = true; // Ö , CAPITAL LETTER O WITH DIAERESIS
- IsLetterTab[0xD8] = true; // Ø , CAPITAL LETTER O WITH STROKE
- IsLetterTab[0xD9] = true; // Ù , CAPITAL LETTER U WITH GRAVE ACCENT
- IsLetterTab[0xDA] = true; // Ú , CAPITAL LETTER U WITH ACUTE ACCENT
- IsLetterTab[0xDB] = true; // Û , CAPITAL LETTER U WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xDC] = true; // Ü , CAPITAL LETTER U WITH DIAERESIS
- IsLetterTab[0xDD] = true; // Ý , CAPITAL LETTER Y WITH ACUTE ACCENT
- IsLetterTab[0xDE] = true; // Þ , CAPITAL LETTER THORN
- IsLetterTab[0xDF] = true; // ß , SMALL LETTER SHARP S
- IsLetterTab[0xE0] = true; // à , SMALL LETTER A WITH GRAVE ACCENT
- IsLetterTab[0xE1] = true; // á , SMALL LETTER A WITH ACUTE ACCENT
- IsLetterTab[0xE2] = true; // â , SMALL LETTER A WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xE3] = true; // ã , SMALL LETTER A WITH TILDE
- IsLetterTab[0xE4] = true; // ä , SMALL LETTER A WITH DIAERESIS
- IsLetterTab[0xE5] = true; // å , SMALL LETTER A WITH RING ABOVE
- IsLetterTab[0xE6] = true; // æ , SMALL LIGATURE AE
- IsLetterTab[0xE7] = true; // ç , SMALL LETTER C WITH CEDILLA
- IsLetterTab[0xE8] = true; // è , SMALL LETTER E WITH GRAVE ACCENT
- IsLetterTab[0xE9] = true; // é , SMALL LETTER E WITH ACUTE ACCENT
- IsLetterTab[0xEA] = true; // ê , SMALL LETTER E WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xEB] = true; // ë , SMALL LETTER E WITH DIAERESIS
- IsLetterTab[0xEC] = true; // ì , SMALL LETTER I WITH GRAVE ACCENT
- IsLetterTab[0xED] = true; // í , SMALL LETTER I WITH ACUTE ACCENT
- IsLetterTab[0xEE] = true; // î , SMALL LETTER I WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xEF] = true; // ï , SMALL LETTER I WITH DIAERESIS
- IsLetterTab[0xF0] = true; // ð , SMALL LETTER ETH
- IsLetterTab[0xF1] = true; // ñ , SMALL LETTER N WITH TILDE
- IsLetterTab[0xF2] = true; // ò , SMALL LETTER O WITH GRAVE ACCENT
- IsLetterTab[0xF3] = true; // ó , SMALL LETTER O WITH ACUTE ACCENT
- IsLetterTab[0xF4] = true; // ô , SMALL LETTER O WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xF5] = true; // õ , SMALL LETTER O WITH TILDE
- IsLetterTab[0xF6] = true; // ö , SMALL LETTER O WITH DIAERESIS
- IsLetterTab[0xF8] = true; // ø , SMALL LETTER O WITH OBLIQUE BAR
- IsLetterTab[0xF9] = true; // ù , SMALL LETTER U WITH GRAVE ACCENT
- IsLetterTab[0xFA] = true; // ú , SMALL LETTER U WITH ACUTE ACCENT
- IsLetterTab[0xFB] = true; // û , SMALL LETTER U WITH CIRCUMFLEX ACCENT
- IsLetterTab[0xFC] = true; // ü , SMALL LETTER U WITH DIAERESIS
- IsLetterTab[0xFD] = true; // ý , SMALL LETTER Y WITH ACUTE ACCENT
- IsLetterTab[0xFE] = true; // þ , SMALL LETTER THORN
- IsLetterTab[0xFF] = true; // ÿ , SMALL LETTER Y WITH DIAERESIS
+ IsLetterTab[0xC0] = true; // ?, CAPITAL LETTER A WITH GRAVE ACCENT
+ IsLetterTab[0xC1] = true; // ?, CAPITAL LETTER A WITH ACUTE ACCENT
+ IsLetterTab[0xC2] = true; // ?, CAPITAL LETTER A WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xC3] = true; // ?, CAPITAL LETTER A WITH TILDE
+ IsLetterTab[0xC4] = true; // ?, CAPITAL LETTER A WITH DIAERESIS
+ IsLetterTab[0xC5] = true; // ?, CAPITAL LETTER A WITH RING ABOVE
+ IsLetterTab[0xC6] = true; // ?, CAPITAL LIGATURE AE
+ IsLetterTab[0xC7] = true; // ?, CAPITAL LETTER C WITH CEDILLA
+ IsLetterTab[0xC8] = true; // ?, CAPITAL LETTER E WITH GRAVE ACCENT
+ IsLetterTab[0xC9] = true; // ?, CAPITAL LETTER E WITH ACUTE ACCENT
+ IsLetterTab[0xCA] = true; // ?, CAPITAL LETTER E WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xCB] = true; // ?, CAPITAL LETTER E WITH DIAERESIS
+ IsLetterTab[0xCC] = true; // ?, CAPITAL LETTER I WITH GRAVE ACCENT
+ IsLetterTab[0xCD] = true; // ?, CAPITAL LETTER I WITH ACUTE ACCENT
+ IsLetterTab[0xCE] = true; // ?, CAPITAL LETTER I WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xCF] = true; // ?, CAPITAL LETTER I WITH DIAERESIS
+ IsLetterTab[0xD0] = true; // ?, CAPITAL LETTER ETH
+ IsLetterTab[0xD1] = true; // ?, CAPITAL LETTER N WITH TILDE
+ IsLetterTab[0xD2] = true; // ?, CAPITAL LETTER O WITH GRAVE ACCENT
+ IsLetterTab[0xD3] = true; // ?, CAPITAL LETTER O WITH ACUTE ACCENT
+ IsLetterTab[0xD4] = true; // ?, CAPITAL LETTER O WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xD5] = true; // ?, CAPITAL LETTER O WITH TILDE
+ IsLetterTab[0xD6] = true; // ?, CAPITAL LETTER O WITH DIAERESIS
+ IsLetterTab[0xD8] = true; // ?, CAPITAL LETTER O WITH STROKE
+ IsLetterTab[0xD9] = true; // ?, CAPITAL LETTER U WITH GRAVE ACCENT
+ IsLetterTab[0xDA] = true; // ?, CAPITAL LETTER U WITH ACUTE ACCENT
+ IsLetterTab[0xDB] = true; // ?, CAPITAL LETTER U WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xDC] = true; // ?, CAPITAL LETTER U WITH DIAERESIS
+ IsLetterTab[0xDD] = true; // ?, CAPITAL LETTER Y WITH ACUTE ACCENT
+ IsLetterTab[0xDE] = true; // ?, CAPITAL LETTER THORN
+ IsLetterTab[0xDF] = true; // ?, SMALL LETTER SHARP S
+ IsLetterTab[0xE0] = true; // ?, SMALL LETTER A WITH GRAVE ACCENT
+ IsLetterTab[0xE1] = true; // ?, SMALL LETTER A WITH ACUTE ACCENT
+ IsLetterTab[0xE2] = true; // ?, SMALL LETTER A WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xE3] = true; // ?, SMALL LETTER A WITH TILDE
+ IsLetterTab[0xE4] = true; // ?, SMALL LETTER A WITH DIAERESIS
+ IsLetterTab[0xE5] = true; // ?, SMALL LETTER A WITH RING ABOVE
+ IsLetterTab[0xE6] = true; // ?, SMALL LIGATURE AE
+ IsLetterTab[0xE7] = true; // ?, SMALL LETTER C WITH CEDILLA
+ IsLetterTab[0xE8] = true; // ?, SMALL LETTER E WITH GRAVE ACCENT
+ IsLetterTab[0xE9] = true; // ?, SMALL LETTER E WITH ACUTE ACCENT
+ IsLetterTab[0xEA] = true; // ?, SMALL LETTER E WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xEB] = true; // ?, SMALL LETTER E WITH DIAERESIS
+ IsLetterTab[0xEC] = true; // ?, SMALL LETTER I WITH GRAVE ACCENT
+ IsLetterTab[0xED] = true; // ?, SMALL LETTER I WITH ACUTE ACCENT
+ IsLetterTab[0xEE] = true; // ?, SMALL LETTER I WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xEF] = true; // ?, SMALL LETTER I WITH DIAERESIS
+ IsLetterTab[0xF0] = true; // ?, SMALL LETTER ETH
+ IsLetterTab[0xF1] = true; // ?, SMALL LETTER N WITH TILDE
+ IsLetterTab[0xF2] = true; // ?, SMALL LETTER O WITH GRAVE ACCENT
+ IsLetterTab[0xF3] = true; // ?, SMALL LETTER O WITH ACUTE ACCENT
+ IsLetterTab[0xF4] = true; // ?, SMALL LETTER O WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xF5] = true; // ?, SMALL LETTER O WITH TILDE
+ IsLetterTab[0xF6] = true; // ?, SMALL LETTER O WITH DIAERESIS
+ IsLetterTab[0xF8] = true; // ?, SMALL LETTER O WITH OBLIQUE BAR
+ IsLetterTab[0xF9] = true; // ?, SMALL LETTER U WITH GRAVE ACCENT
+ IsLetterTab[0xFA] = true; // ?, SMALL LETTER U WITH ACUTE ACCENT
+ IsLetterTab[0xFB] = true; // ?, SMALL LETTER U WITH CIRCUMFLEX ACCENT
+ IsLetterTab[0xFC] = true; // ?, SMALL LETTER U WITH DIAERESIS
+ IsLetterTab[0xFD] = true; // ?, SMALL LETTER Y WITH ACUTE ACCENT
+ IsLetterTab[0xFE] = true; // ?, SMALL LETTER THORN
+ IsLetterTab[0xFF] = true; // � , SMALL LETTER Y WITH DIAERESIS
}
bool LetterTable::isLetterUnicode( sal_Unicode c )
@@ -362,7 +359,7 @@ bool LetterTable::isLetterUnicode( sal_Unicode c )
}
// Hilfsfunktion: Zeichen-Flag Testen
-BOOL SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, USHORT nTestFlags )
+sal_Bool SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, sal_uInt16 nTestFlags )
{
bool bRet = false;
if( c != 0 && c <= 255 )
@@ -377,14 +374,14 @@ BOOL SimpleTokenizer_Impl::testCharFlags( sal_Unicode c, USHORT nTestFlags )
return bRet;
}
-void SimpleTokenizer_Impl::setKeyWords( const char** ppKeyWords, UINT16 nCount )
+void SimpleTokenizer_Impl::setKeyWords( const char** ppKeyWords, sal_uInt16 nCount )
{
ppListKeyWords = ppKeyWords;
nKeyWordCount = nCount;
}
// Neues Token holen
-BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
+sal_Bool SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
/*out*/const sal_Unicode*& rpStartPos, /*out*/const sal_Unicode*& rpEndPos )
{
reType = TT_UNKNOWN;
@@ -395,25 +392,25 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Zeichen untersuchen
sal_Unicode c = peekChar();
if( c == CHAR_EOF )
- return FALSE;
+ return sal_False;
// Zeichen lesen
getChar();
//*** Alle Moeglichkeiten durchgehen ***
// Space?
- if ( (testCharFlags( c, CHAR_SPACE ) == TRUE) )
+ if ( (testCharFlags( c, CHAR_SPACE ) == sal_True) )
{
- while( testCharFlags( peekChar(), CHAR_SPACE ) == TRUE )
+ while( testCharFlags( peekChar(), CHAR_SPACE ) == sal_True )
getChar();
reType = TT_WHITESPACE;
}
// Identifier?
- else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == TRUE) )
+ else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == sal_True) )
{
- BOOL bIdentifierChar;
+ sal_Bool bIdentifierChar;
do
{
// Naechstes Zeichen holen
@@ -456,7 +453,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
{
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
sal_Unicode cPeek = peekChar();
- while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE )
+ while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
{
c = getChar();
cPeek = peekChar();
@@ -471,14 +468,14 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Operator?
// only for BASIC '\'' should be a comment, otherwise it is a normal string and handled there
- else if ( ( testCharFlags( c, CHAR_OPERATOR ) == TRUE ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) )
+ else if ( ( testCharFlags( c, CHAR_OPERATOR ) == sal_True ) || ( (c == '\'') && (aLanguage==HIGHLIGHT_BASIC)) )
{
// paramters for SQL view
if ( (c==':') || (c=='?'))
{
if (c!='?')
{
- BOOL bIdentifierChar;
+ sal_Bool bIdentifierChar;
do
{
// Naechstes Zeichen holen
@@ -497,7 +494,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if (cPeekNext=='-')
{
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
- while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE )
+ while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False )
{
getChar();
cPeekNext = peekChar();
@@ -511,7 +508,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if (cPeekNext=='/')
{
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
- while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == FALSE )
+ while( cPeekNext != CHAR_EOF && testCharFlags( cPeekNext, CHAR_EOL ) == sal_False )
{
getChar();
cPeekNext = peekChar();
@@ -528,7 +525,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// Alle Zeichen bis Zeilen-Ende oder EOF entfernen
sal_Unicode cPeek = c;
- while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE )
+ while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == sal_False )
{
getChar();
cPeek = peekChar();
@@ -555,7 +552,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
}
// Zahl?
- else if( testCharFlags( c, CHAR_START_NUMBER ) == TRUE )
+ else if( testCharFlags( c, CHAR_START_NUMBER ) == sal_True )
{
reType = TT_NUMBER;
@@ -597,7 +594,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
if( reType == TT_NUMBER && nRadix == 10 )
{
// Flag, ob das letzte Zeichen ein Exponent war
- BOOL bAfterExpChar = FALSE;
+ sal_Bool bAfterExpChar = sal_False;
// Alle Ziffern einlesen
while( testCharFlags( peekChar(), CHAR_IN_NUMBER ) ||
@@ -614,7 +611,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
}
// String?
- else if( testCharFlags( c, CHAR_START_STRING ) == TRUE )
+ else if( testCharFlags( c, CHAR_START_STRING ) == sal_True )
{
// Merken, welches Zeichen den String eroeffnet hat
sal_Unicode cEndString = c;
@@ -632,7 +629,7 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
break;
}
c = getChar();
- if( testCharFlags( c, CHAR_EOL ) == TRUE )
+ if( testCharFlags( c, CHAR_EOL ) == sal_True )
{
// ERROR: unterminated string literal
reType = TT_ERROR;
@@ -652,11 +649,11 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
}
// Zeilenende?
- else if( testCharFlags( c, CHAR_EOL ) == TRUE )
+ else if( testCharFlags( c, CHAR_EOL ) == sal_True )
{
// Falls ein weiteres anderes EOL-Char folgt, weg damit
sal_Unicode cNext = peekChar();
- if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == TRUE )
+ if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == sal_True )
getChar();
// Positions-Daten auf Zeilen-Beginn setzen
@@ -671,13 +668,13 @@ BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType,
// End-Position eintragen
rpEndPos = mpActualPos;
- return TRUE;
+ return sal_True;
}
String SimpleTokenizer_Impl::getTokStr
( /*out*/const sal_Unicode* pStartPos, /*out*/const sal_Unicode* pEndPos )
{
- return String( pStartPos, (USHORT)( pEndPos - pStartPos ) );
+ return String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) );
}
#ifdef DBG_UTIL
@@ -702,7 +699,7 @@ String SimpleTokenizer_Impl::getFullTokenStr( /*out*/TokenTypes eType,
}
if( eType != TT_EOL )
{
- aOut += String( pStartPos, (USHORT)( pEndPos - pStartPos ) );
+ aOut += String( pStartPos, (sal_uInt16)( pEndPos - pStartPos ) );
}
aOut += String( RTL_CONSTASCII_USTRINGPARAM("\n") );
return aOut;
@@ -714,10 +711,10 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua
memset( aCharTypeTab, 0, sizeof( aCharTypeTab ) );
// Zeichen-Tabelle fuellen
- USHORT i;
+ sal_uInt16 i;
// Zulaessige Zeichen fuer Identifier
- USHORT nHelpMask = (USHORT)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER );
+ sal_uInt16 nHelpMask = (sal_uInt16)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER );
for( i = 'a' ; i <= 'z' ; i++ )
aCharTypeTab[i] |= nHelpMask;
for( i = 'A' ; i <= 'Z' ; i++ )
@@ -728,7 +725,7 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua
aCharTypeTab[(int)'$'] |= nHelpMask;
// Ziffern (Identifier und Number ist moeglich)
- nHelpMask = (USHORT)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER |
+ nHelpMask = (sal_uInt16)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER |
CHAR_IN_NUMBER | CHAR_IN_HEX_NUMBER );
for( i = '0' ; i <= '9' ; i++ )
aCharTypeTab[i] |= nHelpMask;
@@ -736,7 +733,7 @@ SimpleTokenizer_Impl::SimpleTokenizer_Impl( HighlighterLanguage aLang ): aLangua
// e und E sowie . von Hand ergaenzen
aCharTypeTab[(int)'e'] |= CHAR_IN_NUMBER;
aCharTypeTab[(int)'E'] |= CHAR_IN_NUMBER;
- aCharTypeTab[(int)'.'] |= (USHORT)( CHAR_IN_NUMBER | CHAR_START_NUMBER );
+ aCharTypeTab[(int)'.'] |= (sal_uInt16)( CHAR_IN_NUMBER | CHAR_START_NUMBER );
aCharTypeTab[(int)'&'] |= CHAR_START_NUMBER;
// Hex-Ziffern
@@ -804,7 +801,7 @@ SimpleTokenizer_Impl* getSimpleTokenizer( void )
}
// Heraussuchen der jeweils naechsten Funktion aus einem JavaScript-Modul
-UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource )
+sal_uInt16 SimpleTokenizer_Impl::parseLine( sal_uInt32 nParseLine, const String* aSource )
{
// Position auf den Anfang des Source-Strings setzen
mpStringBegin = mpActualPos = aSource->GetBuffer();
@@ -819,14 +816,14 @@ UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource
const sal_Unicode* pEndPos;
// Schleife ueber alle Tokens
- UINT16 nTokenCount = 0;
+ sal_uInt16 nTokenCount = 0;
while( getNextToken( eType, pStartPos, pEndPos ) )
nTokenCount++;
return nTokenCount;
}
-void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String& rLine,
+void SimpleTokenizer_Impl::getHighlightPortions( sal_uInt32 nParseLine, const String& rLine,
/*out*/HighlightPortions& portions )
{
// Position auf den Anfang des Source-Strings setzen
@@ -846,11 +843,11 @@ void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String
{
HighlightPortion portion;
- portion.nBegin = (UINT16)(pStartPos - mpStringBegin);
- portion.nEnd = (UINT16)(pEndPos - mpStringBegin);
+ portion.nBegin = (sal_uInt16)(pStartPos - mpStringBegin);
+ portion.nEnd = (sal_uInt16)(pEndPos - mpStringBegin);
portion.tokenType = eType;
- portions.Insert(portion, portions.Count());
+ portions.push_back(portion);
}
}
@@ -892,18 +889,18 @@ void SyntaxHighlighter::initialize( HighlighterLanguage eLanguage_ )
}
}
-const Range SyntaxHighlighter::notifyChange( UINT32 nLine, INT32 nLineCountDifference,
- const String* pChangedLines, UINT32 nArrayLength)
+const Range SyntaxHighlighter::notifyChange( sal_uInt32 nLine, sal_Int32 nLineCountDifference,
+ const String* pChangedLines, sal_uInt32 nArrayLength)
{
(void)nLineCountDifference;
- for( UINT32 i=0 ; i < nArrayLength ; i++ )
+ for( sal_uInt32 i=0 ; i < nArrayLength ; i++ )
m_pSimpleTokenizer->parseLine(nLine+i, &pChangedLines[i]);
return Range( nLine, nLine + nArrayLength-1 );
}
-void SyntaxHighlighter::getHighlightPortions( UINT32 nLine, const String& rLine,
+void SyntaxHighlighter::getHighlightPortions( sal_uInt32 nLine, const String& rLine,
/*out*/HighlightPortions& portions )
{
m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions );
diff --git a/svtools/source/edit/textdat2.hxx b/svtools/source/edit/textdat2.hxx
index df2e3ffaf6a5..579810ce37ab 100644
--- a/svtools/source/edit/textdat2.hxx
+++ b/svtools/source/edit/textdat2.hxx
@@ -56,35 +56,35 @@ class TextView;
class TETextPortion
{
private:
- USHORT nLen;
+ sal_uInt16 nLen;
long nWidth;
- BYTE nKind;
- BYTE nRightToLeft;
+ sal_uInt8 nKind;
+ sal_uInt8 nRightToLeft;
TETextPortion() { nLen = 0; nKind = PORTIONKIND_TEXT; nWidth = -1; nRightToLeft = 0;}
public:
- TETextPortion( USHORT nL ) {
+ TETextPortion( sal_uInt16 nL ) {
nLen = nL;
nKind = PORTIONKIND_TEXT;
nWidth= -1;
nRightToLeft = 0;
}
- USHORT GetLen() const { return nLen; }
- USHORT& GetLen() { return nLen; }
+ sal_uInt16 GetLen() const { return nLen; }
+ sal_uInt16& GetLen() { return nLen; }
long GetWidth()const { return nWidth; }
long& GetWidth() { return nWidth; }
- BYTE GetKind() const { return nKind; }
- BYTE& GetKind() { return nKind; }
+ sal_uInt8 GetKind() const { return nKind; }
+ sal_uInt8& GetKind() { return nKind; }
- BYTE GetRightToLeft() const { return nRightToLeft; }
- BYTE& GetRightToLeft() { return nRightToLeft; }
- BOOL IsRightToLeft() const { return (nRightToLeft&1); }
+ sal_uInt8 GetRightToLeft() const { return nRightToLeft; }
+ sal_uInt8& GetRightToLeft() { return nRightToLeft; }
+ sal_Bool IsRightToLeft() const { return (nRightToLeft&1); }
- BOOL HasValidSize() const { return nWidth != (-1); }
+ sal_Bool HasValidSize() const { return nWidth != (-1); }
};
@@ -99,17 +99,17 @@ public:
~TETextPortionList();
void Reset();
- USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE );
- USHORT GetPortionStartIndex( USHORT nPortion );
- void DeleteFromPortion( USHORT nDelFrom );
+ sal_uInt16 FindPortion( sal_uInt16 nCharPos, sal_uInt16& rPortionStart, sal_Bool bPreferStartingPortion = sal_False );
+ sal_uInt16 GetPortionStartIndex( sal_uInt16 nPortion );
+ void DeleteFromPortion( sal_uInt16 nDelFrom );
};
struct TEWritingDirectionInfo
{
- BYTE nType;
- USHORT nStartPos;
- USHORT nEndPos;
- TEWritingDirectionInfo( BYTE _Type, USHORT _Start, USHORT _End )
+ sal_uInt8 nType;
+ sal_uInt16 nStartPos;
+ sal_uInt16 nEndPos;
+ TEWritingDirectionInfo( sal_uInt8 _Type, sal_uInt16 _Start, sal_uInt16 _End )
{
nType = _Type;
nStartPos = _Start;
@@ -122,65 +122,65 @@ SV_DECL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo, 0, 4 )
class TextLine
{
private:
- USHORT mnStart;
- USHORT mnEnd;
- USHORT mnStartPortion;
- USHORT mnEndPortion;
+ sal_uInt16 mnStart;
+ sal_uInt16 mnEnd;
+ sal_uInt16 mnStartPortion;
+ sal_uInt16 mnEndPortion;
short mnStartX;
- BOOL mbInvalid; // fuer geschickte Formatierung/Ausgabe
+ sal_Bool mbInvalid; // fuer geschickte Formatierung/Ausgabe
public:
TextLine() {
mnStart = mnEnd = 0;
mnStartPortion = mnEndPortion = 0;
mnStartX = 0;
- mbInvalid = TRUE;
+ mbInvalid = sal_True;
}
- BOOL IsIn( USHORT nIndex ) const
+ sal_Bool IsIn( sal_uInt16 nIndex ) const
{ return ( (nIndex >= mnStart ) && ( nIndex < mnEnd ) ); }
- BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const
+ sal_Bool IsIn( sal_uInt16 nIndex, sal_Bool bInclEnd ) const
{ return ( ( nIndex >= mnStart ) && ( bInclEnd ? ( nIndex <= mnEnd ) : ( nIndex < mnEnd ) ) ); }
- void SetStart( USHORT n ) { mnStart = n; }
- USHORT GetStart() const { return mnStart; }
- USHORT& GetStart() { return mnStart; }
+ void SetStart( sal_uInt16 n ) { mnStart = n; }
+ sal_uInt16 GetStart() const { return mnStart; }
+ sal_uInt16& GetStart() { return mnStart; }
- void SetEnd( USHORT n ) { mnEnd = n; }
- USHORT GetEnd() const { return mnEnd; }
- USHORT& GetEnd() { return mnEnd; }
+ void SetEnd( sal_uInt16 n ) { mnEnd = n; }
+ sal_uInt16 GetEnd() const { return mnEnd; }
+ sal_uInt16& GetEnd() { return mnEnd; }
- void SetStartPortion( USHORT n ) { mnStartPortion = n; }
- USHORT GetStartPortion() const { return mnStartPortion; }
- USHORT& GetStartPortion() { return mnStartPortion; }
+ void SetStartPortion( sal_uInt16 n ) { mnStartPortion = n; }
+ sal_uInt16 GetStartPortion() const { return mnStartPortion; }
+ sal_uInt16& GetStartPortion() { return mnStartPortion; }
- void SetEndPortion( USHORT n ) { mnEndPortion = n; }
- USHORT GetEndPortion() const { return mnEndPortion; }
- USHORT& GetEndPortion() { return mnEndPortion; }
+ void SetEndPortion( sal_uInt16 n ) { mnEndPortion = n; }
+ sal_uInt16 GetEndPortion() const { return mnEndPortion; }
+ sal_uInt16& GetEndPortion() { return mnEndPortion; }
- USHORT GetLen() const { return mnEnd - mnStart; }
+ sal_uInt16 GetLen() const { return mnEnd - mnStart; }
- BOOL IsInvalid() const { return mbInvalid; }
- BOOL IsValid() const { return !mbInvalid; }
- void SetInvalid() { mbInvalid = TRUE; }
- void SetValid() { mbInvalid = FALSE; }
+ sal_Bool IsInvalid() const { return mbInvalid; }
+ sal_Bool IsValid() const { return !mbInvalid; }
+ void SetInvalid() { mbInvalid = sal_True; }
+ void SetValid() { mbInvalid = sal_False; }
- BOOL IsEmpty() const { return (mnEnd > mnStart) ? FALSE : TRUE; }
+ sal_Bool IsEmpty() const { return (mnEnd > mnStart) ? sal_False : sal_True; }
short GetStartX() const { return mnStartX; }
void SetStartX( short n ) { mnStartX = n; }
- inline BOOL operator == ( const TextLine& rLine ) const;
- inline BOOL operator != ( const TextLine& rLine ) const;
+ inline sal_Bool operator == ( const TextLine& rLine ) const;
+ inline sal_Bool operator != ( const TextLine& rLine ) const;
};
typedef TextLine* TextLinePtr;
SV_DECL_PTRARR_DEL( TextLines, TextLinePtr, 1, 4 )
-inline BOOL TextLine::operator == ( const TextLine& rLine ) const
+inline sal_Bool TextLine::operator == ( const TextLine& rLine ) const
{
return ( ( mnStart == rLine.mnStart ) &&
( mnEnd == rLine.mnEnd ) &&
@@ -188,7 +188,7 @@ inline BOOL TextLine::operator == ( const TextLine& rLine ) const
( mnEndPortion == rLine.mnEndPortion ) );
}
-inline BOOL TextLine::operator != ( const TextLine& rLine ) const
+inline sal_Bool TextLine::operator != ( const TextLine& rLine ) const
{
return !( *this == rLine );
}
@@ -205,11 +205,11 @@ private:
TEWritingDirectionInfos maWritingDirectionInfos;
- USHORT mnInvalidPosStart;
+ sal_uInt16 mnInvalidPosStart;
short mnInvalidDiff;
- BOOL mbInvalid;
- BOOL mbSimple; // nur lineares Tippen
+ sal_Bool mbInvalid;
+ sal_Bool mbSimple; // nur lineares Tippen
TEParaPortion( const TEParaPortion& ) {;}
@@ -219,15 +219,15 @@ public:
~TEParaPortion();
- BOOL IsInvalid() const { return mbInvalid; }
- BOOL IsSimpleInvalid() const { return mbSimple; }
- void SetNotSimpleInvalid() { mbSimple = FALSE; }
- void SetValid() { mbInvalid = FALSE; mbSimple = TRUE;}
+ sal_Bool IsInvalid() const { return mbInvalid; }
+ sal_Bool IsSimpleInvalid() const { return mbSimple; }
+ void SetNotSimpleInvalid() { mbSimple = sal_False; }
+ void SetValid() { mbInvalid = sal_False; mbSimple = sal_True;}
- void MarkInvalid( USHORT nStart, short nDiff);
- void MarkSelectionInvalid( USHORT nStart, USHORT nEnd );
+ void MarkInvalid( sal_uInt16 nStart, short nDiff);
+ void MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 nEnd );
- USHORT GetInvalidPosStart() const { return mnInvalidPosStart; }
+ sal_uInt16 GetInvalidPosStart() const { return mnInvalidPosStart; }
short GetInvalidDiff() const { return mnInvalidDiff; }
TextNode* GetNode() const { return mpNode; }
@@ -236,8 +236,8 @@ public:
TEWritingDirectionInfos& GetWritingDirectionInfos() { return maWritingDirectionInfos; }
- USHORT GetLineNumber( USHORT nIndex, BOOL bInclEnd );
- void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine );
+ sal_uInt16 GetLineNumber( sal_uInt16 nIndex, sal_Bool bInclEnd );
+ void CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine );
};
@@ -262,9 +262,9 @@ public:
virtual void CreateAnchor();
- virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE );
+ virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False );
- virtual BOOL IsSelectionAtPoint( const Point& rPointPixel );
+ virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel );
virtual void DeselectAll();
virtual void DeselectAtPoint( const Point& );
@@ -276,13 +276,13 @@ class IdleFormatter : public Timer
{
private:
TextView* mpView;
- USHORT mnRestarts;
+ sal_uInt16 mnRestarts;
public:
IdleFormatter();
~IdleFormatter();
- void DoIdleFormat( TextView* pV, USHORT nMaxRestarts );
+ void DoIdleFormat( TextView* pV, sal_uInt16 nMaxRestarts );
void ForceTimeout();
TextView* GetView() { return mpView; }
};
@@ -292,14 +292,14 @@ struct TextDDInfo
Cursor maCursor;
TextPaM maDropPos;
- BOOL mbStarterOfDD;
- BOOL mbVisCursor;
+ sal_Bool mbStarterOfDD;
+ sal_Bool mbVisCursor;
TextDDInfo()
{
maCursor.SetStyle( CURSOR_SHADOW );
- mbStarterOfDD = FALSE;
- mbVisCursor = FALSE;
+ mbStarterOfDD = sal_False;
+ mbVisCursor = sal_False;
}
};
diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx
index 18301a181fae..d1586de4352a 100644
--- a/svtools/source/edit/textdata.cxx
+++ b/svtools/source/edit/textdata.cxx
@@ -38,7 +38,7 @@ SV_IMPL_PTRARR( TextLines, TextLinePtr );
SV_IMPL_VARARR( TEWritingDirectionInfos, TEWritingDirectionInfo );
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TextSelection
// -------------------------------------------------------------------------
@@ -67,7 +67,7 @@ void TextSelection::Justify()
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TETextPortionList
// -------------------------------------------------------------------------
TETextPortionList::TETextPortionList()
@@ -81,24 +81,24 @@ TETextPortionList::~TETextPortionList()
void TETextPortionList::Reset()
{
- for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
+ for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ )
delete GetObject( nPortion );
Remove( 0, Count() );
}
-void TETextPortionList::DeleteFromPortion( USHORT nDelFrom )
+void TETextPortionList::DeleteFromPortion( sal_uInt16 nDelFrom )
{
DBG_ASSERT( ( nDelFrom < Count() ) || ( (nDelFrom == 0) && (Count() == 0) ), "DeleteFromPortion: Out of range" );
- for ( USHORT nP = nDelFrom; nP < Count(); nP++ )
+ for ( sal_uInt16 nP = nDelFrom; nP < Count(); nP++ )
delete GetObject( nP );
Remove( nDelFrom, Count()-nDelFrom );
}
-USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOOL bPreferStartingPortion )
+sal_uInt16 TETextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPortionStart, sal_Bool bPreferStartingPortion )
{
// Bei nCharPos an Portion-Grenze wird die linke Portion gefunden
- USHORT nTmpPos = 0;
- for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
+ sal_uInt16 nTmpPos = 0;
+ for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ )
{
TETextPortion* pPortion = GetObject( nPortion );
nTmpPos = nTmpPos + pPortion->GetLen();
@@ -117,10 +117,10 @@ USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, B
}
/*
-USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion )
+sal_uInt16 TETextPortionList::GetPortionStartIndex( sal_uInt16 nPortion )
{
- USHORT nPos = 0;
- for ( USHORT nP = 0; nP < nPortion; nP++ )
+ sal_uInt16 nPos = 0;
+ for ( sal_uInt16 nP = 0; nP < nPortion; nP++ )
{
TETextPortion* pPortion = GetObject( nP );
nPos += pPortion->GetLen();
@@ -130,24 +130,24 @@ USHORT TETextPortionList::GetPortionStartIndex( USHORT nPortion )
*/
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TEParaPortion
// -------------------------------------------------------------------------
TEParaPortion::TEParaPortion( TextNode* pN )
{
mpNode = pN;
mnInvalidPosStart = mnInvalidDiff = 0;
- mbInvalid = TRUE;
- mbSimple = FALSE;
+ mbInvalid = sal_True;
+ mbSimple = sal_False;
}
TEParaPortion::~TEParaPortion()
{
}
-void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff )
+void TEParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff )
{
- if ( mbInvalid == FALSE )
+ if ( mbInvalid == sal_False )
{
mnInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff );
mnInvalidDiff = nDiff;
@@ -169,20 +169,20 @@ void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff )
else
{
DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" );
- mnInvalidPosStart = Min( mnInvalidPosStart, (USHORT) ( (nDiff < 0) ? nStart+nDiff : nDiff ) );
+ mnInvalidPosStart = Min( mnInvalidPosStart, (sal_uInt16) ( (nDiff < 0) ? nStart+nDiff : nDiff ) );
mnInvalidDiff = 0;
- mbSimple = FALSE;
+ mbSimple = sal_False;
}
}
maWritingDirectionInfos.Remove( 0, maWritingDirectionInfos.Count() );
- mbInvalid = TRUE;
+ mbInvalid = sal_True;
}
-void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /*nEnd*/ )
+void TEParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /*nEnd*/ )
{
- if ( mbInvalid == FALSE )
+ if ( mbInvalid == sal_False )
{
mnInvalidPosStart = nStart;
// nInvalidPosEnd = nEnd;
@@ -196,13 +196,13 @@ void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /*nEnd*/ )
maWritingDirectionInfos.Remove( 0, maWritingDirectionInfos.Count() );
mnInvalidDiff = 0;
- mbInvalid = TRUE;
- mbSimple = FALSE;
+ mbInvalid = sal_True;
+ mbSimple = sal_False;
}
-USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd )
+sal_uInt16 TEParaPortion::GetLineNumber( sal_uInt16 nChar, sal_Bool bInclEnd )
{
- for ( USHORT nLine = 0; nLine < maLines.Count(); nLine++ )
+ for ( sal_uInt16 nLine = 0; nLine < maLines.Count(); nLine++ )
{
TextLine* pLine = maLines.GetObject( nLine );
if ( ( bInclEnd && ( pLine->GetEnd() >= nChar ) ) ||
@@ -219,9 +219,9 @@ USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd )
}
-void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine )
+void TEParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine )
{
- USHORT nLines = maLines.Count();
+ sal_uInt16 nLines = maLines.Count();
DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" );
if ( nLastFormattedLine < ( nLines - 1 ) )
{
@@ -239,7 +239,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL
short nTDiff = sal::static_int_cast< short >(-( nTextDiff-1 ));
if ( nPDiff || nTDiff )
{
- for ( USHORT nL = nLastFormattedLine+1; nL < nLines; nL++ )
+ for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ )
{
TextLine* pLine = maLines[ nL ];
@@ -255,7 +255,7 @@ void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedL
}
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class TEParaPortions
// -------------------------------------------------------------------------
TEParaPortions::TEParaPortions()
@@ -275,7 +275,7 @@ void TEParaPortions::Reset()
clear();
}
- // -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
// (+) class IdleFormatter
// -------------------------------------------------------------------------
IdleFormatter::IdleFormatter()
@@ -289,7 +289,7 @@ IdleFormatter::~IdleFormatter()
mpView = 0;
}
-void IdleFormatter::DoIdleFormat( TextView* pV, USHORT nMaxRestarts )
+void IdleFormatter::DoIdleFormat( TextView* pV, sal_uInt16 nMaxRestarts )
{
mpView = pV;
@@ -319,12 +319,12 @@ void IdleFormatter::ForceTimeout()
TYPEINIT1( TextHint, SfxSimpleHint );
-TextHint::TextHint( ULONG Id ) : SfxSimpleHint( Id )
+TextHint::TextHint( sal_uLong Id ) : SfxSimpleHint( Id )
{
mnValue = 0;
}
-TextHint::TextHint( ULONG Id, ULONG nValue ) : SfxSimpleHint( Id )
+TextHint::TextHint( sal_uLong Id, sal_uLong nValue ) : SfxSimpleHint( Id )
{
mnValue = nValue;
}
@@ -334,9 +334,9 @@ TEIMEInfos::TEIMEInfos( const TextPaM& rPos, const String& rOldTextAfterStartPos
{
aPos = rPos;
nLen = 0;
- bCursor = TRUE;
+ bCursor = sal_True;
pAttribs = NULL;
- bWasCursorOverwrite = FALSE;
+ bWasCursorOverwrite = sal_False;
}
TEIMEInfos::~TEIMEInfos()
@@ -344,12 +344,12 @@ TEIMEInfos::~TEIMEInfos()
delete[] pAttribs;
}
-void TEIMEInfos::CopyAttribs( const USHORT* pA, USHORT nL )
+void TEIMEInfos::CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL )
{
nLen = nL;
delete pAttribs;
- pAttribs = new USHORT[ nL ];
- memcpy( pAttribs, pA, nL*sizeof(USHORT) );
+ pAttribs = new sal_uInt16[ nL ];
+ memcpy( pAttribs, pA, nL*sizeof(sal_uInt16) );
}
void TEIMEInfos::DestroyAttribs()
diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx
index 59072e2e1d9f..b4eeb76d8a06 100644
--- a/svtools/source/edit/textdoc.cxx
+++ b/svtools/source/edit/textdoc.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-
#include <textdoc.hxx>
#include <stdlib.h>
@@ -67,7 +66,7 @@ CompareStart( const void* pFirst, const void* pSecond )
// -------------------------------------------------------------------------
// (+) class TextCharAttrib
// -------------------------------------------------------------------------
-TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, USHORT nStart, USHORT nEnd )
+TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd )
{
mpAttr = rAttr.Clone();
mnStart = nStart,
@@ -92,7 +91,7 @@ TextCharAttrib::~TextCharAttrib()
TextCharAttribList::TextCharAttribList()
{
- mbHasEmptyAttribs = FALSE;
+ mbHasEmptyAttribs = sal_False;
}
TextCharAttribList::~TextCharAttribList()
@@ -100,7 +99,7 @@ TextCharAttribList::~TextCharAttribList()
// PTRARR_DEL
}
-void TextCharAttribList::Clear( BOOL bDestroyAttribs )
+void TextCharAttribList::Clear( sal_Bool bDestroyAttribs )
{
if ( bDestroyAttribs )
TextCharAttribs::DeleteAndDestroy( 0, Count() );
@@ -112,18 +111,18 @@ void TextCharAttribList::Clear( BOOL bDestroyAttribs )
void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib )
{
if ( pAttrib->IsEmpty() )
- mbHasEmptyAttribs = TRUE;
+ mbHasEmptyAttribs = sal_True;
- const USHORT nCount = Count();
- const USHORT nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt.
- BOOL bInserted = FALSE;
- for ( USHORT x = 0; x < nCount; x++ )
+ const sal_uInt16 nCount = Count();
+ const sal_uInt16 nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt.
+ sal_Bool bInserted = sal_False;
+ for ( sal_uInt16 x = 0; x < nCount; x++ )
{
TextCharAttrib* pCurAttrib = GetObject( x );
if ( pCurAttrib->GetStart() > nStart )
{
Insert( pAttrib, x );
- bInserted = TRUE;
+ bInserted = sal_True;
break;
}
}
@@ -137,12 +136,12 @@ void TextCharAttribList::ResortAttribs()
qsort( (void*)GetData(), Count(), sizeof( TextCharAttrib* ), CompareStart );
}
-TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos )
+TextCharAttrib* TextCharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
{
// Rueckwaerts, falls eins dort endet, das naechste startet.
// => Das startende gilt...
- for ( USHORT nAttr = Count(); nAttr; )
+ for ( sal_uInt16 nAttr = Count(); nAttr; )
{
TextCharAttrib* pAttr = GetObject( --nAttr );
@@ -155,11 +154,11 @@ TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos )
return NULL;
}
-TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos ) const
+TextCharAttrib* TextCharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos ) const
{
DBG_ASSERT( nWhich, "FindNextAttrib: Which?" );
- const USHORT nAttribs = Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ const sal_uInt16 nAttribs = Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( ( pAttr->GetStart() >= nFromPos ) &&
@@ -170,41 +169,41 @@ TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromP
return NULL;
}
-BOOL TextCharAttribList::HasAttrib( USHORT nWhich ) const
+sal_Bool TextCharAttribList::HasAttrib( sal_uInt16 nWhich ) const
{
- for ( USHORT nAttr = Count(); nAttr; )
+ for ( sal_uInt16 nAttr = Count(); nAttr; )
{
const TextCharAttrib* pAttr = GetObject( --nAttr );
if ( pAttr->Which() == nWhich )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL TextCharAttribList::HasBoundingAttrib( USHORT nBound )
+sal_Bool TextCharAttribList::HasBoundingAttrib( sal_uInt16 nBound )
{
// Rueckwaerts, falls eins dort endet, das naechste startet.
// => Das startende gilt...
- for ( USHORT nAttr = Count(); nAttr; )
+ for ( sal_uInt16 nAttr = Count(); nAttr; )
{
TextCharAttrib* pAttr = GetObject( --nAttr );
if ( pAttr->GetEnd() < nBound )
- return FALSE;
+ return sal_False;
if ( ( pAttr->GetStart() == nBound ) || ( pAttr->GetEnd() == nBound ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos )
+TextCharAttrib* TextCharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos )
{
if ( !mbHasEmptyAttribs )
return 0;
- const USHORT nAttribs = Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ const sal_uInt16 nAttribs = Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( pAttr->GetStart() > nPos )
@@ -218,7 +217,7 @@ TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos
void TextCharAttribList::DeleteEmptyAttribs()
{
- for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ )
+ for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( pAttr->IsEmpty() )
@@ -228,19 +227,19 @@ void TextCharAttribList::DeleteEmptyAttribs()
nAttr--;
}
}
- mbHasEmptyAttribs = FALSE;
+ mbHasEmptyAttribs = sal_False;
}
#ifdef DBG_UTIL
-BOOL TextCharAttribList::DbgCheckAttribs()
+sal_Bool TextCharAttribList::DbgCheckAttribs()
{
- BOOL bOK = TRUE;
- for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ )
+ sal_Bool bOK = sal_True;
+ for ( sal_uInt16 nAttr = 0; nAttr < Count(); nAttr++ )
{
TextCharAttrib* pAttr = GetObject( nAttr );
if ( pAttr->GetStart() > pAttr->GetEnd() )
{
- bOK = FALSE;
+ bOK = sal_False;
OSL_FAIL( "Attr verdreht" );
}
}
@@ -257,14 +256,14 @@ TextNode::TextNode( const String& rText ) :
{
}
-void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
+void TextNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew )
{
if ( !nNew )
return;
- BOOL bResort = FALSE;
- USHORT nAttribs = maCharAttribs.Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ sal_Bool bResort = sal_False;
+ sal_uInt16 nAttribs = maCharAttribs.Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
if ( pAttrib->GetEnd() >= nIndex )
@@ -295,7 +294,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
pAttrib->Expand( nNew );
}
else
- bResort = TRUE;
+ bResort = sal_True;
}
// 2: Attribut startet davor, geht hinter Index...
else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) )
@@ -308,7 +307,7 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
if ( nIndex == 0 )
{
pAttrib->Expand( nNew );
-// bResort = TRUE; // es gibt ja keine Features mehr...
+// bResort = sal_True; // es gibt ja keine Features mehr...
}
else
pAttrib->MoveForward( nNew );
@@ -328,18 +327,18 @@ void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
#endif
}
-void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
+void TextNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted )
{
if ( !nDeleted )
return;
- BOOL bResort = FALSE;
- USHORT nEndChanges = nIndex+nDeleted;
+ sal_Bool bResort = sal_False;
+ sal_uInt16 nEndChanges = nIndex+nDeleted;
- for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
+ for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
{
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
- BOOL bDelAttr = FALSE;
+ sal_Bool bDelAttr = sal_False;
if ( pAttrib->GetEnd() >= nIndex )
{
// Alles Attribute hinter der Einfuegeposition verschieben...
@@ -355,7 +354,7 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) )
pAttrib->GetEnd() = nIndex; // leer
else
- bDelAttr = TRUE;
+ bDelAttr = sal_True;
}
// 2. Attribut beginnt davor, endet drinnen oder dahinter...
else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) )
@@ -378,13 +377,13 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
DBG_ASSERT( ( pAttrib->GetEnd() <= maText.Len()) || bDelAttr, "Collaps: Attrib groesser als Absatz!" );
if ( bDelAttr /* || pAttrib->IsEmpty() */ )
{
- bResort = TRUE;
+ bResort = sal_True;
maCharAttribs.RemoveAttrib( nAttr );
delete pAttrib;
nAttr--;
}
else if ( pAttrib->IsEmpty() )
- maCharAttribs.HasEmptyAttribs() = TRUE;
+ maCharAttribs.HasEmptyAttribs() = sal_True;
}
if ( bResort )
@@ -395,25 +394,25 @@ void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
#endif
}
-void TextNode::InsertText( USHORT nPos, const String& rText )
+void TextNode::InsertText( sal_uInt16 nPos, const String& rText )
{
maText.Insert( rText, nPos );
ExpandAttribs( nPos, rText.Len() );
}
-void TextNode::InsertText( USHORT nPos, sal_Unicode c )
+void TextNode::InsertText( sal_uInt16 nPos, sal_Unicode c )
{
maText.Insert( c, nPos );
ExpandAttribs( nPos, 1 );
}
-void TextNode::RemoveText( USHORT nPos, USHORT nChars )
+void TextNode::RemoveText( sal_uInt16 nPos, sal_uInt16 nChars )
{
maText.Erase( nPos, nChars );
CollapsAttribs( nPos, nChars );
}
-TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs )
+TextNode* TextNode::Split( sal_uInt16 nPos, sal_Bool bKeepEndingAttribs )
{
String aNewText;
if ( nPos < maText.Len() )
@@ -423,7 +422,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs )
}
TextNode* pNew = new TextNode( aNewText );
- for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
+ for ( sal_uInt16 nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
{
TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
if ( pAttrib->GetEnd() < nPos )
@@ -471,7 +470,7 @@ TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs )
void TextNode::Append( const TextNode& rNode )
{
- USHORT nOldLen = maText.Len();
+ sal_uInt16 nOldLen = maText.Len();
maText += rNode.GetText();
@@ -479,16 +478,16 @@ void TextNode::Append( const TextNode& rNode )
DBG_ASSERT( maCharAttribs.DbgCheckAttribs(), "Attribute VOR AppendAttribs kaputt" );
#endif
- const USHORT nAttribs = rNode.GetCharAttribs().Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ const sal_uInt16 nAttribs = rNode.GetCharAttribs().Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = rNode.GetCharAttribs().GetAttrib( nAttr );
- BOOL bMelted = FALSE;
+ sal_Bool bMelted = sal_False;
if ( pAttrib->GetStart() == 0 )
{
// Evtl koennen Attribute zusammengefasst werden:
- USHORT nTmpAttribs = maCharAttribs.Count();
- for ( USHORT nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ )
+ sal_uInt16 nTmpAttribs = maCharAttribs.Count();
+ for ( sal_uInt16 nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ )
{
TextCharAttrib* pTmpAttrib = maCharAttribs.GetAttrib( nTmpAttr );
@@ -499,7 +498,7 @@ void TextNode::Append( const TextNode& rNode )
{
pTmpAttrib->GetEnd() =
pTmpAttrib->GetEnd() + pAttrib->GetLen();
- bMelted = TRUE;
+ bMelted = sal_True;
break; // es kann nur eins von der Sorte an der Stelle geben
}
}
@@ -541,15 +540,15 @@ void TextDoc::Clear()
void TextDoc::DestroyTextNodes()
{
- for ( ULONG nNode = 0; nNode < maTextNodes.Count(); nNode++ )
+ for ( sal_uLong nNode = 0; nNode < maTextNodes.Count(); nNode++ )
delete maTextNodes.GetObject( nNode );
maTextNodes.clear();
}
String TextDoc::GetText( const sal_Unicode* pSep ) const
{
- ULONG nLen = GetTextLen( pSep );
- ULONG nNodes = maTextNodes.Count();
+ sal_uLong nLen = GetTextLen( pSep );
+ sal_uLong nNodes = maTextNodes.Count();
if ( nLen > STRING_MAXLEN )
{
@@ -558,8 +557,8 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const
}
String aASCIIText;
- ULONG nLastNode = nNodes-1;
- for ( ULONG nNode = 0; nNode < nNodes; nNode++ )
+ sal_uLong nLastNode = nNodes-1;
+ for ( sal_uLong nNode = 0; nNode < nNodes; nNode++ )
{
TextNode* pNode = maTextNodes.GetObject( nNode );
String aTmp( pNode->GetText() );
@@ -571,7 +570,7 @@ String TextDoc::GetText( const sal_Unicode* pSep ) const
return aASCIIText;
}
-XubString TextDoc::GetText( ULONG nPara ) const
+XubString TextDoc::GetText( sal_uLong nPara ) const
{
XubString aText;
TextNode* pNode = ( nPara < maTextNodes.Count() ) ? maTextNodes.GetObject( nPara ) : 0;
@@ -582,26 +581,26 @@ XubString TextDoc::GetText( ULONG nPara ) const
}
-ULONG TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const
+sal_uLong TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const
{
- ULONG nLen = 0;
- ULONG nNodes = maTextNodes.Count();
+ sal_uLong nLen = 0;
+ sal_uLong nNodes = maTextNodes.Count();
if ( nNodes )
{
- ULONG nStartNode = 0;
- ULONG nEndNode = nNodes-1;
+ sal_uLong nStartNode = 0;
+ sal_uLong nEndNode = nNodes-1;
if ( pSel )
{
nStartNode = pSel->GetStart().GetPara();
nEndNode = pSel->GetEnd().GetPara();
}
- for ( ULONG nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ for ( sal_uLong nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
TextNode* pNode = maTextNodes.GetObject( nNode );
- USHORT nS = 0;
- ULONG nE = pNode->GetText().Len();
+ sal_uInt16 nS = 0;
+ sal_uLong nE = pNode->GetText().Len();
if ( pSel && ( nNode == pSel->GetStart().GetPara() ) )
nS = pSel->GetStart().GetIndex();
if ( pSel && ( nNode == pSel->GetEnd().GetPara() ) )
@@ -641,7 +640,7 @@ TextPaM TextDoc::InsertText( const TextPaM& rPaM, const XubString& rStr )
return aPaM;
}
-TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
+TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs )
{
TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
TextNode* pNew = pNode->Split( rPaM.GetIndex(), bKeepEndingAttribs );
@@ -654,20 +653,20 @@ TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
TextPaM TextDoc::ConnectParagraphs( TextNode* pLeft, TextNode* pRight )
{
- USHORT nPrevLen = pLeft->GetText().Len();
+ sal_uInt16 nPrevLen = pLeft->GetText().Len();
pLeft->Append( *pRight );
// der rechte verschwindet.
- ULONG nRight = maTextNodes.GetPos( pRight );
+ sal_uLong nRight = maTextNodes.GetPos( pRight );
maTextNodes.Remove( nRight );
delete pRight;
- ULONG nLeft = maTextNodes.GetPos( pLeft );
+ sal_uLong nLeft = maTextNodes.GetPos( pLeft );
TextPaM aPaM( nLeft, nPrevLen );
return aPaM;
}
-TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars )
+TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars )
{
TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
pNode->RemoveText( rPaM.GetIndex(), nChars );
@@ -675,20 +674,20 @@ TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars )
return rPaM;
}
-BOOL TextDoc::IsValidPaM( const TextPaM& rPaM )
+sal_Bool TextDoc::IsValidPaM( const TextPaM& rPaM )
{
if ( rPaM.GetPara() >= maTextNodes.Count() )
{
OSL_FAIL( "PaM: Para out of range" );
- return FALSE;
+ return sal_False;
}
TextNode * pNode = maTextNodes.GetObject( rPaM.GetPara() );
if ( rPaM.GetIndex() > pNode->GetText().Len() )
{
OSL_FAIL( "PaM: Index out of range" );
- return FALSE;
+ return sal_False;
}
- return TRUE;
+ return sal_True;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/edit/textdoc.hxx b/svtools/source/edit/textdoc.hxx
index ea7619f3da25..c52190ca4d63 100644
--- a/svtools/source/edit/textdoc.hxx
+++ b/svtools/source/edit/textdoc.hxx
@@ -31,7 +31,7 @@
#include <svl/svarray.hxx>
#include <svtools/textdata.hxx>
-#include <txtattr.hxx>
+#include <svtools/txtattr.hxx>
#include <tools/debug.hxx>
#include <tools/string.hxx>
@@ -42,7 +42,7 @@ SV_DECL_PTRARR_DEL( TextCharAttribs, TextCharAttribPtr, 0, 4 )
class TextCharAttribList : private TextCharAttribs
{
private:
- BOOL mbHasEmptyAttribs;
+ sal_Bool mbHasEmptyAttribs;
TextCharAttribList( const TextCharAttribList& ) : TextCharAttribs() {}
@@ -50,28 +50,28 @@ public:
TextCharAttribList();
~TextCharAttribList();
- void Clear( BOOL bDestroyAttribs );
- USHORT Count() const { return TextCharAttribs::Count(); }
+ void Clear( sal_Bool bDestroyAttribs );
+ sal_uInt16 Count() const { return TextCharAttribs::Count(); }
- TextCharAttrib* GetAttrib( USHORT n ) const { return TextCharAttribs::GetObject( n ); }
- void RemoveAttrib( USHORT n ) { TextCharAttribs::Remove( n, 1 ); }
+ TextCharAttrib* GetAttrib( sal_uInt16 n ) const { return TextCharAttribs::GetObject( n ); }
+ void RemoveAttrib( sal_uInt16 n ) { TextCharAttribs::Remove( n, 1 ); }
void InsertAttrib( TextCharAttrib* pAttrib );
void DeleteEmptyAttribs();
void ResortAttribs();
- BOOL HasEmptyAttribs() const { return mbHasEmptyAttribs; }
- BOOL& HasEmptyAttribs() { return mbHasEmptyAttribs; }
+ sal_Bool HasEmptyAttribs() const { return mbHasEmptyAttribs; }
+ sal_Bool& HasEmptyAttribs() { return mbHasEmptyAttribs; }
- TextCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos );
- TextCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos = 0xFFFF ) const;
- TextCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos );
- BOOL HasAttrib( USHORT nWhich ) const;
- BOOL HasBoundingAttrib( USHORT nBound );
+ TextCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos );
+ TextCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos, sal_uInt16 nMaxPos = 0xFFFF ) const;
+ TextCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos );
+ sal_Bool HasAttrib( sal_uInt16 nWhich ) const;
+ sal_Bool HasBoundingAttrib( sal_uInt16 nBound );
#ifdef DBG_UTIL
- BOOL DbgCheckAttribs();
+ sal_Bool DbgCheckAttribs();
#endif
};
@@ -84,8 +84,8 @@ private:
TextNode( const TextNode& ) {;}
protected:
- void ExpandAttribs( USHORT nIndex, USHORT nNewChars );
- void CollapsAttribs( USHORT nIndex, USHORT nDelChars );
+ void ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNewChars );
+ void CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDelChars );
public:
TextNode( const String& rText );
@@ -96,11 +96,11 @@ public:
const TextCharAttribList& GetCharAttribs() const { return maCharAttribs; }
TextCharAttribList& GetCharAttribs() { return maCharAttribs; }
- void InsertText( USHORT nPos, const String& rText );
- void InsertText( USHORT nPos, sal_Unicode c );
- void RemoveText( USHORT nPos, USHORT nChars );
+ void InsertText( sal_uInt16 nPos, const String& rText );
+ void InsertText( sal_uInt16 nPos, sal_Unicode c );
+ void RemoveText( sal_uInt16 nPos, sal_uInt16 nChars );
- TextNode* Split( USHORT nPos, BOOL bKeepEndigAttribs );
+ TextNode* Split( sal_uInt16 nPos, sal_Bool bKeepEndigAttribs );
void Append( const TextNode& rNode );
};
@@ -108,7 +108,7 @@ class TextDoc
{
private:
ToolsList<TextNode*> maTextNodes;
- USHORT mnLeftMargin;
+ sal_uInt16 mnLeftMargin;
protected:
void DestroyTextNodes();
@@ -122,27 +122,27 @@ public:
ToolsList<TextNode*>& GetNodes() { return maTextNodes; }
const ToolsList<TextNode*>& GetNodes() const { return maTextNodes; }
- TextPaM RemoveChars( const TextPaM& rPaM, USHORT nChars );
+ TextPaM RemoveChars( const TextPaM& rPaM, sal_uInt16 nChars );
TextPaM InsertText( const TextPaM& rPaM, sal_Unicode c );
TextPaM InsertText( const TextPaM& rPaM, const String& rStr );
- TextPaM InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs );
+ TextPaM InsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs );
TextPaM ConnectParagraphs( TextNode* pLeft, TextNode* pRight );
- ULONG GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const;
+ sal_uLong GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const;
String GetText( const sal_Unicode* pSep ) const;
- String GetText( ULONG nPara ) const;
+ String GetText( sal_uLong nPara ) const;
- void SetLeftMargin( USHORT n ) { mnLeftMargin = n; }
- USHORT GetLeftMargin() const { return mnLeftMargin; }
+ void SetLeftMargin( sal_uInt16 n ) { mnLeftMargin = n; }
+ sal_uInt16 GetLeftMargin() const { return mnLeftMargin; }
-// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd ), USHORT nWhich = 0 );
-// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, USHORT nWhich = 0 );
+// sal_Bool RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ), sal_uInt16 nWhich = 0 );
+// sal_Bool RemoveAttribs( TextNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 );
// void InsertAttrib( const EditCharAttrib* pAttr );
// void InsertAttribInSelection( const EditCharAttrib* pAttr );
-// void FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet );
+// void FindAttribs( TextNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet );
- BOOL IsValidPaM( const TextPaM& rPaM );
+ sal_Bool IsValidPaM( const TextPaM& rPaM );
};
#endif // _TEXTDOC_HXX
diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx
index 45d23bcdbee9..539c34538c44 100644
--- a/svtools/source/edit/texteng.cxx
+++ b/svtools/source/edit/texteng.cxx
@@ -74,8 +74,8 @@ typedef TextView* TextViewPtr;
SV_DECL_PTRARR( TextViews, TextViewPtr, 0, 1 )
// SV_IMPL_PTRARR( TextViews, TextViewPtr );
-SV_DECL_VARARR_SORT( TESortedPositions, ULONG, 16, 8 )
-SV_IMPL_VARARR_SORT( TESortedPositions, ULONG )
+SV_DECL_VARARR_SORT( TESortedPositions, sal_uLong, 16, 8 )
+SV_IMPL_VARARR_SORT( TESortedPositions, sal_uLong )
#define RESDIFF 10
#define SCRLRANGE 20 // 1/20 der Breite/Hoehe scrollen, wenn im QueryDrop
@@ -92,15 +92,15 @@ TextEngine::TextEngine()
mpViews = new TextViews;
mpActiveView = NULL;
- mbIsFormatting = FALSE;
- mbFormatted = FALSE;
- mbUpdate = TRUE;
- mbModified = FALSE;
- mbUndoEnabled = FALSE;
- mbIsInUndo = FALSE;
- mbDowning = FALSE;
- mbRightToLeft = FALSE;
- mbHasMultiLineParas = FALSE;
+ mbIsFormatting = sal_False;
+ mbFormatted = sal_False;
+ mbUpdate = sal_True;
+ mbModified = sal_False;
+ mbUndoEnabled = sal_False;
+ mbIsInUndo = sal_False;
+ mbDowning = sal_False;
+ mbRightToLeft = sal_False;
+ mbHasMultiLineParas = sal_False;
meAlign = TXTALIGN_LEFT;
@@ -124,7 +124,7 @@ TextEngine::TextEngine()
maTextColor = COL_BLACK;
Font aFont;
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
Color aFillColor( aFont.GetFillColor() );
aFillColor.SetTransparency( 0 );
aFont.SetFillColor( aFillColor );
@@ -133,7 +133,7 @@ TextEngine::TextEngine()
TextEngine::~TextEngine()
{
- mbDowning = TRUE;
+ mbDowning = sal_True;
delete mpIdleFormatter;
delete mpDoc;
@@ -156,7 +156,7 @@ void TextEngine::InsertView( TextView* pTextView )
void TextEngine::RemoveView( TextView* pTextView )
{
- USHORT nPos = mpViews->GetPos( pTextView );
+ sal_uInt16 nPos = mpViews->GetPos( pTextView );
if( nPos != USHRT_MAX )
{
pTextView->HideCursor();
@@ -166,12 +166,12 @@ void TextEngine::RemoveView( TextView* pTextView )
}
}
-USHORT TextEngine::GetViewCount() const
+sal_uInt16 TextEngine::GetViewCount() const
{
return mpViews->Count();
}
-TextView* TextEngine::GetView( USHORT nView ) const
+TextView* TextEngine::GetView( sal_uInt16 nView ) const
{
return mpViews->GetObject( nView );
}
@@ -210,7 +210,7 @@ void TextEngine::SetFont( const Font& rFont )
// Wegen Selektion keinen Transparenten Font zulassen...
// (Sonst spaeter in ImplPaint den Hintergrund anders loeschen...)
- maFont.SetTransparent( FALSE );
+ maFont.SetTransparent( sal_False );
// Tell VCL not to use the font color, use text color from OutputDevice
maFont.SetColor( COL_TRANSPARENT );
Color aFillColor( maFont.GetFillColor() );
@@ -225,10 +225,10 @@ void TextEngine::SetFont( const Font& rFont )
if ( !aTextSize.Width() )
aTextSize.Width() = mpRefDev->GetTextWidth( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "XXXX" ) ) );
- mnDefTab = (USHORT)aTextSize.Width();
+ mnDefTab = (sal_uInt16)aTextSize.Width();
if ( !mnDefTab )
mnDefTab = 1;
- mnCharHeight = (USHORT)aTextSize.Height();
+ mnCharHeight = (sal_uInt16)aTextSize.Height();
/*
// #93746# Doesn't work with CJK HalfWidth/FullWidth
FontMetric aRealFont( mpRefDev->GetFontMetric() );
@@ -236,7 +236,7 @@ void TextEngine::SetFont( const Font& rFont )
{
String aX100;
aX100.Fill( 100, 'X' );
- mnFixCharWidth100 = (USHORT)mpRefDev->GetTextWidth( aX100 );
+ mnFixCharWidth100 = (sal_uInt16)mpRefDev->GetTextWidth( aX100 );
}
else
*/
@@ -245,7 +245,7 @@ void TextEngine::SetFont( const Font& rFont )
FormatFullDoc();
UpdateViews();
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
pView->GetWindow()->SetInputContext( InputContext( GetFont(), !pView->IsReadOnly() ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) );
@@ -253,22 +253,22 @@ void TextEngine::SetFont( const Font& rFont )
}
}
-void TextEngine::SetDefTab( USHORT nDefTab )
+void TextEngine::SetDefTab( sal_uInt16 nDefTab )
{
mnDefTab = nDefTab;
// evtl neu setzen?
}
-void TextEngine::SetMaxTextLen( ULONG nLen )
+void TextEngine::SetMaxTextLen( sal_uLong nLen )
{
mnMaxTextLen = nLen;
}
-void TextEngine::SetMaxTextWidth( ULONG nMaxWidth )
+void TextEngine::SetMaxTextWidth( sal_uLong nMaxWidth )
{
if ( nMaxWidth != mnMaxTextWidth )
{
- mnMaxTextWidth = Min( nMaxWidth, (ULONG)0x7FFFFFFF );
+ mnMaxTextWidth = Min( nMaxWidth, (sal_uLong)0x7FFFFFFF );
FormatFullDoc();
UpdateViews();
}
@@ -304,14 +304,14 @@ String TextEngine::GetText( LineEnd aSeparator ) const
String TextEngine::GetTextLines( LineEnd aSeparator ) const
{
String aText;
- ULONG nParas = mpTEParaPortions->Count();
+ sal_uLong nParas = mpTEParaPortions->Count();
const sal_Unicode* pSep = static_getLineEndText( aSeparator );
- for ( ULONG nP = 0; nP < nParas; nP++ )
+ for ( sal_uLong nP = 0; nP < nParas; nP++ )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nP );
- USHORT nLines = pTEParaPortion->GetLines().Count();
- for ( USHORT nL = 0; nL < nLines; nL++ )
+ sal_uInt16 nLines = pTEParaPortion->GetLines().Count();
+ for ( sal_uInt16 nL = 0; nL < nLines; nL++ )
{
TextLine* pLine = pTEParaPortion->GetLines()[nL];
aText += pTEParaPortion->GetNode()->GetText().Copy( pLine->GetStart(), pLine->GetEnd() - pLine->GetStart() );
@@ -322,17 +322,17 @@ String TextEngine::GetTextLines( LineEnd aSeparator ) const
return aText;
}
-String TextEngine::GetText( ULONG nPara ) const
+String TextEngine::GetText( sal_uLong nPara ) const
{
return mpDoc->GetText( nPara );
}
-ULONG TextEngine::GetTextLen( LineEnd aSeparator ) const
+sal_uLong TextEngine::GetTextLen( LineEnd aSeparator ) const
{
return mpDoc->GetTextLen( static_getLineEndText( aSeparator ) );
}
-ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const
+sal_uLong TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const
{
TextSelection aSel( rSel );
aSel.Justify();
@@ -340,12 +340,12 @@ ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) co
return mpDoc->GetTextLen( static_getLineEndText( aSeparator ), &aSel );
}
-USHORT TextEngine::GetTextLen( ULONG nPara ) const
+sal_uInt16 TextEngine::GetTextLen( sal_uLong nPara ) const
{
return mpDoc->GetNodes().GetObject( nPara )->GetText().Len();
}
-void TextEngine::SetUpdateMode( BOOL bUpdate )
+void TextEngine::SetUpdateMode( sal_Bool bUpdate )
{
if ( bUpdate != mbUpdate )
{
@@ -359,9 +359,9 @@ void TextEngine::SetUpdateMode( BOOL bUpdate )
}
}
-BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent )
+sal_Bool TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent )
{
- BOOL bDoesMove = FALSE;
+ sal_Bool bDoesMove = sal_False;
switch ( rKeyEvent.GetKeyCode().GetCode() )
{
@@ -375,16 +375,16 @@ BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent )
case KEY_PAGEDOWN:
{
if ( !rKeyEvent.GetKeyCode().IsMod2() )
- bDoesMove = TRUE;
+ bDoesMove = sal_True;
}
break;
}
return bDoesMove;
}
-BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
+sal_Bool TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
{
- BOOL bDoesChange = FALSE;
+ sal_Bool bDoesChange = sal_False;
KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction();
if ( eFunc != KEYFUNC_DONTKNOW )
@@ -394,7 +394,7 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
case KEYFUNC_UNDO:
case KEYFUNC_REDO:
case KEYFUNC_CUT:
- case KEYFUNC_PASTE: bDoesChange = TRUE;
+ case KEYFUNC_PASTE: bDoesChange = sal_True;
break;
default: // wird dann evtl. unten bearbeitet.
eFunc = KEYFUNC_DONTKNOW;
@@ -408,14 +408,14 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
case KEY_BACKSPACE:
{
if ( !rKeyEvent.GetKeyCode().IsMod2() )
- bDoesChange = TRUE;
+ bDoesChange = sal_True;
}
break;
case KEY_RETURN:
case KEY_TAB:
{
if ( !rKeyEvent.GetKeyCode().IsMod1() && !rKeyEvent.GetKeyCode().IsMod2() )
- bDoesChange = TRUE;
+ bDoesChange = sal_True;
}
break;
default:
@@ -427,15 +427,15 @@ BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
return bDoesChange;
}
-BOOL TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent )
+sal_Bool TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent )
{
if( rKeyEvent.GetCharCode() >= 32 && rKeyEvent.GetCharCode() != 127 &&
KEY_MOD1 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) && // (ssa) #i45714#:
KEY_MOD2 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT) ) // check for Ctrl and Alt separately
{
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
void TextEngine::ImpInitDoc()
@@ -452,9 +452,9 @@ void TextEngine::ImpInitDoc()
mpDoc->GetNodes().Insert( pNode, 0 );
TEParaPortion* pIniPortion = new TEParaPortion( pNode );
- mpTEParaPortions->Insert( pIniPortion, (ULONG)0 );
+ mpTEParaPortions->Insert( pIniPortion, (sal_uLong)0 );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
ImpParagraphRemoved( TEXT_PARA_ALL );
ImpParagraphInserted( 0 );
@@ -470,15 +470,15 @@ String TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) cons
TextSelection aSel( rSel );
aSel.Justify();
- ULONG nStartPara = aSel.GetStart().GetPara();
- ULONG nEndPara = aSel.GetEnd().GetPara();
+ sal_uLong nStartPara = aSel.GetStart().GetPara();
+ sal_uLong nEndPara = aSel.GetEnd().GetPara();
const sal_Unicode* pSep = static_getLineEndText( aSeparator );
- for ( ULONG nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ )
+ for ( sal_uLong nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
- USHORT nStartPos = 0;
- USHORT nEndPos = pNode->GetText().Len();
+ sal_uInt16 nStartPos = 0;
+ sal_uInt16 nEndPos = pNode->GetText().Len();
if ( nNode == nStartPara )
nStartPos = aSel.GetStart().GetIndex();
if ( nNode == nEndPara ) // kann auch == nStart sein!
@@ -497,7 +497,7 @@ void TextEngine::ImpRemoveText()
TextPaM aStartPaM( 0, 0 );
TextSelection aEmptySel( aStartPaM, aStartPaM );
- for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ )
{
TextView* pView = mpViews->GetObject( nView );
pView->ImpSetSelection( aEmptySel );
@@ -509,9 +509,9 @@ void TextEngine::SetText( const XubString& rText )
{
ImpRemoveText();
- BOOL bUndoCurrentlyEnabled = IsUndoEnabled();
+ sal_Bool bUndoCurrentlyEnabled = IsUndoEnabled();
// Der von Hand reingesteckte Text kann nicht vom Anwender rueckgaengig gemacht werden.
- EnableUndo( FALSE );
+ EnableUndo( sal_False );
TextPaM aStartPaM( 0, 0 );
TextSelection aEmptySel( aStartPaM, aStartPaM );
@@ -520,7 +520,7 @@ void TextEngine::SetText( const XubString& rText )
if ( rText.Len() )
aPaM = ImpInsertText( aEmptySel, rText );
- for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ )
{
TextView* pView = mpViews->GetObject( nView );
pView->ImpSetSelection( aEmptySel );
@@ -541,7 +541,7 @@ void TextEngine::SetText( const XubString& rText )
}
-void TextEngine::CursorMoved( ULONG nNode )
+void TextEngine::CursorMoved( sal_uLong nNode )
{
// Leere Attribute loeschen, aber nur, wenn Absatz nicht leer!
TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
@@ -549,7 +549,7 @@ void TextEngine::CursorMoved( ULONG nNode )
pNode->GetCharAttribs().DeleteEmptyAttribs();
}
-void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoAction* )
+void TextEngine::ImpRemoveChars( const TextPaM& rPaM, sal_uInt16 nChars, SfxUndoAction* )
{
DBG_ASSERT( nChars, "ImpRemoveChars - 0 Chars?!" );
if ( IsUndoEnabled() && !IsInUndo() )
@@ -559,9 +559,9 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoActi
XubString aStr( pNode->GetText().Copy( rPaM.GetIndex(), nChars ) );
// Pruefen, ob Attribute geloescht oder geaendert werden:
- USHORT nStart = rPaM.GetIndex();
- USHORT nEnd = nStart + nChars;
- for ( USHORT nAttr = pNode->GetCharAttribs().Count(); nAttr; )
+ sal_uInt16 nStart = rPaM.GetIndex();
+ sal_uInt16 nEnd = nStart + nChars;
+ for ( sal_uInt16 nAttr = pNode->GetCharAttribs().Count(); nAttr; )
{
TextCharAttrib* pAttr = pNode->GetCharAttribs().GetAttrib( --nAttr );
if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetStart() < nEnd ) )
@@ -583,7 +583,7 @@ void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoActi
ImpCharsRemoved( rPaM.GetPara(), rPaM.GetIndex(), nChars );
}
-TextPaM TextEngine::ImpConnectParagraphs( ULONG nLeft, ULONG nRight )
+TextPaM TextEngine::ImpConnectParagraphs( sal_uLong nLeft, sal_uLong nRight )
{
DBG_ASSERT( nLeft != nRight, "Den gleichen Absatz zusammenfuegen ?" );
@@ -627,11 +627,11 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
DBG_ASSERT( mpDoc->IsValidPaM( aStartPaM ), "Index im Wald in ImpDeleteText" );
DBG_ASSERT( mpDoc->IsValidPaM( aEndPaM ), "Index im Wald in ImpDeleteText" );
- ULONG nStartNode = aStartPaM.GetPara();
- ULONG nEndNode = aEndPaM.GetPara();
+ sal_uLong nStartNode = aStartPaM.GetPara();
+ sal_uLong nEndNode = aEndPaM.GetPara();
// Alle Nodes dazwischen entfernen....
- for ( ULONG z = nStartNode+1; z < nEndNode; z++ )
+ for ( sal_uLong z = nStartNode+1; z < nEndNode; z++ )
{
// Immer nStartNode+1, wegen Remove()!
ImpRemoveParagraph( nStartNode+1 );
@@ -641,7 +641,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
{
// Den Rest des StartNodes...
TextNode* pLeft = mpDoc->GetNodes().GetObject( nStartNode );
- USHORT nChars = pLeft->GetText().Len() - aStartPaM.GetIndex();
+ sal_uInt16 nChars = pLeft->GetText().Len() - aStartPaM.GetIndex();
if ( nChars )
{
ImpRemoveChars( aStartPaM, nChars );
@@ -668,7 +668,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
}
else
{
- USHORT nChars;
+ sal_uInt16 nChars;
nChars = aEndPaM.GetIndex() - aStartPaM.GetIndex();
ImpRemoveChars( aStartPaM, nChars );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nStartNode );
@@ -681,7 +681,7 @@ TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
return aStartPaM;
}
-void TextEngine::ImpRemoveParagraph( ULONG nPara )
+void TextEngine::ImpRemoveParagraph( sal_uLong nPara )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
@@ -715,14 +715,14 @@ uno::Reference < i18n::XExtendedInputSequenceChecker > TextEngine::GetInputSeque
return xISC;
}
-BOOL TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const
+sal_Bool TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelection& rCurSel ) const
{
uno::Reference< i18n::XBreakIterator > xBI = ((TextEngine *) this)->GetBreakIterator();
SvtCTLOptions aCTLOptions;
// get the index that really is first
- USHORT nFirstPos = rCurSel.GetStart().GetIndex();
- USHORT nMaxPos = rCurSel.GetEnd().GetIndex();
+ sal_uInt16 nFirstPos = rCurSel.GetStart().GetIndex();
+ sal_uInt16 nMaxPos = rCurSel.GetEnd().GetIndex();
if (nMaxPos < nFirstPos)
nFirstPos = nMaxPos;
@@ -735,12 +735,12 @@ BOOL TextEngine::IsInputSequenceCheckingRequired( sal_Unicode c, const TextSelec
return bIsSequenceChecking;
}
-TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, BOOL bOverwrite )
+TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, sal_Bool bOverwrite )
{
return ImpInsertText( c, rCurSel, bOverwrite, sal_False );
}
-TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, BOOL bOverwrite, BOOL bIsUserInput )
+TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel, sal_Bool bOverwrite, sal_Bool bIsUserInput )
{
DBG_ASSERT( c != '\n', "Zeilenumbruch bei InsertText ?" );
DBG_ASSERT( c != '\r', "Zeilenumbruch bei InsertText ?" );
@@ -750,13 +750,13 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
if ( pNode->GetText().Len() < STRING_MAXLEN )
{
- BOOL bDoOverwrite = ( bOverwrite &&
- ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? TRUE : FALSE;
+ sal_Bool bDoOverwrite = ( bOverwrite &&
+ ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? sal_True : sal_False;
- BOOL bUndoAction = ( rCurSel.HasRange() || bDoOverwrite );
+ sal_Bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite );
if ( bUndoAction )
- UndoActionStart( TEXTUNDO_INSERT );
+ UndoActionStart();
if ( rCurSel.HasRange() )
{
@@ -803,7 +803,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
String aChgText( aNewText.copy( nChgPos ), nChgLen );
// select text from first pos to be changed to current pos
- TextSelection aSel( TextPaM( aPaM.GetPara(), (USHORT) nChgPos ), aPaM );
+ TextSelection aSel( TextPaM( aPaM.GetPara(), (sal_uInt16) nChgPos ), aPaM );
if (aChgText.Len())
// ImpInsertText implicitly handles undo...
@@ -826,7 +826,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
if ( IsUndoEnabled() && !IsInUndo() )
{
TextUndoInsertChars* pNewUndo = new TextUndoInsertChars( this, aPaM, c );
- BOOL bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? TRUE : FALSE;
+ sal_Bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False;
InsertUndo( pNewUndo, bTryMerge );
}
@@ -840,7 +840,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
TextModified();
if ( bUndoAction )
- UndoActionEnd( TEXTUNDO_INSERT );
+ UndoActionEnd();
}
return aPaM;
@@ -849,7 +849,7 @@ TextPaM TextEngine::ImpInsertText( sal_Unicode c, const TextSelection& rCurSel,
TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString& rStr )
{
- UndoActionStart( TEXTUNDO_INSERT );
+ UndoActionStart();
TextPaM aPaM;
@@ -861,21 +861,21 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString
XubString aText( rStr );
aText.ConvertLineEnd( LINEEND_LF );
- USHORT nStart = 0;
+ sal_uInt16 nStart = 0;
while ( nStart < aText.Len() )
{
- USHORT nEnd = aText.Search( LINE_SEP, nStart );
+ sal_uInt16 nEnd = aText.Search( LINE_SEP, nStart );
if ( nEnd == STRING_NOTFOUND )
nEnd = aText.Len(); // nicht dereferenzieren!
// Start == End => Leerzeile
if ( nEnd > nStart )
{
- ULONG nL = aPaM.GetIndex();
+ sal_uLong nL = aPaM.GetIndex();
nL += ( nEnd-nStart );
if ( nL > STRING_MAXLEN )
{
- USHORT nDiff = (USHORT) (nL-STRING_MAXLEN);
+ sal_uInt16 nDiff = (sal_uInt16) (nL-STRING_MAXLEN);
nEnd = nEnd - nDiff;
}
@@ -901,13 +901,13 @@ TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString
break;
}
- UndoActionEnd( TEXTUNDO_INSERT );
+ UndoActionEnd();
TextModified();
return aPaM;
}
-TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeepEndingAttribs )
+TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, sal_Bool bKeepEndingAttribs )
{
TextPaM aPaM;
if ( rCurSel.HasRange() )
@@ -918,13 +918,13 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeep
return ImpInsertParaBreak( aPaM, bKeepEndingAttribs );
}
-TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
+TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, sal_Bool bKeepEndingAttribs )
{
if ( IsUndoEnabled() && !IsInUndo() )
InsertUndo( new TextUndoSplitPara( this, rPaM.GetPara(), rPaM.GetIndex() ) );
TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() );
- BOOL bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len();
+ sal_Bool bFirstParaContentChanged = rPaM.GetIndex() < pNode->GetText().Len();
TextPaM aPaM( mpDoc->InsertParaBreak( rPaM, bKeepEndingAttribs ) );
@@ -946,9 +946,9 @@ TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAtt
return aPaM;
}
-Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial )
+Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, sal_Bool bSpecial )
{
- DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: PaMtoEditCursor" );
+ DBG_ASSERT( GetUpdateMode(), "Darf bei Update=sal_False nicht erreicht werden: PaMtoEditCursor" );
Rectangle aEditCursor;
long nY = 0;
@@ -959,7 +959,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial )
}
else
{
- for ( ULONG nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ )
+ for ( sal_uLong nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject(nPortion);
nY += pPortion->GetLines().Count() * mnCharHeight;
@@ -972,7 +972,7 @@ Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial )
return aEditCursor;
}
-Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bPreferPortionStart )
+Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, sal_Bool bSpecial, sal_Bool bPreferPortionStart )
{
if ( !IsFormatted() && !IsFormatting() )
FormatAndUpdate();
@@ -993,9 +993,9 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bP
*/
long nY = 0;
- USHORT nCurIndex = 0;
+ sal_uInt16 nCurIndex = 0;
TextLine* pLine = 0;
- for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
+ for ( sal_uInt16 nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
{
TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine );
if ( ( pTmpLine->GetStart() == rPaM.GetIndex() ) || ( pTmpLine->IsIn( rPaM.GetIndex(), bSpecial ) ) )
@@ -1029,21 +1029,21 @@ Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial, BOOL bP
return aEditCursor;
}
-long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL bPreferPortionStart )
+long TextEngine::ImpGetXPos( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_Bool bPreferPortionStart )
{
DBG_ASSERT( ( nIndex >= pLine->GetStart() ) && ( nIndex <= pLine->GetEnd() ) , "ImpGetXPos muss richtig gerufen werden!" );
- BOOL bDoPreferPortionStart = bPreferPortionStart;
+ sal_Bool bDoPreferPortionStart = bPreferPortionStart;
// Assure that the portion belongs to this line:
if ( nIndex == pLine->GetStart() )
- bDoPreferPortionStart = TRUE;
+ bDoPreferPortionStart = sal_True;
else if ( nIndex == pLine->GetEnd() )
- bDoPreferPortionStart = FALSE;
+ bDoPreferPortionStart = sal_False;
TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nTextPortionStart = 0;
- USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart );
+ sal_uInt16 nTextPortionStart = 0;
+ sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart );
DBG_ASSERT( ( nTextPortion >= pLine->GetStartPortion() ) && ( nTextPortion <= pLine->GetEndPortion() ), "GetXPos: Portion not in current line! " );
@@ -1074,7 +1074,7 @@ long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL b
// nX += pNextPortion->GetWidth();
// End of the tab portion, use start of next for cursor pos
DBG_ASSERT( !bPreferPortionStart, "ImpGetXPos - How can we this tab portion here???" );
- nX = ImpGetXPos( nPara, pLine, nIndex, TRUE );
+ nX = ImpGetXPos( nPara, pLine, nIndex, sal_True );
}
}
@@ -1110,7 +1110,7 @@ long TextEngine::ImpGetXPos( ULONG nPara, TextLine* pLine, USHORT nIndex, BOOL b
return nX;
}
-const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) const
+const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const
{
const TextAttrib* pAttr = NULL;
const TextCharAttrib* pCharAttr = FindCharAttrib( rPaM, nWhich );
@@ -1119,7 +1119,7 @@ const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) c
return pAttr;
}
-const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nWhich ) const
+const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const
{
const TextCharAttrib* pAttr = NULL;
TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() );
@@ -1128,10 +1128,10 @@ const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nW
return pAttr;
}
-BOOL TextEngine::HasAttrib( USHORT nWhich ) const
+sal_Bool TextEngine::HasAttrib( sal_uInt16 nWhich ) const
{
- BOOL bAttr = FALSE;
- for ( ULONG n = mpDoc->GetNodes().Count(); --n && !bAttr; )
+ sal_Bool bAttr = sal_False;
+ for ( sal_uLong n = mpDoc->GetNodes().Count(); --n && !bAttr; )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( n );
bAttr = pNode->GetCharAttribs().HasAttrib( nWhich );
@@ -1139,12 +1139,12 @@ BOOL TextEngine::HasAttrib( USHORT nWhich ) const
return bAttr;
}
-TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart )
+TextPaM TextEngine::GetPaM( const Point& rDocPos, sal_Bool bSmart )
{
- DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: GetPaM" );
+ DBG_ASSERT( GetUpdateMode(), "Darf bei Update=sal_False nicht erreicht werden: GetPaM" );
long nY = 0;
- for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
+ for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
long nTmpHeight = pPortion->GetLines().Count() * mnCharHeight;
@@ -1162,21 +1162,21 @@ TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart )
}
// Nicht gefunden - Dann den letzten sichtbare...
- ULONG nLastNode = mpDoc->GetNodes().Count() - 1;
+ sal_uLong nLastNode = mpDoc->GetNodes().Count() - 1;
TextNode* pLast = mpDoc->GetNodes().GetObject( nLastNode );
return TextPaM( nLastNode, pLast->GetText().Len() );
}
-USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL bSmart )
+sal_uInt16 TextEngine::ImpFindIndex( sal_uLong nPortion, const Point& rPosInPara, sal_Bool bSmart )
{
DBG_ASSERT( IsFormatted(), "GetPaM: Nicht formatiert" );
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
- USHORT nCurIndex = 0;
+ sal_uInt16 nCurIndex = 0;
long nY = 0;
TextLine* pLine = 0;
- USHORT nLine;
+ sal_uInt16 nLine;
for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
{
TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine );
@@ -1196,24 +1196,24 @@ USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL b
{
uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator();
sal_Int32 nCount = 1;
- nCurIndex = (USHORT)xBI->previousCharacters( pPortion->GetNode()->GetText(), nCurIndex, GetLocale(), i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount );
+ nCurIndex = (sal_uInt16)xBI->previousCharacters( pPortion->GetNode()->GetText(), nCurIndex, GetLocale(), i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount );
}
return nCurIndex;
}
-USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL )
+sal_uInt16 TextEngine::GetCharPos( sal_uLong nPortion, sal_uInt16 nLine, long nXPos, sal_Bool )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
TextLine* pLine = pPortion->GetLines().GetObject( nLine );
- USHORT nCurIndex = pLine->GetStart();
+ sal_uInt16 nCurIndex = pLine->GetStart();
long nTmpX = pLine->GetStartX();
if ( nXPos <= nTmpX )
return nCurIndex;
- for ( USHORT i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ )
+ for ( sal_uInt16 i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ )
{
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( i );
nTmpX += pTextPortion->GetWidth();
@@ -1241,9 +1241,9 @@ USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL )
}
-ULONG TextEngine::GetTextHeight() const
+sal_uLong TextEngine::GetTextHeight() const
{
- DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" );
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: GetTextHeight" );
if ( !IsFormatted() && !IsFormatting() )
((TextEngine*)this)->FormatAndUpdate();
@@ -1251,9 +1251,9 @@ ULONG TextEngine::GetTextHeight() const
return mnCurTextHeight;
}
-ULONG TextEngine::GetTextHeight( ULONG nParagraph ) const
+sal_uLong TextEngine::GetTextHeight( sal_uLong nParagraph ) const
{
- DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" );
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: GetTextHeight" );
if ( !IsFormatted() && !IsFormatting() )
((TextEngine*)this)->FormatAndUpdate();
@@ -1261,15 +1261,15 @@ ULONG TextEngine::GetTextHeight( ULONG nParagraph ) const
return CalcParaHeight( nParagraph );
}
-ULONG TextEngine::CalcTextWidth( ULONG nPara )
+sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara )
{
- ULONG nParaWidth = 0;
+ sal_uLong nParaWidth = 0;
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
- for ( USHORT nLine = pPortion->GetLines().Count(); nLine; )
+ for ( sal_uInt16 nLine = pPortion->GetLines().Count(); nLine; )
{
- ULONG nLineWidth = 0;
+ sal_uLong nLineWidth = 0;
TextLine* pLine = pPortion->GetLines().GetObject( --nLine );
- for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
+ for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
{
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nTP );
nLineWidth += pTextPortion->GetWidth();
@@ -1280,7 +1280,7 @@ ULONG TextEngine::CalcTextWidth( ULONG nPara )
return nParaWidth;
}
-ULONG TextEngine::CalcTextWidth()
+sal_uLong TextEngine::CalcTextWidth()
{
if ( !IsFormatted() && !IsFormatting() )
FormatAndUpdate();
@@ -1288,9 +1288,9 @@ ULONG TextEngine::CalcTextWidth()
if ( mnCurTextWidth == 0xFFFFFFFF )
{
mnCurTextWidth = 0;
- for ( ULONG nPara = mpTEParaPortions->Count(); nPara; )
+ for ( sal_uLong nPara = mpTEParaPortions->Count(); nPara; )
{
- ULONG nParaWidth = CalcTextWidth( --nPara );
+ sal_uLong nParaWidth = CalcTextWidth( --nPara );
if ( nParaWidth > mnCurTextWidth )
mnCurTextWidth = nParaWidth;
}
@@ -1298,25 +1298,25 @@ ULONG TextEngine::CalcTextWidth()
return mnCurTextWidth+1;// Ein breiter, da in CreateLines bei >= umgebrochen wird.
}
-ULONG TextEngine::CalcTextHeight()
+sal_uLong TextEngine::CalcTextHeight()
{
- DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: CalcTextHeight" );
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=sal_False nicht verwendet werden: CalcTextHeight" );
- ULONG nY = 0;
- for ( ULONG nPortion = mpTEParaPortions->Count(); nPortion; )
+ sal_uLong nY = 0;
+ for ( sal_uLong nPortion = mpTEParaPortions->Count(); nPortion; )
nY += CalcParaHeight( --nPortion );
return nY;
}
-ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen, const Font* pFont )
+sal_uLong TextEngine::CalcTextWidth( sal_uLong nPara, sal_uInt16 nPortionStart, sal_uInt16 nLen, const Font* pFont )
{
// Innerhalb des Textes darf es keinen Portionwechsel (Attribut/Tab) geben!
DBG_ASSERT( mpDoc->GetNodes().GetObject( nPara )->GetText().Search( '\t', nPortionStart ) >= (nPortionStart+nLen), "CalcTextWidth: Tab!" );
- ULONG nWidth;
+ sal_uLong nWidth;
if ( mnFixCharWidth100 )
{
- nWidth = (ULONG)nLen*mnFixCharWidth100/100;
+ nWidth = (sal_uLong)nLen*mnFixCharWidth100/100;
}
else
{
@@ -1332,14 +1332,14 @@ ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen,
mpRefDev->SetFont( aFont );
}
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
- nWidth = (ULONG)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen );
+ nWidth = (sal_uLong)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen );
}
return nWidth;
}
-USHORT TextEngine::GetLineCount( ULONG nParagraph ) const
+sal_uInt16 TextEngine::GetLineCount( sal_uLong nParagraph ) const
{
DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" );
@@ -1350,7 +1350,7 @@ USHORT TextEngine::GetLineCount( ULONG nParagraph ) const
return 0xFFFF;
}
-USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const
+sal_uInt16 TextEngine::GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const
{
DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" );
@@ -1364,9 +1364,9 @@ USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const
return 0xFFFF;
}
-ULONG TextEngine::CalcParaHeight( ULONG nParagraph ) const
+sal_uLong TextEngine::CalcParaHeight( sal_uLong nParagraph ) const
{
- ULONG nHeight = 0;
+ sal_uLong nHeight = 0;
TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph );
DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetParaHeight" );
@@ -1380,12 +1380,12 @@ void TextEngine::UpdateSelections()
{
}
-Range TextEngine::GetInvalidYOffsets( ULONG nPortion )
+Range TextEngine::GetInvalidYOffsets( sal_uLong nPortion )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion );
- USHORT nLines = pTEParaPortion->GetLines().Count();
- USHORT nLastInvalid, nFirstInvalid = 0;
- USHORT nLine;
+ sal_uInt16 nLines = pTEParaPortion->GetLines().Count();
+ sal_uInt16 nLastInvalid, nFirstInvalid = 0;
+ sal_uInt16 nLine;
for ( nLine = 0; nLine < nLines; nLine++ )
{
TextLine* pL = pTEParaPortion->GetLines().GetObject( nLine );
@@ -1409,12 +1409,12 @@ Range TextEngine::GetInvalidYOffsets( ULONG nPortion )
return Range( nFirstInvalid*mnCharHeight, ((nLastInvalid+1)*mnCharHeight)-1 );
}
-ULONG TextEngine::GetParagraphCount() const
+sal_uLong TextEngine::GetParagraphCount() const
{
return mpDoc->GetNodes().Count();
}
-void TextEngine::EnableUndo( BOOL bEnable )
+void TextEngine::EnableUndo( sal_Bool bEnable )
{
// Beim Umschalten des Modus Liste loeschen:
if ( bEnable != IsUndoEnabled() )
@@ -1423,14 +1423,14 @@ void TextEngine::EnableUndo( BOOL bEnable )
mbUndoEnabled = bEnable;
}
-SfxUndoManager& TextEngine::GetUndoManager()
+::svl::IUndoManager& TextEngine::GetUndoManager()
{
if ( !mpUndoManager )
mpUndoManager = new TextUndoManager( this );
return *mpUndoManager;
}
-void TextEngine::UndoActionStart( USHORT nId )
+void TextEngine::UndoActionStart( sal_uInt16 nId )
{
if ( IsUndoEnabled() && !IsInUndo() )
{
@@ -1440,13 +1440,13 @@ void TextEngine::UndoActionStart( USHORT nId )
}
}
-void TextEngine::UndoActionEnd( USHORT )
+void TextEngine::UndoActionEnd()
{
if ( IsUndoEnabled() && !IsInUndo() )
GetUndoManager().LeaveListAction();
}
-void TextEngine::InsertUndo( TextUndo* pUndo, BOOL bTryMerge )
+void TextEngine::InsertUndo( TextUndo* pUndo, sal_Bool bTryMerge )
{
DBG_ASSERT( !IsInUndo(), "InsertUndo im Undomodus!" );
GetUndoManager().AddUndoAction( pUndo, bTryMerge );
@@ -1458,7 +1458,7 @@ void TextEngine::ResetUndo()
mpUndoManager->Clear();
}
-void TextEngine::InsertContent( TextNode* pNode, ULONG nPara )
+void TextEngine::InsertContent( TextNode* pNode, sal_uLong nPara )
{
DBG_ASSERT( pNode, "NULL-Pointer in InsertContent! " );
DBG_ASSERT( IsInUndo(), "InsertContent nur fuer Undo()!" );
@@ -1468,7 +1468,7 @@ void TextEngine::InsertContent( TextNode* pNode, ULONG nPara )
ImpParagraphInserted( nPara );
}
-TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos )
+TextPaM TextEngine::SplitContent( sal_uLong nNode, sal_uInt16 nSepPos )
{
#ifdef DBG_UTIL
TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
@@ -1480,21 +1480,21 @@ TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos )
return ImpInsertParaBreak( aPaM );
}
-TextPaM TextEngine::ConnectContents( ULONG nLeftNode )
+TextPaM TextEngine::ConnectContents( sal_uLong nLeftNode )
{
DBG_ASSERT( IsInUndo(), "ConnectContent nur fuer Undo()!" );
return ImpConnectParagraphs( nLeftNode, nLeftNode+1 );
}
-void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice* pOutDev )
+void TextEngine::SeekCursor( sal_uLong nPara, sal_uInt16 nPos, Font& rFont, OutputDevice* pOutDev )
{
rFont = maFont;
if ( pOutDev )
pOutDev->SetTextColor( maTextColor );
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
- USHORT nAttribs = pNode->GetCharAttribs().Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ sal_uInt16 nAttribs = pNode->GetCharAttribs().Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr );
if ( pAttrib->GetStart() > nPos )
@@ -1542,7 +1542,7 @@ void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
rFont.SetColor( rStyleSettings.GetHighlightTextColor() );
rFont.SetFillColor( rStyleSettings.GetHighlightColor() );
- rFont.SetTransparent( FALSE );
+ rFont.SetTransparent( sal_False );
}
else if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE )
{
@@ -1553,9 +1553,9 @@ void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont, OutputDevice
}
}
-void TextEngine::SetUpdateMode( BOOL bUp, TextView* pCurView, BOOL bForceUpdate )
+void TextEngine::SetUpdateMode( sal_Bool bUp, TextView* pCurView, sal_Bool bForceUpdate )
{
- BOOL bChanged = ( GetUpdateMode() != bUp );
+ sal_Bool bChanged = ( GetUpdateMode() != bUp );
mbUpdate = bUp;
if ( mbUpdate && ( bChanged || bForceUpdate ) )
@@ -1577,15 +1577,15 @@ void TextEngine::FormatAndUpdate( TextView* pCurView )
}
-void TextEngine::IdleFormatAndUpdate( TextView* pCurView, USHORT nMaxTimerRestarts )
+void TextEngine::IdleFormatAndUpdate( TextView* pCurView, sal_uInt16 nMaxTimerRestarts )
{
mpIdleFormatter->DoIdleFormat( pCurView, nMaxTimerRestarts );
}
void TextEngine::TextModified()
{
- mbFormatted = FALSE;
- mbModified = TRUE;
+ mbFormatted = sal_False;
+ mbModified = sal_True;
}
void TextEngine::UpdateViews( TextView* pCurView )
@@ -1595,7 +1595,7 @@ void TextEngine::UpdateViews( TextView* pCurView )
DBG_ASSERT( IsFormatted(), "UpdateViews: Doc nicht formatiert!" );
- for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ for ( sal_uInt16 nView = 0; nView < mpViews->Count(); nView++ )
{
TextView* pView = mpViews->GetObject( nView );
pView->HideCursor();
@@ -1640,12 +1640,12 @@ void TextEngine::CheckIdleFormatter()
void TextEngine::FormatFullDoc()
{
- for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
+ for ( sal_uLong nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
{
- TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); USHORT nLen = pTEParaPortion->GetNode()->GetText().Len();
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion ); sal_uInt16 nLen = pTEParaPortion->GetNode()->GetText().Len();
pTEParaPortion->MarkSelectionInvalid( 0, nLen );
}
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
FormatDoc();
}
@@ -1654,26 +1654,26 @@ void TextEngine::FormatDoc()
if ( IsFormatted() || !GetUpdateMode() || IsFormatting() )
return;
- mbIsFormatting = TRUE;
- mbHasMultiLineParas = FALSE;
+ mbIsFormatting = sal_True;
+ mbHasMultiLineParas = sal_False;
long nY = 0;
- BOOL bGrow = FALSE;
+ sal_Bool bGrow = sal_False;
maInvalidRec = Rectangle(); // leermachen
- for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
+ for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
if ( pTEParaPortion->IsInvalid() )
{
- ULONG nOldParaWidth = 0xFFFFFFFF;
+ sal_uLong nOldParaWidth = 0xFFFFFFFF;
if ( mnCurTextWidth != 0xFFFFFFFF )
nOldParaWidth = CalcTextWidth( nPara );
ImpFormattingParagraph( nPara );
if ( CreateLines( nPara ) )
- bGrow = TRUE;
+ bGrow = sal_True;
// InvalidRec nur einmal setzen...
if ( maInvalidRec.IsEmpty() )
@@ -1693,7 +1693,7 @@ void TextEngine::FormatDoc()
if ( mnCurTextWidth != 0xFFFFFFFF )
{
- ULONG nNewParaWidth = CalcTextWidth( nPara );
+ sal_uLong nNewParaWidth = CalcTextWidth( nPara );
if ( nNewParaWidth >= mnCurTextWidth )
mnCurTextWidth = nNewParaWidth;
else if ( ( nOldParaWidth != 0xFFFFFFFF ) && ( nOldParaWidth >= mnCurTextWidth ) )
@@ -1706,12 +1706,12 @@ void TextEngine::FormatDoc()
}
nY += CalcParaHeight( nPara );
if ( !mbHasMultiLineParas && pTEParaPortion->GetLines().Count() > 1 )
- mbHasMultiLineParas = TRUE;
+ mbHasMultiLineParas = sal_True;
}
if ( !maInvalidRec.IsEmpty() )
{
- ULONG nNewHeight = CalcTextHeight();
+ sal_uLong nNewHeight = CalcTextHeight();
long nDiff = nNewHeight - mnCurTextHeight;
if ( nNewHeight < mnCurTextHeight )
{
@@ -1728,18 +1728,18 @@ void TextEngine::FormatDoc()
mnCurTextHeight = nNewHeight;
if ( nDiff )
{
- mbFormatted = TRUE;
+ mbFormatted = sal_True;
ImpTextHeightChanged();
}
}
- mbIsFormatting = FALSE;
- mbFormatted = TRUE;
+ mbIsFormatting = sal_False;
+ mbFormatted = sal_True;
ImpTextFormatted();
}
-void TextEngine::CreateAndInsertEmptyLine( ULONG nPara )
+void TextEngine::CreateAndInsertEmptyLine( sal_uLong nPara )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
@@ -1756,31 +1756,31 @@ void TextEngine::CreateAndInsertEmptyLine( ULONG nPara )
else
pTmpLine->SetStartX( mpDoc->GetLeftMargin() );
- BOOL bLineBreak = pNode->GetText().Len() ? TRUE : FALSE;
+ sal_Bool bLineBreak = pNode->GetText().Len() ? sal_True : sal_False;
TETextPortion* pDummyPortion = new TETextPortion( 0 );
pDummyPortion->GetWidth() = 0;
pTEParaPortion->GetTextPortions().Insert( pDummyPortion, pTEParaPortion->GetTextPortions().Count() );
- if ( bLineBreak == TRUE )
+ if ( bLineBreak == sal_True )
{
// -2: Die neue ist bereits eingefuegt.
#ifdef DBG_UTIL
TextLine* pLastLine = pTEParaPortion->GetLines().GetObject( pTEParaPortion->GetLines().Count()-2 );
DBG_ASSERT( pLastLine, "Weicher Umbruch, keine Zeile ?!" );
#endif
- USHORT nPos = (USHORT) pTEParaPortion->GetTextPortions().Count() - 1 ;
+ sal_uInt16 nPos = (sal_uInt16) pTEParaPortion->GetTextPortions().Count() - 1 ;
pTmpLine->SetStartPortion( nPos );
pTmpLine->SetEndPortion( nPos );
}
}
-void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USHORT nPortionStart, long nRemainingWidth )
+void TextEngine::ImpBreakLine( sal_uLong nPara, TextLine* pLine, TETextPortion*, sal_uInt16 nPortionStart, long nRemainingWidth )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
// Font sollte noch eingestellt sein.
- USHORT nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart );
+ sal_uInt16 nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart );
DBG_ASSERT( nMaxBreakPos < pNode->GetText().Len(), "Break?!" );
@@ -1799,7 +1799,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH
static const com::sun::star::lang::Locale aDefLocale;
i18n::LineBreakResults aLBR = xBI->getLineBreak( pNode->GetText(), nMaxBreakPos, aDefLocale, pLine->GetStart(), aHyphOptions, aUserOptions );
- USHORT nBreakPos = (USHORT)aLBR.breakIndex;
+ sal_uInt16 nBreakPos = (sal_uInt16)aLBR.breakIndex;
if ( nBreakPos <= pLine->GetStart() )
{
nBreakPos = nMaxBreakPos;
@@ -1810,7 +1810,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH
// die angeknackste Portion ist die End-Portion
pLine->SetEnd( nBreakPos );
- USHORT nEndPortion = SplitTextPortion( nPara, nBreakPos );
+ sal_uInt16 nEndPortion = SplitTextPortion( nPara, nBreakPos );
sal_Bool bBlankSeparator = ( ( nBreakPos >= pLine->GetStart() ) &&
( pNode->GetText().GetChar( nBreakPos ) == ' ' ) ) ? sal_True : sal_False;
@@ -1825,7 +1825,7 @@ void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TETextPortion*, USH
pLine->SetEndPortion( nEndPortion );
}
-USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
+sal_uInt16 TextEngine::SplitTextPortion( sal_uLong nPara, sal_uInt16 nPos )
{
// Die Portion bei nPos wird geplittet, wenn bei nPos nicht
@@ -1833,11 +1833,11 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
if ( nPos == 0 )
return 0;
- USHORT nSplitPortion;
- USHORT nTmpPos = 0;
+ sal_uInt16 nSplitPortion;
+ sal_uInt16 nTmpPos = 0;
TETextPortion* pTextPortion = 0;
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
+ sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count();
for ( nSplitPortion = 0; nSplitPortion < nPortions; nSplitPortion++ )
{
TETextPortion* pTP = pTEParaPortion->GetTextPortions().GetObject(nSplitPortion);
@@ -1853,7 +1853,7 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
DBG_ASSERT( pTextPortion, "Position ausserhalb des Bereichs!" );
- USHORT nOverlapp = nTmpPos - nPos;
+ sal_uInt16 nOverlapp = nTmpPos - nPos;
pTextPortion->GetLen() = pTextPortion->GetLen() - nOverlapp;
TETextPortion* pNewPortion = new TETextPortion( nOverlapp );
pTEParaPortion->GetTextPortions().Insert( pNewPortion, nSplitPortion+1 );
@@ -1862,18 +1862,18 @@ USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
return nSplitPortion;
}
-void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
+void TextEngine::CreateTextPortions( sal_uLong nPara, sal_uInt16 nStartPos )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
TextNode* pNode = pTEParaPortion->GetNode();
DBG_ASSERT( pNode->GetText().Len(), "CreateTextPortions sollte nicht fuer leere Absaetze verwendet werden!" );
TESortedPositions aPositions;
- ULONG nZero = 0;
+ sal_uLong nZero = 0;
aPositions.Insert( nZero );
- USHORT nAttribs = pNode->GetCharAttribs().Count();
- for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ sal_uInt16 nAttribs = pNode->GetCharAttribs().Count();
+ for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ )
{
TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr );
@@ -1885,7 +1885,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
aPositions.Insert( pNode->GetText().Len() );
const TEWritingDirectionInfos& rWritingDirections = pTEParaPortion->GetWritingDirectionInfos();
- for ( USHORT nD = 0; nD < rWritingDirections.Count(); nD++ )
+ for ( sal_uInt16 nD = 0; nD < rWritingDirections.Count(); nD++ )
aPositions.Insert( rWritingDirections[nD].nStartPos );
if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetPara() == nPara ) )
@@ -1901,7 +1901,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
}
}
- USHORT nTabPos = pNode->GetText().Search( '\t', 0 );
+ sal_uInt16 nTabPos = pNode->GetText().Search( '\t', 0 );
while ( nTabPos != STRING_NOTFOUND )
{
aPositions.Insert( nTabPos );
@@ -1912,9 +1912,9 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
// Ab ... loeschen:
// Leider muss die Anzahl der TextPortions mit aPositions.Count()
// nicht uebereinstimmen, da evtl. Zeilenumbrueche...
- USHORT nPortionStart = 0;
- USHORT nInvPortion = 0;
- USHORT nP;
+ sal_uInt16 nPortionStart = 0;
+ sal_uInt16 nInvPortion = 0;
+ sal_uInt16 nP;
for ( nP = 0; nP < pTEParaPortion->GetTextPortions().Count(); nP++ )
{
TETextPortion* pTmpPortion = pTEParaPortion->GetTextPortions().GetObject(nP);
@@ -1940,15 +1940,15 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
// Eine Portion kann auch durch einen Zeilenumbruch entstanden sein:
aPositions.Insert( nPortionStart );
- USHORT nInvPos;
+ sal_uInt16 nInvPos;
#ifdef DBG_UTIL
- BOOL bFound =
+ sal_Bool bFound =
#endif
aPositions.Seek_Entry( nPortionStart, &nInvPos );
DBG_ASSERT( bFound && ( nInvPos < (aPositions.Count()-1) ), "InvPos ?!" );
- for ( USHORT i = nInvPos+1; i < aPositions.Count(); i++ )
+ for ( sal_uInt16 i = nInvPos+1; i < aPositions.Count(); i++ )
{
- TETextPortion* pNew = new TETextPortion( (USHORT)aPositions[i] - (USHORT)aPositions[i-1] );
+ TETextPortion* pNew = new TETextPortion( (sal_uInt16)aPositions[i] - (sal_uInt16)aPositions[i-1] );
pTEParaPortion->GetTextPortions().Insert( pNew, pTEParaPortion->GetTextPortions().Count());
}
@@ -1958,7 +1958,7 @@ void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
#endif
}
-void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewChars )
+void TextEngine::RecalcTextPortion( sal_uLong nPara, sal_uInt16 nStartPos, short nNewChars )
{
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine Portions!" );
@@ -1976,7 +1976,7 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
( nStartPos && ( pNode->GetText().GetChar( nStartPos - 1 ) == '\t' ) ) ||
( ( !nStartPos && ( nNewChars < pNode->GetText().Len() ) && pNode->GetText().GetChar( nNewChars ) == '\t' ) ) )
{
- USHORT nNewPortionPos = 0;
+ sal_uInt16 nNewPortionPos = 0;
if ( nStartPos )
nNewPortionPos = SplitTextPortion( nPara, nStartPos ) + 1;
// else if ( ( pTEParaPortion->GetTextPortions().Count() == 1 ) &&
@@ -1989,7 +1989,7 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
!pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen() )
{
// Dann die leere Portion verwenden.
- USHORT & r =
+ sal_uInt16 & r =
pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen();
r = r + nNewChars;
}
@@ -2001,8 +2001,8 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
}
else
{
- USHORT nPortionStart;
- const USHORT nTP = pTEParaPortion->GetTextPortions().
+ sal_uInt16 nPortionStart;
+ const sal_uInt16 nTP = pTEParaPortion->GetTextPortions().
FindPortion( nStartPos, nPortionStart );
TETextPortion* const pTP = pTEParaPortion->GetTextPortions()[ nTP ];
DBG_ASSERT( pTP, "RecalcTextPortion: Portion nicht gefunden" );
@@ -2018,10 +2018,10 @@ void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewCha
// Es darf keine reinragende oder im Bereich startende Portion geben,
// also muss nStartPos <= nPos <= nStartPos - nNewChars(neg.) sein
- USHORT nPortion = 0;
- USHORT nPos = 0;
- USHORT nEnd = nStartPos-nNewChars;
- USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
+ sal_uInt16 nPortion = 0;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nEnd = nStartPos-nNewChars;
+ sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count();
TETextPortion* pTP = 0;
for ( nPortion = 0; nPortion < nPortions; nPortion++ )
{
@@ -2072,7 +2072,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
TextPaM const* pSelEnd = 0;
if ( pSelection && pSelection->HasRange() )
{
- BOOL bInvers = pSelection->GetEnd() < pSelection->GetStart();
+ sal_Bool bInvers = pSelection->GetEnd() < pSelection->GetStart();
pSelStart = !bInvers ? &pSelection->GetStart() : &pSelection->GetEnd();
pSelEnd = bInvers ? &pSelection->GetStart() : &pSelection->GetEnd();
}
@@ -2083,23 +2083,23 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
// --------------------------------------------------
// Ueber alle Absaetze...
// --------------------------------------------------
- for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
+ for ( sal_uLong nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
// falls beim Tippen Idle-Formatierung, asynchrones Paint.
if ( pPortion->IsInvalid() )
return;
- ULONG nParaHeight = CalcParaHeight( nPara );
+ sal_uLong nParaHeight = CalcParaHeight( nPara );
if ( ( !pPaintArea || ( ( nY + (long)nParaHeight ) > pPaintArea->Top() ) )
&& ( !pPaintRange || ( ( nPara >= pPaintRange->GetStart().GetPara() ) && ( nPara <= pPaintRange->GetEnd().GetPara() ) ) ) )
{
// --------------------------------------------------
// Ueber die Zeilen des Absatzes...
// --------------------------------------------------
- USHORT nLines = pPortion->GetLines().Count();
+ sal_uInt16 nLines = pPortion->GetLines().Count();
USHORT nIndex = 0;
- for ( USHORT nLine = 0; nLine < nLines; nLine++ )
+ for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ )
{
TextLine* pLine = pPortion->GetLines().GetObject(nLine);
Point aTmpPos( rStartPos.X() + pLine->GetStartX(), nY );
@@ -2113,7 +2113,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
// Ueber die Portions der Zeile...
// --------------------------------------------------
nIndex = pLine->GetStart();
- for ( USHORT y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ )
+ for ( sal_uInt16 y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ )
{
DBG_ASSERT( pPortion->GetTextPortions().Count(), "Zeile ohne Textportion im Paint!" );
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( y );
@@ -2138,13 +2138,13 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
Font aFont;
SeekCursor( nPara, nIndex+1, aFont, pOutDev );
if( bTransparent )
- aFont.SetTransparent( TRUE );
+ aFont.SetTransparent( sal_True );
else if ( pSelection )
- aFont.SetTransparent( FALSE );
+ aFont.SetTransparent( sal_False );
pOutDev->SetFont( aFont );
- USHORT nTmpIndex = nIndex;
- USHORT nEnd = nTmpIndex + pTextPortion->GetLen();
+ sal_uInt16 nTmpIndex = nIndex;
+ sal_uInt16 nEnd = nTmpIndex + pTextPortion->GetLen();
Point aPos = aTmpPos;
if ( pPaintRange )
{
@@ -2161,7 +2161,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
}
}
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( pSelStart )
{
// liegt ein Teil in der Selektion???
@@ -2169,7 +2169,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
TextPaM aTextEnd( nPara, nEnd );
if ( ( aTextStart < *pSelEnd ) && ( aTextEnd > *pSelStart ) )
{
- USHORT nL;
+ sal_uInt16 nL;
// 1) Bereich vor Selektion
if ( aTextStart < *pSelStart )
@@ -2204,7 +2204,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, pLine, nTmpIndex, nTmpIndex+nL );
pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex );
}
- bDone = TRUE;
+ bDone = sal_True;
}
}
if ( !bDone )
@@ -2222,7 +2222,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
if ( pSelStart || pPaintRange )
{
Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) );
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
if ( pSelStart )
{
// liegt der Tab in der Selektion???
@@ -2234,7 +2234,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
pOutDev->SetFillColor( rStyleSettings.GetHighlightColor() );
pOutDev->DrawRect( aTabArea );
pOutDev->SetFillColor( aOldColor );
- bDone = TRUE;
+ bDone = sal_True;
}
}
if ( !bDone )
@@ -2275,15 +2275,15 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan
}
}
-BOOL TextEngine::CreateLines( ULONG nPara )
+sal_Bool TextEngine::CreateLines( sal_uLong nPara )
{
- // BOOL: Aenderung der Hoehe des Absatzes Ja/Nein - TRUE/FALSE
+ // sal_Bool: Aenderung der Hoehe des Absatzes Ja/Nein - sal_True/sal_False
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
DBG_ASSERT( pTEParaPortion->IsInvalid(), "CreateLines: Portion nicht invalid!" );
- USHORT nOldLineCount = pTEParaPortion->GetLines().Count();
+ sal_uInt16 nOldLineCount = pTEParaPortion->GetLines().Count();
// ---------------------------------------------------------------
// Schnelle Sonderbehandlung fuer leere Absaetze...
@@ -2311,9 +2311,9 @@ BOOL TextEngine::CreateLines( ULONG nPara )
}
const short nInvalidDiff = pTEParaPortion->GetInvalidDiff();
- const USHORT nInvalidStart = pTEParaPortion->GetInvalidPosStart();
- const USHORT nInvalidEnd = nInvalidStart + Abs( nInvalidDiff );
- BOOL bQuickFormat = FALSE;
+ const sal_uInt16 nInvalidStart = pTEParaPortion->GetInvalidPosStart();
+ const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff );
+ sal_Bool bQuickFormat = sal_False;
if ( !pTEParaPortion->GetWritingDirectionInfos().Count() )
ImpInitWritingDirections( nPara );
@@ -2322,24 +2322,24 @@ BOOL TextEngine::CreateLines( ULONG nPara )
{
if ( pTEParaPortion->IsSimpleInvalid() && ( nInvalidDiff > 0 ) )
{
- bQuickFormat = TRUE;
+ bQuickFormat = sal_True;
}
else if ( ( pTEParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) )
{
// pruefen, ob loeschen ueber Portiongrenzen erfolgte...
- USHORT nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!!
- USHORT nEnd = nStart - nInvalidDiff; // neg.
- bQuickFormat = TRUE;
- USHORT nPos = 0;
- USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
- for ( USHORT nTP = 0; nTP < nPortions; nTP++ )
+ sal_uInt16 nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!!
+ sal_uInt16 nEnd = nStart - nInvalidDiff; // neg.
+ bQuickFormat = sal_True;
+ sal_uInt16 nPos = 0;
+ sal_uInt16 nPortions = pTEParaPortion->GetTextPortions().Count();
+ for ( sal_uInt16 nTP = 0; nTP < nPortions; nTP++ )
{
// Es darf kein Start/Ende im geloeschten Bereich liegen.
TETextPortion* const pTP = pTEParaPortion->GetTextPortions().GetObject( nTP );
nPos = nPos + pTP->GetLen();
if ( ( nPos > nStart ) && ( nPos < nEnd ) )
{
- bQuickFormat = FALSE;
+ bQuickFormat = sal_False;
break;
}
}
@@ -2356,8 +2356,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// Zeilen flaggen => nicht removen !
// ---------------------------------------------------------------
- USHORT nLine = pTEParaPortion->GetLines().Count()-1;
- for ( USHORT nL = 0; nL <= nLine; nL++ )
+ sal_uInt16 nLine = pTEParaPortion->GetLines().Count()-1;
+ for ( sal_uInt16 nL = 0; nL <= nLine; nL++ )
{
TextLine* pLine = pTEParaPortion->GetLines().GetObject( nL );
if ( pLine->GetEnd() > nInvalidStart )
@@ -2377,24 +2377,24 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// ---------------------------------------------------------------
// Ab hier alle Zeilen durchformatieren...
// ---------------------------------------------------------------
- USHORT nDelFromLine = 0xFFFF;
- BOOL bLineBreak = FALSE;
+ sal_uInt16 nDelFromLine = 0xFFFF;
+ sal_Bool bLineBreak = sal_False;
- USHORT nIndex = pLine->GetStart();
+ sal_uInt16 nIndex = pLine->GetStart();
TextLine aSaveLine( *pLine );
Font aFont;
- BOOL bCalcPortion = TRUE;
+ sal_Bool bCalcPortion = sal_True;
while ( nIndex < pNode->GetText().Len() )
{
- BOOL bEOL = FALSE;
- USHORT nPortionStart = 0;
- USHORT nPortionEnd = 0;
+ sal_Bool bEOL = sal_False;
+ sal_uInt16 nPortionStart = 0;
+ sal_uInt16 nPortionEnd = 0;
- USHORT nTmpPos = nIndex;
- USHORT nTmpPortion = pLine->GetStartPortion();
+ sal_uInt16 nTmpPos = nIndex;
+ sal_uInt16 nTmpPortion = pLine->GetStartPortion();
long nTmpWidth = mpDoc->GetLeftMargin();
// long nXWidth = mnMaxTextWidth ? ( mnMaxTextWidth - mpDoc->GetLeftMargin() ) : 0x7FFFFFFF;
// Margin nicht abziehen, ist schon in TmpWidth enthalten.
@@ -2404,8 +2404,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// Portion suchen, die nicht mehr in Zeile passt....
TETextPortion* pPortion = 0;
- BOOL bBrokenLine = FALSE;
- bLineBreak = FALSE;
+ sal_Bool bBrokenLine = sal_False;
+ bLineBreak = sal_False;
while ( ( nTmpWidth <= nXWidth ) && !bEOL && ( nTmpPortion < pTEParaPortion->GetTextPortions().Count() ) )
{
@@ -2424,8 +2424,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// Aber was jetzt ? Tab passend machen!
pPortion->GetWidth() = nXWidth-1;
nTmpWidth = pPortion->GetWidth();
- bEOL = TRUE;
- bBrokenLine = TRUE;
+ bEOL = sal_True;
+ bBrokenLine = sal_True;
}
pPortion->GetKind() = PORTIONKIND_TAB;
}
@@ -2446,28 +2446,28 @@ BOOL TextEngine::CreateLines( ULONG nPara )
}
// das war evtl. eine Portion zu weit:
- BOOL bFixedEnd = FALSE;
+ sal_Bool bFixedEnd = sal_False;
if ( nTmpWidth > nXWidth )
{
nPortionEnd = nTmpPos;
nTmpPos = nTmpPos - pPortion->GetLen();
nPortionStart = nTmpPos;
nTmpPortion--;
- bEOL = FALSE;
+ bEOL = sal_False;
nTmpWidth -= pPortion->GetWidth();
if ( pPortion->GetKind() == PORTIONKIND_TAB )
{
- bEOL = TRUE;
- bFixedEnd = TRUE;
+ bEOL = sal_True;
+ bFixedEnd = sal_True;
}
}
else
{
- bEOL = TRUE;
+ bEOL = sal_True;
pLine->SetEnd( nPortionEnd );
DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine TextPortions?" );
- pLine->SetEndPortion( (USHORT)pTEParaPortion->GetTextPortions().Count() - 1 );
+ pLine->SetEndPortion( (sal_uInt16)pTEParaPortion->GetTextPortions().Count() - 1 );
}
if ( bFixedEnd )
@@ -2491,7 +2491,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
{
// Ausrichten...
long nTextWidth = 0;
- for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
+ for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
{
TETextPortion* pTextPortion = pTEParaPortion->GetTextPortions().GetObject( nTP );
nTextWidth += pTextPortion->GetWidth();
@@ -2500,9 +2500,9 @@ BOOL TextEngine::CreateLines( ULONG nPara )
if ( nSpace > 0 )
{
if ( ImpGetAlign() == TXTALIGN_CENTER )
- pLine->SetStartX( (USHORT)(nSpace / 2) );
+ pLine->SetStartX( (sal_uInt16)(nSpace / 2) );
else // TXTALIGN_RIGHT
- pLine->SetStartX( (USHORT)nSpace );
+ pLine->SetStartX( (sal_uInt16)nSpace );
}
}
else
@@ -2531,8 +2531,8 @@ BOOL TextEngine::CreateLines( ULONG nPara )
}
else
{
- USHORT nStart = pLine->GetStart();
- USHORT nEnd = pLine->GetEnd();
+ sal_uInt16 nStart = pLine->GetStart();
+ sal_uInt16 nEnd = pLine->GetEnd();
if ( nStart > nInvalidEnd )
{
@@ -2542,7 +2542,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
pLine->SetValid();
if ( bCalcPortion && bQuickFormat )
{
- bCalcPortion = FALSE;
+ bCalcPortion = sal_False;
pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine );
break;
}
@@ -2556,7 +2556,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
// textbreiten neu bestimmen:
if ( nEnd == ( aSaveLine.GetEnd() + nInvalidDiff ) )
{
- bCalcPortion = FALSE;
+ bCalcPortion = sal_False;
pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine );
break;
}
@@ -2567,7 +2567,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
nIndex = pLine->GetEnd(); // naechste Zeile Start = letzte Zeile Ende
// weil nEnd hinter das letzte Zeichen zeigt!
- USHORT nEndPortion = pLine->GetEndPortion();
+ sal_uInt16 nEndPortion = pLine->GetEndPortion();
// Naechste Zeile oder ggf. neue Zeile....
pLine = 0;
@@ -2598,7 +2598,7 @@ BOOL TextEngine::CreateLines( ULONG nPara )
DBG_ASSERT( pTEParaPortion->GetLines().Count(), "Keine Zeile nach CreateLines!" );
- if ( bLineBreak == TRUE )
+ if ( bLineBreak == sal_True )
CreateAndInsertEmptyLine( nPara );
pTEParaPortion->SetValid();
@@ -2615,8 +2615,8 @@ String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord )
TextNode* pNode = mpDoc->GetNodes().GetObject( rCursorPos.GetPara() );
uno::Reference < i18n::XBreakIterator > xBI = GetBreakIterator();
i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rCursorPos.GetIndex(), GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
- aSel.GetStart().GetIndex() = (USHORT)aBoundary.startPos;
- aSel.GetEnd().GetIndex() = (USHORT)aBoundary.endPos;
+ aSel.GetStart().GetIndex() = (sal_uInt16)aBoundary.startPos;
+ aSel.GetEnd().GetIndex() = (sal_uInt16)aBoundary.endPos;
aWord = pNode->GetText().Copy( aSel.GetStart().GetIndex(), aSel.GetEnd().GetIndex() - aSel.GetStart().GetIndex() );
if ( pStartOfWord )
*pStartOfWord = aSel.GetStart();
@@ -2624,18 +2624,18 @@ String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord )
return aWord;
}
-BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
+sal_Bool TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
{
- BOOL bUpdate = GetUpdateMode();
- SetUpdateMode( FALSE );
+ sal_Bool bUpdate = GetUpdateMode();
+ SetUpdateMode( sal_False );
- UndoActionStart( TEXTUNDO_READ );
+ UndoActionStart();
TextSelection aSel;
if ( pSel )
aSel = *pSel;
else
{
- ULONG nParas = mpDoc->GetNodes().Count();
+ sal_uLong nParas = mpDoc->GetNodes().Count();
TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 );
aSel = TextPaM( nParas-1 , pNode->GetText().Len() );
}
@@ -2644,7 +2644,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
aSel = ImpDeleteText( aSel );
ByteString aLine;
- BOOL bDone = rInput.ReadLine( aLine );
+ sal_Bool bDone = rInput.ReadLine( aLine );
String aTmpStr( aLine, rInput.GetStreamCharSet() ), aStr;
while ( bDone )
{
@@ -2655,7 +2655,7 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
aSel = ImpInsertParaBreak( aSel.GetEnd() );
}
- UndoActionEnd( TEXTUNDO_READ );
+ UndoActionEnd();
TextSelection aNewSel( aSel.GetEnd(), aSel.GetEnd() );
@@ -2666,17 +2666,17 @@ BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
SetUpdateMode( bUpdate );
FormatAndUpdate( GetActiveView() );
- return rInput.GetError() ? FALSE : TRUE;
+ return rInput.GetError() ? sal_False : sal_True;
}
-BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML )
+sal_Bool TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, sal_Bool bHTML )
{
TextSelection aSel;
if ( pSel )
aSel = *pSel;
else
{
- ULONG nParas = mpDoc->GetNodes().Count();
+ sal_uLong nParas = mpDoc->GetNodes().Count();
TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 );
aSel.GetStart() = TextPaM( 0, 0 );
aSel.GetEnd() = TextPaM( nParas-1, pNode->GetText().Len() );
@@ -2688,12 +2688,12 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML
rOutput.WriteLine( "<BODY>" );
}
- for ( ULONG nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ )
+ for ( sal_uLong nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
- USHORT nStartPos = 0;
- USHORT nEndPos = pNode->GetText().Len();
+ sal_uInt16 nStartPos = 0;
+ sal_uInt16 nEndPos = pNode->GetText().Len();
if ( nPara == aSel.GetStart().GetPara() )
nStartPos = aSel.GetStart().GetIndex();
if ( nPara == aSel.GetEnd().GetPara() )
@@ -2715,8 +2715,8 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML
}
else
{
- USHORT nTmpStart = nStartPos;
- USHORT nTmpEnd = nEndPos;
+ sal_uInt16 nTmpStart = nStartPos;
+ sal_uInt16 nTmpEnd = nEndPos;
do
{
TextCharAttrib* pAttr = pNode->GetCharAttribs().FindNextAttrib( TEXTATTR_HYPERLINK, nTmpStart, nEndPos );
@@ -2753,22 +2753,22 @@ BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML
rOutput.WriteLine( "</HTML>" );
}
- return rOutput.GetError() ? FALSE : TRUE;
+ return rOutput.GetError() ? sal_False : sal_True;
}
-void TextEngine::RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate )
+void TextEngine::RemoveAttribs( sal_uLong nPara, sal_Bool bIdleFormatAndUpdate )
{
if ( nPara < mpDoc->GetNodes().Count() )
{
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
if ( pNode->GetCharAttribs().Count() )
{
- pNode->GetCharAttribs().Clear( TRUE );
+ pNode->GetCharAttribs().Clear( sal_True );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
if ( bIdleFormatAndUpdate )
IdleFormatAndUpdate( NULL, 0xFFFF );
@@ -2777,7 +2777,7 @@ void TextEngine::RemoveAttribs( ULONG nPara, BOOL bIdleFormatAndUpdate )
}
}
}
-void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndUpdate )
+void TextEngine::RemoveAttribs( sal_uLong nPara, sal_uInt16 nWhich, sal_Bool bIdleFormatAndUpdate )
{
if ( nPara < mpDoc->GetNodes().Count() )
{
@@ -2785,15 +2785,15 @@ void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndU
if ( pNode->GetCharAttribs().Count() )
{
TextCharAttribList& rAttribs = pNode->GetCharAttribs();
- USHORT nAttrCount = rAttribs.Count();
- for(USHORT nAttr = nAttrCount; nAttr; --nAttr)
+ sal_uInt16 nAttrCount = rAttribs.Count();
+ for(sal_uInt16 nAttr = nAttrCount; nAttr; --nAttr)
{
if(rAttribs.GetAttrib( nAttr - 1 )->Which() == nWhich)
rAttribs.RemoveAttrib( nAttr -1 );
}
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
if(bIdleFormatAndUpdate)
IdleFormatAndUpdate( NULL, 0xFFFF );
else
@@ -2801,7 +2801,7 @@ void TextEngine::RemoveAttribs( ULONG nPara, USHORT nWhich, BOOL bIdleFormatAndU
}
}
}
-void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib )
+void TextEngine::RemoveAttrib( sal_uLong nPara, const TextCharAttrib& rAttrib )
{
if ( nPara < mpDoc->GetNodes().Count() )
{
@@ -2809,8 +2809,8 @@ void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib )
if ( pNode->GetCharAttribs().Count() )
{
TextCharAttribList& rAttribs = pNode->GetCharAttribs();
- USHORT nAttrCount = rAttribs.Count();
- for(USHORT nAttr = nAttrCount; nAttr; --nAttr)
+ sal_uInt16 nAttrCount = rAttribs.Count();
+ for(sal_uInt16 nAttr = nAttrCount; nAttr; --nAttr)
{
if(rAttribs.GetAttrib( nAttr - 1 ) == &rAttrib)
{
@@ -2820,13 +2820,13 @@ void TextEngine::RemoveAttrib( ULONG nPara, const TextCharAttrib& rAttrib )
}
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
FormatAndUpdate( NULL );
}
}
}
-void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd, BOOL bIdleFormatAndUpdate )
+void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uLong nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_Bool bIdleFormatAndUpdate )
{
// Es wird hier erstmal nicht geprueft, ob sich Attribute ueberlappen!
// Diese Methode ist erstmal nur fuer einen Editor, der fuer eine Zeile
@@ -2840,7 +2840,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart,
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nMax = pNode->GetText().Len();
+ sal_uInt16 nMax = pNode->GetText().Len();
if ( nStart > nMax )
nStart = nMax;
if ( nEnd > nMax )
@@ -2849,7 +2849,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart,
pNode->GetCharAttribs().InsertAttrib( new TextCharAttrib( rAttr, nStart, nEnd ) );
pTEParaPortion->MarkSelectionInvalid( nStart, nEnd );
- mbFormatted = FALSE;
+ mbFormatted = sal_False;
if ( bIdleFormatAndUpdate )
IdleFormatAndUpdate( NULL, 0xFFFF );
else
@@ -2876,14 +2876,14 @@ void TextEngine::ValidateSelection( TextSelection& rSel ) const
void TextEngine::ValidatePaM( TextPaM& rPaM ) const
{
- ULONG nMaxPara = mpDoc->GetNodes().Count() - 1;
+ sal_uLong nMaxPara = mpDoc->GetNodes().Count() - 1;
if ( rPaM.GetPara() > nMaxPara )
{
rPaM.GetPara() = nMaxPara;
rPaM.GetIndex() = 0xFFFF;
}
- USHORT nMaxIndex = GetTextLen( rPaM.GetPara() );
+ sal_uInt16 nMaxIndex = GetTextLen( rPaM.GetPara() );
if ( rPaM.GetIndex() > nMaxIndex )
rPaM.GetIndex() = nMaxIndex;
}
@@ -2891,18 +2891,18 @@ void TextEngine::ValidatePaM( TextPaM& rPaM ) const
// Status & Selektionsanpassung
-void TextEngine::ImpParagraphInserted( ULONG nPara )
+void TextEngine::ImpParagraphInserted( sal_uLong nPara )
{
// Die aktive View braucht nicht angepasst werden, aber bei allen
// passiven muss die Selektion angepasst werden:
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
{
-// BOOL bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart();
+// sal_Bool bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart();
// TextPaM& rMin = !bInvers ? pView->maSelection.GetStart(): pView->maSelection.GetEnd();
// TextPaM& rMax = bInvers ? pView->maSelection.GetStart() : pView->maSelection.GetEnd();
//
@@ -2922,16 +2922,16 @@ void TextEngine::ImpParagraphInserted( ULONG nPara )
Broadcast( TextHint( TEXT_HINT_PARAINSERTED, nPara ) );
}
-void TextEngine::ImpParagraphRemoved( ULONG nPara )
+void TextEngine::ImpParagraphRemoved( sal_uLong nPara )
{
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
{
- ULONG nParas = mpDoc->GetNodes().Count();
+ sal_uLong nParas = mpDoc->GetNodes().Count();
for ( int n = 0; n <= 1; n++ )
{
TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd();
@@ -2950,16 +2950,16 @@ void TextEngine::ImpParagraphRemoved( ULONG nPara )
Broadcast( TextHint( TEXT_HINT_PARAREMOVED, nPara ) );
}
-void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars )
+void TextEngine::ImpCharsRemoved( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars )
{
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
{
- USHORT nEnd = nPos+nChars;
+ sal_uInt16 nEnd = nPos+nChars;
for ( int n = 0; n <= 1; n++ )
{
TextPaM& rPaM = n ? pView->GetSelection().GetStart(): pView->GetSelection().GetEnd();
@@ -2977,11 +2977,11 @@ void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars )
Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) );
}
-void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars )
+void TextEngine::ImpCharsInserted( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16 nChars )
{
if ( mpViews->Count() > 1 )
{
- for ( USHORT nView = mpViews->Count(); nView; )
+ for ( sal_uInt16 nView = mpViews->Count(); nView; )
{
TextView* pView = mpViews->GetObject( --nView );
if ( pView != GetActiveView() )
@@ -3001,7 +3001,7 @@ void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars )
Broadcast( TextHint( TEXT_HINT_PARACONTENTCHANGED, nPara ) );
}
-void TextEngine::ImpFormattingParagraph( ULONG nPara )
+void TextEngine::ImpFormattingParagraph( sal_uLong nPara )
{
Broadcast( TextHint( TEXT_HINT_FORMATPARA, nPara ) );
}
@@ -3021,12 +3021,12 @@ void TextEngine::Draw( OutputDevice* pDev, const Point& rPos )
ImpPaint( pDev, rPos, NULL );
}
-void TextEngine::SetLeftMargin( USHORT n )
+void TextEngine::SetLeftMargin( sal_uInt16 n )
{
mpDoc->SetLeftMargin( n );
}
-USHORT TextEngine::GetLeftMargin() const
+sal_uInt16 TextEngine::GetLeftMargin() const
{
return mpDoc->GetLeftMargin();
}
@@ -3063,7 +3063,7 @@ LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper()
return mpLocaleDataWrapper;
}
-void TextEngine::SetRightToLeft( BOOL bR2L )
+void TextEngine::SetRightToLeft( sal_Bool bR2L )
{
if ( mbRightToLeft != bR2L )
{
@@ -3074,7 +3074,7 @@ void TextEngine::SetRightToLeft( BOOL bR2L )
}
}
-void TextEngine::ImpInitWritingDirections( ULONG nPara )
+void TextEngine::ImpInitWritingDirections( sal_uLong nPara )
{
TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara );
TEWritingDirectionInfos& rInfos = pParaPortion->GetWritingDirectionInfos();
@@ -3101,10 +3101,10 @@ void TextEngine::ImpInitWritingDirections( ULONG nPara )
int32_t nEnd;
UBiDiLevel nCurrDir;
- for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx )
+ for ( sal_uInt16 nIdx = 0; nIdx < nCount; ++nIdx )
{
ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir );
- rInfos.Insert( TEWritingDirectionInfo( nCurrDir, (USHORT)nStart, (USHORT)nEnd ), rInfos.Count() );
+ rInfos.Insert( TEWritingDirectionInfo( nCurrDir, (sal_uInt16)nStart, (sal_uInt16)nEnd ), rInfos.Count() );
nStart = nEnd;
}
@@ -3113,13 +3113,13 @@ void TextEngine::ImpInitWritingDirections( ULONG nPara )
// No infos mean no CTL and default dir is L2R...
if ( !rInfos.Count() )
- rInfos.Insert( TEWritingDirectionInfo( 0, 0, (USHORT)pParaPortion->GetNode()->GetText().Len() ), rInfos.Count() );
+ rInfos.Insert( TEWritingDirectionInfo( 0, 0, (sal_uInt16)pParaPortion->GetNode()->GetText().Len() ), rInfos.Count() );
}
-BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, USHORT* pEnd )
+sal_uInt8 TextEngine::ImpGetRightToLeft( sal_uLong nPara, sal_uInt16 nPos, sal_uInt16* pStart, sal_uInt16* pEnd )
{
- BYTE nRightToLeft = 0;
+ sal_uInt8 nRightToLeft = 0;
TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
if ( pNode && pNode->GetText().Len() )
@@ -3129,7 +3129,7 @@ BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, US
ImpInitWritingDirections( nPara );
TEWritingDirectionInfos& rDirInfos = pParaPortion->GetWritingDirectionInfos();
- for ( USHORT n = 0; n < rDirInfos.Count(); n++ )
+ for ( sal_uInt16 n = 0; n < rDirInfos.Count(); n++ )
{
if ( ( rDirInfos[n].nStartPos <= nPos ) && ( rDirInfos[n].nEndPos >= nPos ) )
{
@@ -3145,13 +3145,13 @@ BYTE TextEngine::ImpGetRightToLeft( ULONG nPara, USHORT nPos, USHORT* pStart, US
return nRightToLeft;
}
-long TextEngine::ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTextPortion )
+long TextEngine::ImpGetPortionXOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nTextPortion )
{
long nX = pLine->GetStartX();
TEParaPortion* pParaPortion = mpTEParaPortions->GetObject( nPara );
- for ( USHORT i = pLine->GetStartPortion(); i < nTextPortion; i++ )
+ for ( sal_uInt16 i = pLine->GetStartPortion(); i < nTextPortion; i++ )
{
TETextPortion* pPortion = pParaPortion->GetTextPortions().GetObject( i );
nX += pPortion->GetWidth();
@@ -3225,9 +3225,9 @@ long TextEngine::ImpGetPortionXOffset( ULONG nPara, TextLine* pLine, USHORT nTex
return nX;
}
-void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev, BOOL bDrawingR2LPortion )
+void TextEngine::ImpInitLayoutMode( OutputDevice* pOutDev, sal_Bool bDrawingR2LPortion )
{
- ULONG nLayoutMode = pOutDev->GetLayoutMode();
+ sal_uLong nLayoutMode = pOutDev->GetLayoutMode();
nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_COMPLEX_DISABLED | TEXT_LAYOUT_BIDI_STRONG );
if ( bDrawingR2LPortion )
@@ -3249,12 +3249,12 @@ TxtAlign TextEngine::ImpGetAlign() const
return eAlign;
}
-long TextEngine::ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex, USHORT nIndex2 )
+long TextEngine::ImpGetOutputOffset( sal_uLong nPara, TextLine* pLine, sal_uInt16 nIndex, sal_uInt16 nIndex2 )
{
TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
- USHORT nPortionStart;
- USHORT nPortion = pPortion->GetTextPortions().FindPortion( nIndex, nPortionStart, TRUE );
+ sal_uInt16 nPortionStart;
+ sal_uInt16 nPortion = pPortion->GetTextPortions().FindPortion( nIndex, nPortionStart, sal_True );
TETextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nPortion );
@@ -3275,7 +3275,7 @@ long TextEngine::ImpGetOutputOffset( ULONG nPara, TextLine* pLine, USHORT nIndex
nX = ImpGetXPos( nPara, pLine, nIndex, nIndex == nPortionStart );
if ( nIndex2 != nIndex )
{
- long nX2 = ImpGetXPos( nPara, pLine, nIndex2, FALSE );
+ long nX2 = ImpGetXPos( nPara, pLine, nIndex2, sal_False );
if ( ( !IsRightToLeft() && ( nX2 < nX ) ) ||
( IsRightToLeft() && ( nX2 > nX ) ) )
{
diff --git a/svtools/source/edit/textund2.hxx b/svtools/source/edit/textund2.hxx
index b49619894670..63937c31e0e8 100644
--- a/svtools/source/edit/textund2.hxx
+++ b/svtools/source/edit/textund2.hxx
@@ -34,13 +34,13 @@
class TextUndoDelPara : public TextUndo
{
private:
- BOOL mbDelObject;
- ULONG mnPara;
+ sal_Bool mbDelObject;
+ sal_uLong mnPara;
TextNode* mpNode; // Zeigt auf das gueltige, nicht zerstoerte Objekt!
public:
TYPEINFO();
- TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara );
+ TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara );
~TextUndoDelPara();
virtual void Undo();
@@ -51,12 +51,12 @@ public:
class TextUndoConnectParas : public TextUndo
{
private:
- ULONG mnPara;
- USHORT mnSepPos;
+ sal_uLong mnPara;
+ sal_uInt16 mnSepPos;
public:
TYPEINFO();
- TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos );
+ TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
~TextUndoConnectParas();
virtual void Undo();
@@ -67,12 +67,12 @@ public:
class TextUndoSplitPara : public TextUndo
{
private:
- ULONG mnPara;
- USHORT mnSepPos;
+ sal_uLong mnPara;
+ sal_uInt16 mnSepPos;
public:
TYPEINFO();
- TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos );
+ TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nSepPos );
~TextUndoSplitPara();
virtual void Undo();
@@ -96,7 +96,7 @@ public:
virtual void Undo();
virtual void Redo();
- virtual BOOL Merge( SfxUndoAction *pNextAction );
+ virtual sal_Bool Merge( SfxUndoAction *pNextAction );
};
@@ -124,9 +124,9 @@ private:
TextSelection maSelection;
// SfxItemSet aNewAttribs;
// TextInfoArray aPrevAttribs;
-// BYTE nSpecial;
-// BOOL bSetIsRemove;
-// USHORT nRemoveWhich;
+// sal_uInt8 nSpecial;
+// sal_Bool bSetIsRemove;
+// sal_uInt16 nRemoveWhich;
//
// void ImpSetSelection( TextView* pView );
@@ -138,9 +138,9 @@ public:
// TextInfoArray& GetTextInfos() { return aPrevAttribs; }
// SfxItemSet& GetNewAttribs() { return aNewAttribs; }
-// void SetSpecial( BYTE n ) { nSpecial = n; }
-// void SetRemoveAttribs( BOOL b ) { bSetIsRemove = b; }
-// void SetRemoveWhich( USHORT n ) { nRemoveWhich = n; }
+// void SetSpecial( sal_uInt8 n ) { nSpecial = n; }
+// void SetRemoveAttribs( sal_Bool b ) { bSetIsRemove = b; }
+// void SetRemoveWhich( sal_uInt16 n ) { nRemoveWhich = n; }
virtual void Undo();
virtual void Redo();
diff --git a/svtools/source/edit/textundo.cxx b/svtools/source/edit/textundo.cxx
index fcecb59452f5..660c272397f5 100644
--- a/svtools/source/edit/textundo.cxx
+++ b/svtools/source/edit/textundo.cxx
@@ -55,33 +55,33 @@ TextUndoManager::~TextUndoManager()
{
}
-BOOL TextUndoManager::Undo( USHORT nCount )
+sal_Bool TextUndoManager::Undo()
{
if ( GetUndoActionCount() == 0 )
- return FALSE;
+ return sal_False;
UndoRedoStart();
- mpTextEngine->SetIsInUndo( TRUE );
- BOOL bDone = SfxUndoManager::Undo( nCount );
- mpTextEngine->SetIsInUndo( FALSE );
+ mpTextEngine->SetIsInUndo( sal_True );
+ sal_Bool bDone = SfxUndoManager::Undo();
+ mpTextEngine->SetIsInUndo( sal_False );
UndoRedoEnd();
return bDone;
}
-BOOL TextUndoManager::Redo( USHORT nCount )
+sal_Bool TextUndoManager::Redo()
{
if ( GetRedoActionCount() == 0 )
- return FALSE;
+ return sal_False;
UndoRedoStart();
- mpTextEngine->SetIsInUndo( TRUE );
- BOOL bDone = SfxUndoManager::Redo( nCount );
- mpTextEngine->SetIsInUndo( FALSE );
+ mpTextEngine->SetIsInUndo( sal_True );
+ sal_Bool bDone = SfxUndoManager::Redo();
+ mpTextEngine->SetIsInUndo( sal_False );
UndoRedoEnd();
@@ -111,9 +111,8 @@ void TextUndoManager::UndoRedoEnd()
}
-TextUndo::TextUndo( USHORT nI, TextEngine* p )
+TextUndo::TextUndo( TextEngine* p )
{
- mnId = nI;
mpTextEngine = p;
}
@@ -121,12 +120,6 @@ TextUndo::~TextUndo()
{
}
-USHORT TextUndo::GetId() const
-{
- //nId sollte mal entfallen => GetId ueberall ueberladen...
- return mnId;
-}
-
XubString TextUndo::GetComment() const
{
// return mpTextEngine->GetUndoComment( this );
@@ -140,12 +133,12 @@ void TextUndo::SetSelection( const TextSelection& rSel )
}
-TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara )
- : TextUndo( TEXTUNDO_DELCONTENT, pTextEngine )
+TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, sal_uLong nPara )
+ : TextUndo( pTextEngine )
{
mpNode = pNode;
mnPara = nPara;
- mbDelObject = TRUE;
+ mbDelObject = sal_True;
}
TextUndoDelPara::~TextUndoDelPara()
@@ -157,7 +150,7 @@ TextUndoDelPara::~TextUndoDelPara()
void TextUndoDelPara::Undo()
{
GetTextEngine()->InsertContent( mpNode, mnPara );
- mbDelObject = FALSE; // gehoert wieder der Engine
+ mbDelObject = sal_False; // gehoert wieder der Engine
if ( GetView() )
{
@@ -179,10 +172,10 @@ void TextUndoDelPara::Redo()
GetDoc()->GetNodes().Remove( mnPara );
GetTextEngine()->ImpParagraphRemoved( mnPara );
- mbDelObject = TRUE; // gehoert wieder dem Undo
+ mbDelObject = sal_True; // gehoert wieder dem Undo
- ULONG nParas = GetDoc()->GetNodes().Count();
- ULONG n = mnPara < nParas ? mnPara : (nParas-1);
+ sal_uLong nParas = GetDoc()->GetNodes().Count();
+ sal_uLong n = mnPara < nParas ? mnPara : (nParas-1);
TextNode* pN = GetDoc()->GetNodes().GetObject( n );
TextPaM aPaM( n, pN->GetText().Len() );
SetSelection( aPaM );
@@ -191,8 +184,8 @@ void TextUndoDelPara::Redo()
// -----------------------------------------------------------------------
// TextUndoConnectParas
// ------------------------------------------------------------------------
-TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nPos )
- : TextUndo( TEXTUNDO_CONNECTPARAS, pTextEngine )
+TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos )
+ : TextUndo( pTextEngine )
{
mnPara = nPara;
mnSepPos = nPos;
@@ -215,8 +208,8 @@ void TextUndoConnectParas::Redo()
}
-TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nPos )
- : TextUndo( TEXTUNDO_SPLITPARA, pTextEngine )
+TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, sal_uLong nPara, sal_uInt16 nPos )
+ : TextUndo( pTextEngine )
{
mnPara = nPara;
mnSepPos = nPos;
@@ -240,7 +233,7 @@ void TextUndoSplitPara::Redo()
TextUndoInsertChars::TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
- : TextUndo( TEXTUNDO_INSERTCHARS, pTextEngine ),
+ : TextUndo( pTextEngine ),
maTextPaM( rTextPaM ), maText( rStr )
{
}
@@ -262,27 +255,27 @@ void TextUndoInsertChars::Redo()
SetSelection( TextSelection( aSel.GetStart(), aNewPaM ) );
}
-BOOL TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
+sal_Bool TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
{
if ( !pNextAction->ISA( TextUndoInsertChars ) )
- return FALSE;
+ return sal_False;
TextUndoInsertChars* pNext = (TextUndoInsertChars*)pNextAction;
if ( maTextPaM.GetPara() != pNext->maTextPaM.GetPara() )
- return FALSE;
+ return sal_False;
if ( ( maTextPaM.GetIndex() + maText.Len() ) == pNext->maTextPaM.GetIndex() )
{
maText += pNext->maText;
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
TextUndoRemoveChars::TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
- : TextUndo( TEXTUNDO_REMOVECHARS, pTextEngine ),
+ : TextUndo( pTextEngine ),
maTextPaM( rTextPaM ), maText( rStr )
{
}
@@ -305,11 +298,11 @@ void TextUndoRemoveChars::Redo()
TextUndoSetAttribs::TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rSel )
- : TextUndo( TEXTUNDO_ATTRIBS, pTextEngine ), maSelection( rSel )
+ : TextUndo( pTextEngine ), maSelection( rSel )
{
maSelection.Justify();
// aNewAttribs.Set( rNewItems );
-// mbSetIsRemove = FALSE;
+// mbSetIsRemove = sal_False;
// mnRemoveWhich = 0;
// mnSpecial = 0;
}
@@ -321,12 +314,12 @@ TextUndoSetAttribs::~TextUndoSetAttribs()
void TextUndoSetAttribs::Undo()
{
- for ( ULONG nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ )
+ for ( sal_uLong nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ )
{
-// ContentAttribsInfo* pInf = aPrevAttribs[ (USHORT)(nPara-aESel.nStartPara) ];
+// ContentAttribsInfo* pInf = aPrevAttribs[ (sal_uInt16)(nPara-aESel.nStartPara) ];
// GetTextEngine()->RemoveCharAttribs( nPara );
// TextNode* pNode = GetTextEngine()->GetTextDoc().GetObject( nPara );
-// for ( USHORT nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ )
+// for ( sal_uInt16 nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ )
// {
// GetTextEngine()->GetTextDoc().InsertAttrib( pNode, pX->GetStart(), pX->GetEnd(), *pX->GetItem() );
// }
diff --git a/svtools/source/edit/textundo.hxx b/svtools/source/edit/textundo.hxx
index 414f2f1f5db2..b8189eaa9711 100644
--- a/svtools/source/edit/textundo.hxx
+++ b/svtools/source/edit/textundo.hxx
@@ -48,16 +48,15 @@ public:
~TextUndoManager();
using SfxUndoManager::Undo;
- virtual BOOL Undo( USHORT nCount=1 );
+ virtual sal_Bool Undo();
using SfxUndoManager::Redo;
- virtual BOOL Redo( USHORT nCount=1 );
+ virtual sal_Bool Redo();
};
class TextUndo : public SfxUndoAction
{
private:
- USHORT mnId;
TextEngine* mpTextEngine;
protected:
@@ -70,7 +69,7 @@ protected:
public:
TYPEINFO();
- TextUndo( USHORT nId, TextEngine* pTextEngine );
+ TextUndo( TextEngine* pTextEngine );
virtual ~TextUndo();
TextEngine* GetTextEngine() const { return mpTextEngine; }
@@ -79,7 +78,6 @@ public:
virtual void Redo() = 0;
virtual XubString GetComment() const;
- virtual USHORT GetId() const;
};
#endif // _TEXTUNDO_HXX
diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx
index 292cf03ce86a..f2b370a9a923 100644
--- a/svtools/source/edit/textview.cxx
+++ b/svtools/source/edit/textview.cxx
@@ -117,7 +117,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla
{
uno::Any aAny;
- ULONG nT = SotExchange::GetFormat( rFlavor );
+ sal_uLong nT = SotExchange::GetFormat( rFlavor );
if ( nT == SOT_FORMAT_STRING )
{
aAny <<= (::rtl::OUString)GetText();
@@ -125,7 +125,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla
else if ( nT == SOT_FORMATSTR_ID_HTML )
{
GetHTMLStream().Seek( STREAM_SEEK_TO_END );
- ULONG nLen = GetHTMLStream().Tell();
+ sal_uLong nLen = GetHTMLStream().Tell();
GetHTMLStream().Seek(0);
uno::Sequence< sal_Int8 > aSeq( nLen );
@@ -142,7 +142,7 @@ uno::Any TETextDataObject::getTransferData( const datatransfer::DataFlavor& rFla
uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavors( ) throw(uno::RuntimeException)
{
GetHTMLStream().Seek( STREAM_SEEK_TO_END );
- BOOL bHTML = GetHTMLStream().Tell() > 0;
+ sal_Bool bHTML = GetHTMLStream().Tell() > 0;
uno::Sequence< datatransfer::DataFlavor > aDataFlavors( bHTML ? 2 : 1 );
SotExchange::GetFormatDataFlavor( SOT_FORMAT_STRING, aDataFlavors.getArray()[0] );
if ( bHTML )
@@ -152,7 +152,7 @@ uno::Sequence< datatransfer::DataFlavor > TETextDataObject::getTransferDataFlavo
sal_Bool TETextDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException)
{
- ULONG nT = SotExchange::GetFormat( rFlavor );
+ sal_uLong nT = SotExchange::GetFormat( rFlavor );
return ( nT == SOT_FORMAT_STRING );
}
@@ -176,17 +176,17 @@ struct ImpTextView
::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSourceListener > mxDnDListener;
- USHORT mnTravelXPos;
-
- BOOL mbAutoScroll : 1;
- BOOL mbInsertMode : 1;
- BOOL mbReadOnly : 1;
- BOOL mbPaintSelection : 1;
- BOOL mbAutoIndent : 1;
- BOOL mbHighlightSelection : 1;
- BOOL mbCursorEnabled : 1;
- BOOL mbClickedInSelection : 1;
- BOOL mbSupportProtectAttribute : 1;
+ sal_uInt16 mnTravelXPos;
+
+ sal_Bool mbAutoScroll : 1;
+ sal_Bool mbInsertMode : 1;
+ sal_Bool mbReadOnly : 1;
+ sal_Bool mbPaintSelection : 1;
+ sal_Bool mbAutoIndent : 1;
+ sal_Bool mbHighlightSelection : 1;
+ sal_Bool mbCursorEnabled : 1;
+ sal_Bool mbClickedInSelection : 1;
+ sal_Bool mbSupportProtectAttribute : 1;
bool mbCursorAtEndOfLine;
};
@@ -196,30 +196,30 @@ struct ImpTextView
TextView::TextView( TextEngine* pEng, Window* pWindow ) :
mpImpl(new ImpTextView)
{
- pWindow->EnableRTL( FALSE );
+ pWindow->EnableRTL( sal_False );
mpImpl->mpWindow = pWindow;
mpImpl->mpTextEngine = pEng;
mpImpl->mpVirtDev = NULL;
- mpImpl->mbPaintSelection = TRUE;
- mpImpl->mbAutoScroll = TRUE;
- mpImpl->mbInsertMode = TRUE;
- mpImpl->mbReadOnly = FALSE;
- mpImpl->mbHighlightSelection = FALSE;
- mpImpl->mbAutoIndent = FALSE;
- mpImpl->mbCursorEnabled = TRUE;
- mpImpl->mbClickedInSelection = FALSE;
- mpImpl->mbSupportProtectAttribute = FALSE;
+ mpImpl->mbPaintSelection = sal_True;
+ mpImpl->mbAutoScroll = sal_True;
+ mpImpl->mbInsertMode = sal_True;
+ mpImpl->mbReadOnly = sal_False;
+ mpImpl->mbHighlightSelection = sal_False;
+ mpImpl->mbAutoIndent = sal_False;
+ mpImpl->mbCursorEnabled = sal_True;
+ mpImpl->mbClickedInSelection = sal_False;
+ mpImpl->mbSupportProtectAttribute = sal_False;
mpImpl->mbCursorAtEndOfLine = false;
-// mbInSelection = FALSE;
+// mbInSelection = sal_False;
mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW;
mpImpl->mpSelFuncSet = new TextSelFunctionSet( this );
mpImpl->mpSelEngine = new SelectionEngine( mpImpl->mpWindow, mpImpl->mpSelFuncSet );
mpImpl->mpSelEngine->SetSelectionMode( RANGE_SELECTION );
- mpImpl->mpSelEngine->EnableDrag( TRUE );
+ mpImpl->mpSelEngine->EnableDrag( sal_True );
mpImpl->mpCursor = new Cursor;
mpImpl->mpCursor->Show();
@@ -227,7 +227,7 @@ TextView::TextView( TextEngine* pEng, Window* pWindow ) :
pWindow->SetInputContext( InputContext( pEng->GetFont(), INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT ) );
if ( pWindow->GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_INVERT )
- mpImpl->mbHighlightSelection = TRUE;
+ mpImpl->mbHighlightSelection = sal_True;
pWindow->SetLineColor();
@@ -265,7 +265,7 @@ void TextView::Invalidate()
mpImpl->mpWindow->Invalidate();
}
-void TextView::SetSelection( const TextSelection& rTextSel, BOOL bGotoCursor )
+void TextView::SetSelection( const TextSelection& rTextSel, sal_Bool bGotoCursor )
{
// Falls jemand gerade ein leeres Attribut hinterlassen hat,
// und dann der Outliner die Selektion manipulitert:
@@ -301,9 +301,9 @@ void TextView::DeleteSelected()
{
// HideSelection();
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionStart();
TextPaM aPaM = mpImpl->mpTextEngine->ImpDeleteText( mpImpl->maSelection );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionEnd();
ImpSetSelection( aPaM );
mpImpl->mpTextEngine->FormatAndUpdate( this );
@@ -335,10 +335,10 @@ void TextView::ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle c
void TextView::Paint( const Rectangle& rRect )
{
- ImpPaint( rRect, FALSE );
+ ImpPaint( rRect, sal_False );
}
-void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev )
+void TextView::ImpPaint( const Rectangle& rRect, sal_Bool bUseVirtDev )
{
if ( !mpImpl->mpTextEngine->GetUpdateMode() || mpImpl->mpTextEngine->IsInUndo() )
return;
@@ -357,7 +357,7 @@ void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev )
if ( pVDev->GetBackground().GetColor() != rBackgroundColor )
pVDev->SetBackground( rBackgroundColor );
- BOOL bVDevValid = TRUE;
+ sal_Bool bVDevValid = sal_True;
Size aOutSz( pVDev->GetOutputSizePixel() );
if ( ( aOutSz.Width() < rRect.GetWidth() ) ||
( aOutSz.Height() < rRect.GetHeight() ) )
@@ -380,7 +380,7 @@ void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev )
}
if ( !bVDevValid )
{
- ImpPaint( rRect, FALSE /* ohne VDev */ );
+ ImpPaint( rRect, sal_False /* ohne VDev */ );
return;
}
@@ -418,27 +418,27 @@ void TextView::ImpHighlight( const TextSelection& rSel )
Rectangle aVisArea( mpImpl->maStartDocPos, mpImpl->mpWindow->GetOutputSizePixel() );
long nY = 0;
- ULONG nStartPara = aSel.GetStart().GetPara();
- ULONG nEndPara = aSel.GetEnd().GetPara();
- for ( ULONG nPara = 0; nPara <= nEndPara; nPara++ )
+ sal_uLong nStartPara = aSel.GetStart().GetPara();
+ sal_uLong nEndPara = aSel.GetEnd().GetPara();
+ for ( sal_uLong nPara = 0; nPara <= nEndPara; nPara++ )
{
long nParaHeight = (long)mpImpl->mpTextEngine->CalcParaHeight( nPara );
if ( ( nPara >= nStartPara ) && ( ( nY + nParaHeight ) > aVisArea.Top() ) )
{
TEParaPortion* pTEParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( nPara );
- USHORT nStartLine = 0;
- USHORT nEndLine = pTEParaPortion->GetLines().Count() -1;
+ sal_uInt16 nStartLine = 0;
+ sal_uInt16 nEndLine = pTEParaPortion->GetLines().Count() -1;
if ( nPara == nStartPara )
- nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), FALSE );
+ nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), sal_False );
if ( nPara == nEndPara )
- nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), TRUE );
+ nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), sal_True );
// ueber die Zeilen iterieren....
- for ( USHORT nLine = nStartLine; nLine <= nEndLine; nLine++ )
+ for ( sal_uInt16 nLine = nStartLine; nLine <= nEndLine; nLine++ )
{
TextLine* pLine = pTEParaPortion->GetLines().GetObject( nLine );
- USHORT nStartIndex = pLine->GetStart();
- USHORT nEndIndex = pLine->GetEnd();
+ sal_uInt16 nStartIndex = pLine->GetStart();
+ sal_uInt16 nEndIndex = pLine->GetEnd();
if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) )
nStartIndex = aSel.GetStart().GetIndex();
if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) )
@@ -448,12 +448,12 @@ void TextView::ImpHighlight( const TextSelection& rSel )
if ( nEndIndex < nStartIndex )
nEndIndex = nStartIndex;
- Rectangle aTmpRec( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), FALSE ) );
+ Rectangle aTmpRec( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), sal_False ) );
aTmpRec.Top() += nY;
aTmpRec.Bottom() += nY;
Point aTopLeft( aTmpRec.TopLeft() );
- aTmpRec = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), TRUE );
+ aTmpRec = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), sal_True );
aTmpRec.Top() += nY;
aTmpRec.Bottom() += nY;
Point aBottomRight( aTmpRec.BottomRight() );
@@ -489,20 +489,20 @@ void TextView::ImpSetSelection( const TextSelection& rSelection )
void TextView::ShowSelection()
{
- ImpShowHideSelection( TRUE );
+ ImpShowHideSelection( sal_True );
}
void TextView::HideSelection()
{
- ImpShowHideSelection( FALSE );
+ ImpShowHideSelection( sal_False );
}
void TextView::ShowSelection( const TextSelection& rRange )
{
- ImpShowHideSelection( TRUE, &rRange );
+ ImpShowHideSelection( sal_True, &rRange );
}
-void TextView::ImpShowHideSelection( BOOL bShow, const TextSelection* pRange )
+void TextView::ImpShowHideSelection( sal_Bool bShow, const TextSelection* pRange )
{
const TextSelection* pRangeOrSelection = pRange ? pRange : &mpImpl->maSelection;
@@ -522,7 +522,7 @@ void TextView::ImpShowHideSelection( BOOL bShow, const TextSelection* pRange )
Point aStartPos( ImpGetOutputStartPos( mpImpl->maStartDocPos ) );
TextSelection aRange( *pRangeOrSelection );
aRange.Justify();
- BOOL bVisCursor = mpImpl->mpCursor->IsVisible();
+ sal_Bool bVisCursor = mpImpl->mpCursor->IsVisible();
mpImpl->mpCursor->Hide();
ImpPaint( mpImpl->mpWindow, aStartPos, &aOutArea, &aRange, bShow ? &mpImpl->maSelection : NULL );
if ( bVisCursor )
@@ -548,24 +548,24 @@ void TextView::EraseVirtualDevice()
mpImpl->mpVirtDev = 0;
}
-BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
+sal_Bool TextView::KeyInput( const KeyEvent& rKeyEvent )
{
- BOOL bDone = TRUE;
- BOOL bModified = FALSE;
- BOOL bMoved = FALSE;
- BOOL bEndKey = FALSE; // spezielle CursorPosition
- BOOL bAllowIdle = TRUE;
+ sal_Bool bDone = sal_True;
+ sal_Bool bModified = sal_False;
+ sal_Bool bMoved = sal_False;
+ sal_Bool bEndKey = sal_False; // spezielle CursorPosition
+ sal_Bool bAllowIdle = sal_True;
// Um zu pruefen ob durch irgendeine Aktion mModified, das lokale
// bModified wird z.B. bei Cut/Paste nicht gesetzt, weil dort an anderen
// Stellen das updaten erfolgt.
- BOOL bWasModified = mpImpl->mpTextEngine->IsModified();
- mpImpl->mpTextEngine->SetModified( FALSE );
+ sal_Bool bWasModified = mpImpl->mpTextEngine->IsModified();
+ mpImpl->mpTextEngine->SetModified( sal_False );
TextSelection aCurSel( mpImpl->maSelection );
TextSelection aOldSel( aCurSel );
- USHORT nCode = rKeyEvent.GetKeyCode().GetCode();
+ sal_uInt16 nCode = rKeyEvent.GetKeyCode().GetCode();
KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction();
if ( eFunc != KEYFUNC_DONTKNOW )
{
@@ -642,12 +642,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
uno::Reference<datatransfer::clipboard::XClipboard> aSelection(GetWindow()->GetPrimarySelection());
Copy( aSelection );
}
- bMoved = TRUE;
+ bMoved = sal_True;
if ( nCode == KEY_END )
- bEndKey = TRUE;
+ bEndKey = sal_True;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_BACKSPACE:
@@ -659,8 +659,8 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
{
if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod2() )
{
- BYTE nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT;
- BYTE nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE;
+ sal_uInt8 nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT;
+ sal_uInt8 nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE;
if ( ( nMode == DELMODE_RESTOFWORD ) && rKeyEvent.GetKeyCode().IsShift() )
nMode = DELMODE_RESTOFCONTENT;
@@ -685,7 +685,7 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
default: break;
}
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DELETE );
+ mpImpl->mpTextEngine->UndoActionStart();
if(mpImpl->mbSupportProtectAttribute)
{
//expand selection to include all protected content - if there is any
@@ -707,12 +707,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
}
}
aCurSel = ImpDelete( nDel, nMode );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE );
- bModified = TRUE;
- bAllowIdle = FALSE;
+ mpImpl->mpTextEngine->UndoActionEnd();
+ bModified = sal_True;
+ bAllowIdle = sal_False;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_TAB:
@@ -722,10 +722,10 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
ImplCheckTextLen( 'x' ) )
{
aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, '\t', !IsInsertMode() );
- bModified = TRUE;
+ bModified = sal_True;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_RETURN:
@@ -735,12 +735,12 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( !mpImpl->mbReadOnly && !rKeyEvent.GetKeyCode().IsMod1() &&
!rKeyEvent.GetKeyCode().IsMod2() && ImplCheckTextLen( 'x' ) )
{
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
aCurSel = mpImpl->mpTextEngine->ImpInsertParaBreak( aCurSel );
if ( mpImpl->mbAutoIndent )
{
TextNode* pPrev = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aCurSel.GetEnd().GetPara() - 1 );
- USHORT n = 0;
+ sal_uInt16 n = 0;
while ( ( n < pPrev->GetText().Len() ) && (
( pPrev->GetText().GetChar( n ) == ' ' ) ||
( pPrev->GetText().GetChar( n ) == '\t' ) ) )
@@ -750,11 +750,11 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( n )
aCurSel = mpImpl->mpTextEngine->ImpInsertText( aCurSel, pPrev->GetText().Copy( 0, n ) );
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
- bModified = TRUE;
+ mpImpl->mpTextEngine->UndoActionEnd();
+ bModified = sal_True;
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
break;
case KEY_INSERT:
@@ -771,11 +771,11 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
if ( !mpImpl->mbReadOnly && ImplCheckTextLen( nCharCode ) ) // sonst trotzdem das Zeichen schlucken...
{
aCurSel = mpImpl->mpTextEngine->ImpInsertText( nCharCode, aCurSel, !IsInsertMode(), sal_True );
- bModified = TRUE;
+ bModified = sal_True;
}
}
else
- bDone = FALSE;
+ bDone = sal_False;
}
}
}
@@ -799,20 +799,20 @@ BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
else if ( bMoved )
{
// Selection wird jetzt gezielt in ImpMoveCursor gemalt.
- ImpShowCursor( mpImpl->mbAutoScroll, TRUE, bEndKey );
+ ImpShowCursor( mpImpl->mbAutoScroll, sal_True, bEndKey );
}
if ( mpImpl->mpTextEngine->IsModified() )
mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
else if ( bWasModified )
- mpImpl->mpTextEngine->SetModified( TRUE );
+ mpImpl->mpTextEngine->SetModified( sal_True );
return bDone;
}
void TextView::MouseButtonUp( const MouseEvent& rMouseEvent )
{
- mpImpl->mbClickedInSelection = FALSE;
+ mpImpl->mbClickedInSelection = sal_False;
mpImpl->mnTravelXPos = TRAVEL_X_DONTKNOW;
mpImpl->mpSelEngine->SelMouseButtonUp( rMouseEvent );
if ( rMouseEvent.IsMiddle() && !IsReadOnly() &&
@@ -866,18 +866,18 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent )
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
TextSelection aNewSel( mpImpl->maSelection );
- aNewSel.GetStart().GetIndex() = (USHORT)aBoundary.startPos;
- aNewSel.GetEnd().GetIndex() = (USHORT)aBoundary.endPos;
+ aNewSel.GetStart().GetIndex() = (sal_uInt16)aBoundary.startPos;
+ aNewSel.GetEnd().GetIndex() = (sal_uInt16)aBoundary.endPos;
if(mpImpl->mbSupportProtectAttribute)
{
//expand selection to include all protected content - if there is any
const TextCharAttrib* pStartAttr = mpImpl->mpTextEngine->FindCharAttrib(
TextPaM(aNewSel.GetStart().GetPara(),
- (USHORT)aBoundary.startPos),
+ (sal_uInt16)aBoundary.startPos),
TEXTATTR_PROTECTED );
const TextCharAttrib* pEndAttr = mpImpl->mpTextEngine->FindCharAttrib(
TextPaM(aNewSel.GetEnd().GetPara(),
- (USHORT)aBoundary.endPos),
+ (sal_uInt16)aBoundary.endPos),
TEXTATTR_PROTECTED );
if(pStartAttr && pStartAttr->GetStart() < aNewSel.GetStart().GetIndex())
{
@@ -890,7 +890,7 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent )
}
ImpSetSelection( aNewSel );
ShowSelection();
- ShowCursor( TRUE, TRUE );
+ ShowCursor( sal_True, sal_True );
}
}
else if ( rMouseEvent.GetClicks() == 3 )
@@ -904,7 +904,7 @@ void TextView::MouseButtonDown( const MouseEvent& rMouseEvent )
aNewSel.GetEnd().GetIndex() = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( mpImpl->maSelection.GetEnd().GetPara() )->GetText().Len();
ImpSetSelection( aNewSel );
ShowSelection();
- ShowCursor( TRUE, TRUE );
+ ShowCursor( sal_True, sal_True );
}
}
}
@@ -938,7 +938,7 @@ void TextView::Command( const CommandEvent& rCEvt )
TEParaPortion* pPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( mpImpl->mpTextEngine->mpIMEInfos->aPos.GetPara() );
pPortion->MarkSelectionInvalid( mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex(), 0 );
- BOOL bInsertMode = !mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite;
+ sal_Bool bInsertMode = !mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite;
delete mpImpl->mpTextEngine->mpIMEInfos;
mpImpl->mpTextEngine->mpIMEInfos = NULL;
@@ -967,14 +967,14 @@ void TextView::Command( const CommandEvent& rCEvt )
if ( mpImpl->mpTextEngine->mpIMEInfos->bWasCursorOverwrite )
{
- USHORT nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen;
- USHORT nNewIMETextLen = pData->GetText().Len();
+ sal_uInt16 nOldIMETextLen = mpImpl->mpTextEngine->mpIMEInfos->nLen;
+ sal_uInt16 nNewIMETextLen = pData->GetText().Len();
if ( ( nOldIMETextLen > nNewIMETextLen ) &&
( nNewIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// restore old characters
- USHORT nRestore = nOldIMETextLen - nNewIMETextLen;
+ sal_uInt16 nRestore = nOldIMETextLen - nNewIMETextLen;
TextPaM aPaM( mpImpl->mpTextEngine->mpIMEInfos->aPos );
aPaM.GetIndex() = aPaM.GetIndex() + nNewIMETextLen;
mpImpl->mpTextEngine->ImpInsertText( aPaM, mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Copy( nNewIMETextLen, nRestore ) );
@@ -983,7 +983,7 @@ void TextView::Command( const CommandEvent& rCEvt )
( nOldIMETextLen < mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() ) )
{
// overwrite
- USHORT nOverwrite = nNewIMETextLen - nOldIMETextLen;
+ sal_uInt16 nOverwrite = nNewIMETextLen - nOldIMETextLen;
if ( ( nOldIMETextLen + nOverwrite ) > mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() )
nOverwrite = mpImpl->mpTextEngine->mpIMEInfos->aOldTextAfterStartPos.Len() - nOldIMETextLen;
DBG_ASSERT( nOverwrite && (nOverwrite < 0xFF00), "IME Overwrite?!" );
@@ -1028,13 +1028,13 @@ void TextView::Command( const CommandEvent& rCEvt )
TextPaM aPaM( GetSelection().GetEnd() );
Rectangle aR1 = mpImpl->mpTextEngine->PaMtoEditCursor( aPaM );
- USHORT nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen;
+ sal_uInt16 nInputEnd = mpImpl->mpTextEngine->mpIMEInfos->aPos.GetIndex() + mpImpl->mpTextEngine->mpIMEInfos->nLen;
if ( !mpImpl->mpTextEngine->IsFormatted() )
mpImpl->mpTextEngine->FormatDoc();
TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True );
+ sal_uInt16 nLine = pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True );
TextLine* pLine = pParaPortion->GetLines().GetObject( nLine );
if ( pLine && ( nInputEnd > pLine->GetEnd() ) )
nInputEnd = pLine->GetEnd();
@@ -1055,12 +1055,12 @@ void TextView::Command( const CommandEvent& rCEvt )
}
}
-void TextView::ShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor )
+void TextView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor )
{
// Die Einstellung hat mehr Gewicht:
if ( !mpImpl->mbAutoScroll )
- bGotoCursor = FALSE;
- ImpShowCursor( bGotoCursor, bForceVisCursor, FALSE );
+ bGotoCursor = sal_False;
+ ImpShowCursor( bGotoCursor, bForceVisCursor, sal_False );
}
void TextView::HideCursor()
@@ -1092,7 +1092,7 @@ void TextView::Scroll( long ndX, long ndY )
if ( nDiffX || nDiffY )
{
- BOOL bVisCursor = mpImpl->mpCursor->IsVisible();
+ sal_Bool bVisCursor = mpImpl->mpCursor->IsVisible();
mpImpl->mpCursor->Hide();
mpImpl->mpWindow->Update();
mpImpl->maStartDocPos = aNewStartPos;
@@ -1112,21 +1112,21 @@ void TextView::Scroll( long ndX, long ndY )
void TextView::Undo()
{
mpImpl->mpTextEngine->SetActiveView( this );
- mpImpl->mpTextEngine->GetUndoManager().Undo( 1 );
+ mpImpl->mpTextEngine->GetUndoManager().Undo();
}
void TextView::Redo()
{
mpImpl->mpTextEngine->SetActiveView( this );
- mpImpl->mpTextEngine->GetUndoManager().Redo( 0 );
+ mpImpl->mpTextEngine->GetUndoManager().Redo();
}
void TextView::Cut()
{
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_CUT );
+ mpImpl->mpTextEngine->UndoActionStart();
Copy();
DeleteSelected();
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_CUT );
+ mpImpl->mpTextEngine->UndoActionEnd();
}
void TextView::Copy( uno::Reference< datatransfer::clipboard::XClipboard >& rxClipboard )
@@ -1136,7 +1136,7 @@ void TextView::Copy( uno::Reference< datatransfer::clipboard::XClipboard >& rxCl
TETextDataObject* pDataObj = new TETextDataObject( GetSelected() );
if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // Dann auch als HTML
- mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, TRUE );
+ mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, sal_True );
const sal_uInt32 nRef = Application::ReleaseSolarMutex();
@@ -1194,7 +1194,7 @@ void TextView::Paste( uno::Reference< datatransfer::clipboard::XClipboard >& rxC
bool bWasTruncated = false;
if( mpImpl->mpTextEngine->GetMaxTextLen() != 0 )
bWasTruncated = ImplTruncateNewText( aText );
- InsertNewText( aText, FALSE );
+ InsertNewText( aText, sal_False );
mpImpl->mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
if( bWasTruncated )
@@ -1224,22 +1224,22 @@ String TextView::GetSelected( LineEnd aSeparator )
return mpImpl->mpTextEngine->GetText( mpImpl->maSelection, aSeparator );
}
-void TextView::SetInsertMode( BOOL bInsert )
+void TextView::SetInsertMode( sal_Bool bInsert )
{
if ( mpImpl->mbInsertMode != bInsert )
{
mpImpl->mbInsertMode = bInsert;
- ShowCursor( mpImpl->mbAutoScroll, FALSE );
+ ShowCursor( mpImpl->mbAutoScroll, sal_False );
}
}
-void TextView::SetReadOnly( BOOL bReadOnly )
+void TextView::SetReadOnly( sal_Bool bReadOnly )
{
if ( mpImpl->mbReadOnly != bReadOnly )
{
mpImpl->mbReadOnly = bReadOnly;
if ( !mpImpl->mbReadOnly )
- ShowCursor( mpImpl->mbAutoScroll, FALSE );
+ ShowCursor( mpImpl->mbAutoScroll, sal_False );
else
HideCursor();
@@ -1261,8 +1261,8 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
KeyEvent aTranslatedKeyEvent = rKeyEvent.LogicalTextDirectionality( eTextDirection );
- BOOL bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? TRUE : FALSE;
- USHORT nCode = aTranslatedKeyEvent.GetKeyCode().GetCode();
+ sal_Bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? sal_True : sal_False;
+ sal_uInt16 nCode = aTranslatedKeyEvent.GetKeyCode().GetCode();
bool bSelect = aTranslatedKeyEvent.GetKeyCode().IsShift();
switch ( nCode )
@@ -1279,9 +1279,9 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
break;
case KEY_PAGEDOWN: aPaM = bCtrl ? CursorEndOfDoc() : PageDown( aPaM );
break;
- case KEY_LEFT: aPaM = bCtrl ? CursorWordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER : (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ case KEY_LEFT: aPaM = bCtrl ? CursorWordLeft( aPaM ) : CursorLeft( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
break;
- case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER : (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ case KEY_RIGHT: aPaM = bCtrl ? CursorWordRight( aPaM ) : CursorRight( aPaM, aTranslatedKeyEvent.GetKeyCode().IsMod2() ? (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER : (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
break;
case com::sun::star::awt::Key::SELECT_WORD_FORWARD:
bSelect = true; // fallthrough intentional
@@ -1352,15 +1352,15 @@ TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
return mpImpl->maSelection;
}
-void TextView::InsertText( const XubString& rStr, BOOL bSelect )
+void TextView::InsertText( const XubString& rStr, sal_Bool bSelect )
{
InsertNewText( rStr, bSelect );
}
-void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect )
+void TextView::InsertNewText( const rtl::OUString& rStr, sal_Bool bSelect )
{
// HideSelection();
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
/* #i87633#
break inserted text into chunks that fit into the underlying String
@@ -1395,21 +1395,21 @@ void TextView::InsertNewText( const rtl::OUString& rStr, BOOL bSelect )
nLen -= nChunkLen;
nPos += nChunkLen;
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionEnd();
mpImpl->mpTextEngine->FormatAndUpdate( this );
}
/*
-void TextView::InsertText( const XubString& rStr, BOOL bSelect )
+void TextView::InsertText( const XubString& rStr, sal_Bool bSelect )
{
// HideSelection();
TextSelection aNewSel( mpImpl->maSelection );
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionStart();
TextPaM aPaM = mpImpl->mpTextEngine->ImpInsertText( mpImpl->maSelection, rStr );
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ mpImpl->mpTextEngine->UndoActionEnd();
if ( bSelect )
{
@@ -1428,22 +1428,22 @@ void TextView::InsertText( const XubString& rStr, BOOL bSelect )
*/
// OLD
-TextPaM TextView::CursorLeft( const TextPaM& rPaM, BOOL bWordMode )
+TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_Bool bWordMode )
{
- return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ return bWordMode ? CursorWordLeft( rPaM ) : CursorLeft( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
- // Remove (USHORT) typecasts in this file when removing this method!
+ // Remove (sal_uInt16) typecasts in this file when removing this method!
}
// OLD
-TextPaM TextView::CursorRight( const TextPaM& rPaM, BOOL bWordMode )
+TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_Bool bWordMode )
{
- return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ return bWordMode ? CursorWordRight( rPaM ) : CursorRight( rPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
- // Remove (USHORT) typecasts in this file when removing this method!
+ // Remove (sal_uInt16) typecasts in this file when removing this method!
}
-TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode )
+TextPaM TextView::CursorLeft( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode )
{
TextPaM aPaM( rPaM );
@@ -1452,7 +1452,7 @@ TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode
TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aPaM.GetPara() );
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
sal_Int32 nCount = 1;
- aPaM.GetIndex() = (USHORT)xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
+ aPaM.GetIndex() = (sal_uInt16)xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
}
else if ( aPaM.GetPara() )
{
@@ -1463,7 +1463,7 @@ TextPaM TextView::CursorLeft( const TextPaM& rPaM, USHORT nCharacterIteratorMode
return aPaM;
}
-TextPaM TextView::CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMode )
+TextPaM TextView::CursorRight( const TextPaM& rPaM, sal_uInt16 nCharacterIteratorMode )
{
TextPaM aPaM( rPaM );
@@ -1472,7 +1472,7 @@ TextPaM TextView::CursorRight( const TextPaM& rPaM, USHORT nCharacterIteratorMod
{
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
sal_Int32 nCount = 1;
- aPaM.GetIndex() = (USHORT)xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
+ aPaM.GetIndex() = (sal_uInt16)xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), nCharacterIteratorMode, nCount, nCount );
}
else if ( aPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().Count()-1) )
{
@@ -1495,7 +1495,7 @@ TextPaM TextView::CursorWordLeft( const TextPaM& rPaM )
i18n::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
if ( aBoundary.startPos >= rPaM.GetIndex() )
aBoundary = xBI->previousWord( pNode->GetText(), rPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
- aPaM.GetIndex() = ( aBoundary.startPos != -1 ) ? (USHORT)aBoundary.startPos : 0;
+ aPaM.GetIndex() = ( aBoundary.startPos != -1 ) ? (sal_uInt16)aBoundary.startPos : 0;
}
else if ( aPaM.GetPara() )
{
@@ -1516,7 +1516,7 @@ TextPaM TextView::CursorWordRight( const TextPaM& rPaM )
{
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
i18n::Boundary aBoundary = xBI->nextWord( pNode->GetText(), aPaM.GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
- aPaM.GetIndex() = (USHORT)aBoundary.startPos;
+ aPaM.GetIndex() = (sal_uInt16)aBoundary.startPos;
}
else if ( aPaM.GetPara() < ( mpImpl->mpTextEngine->mpDoc->GetNodes().Count()-1) )
{
@@ -1527,7 +1527,7 @@ TextPaM TextView::CursorWordRight( const TextPaM& rPaM )
return aPaM;
}
-TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
+TextPaM TextView::ImpDelete( sal_uInt8 nMode, sal_uInt8 nDelMode )
{
if ( mpImpl->maSelection.HasRange() ) // dann nur Sel. loeschen
return mpImpl->mpTextEngine->ImpDeleteText( mpImpl->maSelection );
@@ -1538,7 +1538,7 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
{
if ( nDelMode == DELMODE_SIMPLE )
{
- aEndPaM = CursorLeft( aEndPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCHARACTER );
+ aEndPaM = CursorLeft( aEndPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCHARACTER );
}
else if ( nDelMode == DELMODE_RESTOFWORD )
{
@@ -1548,7 +1548,7 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
if ( aBoundary.startPos == mpImpl->maSelection.GetEnd().GetIndex() )
aBoundary = xBI->previousWord( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
// #i63506# startPos is -1 when the paragraph starts with a tab
- aEndPaM.GetIndex() = (aBoundary.startPos >= 0) ? (USHORT)aBoundary.startPos : 0;
+ aEndPaM.GetIndex() = (aBoundary.startPos >= 0) ? (sal_uInt16)aBoundary.startPos : 0;
}
else // DELMODE_RESTOFCONTENT
{
@@ -1566,14 +1566,14 @@ TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
{
if ( nDelMode == DELMODE_SIMPLE )
{
- aEndPaM = CursorRight( aEndPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
+ aEndPaM = CursorRight( aEndPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
}
else if ( nDelMode == DELMODE_RESTOFWORD )
{
TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( aEndPaM.GetPara() );
uno::Reference < i18n::XBreakIterator > xBI = mpImpl->mpTextEngine->GetBreakIterator();
i18n::Boundary aBoundary = xBI->nextWord( pNode->GetText(), mpImpl->maSelection.GetEnd().GetIndex(), mpImpl->mpTextEngine->GetLocale(), i18n::WordType::ANYWORD_IGNOREWHITESPACES );
- aEndPaM.GetIndex() = (USHORT)aBoundary.startPos;
+ aEndPaM.GetIndex() = (sal_uInt16)aBoundary.startPos;
}
else // DELMODE_RESTOFCONTENT
{
@@ -1602,17 +1602,17 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM )
long nX;
if ( mpImpl->mnTravelXPos == TRAVEL_X_DONTKNOW )
{
- nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, FALSE ).Left();
- mpImpl->mnTravelXPos = (USHORT)nX+1;
+ nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, sal_False ).Left();
+ mpImpl->mnTravelXPos = (sal_uInt16)nX+1;
}
else
nX = mpImpl->mnTravelXPos;
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False );
if ( nLine ) // gleicher Absatz
{
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX );
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX );
aPaM.GetIndex() = nCharPos;
// Wenn davor eine autom.Umgebrochene Zeile, und ich muss genau an das
// Ende dieser Zeile, landet der Cursor in der aktuellen Zeile am Anfang
@@ -1625,8 +1625,8 @@ TextPaM TextView::CursorUp( const TextPaM& rPaM )
{
aPaM.GetPara()--;
pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nL = pPPortion->GetLines().Count() - 1;
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 );
+ sal_uInt16 nL = pPPortion->GetLines().Count() - 1;
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 );
aPaM.GetIndex() = nCharPos;
}
@@ -1640,17 +1640,17 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM )
long nX;
if ( mpImpl->mnTravelXPos == TRAVEL_X_DONTKNOW )
{
- nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, FALSE ).Left();
- mpImpl->mnTravelXPos = (USHORT)nX+1;
+ nX = mpImpl->mpTextEngine->GetEditCursor( rPaM, sal_False ).Left();
+ mpImpl->mnTravelXPos = (sal_uInt16)nX+1;
}
else
nX = mpImpl->mnTravelXPos;
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), sal_False );
if ( nLine < ( pPPortion->GetLines().Count() - 1 ) )
{
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX );
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX );
aPaM.GetIndex() = nCharPos;
// Sonderbehandlung siehe CursorUp...
@@ -1662,7 +1662,7 @@ TextPaM TextView::CursorDown( const TextPaM& rPaM )
{
aPaM.GetPara()++;
pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 );
+ sal_uInt16 nCharPos = mpImpl->mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 );
aPaM.GetIndex() = nCharPos;
TextLine* pLine = pPPortion->GetLines().GetObject( 0 );
if ( ( aPaM.GetIndex() == pLine->GetEnd() ) && ( aPaM.GetIndex() > pLine->GetStart() ) && ( pPPortion->GetLines().Count() > 1 ) )
@@ -1677,7 +1677,7 @@ TextPaM TextView::CursorStartOfLine( const TextPaM& rPaM )
TextPaM aPaM( rPaM );
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
TextLine* pLine = pPPortion->GetLines().GetObject( nLine );
aPaM.GetIndex() = pLine->GetStart();
@@ -1689,13 +1689,13 @@ TextPaM TextView::CursorEndOfLine( const TextPaM& rPaM )
TextPaM aPaM( rPaM );
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
- USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ sal_uInt16 nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
TextLine* pLine = pPPortion->GetLines().GetObject( nLine );
aPaM.GetIndex() = pLine->GetEnd();
if ( pLine->GetEnd() > pLine->GetStart() ) // Leerzeile
{
- xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((USHORT)(aPaM.GetIndex()-1) );
+ xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((sal_uInt16)(aPaM.GetIndex()-1) );
if ( ( cLastChar == ' ' ) && ( aPaM.GetIndex() != pPPortion->GetNode()->GetText().Len() ) )
{
// Bei einem Blank in einer autom. umgebrochenen Zeile macht es Sinn,
@@ -1730,7 +1730,7 @@ TextPaM TextView::CursorStartOfDoc()
TextPaM TextView::CursorEndOfDoc()
{
- ULONG nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().Count() - 1;
+ sal_uLong nNode = mpImpl->mpTextEngine->mpDoc->GetNodes().Count() - 1;
TextNode* pNode = mpImpl->mpTextEngine->mpDoc->GetNodes().GetObject( nNode );
TextPaM aPaM( nNode, pNode->GetText().Len() );
return aPaM;
@@ -1763,11 +1763,11 @@ TextPaM TextView::PageDown( const TextPaM& rPaM )
return aPaM;
}
-void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpecial )
+void TextView::ImpShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool bSpecial )
{
if ( mpImpl->mpTextEngine->IsFormatting() )
return;
- if ( mpImpl->mpTextEngine->GetUpdateMode() == FALSE )
+ if ( mpImpl->mpTextEngine->GetUpdateMode() == sal_False )
return;
if ( mpImpl->mpTextEngine->IsInUndo() )
return;
@@ -1786,7 +1786,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
{
TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
mpImpl->mbCursorAtEndOfLine =
- pParaPortion->GetLineNumber( aPaM.GetIndex(), TRUE ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_True ) != pParaPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
}
if ( !IsInsertMode() && !mpImpl->maSelection.HasRange() )
@@ -1795,12 +1795,12 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
if ( pNode->GetText().Len() && ( aPaM.GetIndex() < pNode->GetText().Len() ) )
{
// If we are behind a portion, and the next portion has other direction, we must change position...
- aEditCursor.Left() = aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aPaM, FALSE, TRUE ).Left();
+ aEditCursor.Left() = aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aPaM, sal_False, sal_True ).Left();
TEParaPortion* pParaPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- USHORT nTextPortionStart = 0;
- USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, TRUE );
+ sal_uInt16 nTextPortionStart = 0;
+ sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, sal_True );
TETextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion );
if ( pTextPortion->GetKind() == PORTIONKIND_TAB )
{
@@ -1812,8 +1812,8 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
}
else
{
- TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), (USHORT)i18n::CharacterIteratorMode::SKIPCELL );
- aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, TRUE ).Left();
+ TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL );
+ aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, sal_True ).Left();
}
}
}
@@ -1862,7 +1862,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
}
// X kann durch das 'bischen mehr' falsch sein:
-// ULONG nMaxTextWidth = mpImpl->mpTextEngine->GetMaxTextWidth();
+// sal_uLong nMaxTextWidth = mpImpl->mpTextEngine->GetMaxTextWidth();
// if ( !nMaxTextWidth || ( nMaxTextWidth > 0x7FFFFFFF ) )
// nMaxTextWidth = 0x7FFFFFFF;
// long nMaxX = (long)nMaxTextWidth - aOutSz.Width();
@@ -1900,7 +1900,7 @@ void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpec
mpImpl->mpCursor->Show();
}
-BOOL TextView::SetCursorAtPoint( const Point& rPosPixel )
+sal_Bool TextView::SetCursorAtPoint( const Point& rPosPixel )
{
mpImpl->mpTextEngine->CheckIdleFormatter();
@@ -1926,50 +1926,50 @@ BOOL TextView::SetCursorAtPoint( const Point& rPosPixel )
ShowSelection( aTmpNewSel );
}
- BOOL bForceCursor = mpImpl->mpDDInfo ? FALSE : TRUE; // && !mbInSelection
- ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, FALSE );
- return TRUE;
+ sal_Bool bForceCursor = mpImpl->mpDDInfo ? sal_False : sal_True; // && !mbInSelection
+ ImpShowCursor( mpImpl->mbAutoScroll, bForceCursor, sal_False );
+ return sal_True;
}
-BOOL TextView::IsSelectionAtPoint( const Point& rPosPixel )
+sal_Bool TextView::IsSelectionAtPoint( const Point& rPosPixel )
{
// if ( !Rectangle( Point(), mpImpl->mpWindow->GetOutputSizePixel() ).IsInside( rPosPixel ) && !mbInSelection )
-// return FALSE;
+// return sal_False;
Point aDocPos = GetDocPos( rPosPixel );
- TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos, FALSE );
+ TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aDocPos, sal_False );
// Bei Hyperlinks D&D auch ohne Selektion starten.
// BeginDrag wird aber nur gerufen, wenn IsSelectionAtPoint()
// Problem: IsSelectionAtPoint wird bei Command() nicht gerufen,
- // wenn vorher im MBDown schon FALSE returnt wurde.
+ // wenn vorher im MBDown schon sal_False returnt wurde.
return ( IsInSelection( aPaM ) ||
( /* mpImpl->mpSelEngine->IsInCommand() && */ mpImpl->mpTextEngine->FindAttrib( aPaM, TEXTATTR_HYPERLINK ) ) );
}
-BOOL TextView::IsInSelection( const TextPaM& rPaM )
+sal_Bool TextView::IsInSelection( const TextPaM& rPaM )
{
TextSelection aSel = mpImpl->maSelection;
aSel.Justify();
- ULONG nStartNode = aSel.GetStart().GetPara();
- ULONG nEndNode = aSel.GetEnd().GetPara();
- ULONG nCurNode = rPaM.GetPara();
+ sal_uLong nStartNode = aSel.GetStart().GetPara();
+ sal_uLong nEndNode = aSel.GetEnd().GetPara();
+ sal_uLong nCurNode = rPaM.GetPara();
if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) )
- return TRUE;
+ return sal_True;
if ( nStartNode == nEndNode )
{
if ( nCurNode == nStartNode )
if ( ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) )
- return TRUE;
+ return sal_True;
}
else if ( ( nCurNode == nStartNode ) && ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) )
- return TRUE;
+ return sal_True;
else if ( ( nCurNode == nEndNode ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) )
- return TRUE;
+ return sal_True;
- return FALSE;
+ return sal_False;
}
void TextView::ImpHideDDCursor()
@@ -1977,7 +1977,7 @@ void TextView::ImpHideDDCursor()
if ( mpImpl->mpDDInfo && mpImpl->mpDDInfo->mbVisCursor )
{
mpImpl->mpDDInfo->maCursor.Hide();
- mpImpl->mpDDInfo->mbVisCursor = FALSE;
+ mpImpl->mpDDInfo->mbVisCursor = sal_False;
}
}
@@ -1985,7 +1985,7 @@ void TextView::ImpShowDDCursor()
{
if ( !mpImpl->mpDDInfo->mbVisCursor )
{
- Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, TRUE );
+ Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, sal_True );
aCursor.Right()++;
aCursor.SetPos( GetWindowPos( aCursor.TopLeft() ) );
@@ -1993,11 +1993,11 @@ void TextView::ImpShowDDCursor()
mpImpl->mpDDInfo->maCursor.SetPos( aCursor.TopLeft() );
mpImpl->mpDDInfo->maCursor.SetSize( aCursor.GetSize() );
mpImpl->mpDDInfo->maCursor.Show();
- mpImpl->mpDDInfo->mbVisCursor = TRUE;
+ mpImpl->mpDDInfo->mbVisCursor = sal_True;
}
}
-void TextView::SetPaintSelection( BOOL bPaint )
+void TextView::SetPaintSelection( sal_Bool bPaint )
{
if ( bPaint != mpImpl->mbPaintSelection )
{
@@ -2006,7 +2006,7 @@ void TextView::SetPaintSelection( BOOL bPaint )
}
}
-void TextView::SetHighlightSelection( BOOL bSelectByHighlight )
+void TextView::SetHighlightSelection( sal_Bool bSelectByHighlight )
{
if ( bSelectByHighlight != mpImpl->mbHighlightSelection )
{
@@ -2015,14 +2015,14 @@ void TextView::SetHighlightSelection( BOOL bSelectByHighlight )
}
}
-BOOL TextView::Read( SvStream& rInput )
+sal_Bool TextView::Read( SvStream& rInput )
{
- BOOL bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection );
+ sal_Bool bDone = mpImpl->mpTextEngine->Read( rInput, &mpImpl->maSelection );
ShowCursor();
return bDone;
}
-BOOL TextView::Write( SvStream& rOutput )
+sal_Bool TextView::Write( SvStream& rOutput )
{
return mpImpl->mpTextEngine->Read( rOutput, &mpImpl->maSelection );
}
@@ -2037,17 +2037,17 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const
bTruncated = true;
}
- ULONG nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen();
+ sal_uLong nMaxLen = mpImpl->mpTextEngine->GetMaxTextLen();
// 0 means unlimited, there is just the String API limit handled above
if( nMaxLen != 0 )
{
- ULONG nCurLen = mpImpl->mpTextEngine->GetTextLen();
+ sal_uLong nCurLen = mpImpl->mpTextEngine->GetTextLen();
sal_uInt32 nNewLen = rNewText.getLength();
if ( nCurLen + nNewLen > nMaxLen )
{
// see how much text will be replaced
- ULONG nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection );
+ sal_uLong nSelLen = mpImpl->mpTextEngine->GetTextLen( mpImpl->maSelection );
if ( nCurLen + nNewLen - nSelLen > nMaxLen )
{
sal_uInt32 nTruncatedLen = static_cast<sal_uInt32>(nMaxLen - (nCurLen - nSelLen));
@@ -2059,12 +2059,12 @@ bool TextView::ImplTruncateNewText( rtl::OUString& rNewText ) const
return bTruncated;
}
-BOOL TextView::ImplCheckTextLen( const String& rNewText )
+sal_Bool TextView::ImplCheckTextLen( const String& rNewText )
{
- BOOL bOK = TRUE;
+ sal_Bool bOK = sal_True;
if ( mpImpl->mpTextEngine->GetMaxTextLen() )
{
- ULONG n = mpImpl->mpTextEngine->GetTextLen();
+ sal_uLong n = mpImpl->mpTextEngine->GetTextLen();
n += rNewText.Len();
if ( n > mpImpl->mpTextEngine->GetMaxTextLen() )
{
@@ -2075,7 +2075,7 @@ BOOL TextView::ImplCheckTextLen( const String& rNewText )
// Beep hat hier eigentlich nichts verloren, sondern lieber ein Hdl,
// aber so funktioniert es wenigstens in ME, BasicIDE, SourceView
Sound::Beep();
- bOK = FALSE;
+ bOK = sal_False;
}
}
}
@@ -2092,12 +2092,12 @@ void TextView::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd:
delete mpImpl->mpDDInfo;
mpImpl->mpDDInfo = new TextDDInfo;
- mpImpl->mpDDInfo->mbStarterOfDD = TRUE;
+ mpImpl->mpDDInfo->mbStarterOfDD = sal_True;
TETextDataObject* pDataObj = new TETextDataObject( GetSelected() );
if ( mpImpl->mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) ) // Dann auch als HTML
- mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, TRUE );
+ mpImpl->mpTextEngine->Write( pDataObj->GetHTMLStream(), &mpImpl->maSelection, sal_True );
/*
@@ -2141,7 +2141,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
{
SolarMutexGuard aVclGuard;
- BOOL bChanges = FALSE;
+ sal_Bool bChanges = sal_False;
if ( !mpImpl->mbReadOnly && mpImpl->mpDDInfo )
{
ImpHideDDCursor();
@@ -2149,17 +2149,17 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
// Daten fuer das loeschen nach einem DROP_MOVE:
TextSelection aPrevSel( mpImpl->maSelection );
aPrevSel.Justify();
- ULONG nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount();
- USHORT nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() );
+ sal_uLong nPrevParaCount = mpImpl->mpTextEngine->GetParagraphCount();
+ sal_uInt16 nPrevStartParaLen = mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() );
- BOOL bStarterOfDD = FALSE;
- for ( USHORT nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; )
- bStarterOfDD = mpImpl->mpTextEngine->GetView( --nView )->mpImpl->mpDDInfo ? mpImpl->mpTextEngine->GetView( nView )->mpImpl->mpDDInfo->mbStarterOfDD : FALSE;
+ sal_Bool bStarterOfDD = sal_False;
+ for ( sal_uInt16 nView = mpImpl->mpTextEngine->GetViewCount(); nView && !bStarterOfDD; )
+ bStarterOfDD = mpImpl->mpTextEngine->GetView( --nView )->mpImpl->mpDDInfo ? mpImpl->mpTextEngine->GetView( nView )->mpImpl->mpDDInfo->mbStarterOfDD : sal_False;
HideSelection();
ImpSetSelection( mpImpl->mpDDInfo->maDropPos );
- mpImpl->mpTextEngine->UndoActionStart( TEXTUNDO_DRAGANDDROP );
+ mpImpl->mpTextEngine->UndoActionStart();
String aText;
uno::Reference< datatransfer::XTransferable > xDataObj = rDTDE.Transferable;
@@ -2188,7 +2188,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
mpImpl->mpTextEngine->SetAttrib( TextAttribProtect(),
aTempStart.GetPara(),
aTempStart.GetIndex(),
- mpImpl->maSelection.GetEnd().GetIndex(), FALSE );
+ mpImpl->maSelection.GetEnd().GetIndex(), sal_False );
}
if ( aPrevSel.HasRange() &&
@@ -2200,7 +2200,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
( ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() )
&& ( mpImpl->mpDDInfo->maDropPos.GetIndex() < aPrevSel.GetStart().GetIndex() ) ) )
{
- ULONG nNewParasBeforeSelection =
+ sal_uLong nNewParasBeforeSelection =
mpImpl->mpTextEngine->GetParagraphCount() - nPrevParaCount;
aPrevSel.GetStart().GetPara() += nNewParasBeforeSelection;
@@ -2208,7 +2208,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
if ( mpImpl->mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() )
{
- USHORT nNewChars =
+ sal_uInt16 nNewChars =
mpImpl->mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ) - nPrevStartParaLen;
aPrevSel.GetStart().GetIndex() =
@@ -2237,7 +2237,7 @@ void TextView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEv
mpImpl->mpTextEngine->ImpDeleteText( aPrevSel );
}
- mpImpl->mpTextEngine->UndoActionEnd( TEXTUNDO_DRAGANDDROP );
+ mpImpl->mpTextEngine->UndoActionEnd();
delete mpImpl->mpDDInfo;
mpImpl->mpDDInfo = 0;
@@ -2370,7 +2370,7 @@ sal_Int32 TextView::GetLineNumberOfCursorInSelection() const
{
TextPaM aPaM = GetSelection().GetEnd();
TEParaPortion* pPPortion = mpImpl->mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
- nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ nLineNo = pPPortion->GetLineNumber( aPaM.GetIndex(), sal_False );
if( mpImpl->mbCursorAtEndOfLine )
--nLineNo;
}
@@ -2401,12 +2401,12 @@ void TextSelFunctionSet::CreateAnchor()
mpView->ImpSetSelection( mpView->mpImpl->maSelection.GetEnd() );
}
-BOOL TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOOL )
+sal_Bool TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool )
{
return mpView->SetCursorAtPoint( rPointPixel );
}
-BOOL TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
+sal_Bool TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
{
return mpView->IsSelectionAtPoint( rPointPixel );
}
@@ -2429,31 +2429,31 @@ TextEngine* TextView::GetTextEngine() const
{ return mpImpl->mpTextEngine; }
Window* TextView::GetWindow() const
{ return mpImpl->mpWindow; }
-void TextView::EnableCursor( BOOL bEnable )
+void TextView::EnableCursor( sal_Bool bEnable )
{ mpImpl->mbCursorEnabled = bEnable; }
-BOOL TextView::IsCursorEnabled() const
+sal_Bool TextView::IsCursorEnabled() const
{ return mpImpl->mbCursorEnabled; }
void TextView::SetStartDocPos( const Point& rPos )
{ mpImpl->maStartDocPos = rPos; }
const Point& TextView::GetStartDocPos() const
{ return mpImpl->maStartDocPos; }
-void TextView::SetAutoIndentMode( BOOL bAutoIndent )
+void TextView::SetAutoIndentMode( sal_Bool bAutoIndent )
{ mpImpl->mbAutoIndent = bAutoIndent; }
-BOOL TextView::IsAutoIndentMode() const
+sal_Bool TextView::IsAutoIndentMode() const
{ return mpImpl->mbAutoIndent; }
-BOOL TextView::IsReadOnly() const
+sal_Bool TextView::IsReadOnly() const
{ return mpImpl->mbReadOnly; }
-void TextView::SetAutoScroll( BOOL bAutoScroll )
+void TextView::SetAutoScroll( sal_Bool bAutoScroll )
{ mpImpl->mbAutoScroll = bAutoScroll; }
-BOOL TextView::IsAutoScroll() const
+sal_Bool TextView::IsAutoScroll() const
{ return mpImpl->mbAutoScroll; }
-BOOL TextView::IsPaintSelection() const
+sal_Bool TextView::IsPaintSelection() const
{ return mpImpl->mbPaintSelection; }
-BOOL TextView::IsHighlightSelection() const
+sal_Bool TextView::IsHighlightSelection() const
{ return mpImpl->mbHighlightSelection; }
-BOOL TextView::HasSelection() const
+sal_Bool TextView::HasSelection() const
{ return mpImpl->maSelection.HasRange(); }
-BOOL TextView::IsInsertMode() const
+sal_Bool TextView::IsInsertMode() const
{ return mpImpl->mbInsertMode; }
void TextView::SupportProtectAttribute(sal_Bool bSupport)
{ mpImpl->mbSupportProtectAttribute = bSupport;}
diff --git a/svtools/source/edit/txtattr.cxx b/svtools/source/edit/txtattr.cxx
index 57b4ade43379..022a40ae848f 100644
--- a/svtools/source/edit/txtattr.cxx
+++ b/svtools/source/edit/txtattr.cxx
@@ -29,7 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_svtools.hxx"
-#include <txtattr.hxx>
+#include <svtools/txtattr.hxx>
#include <vcl/font.hxx>
diff --git a/svtools/source/edit/xtextedt.cxx b/svtools/source/edit/xtextedt.cxx
index e7c77e7e65ce..eaef852b9d6d 100644
--- a/svtools/source/edit/xtextedt.cxx
+++ b/svtools/source/edit/xtextedt.cxx
@@ -53,12 +53,12 @@ ExtTextEngine::~ExtTextEngine()
TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
{
TextSelection aSel( rCursor );
- USHORT nPos = rCursor.GetIndex();
- ULONG nPara = rCursor.GetPara();
- ULONG nParas = GetParagraphCount();
+ sal_uInt16 nPos = rCursor.GetIndex();
+ sal_uLong nPara = rCursor.GetPara();
+ sal_uLong nParas = GetParagraphCount();
if ( ( nPara < nParas ) && ( nPos < GetTextLen( nPara ) ) )
{
- USHORT nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) );
+ sal_uInt16 nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) );
if ( nMatchChar != STRING_NOTFOUND )
{
if ( ( nMatchChar % 2 ) == 0 )
@@ -67,8 +67,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
sal_Unicode nSC = maGroupChars.GetChar( nMatchChar );
sal_Unicode nEC = maGroupChars.GetChar( nMatchChar+1 );
- USHORT nCur = nPos+1;
- USHORT nLevel = 1;
+ sal_uInt16 nCur = nPos+1;
+ sal_uInt16 nLevel = 1;
while ( nLevel && ( nPara < nParas ) )
{
XubString aStr = GetText( nPara );
@@ -103,8 +103,8 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
xub_Unicode nEC = maGroupChars.GetChar( nMatchChar );
xub_Unicode nSC = maGroupChars.GetChar( nMatchChar-1 );
- USHORT nCur = rCursor.GetIndex()-1;
- USHORT nLevel = 1;
+ sal_uInt16 nCur = rCursor.GetIndex()-1;
+ sal_uInt16 nLevel = 1;
while ( nLevel )
{
if ( GetTextLen( nPara ) )
@@ -149,12 +149,12 @@ TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
return aSel;
}
-BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSearchOptions, BOOL bForward )
+sal_Bool ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSearchOptions, sal_Bool bForward )
{
TextSelection aSel( rSel );
aSel.Justify();
- BOOL bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
+ sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
TextPaM aStartPaM( aSel.GetEnd() );
if ( aSel.HasRange() && ( ( bSearchInSelection && bForward ) || ( !bSearchInSelection && !bForward ) ) )
@@ -163,7 +163,7 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea
}
bool bFound = false;
- ULONG nStartNode, nEndNode;
+ sal_uLong nStartNode, nEndNode;
if ( bSearchInSelection )
nEndNode = bForward ? aSel.GetEnd().GetPara() : aSel.GetStart().GetPara();
@@ -177,13 +177,13 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea
utl::TextSearch aSearcher( rSearchOptions );
// ueber die Absaetze iterieren...
- for ( ULONG nNode = nStartNode;
+ for ( sal_uLong nNode = nStartNode;
bForward ? ( nNode <= nEndNode) : ( nNode >= nEndNode );
bForward ? nNode++ : nNode-- )
{
String aText = GetText( nNode );
- USHORT nStartPos = 0;
- USHORT nEndPos = aText.Len();
+ sal_uInt16 nStartPos = 0;
+ sal_uInt16 nEndPos = aText.Len();
if ( nNode == nStartNode )
{
if ( bForward )
@@ -213,7 +213,7 @@ BOOL ExtTextEngine::Search( TextSelection& rSel, const util::SearchOptions& rSea
// Ueber den Absatz selektieren?
// Select over the paragraph?
// FIXME This should be max long...
- if( nEndPos == sal::static_int_cast<USHORT>(-1) ) // USHORT for 0 and -1 !
+ if( nEndPos == sal::static_int_cast<sal_uInt16>(-1) ) // sal_uInt16 for 0 and -1 !
{
if ( (rSel.GetEnd().GetPara()+1) < GetParagraphCount() )
{
@@ -250,34 +250,34 @@ ExtTextView::~ExtTextView()
{
}
-BOOL ExtTextView::MatchGroup()
+sal_Bool ExtTextView::MatchGroup()
{
TextSelection aTmpSel( GetSelection() );
aTmpSel.Justify();
if ( ( aTmpSel.GetStart().GetPara() != aTmpSel.GetEnd().GetPara() ) ||
( ( aTmpSel.GetEnd().GetIndex() - aTmpSel.GetStart().GetIndex() ) > 1 ) )
{
- return FALSE;
+ return sal_False;
}
TextSelection aMatchSel = ((ExtTextEngine*)GetTextEngine())->MatchGroup( aTmpSel.GetStart() );
if ( aMatchSel.HasRange() )
SetSelection( aMatchSel );
- return aMatchSel.HasRange() ? TRUE : FALSE;
+ return aMatchSel.HasRange() ? sal_True : sal_False;
}
-BOOL ExtTextView::Search( const util::SearchOptions& rSearchOptions, BOOL bForward )
+sal_Bool ExtTextView::Search( const util::SearchOptions& rSearchOptions, sal_Bool bForward )
{
- BOOL bFound = FALSE;
+ sal_Bool bFound = sal_False;
TextSelection aSel( GetSelection() );
if ( ((ExtTextEngine*)GetTextEngine())->Search( aSel, rSearchOptions, bForward ) )
{
- bFound = TRUE;
+ bFound = sal_True;
// Erstmal den Anfang des Wortes als Selektion einstellen,
// damit das ganze Wort in den sichtbaren Bereich kommt.
SetSelection( aSel.GetStart() );
- ShowCursor( TRUE, FALSE );
+ ShowCursor( sal_True, sal_False );
}
else
{
@@ -290,9 +290,9 @@ BOOL ExtTextView::Search( const util::SearchOptions& rSearchOptions, BOOL bForwa
return bFound;
}
-USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAll, BOOL bForward )
+sal_uInt16 ExtTextView::Replace( const util::SearchOptions& rSearchOptions, sal_Bool bAll, sal_Bool bForward )
{
- USHORT nFound = 0;
+ sal_uInt16 nFound = 0;
if ( !bAll )
{
@@ -317,7 +317,7 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
// HideSelection();
TextSelection aSel;
- BOOL bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
+ sal_Bool bSearchInSelection = (0 != (rSearchOptions.searchFlag & util::SearchFlags::REG_NOT_BEGINOFLINE) );
if ( bSearchInSelection )
{
aSel = GetSelection();
@@ -326,9 +326,9 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
TextSelection aSearchSel( aSel );
- BOOL bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE );
+ sal_Bool bFound = pTextEngine->Search( aSel, rSearchOptions, sal_True );
if ( bFound )
- pTextEngine->UndoActionStart( XTEXTUNDO_REPLACEALL );
+ pTextEngine->UndoActionStart();
while ( bFound )
{
nFound++;
@@ -336,42 +336,42 @@ USHORT ExtTextView::Replace( const util::SearchOptions& rSearchOptions, BOOL bAl
TextPaM aNewStart = pTextEngine->ImpInsertText( aSel, rSearchOptions.replaceString );
aSel = aSearchSel;
aSel.GetStart() = aNewStart;
- bFound = pTextEngine->Search( aSel, rSearchOptions, TRUE );
+ bFound = pTextEngine->Search( aSel, rSearchOptions, sal_True );
}
if ( nFound )
{
SetSelection( aSel.GetStart() );
pTextEngine->FormatAndUpdate( this );
- pTextEngine->UndoActionEnd( XTEXTUNDO_REPLACEALL );
+ pTextEngine->UndoActionEnd();
}
}
return nFound;
}
-BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
+sal_Bool ExtTextView::ImpIndentBlock( sal_Bool bRight )
{
- BOOL bDone = FALSE;
+ sal_Bool bDone = sal_False;
TextSelection aSel = GetSelection();
aSel.Justify();
HideSelection();
- GetTextEngine()->UndoActionStart( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK );
+ GetTextEngine()->UndoActionStart();
- ULONG nStartPara = aSel.GetStart().GetPara();
- ULONG nEndPara = aSel.GetEnd().GetPara();
+ sal_uLong nStartPara = aSel.GetStart().GetPara();
+ sal_uLong nEndPara = aSel.GetEnd().GetPara();
if ( aSel.HasRange() && !aSel.GetEnd().GetIndex() )
{
nEndPara--; // den dann nicht einruecken...
}
- for ( ULONG nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ for ( sal_uLong nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
if ( bRight )
{
// Tabs hinzufuegen
GetTextEngine()->ImpInsertText( TextPaM( nPara, 0 ), '\t' );
- bDone = TRUE;
+ bDone = sal_True;
}
else
{
@@ -382,14 +382,14 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
( aText.GetChar( 0 ) == ' ' ) ) )
{
GetTextEngine()->ImpDeleteText( TextSelection( TextPaM( nPara, 0 ), TextPaM( nPara, 1 ) ) );
- bDone = TRUE;
+ bDone = sal_True;
}
}
}
- GetTextEngine()->UndoActionEnd( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK );
+ GetTextEngine()->UndoActionEnd();
- BOOL bRange = aSel.HasRange();
+ sal_Bool bRange = aSel.HasRange();
if ( bRight )
{
aSel.GetStart().GetIndex()++;
@@ -410,14 +410,14 @@ BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
return bDone;
}
-BOOL ExtTextView::IndentBlock()
+sal_Bool ExtTextView::IndentBlock()
{
- return ImpIndentBlock( TRUE );
+ return ImpIndentBlock( sal_True );
}
-BOOL ExtTextView::UnindentBlock()
+sal_Bool ExtTextView::UnindentBlock()
{
- return ImpIndentBlock( FALSE );
+ return ImpIndentBlock( sal_False );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */