convert SelectionType to scoped enum
Change-Id: Iefdf6d47b1c0189c3b3e39ad5a025e95f18fe6b6
Reviewed-on: https://gerrit.libreoffice.org/36446
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index ae74f41..6af7a90 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -80,6 +80,7 @@ class SwPostItMgr;
enum class SotExchangeDest;
class SwCursorShell;
enum class SvxSearchCmd;
enum class SelectionType : sal_Int32;
namespace com{ namespace sun { namespace star {
namespace view{ class XSelectionSupplier; }
@@ -208,7 +209,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SwPostItMgr *m_pPostItMgr;
int m_nSelectionType;
SelectionType m_nSelectionType;
VclPtr<FloatingWindow> m_pFieldPopup;
sal_uInt16 m_nPageCnt;
@@ -337,10 +338,10 @@ protected:
SwView_Impl* GetViewImpl() {return m_pViewImpl;}
void ImpSetVerb( int nSelType );
void ImpSetVerb( SelectionType nSelType );
int GetSelectionType() const { return m_nSelectionType; }
void SetSelectionType(int nSet) { m_nSelectionType = nSet;}
SelectionType GetSelectionType() const { return m_nSelectionType; }
void SetSelectionType(SelectionType nSet) { m_nSelectionType = nSet;}
// for SwWebView
void SetShell( SfxShell* pS ) { m_pShell = pS; }
diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index 84697cd..93c22f9 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -210,7 +210,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
// pagebreak only when the cursor is in the body-area and not in a table
const FrameTypeFlags eType = rSh.GetFrameType(nullptr,true);
if( !(FrameTypeFlags::BODY & eType) ||
rSh.GetSelectionType() & nsSelectionType::SEL_TBL )
rSh.GetSelectionType() & SelectionType::Table )
{
aSet.Put(SfxBoolItem(SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,true));
rPage.PageCreated(aSet);
@@ -228,7 +228,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
// pagebreak only when the cursor is in the body-area and not in a table
const FrameTypeFlags eType = rSh.GetFrameType(nullptr,true);
if(!(FrameTypeFlags::BODY & eType) ||
rSh.GetSelectionType() & nsSelectionType::SEL_TBL)
rSh.GetSelectionType() & SelectionType::Table)
{
aSet.Put(SfxBoolItem(SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,true));
rPage.PageCreated(aSet);
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 33db3c3..ccd25e2 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -1173,7 +1173,7 @@ bool SwTableOptionsTabPage::FillItemSet( SfxItemSet* )
pModOpt->SetTableMode(eMode);
// the table-keyboard-mode has changed, now the current
// table should know about that too.
if(m_pWrtShell && nsSelectionType::SEL_TBL & m_pWrtShell->GetSelectionType())
if(m_pWrtShell && SelectionType::Table & m_pWrtShell->GetSelectionType())
{
m_pWrtShell->SetTableChgMode(eMode);
static sal_uInt16 aInva[] =
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 5fe1cd7..d44ecc9 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -123,9 +123,9 @@ SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) :
uno::Reference< frame::XModel > xModel = rView.GetDocShell()->GetBaseModel();
eType = rSh.GetSelectionType();
if ( eType & nsSelectionType::SEL_OLE )
if ( eType & SelectionType::Ole )
{
eType = nsSelectionType::SEL_GRF;
eType = SelectionType::Graphic;
uno::Reference< text::XTextEmbeddedObjectsSupplier > xObjs(xModel, uno::UNO_QUERY);
xNameAccess = xObjs->getEmbeddedObjects();
}
@@ -153,7 +153,7 @@ SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) :
OUString sString;
sal_uInt16 nPoolId = 0;
if (eType & nsSelectionType::SEL_GRF)
if (eType & SelectionType::Graphic)
{
nPoolId = RES_POOLCOLL_LABEL_ABB;
sString = ::GetOldGrfCat();
@@ -167,7 +167,7 @@ SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) :
}
}
else if( eType & nsSelectionType::SEL_TBL )
else if( eType & SelectionType::Table )
{
nPoolId = RES_POOLCOLL_LABEL_TABLE;
sString = ::GetOldTabCat();
@@ -175,7 +175,7 @@ SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) :
xNameAccess = xTables->getTextTables();
sObjectName = rSh.GetTableFormat()->GetName();
}
else if( eType & nsSelectionType::SEL_FRM )
else if( eType & SelectionType::Frame )
{
nPoolId = RES_POOLCOLL_LABEL_FRAME;
sString = ::GetOldFrameCat();
@@ -183,12 +183,12 @@ SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) :
xNameAccess = xFrames->getTextFrames();
sObjectName = rSh.GetFlyName();
}
else if( eType == nsSelectionType::SEL_TXT )
else if( eType == SelectionType::Text )
{
nPoolId = RES_POOLCOLL_LABEL_FRAME;
sString = ::GetOldFrameCat();
}
else if( eType & nsSelectionType::SEL_DRW )
else if( eType & SelectionType::DrawObject )
{
nPoolId = RES_POOLCOLL_LABEL_DRAWING;
sString = ::GetOldDrwCat();
@@ -226,23 +226,22 @@ SwCaptionDialog::SwCaptionDialog( vcl::Window *pParent, SwView &rV ) :
}
// aPosBox
switch (eType)
if (eType == SelectionType::Graphic
|| eType == SelectionType::Table
|| eType == (SelectionType::Table | SelectionType::NumberList)
|| eType == (SelectionType::Table | SelectionType::Text)
|| eType == (SelectionType::Table | SelectionType::NumberList | SelectionType::Text)
|| eType == SelectionType::DrawObject
|| eType == (SelectionType::DrawObject | SelectionType::Ornament))
{
case nsSelectionType::SEL_GRF:
case nsSelectionType::SEL_TBL:
case nsSelectionType::SEL_TBL | nsSelectionType::SEL_NUM:
case nsSelectionType::SEL_TBL | nsSelectionType::SEL_TXT:
case nsSelectionType::SEL_TBL | nsSelectionType::SEL_NUM | nsSelectionType::SEL_TXT:
case nsSelectionType::SEL_DRW:
case nsSelectionType::SEL_DRW | nsSelectionType::SEL_BEZ:
m_pPosBox->InsertEntry(SW_RESSTR(STR_CAPTION_ABOVE));
m_pPosBox->InsertEntry(SW_RESSTR(STR_CAPTION_BELOW));
break;
case nsSelectionType::SEL_FRM:
case nsSelectionType::SEL_TXT:
m_pPosBox->InsertEntry(SW_RESSTR(STR_CAPTION_BEGINNING));
m_pPosBox->InsertEntry(SW_RESSTR(STR_CAPTION_END ));
break;
m_pPosBox->InsertEntry(SW_RESSTR(STR_CAPTION_ABOVE));
m_pPosBox->InsertEntry(SW_RESSTR(STR_CAPTION_BELOW));
}
else if(eType == SelectionType::Frame
|| eType == SelectionType::Text)
{
m_pPosBox->InsertEntry(SW_RESSTR(STR_CAPTION_BEGINNING));
m_pPosBox->InsertEntry(SW_RESSTR(STR_CAPTION_END ));
}
m_pPosBox->SelectEntryPos(1);
diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx
index 1a1afc2..631902c 100644
--- a/sw/source/ui/frmdlg/wrap.cxx
+++ b/sw/source/ui/frmdlg/wrap.cxx
@@ -178,9 +178,9 @@ void SwWrapTabPage::Reset(const SfxItemSet *rSet)
bool bShowCB = m_bFormat;
if( !m_bFormat )
{
int nSelType = m_pWrtSh->GetSelectionType();
if( ( nSelType & nsSelectionType::SEL_GRF ) ||
( nSelType & nsSelectionType::SEL_OLE && GraphicType::NONE !=
SelectionType nSelType = m_pWrtSh->GetSelectionType();
if( ( nSelType & SelectionType::Graphic ) ||
( nSelType & SelectionType::Ole && GraphicType::NONE !=
m_pWrtSh->GetIMapGraphic().GetType() ))
bShowCB = true;
}
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index aeaff222..caa6b90 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -150,7 +150,7 @@ SwSortDlg::SwSortDlg(vcl::Window* pParent, SwWrtShell &rShell)
m_pDelimEdt->SetMaxTextLen( 1 );
if(rSh.GetSelectionType() &
(nsSelectionType::SEL_TBL|nsSelectionType::SEL_TBL_CELLS) )
(SelectionType::Table|SelectionType::TableCell) )
{
m_pColumnRB->Check(bCol);
m_pColLbl->SetText(bCol ? aRowText : aColText);
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 6babf28..61e98ca 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -160,14 +160,14 @@ void SwModule::StateOther(SfxItemSet &rSet)
case FN_EDIT_FORMULA:
{
SwWrtShell* pSh = nullptr;
int nSelection = 0;
SelectionType nSelection = SelectionType::NONE;
if( pActView )
pSh = &pActView->GetWrtShell();
if( pSh )
nSelection = pSh->GetSelectionType();
if( (pSh && pSh->HasSelection()) ||
!(nSelection & (nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL)))
!(nSelection & (SelectionType::Text | SelectionType::Table)))
rSet.DisableItem(nWhich);
}
break;
diff --git a/sw/source/uibase/config/barcfg.cxx b/sw/source/uibase/config/barcfg.cxx
index cbf4477..7fc2569 100644
--- a/sw/source/uibase/config/barcfg.cxx
+++ b/sw/source/uibase/config/barcfg.cxx
@@ -62,26 +62,26 @@ SwToolbarConfigItem::~SwToolbarConfigItem()
{
}
static sal_Int32 lcl_getArrayIndex(int nSelType)
static sal_Int32 lcl_getArrayIndex(SelectionType nSelType)
{
sal_Int32 nRet = -1;
if(nSelType & nsSelectionType::SEL_NUM)
if(nSelType & SelectionType::NumberList)
{
if(nSelType & nsSelectionType::SEL_TBL)
if(nSelType & SelectionType::Table)
nRet = SEL_TYPE_TABLE_LIST;
else
nRet = SEL_TYPE_LIST_TEXT;
}
else if(nSelType & nsSelectionType::SEL_TBL)
else if(nSelType & SelectionType::Table)
nRet = SEL_TYPE_TABLE_TEXT;
else if(nSelType & nsSelectionType::SEL_BEZ)
else if(nSelType & SelectionType::Ornament)
nRet = SEL_TYPE_BEZIER;
else if(nSelType & nsSelectionType::SEL_GRF)
else if(nSelType & SelectionType::Graphic)
nRet = SEL_TYPE_GRAPHIC;
return nRet;
}
void SwToolbarConfigItem::SetTopToolbar( sal_Int32 nSelType, sal_Int32 nBarId )
void SwToolbarConfigItem::SetTopToolbar( SelectionType nSelType, sal_Int32 nBarId )
{
sal_Int32 nProp = lcl_getArrayIndex(nSelType);
if(nProp >= 0)
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
index fc9e021..117fe87 100644
--- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -208,7 +208,7 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck)
else
{
// the selection type has to be checked again - both text types are possible
if(0 != (pWrtShell->GetSelectionType()& nsSelectionType::SEL_DRW_TXT))
if(pWrtShell->GetSelectionType() & SelectionType::DrawObjectEditMode)
bDrawText = true;
bNormalText = !bDrawText;
}
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 10d9006..1562752 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -412,13 +412,13 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
{
SelectionType nSelectionType = m_pWrtShell->GetSelectionType();
// when pending we will not get the correct type, but nsSelectionType::SEL_TXT
// when pending we will not get the correct type, but SelectionType::Text
// as fallback. This *happens* during D&D, so we need to check if we are in
// the fallback and just try to get a graphic
const bool bPending(m_pWrtShell->BasicActionPend());
// SEL_GRF is from ContentType of editsh
if(bPending || ((nsSelectionType::SEL_GRF | nsSelectionType::SEL_DRW_FORM) & nSelectionType))
if(bPending || ((SelectionType::Graphic | SelectionType::DbForm) & nSelectionType))
{
m_pClpGraphic = new Graphic;
if( !m_pWrtShell->GetDrawObjGraphic( SotClipboardFormatId::GDIMETAFILE, *m_pClpGraphic ))
@@ -449,7 +449,7 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
SwTransferable::InitOle( m_aDocShellRef, *pTmpDoc );
pTmpDoc->SetTmpDocShell( nullptr );
if( nSelectionType & nsSelectionType::SEL_TXT && !m_pWrtShell->HasMark() )
if( nSelectionType & SelectionType::Text && !m_pWrtShell->HasMark() )
{
SwContentAtPos aContentAtPos( IsAttrAtPos::InetAttr );
@@ -777,9 +777,9 @@ void SwTransferable::DeleteSelection()
if(!m_pWrtShell)
return;
// ask for type of selection before action-bracketing
const int nSelection = m_pWrtShell->GetSelectionType();
const SelectionType nSelection = m_pWrtShell->GetSelectionType();
m_pWrtShell->StartUndo( SwUndoId::START );
if( ( nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL ) & nSelection )
if( ( SelectionType::Text | SelectionType::Table ) & nSelection )
m_pWrtShell->IntelligentCut( nSelection );
m_pWrtShell->DelRight();
m_pWrtShell->EndUndo( SwUndoId::END );
@@ -792,8 +792,8 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
return 0;
OUString sGrfNm;
const int nSelection = m_pWrtShell->GetSelectionType();
if( nSelection == nsSelectionType::SEL_GRF )
const SelectionType nSelection = m_pWrtShell->GetSelectionType();
if( nSelection == SelectionType::Graphic )
{
m_pClpGraphic = new Graphic;
if( !m_pWrtShell->GetDrawObjGraphic( SotClipboardFormatId::GDIMETAFILE, *m_pClpGraphic ))
@@ -822,7 +822,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
m_eBufferType = TransferBufferType::Graphic;
m_pWrtShell->GetGrfNms( &sGrfNm, nullptr );
}
else if ( nSelection == nsSelectionType::SEL_OLE )
else if ( nSelection == SelectionType::Ole )
{
m_pClpDocFac = new SwDocFac;
SwDoc *const pDoc = lcl_GetDoc(*m_pClpDocFac);
@@ -915,7 +915,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
}
bool bDDELink = m_pWrtShell->IsSelection();
if( nSelection & nsSelectionType::SEL_TBL_CELLS )
if( nSelection & SelectionType::TableCell )
{
m_eBufferType = TransferBufferType::Table | m_eBufferType;
bDDELink = m_pWrtShell->HasWholeTabSelection();
@@ -934,10 +934,10 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
if( m_pWrtShell->IsSelection() )
AddFormat( SotClipboardFormatId::STRING );
if( nSelection & ( nsSelectionType::SEL_DRW | nsSelectionType::SEL_DRW_FORM ))
if( nSelection & ( SelectionType::DrawObject | SelectionType::DbForm ))
{
AddFormat( SotClipboardFormatId::DRAWING );
if ( nSelection & nsSelectionType::SEL_DRW )
if ( nSelection & SelectionType::DrawObject )
{
AddFormat( SotClipboardFormatId::GDIMETAFILE );
AddFormat( SotClipboardFormatId::PNG );
@@ -3017,8 +3017,8 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
if(!m_pWrtShell)
return;
OUString sGrfNm;
const int nSelection = m_pWrtShell->GetSelectionType();
if( nsSelectionType::SEL_GRF == nSelection)
const SelectionType nSelection = m_pWrtShell->GetSelectionType();
if( SelectionType::Graphic == nSelection)
{
AddFormat( SotClipboardFormatId::SVXB );
const Graphic* pGrf = m_pWrtShell->GetGraphic();
@@ -3031,7 +3031,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
m_eBufferType = TransferBufferType::Graphic;
m_pWrtShell->GetGrfNms( &sGrfNm, nullptr );
}
else if( nsSelectionType::SEL_OLE == nSelection )
else if( SelectionType::Ole == nSelection )
{
AddFormat( SotClipboardFormatId::EMBED_SOURCE );
PrepareOLE( m_aObjDesc );
@@ -3053,7 +3053,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
m_eBufferType = TransferBufferType::DocumentWord | m_eBufferType;
}
if( nSelection & nsSelectionType::SEL_TBL_CELLS )
if( nSelection & SelectionType::TableCell )
m_eBufferType = TransferBufferType::Table | m_eBufferType;
AddFormat( SotClipboardFormatId::EMBED_SOURCE );
@@ -3068,10 +3068,10 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
if( m_pWrtShell->IsSelection() )
AddFormat( SotClipboardFormatId::STRING );
if( nSelection & ( nsSelectionType::SEL_DRW | nsSelectionType::SEL_DRW_FORM ))
if( nSelection & ( SelectionType::DrawObject | SelectionType::DbForm ))
{
AddFormat( SotClipboardFormatId::DRAWING );
if ( nSelection & nsSelectionType::SEL_DRW )
if ( nSelection & SelectionType::DrawObject )
{
AddFormat( SotClipboardFormatId::GDIMETAFILE );
AddFormat( SotClipboardFormatId::PNG );
@@ -3110,7 +3110,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
PrepareOLE( m_aObjDesc );
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
}
else if( nSelection & nsSelectionType::SEL_TXT && !m_pWrtShell->HasMark() )
else if( nSelection & SelectionType::Text && !m_pWrtShell->HasMark() )
{
// is only one field - selected?
SwContentAtPos aContentAtPos( IsAttrAtPos::InetAttr );
@@ -3198,9 +3198,9 @@ void SwTransferable::DragFinished( sal_Int8 nAction )
}
else
{
const int nSelection = m_pWrtShell->GetSelectionType();
if( ( nsSelectionType::SEL_FRM | nsSelectionType::SEL_GRF |
nsSelectionType::SEL_OLE | nsSelectionType::SEL_DRW ) & nSelection )
const SelectionType nSelection = m_pWrtShell->GetSelectionType();
if( ( SelectionType::Frame | SelectionType::Graphic |
SelectionType::Ole | SelectionType::DrawObject ) & nSelection )
{
m_pWrtShell->EnterSelFrameMode();
}
@@ -3243,23 +3243,23 @@ bool SwTransferable::PrivatePaste( SwWrtShell& rShell )
if ( !m_pClpDocFac )
return false; // the return value of the SwFEShell::Paste also is bool!
const int nSelection = rShell.GetSelectionType();
const SelectionType nSelection = rShell.GetSelectionType();
SwTrnsfrActionAndUndo aAction( &rShell );
bool bKillPaMs = false;
//Delete selected content, not at table-selection and table in Clipboard, and don't delete hovering graphics.
if( rShell.HasSelection() && !( nSelection & nsSelectionType::SEL_TBL_CELLS) && !( nSelection & nsSelectionType::SEL_DRW))
if( rShell.HasSelection() && !( nSelection & SelectionType::TableCell) && !( nSelection & SelectionType::DrawObject))
{
bKillPaMs = true;
rShell.SetRetainSelection( true );
rShell.DelRight();
// when a Fly was selected, a valid cursor position has to be found now
// (parked Cursor!)
if( ( nsSelectionType::SEL_FRM | nsSelectionType::SEL_GRF |
nsSelectionType::SEL_OLE | nsSelectionType::SEL_DRW |
nsSelectionType::SEL_DRW_FORM ) & nSelection )
if( ( SelectionType::Frame | SelectionType::Graphic |
SelectionType::Ole | SelectionType::DrawObject |
SelectionType::DbForm ) & nSelection )
{
// position the cursor again
Point aPt( rShell.GetCharRect().Pos() );
@@ -3267,7 +3267,7 @@ bool SwTransferable::PrivatePaste( SwWrtShell& rShell )
}
rShell.SetRetainSelection( false );
}
if ( nSelection & nsSelectionType::SEL_DRW) //unselect hovering graphics
if ( nSelection & SelectionType::DrawObject) //unselect hovering graphics
{
rShell.ResetSelect(nullptr,false);
}
@@ -3336,10 +3336,10 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
g_bFrameDrag = true;
}
const int nSelection = rSh.GetSelectionType();
const SelectionType nSelection = rSh.GetSelectionType();
// not yet consider Draw objects
if( nsSelectionType::SEL_GRF & nSelection )
if( SelectionType::Graphic & nSelection )
{
SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL );
rSh.GetFlyFrameAttr( aSet );
@@ -3350,7 +3350,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
return true;
}
if( nsSelectionType::SEL_DRW & nSelection )
if( SelectionType::DrawObject & nSelection )
{
rSh.LeaveSelFrameMode();
rSh.UnSelectFrame();
@@ -3360,7 +3360,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
}
}
if( &rSh != &rSrcSh && (nsSelectionType::SEL_GRF & rSh.GetSelectionType()) &&
if( &rSh != &rSrcSh && (SelectionType::Graphic & rSh.GetSelectionType()) &&
TransferBufferType::Graphic == m_eBufferType )
{
// ReRead the graphic
@@ -3387,7 +3387,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt,
bFrameSel = true;
}
const int nSel = rSrcSh.GetSelectionType();
const SelectionType nSel = rSrcSh.GetSelectionType();
SwUndoId eUndoId = bMove ? SwUndoId::UI_DRAG_AND_MOVE : SwUndoId::UI_DRAG_AND_COPY;
@@ -3640,7 +3640,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh )
, bInDisconnect(false)
{
// we only end up here with table- or text selection
if( nsSelectionType::SEL_TBL_CELLS & rSh.GetSelectionType() )
if( SelectionType::TableCell & rSh.GetSelectionType() )
{
SwFrameFormat* pFormat = rSh.GetTableFormat();
if( pFormat )
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index ffede7f..a26e2a0 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -360,7 +360,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier )
bool bFrameIsValidTarget = false;
if( m_pApplyTempl->m_pFormatClipboard )
bFrameIsValidTarget = m_pApplyTempl->m_pFormatClipboard->HasContentForThisType( nsSelectionType::SEL_FRM );
bFrameIsValidTarget = m_pApplyTempl->m_pFormatClipboard->HasContentForThisType( SelectionType::Frame );
else if( !m_pApplyTempl->nColor )
bFrameIsValidTarget = ( m_pApplyTempl->eType == SfxStyleFamily::Frame );
@@ -1524,13 +1524,13 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
return ;
}
}
int nLclSelectionType;
SelectionType nLclSelectionType;
//A is converted to 1
if( rKeyCode.GetFullCode() == (KEY_A | KEY_MOD1 |KEY_SHIFT)
&& rSh.HasDrawView() &&
(0 != (nLclSelectionType = rSh.GetSelectionType()) &&
((nLclSelectionType & (nsSelectionType::SEL_FRM|nsSelectionType::SEL_GRF)) ||
((nLclSelectionType & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM)) &&
(bool(nLclSelectionType = rSh.GetSelectionType()) &&
((nLclSelectionType & (SelectionType::Frame|SelectionType::Graphic)) ||
((nLclSelectionType & (SelectionType::DrawObject|SelectionType::DbForm)) &&
rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1))))
{
SdrHdlList& rHdlList = (SdrHdlList&)rSh.GetDrawView()->GetHdlList();
@@ -1728,7 +1728,7 @@ KEYINPUT_CHECKTABLE:
if(SwKeyState::KeyToView != eFlyState)
{
if(!pFlyFormat && SwKeyState::KeyToView != eFlyState &&
(rSh.GetSelectionType() & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM)) &&
(rSh.GetSelectionType() & (SelectionType::DrawObject|SelectionType::DbForm)) &&
rSh.GetDrawView()->AreObjectsMarked())
eKeyState = SwKeyState::Draw_Change;
}
@@ -1746,10 +1746,10 @@ KEYINPUT_CHECKTABLE:
case KEY_UP | KEY_SHIFT:
case KEY_DOWN | KEY_SHIFT:
{
const int nSelectionType = rSh.GetSelectionType();
const SelectionType nSelectionType = rSh.GetSelectionType();
if ( ( pFlyFormat
&& ( nSelectionType & (nsSelectionType::SEL_FRM|nsSelectionType::SEL_OLE|nsSelectionType::SEL_GRF) ) )
|| ( ( nSelectionType & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM) )
&& ( nSelectionType & (SelectionType::Frame|SelectionType::Ole|SelectionType::Graphic) ) )
|| ( ( nSelectionType & (SelectionType::DrawObject|SelectionType::DbForm) )
&& rSh.GetDrawView()->AreObjectsMarked() ) )
{
eKeyState = pFlyFormat ? SwKeyState::Fly_Change : SwKeyState::Draw_Change;
@@ -1825,15 +1825,15 @@ KEYINPUT_CHECKTABLE_INSDEL:
false /* table protected */
)
{
const int nSelectionType = rSh.GetSelectionType();
const SelectionType nSelectionType = rSh.GetSelectionType();
eKeyState = SwKeyState::KeyToView;
if(SwKeyState::KeyToView != eFlyState)
{
if((nSelectionType & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM)) &&
if((nSelectionType & (SelectionType::DrawObject|SelectionType::DbForm)) &&
rSh.GetDrawView()->AreObjectsMarked())
eKeyState = SwKeyState::Draw_Change;
else if(nSelectionType & (nsSelectionType::SEL_FRM|nsSelectionType::SEL_OLE|nsSelectionType::SEL_GRF))
else if(nSelectionType & (SelectionType::Frame|SelectionType::Ole|SelectionType::Graphic))
eKeyState = SwKeyState::Fly_Change;
}
}
@@ -1885,13 +1885,13 @@ KEYINPUT_CHECKTABLE_INSDEL:
if ( !rSh.HasReadonlySel()
&& !rSh.CursorInsideInputField() )
{
const int nSelectionType = rSh.GetSelectionType();
if(nSelectionType & nsSelectionType::SEL_OLE)
const SelectionType nSelectionType = rSh.GetSelectionType();
if(nSelectionType & SelectionType::Ole)
eKeyState = SwKeyState::LaunchOLEObject;
else if(nSelectionType & nsSelectionType::SEL_FRM)
else if(nSelectionType & SelectionType::Frame)
eKeyState = SwKeyState::GoIntoFly;
else if((nSelectionType & nsSelectionType::SEL_DRW) &&
0 == (nSelectionType & nsSelectionType::SEL_DRW_TXT) &&
else if((nSelectionType & SelectionType::DrawObject) &&
!(nSelectionType & SelectionType::DrawObjectEditMode) &&
rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1)
{
eKeyState = SwKeyState::GoIntoDrawing;
@@ -1914,10 +1914,10 @@ KEYINPUT_CHECKTABLE_INSDEL:
}
//RETURN for new paragraph with AutoFormatting
else if( pACfg && pACfg->IsAutoFormatByInput() &&
!(nSelectionType & (nsSelectionType::SEL_GRF |
nsSelectionType::SEL_OLE | nsSelectionType::SEL_FRM |
nsSelectionType::SEL_TBL_CELLS | nsSelectionType::SEL_DRW |
nsSelectionType::SEL_DRW_TXT)) )
!(nSelectionType & (SelectionType::Graphic |
SelectionType::Ole | SelectionType::Frame |
SelectionType::TableCell | SelectionType::DrawObject |
SelectionType::DrawObjectEditMode)) )
{
eKeyState = SwKeyState::CheckAutoCorrect;
eNextKeyState = SwKeyState::AutoFormatByInput;
@@ -2077,11 +2077,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
}
}
else if ( rSh.GetSelectionType() &
(nsSelectionType::SEL_GRF |
nsSelectionType::SEL_FRM |
nsSelectionType::SEL_OLE |
nsSelectionType::SEL_DRW |
nsSelectionType::SEL_DRW_FORM))
(SelectionType::Graphic |
SelectionType::Frame |
SelectionType::Ole |
SelectionType::DrawObject |
SelectionType::DbForm))
eKeyState = SwKeyState::NextObject;
else
@@ -2132,11 +2132,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
}
}
else if ( rSh.GetSelectionType() &
(nsSelectionType::SEL_GRF |
nsSelectionType::SEL_FRM |
nsSelectionType::SEL_OLE |
nsSelectionType::SEL_DRW |
nsSelectionType::SEL_DRW_FORM))
(SelectionType::Graphic |
SelectionType::Frame |
SelectionType::Ole |
SelectionType::DrawObject |
SelectionType::DbForm))
eKeyState = SwKeyState::PrevObject;
else
@@ -2167,8 +2167,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
else if( rSh.GetTableFormat() )
eKeyState = SwKeyState::InsTab;
else if((rSh.GetSelectionType() &
(nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM|
nsSelectionType::SEL_FRM|nsSelectionType::SEL_OLE|nsSelectionType::SEL_GRF)) &&
(SelectionType::DrawObject|SelectionType::DbForm|
SelectionType::Frame|SelectionType::Ole|SelectionType::Graphic)) &&
rSh.GetDrawView()->AreObjectsMarked())
eKeyState = SwKeyState::EnterDrawHandleMode;
else
@@ -2188,8 +2188,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
pACorr->GetSwFlags().bAutoCmpltEndless );
eKeyState = SwKeyState::NextPrevGlossary;
}
else if((rSh.GetSelectionType() & (nsSelectionType::SEL_DRW|nsSelectionType::SEL_DRW_FORM|
nsSelectionType::SEL_FRM|nsSelectionType::SEL_OLE|nsSelectionType::SEL_GRF)) &&
else if((rSh.GetSelectionType() & (SelectionType::DrawObject|SelectionType::DbForm|
SelectionType::Frame|SelectionType::Ole|SelectionType::Graphic)) &&
rSh.GetDrawView()->AreObjectsMarked())
{
eKeyState = SwKeyState::EnterDrawHandleMode;
@@ -2199,10 +2199,10 @@ KEYINPUT_CHECKTABLE_INSDEL:
case KEY_F2 :
if( !rSh.HasReadonlySel() )
{
const int nSelectionType = rSh.GetSelectionType();
if(nSelectionType & nsSelectionType::SEL_FRM)
const SelectionType nSelectionType = rSh.GetSelectionType();
if(nSelectionType & SelectionType::Frame)
eKeyState = SwKeyState::GoIntoFly;
else if((nSelectionType & nsSelectionType::SEL_DRW))
else if((nSelectionType & SelectionType::DrawObject))
{
eKeyState = SwKeyState::GoIntoDrawing;
if (lcl_goIntoTextBox(*this, rSh))
@@ -2223,11 +2223,11 @@ KEYINPUT_CHECKTABLE_INSDEL:
bNormalChar = false;
eKeyState = SwKeyState::End;
if ( rSh.GetSelectionType() &
(nsSelectionType::SEL_GRF |
nsSelectionType::SEL_FRM |
nsSelectionType::SEL_OLE |
nsSelectionType::SEL_DRW |
nsSelectionType::SEL_DRW_FORM))
(SelectionType::Graphic |
SelectionType::Frame |
SelectionType::Ole |
SelectionType::DrawObject |
SelectionType::DbForm))
{
eKeyState = (rKeyCode.GetModifier() & KEY_SHIFT) ?
@@ -2245,8 +2245,8 @@ KEYINPUT_CHECKTABLE_INSDEL:
break;
case KEY_RETURN:
{
const int nSelectionType = rSh.GetSelectionType();
if(nSelectionType & nsSelectionType::SEL_FRM)
const SelectionType nSelectionType = rSh.GetSelectionType();
if(nSelectionType & SelectionType::Frame)
eKeyState = SwKeyState::GoIntoFly;
else
{
@@ -2317,9 +2317,9 @@ KEYINPUT_CHECKTABLE_INSDEL:
if( !bIsDocReadOnly && bNormalChar )
{
const int nSelectionType = rSh.GetSelectionType();
const bool bDrawObject = (nSelectionType & nsSelectionType::SEL_DRW) &&
0 == (nSelectionType & nsSelectionType::SEL_DRW_TXT) &&
const SelectionType nSelectionType = rSh.GetSelectionType();
const bool bDrawObject = (nSelectionType & SelectionType::DrawObject) &&
!(nSelectionType & SelectionType::DrawObjectEditMode) &&
rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() == 1;
bool bTextBox = false;
@@ -2340,7 +2340,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
rSh.GetDrawView()->KeyInput( rKEvt, this );
}
}
else if (nSelectionType & nsSelectionType::SEL_FRM || bTextBox)
else if (nSelectionType & SelectionType::Frame || bTextBox)
{
rSh.UnSelectFrame();
rSh.LeaveSelFrameMode();
@@ -3301,9 +3301,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
* (take a look into the GetSelectionType method) and on the other hand the
* return value is used in a switch without proper masking (very nice), this must lead to trouble
*/
switch ( rSh.GetSelectionType() &~ ( nsSelectionType::SEL_FONTWORK | nsSelectionType::SEL_EXTRUDED_CUSTOMSHAPE ) )
switch ( rSh.GetSelectionType() & ~SelectionType( SelectionType::FontWork | SelectionType::ExtrudedCustomShape ) )
{
case nsSelectionType::SEL_GRF:
case SelectionType::Graphic:
RstMBDownFlags();
if (!comphelper::LibreOfficeKit::isActive())
{
@@ -3314,7 +3314,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
return;
// double click on OLE object --> OLE-InPlace
case nsSelectionType::SEL_OLE:
case SelectionType::Ole:
if (rSh.IsSelObjProtected(FlyProtectFlags::Content) == FlyProtectFlags::NONE)
{
RstMBDownFlags();
@@ -3322,7 +3322,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
return;
case nsSelectionType::SEL_FRM:
case SelectionType::Frame:
RstMBDownFlags();
if (!comphelper::LibreOfficeKit::isActive())
{
@@ -3332,12 +3332,14 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
return;
case nsSelectionType::SEL_DRW:
case SelectionType::DrawObject:
RstMBDownFlags();
EnterDrawTextMode(aDocPos);
if ( dynamic_cast< const SwDrawTextShell *>( m_rView.GetCurShell() ) != nullptr )
static_cast<SwDrawTextShell*>(m_rView.GetCurShell())->Init();
return;
default: break;
}
}
@@ -3685,11 +3687,11 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
if (!bOverURLGrf && !bExecDrawTextLink && !bOnlyText)
{
const int nSelType = rSh.GetSelectionType();
const SelectionType nSelType = rSh.GetSelectionType();
// Check in general, if an object is selectable at given position.
// Thus, also text fly frames in background become selectable via Ctrl-Click.
if ( ( nSelType & nsSelectionType::SEL_OLE ||
nSelType & nsSelectionType::SEL_GRF ||
if ( ( nSelType & SelectionType::Ole ||
nSelType & SelectionType::Graphic ||
rSh.IsObjSelectable( aDocPos ) ) && !lcl_urlOverBackground( rSh, aDocPos ) )
{
SwMvContext aMvContext( &rSh );
@@ -4073,9 +4075,9 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if( bIsDocReadOnly )
break;
bool bResizeKeepRatio = rSh.GetSelectionType() & nsSelectionType::SEL_GRF ||
rSh.GetSelectionType() & nsSelectionType::SEL_MEDIA ||
rSh.GetSelectionType() & nsSelectionType::SEL_OLE;
bool bResizeKeepRatio = rSh.GetSelectionType() & SelectionType::Graphic ||
rSh.GetSelectionType() & SelectionType::Media ||
rSh.GetSelectionType() & SelectionType::Ole;
bool bisResize = g_eSdrMoveHdl != SdrHdlKind::Move;
if (pSdrView)
@@ -4762,7 +4764,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
if( m_pApplyTempl )
{
int eSelection = rSh.GetSelectionType();
SelectionType eSelection = rSh.GetSelectionType();
SwFormatClipboard* pFormatClipboard = m_pApplyTempl->m_pFormatClipboard;
if( pFormatClipboard )//apply format paintbrush
{
@@ -4802,7 +4804,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
nId = RES_CHRATR_BACKGROUND;
break;
}
if( nId && (nsSelectionType::SEL_TXT|nsSelectionType::SEL_TBL) & eSelection)
if( nId && (SelectionType::Text|SelectionType::Table) & eSelection)
{
if( rSh.IsSelection() && !rSh.HasReadonlySel() )
{
@@ -4831,7 +4833,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
switch ( m_pApplyTempl->eType )
{
case SfxStyleFamily::Para:
if( (( nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL )
if( (( SelectionType::Text | SelectionType::Table )
& eSelection ) && !rSh.HasReadonlySel() )
{
rSh.SetTextFormatColl( m_pApplyTempl->aColl.pTextColl );
@@ -4843,7 +4845,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
}
break;
case SfxStyleFamily::Char:
if( (( nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL )
if( (( SelectionType::Text | SelectionType::Table )
& eSelection ) && !rSh.HasReadonlySel() )
{
rSh.SetAttrItem( SwFormatCharFormat(m_pApplyTempl->aColl.pCharFormat) );
@@ -5651,7 +5653,7 @@ void SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
// if draw text is active and there's a text selection
// at the mouse position then do nothing
if(rSh.GetSelectionType() & nsSelectionType::SEL_DRW_TXT)
if(rSh.GetSelectionType() & SelectionType::DrawObjectEditMode)
{
OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
ESelection aSelection = pOLV->GetSelection();
@@ -5825,9 +5827,9 @@ void SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos )
}
if( !bOverURLGrf )
{
const int nSelType = rSh.GetSelectionType();
if( nSelType == nsSelectionType::SEL_OLE ||
nSelType == nsSelectionType::SEL_GRF )
const SelectionType nSelType = rSh.GetSelectionType();
if( nSelType == SelectionType::Ole ||
nSelType == SelectionType::Graphic )
{
SwMvContext aMvContext( &rSh );
if( !rSh.IsFrameSelected() )
diff --git a/sw/source/uibase/inc/barcfg.hxx b/sw/source/uibase/inc/barcfg.hxx
index 607ff2f..0982c3c 100644
--- a/sw/source/uibase/inc/barcfg.hxx
+++ b/sw/source/uibase/inc/barcfg.hxx
@@ -18,8 +18,11 @@
*/
#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_BARCFG_HXX
#define INCLUDED_SW_SOURCE_UIBASE_INC_BARCFG_HXX
#include <unotools/configitem.hxx>
enum class SelectionType : sal_Int32;
class SwToolbarConfigItem : public utl::ConfigItem
{
sal_Int32 aTbxIdArray[5];
@@ -34,7 +37,7 @@ public:
virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
void SetTopToolbar( sal_Int32 nSelType, sal_Int32 nBarId );
void SetTopToolbar( SelectionType nSelType, sal_Int32 nBarId );
};
#endif
diff --git a/sw/source/uibase/inc/formatclipboard.hxx b/sw/source/uibase/inc/formatclipboard.hxx
index eb18dc8..11e35cf 100644
--- a/sw/source/uibase/inc/formatclipboard.hxx
+++ b/sw/source/uibase/inc/formatclipboard.hxx
@@ -37,8 +37,8 @@ public:
* Test if the object contains text or paragraph attribute
*/
bool HasContent() const;
bool HasContentForThisType( int nSelectionType ) const;
static bool CanCopyThisType( int nSelectionType );
bool HasContentForThisType( SelectionType nSelectionType ) const;
static bool CanCopyThisType( SelectionType nSelectionType );
/**
* Store/Backup the text and paragraph attribute of the current selection.
@@ -66,7 +66,7 @@ public:
void Erase();
private:
int m_nSelectionType;
SelectionType m_nSelectionType;
/** automatic/named character attribute set */
SfxItemSet* m_pItemSet_TextAttr;
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index 07e0528..45e9ec7 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -26,6 +26,7 @@
#include <IMark.hxx>
#include "navmgr.hxx"
#include <boost/optional.hpp>
#include <o3tl/typed_flags_set.hxx>
namespace vcl { class Window; }
class SbxArray;
@@ -50,25 +51,29 @@ namespace i18nutil {
struct SearchOptions2;
}
typedef sal_Int32 SelectionType;
namespace nsSelectionType
enum class SelectionType : sal_Int32
{
const SelectionType SEL_TXT = CNT_TXT; // text, never frames too 0x0001
const SelectionType SEL_GRF = CNT_GRF; // graphic 0x0002
const SelectionType SEL_OLE = CNT_OLE; // OLE 0x0010
const SelectionType SEL_FRM = 0x000020; // frame, no content type
const SelectionType SEL_NUM = 0x000040; // NumList
const SelectionType SEL_TBL = 0x000080; // cursor is in table
const SelectionType SEL_TBL_CELLS = 0x000100; // table cells are selected
const SelectionType SEL_DRW = 0x000200; // drawing objects (rectangle, circle...)
const SelectionType SEL_DRW_TXT = 0x000400; // draw-textobjects in edit mode
const SelectionType SEL_BEZ = 0x000800; // edit ornament objects
const SelectionType SEL_DRW_FORM = 0x001000; // drawing objects: DB-Forms
const SelectionType SEL_FOC_FRM_CTRL = 0x002000; // a form control is focused. Neither set nor evaluated by the SwWrtShell itself, only by its clients.
const SelectionType SEL_MEDIA = 0x004000; // Media object
const SelectionType SEL_EXTRUDED_CUSTOMSHAPE = 0x008000; // extruded custom shape
const SelectionType SEL_FONTWORK = 0x010000; // fontwork
const SelectionType SEL_POSTIT = 0x020000; //annotation
NONE = 0x000000,
Text = CNT_TXT, // text, never frames too 0x0001
Graphic = CNT_GRF, // graphic 0x0002
Ole = CNT_OLE, // OLE 0x0010
Frame = 0x000020, // frame, no content type
NumberList = 0x000040, // NumList
Table = 0x000080, // cursor is in table
TableCell = 0x000100, // table cells are selected
DrawObject = 0x000200, // drawing objects (rectangle, circle...)
DrawObjectEditMode = 0x000400, // draw-textobjects in edit mode
Ornament = 0x000800, // edit ornament objects
DbForm = 0x001000, // drawing objects: DB-Forms
FormControl = 0x002000, // a form control is focused. Neither set nor evaluated by the SwWrtShell itself, only by its clients.
Media = 0x004000, // Media object
ExtrudedCustomShape = 0x008000, // extruded custom shape
FontWork = 0x010000, // fontwork
PostIt = 0x020000, // annotation
All = 0x03fff3,
};
namespace o3tl {
template<> struct typed_flags<SelectionType> : is_typed_flags<SelectionType, 0x03fff3> {};
}
/** Used by the UI to modify the document model.
@@ -282,7 +287,7 @@ typedef bool (SwWrtShell:: *FNSimpleMove)();
WORD_SPACE_AFTER = 2,
WORD_NO_SPACE = 3
};
int IntelligentCut(int nSelectionType, bool bCut = true);
int IntelligentCut(SelectionType nSelectionType, bool bCut = true);
// edit
void Insert(SwField &);
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index e55cf19..101fc81 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -179,7 +179,7 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh )
aGrf, rURL.GetMap(), pList.get(), pEditObj );
}
static bool lcl_UpdateContourDlg( SwWrtShell &rSh, int nSel )
static bool lcl_UpdateContourDlg( SwWrtShell &rSh, SelectionType nSel )
{
Graphic aGraf( rSh.GetIMapGraphic() );
GraphicType nGrfType = aGraf.GetType();
@@ -187,7 +187,7 @@ static bool lcl_UpdateContourDlg( SwWrtShell &rSh, int nSel )
if( bRet )
{
OUString aGrfName;
if ( nSel & nsSelectionType::SEL_GRF )
if ( nSel & SelectionType::Graphic )
rSh.GetGrfNms( &aGrfName, nullptr );
SvxContourDlg *pDlg = GetContourDlg(rSh.GetView());
@@ -759,10 +759,10 @@ void SwBaseShell::Execute(SfxRequest &rReq)
if ( !pGalleryItem )
break;
const int nSelType = rSh.GetSelectionType();
const SelectionType nSelType = rSh.GetSelectionType();
sal_Int8 nGalleryItemType( pGalleryItem->GetType() );
if ( (!rSh.IsSelFrameMode() || nSelType & nsSelectionType::SEL_GRF) &&
if ( (!rSh.IsSelFrameMode() || nSelType & SelectionType::Graphic) &&
nGalleryItemType == css::gallery::GalleryItemType::GRAPHIC )
{
SwWait aWait( *rView.GetDocShell(), true );
@@ -770,7 +770,7 @@ void SwBaseShell::Execute(SfxRequest &rReq)
OUString aGrfName, aFltName;
const Graphic aGrf( pGalleryItem->GetGraphic() );
if ( nSelType & nsSelectionType::SEL_GRF )
if ( nSelType & SelectionType::Graphic )
rSh.ReRead( aGrfName, aFltName, &aGrf );
else
rSh.Insert( aGrfName, aFltName, aGrf );
@@ -998,9 +998,9 @@ void SwBaseShell::Execute(SfxRequest &rReq)
pVFrame->ToggleChildWindow( nId );
pVFrame->GetBindings().Invalidate( SID_CONTOUR_DLG );
int nSel = rSh.GetSelectionType();
SelectionType nSel = rSh.GetSelectionType();
if ( pVFrame->HasChildWindow( nId ) &&
(nSel & (nsSelectionType::SEL_GRF|nsSelectionType::SEL_OLE)) )
(nSel & (SelectionType::Graphic|SelectionType::Ole)) )
{
lcl_UpdateContourDlg( rSh, nSel );
}
@@ -1010,8 +1010,8 @@ void SwBaseShell::Execute(SfxRequest &rReq)
{
SvxContourDlg *pDlg = GetContourDlg(GetView());
// Check, if the allocation is useful or allowed at all.
int nSel = rSh.GetSelectionType();
if ( nSel & (nsSelectionType::SEL_GRF|nsSelectionType::SEL_OLE) )
SelectionType nSel = rSh.GetSelectionType();
if ( nSel & (SelectionType::Graphic|SelectionType::Ole) )
{
if (pDlg && pDlg->GetEditingObject() == rSh.GetIMapInventor())
{
@@ -1321,7 +1321,7 @@ IMPL_LINK_NOARG(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void)
static_cast<SvxIMapDlg*>(pChildWindow->GetWindow()) : nullptr;
if( pDlg && pDlg->GetEditingObject() !=
rSh.GetIMapInventor() )
lcl_UpdateContourDlg( rSh, nsSelectionType::SEL_GRF );
lcl_UpdateContourDlg( rSh, SelectionType::Graphic );
bSetState = true;
bState = nullptr != pDlg;
@@ -1382,7 +1382,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
case SID_GALLERY_FORMATS:
if ( rSh.IsObjSelected() ||
(rSh.IsSelFrameMode() &&
!(rSh.GetSelectionType() & nsSelectionType::SEL_GRF)) )
!(rSh.GetSelectionType() & SelectionType::Graphic)) )
rSet.DisableItem( nWhich );
break;
case SID_GALLERY_ENABLE_ADDCOPY:
@@ -1471,7 +1471,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
const bool bHas = pVFrame->HasChildWindow( nId );
const bool bFrameSel = rSh.IsFrameSelected();
const bool bIsGraphicSelection =
rSh.GetSelectionType() == nsSelectionType::SEL_GRF;
rSh.GetSelectionType() == SelectionType::Graphic;
// #i59688#
// Avoid unnecessary loading of selected graphic.
@@ -1512,7 +1512,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
if(!bDisable && pVFrame->HasChildWindow( nId ))
{
if(rSh.GetSelectionType() == nsSelectionType::SEL_GRF
if(rSh.GetSelectionType() == SelectionType::Graphic
&& rSh.IsLinkedGrfSwapOut())
{
if( AddGrfUpdateSlot( nWhich ))
@@ -1549,8 +1549,8 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
{
sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
bool bHas = GetView().GetViewFrame()->HasChildWindow( nId );
int nSel = rSh.GetSelectionType();
bool bOk = 0 != (nSel & (nsSelectionType::SEL_GRF|nsSelectionType::SEL_OLE));
SelectionType nSel = rSh.GetSelectionType();
bool bOk(nSel & (SelectionType::Graphic|SelectionType::Ole));
bool bDisable = false;
if( !bHas && !bOk )
@@ -1561,7 +1561,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
// If the swapping of the graphic is finished, the status
// must be determined asynchronously, until this the slot
// will be disabled.
else if ( bHas && (nSel & nsSelectionType::SEL_GRF) &&
else if ( bHas && (nSel & SelectionType::Graphic) &&
rSh.IsLinkedGrfSwapOut() )
{
if( AddGrfUpdateSlot( nWhich ))
@@ -1575,7 +1575,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
{
// #i75481#
// apply fix #i59688# only for selected graphics
if ( nSel & nsSelectionType::SEL_GRF )
if ( nSel & SelectionType::Graphic )
bDisable = GraphicType::NONE == rSh.GetGraphicType();
else
bDisable = GraphicType::NONE == rSh.GetIMapGraphic().GetType();
@@ -1591,8 +1591,8 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
case SID_CONTOUR_EXEC:
{
bool bDisable = false;
int nSel = rSh.GetSelectionType();
if( !(nSel & (nsSelectionType::SEL_GRF|nsSelectionType::SEL_OLE)) )
SelectionType nSel = rSh.GetSelectionType();
if( !(nSel & (SelectionType::Graphic|SelectionType::Ole)) )
bDisable = true;
sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
if( !bDisable && GetView().GetViewFrame()->HasChildWindow( nId ))
@@ -1751,8 +1751,8 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
bDisable |= (nSurround == css::text::WrapTextMode_NONE || nSurround == css::text::WrapTextMode_THROUGHT);
if( !bDisable )
{
int nSel = rSh.GetSelectionType();
if( (nSel & nsSelectionType::SEL_GRF) &&
SelectionType nSel = rSh.GetSelectionType();
if( (nSel & SelectionType::Graphic) &&
rSh.IsLinkedGrfSwapOut())
{
if( AddGrfUpdateSlot( nWhich ))
@@ -1762,7 +1762,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
{
// #i102253# applied patch from OD (see task)
bDisable =
nSel & nsSelectionType::SEL_FRM ||
nSel & SelectionType::Frame ||
GraphicType::NONE == rSh.GetIMapGraphic().GetType();
}
}
@@ -2205,10 +2205,10 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet)
SwWrtShell &rSh = GetShell();
SfxWhichIter aIter(rSet);
sal_uInt16 nWhich(aIter.FirstWhich());
int nSelType(rSh.GetSelectionType());
SelectionType nSelType(rSh.GetSelectionType());
SvxBrushItem aBrushItem(RES_BACKGROUND);
if( nsSelectionType::SEL_TBL_CELLS & nSelType )
if( SelectionType::TableCell & nSelType )
{
rSh.GetBoxBackground( aBrushItem );
}
@@ -2219,7 +2219,7 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet)
aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
if(nSelType & nsSelectionType::SEL_GRF || nsSelectionType::SEL_FRM & nSelType)
if(nSelType & SelectionType::Graphic || SelectionType::Frame & nSelType)
{
rSh.GetFlyFrameAttr(aCoreSet);
}
@@ -2257,7 +2257,7 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet)
void SwBaseShell::ExecBckCol(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
int nSelType(rSh.GetSelectionType());
SelectionType nSelType(rSh.GetSelectionType());
const SfxItemSet* pArgs = rReq.GetArgs();
sal_uInt16 nSlot(rReq.GetSlot());
@@ -2268,7 +2268,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
SvxBrushItem aBrushItem(RES_BACKGROUND);
if( nsSelectionType::SEL_TBL_CELLS & nSelType )
if( SelectionType::TableCell & nSelType )
{
rSh.GetBoxBackground( aBrushItem );
}
@@ -2279,7 +2279,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
if((nsSelectionType::SEL_FRM & nSelType) || (nsSelectionType::SEL_GRF & nSelType))
if((SelectionType::Frame & nSelType) || (SelectionType::Graphic & nSelType))
{
rSh.GetFlyFrameAttr(aCoreSet);
}
@@ -2327,7 +2327,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
}
}
if( nsSelectionType::SEL_TBL_CELLS & nSelType )
if( SelectionType::TableCell & nSelType )
{
rSh.SetBoxBackground( aBrushItem );
}
@@ -2339,7 +2339,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, aCoreSet);
if((nsSelectionType::SEL_FRM & nSelType) || (nsSelectionType::SEL_GRF & nSelType))
if((SelectionType::Frame & nSelType) || (SelectionType::Graphic & nSelType))
{
// Template autoupdate
SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat();
@@ -2747,7 +2747,7 @@ void SwBaseShell::GetGalleryState( SfxItemSet &rSet )
{
case SID_GALLERY_BG_BRUSH:
{
int nSel = rSh.GetSelectionType();
SelectionType nSel = rSh.GetSelectionType();
SfxStringListItem aLst( nWhich );
std::vector<OUString> &rLst = aLst.GetList();
nParagraphPos = nGraphicPos = nOlePos = nFramePos = nTablePos =
@@ -2760,13 +2760,13 @@ void SwBaseShell::GetGalleryState( SfxItemSet &rSet )
bool bHtmlMode = 0 != (nHtmlMode & HTMLMODE_ON);
if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_FULL_STYLES)) &&
(nSel & nsSelectionType::SEL_TXT) )
(nSel & SelectionType::Text) )
{
rLst.push_back( SW_RESSTR( STR_SWBG_PARAGRAPH ) );
nParagraphPos = nPos++;
}
if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_SOME_STYLES)) &&
nSel & (nsSelectionType::SEL_TBL|nsSelectionType::SEL_TBL_CELLS) )
nSel & (SelectionType::Table|SelectionType::TableCell) )
{
rLst.push_back( SW_RESSTR( STR_SWBG_TABLE ) );
nTablePos = nPos++;
@@ -2782,17 +2782,17 @@ void SwBaseShell::GetGalleryState( SfxItemSet &rSet )
}
if(!bHtmlMode)
{
if ( nSel & nsSelectionType::SEL_FRM )
if ( nSel & SelectionType::Frame )
{
rLst.push_back( SW_RESSTR( STR_SWBG_FRAME ) );
nFramePos = nPos++;
}
if ( nSel & nsSelectionType::SEL_GRF )
if ( nSel & SelectionType::Graphic )
{
rLst.push_back( SW_RESSTR( STR_SWBG_GRAPHIC ) );
nGraphicPos = nPos++;
}
if ( nSel & nsSelectionType::SEL_OLE )
if ( nSel & SelectionType::Ole )
{
rLst.push_back( SW_RESSTR( STR_SWBG_OLE ) );
nOlePos = nPos++;
@@ -2831,8 +2831,8 @@ void SwBaseShell::ExecuteGallery(SfxRequest &rReq)
if ( !pArgs )
break;
int nSel = rSh.GetSelectionType();
if ( nSel & nsSelectionType::SEL_DRW_TXT )
SelectionType nSel = rSh.GetSelectionType();
if ( nSel & SelectionType::DrawObjectEditMode )
break;
const SfxUInt16Item* pPos = rReq.GetArg<SfxUInt16Item>(SID_GALLERY_BG_POS);
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index acfcd31..7281147 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -378,8 +378,8 @@ void SwFrameShell::Execute(SfxRequest &rReq)
case FN_FORMAT_FRAME_DLG:
case FN_DRAW_WRAP_DLG:
{
const int nSel = rSh.GetSelectionType();
if (nSel & nsSelectionType::SEL_GRF)
const SelectionType nSel = rSh.GetSelectionType();
if (nSel & SelectionType::Graphic)
{
rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_FORMAT_GRAFIC_DLG);
bUpdateMgr = false;
@@ -420,11 +420,11 @@ void SwFrameShell::Execute(SfxRequest &rReq)
pDrawModel->PutAreaListItems(aSet);
const SwViewOption* pVOpt = rSh.GetViewOptions();
if(nSel & nsSelectionType::SEL_OLE)
if(nSel & SelectionType::Ole)
aSet.Put( SfxBoolItem(FN_KEEP_ASPECT_RATIO, pVOpt->IsKeepRatio()) );
aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
if( nSel & nsSelectionType::SEL_OLE )
if( nSel & SelectionType::Ole )
{
// #i73249#
aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) );
@@ -466,8 +466,8 @@ void SwFrameShell::Execute(SfxRequest &rReq)
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
assert(pFact);
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog(
nSel & nsSelectionType::SEL_GRF ? OUString("PictureDialog") :
nSel & nsSelectionType::SEL_OLE ? OUString("ObjectDialog"):
nSel & SelectionType::Graphic ? OUString("PictureDialog") :
nSel & SelectionType::Ole ? OUString("ObjectDialog"):
OUString("FrameDialog"),
GetView().GetViewFrame(),
GetView().GetWindow(),
@@ -487,7 +487,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
if(pOutSet)
{
rReq.Done(*pOutSet);
if(nSel & nsSelectionType::SEL_OLE &&
if(nSel & SelectionType::Ole &&
SfxItemState::SET == pOutSet->GetItemState(FN_KEEP_ASPECT_RATIO, true, &pItem))
{
SwViewOption aUsrPref( *pVOpt );
@@ -852,8 +852,8 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
case FN_FRAME_CHAIN:
{
const int nSel = rSh.GetSelectionType();
if (nSel & nsSelectionType::SEL_GRF || nSel & nsSelectionType::SEL_OLE)
const SelectionType nSel = rSh.GetSelectionType();
if (nSel & SelectionType::Graphic || nSel & SelectionType::Ole)
rSet.DisableItem( FN_FRAME_CHAIN );
else
{
@@ -873,8 +873,8 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
break;
case FN_FRAME_UNCHAIN:
{
const int nSel = rSh.GetSelectionType();
if (nSel & nsSelectionType::SEL_GRF || nSel & nsSelectionType::SEL_OLE)
const SelectionType nSel = rSh.GetSelectionType();
if (nSel & SelectionType::Graphic || nSel & SelectionType::Ole)
rSet.DisableItem( FN_FRAME_UNCHAIN );
else
{
@@ -930,8 +930,8 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
case FN_FORMAT_FRAME_DLG:
{
const int nSel = rSh.GetSelectionType();
if ( bParentCntProt || nSel & nsSelectionType::SEL_GRF)
const SelectionType nSel = rSh.GetSelectionType();
if ( bParentCntProt || nSel & SelectionType::Graphic)
rSet.DisableItem( nWhich );
}
break;
@@ -1191,9 +1191,9 @@ void SwFrameShell::GetLineStyleState(SfxItemSet &rSet)
void SwFrameShell::StateInsert(SfxItemSet &rSet)
{
const int nSel = GetShell().GetSelectionType();
if ( (nSel & nsSelectionType::SEL_GRF)
|| (nSel & nsSelectionType::SEL_OLE) )
const SelectionType nSel = GetShell().GetSelectionType();
if ( (nSel & SelectionType::Graphic)
|| (nSel & SelectionType::Ole) )
{
rSet.DisableItem(FN_INSERT_FRAME);
}
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 6d744b1..8dc2bf086 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -197,7 +197,7 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh )
// Set minimum size in tables and paragraphs.
aBoxInfo.SetMinDist( !bTableSel || rSh.IsTableMode() ||
rSh.GetSelectionType() &
(nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL));
(SelectionType::Text | SelectionType::Table));
// Always set the default spacing.
aBoxInfo.SetDefDist (MIN_BORDER_DIST);
// Individual lines can have DontCare status only in tables.
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index 9fcea1e..0c4b7c7 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -895,7 +895,7 @@ void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem)
SwWrtShell& rSh = GetShell();
if( rSh.GetSelectionType() & nsSelectionType::SEL_TXT )
if( rSh.GetSelectionType() & SelectionType::Text )
{
rSh.StartAction();
SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT);
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index df0131e..b512f5e 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -694,8 +694,8 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
case FN_INSERT_FRAME:
if (rSh.IsSelFrameMode() )
{
const int nSel = rSh.GetSelectionType();
if( ((nsSelectionType::SEL_GRF | nsSelectionType::SEL_OLE ) & nSel ) || bCursorInHidden )
const SelectionType nSel = rSh.GetSelectionType();
if( ((SelectionType::Graphic | SelectionType::Ole ) & nSel ) || bCursorInHidden )
rSet.DisableItem(nWhich);
}
else if ( rSh.CursorInsideInputField() )
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index b81dc31..c4fd2b6 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1457,10 +1457,10 @@ void SwTextShell::GetState( SfxItemSet &rSet )
case SID_CHARMAP:
case SID_EMOJI_CONTROL:
{
const int nType = rSh.GetSelectionType();
if (!(nType & nsSelectionType::SEL_TXT) &&
!(nType & nsSelectionType::SEL_TBL) &&
!(nType & nsSelectionType::SEL_NUM))
const SelectionType nType = rSh.GetSelectionType();
if (!(nType & SelectionType::Text) &&
!(nType & SelectionType::Table) &&
!(nType & SelectionType::NumberList))
{
rSet.DisableItem(nWhich);
}
diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx
index ea79b16..de2fdec 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -58,20 +58,20 @@ RES_PARATR_BEGIN, RES_PARATR_END -1, \
RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END -1, \
FORMAT_PAINTBRUSH_FRAME_IDS
SfxItemSet* lcl_CreateEmptyItemSet( int nSelectionType, SfxItemPool& rPool, bool bNoParagraphFormats = false )
SfxItemSet* lcl_CreateEmptyItemSet( SelectionType nSelectionType, SfxItemPool& rPool, bool bNoParagraphFormats = false )
{
SfxItemSet* pItemSet = nullptr;
if( nSelectionType & (nsSelectionType::SEL_FRM | nsSelectionType::SEL_OLE | nsSelectionType::SEL_GRF) )
if( nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic) )
{
pItemSet = new SfxItemSet(rPool,
FORMAT_PAINTBRUSH_FRAME_IDS
0);
}
else if( nSelectionType & nsSelectionType::SEL_DRW )
else if( nSelectionType & SelectionType::DrawObject )
{
//is handled different
}
else if( nSelectionType & nsSelectionType::SEL_TXT )
else if( nSelectionType & SelectionType::Text )
{
if( bNoParagraphFormats )
pItemSet = new SfxItemSet(rPool,
@@ -223,7 +223,7 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh )
}//end anonymous namespace
SwFormatClipboard::SwFormatClipboard()
: m_nSelectionType(0)
: m_nSelectionType(SelectionType::NONE)
, m_pItemSet_TextAttr(nullptr)
, m_pItemSet_ParAttr(nullptr)
, m_pTableItemSet(nullptr)
@@ -246,7 +246,7 @@ bool SwFormatClipboard::HasContent() const
|| !m_aParaStyle.isEmpty()
;
}
bool SwFormatClipboard::HasContentForThisType( int nSelectionType ) const
bool SwFormatClipboard::HasContentForThisType( SelectionType nSelectionType ) const
{
if( !HasContent() )
return false;
@@ -254,22 +254,22 @@ bool SwFormatClipboard::HasContentForThisType( int nSelectionType ) const
if( m_nSelectionType == nSelectionType )
return true;
if( ( nSelectionType & (nsSelectionType::SEL_FRM | nsSelectionType::SEL_OLE | nsSelectionType::SEL_GRF) )
if( ( nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic) )
&&
( m_nSelectionType & (nsSelectionType::SEL_FRM | nsSelectionType::SEL_OLE | nsSelectionType::SEL_GRF) )
( m_nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic) )
)
return true;
if( nSelectionType & nsSelectionType::SEL_TXT && m_nSelectionType & nsSelectionType::SEL_TXT )
if( nSelectionType & SelectionType::Text && m_nSelectionType & SelectionType::Text )
return true;
return false;
}
bool SwFormatClipboard::CanCopyThisType( int nSelectionType )
bool SwFormatClipboard::CanCopyThisType( SelectionType nSelectionType )
{
if( nSelectionType & (nsSelectionType::SEL_FRM | nsSelectionType::SEL_OLE | nsSelectionType::SEL_GRF
| nsSelectionType::SEL_TXT | nsSelectionType::SEL_DRW | nsSelectionType::SEL_TBL | nsSelectionType::SEL_TBL_CELLS ) )
if( nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic
| SelectionType::Text | SelectionType::DrawObject | SelectionType::Table | SelectionType::TableCell ) )
return true;
return false;
}
@@ -280,7 +280,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP
this->Erase();
m_bPersistentCopy = bPersistentCopy;
int nSelectionType = rWrtShell.GetSelectionType();
SelectionType nSelectionType = rWrtShell.GetSelectionType();
SfxItemSet* pItemSet_TextAttr = lcl_CreateEmptyItemSet( nSelectionType, rPool, true );
SfxItemSet* pItemSet_ParAttr = lcl_CreateEmptyItemSet( nSelectionType, rPool );
@@ -290,7 +290,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP
// modify the "Point and Mark" of the cursor
// in order to select only the last character of the
// selection(s) and then to get the attributes of this single character
if( nSelectionType == nsSelectionType::SEL_TXT )
if( nSelectionType == SelectionType::Text )
{
// get the current PaM, the cursor
// if there several selection it currently point
@@ -346,14 +346,14 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP
if(pItemSet_TextAttr)
{
if( nSelectionType & (nsSelectionType::SEL_FRM | nsSelectionType::SEL_OLE | nsSelectionType::SEL_GRF) )
if( nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic) )
rWrtShell.GetFlyFrameAttr(*pItemSet_TextAttr);
else
{
// get the text attributes from named and automatic formatting
rWrtShell.GetCurAttr(*pItemSet_TextAttr);
if( nSelectionType & nsSelectionType::SEL_TXT )
if( nSelectionType & SelectionType::Text )
{
// get the paragraph attributes (could be character properties)
// from named and automatic formatting
@@ -361,7 +361,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP
}
}
}
else if ( nSelectionType & nsSelectionType::SEL_DRW )
else if ( nSelectionType & SelectionType::DrawObject )
{
SdrView* pDrawView = rWrtShell.GetDrawView();
if(pDrawView)
@@ -379,7 +379,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP
}
}
if( nSelectionType & nsSelectionType::SEL_TBL_CELLS )//only copy table attributes if really cells are selected (not only text in tables)
if( nSelectionType & SelectionType::TableCell )//only copy table attributes if really cells are selected (not only text in tables)
{
m_pTableItemSet = new SfxItemSet(rPool,
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW, //SID_ATTR_BORDER_OUTER is inbetween
@@ -402,7 +402,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP
m_pItemSet_TextAttr = pItemSet_TextAttr;
m_pItemSet_ParAttr = pItemSet_ParAttr;
if( nSelectionType & nsSelectionType::SEL_TXT )
if( nSelectionType & SelectionType::Text )
{
// if text is selected save the named character format
SwFormat* pFormat = rWrtShell.GetCurCharFormat();
@@ -458,7 +458,7 @@ static void lcl_RemoveEqualItems( SfxItemSet& rTemplateItemSet, const ItemVector
void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPool
, bool bNoCharacterFormats, bool bNoParagraphFormats )
{
int nSelectionType = rWrtShell.GetSelectionType();
SelectionType nSelectionType = rWrtShell.GetSelectionType();
if( !this->HasContentForThisType(nSelectionType) )
{
if(!m_bPersistentCopy)
@@ -471,7 +471,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
ItemVector aItemVector;
if( nSelectionType & nsSelectionType::SEL_TXT )
if( nSelectionType & SelectionType::Text )
{
// apply the named text and paragraph formatting
if( pPool )
@@ -537,7 +537,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
if(m_pItemSet_TextAttr)
{
if( nSelectionType & nsSelectionType::SEL_DRW )
if( nSelectionType & SelectionType::DrawObject )
{
SdrView* pDrawView = rWrtShell.GetDrawView();
if(pDrawView)
@@ -562,7 +562,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
lcl_RemoveEqualItems( *pTemplateItemSet, aItemVector );
// apply the character automatic attributes
if( nSelectionType & (nsSelectionType::SEL_FRM | nsSelectionType::SEL_OLE | nsSelectionType::SEL_GRF) )
if( nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic) )
rWrtShell.SetFlyFrameAttr(*pTemplateItemSet);
else if ( !bNoCharacterFormats )
rWrtShell.SetAttrSet(*pTemplateItemSet);
@@ -570,7 +570,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
}
}
if( m_pTableItemSet && nSelectionType & (nsSelectionType::SEL_TBL | nsSelectionType::SEL_TBL_CELLS) )
if( m_pTableItemSet && nSelectionType & (SelectionType::Table | SelectionType::TableCell) )
lcl_setTableAttributes( *m_pTableItemSet, rWrtShell );
rWrtShell.EndUndo(SwUndoId::INSATTR);
@@ -582,7 +582,7 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
void SwFormatClipboard::Erase()
{
m_nSelectionType = 0;
m_nSelectionType = SelectionType::NONE;
delete m_pItemSet_TextAttr;
m_pItemSet_TextAttr = nullptr;
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index cc3dc2d..200e854 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -142,15 +142,15 @@ SfxDispatcher &SwView::GetDispatcher()
return *GetViewFrame()->GetDispatcher();
}
void SwView::ImpSetVerb( int nSelType )
void SwView::ImpSetVerb( SelectionType nSelType )
{
bool bResetVerbs = m_bVerbsActive;
if ( !GetViewFrame()->GetFrame().IsInPlace() &&
(nsSelectionType::SEL_OLE|nsSelectionType::SEL_GRF) & nSelType )
(SelectionType::Ole|SelectionType::Graphic) & nSelType )
{
if ( m_pWrtShell->IsSelObjProtected(FlyProtectFlags::Content) == FlyProtectFlags::NONE )
{
if ( nSelType & nsSelectionType::SEL_OLE )
if ( nSelType & SelectionType::Ole )
{
SetVerbs( GetWrtShell().GetOLEObject()->getSupportedVerbs() );
m_bVerbsActive = true;
@@ -236,17 +236,17 @@ void SwView::SelectShell()
m_pLastTableFormat = pCurTableFormat;
//SEL_TBL and SEL_TBL_CELLS can be ORed!
int nNewSelectionType = (m_pWrtShell->GetSelectionType()
& ~nsSelectionType::SEL_TBL_CELLS);
SelectionType nNewSelectionType = (m_pWrtShell->GetSelectionType()
& ~SelectionType::TableCell);
if ( m_pFormShell && m_pFormShell->IsActiveControl() )
nNewSelectionType |= nsSelectionType::SEL_FOC_FRM_CTRL;
nNewSelectionType |= SelectionType::FormControl;
if ( nNewSelectionType == m_nSelectionType )
{
GetViewFrame()->GetBindings().InvalidateAll( false );
if ( m_nSelectionType & nsSelectionType::SEL_OLE ||
m_nSelectionType & nsSelectionType::SEL_GRF )
if ( m_nSelectionType & SelectionType::Ole ||
m_nSelectionType & SelectionType::Graphic )
// For graphs and OLE the verb can be modified of course!
ImpSetVerb( nNewSelectionType );
}
@@ -298,72 +298,72 @@ void SwView::SelectShell()
m_nSelectionType = nNewSelectionType;
ShellMode eShellMode;
if ( !( m_nSelectionType & nsSelectionType::SEL_FOC_FRM_CTRL ) )
if ( !( m_nSelectionType & SelectionType::FormControl ) )
rDispatcher.Push( *m_pFormShell );
m_pShell = new SwNavigationShell( *this );
rDispatcher.Push( *m_pShell );
if ( m_nSelectionType & nsSelectionType::SEL_OLE )
if ( m_nSelectionType & SelectionType::Ole )
{
eShellMode = ShellMode::Object;
m_pShell = new SwOleShell( *this );
rDispatcher.Push( *m_pShell );
}
else if ( m_nSelectionType & nsSelectionType::SEL_FRM
|| m_nSelectionType & nsSelectionType::SEL_GRF)
else if ( m_nSelectionType & SelectionType::Frame
|| m_nSelectionType & SelectionType::Graphic)
{
eShellMode = ShellMode::Frame;
m_pShell = new SwFrameShell( *this );
rDispatcher.Push( *m_pShell );
if(m_nSelectionType & nsSelectionType::SEL_GRF )
if(m_nSelectionType & SelectionType::Graphic )
{
eShellMode = ShellMode::Graphic;
m_pShell = new SwGrfShell( *this );
rDispatcher.Push( *m_pShell );
}
}
else if ( m_nSelectionType & nsSelectionType::SEL_DRW )
else if ( m_nSelectionType & SelectionType::DrawObject )
{
eShellMode = ShellMode::Draw;
m_pShell = new SwDrawShell( *this );
rDispatcher.Push( *m_pShell );
if ( m_nSelectionType & nsSelectionType::SEL_BEZ )
if ( m_nSelectionType & SelectionType::Ornament )
{
eShellMode = ShellMode::Bezier;
m_pShell = new SwBezierShell( *this );
rDispatcher.Push( *m_pShell );
}
#if HAVE_FEATURE_AVMEDIA
else if( m_nSelectionType & nsSelectionType::SEL_MEDIA )
else if( m_nSelectionType & SelectionType::Media )
{
eShellMode = ShellMode::Media;
m_pShell = new SwMediaShell( *this );
rDispatcher.Push( *m_pShell );
}
#endif
if (m_nSelectionType & nsSelectionType::SEL_EXTRUDED_CUSTOMSHAPE)
if (m_nSelectionType & SelectionType::ExtrudedCustomShape)
{
eShellMode = ShellMode::ExtrudedCustomShape;
m_pShell = new svx::ExtrusionBar(this);
rDispatcher.Push( *m_pShell );
}
if (m_nSelectionType & nsSelectionType::SEL_FONTWORK)
if (m_nSelectionType & SelectionType::FontWork)
{
eShellMode = ShellMode::FontWork;
m_pShell = new svx::FontworkBar(this);
rDispatcher.Push( *m_pShell );
}
}
else if ( m_nSelectionType & nsSelectionType::SEL_DRW_FORM )
else if ( m_nSelectionType & SelectionType::DbForm )
{
eShellMode = ShellMode::DrawForm;
m_pShell = new SwDrawFormShell( *this );
rDispatcher.Push( *m_pShell );
}
else if ( m_nSelectionType & nsSelectionType::SEL_DRW_TXT )
else if ( m_nSelectionType & SelectionType::DrawObjectEditMode )
{
bSetExtInpCntxt = true;
eShellMode = ShellMode::DrawText;
@@ -371,7 +371,7 @@ void SwView::SelectShell()
m_pShell = new SwDrawTextShell( *this );
rDispatcher.Push( *m_pShell );
}
else if ( m_nSelectionType & nsSelectionType::SEL_POSTIT )
else if ( m_nSelectionType & SelectionType::PostIt )
{
eShellMode = ShellMode::PostIt;
m_pShell = new SwAnnotationShell( *this );
@@ -381,7 +381,7 @@ void SwView::SelectShell()
{
bSetExtInpCntxt = true;
eShellMode = ShellMode::Text;
if ( m_nSelectionType & nsSelectionType::SEL_NUM )
if ( m_nSelectionType & SelectionType::NumberList )
{
eShellMode = ShellMode::ListText;
m_pShell = new SwListShell( *this );
@@ -389,7 +389,7 @@ void SwView::SelectShell()
}
m_pShell = new SwTextShell(*this);
rDispatcher.Push( *m_pShell );
if ( m_nSelectionType & nsSelectionType::SEL_TBL )
if ( m_nSelectionType & SelectionType::Table )
{
eShellMode = eShellMode == ShellMode::ListText ? ShellMode::TableListText
: ShellMode::TableText;
@@ -398,7 +398,7 @@ void SwView::SelectShell()
}
}
if ( m_nSelectionType & nsSelectionType::SEL_FOC_FRM_CTRL )
if ( m_nSelectionType & SelectionType::FormControl )
rDispatcher.Push( *m_pFormShell );
m_pViewImpl->SetShellMode(eShellMode);
@@ -697,7 +697,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
m_pLastTableFormat(nullptr),
m_pFormatClipboard(new SwFormatClipboard()),
m_pPostItMgr(nullptr),
m_nSelectionType( INT_MAX ),
m_nSelectionType( SelectionType::All ),
m_nPageCnt(0),
m_nDrawSfxId( USHRT_MAX ),
m_nFormSfxId( USHRT_MAX ),
@@ -1523,8 +1523,8 @@ ErrCode SwView::DoVerb( long nVerb )
if ( !GetViewFrame()->GetFrame().IsInPlace() )
{
SwWrtShell &rSh = GetWrtShell();
const int nSel = rSh.GetSelectionType();
if ( nSel & nsSelectionType::SEL_OLE )
const SelectionType nSel = rSh.GetSelectionType();
if ( nSel & SelectionType::Ole )
rSh.LaunchOLEObj( nVerb );
}
return ERRCODE_NONE;
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 09195d4..bfcad89 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -246,7 +246,7 @@ int SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter,
SwWrtShell& rShell = GetWrtShell();
// #i123922# determine if we really want to insert or replace the graphic at a selected object
const bool bReplaceMode(rShell.HasSelection() && nsSelectionType::SEL_FRM == rShell.GetSelectionType());
const bool bReplaceMode(rShell.HasSelection() && SelectionType::Frame == rShell.GetSelectionType());
if(bReplaceMode)
{
@@ -445,7 +445,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
aRewriter.AddRule(UndoArg1, SW_RESSTR(STR_GRAPHIC_DEFNAME));
// #i123922# determine if we really want to insert or replace the graphic at a selected object
const bool bReplaceMode(rSh.HasSelection() && nsSelectionType::SEL_FRM == rSh.GetSelectionType());
const bool bReplaceMode(rSh.HasSelection() && SelectionType::Frame == rSh.GetSelectionType());
rSh.StartUndo(SwUndoId::INSERT, &aRewriter);
@@ -1180,7 +1180,7 @@ void SwView::Execute(SfxRequest &rReq)
case SID_ALIGN_ANY_VDEFAULT :
{
sal_uInt16 nAlias = 0;
if( m_nSelectionType & (nsSelectionType::SEL_DRW_TXT|nsSelectionType::SEL_TXT) )
if( m_nSelectionType & (SelectionType::DrawObjectEditMode|SelectionType::Text) )
{
switch( nSlot )
{
diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx
index 203a066..a01e2d8 100644
--- a/sw/source/uibase/uiview/viewdlg2.cxx
+++ b/sw/source/uibase/uiview/viewdlg2.cxx
@@ -115,13 +115,13 @@ void SwView::InsertCaption(const InsCaptionOpt *pOpt)
}
SelectionType eType = rSh.GetSelectionType();
if (eType & nsSelectionType::SEL_OLE)
eType = nsSelectionType::SEL_GRF;
if (eType & SelectionType::Ole)
eType = SelectionType::Graphic;
const SwLabelType eT = (eType & nsSelectionType::SEL_TBL) ? LTYPE_TABLE :
(eType & nsSelectionType::SEL_FRM) ? LTYPE_FLY :
(eType == nsSelectionType::SEL_TXT) ? LTYPE_FLY :
(eType & nsSelectionType::SEL_DRW) ? LTYPE_DRAW :
const SwLabelType eT = (eType & SelectionType::Table) ? LTYPE_TABLE :
(eType & SelectionType::Frame) ? LTYPE_FLY :
(eType == SelectionType::Text) ? LTYPE_FLY :
(eType & SelectionType::DrawObject) ? LTYPE_DRAW :
LTYPE_OBJECT;
SwFieldMgr aMgr(&rSh);
@@ -186,15 +186,15 @@ void SwView::InsertCaption(const InsCaptionOpt *pOpt)
}
// remember category
if (eType & nsSelectionType::SEL_GRF)
if (eType & SelectionType::Graphic)
SetOldGrfCat(rName);
else if( eType & nsSelectionType::SEL_TBL)
else if( eType & SelectionType::Table)
SetOldTabCat(rName);
else if( eType & nsSelectionType::SEL_FRM)
else if( eType & SelectionType::Frame)
SetOldFrameCat(rName);
else if( eType == nsSelectionType::SEL_TXT)
else if( eType == SelectionType::Text)
SetOldFrameCat(rName);
else if( eType & nsSelectionType::SEL_DRW)
else if( eType & SelectionType::DrawObject)
SetOldDrwCat(rName);
}
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index c2ad204..a55d4ee 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -435,7 +435,7 @@ void SwView::HyphenateDocument()
return;
}
if (m_pWrtShell->GetSelectionType() & (nsSelectionType::SEL_DRW_TXT|nsSelectionType::SEL_DRW))
if (m_pWrtShell->GetSelectionType() & (SelectionType::DrawObjectEditMode|SelectionType::DrawObject))
{
// Hyphenation in a Draw object
HyphenateDrawText();
@@ -633,7 +633,7 @@ bool SwView::ExecSpellPopup(const Point& rPt)
if( pVOpt->IsOnlineSpell() &&
!m_pWrtShell->IsSelection())
{
if (m_pWrtShell->GetSelectionType() & nsSelectionType::SEL_DRW_TXT)
if (m_pWrtShell->GetSelectionType() & SelectionType::DrawObjectEditMode)
bRet = ExecDrwTextSpellPopup(rPt);
else if (!m_pWrtShell->IsSelFrameMode())
{
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 7046838..f670bf8 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -106,9 +106,9 @@ void SwView::GetState(SfxItemSet &rSet)
eFrameType = m_pWrtShell->GetFrameType(nullptr, true);
bGetFrameType = true;
}
if (! ( ((eFrameType & FrameTypeFlags::FLY_ANY) && m_nSelectionType != nsSelectionType::SEL_DRW_TXT)||
m_nSelectionType & nsSelectionType::SEL_TBL ||
m_nSelectionType & nsSelectionType::SEL_DRW) )
if (! ( ((eFrameType & FrameTypeFlags::FLY_ANY) && m_nSelectionType != SelectionType::DrawObjectEditMode)||
m_nSelectionType & SelectionType::Table ||
m_nSelectionType & SelectionType::DrawObject) )
{
rSet.DisableItem(nWhich);
}
@@ -428,7 +428,7 @@ void SwView::GetState(SfxItemSet &rSet)
if( !m_pShell )
SelectShell();
sal_uInt16 nAlias = 0;
if( m_nSelectionType & (nsSelectionType::SEL_DRW_TXT|nsSelectionType::SEL_TXT) )
if( m_nSelectionType & (SelectionType::DrawObjectEditMode|SelectionType::Text) )
{
switch( nWhich )
{
@@ -459,7 +459,7 @@ void SwView::GetState(SfxItemSet &rSet)
GetViewFrame()->GetDispatcher()->QueryState( nAlias, pState );
if(pState)
{
if (!(m_nSelectionType & nsSelectionType::SEL_DRW))
if (!(m_nSelectionType & SelectionType::DrawObject))
{
std::unique_ptr<SfxPoolItem> pNewItem(pState->CloneSetWhich(nWhich));
rSet.Put(*pNewItem);
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index f9ce09b..c5ed234 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1408,9 +1408,9 @@ void SwView::StateTabWin(SfxItemSet& rSet)
if ( dynamic_cast< const SwWebView *>( this ) != nullptr ||
IsTabColFromDoc() ||
IsTabRowFromDoc() ||
( nSelType & nsSelectionType::SEL_GRF ) ||
( nSelType & nsSelectionType::SEL_FRM ) ||
( nSelType & nsSelectionType::SEL_OLE ) ||
( nSelType & SelectionType::Graphic ) ||
( nSelType & SelectionType::Frame ) ||
( nSelType & SelectionType::Ole ) ||
( SfxItemState::DEFAULT > aCoreSet.GetItemState(RES_LR_SPACE) ) ||
(!bVerticalWriting && (SID_ATTR_TABSTOP_VERTICAL == nWhich) ) ||
( bVerticalWriting && (RES_PARATR_TABSTOP == nWhich))
@@ -1449,9 +1449,9 @@ void SwView::StateTabWin(SfxItemSet& rSet)
case SID_ATTR_PARA_RIGHTSPACE:
case SID_ATTR_PARA_FIRSTLINESPACE:
{
if ( nSelType & nsSelectionType::SEL_GRF ||
nSelType & nsSelectionType::SEL_FRM ||
nSelType & nsSelectionType::SEL_OLE ||
if ( nSelType & SelectionType::Graphic ||
nSelType & SelectionType::Frame ||
nSelType & SelectionType::Ole ||
nFrameType == FrameTypeFlags::DRAWOBJ ||
(!bVerticalWriting && (SID_ATTR_PARA_LRSPACE_VERTICAL == nWhich)) ||
( bVerticalWriting && (SID_ATTR_PARA_LRSPACE == nWhich))
@@ -1524,9 +1524,9 @@ void SwView::StateTabWin(SfxItemSet& rSet)
{
m_nLeftBorderDistance = 0;
m_nRightBorderDistance = 0;
if ( nSelType & nsSelectionType::SEL_GRF ||
nSelType & nsSelectionType::SEL_FRM ||
nSelType & nsSelectionType::SEL_OLE ||
if ( nSelType & SelectionType::Graphic ||
nSelType & SelectionType::Frame ||
nSelType & SelectionType::Ole ||
nFrameType == FrameTypeFlags::DRAWOBJ )
rSet.DisableItem(SID_RULER_BORDER_DISTANCE);
else
@@ -1632,9 +1632,9 @@ void SwView::StateTabWin(SfxItemSet& rSet)
case SID_RULER_TEXT_RIGHT_TO_LEFT:
{
if ( nSelType & nsSelectionType::SEL_GRF ||
nSelType & nsSelectionType::SEL_FRM ||
nSelType & nsSelectionType::SEL_OLE ||
if ( nSelType & SelectionType::Graphic ||
nSelType & SelectionType::Frame ||
nSelType & SelectionType::Ole ||
nFrameType == FrameTypeFlags::DRAWOBJ)
rSet.DisableItem(nWhich);
else
diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx
index 336af0c..ef383b9 100644
--- a/sw/source/uibase/uno/unotxvw.cxx
+++ b/sw/source/uibase/uno/unotxvw.cxx
@@ -860,9 +860,9 @@ bool SwXTextViewCursor::IsTextSelection( bool bAllowTables ) const
//! m_pView->GetShellMode() will only work after the shell
//! has already changed and thus can not be used here!
SelectionType eSelType = m_pView->GetWrtShell().GetSelectionType();
bRes = ( (nsSelectionType::SEL_TXT & eSelType) ||
(nsSelectionType::SEL_NUM & eSelType) ) &&
(!(nsSelectionType::SEL_TBL_CELLS & eSelType) || bAllowTables);
bRes = ( (SelectionType::Text & eSelType) ||
(SelectionType::NumberList & eSelType) ) &&
(!(SelectionType::TableCell & eSelType) || bAllowTables);
}
return bRes;
}
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 09b5841..887b75e 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -112,7 +112,7 @@ void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh)
// Always show the distance field
aBoxInfo.SetDist (true);
// Set minimal size in tables and paragraphs
aBoxInfo.SetMinDist (rSh.IsTableMode() || rSh.GetSelectionType() & (nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL));
aBoxInfo.SetMinDist (rSh.IsTableMode() || rSh.GetSelectionType() & (SelectionType::Text | SelectionType::Table));
// Set always the default distance
aBoxInfo.SetDefDist (MIN_BORDER_DIST);
// Single lines can have only in tables DontCare-Status
diff --git a/sw/source/uibase/web/wview.cxx b/sw/source/uibase/web/wview.cxx
index 40dfde6..51e20e6 100644
--- a/sw/source/uibase/web/wview.cxx
+++ b/sw/source/uibase/web/wview.cxx
@@ -105,15 +105,15 @@ void SwWebView::SelectShell()
}
SetLastTableFrameFormat(pCurTableFormat);
//SEL_TBL and SEL_TBL_CELLS can be ored!
int nNewSelectionType = (GetWrtShell().GetSelectionType()
& ~nsSelectionType::SEL_TBL_CELLS);
SelectionType nNewSelectionType = (GetWrtShell().GetSelectionType()
& ~SelectionType::TableCell);
int _nSelectionType = GetSelectionType();
SelectionType _nSelectionType = GetSelectionType();
if ( nNewSelectionType == _nSelectionType )
{
GetViewFrame()->GetBindings().InvalidateAll( false );
if ( _nSelectionType & nsSelectionType::SEL_OLE ||
_nSelectionType & nsSelectionType::SEL_GRF )
if ( _nSelectionType & SelectionType::Ole ||
_nSelectionType & SelectionType::Graphic )
//The verb may of course change for graphics and OLE!
ImpSetVerb( nNewSelectionType );
}
@@ -161,32 +161,32 @@ void SwWebView::SelectShell()
SetSelectionType( _nSelectionType );
ShellMode eShellMode;
if ( _nSelectionType & nsSelectionType::SEL_OLE )
if ( _nSelectionType & SelectionType::Ole )
{
eShellMode = ShellMode::Object;
SetShell( new SwWebOleShell( *this ));
rDispatcher.Push( *GetCurShell() );
}
else if ( _nSelectionType & nsSelectionType::SEL_FRM
|| _nSelectionType & nsSelectionType::SEL_GRF)
else if ( _nSelectionType & SelectionType::Frame
|| _nSelectionType & SelectionType::Graphic)
{
eShellMode = ShellMode::Frame;
SetShell( new SwWebFrameShell( *this ));
rDispatcher.Push( *GetCurShell() );
if(_nSelectionType & nsSelectionType::SEL_GRF )
if(_nSelectionType & SelectionType::Graphic )
{
eShellMode = ShellMode::Graphic;
SetShell( new SwWebGrfShell( *this ));
rDispatcher.Push( *GetCurShell() );
}
}
else if ( _nSelectionType & nsSelectionType::SEL_FRM )
else if ( _nSelectionType & SelectionType::Frame )
{
eShellMode = ShellMode::Frame;
SetShell( new SwWebFrameShell( *this ));
rDispatcher.Push( *GetCurShell() );
}
else if ( _nSelectionType & nsSelectionType::SEL_DRW )
else if ( _nSelectionType & SelectionType::DrawObject )
{
eShellMode = ShellMode::Draw;
SetShell( new svx::ExtrusionBar( this ) );
@@ -197,7 +197,7 @@ void SwWebView::SelectShell()
SetShell( new SwDrawShell( *this ));
rDispatcher.Push( *GetCurShell() );
if ( _nSelectionType & nsSelectionType::SEL_BEZ )
if ( _nSelectionType & SelectionType::Ornament )
{
eShellMode = ShellMode::Bezier;
SetShell( new SwBezierShell( *this ));
@@ -205,21 +205,21 @@ void SwWebView::SelectShell()
}
}
else if ( _nSelectionType & nsSelectionType::SEL_DRW_FORM )
else if ( _nSelectionType & SelectionType::DbForm )
{
eShellMode = ShellMode::DrawForm;
SetShell( new SwWebDrawFormShell( *this ));
rDispatcher.Push( *GetCurShell() );
}
else if ( _nSelectionType & nsSelectionType::SEL_DRW_TXT )
else if ( _nSelectionType & SelectionType::DrawObjectEditMode )
{
eShellMode = ShellMode::DrawText;
rDispatcher.Push( *(new SwBaseShell( *this )) );
SetShell( new SwDrawTextShell( *this ));
rDispatcher.Push( *GetCurShell() );
}
else if ( _nSelectionType & nsSelectionType::SEL_POSTIT )
else if ( _nSelectionType & SelectionType::PostIt )
{
eShellMode = ShellMode::PostIt;
SetShell( new SwAnnotationShell( *this ) );
@@ -229,7 +229,7 @@ void SwWebView::SelectShell()
{
bSetExtInpCntxt = true;
eShellMode = ShellMode::Text;
if ( _nSelectionType & nsSelectionType::SEL_NUM )
if ( _nSelectionType & SelectionType::NumberList )
{
eShellMode = ShellMode::ListText;
SetShell( new SwWebListShell( *this ));
@@ -237,7 +237,7 @@ void SwWebView::SelectShell()
}
SetShell( new SwWebTextShell(*this));
rDispatcher.Push( *GetCurShell() );
if ( _nSelectionType & nsSelectionType::SEL_TBL )
if ( _nSelectionType & SelectionType::Table )
{
eShellMode = eShellMode == ShellMode::ListText ? ShellMode::TableListText
: ShellMode::TableText;
diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx
index e4833ae..6e020bb 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -118,8 +118,8 @@ void SwWrtShell::DelToEndOfLine()
long SwWrtShell::DelLeft()
{
// If it's a Fly, throw it away
int nSelType = GetSelectionType();
const int nCmp = nsSelectionType::SEL_FRM | nsSelectionType::SEL_GRF | nsSelectionType::SEL_OLE | nsSelectionType::SEL_DRW;
SelectionType nSelType = GetSelectionType();
const SelectionType nCmp = SelectionType::Frame | SelectionType::Graphic | SelectionType::Ole | SelectionType::DrawObject;
if( nCmp & nSelType )
{
// #108205# Remember object's position.
@@ -233,22 +233,22 @@ long SwWrtShell::DelLeft()
long SwWrtShell::DelRight()
{
// Will be or'ed, if a tableselection exists;
// will here be implemented on nsSelectionType::SEL_TBL
// will here be implemented on SelectionType::Table
long nRet = 0;
int nSelection = GetSelectionType();
if(nSelection & nsSelectionType::SEL_TBL_CELLS)
nSelection = nsSelectionType::SEL_TBL;
if(nSelection & nsSelectionType::SEL_TXT)
nSelection = nsSelectionType::SEL_TXT;
SelectionType nSelection = GetSelectionType();
if(nSelection & SelectionType::TableCell)
nSelection = SelectionType::Table;
if(nSelection & SelectionType::Text)
nSelection = SelectionType::Text;
const SwTableNode * pWasInTableNd = nullptr;
switch( nSelection & ~(nsSelectionType::SEL_BEZ) )
switch( nSelection & ~(SelectionType::Ornament) )
{
case nsSelectionType::SEL_POSTIT:
case nsSelectionType::SEL_TXT:
case nsSelectionType::SEL_TBL:
case nsSelectionType::SEL_NUM:
case SelectionType::PostIt:
case SelectionType::Text:
case SelectionType::Table:
case SelectionType::NumberList:
// If a selection exists, erase it.
if( IsSelection() )
{
@@ -279,7 +279,7 @@ long SwWrtShell::DelRight()
pWasInTableNd = IsCursorInTable();
if( nsSelectionType::SEL_TXT & nSelection && SwCursorShell::IsSttPara() &&
if( SelectionType::Text & nSelection && SwCursorShell::IsSttPara() &&
SwCursorShell::IsEndPara() )
{
// save cursor
@@ -357,12 +357,12 @@ long SwWrtShell::DelRight()
CloseMark( 0 != nRet );
break;
case nsSelectionType::SEL_FRM:
case nsSelectionType::SEL_GRF:
case nsSelectionType::SEL_OLE:
case nsSelectionType::SEL_DRW:
case nsSelectionType::SEL_DRW_TXT:
case nsSelectionType::SEL_DRW_FORM:
case SelectionType::Frame:
case SelectionType::Graphic:
case SelectionType::Ole:
case SelectionType::DrawObject:
case SelectionType::DrawObjectEditMode:
case SelectionType::DbForm:
{
// #108205# Remember object's position.
Point aTmpPt = GetObjRect().TopLeft();
@@ -393,10 +393,10 @@ long SwWrtShell::DelRight()
// <IsFrameSelected()> can't be true - see above.
{
nSelection = GetSelectionType();
if ( nsSelectionType::SEL_FRM & nSelection ||
nsSelectionType::SEL_GRF & nSelection ||
nsSelectionType::SEL_OLE & nSelection ||
nsSelectionType::SEL_DRW & nSelection )
if ( SelectionType::Frame & nSelection ||
SelectionType::Graphic & nSelection ||
SelectionType::Ole & nSelection ||
SelectionType::DrawObject & nSelection )
{
EnterSelFrameMode();
GotoNextFly();
@@ -404,6 +404,7 @@ long SwWrtShell::DelRight()
}
nRet = 1;
break;
default: break;
}
return nRet;
}
diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx
index 3454216..fee4245 100644
--- a/sw/source/uibase/wrtsh/select.cxx
+++ b/sw/source/uibase/wrtsh/select.cxx
@@ -844,12 +844,12 @@ void SwWrtShell::SelectTableCell()
// surrounding spaces are cut out.
// Return: Delivers the type of the word selection.
int SwWrtShell::IntelligentCut(int nSelection, bool bCut)
int SwWrtShell::IntelligentCut(SelectionType nSelection, bool bCut)
{
// On multiple selection no intelligent drag and drop
// there are multiple cursors, since a second was placed
// already at the target position.
if( IsAddMode() || !(nSelection & nsSelectionType::SEL_TXT) )
if( IsAddMode() || !(nSelection & SelectionType::Text) )
return NO_WORD;
OUString sText;
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index a03b62b..9e7e600 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1358,63 +1358,63 @@ SelectionType SwWrtShell::GetSelectionType() const
// The value does not matter, it may be updated in endaction anyway.
if ( BasicActionPend() )
return IsSelFrameMode() ? nsSelectionType::SEL_FRM : nsSelectionType::SEL_TXT;
return IsSelFrameMode() ? SelectionType::Frame : SelectionType::Text;
SwView &_rView = const_cast<SwView&>(GetView());
if (_rView.GetPostItMgr() && _rView.GetPostItMgr()->HasActiveSidebarWin() )
return nsSelectionType::SEL_POSTIT;
return SelectionType::PostIt;
// Inserting a frame is not a DrawMode
int nCnt;
SelectionType nCnt;
if ( !_rView.GetEditWin().IsFrameAction() &&
(IsObjSelected() || (_rView.IsDrawMode() && !IsFrameSelected()) ))
{
if (GetDrawView()->IsTextEdit())
nCnt = nsSelectionType::SEL_DRW_TXT;
nCnt = SelectionType::DrawObjectEditMode;
else
{
if (GetView().IsFormMode()) // Only Form selected
nCnt = nsSelectionType::SEL_DRW_FORM;
nCnt = SelectionType::DbForm;
else
nCnt = nsSelectionType::SEL_DRW; // Any draw object
nCnt = SelectionType::DrawObject; // Any draw object
if (_rView.IsBezierEditMode())
nCnt |= nsSelectionType::SEL_BEZ;
nCnt |= SelectionType::Ornament;
else if( GetDrawView()->GetContext() == SdrViewContext::Media )
nCnt |= nsSelectionType::SEL_MEDIA;
nCnt |= SelectionType::Media;
if (svx::checkForSelectedCustomShapes(
const_cast<SdrView *>(GetDrawView()),
true /* bOnlyExtruded */ ))
{
nCnt |= nsSelectionType::SEL_EXTRUDED_CUSTOMSHAPE;
nCnt |= SelectionType::ExtrudedCustomShape;
}
sal_uInt32 nCheckStatus = 0;
if (svx::checkForSelectedFontWork(
const_cast<SdrView *>(GetDrawView()), nCheckStatus ))
{
nCnt |= nsSelectionType::SEL_FONTWORK;
nCnt |= SelectionType::FontWork;
}
}
return nCnt;
}
nCnt = GetCntType();
nCnt = static_cast<SelectionType>(GetCntType());
if ( IsFrameSelected() )
{
if (_rView.IsDrawMode())
_rView.LeaveDrawCreate(); // clean up (Bug #45639)
if ( !(nCnt & (CNT_GRF | CNT_OLE)) )
return nsSelectionType::SEL_FRM;
if ( !(nCnt & (SelectionType::Graphic | SelectionType::Ole)) )
return SelectionType::Frame;
}
if ( IsCursorInTable() )
nCnt |= nsSelectionType::SEL_TBL;
nCnt |= SelectionType::Table;
if ( IsTableMode() )
nCnt |= (nsSelectionType::SEL_TBL | nsSelectionType::SEL_TBL_CELLS);
nCnt |= (SelectionType::Table | SelectionType::TableCell);
// Do not pop up numbering toolbar, if the text node has a numbering of type SVX_NUM_NUMBER_NONE.
const SwNumRule* pNumRule = GetNumRuleAtCurrCursorPos();
@@ -1435,7 +1435,7 @@ SelectionType SwWrtShell::GetSelectionType() const
const SwNumFormat& rFormat = pNumRule->Get(nLevel);
if ( SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType() )
nCnt |= nsSelectionType::SEL_NUM;
nCnt |= SelectionType::NumberList;
}
}
@@ -1717,14 +1717,14 @@ OUString SwWrtShell::GetSelDescr() const
{
OUString aResult;
int nSelType = GetSelectionType();
SelectionType nSelType = GetSelectionType();
switch (nSelType)
{
case nsSelectionType::SEL_GRF:
case SelectionType::Graphic:
aResult = SW_RESSTR(STR_GRAPHIC);
break;
case nsSelectionType::SEL_FRM:
case SelectionType::Frame:
{
const SwFrameFormat * pFrameFormat = GetSelectedFrameFormat();
@@ -1732,7 +1732,7 @@ OUString SwWrtShell::GetSelDescr() const
aResult = pFrameFormat->GetDescription();
}
break;
case nsSelectionType::SEL_DRW:
case SelectionType::DrawObject:
{
aResult = SW_RESSTR(STR_DRAWING_OBJECTS);
}