convert ShellModes to scoped enum

and drop read-only SHELL_MODE_DRAW_CTRL enumerator

Change-Id: I2ccaeb492912c876b89ff9b5dccaa99e28a268b7
This commit is contained in:
Noel Grandin 2017-02-10 11:15:26 +02:00
parent 4f52b3b052
commit d8499c45eb
12 changed files with 165 additions and 169 deletions

View File

@ -138,6 +138,7 @@ for d in definitionSet:
"include/svtools/svtabbx.hxx", "include/svtools/svtabbx.hxx",
"include/vcl/print.hxx", # NupOrderType, from UI combobox "include/vcl/print.hxx", # NupOrderType, from UI combobox
"sw/source/uibase/inc/swcont.hxx", # RegionMode, from UI; ContentTypeId, from UI(registry) "sw/source/uibase/inc/swcont.hxx", # RegionMode, from UI; ContentTypeId, from UI(registry)
"sw/inc/toxe.hxx", # ToxAuthorityType (from UI)
# represents constants from an external API # represents constants from an external API
"opencl/inc/opencl_device_selection.h", "opencl/inc/opencl_device_selection.h",
"vcl/inc/sft.hxx", "vcl/inc/sft.hxx",

View File

@ -95,24 +95,23 @@ const long nScrollY = 30;
#define MAX_MARKS 5 #define MAX_MARKS 5
enum ShellModes enum class ShellMode
{ {
SHELL_MODE_TEXT, Text,
SHELL_MODE_FRAME, Frame,
SHELL_MODE_GRAPHIC, Graphic,
SHELL_MODE_OBJECT, Object,
SHELL_MODE_DRAW, Draw,
SHELL_MODE_DRAW_CTRL, DrawForm,
SHELL_MODE_DRAW_FORM, DrawText,
SHELL_MODE_DRAWTEXT, Bezier,
SHELL_MODE_BEZIER, ListText,
SHELL_MODE_LIST_TEXT, TableText,
SHELL_MODE_TABLE_TEXT, TableListText,
SHELL_MODE_TABLE_LIST_TEXT, Media,
SHELL_MODE_MEDIA, ExtrudedCustomShape,
SHELL_MODE_EXTRUDED_CUSTOMSHAPE, FontWork,
SHELL_MODE_FONTWORK, PostIt
SHELL_MODE_POSTIT
}; };
// apply a template // apply a template
@ -379,9 +378,9 @@ public:
virtual void ShowCursor( bool bOn = true ) override; virtual void ShowCursor( bool bOn = true ) override;
virtual ErrCode DoVerb( long nVerb ) override; virtual ErrCode DoVerb( long nVerb ) override;
virtual sal_uInt16 SetPrinter( SfxPrinter* pNew, virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL) override; SfxPrinterChangeFlags nDiff = SFX_PRINTER_ALL) override;
ShellModes GetShellMode(); ShellMode GetShellMode();
css::view::XSelectionSupplier* GetUNOObject(); css::view::XSelectionSupplier* GetUNOObject();

View File

