convert ShellModes to scoped enum
and drop read-only SHELL_MODE_DRAW_CTRL enumerator Change-Id: I2ccaeb492912c876b89ff9b5dccaa99e28a268b7
This commit is contained in:
parent
4f52b3b052
commit
d8499c45eb
@ -138,6 +138,7 @@ for d in definitionSet:
|
||||
"include/svtools/svtabbx.hxx",
|
||||
"include/vcl/print.hxx", # NupOrderType, from UI combobox
|
||||
"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
|
||||
"opencl/inc/opencl_device_selection.h",
|
||||
"vcl/inc/sft.hxx",
|
||||
|
@ -95,24 +95,23 @@ const long nScrollY = 30;
|
||||
|
||||
#define MAX_MARKS 5
|
||||
|
||||
enum ShellModes
|
||||
enum class ShellMode
|
||||
{
|
||||
SHELL_MODE_TEXT,
|
||||
SHELL_MODE_FRAME,
|
||||
SHELL_MODE_GRAPHIC,
|
||||
SHELL_MODE_OBJECT,
|
||||
SHELL_MODE_DRAW,
|
||||
SHELL_MODE_DRAW_CTRL,
|
||||
SHELL_MODE_DRAW_FORM,
|
||||
SHELL_MODE_DRAWTEXT,
|
||||
SHELL_MODE_BEZIER,
|
||||
SHELL_MODE_LIST_TEXT,
|
||||
SHELL_MODE_TABLE_TEXT,
|
||||
SHELL_MODE_TABLE_LIST_TEXT,
|
||||
SHELL_MODE_MEDIA,
|
||||
SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
|
||||
SHELL_MODE_FONTWORK,
|
||||
SHELL_MODE_POSTIT
|
||||
Text,
|
||||
Frame,
|
||||
Graphic,
|
||||
Object,
|
||||
Draw,
|
||||
DrawForm,
|
||||
DrawText,
|
||||
Bezier,
|
||||
ListText,
|
||||
TableText,
|
||||
TableListText,
|
||||
Media,
|
||||
ExtrudedCustomShape,
|
||||
FontWork,
|
||||
PostIt
|
||||
};
|
||||
|
||||
// apply a template
|
||||
@ -379,9 +378,9 @@ public:
|
||||
virtual void ShowCursor( bool bOn = true ) 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;
|
||||
ShellModes GetShellMode();
|
||||
ShellMode GetShellMode();
|
||||
|
||||
css::view::XSelectionSupplier* GetUNOObject();
|
||||
|
||||
|
@ -84,7 +84,7 @@ struct SpellState
|
||||
bool m_bRestartDrawing; // the first selected drawing object is found again
|
||||
|
||||
// lose/get focus information to decide if spelling can be continued
|
||||
ShellModes m_eSelMode;
|
||||
ShellMode m_eSelMode;
|
||||
const SwNode* m_pPointNode;
|
||||
const SwNode* m_pMarkNode;
|
||||
sal_Int32 m_nPointPos;
|
||||
@ -110,7 +110,7 @@ struct SpellState
|
||||
m_pStartDrawing(nullptr),
|
||||
m_bRestartDrawing(false),
|
||||
|
||||
m_eSelMode(SHELL_MODE_OBJECT), // initially invalid
|
||||
m_eSelMode(ShellMode::Object), // initially invalid
|
||||
m_pPointNode(nullptr),
|
||||
m_pMarkNode(nullptr),
|
||||
m_nPointPos(0),
|
||||
@ -188,13 +188,13 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck)
|
||||
SwEditShell::MoveContinuationPosToEndOfCheckedSentence();
|
||||
}
|
||||
|
||||
ShellModes eSelMode = pWrtShell->GetView().GetShellMode();
|
||||
bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode;
|
||||
ShellMode eSelMode = pWrtShell->GetView().GetShellMode();
|
||||
bool bDrawText = ShellMode::DrawText == eSelMode;
|
||||
bool bNormalText =
|
||||
SHELL_MODE_TABLE_TEXT == eSelMode ||
|
||||
SHELL_MODE_LIST_TEXT == eSelMode ||
|
||||
SHELL_MODE_TABLE_LIST_TEXT == eSelMode ||
|
||||
SHELL_MODE_TEXT == eSelMode;
|
||||
ShellMode::TableText == eSelMode ||
|
||||
ShellMode::ListText == eSelMode ||
|
||||
ShellMode::TableListText == eSelMode ||
|
||||
ShellMode::Text == eSelMode;
|
||||
// Writer text outside of the body
|
||||
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");
|
||||
if(pWrtShell && !m_pSpellState->m_bInitialCall)
|
||||
{
|
||||
ShellModes eSelMode = pWrtShell->GetView().GetShellMode();
|
||||
bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode;
|
||||
ShellMode eSelMode = pWrtShell->GetView().GetShellMode();
|
||||
bool bDrawText = ShellMode::DrawText == eSelMode;
|
||||
bool bNormalText =
|
||||
SHELL_MODE_TABLE_TEXT == eSelMode ||
|
||||
SHELL_MODE_LIST_TEXT == eSelMode ||
|
||||
SHELL_MODE_TABLE_LIST_TEXT == eSelMode ||
|
||||
SHELL_MODE_TEXT == eSelMode;
|
||||
ShellMode::TableText == eSelMode ||
|
||||
ShellMode::ListText == eSelMode ||
|
||||
ShellMode::TableListText == eSelMode ||
|
||||
ShellMode::Text == eSelMode;
|
||||
|
||||
// evaluate if the same sentence should be rechecked or not.
|
||||
// Sentences that got grammar checked should always be rechecked in order
|
||||
@ -492,13 +492,13 @@ void SwSpellDialogChildWindow::SetGrammarChecking(bool bOn)
|
||||
SwWrtShell* pWrtShell = GetWrtShell_Impl();
|
||||
if(pWrtShell)
|
||||
{
|
||||
ShellModes eSelMode = pWrtShell->GetView().GetShellMode();
|
||||
bool bDrawText = SHELL_MODE_DRAWTEXT == eSelMode;
|
||||
ShellMode eSelMode = pWrtShell->GetView().GetShellMode();
|
||||
bool bDrawText = ShellMode::DrawText == eSelMode;
|
||||
bool bNormalText =
|
||||
SHELL_MODE_TABLE_TEXT == eSelMode ||
|
||||
SHELL_MODE_LIST_TEXT == eSelMode ||
|
||||
SHELL_MODE_TABLE_LIST_TEXT == eSelMode ||
|
||||
SHELL_MODE_TEXT == eSelMode;
|
||||
ShellMode::TableText == eSelMode ||
|
||||
ShellMode::ListText == eSelMode ||
|
||||
ShellMode::TableListText == eSelMode ||
|
||||
ShellMode::Text == eSelMode;
|
||||
if( bNormalText )
|
||||
SwEditShell::PutSpellingToSentenceStart();
|
||||
else if( bDrawText )
|
||||
@ -522,7 +522,7 @@ void SwSpellDialogChildWindow::GetFocus()
|
||||
SwWrtShell* pWrtShell = GetWrtShell_Impl();
|
||||
if(pWrtShell && !m_pSpellState->m_bInitialCall)
|
||||
{
|
||||
ShellModes eSelMode = pWrtShell->GetView().GetShellMode();
|
||||
ShellMode eSelMode = pWrtShell->GetView().GetShellMode();
|
||||
if(eSelMode != m_pSpellState->m_eSelMode)
|
||||
{
|
||||
// prevent initial invalidation
|
||||
@ -533,10 +533,10 @@ void SwSpellDialogChildWindow::GetFocus()
|
||||
{
|
||||
switch(m_pSpellState->m_eSelMode)
|
||||
{
|
||||
case SHELL_MODE_TEXT:
|
||||
case SHELL_MODE_LIST_TEXT:
|
||||
case SHELL_MODE_TABLE_TEXT:
|
||||
case SHELL_MODE_TABLE_LIST_TEXT:
|
||||
case ShellMode::Text:
|
||||
case ShellMode::ListText:
|
||||
case ShellMode::TableText:
|
||||
case ShellMode::TableListText:
|
||||
{
|
||||
SwPaM* pCursor = pWrtShell->GetCursor();
|
||||
if(m_pSpellState->m_pPointNode != &pCursor->GetNode() ||
|
||||
@ -546,7 +546,7 @@ void SwSpellDialogChildWindow::GetFocus()
|
||||
bInvalidate = true;
|
||||
}
|
||||
break;
|
||||
case SHELL_MODE_DRAWTEXT:
|
||||
case ShellMode::DrawText:
|
||||
{
|
||||
SdrView* pSdrView = pWrtShell->GetDrawView();
|
||||
SdrOutliner* pOutliner = pSdrView ? pSdrView->GetTextEditOutliner() : nullptr;
|
||||
@ -589,10 +589,10 @@ void SwSpellDialogChildWindow::LoseFocus()
|
||||
|
||||
switch(m_pSpellState->m_eSelMode)
|
||||
{
|
||||
case SHELL_MODE_TEXT:
|
||||
case SHELL_MODE_LIST_TEXT:
|
||||
case SHELL_MODE_TABLE_TEXT:
|
||||
case SHELL_MODE_TABLE_LIST_TEXT:
|
||||
case ShellMode::Text:
|
||||
case ShellMode::ListText:
|
||||
case ShellMode::TableText:
|
||||
case ShellMode::TableListText:
|
||||
{
|
||||
// store a node pointer and a pam-position to be able to check on next GetFocus();
|
||||
SwPaM* pCursor = pWrtShell->GetCursor();
|
||||
@ -603,7 +603,7 @@ void SwSpellDialogChildWindow::LoseFocus()
|
||||
|
||||
}
|
||||
break;
|
||||
case SHELL_MODE_DRAWTEXT:
|
||||
case ShellMode::DrawText:
|
||||
{
|
||||
SdrView* pSdrView = pWrtShell->GetDrawView();
|
||||
SdrOutliner* pOutliner = pSdrView->GetTextEditOutliner();
|
||||
@ -620,7 +620,7 @@ void SwSpellDialogChildWindow::LoseFocus()
|
||||
}
|
||||
}
|
||||
else
|
||||
m_pSpellState->m_eSelMode = SHELL_MODE_OBJECT;
|
||||
m_pSpellState->m_eSelMode = ShellMode::Object;
|
||||
}
|
||||
|
||||
void SwSpellDialogChildWindow::InvalidateSpellDialog()
|
||||
@ -652,20 +652,20 @@ SwWrtShell* SwSpellDialogChildWindow::GetWrtShell_Impl()
|
||||
|
||||
// set the cursor into the body text - necessary if any object is selected
|
||||
// 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();
|
||||
switch(eSelMode)
|
||||
{
|
||||
case SHELL_MODE_TEXT:
|
||||
case SHELL_MODE_LIST_TEXT:
|
||||
case SHELL_MODE_TABLE_TEXT:
|
||||
case SHELL_MODE_TABLE_LIST_TEXT:
|
||||
case SHELL_MODE_DRAWTEXT:
|
||||
case ShellMode::Text:
|
||||
case ShellMode::ListText:
|
||||
case ShellMode::TableText:
|
||||
case ShellMode::TableListText:
|
||||
case ShellMode::DrawText:
|
||||
OSL_FAIL("text already active in SwSpellDialogChildWindow::MakeTextSelection_Impl()");
|
||||
break;
|
||||
|
||||
case SHELL_MODE_FRAME:
|
||||
case ShellMode::Frame:
|
||||
{
|
||||
rShell.UnSelectFrame();
|
||||
rShell.LeaveSelFrameMode();
|
||||
@ -673,18 +673,17 @@ bool SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellM
|
||||
}
|
||||
break;
|
||||
|
||||
case SHELL_MODE_DRAW:
|
||||
case SHELL_MODE_DRAW_CTRL:
|
||||
case SHELL_MODE_DRAW_FORM:
|
||||
case SHELL_MODE_BEZIER:
|
||||
case ShellMode::Draw:
|
||||
case ShellMode::DrawForm:
|
||||
case ShellMode::Bezier:
|
||||
if(FindNextDrawTextError_Impl(rShell))
|
||||
{
|
||||
rView.AttrChangedNotify(&rShell);
|
||||
break;
|
||||
}
|
||||
SAL_FALLTHROUGH; // to deselect the object
|
||||
case SHELL_MODE_GRAPHIC:
|
||||
case SHELL_MODE_OBJECT:
|
||||
case ShellMode::Graphic:
|
||||
case ShellMode::Object:
|
||||
{
|
||||
if ( rShell.IsDrawCreate() )
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ class SwSpellDialogChildWindow
|
||||
SpellState* m_pSpellState;
|
||||
|
||||
SwWrtShell* GetWrtShell_Impl();
|
||||
bool MakeTextSelection_Impl(SwWrtShell& rSh, ShellModes eSelMode);
|
||||
bool MakeTextSelection_Impl(SwWrtShell& rSh, ShellMode eSelMode);
|
||||
bool FindNextDrawTextError_Impl(SwWrtShell& rSh);
|
||||
bool SpellDrawText_Impl(SwWrtShell& rSh, svx::SpellPortions& rPortions);
|
||||
void LockFocusNotification(bool bLock);
|
||||
|
@ -99,7 +99,7 @@ class SwView_Impl
|
||||
mxScanEvtLstnr;
|
||||
rtl::Reference<SwClipboardChangeListener>
|
||||
mxClipEvtLstnr;
|
||||
ShellModes eShellMode;
|
||||
ShellMode eShellMode;
|
||||
|
||||
#if HAVE_FEATURE_DBCONNECTIVITY
|
||||
std::shared_ptr<SwMailMergeConfigItem>
|
||||
@ -122,13 +122,13 @@ public:
|
||||
SwView_Impl(SwView* pShell);
|
||||
~SwView_Impl();
|
||||
|
||||
void SetShellMode(ShellModes eSet);
|
||||
void SetShellMode(ShellMode eSet);
|
||||
|
||||
css::view::XSelectionSupplier* GetUNOObject();
|
||||
SwXTextView* GetUNOObject_Impl();
|
||||
void Invalidate();
|
||||
|
||||
ShellModes GetShellMode() {return eShellMode;}
|
||||
ShellMode GetShellMode() {return eShellMode;}
|
||||
|
||||
void ExecuteScan(SfxRequest& rReq);
|
||||
SwScannerEventListener& GetScannerEventListener();
|
||||
|
@ -931,12 +931,11 @@ void SwBaseShell::Execute(SfxRequest &rReq)
|
||||
case SID_STYLE_NEW_BY_EXAMPLE:
|
||||
case SID_STYLE_APPLY:
|
||||
{
|
||||
ShellModes eMode = GetView().GetShellMode();
|
||||
if ( SHELL_MODE_DRAW != eMode &&
|
||||
SHELL_MODE_DRAW_CTRL != eMode &&
|
||||
SHELL_MODE_DRAW_FORM != eMode &&
|
||||
SHELL_MODE_DRAWTEXT != eMode &&
|
||||
SHELL_MODE_BEZIER != eMode )
|
||||
ShellMode eMode = GetView().GetShellMode();
|
||||
if ( ShellMode::Draw != eMode &&
|
||||
ShellMode::DrawForm != eMode &&
|
||||
ShellMode::DrawText != eMode &&
|
||||
ShellMode::Bezier != eMode )
|
||||
{
|
||||
// oj #107754#
|
||||
if ( SID_STYLE_WATERCAN == nSlot )
|
||||
@ -1836,14 +1835,13 @@ void SwBaseShell::StateDisableItems( SfxItemSet &rSet )
|
||||
void SwBaseShell::StateStyle( SfxItemSet &rSet )
|
||||
{
|
||||
bool bParentCntProt = GetShell().IsSelObjProtected( FlyProtectFlags::Content|FlyProtectFlags::Parent ) != FlyProtectFlags::NONE;
|
||||
ShellModes eMode = GetView().GetShellMode();
|
||||
ShellMode eMode = GetView().GetShellMode();
|
||||
|
||||
if ( bParentCntProt ||
|
||||
SHELL_MODE_DRAW == eMode ||
|
||||
SHELL_MODE_DRAW_CTRL == eMode ||
|
||||
SHELL_MODE_DRAW_FORM == eMode ||
|
||||
SHELL_MODE_DRAWTEXT == eMode ||
|
||||
SHELL_MODE_BEZIER == eMode )
|
||||
ShellMode::Draw == eMode ||
|
||||
ShellMode::DrawForm == eMode ||
|
||||
ShellMode::DrawText == eMode ||
|
||||
ShellMode::Bezier == eMode )
|
||||
{
|
||||
SfxWhichIter aIter( rSet );
|
||||
sal_uInt16 nWhich = aIter.FirstWhich();
|
||||
|
@ -55,7 +55,7 @@ using namespace ::com::sun::star::datatransfer::clipboard;
|
||||
SwView_Impl::SwView_Impl(SwView* pShell)
|
||||
: mxXTextView()
|
||||
, pView(pShell)
|
||||
, eShellMode(SHELL_MODE_TEXT)
|
||||
, eShellMode(ShellMode::Text)
|
||||
#if HAVE_FEATURE_DBCONNECTIVITY
|
||||
, nMailMergeRestartPage(0)
|
||||
#endif
|
||||
@ -97,7 +97,7 @@ SwView_Impl::~SwView_Impl()
|
||||
delete m_pRequest;
|
||||
}
|
||||
|
||||
void SwView_Impl::SetShellMode(ShellModes eSet)
|
||||
void SwView_Impl::SetShellMode(ShellMode eSet)
|
||||
{
|
||||
eShellMode = eSet;
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ void SwView::SelectShell()
|
||||
|
||||
bool bSetExtInpCntxt = false;
|
||||
m_nSelectionType = nNewSelectionType;
|
||||
ShellModes eShellMode;
|
||||
ShellMode eShellMode;
|
||||
|
||||
if ( !( m_nSelectionType & nsSelectionType::SEL_FOC_FRM_CTRL ) )
|
||||
rDispatcher.Push( *m_pFormShell );
|
||||
@ -306,59 +306,59 @@ void SwView::SelectShell()
|
||||
|
||||
if ( m_nSelectionType & nsSelectionType::SEL_OLE )
|
||||
{
|
||||
eShellMode = SHELL_MODE_OBJECT;
|
||||
eShellMode = ShellMode::Object;
|
||||
m_pShell = new SwOleShell( *this );
|
||||
rDispatcher.Push( *m_pShell );
|
||||
}
|
||||
else if ( m_nSelectionType & nsSelectionType::SEL_FRM
|
||||
|| m_nSelectionType & nsSelectionType::SEL_GRF)
|
||||
{
|
||||
eShellMode = SHELL_MODE_FRAME;
|
||||
eShellMode = ShellMode::Frame;
|
||||
m_pShell = new SwFrameShell( *this );
|
||||
rDispatcher.Push( *m_pShell );
|
||||
if(m_nSelectionType & nsSelectionType::SEL_GRF )
|
||||
{
|
||||
eShellMode = SHELL_MODE_GRAPHIC;
|
||||
eShellMode = ShellMode::Graphic;
|
||||
m_pShell = new SwGrfShell( *this );
|
||||
rDispatcher.Push( *m_pShell );
|
||||
}
|
||||
}
|
||||
else if ( m_nSelectionType & nsSelectionType::SEL_DRW )
|
||||
{
|
||||
eShellMode = SHELL_MODE_DRAW;
|
||||
eShellMode = ShellMode::Draw;
|
||||
m_pShell = new SwDrawShell( *this );
|
||||
rDispatcher.Push( *m_pShell );
|
||||
|
||||
if ( m_nSelectionType & nsSelectionType::SEL_BEZ )
|
||||
{
|
||||
eShellMode = SHELL_MODE_BEZIER;
|
||||
eShellMode = ShellMode::Bezier;
|
||||
m_pShell = new SwBezierShell( *this );
|
||||
rDispatcher.Push( *m_pShell );
|
||||
}
|
||||
#if HAVE_FEATURE_AVMEDIA
|
||||
else if( m_nSelectionType & nsSelectionType::SEL_MEDIA )
|
||||
{
|
||||
eShellMode = SHELL_MODE_MEDIA;
|
||||
eShellMode = ShellMode::Media;
|
||||
m_pShell = new SwMediaShell( *this );
|
||||
rDispatcher.Push( *m_pShell );
|
||||
}
|
||||
#endif
|
||||
if (m_nSelectionType & nsSelectionType::SEL_EXTRUDED_CUSTOMSHAPE)
|
||||
{
|
||||
eShellMode = SHELL_MODE_EXTRUDED_CUSTOMSHAPE;
|
||||
eShellMode = ShellMode::ExtrudedCustomShape;
|
||||
m_pShell = new svx::ExtrusionBar(this);
|
||||
rDispatcher.Push( *m_pShell );
|
||||
}
|
||||
if (m_nSelectionType & nsSelectionType::SEL_FONTWORK)
|
||||
{
|
||||
eShellMode = SHELL_MODE_FONTWORK;
|
||||
eShellMode = ShellMode::FontWork;
|
||||
m_pShell = new svx::FontworkBar(this);
|
||||
rDispatcher.Push( *m_pShell );
|
||||
}
|
||||
}
|
||||
else if ( m_nSelectionType & nsSelectionType::SEL_DRW_FORM )
|
||||
{
|
||||
eShellMode = SHELL_MODE_DRAW_FORM;
|
||||
eShellMode = ShellMode::DrawForm;
|
||||
m_pShell = new SwDrawFormShell( *this );
|
||||
|
||||
rDispatcher.Push( *m_pShell );
|
||||
@ -366,25 +366,25 @@ void SwView::SelectShell()
|
||||
else if ( m_nSelectionType & nsSelectionType::SEL_DRW_TXT )
|
||||
{
|
||||
bSetExtInpCntxt = true;
|
||||
eShellMode = SHELL_MODE_DRAWTEXT;
|
||||
eShellMode = ShellMode::DrawText;
|
||||
rDispatcher.Push( *(new SwBaseShell( *this )) );
|
||||
m_pShell = new SwDrawTextShell( *this );
|
||||
rDispatcher.Push( *m_pShell );
|
||||
}
|
||||
else if ( m_nSelectionType & nsSelectionType::SEL_POSTIT )
|
||||
{
|
||||
eShellMode = SHELL_MODE_POSTIT;
|
||||
eShellMode = ShellMode::PostIt;
|
||||
m_pShell = new SwAnnotationShell( *this );
|
||||
rDispatcher.Push( *m_pShell );
|
||||
}
|
||||
else
|
||||
{
|
||||
bSetExtInpCntxt = true;
|
||||
eShellMode = SHELL_MODE_TEXT;
|
||||
eShellMode = ShellMode::Text;
|
||||
sal_uInt32 nHelpId = 0;
|
||||
if ( m_nSelectionType & nsSelectionType::SEL_NUM )
|
||||
{
|
||||
eShellMode = SHELL_MODE_LIST_TEXT;
|
||||
eShellMode = ShellMode::ListText;
|
||||
m_pShell = new SwListShell( *this );
|
||||
nHelpId = m_pShell->GetHelpId();
|
||||
rDispatcher.Push( *m_pShell );
|
||||
@ -395,8 +395,8 @@ void SwView::SelectShell()
|
||||
rDispatcher.Push( *m_pShell );
|
||||
if ( m_nSelectionType & nsSelectionType::SEL_TBL )
|
||||
{
|
||||
eShellMode = eShellMode == SHELL_MODE_LIST_TEXT ? SHELL_MODE_TABLE_LIST_TEXT
|
||||
: SHELL_MODE_TABLE_TEXT;
|
||||
eShellMode = eShellMode == ShellMode::ListText ? ShellMode::TableListText
|
||||
: ShellMode::TableText;
|
||||
m_pShell = new SwTableShell( *this );
|
||||
rDispatcher.Push( *m_pShell );
|
||||
}
|
||||
@ -642,10 +642,10 @@ void SwView::CheckReadonlySelection()
|
||||
// the stack.
|
||||
switch( m_pViewImpl->GetShellMode() )
|
||||
{
|
||||
case SHELL_MODE_TEXT:
|
||||
case SHELL_MODE_LIST_TEXT:
|
||||
case SHELL_MODE_TABLE_TEXT:
|
||||
case SHELL_MODE_TABLE_LIST_TEXT:
|
||||
case ShellMode::Text:
|
||||
case ShellMode::ListText:
|
||||
case ShellMode::TableText:
|
||||
case ShellMode::TableListText:
|
||||
{
|
||||
// Temporary solution!!! Should set the font of the current insertion point
|
||||
// at each cursor movement, so outside of this "if". But TH does not
|
||||
|
@ -118,7 +118,7 @@ void SwView::InitInterface_Impl()
|
||||
}
|
||||
|
||||
|
||||
ShellModes SwView::GetShellMode()
|
||||
ShellMode SwView::GetShellMode()
|
||||
{
|
||||
return m_pViewImpl->GetShellMode();
|
||||
}
|
||||
|
@ -278,11 +278,11 @@ void SwXDispatch::addStatusListener(
|
||||
{
|
||||
if(!m_pView)
|
||||
throw uno::RuntimeException();
|
||||
ShellModes eMode = m_pView->GetShellMode();
|
||||
bool bEnable = SHELL_MODE_TEXT == eMode ||
|
||||
SHELL_MODE_LIST_TEXT == eMode ||
|
||||
SHELL_MODE_TABLE_TEXT == eMode ||
|
||||
SHELL_MODE_TABLE_LIST_TEXT == eMode;
|
||||
ShellMode eMode = m_pView->GetShellMode();
|
||||
bool bEnable = ShellMode::Text == eMode ||
|
||||
ShellMode::ListText == eMode ||
|
||||
ShellMode::TableText == eMode ||
|
||||
ShellMode::TableListText == eMode;
|
||||
|
||||
m_bOldEnable = bEnable;
|
||||
frame::FeatureStateEvent aEvent;
|
||||
@ -345,11 +345,11 @@ void SwXDispatch::removeStatusListener(
|
||||
|
||||
void SwXDispatch::selectionChanged( const lang::EventObject& )
|
||||
{
|
||||
ShellModes eMode = m_pView->GetShellMode();
|
||||
bool bEnable = SHELL_MODE_TEXT == eMode ||
|
||||
SHELL_MODE_LIST_TEXT == eMode ||
|
||||
SHELL_MODE_TABLE_TEXT == eMode ||
|
||||
SHELL_MODE_TABLE_LIST_TEXT == eMode;
|
||||
ShellMode eMode = m_pView->GetShellMode();
|
||||
bool bEnable = ShellMode::Text == eMode ||
|
||||
ShellMode::ListText == eMode ||
|
||||
ShellMode::TableText == eMode ||
|
||||
ShellMode::TableListText == eMode;
|
||||
if(bEnable != m_bOldEnable)
|
||||
{
|
||||
m_bOldEnable = bEnable;
|
||||
|
@ -326,10 +326,10 @@ uno::Any SwXTextView::getSelection()
|
||||
m_pView->StopShellTimer();
|
||||
//Generating an interface from the current selection.
|
||||
SwWrtShell& rSh = m_pView->GetWrtShell();
|
||||
ShellModes eSelMode = m_pView->GetShellMode();
|
||||
ShellMode eSelMode = m_pView->GetShellMode();
|
||||
switch(eSelMode)
|
||||
{
|
||||
case SHELL_MODE_TABLE_TEXT :
|
||||
case ShellMode::TableText :
|
||||
{
|
||||
if(rSh.GetTableCursor())
|
||||
{
|
||||
@ -342,15 +342,15 @@ uno::Any SwXTextView::getSelection()
|
||||
SAL_FALLTHROUGH;
|
||||
// without a table selection the text will be delivered
|
||||
}
|
||||
case SHELL_MODE_LIST_TEXT :
|
||||
case SHELL_MODE_TABLE_LIST_TEXT:
|
||||
case SHELL_MODE_TEXT :
|
||||
case ShellMode::ListText :
|
||||
case ShellMode::TableListText:
|
||||
case ShellMode::Text :
|
||||
{
|
||||
uno::Reference< container::XIndexAccess > xPos = SwXTextRanges::Create(rSh.GetCursor());
|
||||
aRef.set(xPos, uno::UNO_QUERY);
|
||||
}
|
||||
break;
|
||||
case SHELL_MODE_FRAME :
|
||||
case ShellMode::Frame :
|
||||
{
|
||||
SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat();
|
||||
if (pFormat)
|
||||
@ -360,7 +360,7 @@ uno::Any SwXTextView::getSelection()
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SHELL_MODE_GRAPHIC :
|
||||
case ShellMode::Graphic :
|
||||
{
|
||||
SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat();
|
||||
if (pFormat)
|
||||
@ -370,7 +370,7 @@ uno::Any SwXTextView::getSelection()
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SHELL_MODE_OBJECT :
|
||||
case ShellMode::Object :
|
||||
{
|
||||
SwFrameFormat *const pFormat = rSh.GetFlyFrameFormat();
|
||||
if (pFormat)
|
||||
@ -380,11 +380,10 @@ uno::Any SwXTextView::getSelection()
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SHELL_MODE_DRAW :
|
||||
case SHELL_MODE_DRAW_CTRL :
|
||||
case SHELL_MODE_DRAW_FORM :
|
||||
case SHELL_MODE_DRAWTEXT :
|
||||
case SHELL_MODE_BEZIER :
|
||||
case ShellMode::Draw :
|
||||
case ShellMode::DrawForm :
|
||||
case ShellMode::DrawText :
|
||||
case ShellMode::Bezier :
|
||||
{
|
||||
uno::Reference< drawing::XDrawPageSupplier > xPageSupp;
|
||||
uno::Reference< frame::XModel > xModel = m_pView->GetDocShell()->GetBaseModel();
|
||||
@ -520,11 +519,11 @@ Sequence< Sequence< PropertyValue > > SwXTextView::getRubyList( sal_Bool /*bAuto
|
||||
if(!GetView())
|
||||
throw RuntimeException();
|
||||
SwWrtShell& rSh = m_pView->GetWrtShell();
|
||||
ShellModes eSelMode = m_pView->GetShellMode();
|
||||
if (eSelMode != SHELL_MODE_LIST_TEXT &&
|
||||
eSelMode != SHELL_MODE_TABLE_LIST_TEXT &&
|
||||
eSelMode != SHELL_MODE_TABLE_TEXT &&
|
||||
eSelMode != SHELL_MODE_TEXT )
|
||||
ShellMode eSelMode = m_pView->GetShellMode();
|
||||
if (eSelMode != ShellMode::ListText &&
|
||||
eSelMode != ShellMode::TableListText &&
|
||||
eSelMode != ShellMode::TableText &&
|
||||
eSelMode != ShellMode::Text )
|
||||
return Sequence< Sequence< PropertyValue > > ();
|
||||
|
||||
SwRubyList aList;
|
||||
@ -565,11 +564,11 @@ void SAL_CALL SwXTextView::setRubyList(
|
||||
if(!GetView() || !rRubyList.getLength())
|
||||
throw RuntimeException();
|
||||
SwWrtShell& rSh = m_pView->GetWrtShell();
|
||||
ShellModes eSelMode = m_pView->GetShellMode();
|
||||
if (eSelMode != SHELL_MODE_LIST_TEXT &&
|
||||
eSelMode != SHELL_MODE_TABLE_LIST_TEXT &&
|
||||
eSelMode != SHELL_MODE_TABLE_TEXT &&
|
||||
eSelMode != SHELL_MODE_TEXT )
|
||||
ShellMode eSelMode = m_pView->GetShellMode();
|
||||
if (eSelMode != ShellMode::ListText &&
|
||||
eSelMode != ShellMode::TableListText &&
|
||||
eSelMode != ShellMode::TableText &&
|
||||
eSelMode != ShellMode::Text )
|
||||
throw RuntimeException();
|
||||
|
||||
SwRubyList aList;
|
||||
@ -1016,14 +1015,14 @@ void SwXTextViewCursor::gotoRange(
|
||||
throw uno::RuntimeException();
|
||||
}
|
||||
|
||||
ShellModes eSelMode = m_pView->GetShellMode();
|
||||
ShellMode eSelMode = m_pView->GetShellMode();
|
||||
SwWrtShell& rSh = m_pView->GetWrtShell();
|
||||
// call EnterStdMode in non-text selections only
|
||||
if(!bExpand ||
|
||||
(eSelMode != SHELL_MODE_TABLE_TEXT &&
|
||||
eSelMode != SHELL_MODE_LIST_TEXT &&
|
||||
eSelMode != SHELL_MODE_TABLE_LIST_TEXT &&
|
||||
eSelMode != SHELL_MODE_TEXT ))
|
||||
(eSelMode != ShellMode::TableText &&
|
||||
eSelMode != ShellMode::ListText &&
|
||||
eSelMode != ShellMode::TableListText &&
|
||||
eSelMode != ShellMode::Text ))
|
||||
rSh.EnterStdMode();
|
||||
SwPaM* pShellCursor = rSh.GetCursor();
|
||||
SwPaM aOwnPaM(*pShellCursor->GetPoint());
|
||||
@ -1096,10 +1095,10 @@ void SwXTextViewCursor::gotoRange(
|
||||
//with Expand only in the same environment
|
||||
if(bExpand &&
|
||||
(pOwnStartNode != pTmp ||
|
||||
(eSelMode != SHELL_MODE_TABLE_TEXT &&
|
||||
eSelMode != SHELL_MODE_LIST_TEXT &&
|
||||
eSelMode != SHELL_MODE_TABLE_LIST_TEXT &&
|
||||
eSelMode != SHELL_MODE_TEXT)))
|
||||
(eSelMode != ShellMode::TableText &&
|
||||
eSelMode != ShellMode::ListText &&
|
||||
eSelMode != ShellMode::TableListText &&
|
||||
eSelMode != ShellMode::Text)))
|
||||
throw uno::RuntimeException();
|
||||
|
||||
//Now, the selection must be expanded.
|
||||
@ -1378,7 +1377,7 @@ OUString SwXTextViewCursor::getString()
|
||||
if (!IsTextSelection( false ))
|
||||
throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
|
||||
|
||||
ShellModes eSelMode = m_pView->GetShellMode();
|
||||
ShellMode eSelMode = m_pView->GetShellMode();
|
||||
switch(eSelMode)
|
||||
{
|
||||
//! since setString for SEL_TABLE_TEXT (with possible
|
||||
@ -1386,9 +1385,9 @@ OUString SwXTextViewCursor::getString()
|
||||
//! will ignore this case for both
|
||||
//! functions (setString AND getString) because of symmetrie.
|
||||
|
||||
case SHELL_MODE_LIST_TEXT :
|
||||
case SHELL_MODE_TABLE_LIST_TEXT:
|
||||
case SHELL_MODE_TEXT :
|
||||
case ShellMode::ListText :
|
||||
case ShellMode::TableListText:
|
||||
case ShellMode::Text :
|
||||
{
|
||||
SwWrtShell& rSh = m_pView->GetWrtShell();
|
||||
SwPaM* pShellCursor = rSh.GetCursor();
|
||||
@ -1409,7 +1408,7 @@ void SwXTextViewCursor::setString(const OUString& aString)
|
||||
if (!IsTextSelection( false ))
|
||||
throw uno::RuntimeException("no text selection", static_cast < cppu::OWeakObject * > ( this ) );
|
||||
|
||||
ShellModes eSelMode = m_pView->GetShellMode();
|
||||
ShellMode eSelMode = m_pView->GetShellMode();
|
||||
switch(eSelMode)
|
||||
{
|
||||
//! since setString for SEL_TABLE_TEXT (with possible
|
||||
@ -1417,9 +1416,9 @@ void SwXTextViewCursor::setString(const OUString& aString)
|
||||
//! will ignore this case for both
|
||||
//! functions (setString AND getString) because of symmetrie.
|
||||
|
||||
case SHELL_MODE_LIST_TEXT :
|
||||
case SHELL_MODE_TABLE_LIST_TEXT :
|
||||
case SHELL_MODE_TEXT :
|
||||
case ShellMode::ListText :
|
||||
case ShellMode::TableListText :
|
||||
case ShellMode::Text :
|
||||
{
|
||||
SwWrtShell& rSh = m_pView->GetWrtShell();
|
||||
SwCursor* pShellCursor = rSh.GetSwCursor();
|
||||
@ -1721,7 +1720,7 @@ uno::Reference< datatransfer::XTransferable > SAL_CALL SwXTextView::getTransfera
|
||||
//force immediat shell update
|
||||
GetView()->StopShellTimer();
|
||||
SwWrtShell& rSh = GetView()->GetWrtShell();
|
||||
if ( GetView()->GetShellMode() == SHELL_MODE_DRAWTEXT )
|
||||
if ( GetView()->GetShellMode() == ShellMode::DrawText )
|
||||
{
|
||||
SdrView *pSdrView = rSh.GetDrawView();
|
||||
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
|
||||
@ -1745,7 +1744,7 @@ void SAL_CALL SwXTextView::insertTransferable( const uno::Reference< datatransfe
|
||||
//force immediat shell update
|
||||
GetView()->StopShellTimer();
|
||||
SwWrtShell& rSh = GetView()->GetWrtShell();
|
||||
if ( GetView()->GetShellMode() == SHELL_MODE_DRAWTEXT )
|
||||
if ( GetView()->GetShellMode() == ShellMode::DrawText )
|
||||
{
|
||||
SdrView *pSdrView = rSh.GetDrawView();
|
||||
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
|
||||
|
@ -162,36 +162,36 @@ void SwWebView::SelectShell()
|
||||
bool bSetExtInpCntxt = false;
|
||||
_nSelectionType = nNewSelectionType;
|
||||
SetSelectionType( _nSelectionType );
|
||||
ShellModes eShellMode;
|
||||
ShellMode eShellMode;
|
||||
|
||||
if ( _nSelectionType & nsSelectionType::SEL_OLE )
|
||||
{
|
||||
eShellMode = SHELL_MODE_OBJECT;
|
||||
eShellMode = ShellMode::Object;
|
||||
SetShell( new SwWebOleShell( *this ));
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
}
|
||||
else if ( _nSelectionType & nsSelectionType::SEL_FRM
|
||||
|| _nSelectionType & nsSelectionType::SEL_GRF)
|
||||
{
|
||||
eShellMode = SHELL_MODE_FRAME;
|
||||
eShellMode = ShellMode::Frame;
|
||||
SetShell( new SwWebFrameShell( *this ));
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
if(_nSelectionType & nsSelectionType::SEL_GRF )
|
||||
{
|
||||
eShellMode = SHELL_MODE_GRAPHIC;
|
||||
eShellMode = ShellMode::Graphic;
|
||||
SetShell( new SwWebGrfShell( *this ));
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
}
|
||||
}
|
||||
else if ( _nSelectionType & nsSelectionType::SEL_FRM )
|
||||
{
|
||||
eShellMode = SHELL_MODE_FRAME;
|
||||
eShellMode = ShellMode::Frame;
|
||||
SetShell( new SwWebFrameShell( *this ));
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
}
|
||||
else if ( _nSelectionType & nsSelectionType::SEL_DRW )
|
||||
{
|
||||
eShellMode = SHELL_MODE_DRAW;
|
||||
eShellMode = ShellMode::Draw;
|
||||
SetShell( new svx::ExtrusionBar( this ) );
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
|
||||
@ -202,7 +202,7 @@ void SwWebView::SelectShell()
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
if ( _nSelectionType & nsSelectionType::SEL_BEZ )
|
||||
{
|
||||
eShellMode = SHELL_MODE_BEZIER;
|
||||
eShellMode = ShellMode::Bezier;
|
||||
SetShell( new SwBezierShell( *this ));
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
}
|
||||
@ -210,31 +210,31 @@ void SwWebView::SelectShell()
|
||||
}
|
||||
else if ( _nSelectionType & nsSelectionType::SEL_DRW_FORM )
|
||||
{
|
||||
eShellMode = SHELL_MODE_DRAW_FORM;
|
||||
eShellMode = ShellMode::DrawForm;
|
||||
SetShell( new SwWebDrawFormShell( *this ));
|
||||
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
}
|
||||
else if ( _nSelectionType & nsSelectionType::SEL_DRW_TXT )
|
||||
{
|
||||
eShellMode = SHELL_MODE_DRAWTEXT;
|
||||
eShellMode = ShellMode::DrawText;
|
||||
rDispatcher.Push( *(new SwBaseShell( *this )) );
|
||||
SetShell( new SwDrawTextShell( *this ));
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
}
|
||||
else if ( _nSelectionType & nsSelectionType::SEL_POSTIT )
|
||||
{
|
||||
eShellMode = SHELL_MODE_POSTIT;
|
||||
eShellMode = ShellMode::PostIt;
|
||||
SetShell( new SwAnnotationShell( *this ) );
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
}
|
||||
else
|
||||
{
|
||||
bSetExtInpCntxt = true;
|
||||
eShellMode = SHELL_MODE_TEXT;
|
||||
eShellMode = ShellMode::Text;
|
||||
if ( _nSelectionType & nsSelectionType::SEL_NUM )
|
||||
{
|
||||
eShellMode = SHELL_MODE_LIST_TEXT;
|
||||
eShellMode = ShellMode::ListText;
|
||||
SetShell( new SwWebListShell( *this ));
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
}
|
||||
@ -242,8 +242,8 @@ void SwWebView::SelectShell()
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
if ( _nSelectionType & nsSelectionType::SEL_TBL )
|
||||
{
|
||||
eShellMode = eShellMode == SHELL_MODE_LIST_TEXT ? SHELL_MODE_TABLE_LIST_TEXT
|
||||
: SHELL_MODE_TABLE_TEXT;
|
||||
eShellMode = eShellMode == ShellMode::ListText ? ShellMode::TableListText
|
||||
: ShellMode::TableText;
|
||||
SetShell( new SwWebTableShell( *this ));
|
||||
rDispatcher.Push( *GetCurShell() );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user