diff options
Diffstat (limited to 'editeng/source/editeng/impedit2.cxx')
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 77 |
1 files changed, 37 insertions, 40 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index d6f8a54876..27d95e0979 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1,14 +1,11 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: impedit2.cxx,v $ - * $Revision: 1.124.40.1 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -635,41 +632,41 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) pView->GetWindow()->SetCursorRect(); } } - else if ( rCEvt.GetCommand() == COMMAND_SELECTIONCHANGE )
- {
- const CommandSelectionChangeData *pData = rCEvt.GetSelectionChangeData();
-
- ESelection aSelection = pView->GetSelection();
- aSelection.Adjust();
-
- if( pView->HasSelection() )
- {
- aSelection.nEndPos = aSelection.nStartPos;
- aSelection.nStartPos += pData->GetStart();
- aSelection.nEndPos += pData->GetEnd();
- }
- else
- {
- aSelection.nStartPos = pData->GetStart();
- aSelection.nEndPos = pData->GetEnd();
- }
- pView->SetSelection( aSelection );
- }
- else if ( rCEvt.GetCommand() == COMMAND_PREPARERECONVERSION )
- {
- if ( pView->HasSelection() )
- {
- ESelection aSelection = pView->GetSelection();
- aSelection.Adjust();
-
- if ( aSelection.nStartPara != aSelection.nEndPara )
- {
- xub_StrLen aParaLen = pEditEngine->GetTextLen( aSelection.nStartPara );
- aSelection.nEndPara = aSelection.nStartPara;
- aSelection.nEndPos = aParaLen;
- pView->SetSelection( aSelection );
- }
- }
+ else if ( rCEvt.GetCommand() == COMMAND_SELECTIONCHANGE ) + { + const CommandSelectionChangeData *pData = rCEvt.GetSelectionChangeData(); + + ESelection aSelection = pView->GetSelection(); + aSelection.Adjust(); + + if( pView->HasSelection() ) + { + aSelection.nEndPos = aSelection.nStartPos; + aSelection.nStartPos += pData->GetStart(); + aSelection.nEndPos += pData->GetEnd(); + } + else + { + aSelection.nStartPos = pData->GetStart(); + aSelection.nEndPos = pData->GetEnd(); + } + pView->SetSelection( aSelection ); + } + else if ( rCEvt.GetCommand() == COMMAND_PREPARERECONVERSION ) + { + if ( pView->HasSelection() ) + { + ESelection aSelection = pView->GetSelection(); + aSelection.Adjust(); + + if ( aSelection.nStartPara != aSelection.nEndPara ) + { + xub_StrLen aParaLen = pEditEngine->GetTextLen( aSelection.nStartPara ); + aSelection.nEndPara = aSelection.nStartPara; + aSelection.nEndPos = aParaLen; + pView->SetSelection( aSelection ); + } + } } GetSelEngine().Command( rCEvt ); |