Use constants instead of (possibly wrong) magic numbers
Change-Id: I0829d271337b9fe77341c62a1c2ef4d6ae62c727
This commit is contained in:
parent
9d0f86326c
commit
8353793c94
@ -901,7 +901,7 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
|
||||
}
|
||||
case SID_SELECTALL:
|
||||
{
|
||||
TextSelection aSel( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, 0xFFFF ) );
|
||||
TextSelection aSel( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) );
|
||||
TextView * pView = GetEditView();
|
||||
pView->SetSelection( aSel );
|
||||
pView->GetWindow()->GrabFocus();
|
||||
@ -1245,7 +1245,7 @@ sal_uInt16 ModulWindow::StartSearchAndReplace( const SvxSearchItem& rSearchItem,
|
||||
if ( !rSearchItem.GetBackward() )
|
||||
pView->SetSelection( TextSelection() );
|
||||
else
|
||||
pView->SetSelection( TextSelection( TextPaM( 0xFFFFFFFF, 0xFFFF ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) );
|
||||
pView->SetSelection( TextSelection( TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
|
||||
}
|
||||
|
||||
bool const bForward = !rSearchItem.GetBackward();
|
||||
|
@ -25,7 +25,8 @@
|
||||
#include <vcl/dllapi.h>
|
||||
|
||||
// for Notify, if all paragraphs were deleted
|
||||
#define TEXT_PARA_ALL 0xFFFFFFFF
|
||||
#define TEXT_PARA_ALL SAL_MAX_UINT32
|
||||
#define TEXT_INDEX_ALL SAL_MAX_INT32
|
||||
|
||||
class TextPaM
|
||||
{
|
||||
|
@ -414,7 +414,7 @@ void SwSrcView::Execute(SfxRequest& rReq)
|
||||
pTextView->Paste();
|
||||
break;
|
||||
case SID_SELECTALL:
|
||||
pTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) );
|
||||
pTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
|
||||
break;
|
||||
}
|
||||
aEditWin->Invalidate();
|
||||
@ -580,7 +580,7 @@ sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem,
|
||||
bool bAtStart = pTextView->GetSelection() == TextSelection( aPaM, aPaM );
|
||||
|
||||
if( !bForward )
|
||||
aPaM = TextPaM( TEXT_PARA_ALL, USHRT_MAX );
|
||||
aPaM = TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL );
|
||||
|
||||
if( bFromStart )
|
||||
{
|
||||
|
@ -2707,7 +2707,7 @@ void TextEngine::ValidatePaM( TextPaM& rPaM ) const
|
||||
if ( rPaM.GetPara() >= nParas )
|
||||
{
|
||||
rPaM.GetPara() = nParas ? nParas-1 : 0;
|
||||
rPaM.GetIndex() = 0xFFFF;
|
||||
rPaM.GetIndex() = TEXT_INDEX_ALL;
|
||||
}
|
||||
|
||||
const sal_Int32 nMaxIndex = GetTextLen( rPaM.GetPara() );
|
||||
|
@ -773,7 +773,7 @@ void TextWindow::KeyInput( const KeyEvent& rKEvent )
|
||||
( (nCode == KEY_A) && rKEvent.GetKeyCode().IsMod1() && !rKEvent.GetKeyCode().IsMod2() )
|
||||
)
|
||||
{
|
||||
mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) );
|
||||
mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
|
||||
bDone = true;
|
||||
}
|
||||
else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() )
|
||||
@ -879,7 +879,7 @@ void TextWindow::Command( const CommandEvent& rCEvt )
|
||||
mpExtTextEngine->SetModified( true );
|
||||
mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
|
||||
break;
|
||||
case SV_MENU_EDIT_SELECTALL: mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) );
|
||||
case SV_MENU_EDIT_SELECTALL: mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
|
||||
break;
|
||||
case SV_MENU_EDIT_INSERTSYMBOL:
|
||||
{
|
||||
@ -915,7 +915,7 @@ void TextWindow::GetFocus()
|
||||
// select everything, but do not scroll
|
||||
bool bAutoScroll = mpExtTextView->IsAutoScroll();
|
||||
mpExtTextView->SetAutoScroll( false );
|
||||
mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) );
|
||||
mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
|
||||
mpExtTextView->SetAutoScroll( bAutoScroll );
|
||||
bGotoCursor = false;
|
||||
}
|
||||
@ -1516,7 +1516,7 @@ bool VclMultiLineEdit::PreNotify( NotifyEvent& rNEvt )
|
||||
{
|
||||
if ( rKEvent.GetKeyCode().IsMod1() )
|
||||
pImpVclMEdit->GetTextWindow()->GetTextView()->
|
||||
SetSelection( TextSelection( TextPaM( 0xFFFF, 0xFFFF ) ) );
|
||||
SetSelection( TextSelection( TextPaM( TEXT_PARA_ALL, TEXT_INDEX_ALL ) ) );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user