Kaydet (Commit) 42344398 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

editeng: Simplify calls to HasSelection()

Change-Id: I424cd5aee41334aebfd9bc41e1f8a9aeb69b9827
Reviewed-on: https://gerrit.libreoffice.org/44582Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst bff8d843
...@@ -254,7 +254,7 @@ void EditView::SetSelection( const ESelection& rESel ) ...@@ -254,7 +254,7 @@ void EditView::SetSelection( const ESelection& rESel )
{ {
// If someone has just left an empty attribute, and then the outliner // If someone has just left an empty attribute, and then the outliner
// manipulates the selection: // manipulates the selection:
if ( !pImpEditView->GetEditSelection().HasRange() ) if ( !HasSelection() )
{ {
const ContentNode* pNode = pImpEditView->GetEditSelection().Max().GetNode(); const ContentNode* pNode = pImpEditView->GetEditSelection().Max().GetNode();
pImpEditView->pEditEngine->CursorMoved( pNode ); pImpEditView->pEditEngine->CursorMoved( pNode );
...@@ -781,7 +781,7 @@ void EditView::TransliterateText( TransliterationFlags nTransliterationMode ) ...@@ -781,7 +781,7 @@ void EditView::TransliterateText( TransliterationFlags nTransliterationMode )
void EditView::CompleteAutoCorrect( vcl::Window const * pFrameWin ) void EditView::CompleteAutoCorrect( vcl::Window const * pFrameWin )
{ {
if ( !pImpEditView->HasSelection() && pImpEditView->pEditEngine->pImpEditEngine->GetStatus().DoAutoCorrect() ) if ( !HasSelection() && pImpEditView->pEditEngine->pImpEditEngine->GetStatus().DoAutoCorrect() )
{ {
pImpEditView->DrawSelectionXOR(); pImpEditView->DrawSelectionXOR();
EditSelection aSel = pImpEditView->GetEditSelection(); EditSelection aSel = pImpEditView->GetEditSelection();
......
...@@ -1542,7 +1542,7 @@ bool ImpEditView::IsBulletArea( const Point& rPos, sal_Int32* pPara ) ...@@ -1542,7 +1542,7 @@ bool ImpEditView::IsBulletArea( const Point& rPos, sal_Int32* pPara )
void ImpEditView::CutCopy( css::uno::Reference< css::datatransfer::clipboard::XClipboard > const & rxClipboard, bool bCut ) void ImpEditView::CutCopy( css::uno::Reference< css::datatransfer::clipboard::XClipboard > const & rxClipboard, bool bCut )
{ {
if ( rxClipboard.is() && GetEditSelection().HasRange() ) if ( rxClipboard.is() && HasSelection() )
{ {
uno::Reference<datatransfer::XTransferable> xData = pEditEngine->CreateTransferable( GetEditSelection() ); uno::Reference<datatransfer::XTransferable> xData = pEditEngine->CreateTransferable( GetEditSelection() );
...@@ -1848,7 +1848,7 @@ void ImpEditView::dragGestureRecognized(const css::datatransfer::dnd::DragGestur ...@@ -1848,7 +1848,7 @@ void ImpEditView::dragGestureRecognized(const css::datatransfer::dnd::DragGestur
EditSelection aCopySel( GetEditSelection() ); EditSelection aCopySel( GetEditSelection() );
aCopySel.Adjust( pEditEngine->GetEditDoc() ); aCopySel.Adjust( pEditEngine->GetEditDoc() );
if ( GetEditSelection().HasRange() && bClickedInSelection ) if ( HasSelection() && bClickedInSelection )
{ {
pDragAndDropInfo.reset(new DragAndDropInfo()); pDragAndDropInfo.reset(new DragAndDropInfo());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment