diff options
author | Thomas Benisch <tbe@openoffice.org> | 2009-08-18 15:48:15 +0000 |
---|---|---|
committer | Thomas Benisch <tbe@openoffice.org> | 2009-08-18 15:48:15 +0000 |
commit | 7f85e315411933893caf6506b21375c7b9183975 (patch) | |
tree | af9b35e388509d5d712a734aec29c871166c6209 /chart2 | |
parent | 4b0d8825bbcc0492f730394e5051cd3d51e53576 (diff) |
#i12587# Inserting/editing arbitrary text objects in chart
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/main/ChartController_Window.cxx | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index b5f721909fdc..ac405192a5a5 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -564,21 +564,6 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt ) if( isDoubleClick(rMEvt) ) //do not change selection if double click return;//double click is handled further in mousebutton up - // #i12587# support for shapes in chart - if ( m_eDrawMode == CHARTDRAW_INSERT ) - { - if ( m_aSelection.hasSelection() ) - { - m_aSelection.clearSelection(); - } - if ( !pDrawViewWrapper->IsAction() ) - { - pDrawViewWrapper->BegCreateObj( aMPos); - } - impl_SetMousePointer( rMEvt ); - return; - } - SdrHdl* pHitSelectionHdl = 0; //switch from move to resize if handle is hit on a resizeable object if( m_aSelection.isResizeableObjectSelected() ) @@ -586,6 +571,22 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt ) //only change selection if no selection handles are hit if( !pHitSelectionHdl ) { + // #i12587# support for shapes in chart + if ( m_eDrawMode == CHARTDRAW_INSERT && + ( !pDrawViewWrapper->IsMarkedHit( aMPos ) || !m_aSelection.isDragableObjectSelected() ) ) + { + if ( m_aSelection.hasSelection() ) + { + m_aSelection.clearSelection(); + } + if ( !pDrawViewWrapper->IsAction() ) + { + pDrawViewWrapper->BegCreateObj( aMPos); + } + impl_SetMousePointer( rMEvt ); + return; + } + m_aSelection.adaptSelectionToNewPos( aMPos, pDrawViewWrapper , rMEvt.IsRight(), m_bWaitingForDoubleClick ); @@ -689,30 +690,27 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) } // #i12587# support for shapes in chart - if ( m_eDrawMode == CHARTDRAW_INSERT ) + if ( m_eDrawMode == CHARTDRAW_INSERT && pDrawViewWrapper->IsCreateObj() ) { - if ( pDrawViewWrapper->IsCreateObj() ) + pDrawViewWrapper->EndCreateObj( SDRCREATE_FORCEEND ); + if ( pDrawViewWrapper->AreObjectsMarked() ) { - pDrawViewWrapper->EndCreateObj( SDRCREATE_FORCEEND ); - if ( pDrawViewWrapper->AreObjectsMarked() ) + if ( pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT ) { - if ( pDrawViewWrapper->GetCurrentObjIdentifier() == OBJ_TEXT ) - { - executeDispatch_EditText(); - } - else - { - m_aSelection.adaptSelectionToNewPos( aMPos, pDrawViewWrapper, rMEvt.IsRight(), m_bWaitingForDoubleClick ); - m_aSelection.applySelection( pDrawViewWrapper ); - } + executeDispatch_EditText(); } else { m_aSelection.adaptSelectionToNewPos( aMPos, pDrawViewWrapper, rMEvt.IsRight(), m_bWaitingForDoubleClick ); m_aSelection.applySelection( pDrawViewWrapper ); - setDrawMode( CHARTDRAW_SELECT ); } } + else + { + m_aSelection.adaptSelectionToNewPos( aMPos, pDrawViewWrapper, rMEvt.IsRight(), m_bWaitingForDoubleClick ); + m_aSelection.applySelection( pDrawViewWrapper ); + setDrawMode( CHARTDRAW_SELECT ); + } } else if ( pDrawViewWrapper->IsDragObj() ) { @@ -1540,38 +1538,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent ) sal_uInt16 nModifier = rEvent.GetModifier(); BOOL bLeftDown = rEvent.IsLeft(); - if ( m_eDrawMode == CHARTDRAW_INSERT ) - { - // #i12587# support for shapes in chart - PointerStyle ePointerStyle = POINTER_DRAW_RECT; - SdrObjKind eKind = static_cast< SdrObjKind >( m_pDrawViewWrapper->GetCurrentObjIdentifier() ); - switch ( eKind ) - { - case OBJ_LINE: - { - ePointerStyle = POINTER_DRAW_LINE; - } - break; - case OBJ_RECT: - { - ePointerStyle = POINTER_DRAW_RECT; - } - break; - case OBJ_TEXT: - { - ePointerStyle = POINTER_DRAW_TEXT; - } - break; - default: - { - ePointerStyle = POINTER_DRAW_RECT; - } - break; - } - pWindow->SetPointer( Pointer( ePointerStyle ) ); - return; - } - else if ( m_pDrawViewWrapper->IsTextEdit() ) + if ( m_pDrawViewWrapper->IsTextEdit() ) { if( m_pDrawViewWrapper->IsTextEditHit( aMousePos, HITPIX) ) { @@ -1632,6 +1599,39 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent ) } else { + // #i12587# support for shapes in chart + if ( m_eDrawMode == CHARTDRAW_INSERT && + ( !m_pDrawViewWrapper->IsMarkedHit( aMousePos ) || !m_aSelection.isDragableObjectSelected() ) ) + { + PointerStyle ePointerStyle = POINTER_DRAW_RECT; + SdrObjKind eKind = static_cast< SdrObjKind >( m_pDrawViewWrapper->GetCurrentObjIdentifier() ); + switch ( eKind ) + { + case OBJ_LINE: + { + ePointerStyle = POINTER_DRAW_LINE; + } + break; + case OBJ_RECT: + { + ePointerStyle = POINTER_DRAW_RECT; + } + break; + case OBJ_TEXT: + { + ePointerStyle = POINTER_DRAW_TEXT; + } + break; + default: + { + ePointerStyle = POINTER_DRAW_RECT; + } + break; + } + pWindow->SetPointer( Pointer( ePointerStyle ) ); + return; + } + ::rtl::OUString aHitObjectCID( SelectionHelper::getHitObjectCID( aMousePos, *m_pDrawViewWrapper, true /*bGetDiagramInsteadOf_Wall*/ )); |