summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-05-09 09:05:57 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-09 11:15:16 +0000
commit17076d8ecf77f313b7a93912528f9cb0fd0d3ea8 (patch)
treecb77cae87f0a07e729deb9a66679a4cfec434768 /editeng
parent70d5cd845d4fe218588155cf43bdf854e8fc54f3 (diff)
convert OUTLINER_MODE to scoped enum
Change-Id: I7ac45d7fbd5e77a105cbe942c6d4fd6cfc8ff909 Reviewed-on: https://gerrit.libreoffice.org/24789 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editobj.cxx14
-rw-r--r--editeng/source/editeng/editobj2.hxx7
-rw-r--r--editeng/source/outliner/outliner.cxx26
-rw-r--r--editeng/source/outliner/outlobj.cxx4
-rw-r--r--editeng/source/outliner/outlvw.cxx24
5 files changed, 39 insertions, 36 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 7190147e28e1..06ac06998e75 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -321,12 +321,12 @@ const SfxItemPool* EditTextObject::GetPool() const
return mpImpl->GetPool();
}
-sal_uInt16 EditTextObject::GetUserType() const
+OutlinerMode EditTextObject::GetUserType() const
{
return mpImpl->GetUserType();
}
-void EditTextObject::SetUserType( sal_uInt16 n )
+void EditTextObject::SetUserType( OutlinerMode n )
{
mpImpl->SetUserType(n);
}
@@ -510,7 +510,7 @@ EditTextObjectImpl::EditTextObjectImpl( EditTextObject* pFront, SfxItemPool* pP
{
nVersion = 0;
nMetric = 0xFFFF;
- nUserType = 0;
+ nUserType = OutlinerMode::DontKnow;
nObjSettings = 0;
pPortionInfo = nullptr;
@@ -604,7 +604,7 @@ EditTextObjectImpl::~EditTextObjectImpl()
}
-void EditTextObjectImpl::SetUserType( sal_uInt16 n )
+void EditTextObjectImpl::SetUserType( OutlinerMode n )
{
nUserType = n;
}
@@ -1207,7 +1207,7 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
rOStream.WriteUInt16( nMetric );
- rOStream.WriteUInt16( nUserType );
+ rOStream.WriteUInt16( (sal_uInt16)nUserType );
rOStream.WriteUInt32( nObjSettings );
rOStream.WriteBool( bVertical );
@@ -1454,7 +1454,9 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream )
if ( nVersion >= 600 )
{
- rIStream.ReadUInt16( nUserType );
+ sal_uInt16 nTmp;
+ rIStream.ReadUInt16( nTmp );
+ nUserType = (OutlinerMode)nTmp;
rIStream.ReadUInt32( nObjSettings );
}
diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx
index aeeab195b27a..289427ffceac 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -22,6 +22,7 @@
#include <editeng/editobj.hxx>
#include <editeng/fieldupdater.hxx>
+#include <editeng/outliner.hxx>
#include <editdoc.hxx>
#include <unotools/fontcvt.hxx>
@@ -171,7 +172,7 @@ private:
sal_uInt32 nObjSettings;
sal_uInt16 nMetric;
sal_uInt16 nVersion;
- sal_uInt16 nUserType;
+ OutlinerMode nUserType;
SvtScriptType nScriptType;
bool bOwnerOfPool:1;
@@ -192,8 +193,8 @@ public:
EditTextObjectImpl(const EditTextObjectImpl&) = delete;
EditTextObjectImpl& operator=(const EditTextObjectImpl&) = delete;
- sal_uInt16 GetUserType() const { return nUserType;}
- void SetUserType( sal_uInt16 n );
+ OutlinerMode GetUserType() const { return nUserType;}
+ void SetUserType( OutlinerMode n );
void NormalizeString( svl::SharedStringPool& rPool );
std::vector<svl::SharedString> GetSharedStrings() const;
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 12ae4165f32f..906367c796e1 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -193,7 +193,7 @@ void Outliner::ParagraphDeleted( sal_Int32 nPara )
}
}
-void Outliner::Init( sal_uInt16 nMode )
+void Outliner::Init( OutlinerMode nMode )
{
nOutlinerMode = nMode;
@@ -206,14 +206,14 @@ void Outliner::Init( sal_uInt16 nMode )
switch ( ImplGetOutlinerMode() )
{
- case OUTLINERMODE_TEXTOBJECT:
- case OUTLINERMODE_TITLEOBJECT:
+ case OutlinerMode::TextObject:
+ case OutlinerMode::TitleObject:
break;
- case OUTLINERMODE_OUTLINEOBJECT:
+ case OutlinerMode::OutlineObject:
nCtrl |= EEControlBits::OUTLINER2;
break;
- case OUTLINERMODE_OUTLINEVIEW:
+ case OutlinerMode::OutlineView:
nCtrl |= EEControlBits::OUTLINER;
break;
@@ -259,7 +259,7 @@ void Outliner::SetDepth( Paragraph* pPara, sal_Int16 nNewDepth )
ImplInitDepth( nPara, nNewDepth, true );
ImplCalcBulletText( nPara, false, false );
- if ( ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT )
+ if ( ImplGetOutlinerMode() == OutlinerMode::OutlineObject )
ImplSetLevelDependendStyleSheet( nPara );
DepthChangedHdl();
@@ -385,7 +385,7 @@ OutlinerParaObject* Outliner::CreateParaObject( sal_Int32 nStartPara, sal_Int32
return nullptr;
EditTextObject* pText = pEditEngine->CreateTextObject( nStartPara, nCount );
- const bool bIsEditDoc(OUTLINERMODE_TEXTOBJECT == ImplGetOutlinerMode());
+ const bool bIsEditDoc(OutlinerMode::TextObject == ImplGetOutlinerMode());
ParagraphDataVector aParagraphDataVector(nCount);
const sal_Int32 nLastPara(nStartPara + nCount - 1);
@@ -448,8 +448,8 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara )
// In the outliner mode, filter the tabs and set the indentation
// about a LRSpaceItem. In EditEngine mode intend over old tabs
- if( ( ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT ) ||
- ( ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEVIEW ) )
+ if( ( ImplGetOutlinerMode() == OutlinerMode::OutlineObject ) ||
+ ( ImplGetOutlinerMode() == OutlinerMode::OutlineView ) )
{
// Extract Tabs
sal_uInt16 nTabs = 0;
@@ -693,7 +693,7 @@ void Outliner::ImplCheckNumBulletItem( sal_Int32 nPara )
void Outliner::ImplSetLevelDependendStyleSheet( sal_Int32 nPara )
{
- DBG_ASSERT( ( ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT ) || ( ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEVIEW ), "SetLevelDependendStyleSheet: Wrong Mode!" );
+ DBG_ASSERT( ( ImplGetOutlinerMode() == OutlinerMode::OutlineObject ) || ( ImplGetOutlinerMode() == OutlinerMode::OutlineView ), "SetLevelDependendStyleSheet: Wrong Mode!" );
SfxStyleSheet* pStyle = GetStyleSheet( nPara );
@@ -1181,7 +1181,7 @@ void Outliner::ImpTextPasted( sal_Int32 nStartPara, sal_Int32 nCount )
while( nCount && pPara )
{
- if( ImplGetOutlinerMode() != OUTLINERMODE_TEXTOBJECT )
+ if( ImplGetOutlinerMode() != OutlinerMode::TextObject )
{
nDepthChangedHdlPrevDepth = pPara->GetDepth();
mnDepthChangeHdlPrevFlags = pPara->nFlags;
@@ -1234,7 +1234,7 @@ bool Outliner::ImpCanIndentSelectedPages( OutlinerView* pCurView )
// If the first paragraph is on level 0 it can not indented in any case,
// possible there might be indentations in the following on the 0 level.
- if ( ( mnFirstSelPage == 0 ) && ( ImplGetOutlinerMode() != OUTLINERMODE_TEXTOBJECT ) )
+ if ( ( mnFirstSelPage == 0 ) && ( ImplGetOutlinerMode() != OutlinerMode::TextObject ) )
{
if ( nDepthChangedHdlPrevDepth == 1 ) // is the only page
return false;
@@ -1252,7 +1252,7 @@ bool Outliner::ImpCanDeleteSelectedPages( OutlinerView* pCurView )
return RemovingPagesHdl( pCurView );
}
-Outliner::Outliner(SfxItemPool* pPool, sal_uInt16 nMode)
+Outliner::Outliner(SfxItemPool* pPool, OutlinerMode nMode)
: pHdlParagraph(nullptr)
, mnFirstSelPage(0)
, nDepthChangedHdlPrevDepth(0)
diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx
index 9b6512039ec0..9e67af1dee54 100644
--- a/editeng/source/outliner/outlobj.cxx
+++ b/editeng/source/outliner/outlobj.cxx
@@ -110,12 +110,12 @@ bool OutlinerParaObject::isWrongListEqual( const OutlinerParaObject& r ) const
return mpImpl->isWrongListEqual(*r.mpImpl);
}
-sal_uInt16 OutlinerParaObject::GetOutlinerMode() const
+OutlinerMode OutlinerParaObject::GetOutlinerMode() const
{
return mpImpl->mpEditTextObject->GetUserType();
}
-void OutlinerParaObject::SetOutlinerMode(sal_uInt16 nNew)
+void OutlinerParaObject::SetOutlinerMode(OutlinerMode nNew)
{
// create a const pointer to avoid an early call to
// make_unique() in the dereference of mpImpl
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index c4891e228286..5f5a8d1b3df3 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -122,7 +122,7 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, vcl::Window* pFrameWin )
break;
case KeyFuncType::DELETE:
{
- if( !bReadOnly && !bSelection && ( pOwner->ImplGetOutlinerMode() != OUTLINERMODE_TEXTOBJECT ) )
+ if( !bReadOnly && !bSelection && ( pOwner->ImplGetOutlinerMode() != OutlinerMode::TextObject ) )
{
if( aSel.nEndPos == pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) )
{
@@ -148,14 +148,14 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, vcl::Window* pFrameWin )
{
if ( !bReadOnly && !aKeyCode.IsMod1() && !aKeyCode.IsMod2() )
{
- if ( ( pOwner->ImplGetOutlinerMode() != OUTLINERMODE_TEXTOBJECT ) &&
- ( pOwner->ImplGetOutlinerMode() != OUTLINERMODE_TITLEOBJECT ) &&
+ if ( ( pOwner->ImplGetOutlinerMode() != OutlinerMode::TextObject ) &&
+ ( pOwner->ImplGetOutlinerMode() != OutlinerMode::TitleObject ) &&
( bSelection || !aSel.nStartPos ) )
{
Indent( aKeyCode.IsShift() ? (-1) : (+1) );
bKeyProcessed = true;
}
- else if ( ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_TEXTOBJECT ) &&
+ else if ( ( pOwner->ImplGetOutlinerMode() == OutlinerMode::TextObject ) &&
!bSelection && !aSel.nEndPos && pOwner->ImplHasNumberFormat( aSel.nEndPara ) )
{
Indent( aKeyCode.IsShift() ? (-1) : (+1) );
@@ -285,7 +285,7 @@ sal_Int32 OutlinerView::ImpCheckMousePos(const Point& rPosPix, MouseTarget& reTa
bool OutlinerView::MouseMove( const MouseEvent& rMEvt )
{
- if( ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_TEXTOBJECT ) || pEditView->GetEditEngine()->IsInSelectionMode())
+ if( ( pOwner->ImplGetOutlinerMode() == OutlinerMode::TextObject ) || pEditView->GetEditEngine()->IsInSelectionMode())
return pEditView->MouseMove( rMEvt );
Point aMousePosWin( pEditView->GetWindow()->PixelToLogic( rMEvt.GetPosPixel() ) );
@@ -300,7 +300,7 @@ bool OutlinerView::MouseMove( const MouseEvent& rMEvt )
bool OutlinerView::MouseButtonDown( const MouseEvent& rMEvt )
{
- if ( ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_TEXTOBJECT ) || pEditView->GetEditEngine()->IsInSelectionMode() )
+ if ( ( pOwner->ImplGetOutlinerMode() == OutlinerMode::TextObject ) || pEditView->GetEditEngine()->IsInSelectionMode() )
return pEditView->MouseButtonDown( rMEvt );
Point aMousePosWin( pEditView->GetWindow()->PixelToLogic( rMEvt.GetPosPixel() ) );
@@ -332,7 +332,7 @@ bool OutlinerView::MouseButtonDown( const MouseEvent& rMEvt )
}
// special case for outliner view in impress, check if double click hits the page icon for toggle
- if( (nPara == EE_PARA_NOT_FOUND) && (pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEVIEW) && (eTarget == MouseTarget::Text) && (rMEvt.GetClicks() == 2) )
+ if( (nPara == EE_PARA_NOT_FOUND) && (pOwner->ImplGetOutlinerMode() == OutlinerMode::OutlineView) && (eTarget == MouseTarget::Text) && (rMEvt.GetClicks() == 2) )
{
ESelection aSel( pEditView->GetSelection() );
nPara = aSel.nStartPara;
@@ -348,7 +348,7 @@ bool OutlinerView::MouseButtonDown( const MouseEvent& rMEvt )
bool OutlinerView::MouseButtonUp( const MouseEvent& rMEvt )
{
- if ( ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_TEXTOBJECT ) || pEditView->GetEditEngine()->IsInSelectionMode() )
+ if ( ( pOwner->ImplGetOutlinerMode() == OutlinerMode::TextObject ) || pEditView->GetEditEngine()->IsInSelectionMode() )
return pEditView->MouseButtonUp( rMEvt );
Point aMousePosWin( pEditView->GetWindow()->PixelToLogic( rMEvt.GetPosPixel() ) );
@@ -506,7 +506,7 @@ void OutlinerView::Indent( short nDiff )
if( nOldDepth != nNewDepth )
{
- if ( ( nPara == aSel.nStartPara ) && aSel.nStartPara && ( pOwner->ImplGetOutlinerMode() != OUTLINERMODE_TEXTOBJECT ))
+ if ( ( nPara == aSel.nStartPara ) && aSel.nStartPara && ( pOwner->ImplGetOutlinerMode() != OutlinerMode::TextObject ))
{
// Special case: the predecessor of an indented paragraph is
// invisible and is now on the same level as the visible
@@ -538,7 +538,7 @@ void OutlinerView::Indent( short nDiff )
pOwner->ImplInitDepth( nPara, nNewDepth, true );
pOwner->ImplCalcBulletText( nPara, false, false );
- if ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT )
+ if ( pOwner->ImplGetOutlinerMode() == OutlinerMode::OutlineObject )
pOwner->ImplSetLevelDependendStyleSheet( nPara );
// Notify App
@@ -689,7 +689,7 @@ void OutlinerView::PasteSpecial()
pOwner->bPasting = true;
pEditView->PasteSpecial();
- if ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT )
+ if ( pOwner->ImplGetOutlinerMode() == OutlinerMode::OutlineObject )
{
const sal_Int32 nParaCount = pOwner->pEditEngine->GetParagraphCount();
@@ -1404,7 +1404,7 @@ sal_uLong OutlinerView::Read( SvStream& rInput, const OUString& rBaseURL, EEText
pOwner->ImplInitDepth( n, nDepth, false );
}
- if ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT )
+ if ( pOwner->ImplGetOutlinerMode() == OutlinerMode::OutlineObject )
pOwner->ImplSetLevelDependendStyleSheet( n );
}