@ -84,7 +84,7 @@ struct SpellState
bool m_bRestartDrawing; // the first selected drawing object is found again bool m_bRestartDrawing; // the first selected drawing object is found again
// lose/get focus information to decide if spelling can be continued // lose/get focus information to decide if spelling can be continued
ShellModes m_eSelMode; ShellMode m_eSelMode;
const SwNode* m_pPointNode; const SwNode* m_pPointNode;
const SwNode* m_pMarkNode; const SwNode* m_pMarkNode;
sal_Int32 m_nPointPos; sal_Int32 m_nPointPos;
@ -110,7 +110,7 @@ struct SpellState
m_pStartDrawing(nullptr), m_pStartDrawing(nullptr),
m_bRestartDrawing(false), m_bRestartDrawing(false),
m_eSelMode(SHELL_MODE_OBJECT), // initially invalid m_eSelMode(ShellMode::Object), // initially invalid
m_pPointNode(nullptr), m_pPointNode(nullptr),
m_pMarkNode(nullptr), m_pMarkNode(nullptr),
m_nPointPos(0), m_nPointPos(0),
@ -188,13 +188,13 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck)
SwEditShell::MoveContinuationPosToEndOfCheckedSentence(); SwEditShell::MoveContinuationPosToEndOfCheckedSentence();
} }
ShellModes eSelMode = pWrtShell->GetView().GetShellMode(); ShellMode eSelMode = pWrtShell->GetView().GetShellMode();
bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode; bool bDrawText = ShellMode::DrawText == eSelMode;
bool bNormalText = bool bNormalText =
SHELL_MODE_TABLE_TEXT == eSelMode || ShellMode::TableText == eSelMode ||
SHELL_MODE_LIST_TEXT == eSelMode || ShellMode::ListText == eSelMode ||
SHELL_MODE_TABLE_LIST_TEXT == eSelMode || ShellMode::TableListText == eSelMode ||
SHELL_MODE_TEXT == eSelMode; ShellMode::Text == eSelMode;
// Writer text outside of the body // Writer text outside of the body
bool bOtherText = false; bool bOtherText = false;
@ -434,13 +434,13 @@ void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rC
OSL_ENSURE(!m_pSpellState->m_bInitialCall, "ApplyChangedSentence in initial call or after resume"); OSL_ENSURE(!m_pSpellState->m_bInitialCall, "ApplyChangedSentence in initial call or after resume");
if(pWrtShell && !m_pSpellState->m_bInitialCall) if(pWrtShell && !m_pSpellState->m_bInitialCall)
{ {
ShellModes eSelMode = pWrtShell->GetView().GetShellMode(); ShellMode eSelMode = pWrtShell->GetView().GetShellMode();
bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode; bool bDrawText = ShellMode::DrawText == eSelMode;
bool bNormalText = bool bNormalText =
SHELL_MODE_TABLE_TEXT == eSelMode || ShellMode::TableText == eSelMode ||
SHELL_MODE_LIST_TEXT == eSelMode || ShellMode::ListText == eSelMode ||
SHELL_MODE_TABLE_LIST_TEXT == eSelMode || ShellMode::TableListText == eSelMode ||
SHELL_MODE_TEXT == eSelMode; ShellMode::Text == eSelMode;
// evaluate if the same sentence should be rechecked or not. // evaluate if the same sentence should be rechecked or not.
// Sentences that got grammar checked should always be rechecked in order // Sentences that got grammar checked should always be rechecked in order
@ -492,13 +492,13 @@ void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn)
SwWrtShell* pWrtShell = GetWrtShell_Impl(); SwWrtShell* pWrtShell = GetWrtShell_Impl();
if(pWrtShell) if(pWrtShell)
{ {
ShellModes eSelMode = pWrtShell->GetView().GetShellMode(); ShellMode eSelMode = pWrtShell->GetView().GetShellMode();
bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode; bool bDrawText = ShellMode::DrawText == eSelMode;
bool bNormalText = bool bNormalText =
SHELL_MODE_TABLE_TEXT == eSelMode || ShellMode::TableText == eSelMode ||
SHELL_MODE_LIST_TEXT == eSelMode || ShellMode::ListText == eSelMode ||
SHELL_MODE_TABLE_LIST_TEXT == eSelMode || ShellMode::TableListText == eSelMode ||
SHELL_MODE_TEXT == eSelMode; ShellMode::Text == eSelMode;
if( bNormalText ) if( bNormalText )
SwEditShell::PutSpellingToSentenceStart(); SwEditShell::PutSpellingToSentenceStart();
else if( bDrawText ) else if( bDrawText )
@ -522,7 +522,7 @@ void SwSpellDialogChildWindow::GetFocus()
SwWrtShell* pWrtShell = GetWrtShell_Impl(); SwWrtShell* pWrtShell = GetWrtShell_Impl();
if(pWrtShell && !m_pSpellState->m_bInitialCall) if(pWrtShell && !m_pSpellState->m_bInitialCall)
{ {
ShellModes eSelMode = pWrtShell->GetView().GetShellMode(); ShellMode eSelMode = pWrtShell->GetView().GetShellMode();
if(eSelMode != m_pSpellState->m_eSelMode) if(eSelMode != m_pSpellState->m_eSelMode)
{ {
// prevent initial invalidation // prevent initial invalidation
@ -533,10 +533,10 @@ void SwSpellDialogChildWindow::GetFocus()
{ {
switch(m_pSpellState->m_eSelMode) switch(m_pSpellState->m_eSelMode)
{ {
case SHELL_MODE_TEXT: case ShellMode::Text:
case SHELL_MODE_LIST_TEXT: case ShellMode::ListText:
case SHELL_MODE_TABLE_TEXT: case ShellMode::TableText:
case SHELL_MODE_TABLE_LIST_TEXT: case ShellMode::TableListText:
{ {
SwPaM* pCursor = pWrtShell->GetCursor(); SwPaM* pCursor = pWrtShell->GetCursor();
if(m_pSpellState->m_pPointNode != &pCursor->GetNode() || if(m_pSpellState->m_pPointNode != &pCursor->GetNode() ||
@ -546,7 +546,7 @@ void SwSpellDialogChildWindow::GetFocus()
bInvalidate = true; bInvalidate = true;
} }
break; break;
case SHELL_MODE_DRAWTEXT: case ShellMode::DrawText:
{ {
SdrView* pSdrView = pWrtShell->GetDrawView(); SdrView* pSdrView = pWrtShell->GetDrawView();
SdrOutliner* pOutliner = pSdrView ? pSdrView->GetTextEditOutliner() : nullptr; SdrOutliner* pOutliner = pSdrView ? pSdrView->GetTextEditOutliner() : nullptr;
@ -589,10 +589,10 @@ void SwSpellDialogChildWindow::LoseFocus()
switch(m_pSpellState->m_eSelMode) switch(m_pSpellState->m_eSelMode)
{ {
case SHELL_MODE_TEXT: case ShellMode::Text:
case SHELL_MODE_LIST_TEXT: case ShellMode::ListText:
case SHELL_MODE_TABLE_TEXT: case ShellMode::TableText:
case SHELL_MODE_TABLE_LIST_TEXT: case ShellMode::TableListText:
{ {
// store a node pointer and a pam-position to be able to check on next GetFocus(); // store a node pointer and a pam-position to be able to check on next GetFocus();
SwPaM* pCursor = pWrtShell->GetCursor(); SwPaM* pCursor = pWrtShell->GetCursor();
@ -603,7 +603,7 @@ void SwSpellDialogChildWindow::LoseFocus()
} }
break; break;
case SHELL_MODE_DRAWTEXT: case ShellMode::DrawText:
{ {
SdrView* pSdrView = pWrtShell->GetDrawView(); SdrView* pSdrView = pWrtShell->GetDrawView();
SdrOutliner* pOutliner = pSdrView->GetTextEditOutliner(); SdrOutliner* pOutliner = pSdrView->GetTextEditOutliner();
@ -620,7 +620,7 @@ void SwSpellDialogChildWindow::LoseFocus()
} }
} }
else else
m_pSpellState->m_eSelMode = SHELL_MODE_OBJECT; m_pSpellState->m_eSelMode = ShellMode::Object;
} }
void SwSpellDialogChildWindow::InvalidateSpellDialog() void SwSpellDialogChildWindow::InvalidateSpellDialog()
@ -652,20 +652,20 @@ SwWrtShell* SwSpellDialogChildWindow::GetWrtShell_Impl()
// set the cursor into the body text - necessary if any object is selected // set the cursor into the body text - necessary if any object is selected
// on start of the spelling dialog // on start of the spelling dialog
bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellModes eSelMode) bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellMode eSelMode)
{ {
SwView& rView = rShell.GetView(); SwView& rView = rShell.GetView();
switch(eSelMode) switch(eSelMode)
{ {
case SHELL_MODE_TEXT: case ShellMode::Text:
case SHELL_MODE_LIST_TEXT: case ShellMode::ListText:
case SHELL_MODE_TABLE_TEXT: case ShellMode::TableText:
case SHELL_MODE_TABLE_LIST_TEXT: case ShellMode::TableListText:
case SHELL_MODE_DRAWTEXT: case ShellMode::DrawText:
OSL_FAIL("text already active in SwSpellDialogChildWindow::MakeTextSelection_Impl()"); OSL_FAIL("text already active in SwSpellDialogChildWindow::MakeTextSelection_Impl()");
break; break;
case SHELL_MODE_FRAME: case ShellMode::Frame:
{ {
rShell.UnSelectFrame(); rShell.UnSelectFrame();
rShell.LeaveSelFrameMode(); rShell.LeaveSelFrameMode();
@ -673,18 +673,17 @@ bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellM
} }
break; break;
case SHELL_MODE_DRAW: case ShellMode::Draw:
case SHELL_MODE_DRAW_CTRL: case ShellMode::DrawForm:
case SHELL_MODE_DRAW_FORM: case ShellMode::Bezier:
case SHELL_MODE_BEZIER:
if(FindNextDrawTextError_Impl(rShell)) if(FindNextDrawTextError_Impl(rShell))
{ {
rView.AttrChangedNotify(&rShell); rView.AttrChangedNotify(&rShell);
break; break;
} }
SAL_FALLTHROUGH; // to deselect the object SAL_FALLTHROUGH; // to deselect the object
case SHELL_MODE_GRAPHIC: case ShellMode::Graphic:
case SHELL_MODE_OBJECT: case ShellMode::Object:
{ {
if ( rShell.IsDrawCreate() ) if ( rShell.IsDrawCreate() )
{ {

View File

@ -32,7 +32,7 @@ class SwSpellDialogChildWindow
SpellState* m_pSpellState; SpellState* m_pSpellState;
SwWrtShell* GetWrtShell_Impl(); SwWrtShell* GetWrtShell_Impl();
bool MakeTextSelection_Impl(SwWrtShell& rSh, ShellModes eSelMode); bool MakeTextSelection_Impl(SwWrtShell& rSh, ShellMode eSelMode);
bool FindNextDrawTextError_Impl(SwWrtShell& rSh); bool FindNextDrawTextError_Impl(SwWrtShell& rSh);
bool SpellDrawText_Impl(SwWrtShell& rSh, svx::SpellPortions& rPortions); bool SpellDrawText_Impl(SwWrtShell& rSh, svx::SpellPortions& rPortions);
void LockFocusNotification(bool bLock); void LockFocusNotification(bool bLock);

View File

@ -99,7 +99,7 @@ class SwView_Impl
mxScanEvtLstnr; mxScanEvtLstnr;
rtl::Reference<SwClipboardChangeListener> rtl::Reference<SwClipboardChangeListener>
mxClipEvtLstnr; mxClipEvtLstnr;
ShellModes eShellMode; ShellMode eShellMode;
#if HAVE_FEATURE_DBCONNECTIVITY #if HAVE_FEATURE_DBCONNECTIVITY
std::shared_ptr<SwMailMergeConfigItem> std::shared_ptr<SwMailMergeConfigItem>
@ -122,13 +122,13 @@ public:
SwView_Impl(SwView* pShell); SwView_Impl(SwView* pShell);
~SwView_Impl(); ~SwView_Impl();
void SetShellMode(ShellModes eSet); void SetShellMode(ShellMode eSet);
css::view::XSelectionSupplier* GetUNOObject(); css::view::XSelectionSupplier* GetUNOObject();
SwXTextView* GetUNOObject_Impl(); SwXTextView* GetUNOObject_Impl();
void Invalidate(); void Invalidate();
ShellModes GetShellMode() {return eShellMode;} ShellMode GetShellMode() {return eShellMode;}
void ExecuteScan(SfxRequest& rReq); void ExecuteScan(SfxRequest& rReq);
SwScannerEventListener& GetScannerEventListener(); SwScannerEventListener& GetScannerEventListener();

View File

@ -931,12 +931,11 @@ void SwBaseShell::Execute(SfxRequest &rReq)
case SID_STYLE_NEW_BY_EXAMPLE: case SID_STYLE_NEW_BY_EXAMPLE:
case SID_STYLE_APPLY: case SID_STYLE_APPLY:
{ {
ShellModes eMode = GetView().GetShellMode(); ShellMode eMode = GetView().GetShellMode();
if ( SHELL_MODE_DRAW != eMode && if ( ShellMode::Draw != eMode &&
SHELL_MODE_DRAW_CTRL != eMode && ShellMode::DrawForm != eMode &&
SHELL_MODE_DRAW_FORM != eMode && ShellMode::DrawText != eMode &&
SHELL_MODE_DRAWTEXT != eMode && ShellMode::Bezier != eMode )
SHELL_MODE_BEZIER != eMode )
{ {
// oj #107754# // oj #107754#
if ( SID_STYLE_WATERCAN == nSlot ) if ( SID_STYLE_WATERCAN == nSlot )
@ -1836,14 +1835,13 @@ void SwBaseShell::StateDisableItems( SfxItemSet &rSet )
void SwBaseShell::StateStyle( SfxItemSet &rSet ) void SwBaseShell::StateStyle( SfxItemSet &rSet )
{ {
bool bParentCntProt = GetShell().IsSelObjProtected( FlyProtectFlags::Content|FlyProtectFlags::Parent ) != FlyProtectFlags::NONE; bool bParentCntProt = GetShell().IsSelObjProtected( FlyProtectFlags::Content|FlyProtectFlags::Parent ) != FlyProtectFlags::NONE;
ShellModes eMode = GetView().GetShellMode(); ShellMode eMode = GetView().GetShellMode();
if ( bParentCntProt || if ( bParentCntProt ||
SHELL_MODE_DRAW == eMode || ShellMode::Draw == eMode ||
SHELL_MODE_DRAW_CTRL == eMode || ShellMode::DrawForm == eMode ||
SHELL_MODE_DRAW_FORM == eMode || ShellMode::DrawText == eMode ||
SHELL_MODE_DRAWTEXT == eMode || ShellMode::Bezier == eMode )
SHELL_MODE_BEZIER == eMode )
{ {
SfxWhichIter aIter( rSet ); SfxWhichIter aIter( rSet );
sal_uInt16 nWhich = aIter.FirstWhich(); sal_uInt16 nWhich = aIter.FirstWhich();

View File

@ -55,7 +55,7 @@ using namespace ::com::sun::star::datatransfer::clipboard;
SwView_Impl::SwView_Impl(SwView* pShell) SwView_Impl::SwView_Impl(SwView* pShell)
: mxXTextView() : mxXTextView()
, pView(pShell) , pView(pShell)
, eShellMode(SHELL_MODE_TEXT) , eShellMode(ShellMode::Text)
#if HAVE_FEATURE_DBCONNECTIVITY #if HAVE_FEATURE_DBCONNECTIVITY
, nMailMergeRestartPage(0) , nMailMergeRestartPage(0)
#endif #endif
@ -97,7 +97,7 @@ SwView_Impl::~SwView_Impl()
delete m_pRequest; delete m_pRequest;
} }
void SwView_Impl::SetShellMode(ShellModes eSet) void SwView_Impl::SetShellMode(ShellMode eSet)
{ {
eShellMode = eSet; eShellMode = eSet;
} }

View File

@ -296,7 +296,7 @@ void SwView::SelectShell()
bool bSetExtInpCntxt = false; bool bSetExtInpCntxt = false;
m_nSelectionType = nNewSelectionType; m_nSelectionType = nNewSelectionType;
ShellModes eShellMode; ShellMode eShellMode;
if ( !( m_nSelectionType & nsSelectionType::SEL_FOC_FRM_CTRL ) ) if ( !( m_nSelectionType & nsSelectionType::SEL_FOC_FRM_CTRL ) )
rDispatcher.Push( *m_pFormShell ); rDispatcher.Push( *m_pFormShell );
@ -306,59 +306,59 @@ void SwView::SelectShell()
if ( m_nSelectionType & nsSelectionType::SEL_OLE ) if ( m_nSelectionType & nsSelectionType::SEL_OLE )
{ {
eShellMode = SHELL_MODE_OBJECT; eShellMode = ShellMode::Object;
m_pShell = new SwOleShell( *this ); m_pShell = new SwOleShell( *this );
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
} }
else if ( m_nSelectionType & nsSelectionType::SEL_FRM else if ( m_nSelectionType & nsSelectionType::SEL_FRM
|| m_nSelectionType & nsSelectionType::SEL_GRF) || m_nSelectionType & nsSelectionType::SEL_GRF)
{ {
eShellMode = SHELL_MODE_FRAME; eShellMode = ShellMode::Frame;
m_pShell = new SwFrameShell( *this ); m_pShell = new SwFrameShell( *this );
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
if(m_nSelectionType & nsSelectionType::SEL_GRF ) if(m_nSelectionType & nsSelectionType::SEL_GRF )
{ {
eShellMode = SHELL_MODE_GRAPHIC; eShellMode = ShellMode::Graphic;
m_pShell = new SwGrfShell( *this ); m_pShell = new SwGrfShell( *this );
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
} }
} }
else if ( m_nSelectionType & nsSelectionType::SEL_DRW ) else if ( m_nSelectionType & nsSelectionType::SEL_DRW )
{ {
eShellMode = SHELL_MODE_DRAW; eShellMode = ShellMode::Draw;
m_pShell = new SwDrawShell( *this ); m_pShell = new SwDrawShell( *this );
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
if ( m_nSelectionType & nsSelectionType::SEL_BEZ ) if ( m_nSelectionType & nsSelectionType::SEL_BEZ )
{ {
eShellMode = SHELL_MODE_BEZIER; eShellMode = ShellMode::Bezier;
m_pShell = new SwBezierShell( *this ); m_pShell = new SwBezierShell( *this );
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
} }
#if HAVE_FEATURE_AVMEDIA #if HAVE_FEATURE_AVMEDIA
else if( m_nSelectionType & nsSelectionType::SEL_MEDIA ) else if( m_nSelectionType & nsSelectionType::SEL_MEDIA )
{ {
eShellMode = SHELL_MODE_MEDIA; eShellMode = ShellMode::Media;
m_pShell = new SwMediaShell( *this ); m_pShell = new SwMediaShell( *this );
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
} }
#endif #endif
if (m_nSelectionType & nsSelectionType::SEL_EXTRUDED_CUSTOMSHAPE) if (m_nSelectionType & nsSelectionType::SEL_EXTRUDED_CUSTOMSHAPE)
{ {
eShellMode = SHELL_MODE_EXTRUDED_CUSTOMSHAPE; eShellMode = ShellMode::ExtrudedCustomShape;
m_pShell = new svx::ExtrusionBar(this); m_pShell = new svx::ExtrusionBar(this);
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
} }
if (m_nSelectionType & nsSelectionType::SEL_FONTWORK) if (m_nSelectionType & nsSelectionType::SEL_FONTWORK)
{ {
eShellMode = SHELL_MODE_FONTWORK; eShellMode = ShellMode::FontWork;
m_pShell = new svx::FontworkBar(this); m_pShell = new svx::FontworkBar(this);
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
} }
} }
else if ( m_nSelectionType & nsSelectionType::SEL_DRW_FORM ) else if ( m_nSelectionType & nsSelectionType::SEL_DRW_FORM )
{ {
eShellMode = SHELL_MODE_DRAW_FORM; eShellMode = ShellMode::DrawForm;
m_pShell = new SwDrawFormShell( *this ); m_pShell = new SwDrawFormShell( *this );
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
@ -366,25 +366,25 @@ void SwView::SelectShell()
else if ( m_nSelectionType & nsSelectionType::SEL_DRW_TXT ) else if ( m_nSelectionType & nsSelectionType::SEL_DRW_TXT )
{ {
bSetExtInpCntxt = true; bSetExtInpCntxt = true;
eShellMode = SHELL_MODE_DRAWTEXT; eShellMode = ShellMode::DrawText;
rDispatcher.Push( *(new SwBaseShell( *this )) ); rDispatcher.Push( *(new SwBaseShell( *this )) );
m_pShell = new SwDrawTextShell( *this ); m_pShell = new SwDrawTextShell( *this );
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
} }
else if ( m_nSelectionType & nsSelectionType::SEL_POSTIT ) else if ( m_nSelectionType & nsSelectionType::SEL_POSTIT )
{ {
eShellMode = SHELL_MODE_POSTIT; eShellMode = ShellMode::PostIt;
m_pShell = new SwAnnotationShell( *this ); m_pShell = new SwAnnotationShell( *this );
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
} }
else else
{ {
bSetExtInpCntxt = true; bSetExtInpCntxt = true;
eShellMode = SHELL_MODE_TEXT; eShellMode = ShellMode::Text;
sal_uInt32 nHelpId = 0; sal_uInt32 nHelpId = 0;
if ( m_nSelectionType & nsSelectionType::SEL_NUM ) if ( m_nSelectionType & nsSelectionType::SEL_NUM )
{ {
eShellMode = SHELL_MODE_LIST_TEXT; eShellMode = ShellMode::ListText;
m_pShell = new SwListShell( *this ); m_pShell = new SwListShell( *this );
nHelpId = m_pShell->GetHelpId(); nHelpId = m_pShell->GetHelpId();
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
@ -395,8 +395,8 @@ void SwView::SelectShell()
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
if ( m_nSelectionType & nsSelectionType::SEL_TBL ) if ( m_nSelectionType & nsSelectionType::SEL_TBL )
{ {
eShellMode = eShellMode == SHELL_MODE_LIST_TEXT ? SHELL_MODE_TABLE_LIST_TEXT eShellMode = eShellMode == ShellMode::ListText ? ShellMode::TableListText
: SHELL_MODE_TABLE_TEXT; : ShellMode::TableText;
m_pShell = new SwTableShell( *this ); m_pShell = new SwTableShell( *this );
rDispatcher.Push( *m_pShell ); rDispatcher.Push( *m_pShell );
} }
@ -642,10 +642,10 @@ void SwView::CheckReadonlySelection()
// the stack. // the stack.
switch( m_pViewImpl->GetShellMode() ) switch( m_pViewImpl->GetShellMode() )
{ {
case SHELL_MODE_TEXT: case ShellMode::Text:
case SHELL_MODE_LIST_TEXT: case ShellMode::ListText:
case SHELL_MODE_TABLE_TEXT: case ShellMode::TableText:
case SHELL_MODE_TABLE_LIST_TEXT: case ShellMode::TableListText:
{ {
// Temporary solution!!! Should set the font of the current insertion point // Temporary solution!!! Should set the font of the current insertion point
// at each cursor movement, so outside of this "if". But TH does not // at each cursor movement, so outside of this "if". But TH does not

View File

@ -118,7 +118,7 @@ void SwView::InitInterface_Impl()
} }
ShellModes SwView::GetShellMode() ShellMode SwView::GetShellMode()
{ {
return m_pViewImpl->GetShellMode(); return m_pViewImpl->GetShellMode();
} }

View File

@ -278,11 +278,11 @@ void SwXDispatch::addStatusListener(
{ {
if(!m_pView) if(!m_pView)
throw uno::RuntimeException(); throw uno::RuntimeException();
ShellModes eMode = m_pView->GetShellMode(); ShellMode eMode = m_pView->GetShellMode();
bool bEnable = SHELL_MODE_TEXT == eMode || bool bEnable = ShellMode::Text == eMode ||
SHELL_MODE_LIST_TEXT == eMode || ShellMode::ListText == eMode ||
SHELL_MODE_TABLE_TEXT == eMode || ShellMode::TableText == eMode ||
SHELL_MODE_TABLE_LIST_TEXT == eMode; ShellMode::TableListText == eMode;
m_bOldEnable = bEnable; m_bOldEnable = bEnable;
frame::FeatureStateEvent aEvent; frame::FeatureStateEvent aEvent;
@ -345,11 +345,11 @@ void SwXDispatch::removeStatusListener(
void SwXDispatch::selectionChanged( const lang::EventObject& ) void SwXDispatch::selectionChanged( const lang::EventObject& )
{ {
ShellModes eMode = m_pView->GetShellMode(); ShellMode eMode = m_pView->GetShellMode();
bool bEnable = SHELL_MODE_TEXT == eMode || bool bEnable = ShellMode::Text == eMode ||
SHELL_MODE_LIST_TEXT == eMode || ShellMode::ListText == eMode ||
SHELL_MODE_TABLE_TEXT == eMode || ShellMode::TableText == eMode ||
SHELL_MODE_TABLE_LIST_TEXT == eMode; ShellMode::TableListText == eMode;
if(bEnable != m_bOldEnable) if(bEnable != m_bOldEnable)
{ {
m_bOldEnable = bEnable; m_bOldEnable = bEnable;

View File

@ -326,10 +326,10 @@ uno::Any SwXTextView::getSelection()
m_pView->StopShellTimer(); m_pView->StopShellTimer();
//Generating an interface from the current selection. //Generating an interface from the current selection.
SwWrtShell& rSh = m_pView->GetWrtShell(); SwWrtShell& rSh = m_pView->GetWrtShell();
ShellModes eSelMode = m_pView->GetShellMode(); ShellMode eSelMode = m_pView->GetShellMode();
switch(eSelMode) switch(eSelMode)
{ {
case SHELL_MODE_TABLE_TEXT : case ShellMode::TableText :
{ {
if(rSh.GetTableCursor()) if(rSh.GetTableCursor())
{ {
@ -342,15 +342,15 @@ uno::Any SwXTextView::getSelection()
SAL_FALLTHROUGH; SAL_FALLTHROUGH;
// without a table selection the text will be delivered // without a table selection the text will be delivered
} }
case SHELL_MODE_LIST_TEXT : case ShellMode::ListText :
case SHELL_MODE_TABLE_LIST_TEXT: case ShellMode::TableListText:
case SHELL_MODE_TEXT : case ShellMode::Text :
{ {
uno::Reference< container::XIndexAccess > xPos = SwXTextRanges::Create(rSh.GetCursor()); uno::Reference< container::XIndexAccess > xPos = SwXTextRanges::Create(rSh.GetCursor());
aRef.set(xPos, uno::UNO_QUERY); aRef.set(xPos, uno::UNO_QUERY);
} }
break; break;
case SHELL_MODE_FRAME : case ShellMode::Frame :
{ {
SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat(); SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat();
if (pFormat) if (pFormat)
@ -360,7 +360,7 @@ uno::Any SwXTextView::getSelection()
} }
} }
break; break;
case SHELL_MODE_GRAPHIC : case ShellMode::Graphic :
{ {
SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat(); SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat();
if (pFormat) if (pFormat)
@ -370,7 +370,7 @@ uno::Any SwXTextView::getSelection()
} }
} }
break; break;
case SHELL_MODE_OBJECT : case ShellMode::Object :
{ {
SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat(); SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat();
if (pFormat) if (pFormat)
@ -380,11 +380,10 @@ uno::Any SwXTextView::getSelection()
} }
} }
break; break;
case SHELL_MODE_DRAW : case ShellMode::Draw :
case SHELL_MODE_DRAW_CTRL : case ShellMode::DrawForm :
case SHELL_MODE_DRAW_FORM : case ShellMode::DrawText :
case SHELL_MODE_DRAWTEXT : case ShellMode::Bezier :
case SHELL_MODE_BEZIER :
{ {
uno::Reference< drawing::XDrawPageSupplier > xPageSupp; uno::Reference< drawing::XDrawPageSupplier > xPageSupp;
uno::Reference< frame::XModel > xModel = m_pView->GetDocShell()->GetBaseModel(); uno::Reference< frame::XModel > xModel = m_pView->GetDocShell()->GetBaseModel();
@ -520,11 +519,11 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto
if(!GetView()) if(!GetView())
throw RuntimeException(); throw RuntimeException();
SwWrtShell& rSh = m_pView->GetWrtShell(); SwWrtShell& rSh = m_pView->GetWrtShell();
ShellModes eSelMode = m_pView->GetShellMode(); ShellMode eSelMode = m_pView->GetShellMode();
if (eSelMode != SHELL_MODE_LIST_TEXT && if (eSelMode != ShellMode::ListText &&
eSelMode != SHELL_MODE_TABLE_LIST_TEXT && eSelMode != ShellMode::TableListText &&
eSelMode != SHELL_MODE_TABLE_TEXT && eSelMode != ShellMode::TableText &&
eSelMode != SHELL_MODE_TEXT ) eSelMode != ShellMode::Text )
return Sequence< Sequence< PropertyValue > > (); return Sequence< Sequence< PropertyValue > > ();
SwRubyList aList; SwRubyList aList;
@ -565,11 +564,11 @@ void SAL_CALL SwXTextView::setRubyList(
if(!GetView() || !rRubyList.getLength()) if(!GetView() || !rRubyList.getLength())
throw RuntimeException(); throw RuntimeException();
SwWrtShell& rSh = m_pView->GetWrtShell(); SwWrtShell& rSh = m_pView->GetWrtShell();
ShellModes eSelMode = m_pView->GetShellMode(); ShellMode eSelMode = m_pView->GetShellMode();
if (eSelMode != SHELL_MODE_LIST_TEXT && if (eSelMode != ShellMode::ListText &&
eSelMode != SHELL_MODE_TABLE_LIST_TEXT && eSelMode != ShellMode::TableListText &&
eSelMode != SHELL_MODE_TABLE_TEXT && eSelMode != ShellMode::TableText &&
eSelMode != SHELL_MODE_TEXT ) eSelMode != ShellMode::Text )
throw RuntimeException(); throw RuntimeException();
SwRubyList aList; SwRubyList aList;
@ -1016,14 +1015,14 @@ void SwXTextViewCursor::gotoRange(
throw uno::RuntimeException(); throw uno::RuntimeException();
} }
ShellModes eSelMode = m_pView->GetShellMode(); ShellMode eSelMode = m_pView->GetShellMode();
SwWrtShell& rSh = m_pView->GetWrtShell(); SwWrtShell& rSh = m_pView->GetWrtShell();
// call EnterStdMode in non-text selections only // call EnterStdMode in non-text selections only
if(!bExpand || if(!bExpand ||
(eSelMode != SHELL_MODE_TABLE_TEXT && (eSelMode != ShellMode::TableText &&
eSelMode != SHELL_MODE_LIST_TEXT && eSelMode != ShellMode::ListText &&
eSelMode != SHELL_MODE_TABLE_LIST_TEXT && eSelMode != ShellMode::TableListText &&
eSelMode != SHELL_MODE_TEXT )) eSelMode != ShellMode::Text ))
rSh.EnterStdMode(); rSh.EnterStdMode();
SwPaM* pShellCursor = rSh.GetCursor(); SwPaM* pShellCursor = rSh.GetCursor();
SwPaM aOwnPaM(*pShellCursor->GetPoint()); SwPaM aOwnPaM(*pShellCursor->GetPoint());
@ -1096,10 +1095,10 @@ void SwXTextViewCursor::gotoRange(
//with Expand only in the same environment //with Expand only in the same environment
if(bExpand && if(bExpand &&
(pOwnStartNode != pTmp || (pOwnStartNode != pTmp ||
(eSelMode != SHELL_MODE_TABLE_TEXT && (eSelMode != ShellMode::TableText &&
eSelMode != SHELL_MODE_LIST_TEXT && eSelMode != ShellMode::ListText &&
eSelMode != SHELL_MODE_TABLE_LIST_TEXT && eSelMode != ShellMode::TableListText &&
eSelMode != SHELL_MODE_TEXT))) eSelMode != ShellMode::Text)))
throw uno::RuntimeException(); throw uno::RuntimeException();
//Now, the selection must be expanded. //Now, the selection must be expanded.
@ -1378,7 +1377,7 @@ OUString SwXTextViewCursor::getString()
if (!IsTextSelection( false )) if (!IsTextSelection( false ))
throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) ); throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
ShellModes eSelMode = m_pView->GetShellMode(); ShellMode eSelMode = m_pView->GetShellMode();
switch(eSelMode) switch(eSelMode)
{ {
//! since setString for SEL_TABLE_TEXT (with possible //! since setString for SEL_TABLE_TEXT (with possible
@ -1386,9 +1385,9 @@ OUString SwXTextViewCursor::getString()
//! will ignore this case for both //! will ignore this case for both
//! functions (setString AND getString) because of symmetrie. //! functions (setString AND getString) because of symmetrie.
case SHELL_MODE_LIST_TEXT : case ShellMode::ListText :
case SHELL_MODE_TABLE_LIST_TEXT: case ShellMode::TableListText:
case SHELL_MODE_TEXT : case ShellMode::Text :
{ {
SwWrtShell& rSh = m_pView->GetWrtShell(); SwWrtShell& rSh = m_pView->GetWrtShell();
SwPaM* pShellCursor = rSh.GetCursor(); SwPaM* pShellCursor = rSh.GetCursor();
@ -1409,7 +1408,7 @@ void SwXTextViewCursor::setString(const OUString& aString)
if (!IsTextSelection( false )) if (!IsTextSelection( false ))
throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) ); throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
ShellModes eSelMode = m_pView->GetShellMode(); ShellMode eSelMode = m_pView->GetShellMode();
switch(eSelMode) switch(eSelMode)
{ {
//! since setString for SEL_TABLE_TEXT (with possible //! since setString for SEL_TABLE_TEXT (with possible
@ -1417,9 +1416,9 @@ void SwXTextViewCursor::setString(const OUString& aString)
//! will ignore this case for both //! will ignore this case for both
//! functions (setString AND getString) because of symmetrie. //! functions (setString AND getString) because of symmetrie.
case SHELL_MODE_LIST_TEXT : case ShellMode::ListText :
case SHELL_MODE_TABLE_LIST_TEXT : case ShellMode::TableListText :
case SHELL_MODE_TEXT : case ShellMode::Text :
{ {
SwWrtShell& rSh = m_pView->GetWrtShell(); SwWrtShell& rSh = m_pView->GetWrtShell();
SwCursor* pShellCursor = rSh.GetSwCursor(); SwCursor* pShellCursor = rSh.GetSwCursor();
@ -1721,7 +1720,7 @@ uno::Reference< datatransfer::XTransferable > SAL_CALL SwXTextView::getTransfera
//force immediat shell update //force immediat shell update
GetView()->StopShellTimer(); GetView()->StopShellTimer();
SwWrtShell& rSh = GetView()->GetWrtShell(); SwWrtShell& rSh = GetView()->GetWrtShell();
if ( GetView()->GetShellMode() == SHELL_MODE_DRAWTEXT ) if ( GetView()->GetShellMode() == ShellMode::DrawText )
{ {
SdrView *pSdrView = rSh.GetDrawView(); SdrView *pSdrView = rSh.GetDrawView();
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
@ -1745,7 +1744,7 @@ void SAL_CALL SwXTextView::insertTransferable( const uno::Reference< datatransfe
//force immediat shell update //force immediat shell update
GetView()->StopShellTimer(); GetView()->StopShellTimer();
SwWrtShell& rSh = GetView()->GetWrtShell(); SwWrtShell& rSh = GetView()->GetWrtShell();
if ( GetView()->GetShellMode() == SHELL_MODE_DRAWTEXT ) if ( GetView()->GetShellMode() == ShellMode::DrawText )
{ {
SdrView *pSdrView = rSh.GetDrawView(); SdrView *pSdrView = rSh.GetDrawView();
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView(); OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();

View File

@ -162,36 +162,36 @@ void SwWebView::SelectShell()
bool bSetExtInpCntxt = false; bool bSetExtInpCntxt = false;
_nSelectionType = nNewSelectionType; _nSelectionType = nNewSelectionType;
SetSelectionType( _nSelectionType ); SetSelectionType( _nSelectionType );
ShellModes eShellMode; ShellMode eShellMode;
if ( _nSelectionType & nsSelectionType::SEL_OLE ) if ( _nSelectionType & nsSelectionType::SEL_OLE )
{ {
eShellMode = SHELL_MODE_OBJECT; eShellMode = ShellMode::Object;
SetShell( new SwWebOleShell( *this )); SetShell( new SwWebOleShell( *this ));
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
} }
else if ( _nSelectionType & nsSelectionType::SEL_FRM else if ( _nSelectionType & nsSelectionType::SEL_FRM
|| _nSelectionType & nsSelectionType::SEL_GRF) || _nSelectionType & nsSelectionType::SEL_GRF)
{ {
eShellMode = SHELL_MODE_FRAME; eShellMode = ShellMode::Frame;
SetShell( new SwWebFrameShell( *this )); SetShell( new SwWebFrameShell( *this ));
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
if(_nSelectionType & nsSelectionType::SEL_GRF ) if(_nSelectionType & nsSelectionType::SEL_GRF )
{ {
eShellMode = SHELL_MODE_GRAPHIC; eShellMode = ShellMode::Graphic;
SetShell( new SwWebGrfShell( *this )); SetShell( new SwWebGrfShell( *this ));
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
} }
} }
else if ( _nSelectionType & nsSelectionType::SEL_FRM ) else if ( _nSelectionType & nsSelectionType::SEL_FRM )
{ {
eShellMode = SHELL_MODE_FRAME; eShellMode = ShellMode::Frame;
SetShell( new SwWebFrameShell( *this )); SetShell( new SwWebFrameShell( *this ));
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
} }
else if ( _nSelectionType & nsSelectionType::SEL_DRW ) else if ( _nSelectionType & nsSelectionType::SEL_DRW )
{ {
eShellMode = SHELL_MODE_DRAW; eShellMode = ShellMode::Draw;
SetShell( new svx::ExtrusionBar( this ) ); SetShell( new svx::ExtrusionBar( this ) );
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
@ -202,7 +202,7 @@ void SwWebView::SelectShell()
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
if ( _nSelectionType & nsSelectionType::SEL_BEZ ) if ( _nSelectionType & nsSelectionType::SEL_BEZ )
{ {
eShellMode = SHELL_MODE_BEZIER; eShellMode = ShellMode::Bezier;
SetShell( new SwBezierShell( *this )); SetShell( new SwBezierShell( *this ));
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
} }
@ -210,31 +210,31 @@ void SwWebView::SelectShell()
} }
else if ( _nSelectionType & nsSelectionType::SEL_DRW_FORM ) else if ( _nSelectionType & nsSelectionType::SEL_DRW_FORM )
{ {
eShellMode = SHELL_MODE_DRAW_FORM; eShellMode = ShellMode::DrawForm;
SetShell( new SwWebDrawFormShell( *this )); SetShell( new SwWebDrawFormShell( *this ));
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
} }
else if ( _nSelectionType & nsSelectionType::SEL_DRW_TXT ) else if ( _nSelectionType & nsSelectionType::SEL_DRW_TXT )
{ {
eShellMode = SHELL_MODE_DRAWTEXT; eShellMode = ShellMode::DrawText;
rDispatcher.Push( *(new SwBaseShell( *this )) ); rDispatcher.Push( *(new SwBaseShell( *this )) );
SetShell( new SwDrawTextShell( *this )); SetShell( new SwDrawTextShell( *this ));
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
} }
else if ( _nSelectionType & nsSelectionType::SEL_POSTIT ) else if ( _nSelectionType & nsSelectionType::SEL_POSTIT )
{ {
eShellMode = SHELL_MODE_POSTIT; eShellMode = ShellMode::PostIt;
SetShell( new SwAnnotationShell( *this ) ); SetShell( new SwAnnotationShell( *this ) );
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
} }
else else
{ {
bSetExtInpCntxt = true; bSetExtInpCntxt = true;
eShellMode = SHELL_MODE_TEXT; eShellMode = ShellMode::Text;
if ( _nSelectionType & nsSelectionType::SEL_NUM ) if ( _nSelectionType & nsSelectionType::SEL_NUM )
{ {
eShellMode = SHELL_MODE_LIST_TEXT; eShellMode = ShellMode::ListText;
SetShell( new SwWebListShell( *this )); SetShell( new SwWebListShell( *this ));
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
} }
@ -242,8 +242,8 @@ void SwWebView::SelectShell()
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
if ( _nSelectionType & nsSelectionType::SEL_TBL ) if ( _nSelectionType & nsSelectionType::SEL_TBL )
{ {
eShellMode = eShellMode == SHELL_MODE_LIST_TEXT ? SHELL_MODE_TABLE_LIST_TEXT eShellMode = eShellMode == ShellMode::ListText ? ShellMode::TableListText
: SHELL_MODE_TABLE_TEXT; : ShellMode::TableText;
SetShell( new SwWebTableShell( *this )); SetShell( new SwWebTableShell( *this ));
rDispatcher.Push( *GetCurShell() ); rDispatcher.Push( *GetCurShell() );
} }