summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docfly.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-02-27 09:19:55 +0200
committerNoel Grandin <noel@peralex.com>2015-03-02 08:59:17 +0200
commitf9ba16e44b2813dd1fc9b0e06994f67c6350f050 (patch)
treec313171846f005e6299c38c47e010bb6daad6e15 /sw/source/core/doc/docfly.cxx
parent019ab2b00fb022383eaa85e6be66d97504587088 (diff)
convert SW_CHAIN_ constants to enum class
Change-Id: If3cd86cbb0b01f975456b93b05232e18ec742828
Diffstat (limited to 'sw/source/core/doc/docfly.cxx')
-rw-r--r--sw/source/core/doc/docfly.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 0e39cfb64537..701dea332412 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -929,45 +929,45 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
return bUnmark;
}
-int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
+SwChainRet SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
// The Source must not yet have a Follow.
const SwFmtChain &rOldChain = rSource.GetChain();
if ( rOldChain.GetNext() )
- return SW_CHAIN_SOURCE_CHAINED;
+ return SwChainRet::SOURCE_CHAINED;
// Target must not be equal to Source and we also must not have a closed chain.
const SwFrmFmt *pFmt = &rDest;
do {
if( pFmt == &rSource )
- return SW_CHAIN_SELF;
+ return SwChainRet::SELF;
pFmt = pFmt->GetChain().GetNext();
} while ( pFmt );
// There must not be a chaining from outside to inside or the other way around.
if( rDest.IsLowerOf( rSource ) || rSource .IsLowerOf( rDest ) )
- return SW_CHAIN_SELF;
+ return SwChainRet::SELF;
// The Target must not yet have a Master.
const SwFmtChain &rChain = rDest.GetChain();
if( rChain.GetPrev() )
- return SW_CHAIN_IS_IN_CHAIN;
+ return SwChainRet::IS_IN_CHAIN;
// Target must be empty.
const SwNodeIndex* pCntIdx = rDest.GetCntnt().GetCntntIdx();
if( !pCntIdx )
- return SW_CHAIN_NOT_FOUND;
+ return SwChainRet::NOT_FOUND;
SwNodeIndex aNxtIdx( *pCntIdx, 1 );
const SwTxtNode* pTxtNd = aNxtIdx.GetNode().GetTxtNode();
if( !pTxtNd )
- return SW_CHAIN_NOT_FOUND;
+ return SwChainRet::NOT_FOUND;
const sal_uLong nFlySttNd = pCntIdx->GetIndex();
if( 2 != ( pCntIdx->GetNode().EndOfSectionIndex() - nFlySttNd ) ||
pTxtNd->GetTxt().getLength() )
{
- return SW_CHAIN_NOT_EMPTY;
+ return SwChainRet::NOT_EMPTY;
}
for( auto pSpzFrmFm : *GetSpzFrmFmts() )
@@ -982,7 +982,7 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
rAnchor.GetCntntAnchor()->nNode.GetIndex() ) &&
nTstSttNd < nFlySttNd + 2 )
{
- return SW_CHAIN_NOT_EMPTY;
+ return SwChainRet::NOT_EMPTY;
}
}
@@ -1023,13 +1023,13 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest )
bAllowed = true;
}
- return bAllowed ? SW_CHAIN_OK : SW_CHAIN_WRONG_AREA;
+ return bAllowed ? SwChainRet::OK : SwChainRet::WRONG_AREA;
}
-int SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
+SwChainRet SwDoc::Chain( SwFrmFmt &rSource, const SwFrmFmt &rDest )
{
- int nErr = Chainable( rSource, rDest );
- if ( !nErr )
+ SwChainRet nErr = Chainable( rSource, rDest );
+ if ( nErr == SwChainRet::OK )
{
GetIDocumentUndoRedo().StartUndo( UNDO_CHAINE, NULL );