summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/ndhints.hxx7
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx2
-rw-r--r--sw/source/core/txtnode/thints.cxx8
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 )