diff options
Diffstat (limited to 'svx/source/editeng/impedit2.cxx')
-rw-r--r-- | svx/source/editeng/impedit2.cxx | 75 |
1 files changed, 36 insertions, 39 deletions
diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx index 6be5fc0ef0..63280a304c 100644 --- a/svx/source/editeng/impedit2.cxx +++ b/svx/source/editeng/impedit2.cxx @@ -2,13 +2,10 @@ * * 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 @@ -641,41 +638,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 ); |