diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-19 10:37:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-19 12:47:14 +0200 |
commit | 99e95346ac33f2d04536ab6c268936ab8b822b42 (patch) | |
tree | c72423b6708122c223e4c52394a550cc2180a7df | |
parent | 9049c94b32f00b8239cd2b50e5ac29dabf41cb61 (diff) |
convert CopyOrNewType to scoped enum
Change-Id: I4bc01dfbf3305e7eaa0887444e894d14e9e4d092
-rw-r--r-- | sw/inc/ndhints.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 8 |
3 files changed, 7 insertions, 10 deletions
diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx index 5d5c57fdcd81..6643a6a920c3 100644 --- a/sw/inc/ndhints.hxx +++ b/sw/inc/ndhints.hxx @@ -33,10 +33,7 @@ class SfxPoolItem; class SfxItemSet; class SwDoc; -typedef enum { - COPY = int(true), - NEW = int(false), -} CopyOrNew_t; +enum class CopyOrNewType { Copy, New }; /// if COPY then pTextNode must be given! SwTextAttr * MakeTextAttr( @@ -44,7 +41,7 @@ SwTextAttr * MakeTextAttr( SfxPoolItem & rNew, sal_Int32 const nStt, sal_Int32 const nEnd, - CopyOrNew_t const bIsCopy = NEW, + CopyOrNewType const bIsCopy = CopyOrNewType::New, SwTextNode *const pTextNode = nullptr ); SwTextAttr * MakeTextAttr( diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index d01a00668357..19aec8d817aa 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1839,7 +1839,7 @@ void SwTextNode::CopyText( SwTextNode *const pDest, { // copy the hint here, but insert it later pNewHt = MakeTextAttr( *GetDoc(), pHt->GetAttr(), - nAttrStt, nAttrEnd, COPY, pDest ); + nAttrStt, nAttrEnd, CopyOrNewType::Copy, pDest ); lcl_CopyHint(nWhich, pHt, pNewHt, nullptr, pDest); aArr.push_back( pNewHt ); diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 8afc3baf4962..d51b84d75cfb 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -985,7 +985,7 @@ SwTextAttr* MakeTextAttr( SfxPoolItem& rAttr, sal_Int32 const nStt, sal_Int32 const nEnd, - CopyOrNew_t const bIsCopy, + CopyOrNewType const bIsCopy, SwTextNode *const pTextNode ) { if ( isCHRATR(rAttr.Which()) ) @@ -1042,7 +1042,7 @@ SwTextAttr* MakeTextAttr( case RES_TXTATR_ANNOTATION: { pNew = new SwTextAnnotationField( static_cast<SwFormatField &>(rNew), nStt, rDoc.IsClipBoard() ); - if (bIsCopy == COPY) + if (bIsCopy == CopyOrNewType::Copy) { // On copy of the annotation field do not keep the annotated text range by removing // the relation to its annotation mark (relation established via annotation field's name). @@ -1090,7 +1090,7 @@ SwTextAttr* MakeTextAttr( case RES_TXTATR_META: case RES_TXTATR_METAFIELD: pNew = SwTextMeta::CreateTextMeta( rDoc.GetMetaFieldManager(), pTextNode, - static_cast<SwFormatMeta&>(rNew), nStt, nEnd, bIsCopy == COPY ); + static_cast<SwFormatMeta&>(rNew), nStt, nEnd, bIsCopy == CopyOrNewType::Copy ); break; default: assert(RES_TXTATR_AUTOFMT == rNew.Which()); @@ -1223,7 +1223,7 @@ SwTextAttr* SwTextNode::InsertItem( rAttr, nStart, nEnd, - (nMode & SetAttrMode::IS_COPY) ? COPY : NEW, + (nMode & SetAttrMode::IS_COPY) ? CopyOrNewType::Copy : CopyOrNewType::New, this ); if ( pNew ) |