diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-15 14:15:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-16 08:17:34 +0200 |
commit | e52b83ec3f820333e052d0d756268e878086611d (patch) | |
tree | 36a9162b2cec1e2a97ccae101171aa850da8b734 /reportdesign | |
parent | 4ca9e8fa3a040c18221c947a651469a89029282e (diff) |
convert DlgEdMode to scoped enum
and drop unused RPTUI_READONLY enumerator
Change-Id: I863ffc40b3b8f065d01e9570134ee1e2cef400c1
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/inc/ReportDefines.hxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/DesignView.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 24 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportSection.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/report/dlgedfunc.cxx | 25 |
5 files changed, 29 insertions, 32 deletions
diff --git a/reportdesign/source/ui/inc/ReportDefines.hxx b/reportdesign/source/ui/inc/ReportDefines.hxx index 0cca0d817f5b..1b8438f12729 100644 --- a/reportdesign/source/ui/inc/ReportDefines.hxx +++ b/reportdesign/source/ui/inc/ReportDefines.hxx @@ -21,7 +21,7 @@ namespace rptui { - enum DlgEdMode { RPTUI_INSERT, RPTUI_SELECT, RPTUI_TEST, RPTUI_READONLY }; + enum class DlgEdMode { Insert, Select, Test }; #define REPORT_STARTMARKER_WIDTH 120 #define REPORT_ENDMARKER_WIDTH 10 diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index a409d5f6f46a..265c73bbb9d5 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -94,7 +94,7 @@ ODesignView::ODesignView( vcl::Window* pParent, ,m_pAddField(nullptr) ,m_pCurrentView(nullptr) ,m_pReportExplorer(nullptr) - ,m_eMode( RPTUI_SELECT ) + ,m_eMode( DlgEdMode::Select ) ,m_eActObj( OBJ_NONE ) ,m_aGridSizeCoarse( 1000, 1000 ) // #i93595# 100TH_MM changed to grid using coarse 1 cm grid ,m_aGridSizeFine( 250, 250 ) // and a 0,25 cm subdivision for better visualisation @@ -284,7 +284,7 @@ IMPL_LINK_NOARG(ODesignView, MarkTimeout, Timer *, void) void ODesignView::SetMode( DlgEdMode _eNewMode ) { m_eMode = _eNewMode; - if ( m_eMode == RPTUI_SELECT ) + if ( m_eMode == DlgEdMode::Select ) m_eActObj = OBJ_NONE; m_aScrollWindow->SetMode(_eNewMode); diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 29ffb27fe61a..ef0fd07b40a1 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -536,7 +536,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = getCurrentSectionView() != nullptr; break; case SID_ESCAPE: - aReturn.bEnabled = getDesignView()->GetMode() == RPTUI_INSERT; + aReturn.bEnabled = getDesignView()->GetMode() == DlgEdMode::Insert; break; case SID_TERMINATE_INPLACEACTIVATION: aReturn.bEnabled = true; @@ -592,7 +592,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const break; case SID_OBJECT_SELECT: aReturn.bEnabled = true; - aReturn.bChecked = getDesignView()->GetMode() == RPTUI_SELECT; + aReturn.bChecked = getDesignView()->GetMode() == DlgEdMode::Select; break; case SID_INSERT_DIAGRAM: aReturn.bEnabled = isEditable(); @@ -1103,7 +1103,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > } break; case SID_ESCAPE: - getDesignView()->SetMode(RPTUI_SELECT); + getDesignView()->SetMode(DlgEdMode::Select); InvalidateFeature( SID_OBJECT_SELECT ); break; case SID_SELECT_ALL_EDITS: @@ -1176,41 +1176,41 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > getDesignView()->showRuler(m_bShowRuler = !m_bShowRuler); break; case SID_OBJECT_SELECT: - getDesignView()->SetMode(RPTUI_SELECT); + getDesignView()->SetMode(DlgEdMode::Select); InvalidateAll(); break; case SID_INSERT_DIAGRAM: - getDesignView()->SetMode( RPTUI_INSERT ); + getDesignView()->SetMode( DlgEdMode::Insert ); getDesignView()->SetInsertObj( OBJ_OLE2); createDefaultControl(aArgs); InvalidateAll(); break; case SID_FM_FIXEDTEXT: - getDesignView()->SetMode( RPTUI_INSERT ); + getDesignView()->SetMode( DlgEdMode::Insert ); getDesignView()->SetInsertObj( OBJ_DLG_FIXEDTEXT ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_INSERT_HFIXEDLINE: - getDesignView()->SetMode( RPTUI_INSERT ); + getDesignView()->SetMode( DlgEdMode::Insert ); getDesignView()->SetInsertObj( OBJ_DLG_HFIXEDLINE ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_INSERT_VFIXEDLINE: - getDesignView()->SetMode( RPTUI_INSERT ); + getDesignView()->SetMode( DlgEdMode::Insert ); getDesignView()->SetInsertObj( OBJ_DLG_VFIXEDLINE ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_FM_EDIT: - getDesignView()->SetMode( RPTUI_INSERT ); + getDesignView()->SetMode( DlgEdMode::Insert ); getDesignView()->SetInsertObj( OBJ_DLG_FORMATTEDFIELD ); createDefaultControl(aArgs); InvalidateAll(); break; case SID_FM_IMAGECONTROL: - getDesignView()->SetMode( RPTUI_INSERT ); + getDesignView()->SetMode( DlgEdMode::Insert ); getDesignView()->SetInsertObj( OBJ_DLG_IMAGECONTROL ); createDefaultControl(aArgs); InvalidateAll(); @@ -1334,7 +1334,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_DRAWTBX_CS_FLOWCHART: case SID_DRAWTBX_CS_CALLOUT: case SID_DRAWTBX_CS_STAR: - getDesignView()->SetMode( RPTUI_INSERT ); + getDesignView()->SetMode( DlgEdMode::Insert ); { URL aUrl = getURLForId(_nId); sal_Int32 nIndex = 1; @@ -3044,7 +3044,7 @@ sal_Bool SAL_CALL OReportController::select( const Any& aSelection ) if ( getDesignView() ) { getDesignView()->unmarkAllObjects(); - getDesignView()->SetMode(RPTUI_SELECT); + getDesignView()->SetMode(DlgEdMode::Select); uno::Sequence< uno::Reference<report::XReportComponent> > aElements; if ( aSelection >>= aElements ) diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 8f2337371878..684384e5ed61 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -86,7 +86,7 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re , m_pReportListener(nullptr) , m_xSection(_xSection) , m_nPaintEntranceCount(0) - , m_eMode(RPTUI_SELECT) + , m_eMode(DlgEdMode::Select) { //EnableChildTransparentMode(); SetHelpId(HID_REPORTSECTION); @@ -313,7 +313,7 @@ void OReportSection::SetMode( DlgEdMode eNewMode ) { if ( eNewMode != m_eMode ) { - if ( eNewMode == RPTUI_INSERT ) + if ( eNewMode == DlgEdMode::Insert ) { m_pFunc.reset(new DlgEdFuncInsert( this )); } @@ -322,7 +322,7 @@ void OReportSection::SetMode( DlgEdMode eNewMode ) m_pFunc.reset(new DlgEdFuncSelect( this )); } m_pFunc->setOverlappedControlColor(lcl_getOverlappedControlColor( ) ); - m_pModel->SetReadOnly(eNewMode == RPTUI_READONLY); + m_pModel->SetReadOnly(false); m_eMode = eNewMode; } } diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 1502d62d724d..009d686a3a24 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -170,20 +170,17 @@ bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.GetClicks() > 1 ) { // show property browser - if ( m_pParent->GetMode() != RPTUI_READONLY ) - { - uno::Sequence<beans::PropertyValue> aArgs(1); - aArgs[0].Name = "ShowProperties"; - aArgs[0].Value <<= true; - m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController().executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs); - m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView); - // TODO character in shapes - // SdrViewEvent aVEvt; - // m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt); - // if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) ) - // SetInEditMode(static_cast<SdrTextObj *>(aVEvt.pRootObj),rMEvt, sal_False); - bHandled = true; - } + uno::Sequence<beans::PropertyValue> aArgs(1); + aArgs[0].Name = "ShowProperties"; + aArgs[0].Value <<= true; + m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController().executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs); + m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView); + // TODO character in shapes + // SdrViewEvent aVEvt; + // m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt); + // if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) ) + // SetInEditMode(static_cast<SdrTextObj *>(aVEvt.pRootObj),rMEvt, sal_False); + bHandled = true; } else { |