Kaydet (Commit) 99e95346 authored tarafından Noel Grandin's avatar Noel Grandin

convert CopyOrNewType to scoped enum

Change-Id: I4bc01dfbf3305e7eaa0887444e894d14e9e4d092
üst 9049c94b
......@@ -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(
......
......@@ -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 );
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment