summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-06 11:12:14 +0200
committerNoel Grandin <noel@peralex.com>2015-03-11 10:16:53 +0200
commit5eea85ec4fa7c458785be749a0e370a0883ff693 (patch)
tree8e9c5055d2ebfa1586b8106dc4f0a4d69f0d4021 /sw/inc
parent68c87b46fd26291463989d5bf751bc4cecf09b28 (diff)
convert SwMoveFlags and SwInsertFlags from enum to enum class
Change-Id: I067656a47845c5d3fa143ce400b4ef0f8bf9ac5f
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/IDocumentContentOperations.hxx45
-rw-r--r--sw/inc/ndtxt.hxx7
2 files changed, 30 insertions, 22 deletions
diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx
index d58121da8acb..ac1f881cbcfd 100644
--- a/sw/inc/IDocumentContentOperations.hxx
+++ b/sw/inc/IDocumentContentOperations.hxx
@@ -42,28 +42,37 @@ class SwFmtFld;
namespace utl { class TransliterationWrapper; }
namespace svt { class EmbeddedObjectRef; }
+enum class SwMoveFlags
+{
+ DEFAULT = 0x00,
+ ALLFLYS = 0x01,
+ CREATEUNDOOBJ = 0x02,
+ REDLINES = 0x04,
+ NO_DELFRMS = 0x08
+};
+namespace o3tl
+{
+ template<> struct typed_flags<SwMoveFlags> : is_typed_flags<SwMoveFlags, 0x0f> {};
+}
+
+// constants for inserting text
+enum class SwInsertFlags
+{
+ DEFAULT = 0x00, // no extras
+ EMPTYEXPAND = 0x01, // expand empty hints at insert position
+ NOHINTEXPAND = 0x02, // do not expand any hints at insert pos
+ FORCEHINTEXPAND = 0x04 // expand all hints at insert position
+};
+namespace o3tl
+{
+ template<> struct typed_flags<SwInsertFlags> : is_typed_flags<SwInsertFlags, 0x07> {};
+}
+
/** Text operation/manipulation interface
*/
class IDocumentContentOperations
{
public:
- enum SwMoveFlags
- {
- DOC_MOVEDEFAULT = 0x00,
- DOC_MOVEALLFLYS = 0x01,
- DOC_CREATEUNDOOBJ = 0x02,
- DOC_MOVEREDLINES = 0x04,
- DOC_NO_DELFRMS = 0x08
- };
-
- // constants for inserting text
- enum InsertFlags
- { INS_DEFAULT = 0x00 // no extras
- , INS_EMPTYEXPAND = 0x01 // expand empty hints at insert position
- , INS_NOHINTEXPAND = 0x02 // do not expand any hints at insert pos
- , INS_FORCEHINTEXPAND = 0x04 // expand all hints at insert position
- };
-
public:
/** Copy a selected content range to a position
@@ -129,7 +138,7 @@ public:
/** Insert string into existing text node at position rRg.Point().
*/
virtual bool InsertString(const SwPaM &rRg, const OUString&,
- const enum InsertFlags nInsertMode = INS_EMPTYEXPAND ) = 0;
+ const enum SwInsertFlags nInsertMode = SwInsertFlags::EMPTYEXPAND ) = 0;
/** change text to Upper/Lower/Hiragana/Katagana/...
*/
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 3e8d5cac01bb..e5bf4b81a87c 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -246,16 +246,15 @@ public:
/// of the node, the longest prefix that fits is inserted
/// @return the prefix of rStr that was actually inserted
OUString InsertText( const OUString & rStr, const SwIndex & rIdx,
- const enum IDocumentContentOperations::InsertFlags nMode
- = IDocumentContentOperations::INS_DEFAULT );
+ const enum SwInsertFlags nMode
+ = SwInsertFlags::DEFAULT );
/** delete text content
ATTENTION: must not be called with a range that overlaps the start of
an attribute with both extent and dummy char
*/
void EraseText ( const SwIndex &rIdx, const sal_Int32 nCount = SAL_MAX_INT32,
- const enum IDocumentContentOperations::InsertFlags nMode
- = IDocumentContentOperations::INS_DEFAULT );
+ const enum SwInsertFlags nMode = SwInsertFlags::DEFAULT );
/** delete all attributes.
If neither pSet nor nWhich is given, delete all attributes (except