summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-02-27 11:49:51 +0200
committerNoel Grandin <noel@peralex.com>2015-03-02 08:59:18 +0200
commitd8bb694c831d37cb4344e3352fe08e2919a7cdc1 (patch)
tree21c56aa8c401b7741e0321f7a06e9b45ac3d59e1 /editeng
parente9beb264709a8d4a240bb66f6c1ee95658bab4c2 (diff)
convert PARAFLAG_ constants to enum class
Change-Id: I71f5ea8e91fe0f50a471e33e4e2c02840a76b707
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/outliner/outleeng.cxx4
-rw-r--r--editeng/source/outliner/outliner.cxx20
-rw-r--r--editeng/source/outliner/outlundo.cxx4
-rw-r--r--editeng/source/outliner/outlundo.hxx8
-rw-r--r--editeng/source/outliner/outlvw.cxx12
-rw-r--r--editeng/source/outliner/paralist.cxx4
6 files changed, 26 insertions, 26 deletions
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index 55257542279b..3b1c160b3bae 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -94,9 +94,9 @@ void OutlinerEditEng::ParagraphConnected( sal_Int32 /*nLeftParagraph*/, sal_Int3
if( pOwner && pOwner->IsUndoEnabled() && !const_cast<EditEngine&>(pOwner->GetEditEngine()).IsInUndo() )
{
Paragraph* pPara = pOwner->GetParagraph( nRightParagraph );
- if( pPara && pOwner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) )
+ if( pPara && pOwner->HasParaFlag( pPara, ParaFlag::ISPAGE ) )
{
- pOwner->InsertUndo( new OutlinerUndoChangeParaFlags( pOwner, nRightParagraph, PARAFLAG_ISPAGE, 0 ) );
+ pOwner->InsertUndo( new OutlinerUndoChangeParaFlags( pOwner, nRightParagraph, ParaFlag::ISPAGE, ParaFlag::NONE ) );
}
}
}
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index ba1a901d36de..fe6e6ca84bde 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -92,7 +92,7 @@ Paragraph* Outliner::Insert(const OUString& rText, sal_Int32 nAbsPos, sal_Int16
pHdlParagraph = pPara;
DepthChangedHdl();
}
- pPara->nFlags |= PARAFLAG_HOLDDEPTH;
+ pPara->nFlags |= ParaFlag::HOLDDEPTH;
SetText( rText, pPara );
}
else
@@ -107,7 +107,7 @@ Paragraph* Outliner::Insert(const OUString& rText, sal_Int32 nAbsPos, sal_Int16
ImplInitDepth( nAbsPos, nDepth, false );
pHdlParagraph = pPara;
ParagraphInsertedHdl();
- pPara->nFlags |= PARAFLAG_HOLDDEPTH;
+ pPara->nFlags |= ParaFlag::HOLDDEPTH;
SetText( rText, pPara );
ImplBlockInsertionCallbacks( false );
pEditEngine->SetUpdateMode( bUpdate );
@@ -130,7 +130,7 @@ void Outliner::ParagraphInserted( sal_Int32 nPara )
pParaList->Insert( pPara, nPara );
if( pEditEngine->IsInUndo() )
{
- pPara->nFlags = PARAFLAG_SETBULLETTEXT;
+ pPara->nFlags = ParaFlag::SETBULLETTEXT;
pPara->bVisible = true;
const SfxInt16Item& rLevel = static_cast<const SfxInt16Item&>( pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ) );
pPara->SetDepth( rLevel.GetValue() );
@@ -464,12 +464,12 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara )
aStr = aStr.copy(nTabs);
// Keep depth? (see Outliner::Insert)
- if( !(pPara->nFlags & PARAFLAG_HOLDDEPTH) )
+ if( !(pPara->nFlags & ParaFlag::HOLDDEPTH) )
{
nCurDepth = nTabs-1;
ImplCheckDepth( nCurDepth );
pPara->SetDepth( nCurDepth );
- pPara->nFlags &= (~PARAFLAG_HOLDDEPTH);
+ pPara->nFlags &= (~ParaFlag::HOLDDEPTH);
}
}
if( nPos ) // not with the first paragraph
@@ -700,7 +700,7 @@ void Outliner::SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle )
if (pPara)
{
pEditEngine->SetStyleSheet( nPara, pStyle );
- pPara->nFlags |= PARAFLAG_SETBULLETTEXT;
+ pPara->nFlags |= ParaFlag::SETBULLETTEXT;
ImplCheckNumBulletItem( nPara );
}
}
@@ -1934,7 +1934,7 @@ void Outliner::ImplCalcBulletText( sal_Int32 nPara, bool bRecalcLevel, bool bRec
if (!pPara->GetText().equals(aBulletText))
pPara->SetText( aBulletText );
- pPara->nFlags &= (~PARAFLAG_SETBULLETTEXT);
+ pPara->nFlags &= (~ParaFlag::SETBULLETTEXT);
if ( bRecalcLevel )
{
@@ -1995,7 +1995,7 @@ OUString Outliner::ImplGetBulletText( sal_Int32 nPara )
if (pPara)
{
// Enable optimization again ...
-// if( pPara->nFlags & PARAFLAG_SETBULLETTEXT )
+// if( pPara->nFlags & ParaFlag::SETBULLETTEXT )
ImplCalcBulletText( nPara, false, false );
aRes = pPara->GetText();
}
@@ -2068,7 +2068,7 @@ void Outliner::SetEndPasteOrDropHdl( const Link& rLink )
maEndPasteOrDropHdl = rLink;
}
-void Outliner::SetParaFlag( Paragraph* pPara, sal_uInt16 nFlag )
+void Outliner::SetParaFlag( Paragraph* pPara, ParaFlag nFlag )
{
if( pPara && !pPara->HasFlag( nFlag ) )
{
@@ -2079,7 +2079,7 @@ void Outliner::SetParaFlag( Paragraph* pPara, sal_uInt16 nFlag )
}
}
-bool Outliner::HasParaFlag( const Paragraph* pPara, sal_uInt16 nFlag ) const
+bool Outliner::HasParaFlag( const Paragraph* pPara, ParaFlag nFlag ) const
{
return pPara && pPara->HasFlag( nFlag );
}
diff --git a/editeng/source/outliner/outlundo.cxx b/editeng/source/outliner/outlundo.cxx
index 1803dd03fd09..e07cae282acd 100644
--- a/editeng/source/outliner/outlundo.cxx
+++ b/editeng/source/outliner/outlundo.cxx
@@ -37,7 +37,7 @@ OutlinerUndoBase::OutlinerUndoBase( sal_uInt16 _nId, Outliner* pOutliner )
mpOutliner = pOutliner;
}
-OutlinerUndoChangeParaFlags::OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_Int32 nPara, sal_uInt16 nOldFlags, sal_uInt16 nNewFlags )
+OutlinerUndoChangeParaFlags::OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_Int32 nPara, ParaFlag nOldFlags, ParaFlag nNewFlags )
: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner )
{
mnPara = nPara;
@@ -55,7 +55,7 @@ void OutlinerUndoChangeParaFlags::Redo()
ImplChangeFlags( mnNewFlags );
}
-void OutlinerUndoChangeParaFlags::ImplChangeFlags( sal_uInt16 nFlags )
+void OutlinerUndoChangeParaFlags::ImplChangeFlags( ParaFlag nFlags )
{
Outliner* pOutliner = GetOutliner();
Paragraph* pPara = pOutliner->GetParagraph( mnPara );
diff --git a/editeng/source/outliner/outlundo.hxx b/editeng/source/outliner/outlundo.hxx
index e3b1af51cedc..77b689f56b3c 100644
--- a/editeng/source/outliner/outlundo.hxx
+++ b/editeng/source/outliner/outlundo.hxx
@@ -39,13 +39,13 @@ class OutlinerUndoChangeParaFlags : public OutlinerUndoBase
{
private:
sal_Int32 mnPara;
- sal_uInt16 mnOldFlags;
- sal_uInt16 mnNewFlags;
+ ParaFlag mnOldFlags;
+ ParaFlag mnNewFlags;
- void ImplChangeFlags( sal_uInt16 nFlags );
+ void ImplChangeFlags( ParaFlag nFlags );
public:
- OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_Int32 nPara, sal_uInt16 nOldDepth, sal_uInt16 nNewDepth );
+ OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_Int32 nPara, ParaFlag nOldFlags, ParaFlag nNewFlags );
virtual void Undo() SAL_OVERRIDE;
virtual void Redo() SAL_OVERRIDE;
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index e545e9fe2293..9e61056d019e 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -128,7 +128,7 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, vcl::Window* pFrameWin )
if( aSel.nEndPos == pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) )
{
Paragraph* pNext = pOwner->pParaList->GetParagraph( aSel.nEndPara+1 );
- if( pNext && pNext->HasFlag(PARAFLAG_ISPAGE) )
+ if( pNext && pNext->HasFlag(ParaFlag::ISPAGE) )
{
if( !pOwner->ImpCanDeleteSelectedPages( this, aSel.nEndPara, 1 ) )
return false;
@@ -338,7 +338,7 @@ bool OutlinerView::MouseButtonDown( const MouseEvent& rMEvt )
ESelection aSel( pEditView->GetSelection() );
nPara = aSel.nStartPara;
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
- if( (pPara && pOwner->pParaList->HasChildren(pPara)) && pPara->HasFlag(PARAFLAG_ISPAGE) )
+ if( (pPara && pOwner->pParaList->HasChildren(pPara)) && pPara->HasFlag(ParaFlag::ISPAGE) )
{
ImpToggleExpand( pPara );
}
@@ -469,7 +469,7 @@ void OutlinerView::Indent( short nDiff )
if( bOutlinerView && nPara )
{
- const bool bPage = pPara->HasFlag(PARAFLAG_ISPAGE);
+ const bool bPage = pPara->HasFlag(ParaFlag::ISPAGE);
if( (bPage && (nDiff == +1)) || (!bPage && (nDiff == -1) && (nOldDepth <= 0)) )
{
// Notify App
@@ -478,9 +478,9 @@ void OutlinerView::Indent( short nDiff )
pOwner->pHdlParagraph = pPara;
if( bPage )
- pPara->RemoveFlag( PARAFLAG_ISPAGE );
+ pPara->RemoveFlag( ParaFlag::ISPAGE );
else
- pPara->SetFlag( PARAFLAG_ISPAGE );
+ pPara->SetFlag( ParaFlag::ISPAGE );
pOwner->DepthChangedHdl();
pOwner->pEditEngine->QuickMarkInvalid( ESelection( nPara, 0, nPara, 0 ) );
@@ -806,7 +806,7 @@ sal_Int32 OutlinerView::ImpCalcSelectedPages( bool bIncludeFirstSelected )
{
Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara );
DBG_ASSERT(pPara, "ImpCalcSelectedPages: invalid Selection? ");
- if( pPara->HasFlag(PARAFLAG_ISPAGE) )
+ if( pPara->HasFlag(ParaFlag::ISPAGE) )
{
nPages++;
if( nFirstPage == EE_PARA_MAX_COUNT )
diff --git a/editeng/source/outliner/paralist.cxx b/editeng/source/outliner/paralist.cxx
index e9e64077164c..d4a9e13fe9f7 100644
--- a/editeng/source/outliner/paralist.cxx
+++ b/editeng/source/outliner/paralist.cxx
@@ -62,12 +62,12 @@ Paragraph::Paragraph( sal_Int16 nDDepth )
DBG_ASSERT( ( nDDepth >= -1 ) && ( nDDepth < SVX_MAX_NUM ), "Paragraph-CTOR: nDepth invalid!" );
nDepth = nDDepth;
- nFlags = 0;
+ nFlags = ParaFlag::NONE;
bVisible = true;
}
Paragraph::Paragraph( const ParagraphData& rData )
-: nFlags( 0 )
+: nFlags( ParaFlag::NONE )
, aBulSize( -1, -1)
, bVisible( true )
{