[Libreoffice-commits] core.git: 3 commits - sw/inc sw/source
Noel Grandin
noel at peralex.com
Wed Aug 31 11:54:11 UTC 2016
sw/inc/unocoll.hxx | 245 ++++++------
sw/source/core/doc/textboxhelper.cxx | 2
sw/source/core/inc/unofield.hxx | 7
sw/source/core/unocore/unocoll.cxx | 608 +++++++++++++++----------------
sw/source/core/unocore/unofield.cxx | 479 ++++++++++++------------
sw/source/core/unocore/unoidx.cxx | 14
sw/source/core/unocore/unotext.cxx | 2
sw/source/ui/dbui/mmaddressblockpage.cxx | 39 +
sw/source/ui/dbui/mmaddressblockpage.hxx | 20 -
sw/source/ui/frmdlg/frmpage.cxx | 259 ++++++-------
sw/source/uibase/uno/unotxdoc.cxx | 4
11 files changed, 851 insertions(+), 828 deletions(-)
New commits:
commit 9b0b3d40a2566af279204fa5991f35475fc8210c
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 31 12:59:27 2016 +0200
convert LB_ constants to typed_flags
Change-Id: I2293b0120bff73f51ed7ea4d12d5ef3eb1bcba81
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 7f90f17..e400ce7 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -76,93 +76,100 @@ using namespace ::sfx2;
#define SwFPos SvxSwFramePosString
-struct FrameMap
+struct StringIdPair_Impl
{
- SvxSwFramePosString::StringId eStrId;
- SvxSwFramePosString::StringId eMirrorStrId;
- sal_Int16 nAlign;
- sal_uLong nLBRelations;
+ SvxSwFramePosString::StringId eHori;
+ SvxSwFramePosString::StringId eVert;
};
+#define MAX_PERCENT_WIDTH 254L
+#define MAX_PERCENT_HEIGHT 254L
+
+enum class LB {
+ NONE = 0x00000000L,
+ Frame = 0x00000001L, // text region of the paragraph
+ PrintArea = 0x00000002L, // text region of the paragraph + indentions
+ VertFrame = 0x00000004L, // vertical text region of the paragraph
+ VertPrintArea = 0x00000008L, // vertical text region of the paragraph + indentions
+ RelFrameLeft = 0x00000010L, // left paragraph edge
+ RelFrameRight = 0x00000020L, // right paragraph edge
+
+ RelPageLeft = 0x00000040L, // left page edge
+ RelPageRight = 0x00000080L, // right page edge
+ RelPageFrame = 0x00000100L, // whole page
+ RelPagePrintArea = 0x00000200L, // text region of the page
+
+ FlyRelPageLeft = 0x00000400L, // left frame edge
+ FlyRelPageRight = 0x00000800L, // right frame edge
+ FlyRelPageFrame = 0x00001000L, // whole frame
+ FlyRelPagePrintArea = 0x00002000L, // inside of the frame
+
+ RelBase = 0x00010000L, // character alignment Base
+ RelChar = 0x00020000L, // character alignment Character
+ RelRow = 0x00040000L, // character alignment Row
+
+ FlyVertFrame = 0x00100000L, // vertical entire frame
+ FlyVertPrintArea = 0x00200000L, // vertical frame text area
+
+ VertLine = 0x00400000L, // vertical text line
+};
+namespace o3tl {
+ template<> struct typed_flags<LB> : is_typed_flags<LB, 0x00773fffL> {};
+}
+
struct RelationMap
{
SvxSwFramePosString::StringId eStrId;
SvxSwFramePosString::StringId eMirrorStrId;
- sal_uLong nLBRelation;
+ LB nLBRelation;
sal_Int16 nRelation;
};
-struct StringIdPair_Impl
+struct FrameMap
{
- SvxSwFramePosString::StringId eHori;
- SvxSwFramePosString::StringId eVert;
+ SvxSwFramePosString::StringId eStrId;
+ SvxSwFramePosString::StringId eMirrorStrId;
+ sal_Int16 nAlign;
+ LB nLBRelations;
};
-#define MAX_PERCENT_WIDTH 254L
-#define MAX_PERCENT_HEIGHT 254L
-
-#define LB_FRAME 0x00000001L // text region of the paragraph
-#define LB_PRTAREA 0x00000002L // text region of the paragraph + indentions
-#define LB_VERT_FRAME 0x00000004L // vertical text region of the paragraph
-#define LB_VERT_PRTAREA 0x00000008L // vertical text region of the paragraph + indentions
-#define LB_REL_FRM_LEFT 0x00000010L // left paragraph edge
-#define LB_REL_FRM_RIGHT 0x00000020L // right paragraph edge
-
-#define LB_REL_PG_LEFT 0x00000040L // left page edge
-#define LB_REL_PG_RIGHT 0x00000080L // right page edge
-#define LB_REL_PG_FRAME 0x00000100L // whole page
-#define LB_REL_PG_PRTAREA 0x00000200L // text region of the page
-
-#define LB_FLY_REL_PG_LEFT 0x00000400L // left frame edge
-#define LB_FLY_REL_PG_RIGHT 0x00000800L // right frame edge
-#define LB_FLY_REL_PG_FRAME 0x00001000L // whole frame
-#define LB_FLY_REL_PG_PRTAREA 0x00002000L // inside of the frame
-
-#define LB_REL_BASE 0x00010000L // character alignment Base
-#define LB_REL_CHAR 0x00020000L // character alignment Character
-#define LB_REL_ROW 0x00040000L // character alignment Row
-
-#define LB_FLY_VERT_FRAME 0x00100000L // vertical entire frame
-#define LB_FLY_VERT_PRTAREA 0x00200000L // vertical frame text area
-
-#define LB_VERT_LINE 0x00400000L // vertical text line
static RelationMap aRelationMap[] =
{
- {SwFPos::FRAME, SwFPos::FRAME, LB_FRAME, text::RelOrientation::FRAME},
- {SwFPos::PRTAREA, SwFPos::PRTAREA, LB_PRTAREA, text::RelOrientation::PRINT_AREA},
- {SwFPos::REL_PG_LEFT, SwFPos::MIR_REL_PG_LEFT, LB_REL_PG_LEFT, text::RelOrientation::PAGE_LEFT},
- {SwFPos::REL_PG_RIGHT, SwFPos::MIR_REL_PG_RIGHT, LB_REL_PG_RIGHT, text::RelOrientation::PAGE_RIGHT},
- {SwFPos::REL_FRM_LEFT, SwFPos::MIR_REL_FRM_LEFT, LB_REL_FRM_LEFT, text::RelOrientation::FRAME_LEFT},
- {SwFPos::REL_FRM_RIGHT, SwFPos::MIR_REL_FRM_RIGHT, LB_REL_FRM_RIGHT, text::RelOrientation::FRAME_RIGHT},
- {SwFPos::REL_PG_FRAME, SwFPos::REL_PG_FRAME, LB_REL_PG_FRAME, text::RelOrientation::PAGE_FRAME},
- {SwFPos::REL_PG_PRTAREA, SwFPos::REL_PG_PRTAREA, LB_REL_PG_PRTAREA, text::RelOrientation::PAGE_PRINT_AREA},
- {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB_REL_CHAR, text::RelOrientation::CHAR},
+ {SwFPos::FRAME, SwFPos::FRAME, LB::Frame, text::RelOrientation::FRAME},
+ {SwFPos::PRTAREA, SwFPos::PRTAREA, LB::PrintArea, text::RelOrientation::PRINT_AREA},
+ {SwFPos::REL_PG_LEFT, SwFPos::MIR_REL_PG_LEFT, LB::RelPageLeft, text::RelOrientation::PAGE_LEFT},
+ {SwFPos::REL_PG_RIGHT, SwFPos::MIR_REL_PG_RIGHT, LB::RelPageRight, text::RelOrientation::PAGE_RIGHT},
+ {SwFPos::REL_FRM_LEFT, SwFPos::MIR_REL_FRM_LEFT, LB::RelFrameLeft, text::RelOrientation::FRAME_LEFT},
+ {SwFPos::REL_FRM_RIGHT, SwFPos::MIR_REL_FRM_RIGHT, LB::RelFrameRight, text::RelOrientation::FRAME_RIGHT},
+ {SwFPos::REL_PG_FRAME, SwFPos::REL_PG_FRAME, LB::RelPageFrame, text::RelOrientation::PAGE_FRAME},
+ {SwFPos::REL_PG_PRTAREA, SwFPos::REL_PG_PRTAREA, LB::RelPagePrintArea, text::RelOrientation::PAGE_PRINT_AREA},
+ {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB::RelChar, text::RelOrientation::CHAR},
- {SwFPos::FLY_REL_PG_LEFT, SwFPos::FLY_MIR_REL_PG_LEFT, LB_FLY_REL_PG_LEFT, text::RelOrientation::PAGE_LEFT},
- {SwFPos::FLY_REL_PG_RIGHT, SwFPos::FLY_MIR_REL_PG_RIGHT, LB_FLY_REL_PG_RIGHT, text::RelOrientation::PAGE_RIGHT},
- {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB_FLY_REL_PG_FRAME, text::RelOrientation::PAGE_FRAME},
- {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB_FLY_REL_PG_PRTAREA, text::RelOrientation::PAGE_PRINT_AREA},
+ {SwFPos::FLY_REL_PG_LEFT, SwFPos::FLY_MIR_REL_PG_LEFT, LB::FlyRelPageLeft, text::RelOrientation::PAGE_LEFT},
+ {SwFPos::FLY_REL_PG_RIGHT, SwFPos::FLY_MIR_REL_PG_RIGHT, LB::FlyRelPageRight, text::RelOrientation::PAGE_RIGHT},
+ {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB::FlyRelPageFrame, text::RelOrientation::PAGE_FRAME},
+ {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB::FlyRelPagePrintArea, text::RelOrientation::PAGE_PRINT_AREA},
- {SwFPos::REL_BORDER, SwFPos::REL_BORDER, LB_VERT_FRAME, text::RelOrientation::FRAME},
- {SwFPos::REL_PRTAREA, SwFPos::REL_PRTAREA, LB_VERT_PRTAREA, text::RelOrientation::PRINT_AREA},
+ {SwFPos::REL_BORDER, SwFPos::REL_BORDER, LB::VertFrame, text::RelOrientation::FRAME},
+ {SwFPos::REL_PRTAREA, SwFPos::REL_PRTAREA, LB::VertPrintArea, text::RelOrientation::PRINT_AREA},
- {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB_FLY_VERT_FRAME, text::RelOrientation::FRAME},
- {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB_FLY_VERT_PRTAREA, text::RelOrientation::PRINT_AREA},
+ {SwFPos::FLY_REL_PG_FRAME, SwFPos::FLY_REL_PG_FRAME, LB::FlyVertFrame, text::RelOrientation::FRAME},
+ {SwFPos::FLY_REL_PG_PRTAREA, SwFPos::FLY_REL_PG_PRTAREA, LB::FlyVertPrintArea, text::RelOrientation::PRINT_AREA},
- {SwFPos::REL_LINE, SwFPos::REL_LINE, LB_VERT_LINE, text::RelOrientation::TEXT_LINE}
+ {SwFPos::REL_LINE, SwFPos::REL_LINE, LB::VertLine, text::RelOrientation::TEXT_LINE}
};
static RelationMap aAsCharRelationMap[] =
{
- {SwFPos::REL_BASE, SwFPos::REL_BASE, LB_REL_BASE, text::RelOrientation::FRAME},
- {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB_REL_CHAR, text::RelOrientation::FRAME},
- {SwFPos::REL_ROW, SwFPos::REL_ROW, LB_REL_ROW, text::RelOrientation::FRAME}
+ {SwFPos::REL_BASE, SwFPos::REL_BASE, LB::RelBase, text::RelOrientation::FRAME},
+ {SwFPos::REL_CHAR, SwFPos::REL_CHAR, LB::RelChar, text::RelOrientation::FRAME},
+ {SwFPos::REL_ROW, SwFPos::REL_ROW, LB::RelRow, text::RelOrientation::FRAME}
};
// site anchored
-#define HORI_PAGE_REL (LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_PG_LEFT| \
- LB_REL_PG_RIGHT)
+#define HORI_PAGE_REL (LB::RelPageFrame|LB::RelPagePrintArea|LB::RelPageLeft| \
+ LB::RelPageRight)
static FrameMap aHPageMap[] =
{
@@ -174,10 +181,10 @@ static FrameMap aHPageMap[] =
static FrameMap aHPageHtmlMap[] =
{
- {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB_REL_PG_FRAME}
+ {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB::RelPageFrame}
};
-#define VERT_PAGE_REL (LB_REL_PG_FRAME|LB_REL_PG_PRTAREA)
+#define VERT_PAGE_REL (LB::RelPageFrame|LB::RelPagePrintArea)
static FrameMap aVPageMap[] =
{
@@ -189,12 +196,12 @@ static FrameMap aVPageMap[] =
static FrameMap aVPageHtmlMap[] =
{
- {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, LB_REL_PG_FRAME}
+ {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, LB::RelPageFrame}
};
// frame anchored
-#define HORI_FRAME_REL (LB_FLY_REL_PG_FRAME|LB_FLY_REL_PG_PRTAREA| \
- LB_FLY_REL_PG_LEFT|LB_FLY_REL_PG_RIGHT)
+#define HORI_FRAME_REL (LB::FlyRelPageFrame|LB::FlyRelPagePrintArea| \
+ LB::FlyRelPageLeft|LB::FlyRelPageRight)
static FrameMap aHFrameMap[] =
{
@@ -206,12 +213,12 @@ static FrameMap aHFrameMap[] =
static FrameMap aHFlyHtmlMap[] =
{
- {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, LB_FLY_REL_PG_FRAME},
- {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB_FLY_REL_PG_FRAME}
+ {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, LB::FlyRelPageFrame},
+ {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB::FlyRelPageFrame}
};
// own vertical alignment map for objects anchored to frame
-#define VERT_FRAME_REL (LB_FLY_VERT_FRAME|LB_FLY_VERT_PRTAREA)
+#define VERT_FRAME_REL (LB::FlyVertFrame|LB::FlyVertPrintArea)
static FrameMap aVFrameMap[] =
{
@@ -223,14 +230,14 @@ static FrameMap aVFrameMap[] =
static FrameMap aVFlyHtmlMap[] =
{
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_FLY_VERT_FRAME},
- {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, LB_FLY_VERT_FRAME}
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB::FlyVertFrame},
+ {SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, LB::FlyVertFrame}
};
// paragraph anchored
-#define HORI_PARA_REL (LB_FRAME|LB_PRTAREA|LB_REL_PG_LEFT|LB_REL_PG_RIGHT| \
- LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_FRM_LEFT| \
- LB_REL_FRM_RIGHT)
+#define HORI_PARA_REL (LB::Frame|LB::PrintArea|LB::RelPageLeft|LB::RelPageRight| \
+ LB::RelPageFrame|LB::RelPagePrintArea|LB::RelFrameLeft| \
+ LB::RelFrameRight)
static FrameMap aHParaMap[] =
{
@@ -240,7 +247,7 @@ static FrameMap aHParaMap[] =
{SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, HORI_PARA_REL}
};
-#define HTML_HORI_PARA_REL (LB_FRAME|LB_PRTAREA)
+#define HTML_HORI_PARA_REL (LB::Frame|LB::PrintArea)
static FrameMap aHParaHtmlMap[] =
{
@@ -255,8 +262,8 @@ static FrameMap aHParaHtmlAbsMap[] =
};
// allow vertical alignment at page areas
-#define VERT_PARA_REL (LB_VERT_FRAME|LB_VERT_PRTAREA| \
- LB_REL_PG_FRAME|LB_REL_PG_PRTAREA)
+#define VERT_PARA_REL (LB::VertFrame|LB::VertPrintArea| \
+ LB::RelPageFrame|LB::RelPagePrintArea)
static FrameMap aVParaMap[] =
{
@@ -268,13 +275,13 @@ static FrameMap aVParaMap[] =
static FrameMap aVParaHtmlMap[] =
{
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_VERT_PRTAREA}
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB::VertPrintArea}
};
// anchored relative to the character
-#define HORI_CHAR_REL (LB_FRAME|LB_PRTAREA|LB_REL_PG_LEFT|LB_REL_PG_RIGHT| \
- LB_REL_PG_FRAME|LB_REL_PG_PRTAREA|LB_REL_FRM_LEFT| \
- LB_REL_FRM_RIGHT|LB_REL_CHAR)
+#define HORI_CHAR_REL (LB::Frame|LB::PrintArea|LB::RelPageLeft|LB::RelPageRight| \
+ LB::RelPageFrame|LB::RelPagePrintArea|LB::RelFrameLeft| \
+ LB::RelFrameRight|LB::RelChar)
static FrameMap aHCharMap[] =
{
@@ -284,7 +291,7 @@ static FrameMap aHCharMap[] =
{SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, HORI_CHAR_REL}
};
-#define HTML_HORI_CHAR_REL (LB_FRAME|LB_PRTAREA|LB_REL_CHAR)
+#define HTML_HORI_CHAR_REL (LB::Frame|LB::PrintArea|LB::RelChar)
static FrameMap aHCharHtmlMap[] =
{
@@ -294,73 +301,73 @@ static FrameMap aHCharHtmlMap[] =
static FrameMap aHCharHtmlAbsMap[] =
{
- {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, LB_PRTAREA|LB_REL_CHAR},
- {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, LB_PRTAREA},
- {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB_REL_PG_FRAME}
+ {SwFPos::LEFT, SwFPos::MIR_LEFT, text::HoriOrientation::LEFT, LB::PrintArea|LB::RelChar},
+ {SwFPos::RIGHT, SwFPos::MIR_RIGHT, text::HoriOrientation::RIGHT, LB::PrintArea},
+ {SwFPos::FROMLEFT, SwFPos::MIR_FROMLEFT, text::HoriOrientation::NONE, LB::RelPageFrame}
};
// allow vertical alignment at page areas
-#define VERT_CHAR_REL (LB_VERT_FRAME|LB_VERT_PRTAREA| \
- LB_REL_PG_FRAME|LB_REL_PG_PRTAREA)
+#define VERT_CHAR_REL (LB::VertFrame|LB::VertPrintArea| \
+ LB::RelPageFrame|LB::RelPagePrintArea)
static FrameMap aVCharMap[] =
{
- // introduce mappings for new vertical alignment at top of line <LB_VERT_LINE>
+ // introduce mappings for new vertical alignment at top of line <LB::VertLine>
// and correct mapping for vertical alignment at character for position <FROM_BOTTOM>
// Note: Because of these adjustments the map becomes ambigous in its values
// <eStrId>/<eMirrorStrId> and <nAlign>. These ambiguities are considered
// in the methods <SwFramePage::FillRelLB(..)>, <SwFramePage::GetAlignment(..)>
// and <SwFramePage::FillPosLB(..)>
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_CHAR_REL|LB_REL_CHAR},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_CHAR_REL|LB_REL_CHAR},
- {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB_REL_CHAR},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, VERT_CHAR_REL|LB_REL_CHAR},
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, VERT_CHAR_REL|LB::RelChar},
+ {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, VERT_CHAR_REL|LB::RelChar},
+ {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB::RelChar},
+ {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, VERT_CHAR_REL|LB::RelChar},
{SwFPos::FROMTOP, SwFPos::FROMTOP, text::VertOrientation::NONE, VERT_CHAR_REL},
- {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, text::VertOrientation::NONE, LB_REL_CHAR|LB_VERT_LINE},
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::LINE_TOP, LB_VERT_LINE},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::LINE_BOTTOM, LB_VERT_LINE},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB_VERT_LINE}
+ {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, text::VertOrientation::NONE, LB::RelChar|LB::VertLine},
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::LINE_TOP, LB::VertLine},
+ {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::LINE_BOTTOM, LB::VertLine},
+ {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB::VertLine}
};
static FrameMap aVCharHtmlMap[] =
{
- {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB_REL_CHAR}
+ {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB::RelChar}
};
static FrameMap aVCharHtmlAbsMap[] =
{
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_REL_CHAR},
- {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB_REL_CHAR}
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB::RelChar},
+ {SwFPos::BELOW, SwFPos::BELOW, text::VertOrientation::CHAR_BOTTOM, LB::RelChar}
};
// anchored as character
static FrameMap aVAsCharMap[] =
{
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_REL_BASE},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, LB_REL_BASE},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, LB_REL_BASE},
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB::RelBase},
+ {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::BOTTOM, LB::RelBase},
+ {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, LB::RelBase},
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::CHAR_TOP, LB_REL_CHAR},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::CHAR_BOTTOM, LB_REL_CHAR},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CHAR_CENTER, LB_REL_CHAR},
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::CHAR_TOP, LB::RelChar},
+ {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::CHAR_BOTTOM, LB::RelChar},
+ {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CHAR_CENTER, LB::RelChar},
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::LINE_TOP, LB_REL_ROW},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::LINE_BOTTOM, LB_REL_ROW},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB_REL_ROW},
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::LINE_TOP, LB::RelRow},
+ {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::LINE_BOTTOM, LB::RelRow},
+ {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB::RelRow},
- {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, text::VertOrientation::NONE, LB_REL_BASE}
+ {SwFPos::FROMBOTTOM, SwFPos::FROMBOTTOM, text::VertOrientation::NONE, LB::RelBase}
};
static FrameMap aVAsCharHtmlMap[] =
{
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB_REL_BASE},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, LB_REL_BASE},
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::TOP, LB::RelBase},
+ {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::CENTER, LB::RelBase},
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::CHAR_TOP, LB_REL_CHAR},
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::CHAR_TOP, LB::RelChar},
- {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::LINE_TOP, LB_REL_ROW},
- {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::LINE_BOTTOM, LB_REL_ROW},
- {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB_REL_ROW}
+ {SwFPos::TOP, SwFPos::TOP, text::VertOrientation::LINE_TOP, LB::RelRow},
+ {SwFPos::BOTTOM, SwFPos::BOTTOM, text::VertOrientation::LINE_BOTTOM, LB::RelRow},
+ {SwFPos::CENTER_VERT, SwFPos::CENTER_VERT, text::VertOrientation::LINE_CENTER, LB::RelRow}
};
const sal_uInt16 SwFramePage::aPageRg[] = {
@@ -548,9 +555,9 @@ static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePo
// helper method in order to determine all possible
// listbox relations in a relation map for a given relation
-static sal_uLong lcl_GetLBRelationsForRelations( const sal_Int16 _nRel )
+static LB lcl_GetLBRelationsForRelations( const sal_Int16 _nRel )
{
- sal_uLong nLBRelations = 0L;
+ LB nLBRelations = LB::NONE;
for (RelationMap & i : aRelationMap)
{
@@ -565,11 +572,11 @@ static sal_uLong lcl_GetLBRelationsForRelations( const sal_Int16 _nRel )
// helper method on order to determine all possible
// listbox relations in a relation map for a given string ID
-static sal_uLong lcl_GetLBRelationsForStrID( const FrameMap* _pMap,
+static LB lcl_GetLBRelationsForStrID( const FrameMap* _pMap,
const SvxSwFramePosString::StringId _eStrId,
const bool _bUseMirrorStr )
{
- sal_uLong nLBRelations = 0L;
+ LB nLBRelations = LB::NONE;
size_t nRelMapSize = lcl_GetFrameMapCount( _pMap );
for ( size_t nRelMapPos = 0; nRelMapPos < nRelMapSize; ++nRelMapPos )
@@ -1401,8 +1408,8 @@ sal_Int32 SwFramePage::FillPosLB(const FrameMap* _pMap,
// i#22341 determine all possible listbox relations for
// given relation for map <aVCharMap>
- const sal_uLong nLBRelations = (_pMap != aVCharMap)
- ? 0L
+ const LB nLBRelations = (_pMap != aVCharMap)
+ ? LB::NONE
: ::lcl_GetLBRelationsForRelations( _nRel );
// fill Listbox
@@ -1453,8 +1460,8 @@ void SwFramePage::FillRelLB( const FrameMap* _pMap,
FixedText& _rFT )
{
OUString sSelEntry;
- sal_uLong nLBRelations = 0;
- size_t nMapCount = ::lcl_GetFrameMapCount(_pMap);
+ LB nLBRelations = LB::NONE;
+ size_t nMapCount = ::lcl_GetFrameMapCount(_pMap);
_rLB.Clear();
@@ -1503,7 +1510,7 @@ void SwFramePage::FillRelLB( const FrameMap* _pMap,
for (sal_Int32 i = 0; i < _rLB.GetEntryCount(); i++)
{
RelationMap *pEntry = static_cast<RelationMap *>(_rLB.GetEntryData(i));
- if (pEntry->nLBRelation == LB_REL_CHAR) // default
+ if (pEntry->nLBRelation == LB::RelChar) // default
{
_rLB.SelectEntryPos(i);
break;
@@ -1531,11 +1538,11 @@ void SwFramePage::FillRelLB( const FrameMap* _pMap,
for (sal_uLong nBit = 1; nBit < 0x80000000; nBit <<= 1)
{
- if (nLBRelations & nBit)
+ if (nLBRelations & (LB)nBit)
{
for (RelationMap & rMap : aRelationMap)
{
- if (rMap.nLBRelation == nBit)
+ if (rMap.nLBRelation == (LB)nBit)
{
SvxSwFramePosString::StringId eStrId1 = m_pMirrorPagesCB->IsChecked() ?
rMap.eMirrorStrId : rMap.eStrId;
@@ -1654,7 +1661,7 @@ sal_Int16 SwFramePage::GetAlignment(FrameMap *pMap, sal_Int32 nMapPos,
const RelationMap *const pRelationMap = static_cast<const RelationMap *>(
rRelationLB.GetSelectEntryData());
- const sal_uLong nRel = pRelationMap->nLBRelation;
+ const LB nRel = pRelationMap->nLBRelation;
const SvxSwFramePosString::StringId eStrId = pMap[nMapPos].eStrId;
for (size_t i = 0; i < nMapCount; ++i)
commit 10609a987d81f1f08f42cba2f3e9337b31b4fe07
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 31 12:48:51 2016 +0200
convert MOVE_ITEM constants to typed_flags
Change-Id: I9be9226cbe9bf6b76df3132d1ed3f08ea65bf273
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 5f9e640..767aa9a 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -619,13 +619,13 @@ IMPL_LINK_TYPED(SwCustomizeAddressBlockDialog, ImageButtonHdl_Impl, Button*, pBu
}
else
{
- sal_uInt16 nMove = MOVE_ITEM_DOWN;
+ MoveItemFlags nMove = MoveItemFlags::Down;
if (m_pUpIB == pButton)
- nMove = MOVE_ITEM_UP;
+ nMove = MoveItemFlags::Up;
else if (m_pLeftIB == pButton)
- nMove = MOVE_ITEM_LEFT;
+ nMove = MoveItemFlags::Left;
else if (m_pRightIB == pButton)
- nMove = MOVE_ITEM_RIGHT;
+ nMove = MoveItemFlags::Right;
m_pDragED->MoveCurrentItem(nMove);
}
UpdateImageButtons_Impl();
@@ -745,11 +745,11 @@ IMPL_LINK_NOARG_TYPED(SwCustomizeAddressBlockDialog, FieldChangeHdl_Impl, Edit&,
void SwCustomizeAddressBlockDialog::UpdateImageButtons_Impl()
{
- sal_uInt16 nMove = m_pDragED->IsCurrentItemMoveable();
- m_pUpIB->Enable(nMove & MOVE_ITEM_UP );
- m_pLeftIB->Enable(nMove & MOVE_ITEM_LEFT );
- m_pRightIB->Enable(nMove & MOVE_ITEM_RIGHT );
- m_pDownIB->Enable(nMove & MOVE_ITEM_DOWN);
+ MoveItemFlags nMove = m_pDragED->IsCurrentItemMoveable();
+ m_pUpIB->Enable( bool(nMove & MoveItemFlags::Up) );
+ m_pLeftIB->Enable( bool(nMove & MoveItemFlags::Left) );
+ m_pRightIB->Enable( bool(nMove & MoveItemFlags::Right) );
+ m_pDownIB->Enable( bool(nMove & MoveItemFlags::Down) );
m_pRemoveFieldIB->Enable(m_pDragED->HasCurrentItem());
SvTreeListEntry* pEntry = m_pAddressElementsLB->GetCurEntry();
m_pInsertFieldIB->Enable( pEntry &&
@@ -1477,7 +1477,7 @@ void AddressMultiLineEdit::RemoveCurrentEntry()
}
}
-void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove)
+void AddressMultiLineEdit::MoveCurrentItem(MoveItemFlags nMove)
{
ExtTextEngine* pTextEngine = GetTextEngine();
ExtTextView* pTextView = GetTextView();
@@ -1496,7 +1496,7 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove)
pTextEngine->ReplaceText(aEntrySel, OUString());
switch(nMove)
{
- case MOVE_ITEM_LEFT :
+ case MoveItemFlags::Left :
if(nIndex)
{
//go left to find a predecessor or simple text
@@ -1511,7 +1511,7 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove)
}
}
break;
- case MOVE_ITEM_RIGHT:
+ case MoveItemFlags::Right:
{
//go right to find a successor or simple text
++nIndex;
@@ -1522,14 +1522,15 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove)
}
}
break;
- case MOVE_ITEM_UP :
+ case MoveItemFlags::Up :
--nPara;
nIndex = 0;
break;
- case MOVE_ITEM_DOWN :
+ case MoveItemFlags::Down :
++nPara;
nIndex = 0;
break;
+ default: break;
}
//add a new paragraph if there is none yet
if(nPara >= pTextEngine->GetParagraphCount())
@@ -1550,9 +1551,9 @@ void AddressMultiLineEdit::MoveCurrentItem(sal_uInt16 nMove)
}
}
-sal_uInt16 AddressMultiLineEdit::IsCurrentItemMoveable()
+MoveItemFlags AddressMultiLineEdit::IsCurrentItemMoveable()
{
- sal_uInt16 nRet = 0;
+ MoveItemFlags nRet = MoveItemFlags::NONE;
ExtTextEngine* pTextEngine = GetTextEngine();
ExtTextView* pTextView = GetTextView();
const TextSelection& rSelection = pTextView->GetSelection();
@@ -1562,11 +1563,11 @@ sal_uInt16 AddressMultiLineEdit::IsCurrentItemMoveable()
&& pBeginAttrib->GetEnd() >= rSelection.GetEnd().GetIndex()))
{
if(pBeginAttrib->GetStart())
- nRet |= MOVE_ITEM_LEFT;
+ nRet |= MoveItemFlags::Left;
//if there is an entry it can always be move to the right and down
- nRet |= MOVE_ITEM_RIGHT|MOVE_ITEM_DOWN;
+ nRet |= MoveItemFlags::Right | MoveItemFlags::Down;
if(rSelection.GetStart().GetPara() > 0)
- nRet |= MOVE_ITEM_UP;
+ nRet |= MoveItemFlags::Up;
}
return nRet;
}
diff --git a/sw/source/ui/dbui/mmaddressblockpage.hxx b/sw/source/ui/dbui/mmaddressblockpage.hxx
index 55fcb75..28861b9 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.hxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.hxx
@@ -32,6 +32,8 @@
#include <svtools/treelistbox.hxx>
#include <vcl/combobox.hxx>
#include <svl/lstner.hxx>
+#include <o3tl/typed_flags_set.hxx>
+
class SwMailMergeWizard;
class SwMailMergeConfigItem;
@@ -133,10 +135,16 @@ public:
virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override;
};
-#define MOVE_ITEM_LEFT 1
-#define MOVE_ITEM_RIGHT 2
-#define MOVE_ITEM_UP 4
-#define MOVE_ITEM_DOWN 8
+enum class MoveItemFlags {
+ NONE = 0,
+ Left = 1,
+ Right = 2,
+ Up = 4,
+ Down = 8,
+};
+namespace o3tl {
+ template<> struct typed_flags<MoveItemFlags> : is_typed_flags<MoveItemFlags, 0x0f> {};
+}
class AddressMultiLineEdit : public VclMultiLineEdit, public SfxListener
{
@@ -169,8 +177,8 @@ public:
void InsertNewEntryAtPosition( const OUString& rStr, sal_uLong nPara, sal_uInt16 nIndex );
void RemoveCurrentEntry();
- void MoveCurrentItem(sal_uInt16 nMove);
- sal_uInt16 IsCurrentItemMoveable();
+ void MoveCurrentItem(MoveItemFlags nMove);
+ MoveItemFlags IsCurrentItemMoveable();
bool HasCurrentItem();
OUString GetCurrentItem();
void SelectCurrentItem();
commit 60638b092d1da63ec99886e50435ad57cc290d71
Author: Noel Grandin <noel at peralex.com>
Date: Wed Aug 31 12:35:39 2016 +0200
convert SW_SERVICE constants to scoped enum
Change-Id: I731d93f9ab77e60880365c8e2f5e62221d8da5ad
diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index f853fe4..a374662 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -69,123 +69,128 @@ class SwUnoCollection
SwDoc* GetDoc() const {return m_pDoc;}
};
-#define SW_SERVICE_TYPE_TEXTTABLE 0
-#define SW_SERVICE_TYPE_TEXTFRAME 1
-#define SW_SERVICE_TYPE_GRAPHIC 2
-#define SW_SERVICE_TYPE_OLE 3
-#define SW_SERVICE_TYPE_BOOKMARK 4
-#define SW_SERVICE_TYPE_FOOTNOTE 5
-#define SW_SERVICE_TYPE_ENDNOTE 6
-#define SW_SERVICE_TYPE_INDEXMARK 7
-#define SW_SERVICE_TYPE_INDEX 8
-#define SW_SERVICE_REFERENCE_MARK 9
-#define SW_SERVICE_STYLE_CHARACTER_STYLE 10
-#define SW_SERVICE_STYLE_PARAGRAPH_STYLE 11
-#define SW_SERVICE_STYLE_FRAME_STYLE 12
-#define SW_SERVICE_STYLE_PAGE_STYLE 13
-#define SW_SERVICE_STYLE_NUMBERING_STYLE 14
-#define SW_SERVICE_CONTENT_INDEX_MARK 15
-#define SW_SERVICE_CONTENT_INDEX 16
-#define SW_SERVICE_USER_INDEX_MARK 17
-#define SW_SERVICE_USER_INDEX 18
-#define SW_SERVICE_TEXT_SECTION 19
-#define SW_SERVICE_FIELDTYPE_DATETIME 20
-#define SW_SERVICE_FIELDTYPE_USER 21
-#define SW_SERVICE_FIELDTYPE_SET_EXP 22
-#define SW_SERVICE_FIELDTYPE_GET_EXP 23
-#define SW_SERVICE_FIELDTYPE_FILE_NAME 24
-#define SW_SERVICE_FIELDTYPE_PAGE_NUM 25
-#define SW_SERVICE_FIELDTYPE_AUTHOR 26
-#define SW_SERVICE_FIELDTYPE_CHAPTER 27
-#define SW_SERVICE_FIELDTYPE_DUMMY_0 28
-#define SW_SERVICE_FIELDTYPE_GET_REFERENCE 29
-#define SW_SERVICE_FIELDTYPE_CONDITIONED_TEXT 30
-#define SW_SERVICE_FIELDTYPE_ANNOTATION 31
-#define SW_SERVICE_FIELDTYPE_INPUT 32
-#define SW_SERVICE_FIELDTYPE_MACRO 33
-#define SW_SERVICE_FIELDTYPE_DDE 34
-#define SW_SERVICE_FIELDTYPE_HIDDEN_PARA 35
-#define SW_SERVICE_FIELDTYPE_DOC_INFO 36
-#define SW_SERVICE_FIELDTYPE_TEMPLATE_NAME 37
-#define SW_SERVICE_FIELDTYPE_USER_EXT 38
-#define SW_SERVICE_FIELDTYPE_REF_PAGE_SET 39
-#define SW_SERVICE_FIELDTYPE_REF_PAGE_GET 40
-#define SW_SERVICE_FIELDTYPE_JUMP_EDIT 41
-#define SW_SERVICE_FIELDTYPE_SCRIPT 42
-#define SW_SERVICE_FIELDTYPE_DATABASE_NEXT_SET 43
-#define SW_SERVICE_FIELDTYPE_DATABASE_NUM_SET 44
-#define SW_SERVICE_FIELDTYPE_DATABASE_SET_NUM 45
-#define SW_SERVICE_FIELDTYPE_DATABASE 46
-#define SW_SERVICE_FIELDTYPE_DATABASE_NAME 47
-#define SW_SERVICE_FIELDTYPE_TABLE_FORMULA 48
-#define SW_SERVICE_FIELDTYPE_PAGE_COUNT 49
-#define SW_SERVICE_FIELDTYPE_PARAGRAPH_COUNT 50
-#define SW_SERVICE_FIELDTYPE_WORD_COUNT 51
-#define SW_SERVICE_FIELDTYPE_CHARACTER_COUNT 52
-#define SW_SERVICE_FIELDTYPE_TABLE_COUNT 53
-#define SW_SERVICE_FIELDTYPE_GRAPHIC_OBJECT_COUNT 54
-#define SW_SERVICE_FIELDTYPE_EMBEDDED_OBJECT_COUNT 55
-#define SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_AUTHOR 56
-#define SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_DATE_TIME 57
-#define SW_SERVICE_FIELDTYPE_DOCINFO_EDIT_TIME 58
-#define SW_SERVICE_FIELDTYPE_DOCINFO_DESCRIPTION 59
-#define SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_AUTHOR 60
-#define SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_DATE_TIME 61
-#define SW_SERVICE_FIELDTYPE_DUMMY_1 63
-#define SW_SERVICE_FIELDTYPE_DUMMY_2 64
-#define SW_SERVICE_FIELDTYPE_DUMMY_3 65
-#define SW_SERVICE_FIELDTYPE_DOCINFO_CUSTOM 66
-#define SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_AUTHOR 67
-#define SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_DATE_TIME 68
-#define SW_SERVICE_FIELDTYPE_DOCINFO_KEY_WORDS 69
-#define SW_SERVICE_FIELDTYPE_DOCINFO_SUBJECT 70
-#define SW_SERVICE_FIELDTYPE_DOCINFO_TITLE 71
-#define SW_SERVICE_FIELDTYPE_DOCINFO_REVISION 72
-#define SW_SERVICE_FIELDTYPE_BIBLIOGRAPHY 73
-#define SW_SERVICE_FIELDTYPE_COMBINED_CHARACTERS 74
-#define SW_SERVICE_FIELDTYPE_DROPDOWN 75
-#define SW_SERVICE_FIELDTYPE_METAFIELD 76
-#define SW_SERVICE_FIELDTYPE_DUMMY_4 77
-#define SW_SERVICE_FIELDTYPE_DUMMY_5 78
-#define SW_SERVICE_FIELDTYPE_DUMMY_6 79
-#define SW_SERVICE_FIELDTYPE_DUMMY_7 80
-#define SW_SERVICE_FIELDMASTER_USER 81
-#define SW_SERVICE_FIELDMASTER_DDE 82
-#define SW_SERVICE_FIELDMASTER_SET_EXP 83
-#define SW_SERVICE_FIELDMASTER_DATABASE 84
-#define SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY 85
-#define SW_SERVICE_FIELDMASTER_DUMMY2 86
-#define SW_SERVICE_FIELDMASTER_DUMMY3 87
-#define SW_SERVICE_FIELDMASTER_DUMMY4 88
-#define SW_SERVICE_FIELDMASTER_DUMMY5 89
-#define SW_SERVICE_INDEX_ILLUSTRATIONS 90
-#define SW_SERVICE_INDEX_OBJECTS 91
-#define SW_SERVICE_INDEX_TABLES 92
-#define SW_SERVICE_INDEX_BIBLIOGRAPHY 93
-#define SW_SERVICE_PARAGRAPH 94
-#define SW_SERVICE_FIELDTYPE_INPUT_USER 95
-#define SW_SERVICE_FIELDTYPE_HIDDEN_TEXT 96
-#define SW_SERVICE_STYLE_CONDITIONAL_PARAGRAPH_STYLE 97
-#define SW_SERVICE_NUMBERING_RULES 98
-#define SW_SERVICE_TEXT_COLUMNS 99
-#define SW_SERVICE_INDEX_HEADER_SECTION 100
-#define SW_SERVICE_DEFAULTS 101
-#define SW_SERVICE_IMAP_RECTANGLE 102
-#define SW_SERVICE_IMAP_CIRCLE 103
-#define SW_SERVICE_IMAP_POLYGON 104
-#define SW_SERVICE_TYPE_TEXT_GRAPHIC 105
-#define SW_SERVICE_CHART2_DATA_PROVIDER 106
-#define SW_SERVICE_TYPE_FIELDMARK 107
-#define SW_SERVICE_TYPE_FORMFIELDMARK 108
-#define SW_SERVICE_TYPE_META 109
-#define SW_SERVICE_VBAOBJECTPROVIDER 110
-#define SW_SERVICE_VBACODENAMEPROVIDER 111
-#define SW_SERVICE_VBAPROJECTNAMEPROVIDER 112
-#define SW_SERVICE_VBAGLOBALS 113
-#define SW_SERVICE_STYLE_TABLE_STYLE 114
-#define SW_SERVICE_STYLE_CELL_STYLE 115
-
-#define SW_SERVICE_INVALID USHRT_MAX
+/** entries in this enum are mapped in an array in unocoll.cxx */
+enum class SwServiceType {
+ TypeTextTable = 0,
+ TypeTextFrame = 1,
+ TypeGraphic = 2,
+ TypeOLE = 3,
+ TypeBookmark = 4,
+ TypeFootnote = 5,
+ TypeEndnote = 6,
+ TypeIndexMark = 7,
+ TypeIndex = 8,
+ ReferenceMark = 9,
+ StyleCharacter = 10,
+ StyleParagraph = 11,
+ StyleFrame = 12,
+ StylePage = 13,
+ StyleNumbering = 14,
+ ContentIndexMark = 15,
+ ContentIndex = 16,
+ UserIndexMark = 17,
+ UserIndex = 18,
+ TextSection = 19,
+ FieldTypeDateTime = 20,
+ FieldTypeUser = 21,
+ FieldTypeSetExp = 22,
+ FieldTypeGetExp = 23,
+ FieldTypeFileName = 24,
+ FieldTypePageNum = 25,
+ FieldTypeAuthor = 26,
+ FieldTypeChapter = 27,
+ FieldTypeDummy0 = 28,
+ FieldTypeGetReference = 29,
+ FieldTypeConditionedText = 30,
+ FieldTypeAnnotation = 31,
+ FieldTypeInput = 32,
+ FieldTypeMacro = 33,
+ FieldTypeDDE = 34,
+ FieldTypeHiddenPara = 35,
+ FieldTypeDocInfo = 36,
+ FieldTypeTemplateName = 37,
+ FieldTypeUserExt = 38,
+ FieldTypeRefPageSet = 39,
+ FieldTypeRefPageGet = 40,
+ FieldTypeJumpEdit = 41,
+ FieldTypeScript = 42,
+ FieldTypeDatabaseNextSet = 43,
+ FieldTypeDatabaseNumSet = 44,
+ FieldTypeDatabaseSetNum = 45,
+ FieldTypeDatabase = 46,
+ FieldTypeDatabaseName = 47,
+ FieldTypeTableFormula = 48,
+ FieldTypePageCount = 49,
+ FieldTypeParagraphCount = 50,
+ FieldTypeWordCount = 51,
+ FieldTypeCharacterCount = 52,
+ FieldTypeTableCount = 53,
+ FieldTypeGraphicObjectCount = 54,
+ FieldTypeEmbeddedObjectCount = 55,
+ FieldTypeDocInfoChangeAuthor = 56,
+ FieldTypeDocInfoChangeDateTime = 57,
+ FieldTypeDocInfoEditTime = 58,
+ FieldTypeDocInfoDescription = 59,
+ FieldTypeDocInfoCreateAuthor = 60,
+ FieldTypeDocInfoCreateDateTime = 61,
+ FieldTypeDummy1 = 63,
+ FieldTypeDummy2 = 64,
+ FieldTypeDummy3 = 65,
+ FieldTypeDocInfoCustom = 66,
+ FieldTypeDocInfoPrintAuthor = 67,
+ FieldTypeDocInfoPrintDateTime = 68,
+ FieldTypeDocInfoKeywords = 69,
+ FieldTypeDocInfoSubject = 70,
+ FieldTypeDocInfoTitle = 71,
+ FieldTypeDocInfoRevision = 72,
+ FieldTypeBibliography = 73,
+ FieldTypeCombinedCharacters = 74,
+ FieldTypeDropdown = 75,
+ FieldTypeMetafield = 76,
+ FieldTypeDummy4 = 77,
+ FieldTypeDummy5 = 78,
+ FieldTypeDummy6 = 79,
+ FieldTypeDummy7 = 80,
+ FieldMasterUser = 81,
+ FieldMasterDDE = 82,
+ FieldMasterSetExp = 83,
+ FieldMasterDatabase = 84,
+ FieldMasterBibliography = 85,
+ FieldMasterDummy2 = 86,
+ FieldMasterDummy3 = 87,
+ FieldMasterDummy4 = 88,
+ FieldMasterDummy5 = 89,
+ IndexIllustrations = 90,
+ IndexObjects = 91,
+ IndexTables = 92,
+ IndexBibliography = 93,
+ Paragraph = 94,
+ FieldTypeInputUser = 95,
+ FieldTypeHiddenText = 96,
+ StyleConditionalParagraph = 97,
+ NumberingRules = 98,
+ TextColumns = 99,
+ IndexHeaderSection = 100,
+ Defaults = 101,
+ IMapRectangle = 102,
+ IMapCircle = 103,
+ IMapPolygon = 104,
+ TypeTextGraphic = 105,
+ Chart2DataProvider = 106,
+ TypeFieldMark = 107,
+ TypeFormFieldMark = 108,
+ TypeMeta = 109,
+ VbaObjectProvider = 110,
+ VbaCodeNameProvider = 111,
+ VbaProjectNameProvider = 112,
+ VbaGlobals = 113,
+ StyleTable = 114,
+ StyleCell = 115,
+
+ LAST = StyleCell,
+
+ Invalid = USHRT_MAX
+};
// case-corrected versions of service-names (see #i67811)
@@ -250,9 +255,9 @@ class SwUnoCollection
class SwXServiceProvider
{
public:
- static OUString GetProviderName(sal_uInt16 nObjectType);
- static sal_uInt16 GetProviderType(const OUString& rServiceName);
- static css::uno::Reference< css::uno::XInterface > MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc);
+ static OUString GetProviderName(SwServiceType nObjectType);
+ static SwServiceType GetProviderType(const OUString& rServiceName);
+ static css::uno::Reference< css::uno::XInterface > MakeInstance(SwServiceType nObjectType, SwDoc & rDoc);
static css::uno::Sequence<OUString> GetAllServiceNames();
};
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index 95ab15f..227302d 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -51,7 +51,7 @@ void SwTextBoxHelper::create(SwFrameFormat* pShape)
if (!pShape->GetAttrSet().HasItem(RES_CNTNT))
{
// Create the associated TextFrame and insert it into the document.
- uno::Reference<text::XTextContent> xTextFrame(SwXServiceProvider::MakeInstance(SW_SERVICE_TYPE_TEXTFRAME, *pShape->GetDoc()), uno::UNO_QUERY);
+ uno::Reference<text::XTextContent> xTextFrame(SwXServiceProvider::MakeInstance(SwServiceType::TypeTextFrame, *pShape->GetDoc()), uno::UNO_QUERY);
uno::Reference<text::XTextDocument> xTextDocument(pShape->GetDoc()->GetDocShell()->GetBaseModel(), uno::UNO_QUERY);
uno::Reference<text::XTextContentAppend> xTextContentAppend(xTextDocument->getText(), uno::UNO_QUERY);
xTextContentAppend->appendTextContent(xTextFrame, uno::Sequence<beans::PropertyValue>());
diff --git a/sw/source/core/inc/unofield.hxx b/sw/source/core/inc/unofield.hxx
index 4b30914..d268113 100644
--- a/sw/source/core/inc/unofield.hxx
+++ b/sw/source/core/inc/unofield.hxx
@@ -29,6 +29,7 @@
#include <cppuhelper/implbase.hxx>
#include <unobaseclass.hxx>
+#include <unocoll.hxx>
class SwFieldType;
class SwDoc;
@@ -162,15 +163,15 @@ private:
SwXTextField(SwFormatField& rFormat, SwDoc & rDoc);
/// descriptor
- SwXTextField(sal_uInt16 nServiceId, SwDoc* pDoc=nullptr);
+ SwXTextField(SwServiceType nServiceId, SwDoc* pDoc=nullptr);
public:
- sal_uInt16 GetServiceId() const;
+ SwServiceType GetServiceId() const;
/// @return an SwXTextField, either an already existing one or a new one
static css::uno::Reference< css::text::XTextField>
CreateXTextField(SwDoc * pDoc, SwFormatField const* pFormat,
- sal_uInt16 nServiceId = 0xFFFF);
+ SwServiceType nServiceId = SwServiceType::Invalid);
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 79d3859..055e931 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -276,187 +276,187 @@ public:
struct ProvNamesId_Type
{
const char * pName;
- sal_uInt16 nType;
+ SwServiceType nType;
};
// note: this thing is indexed as an array, so do not insert/remove entries!
const ProvNamesId_Type aProvNamesId[] =
{
- { "com.sun.star.text.TextTable", SW_SERVICE_TYPE_TEXTTABLE },
- { "com.sun.star.text.TextFrame", SW_SERVICE_TYPE_TEXTFRAME },
- { "com.sun.star.text.GraphicObject", SW_SERVICE_TYPE_GRAPHIC },
- { "com.sun.star.text.TextEmbeddedObject", SW_SERVICE_TYPE_OLE },
- { "com.sun.star.text.Bookmark", SW_SERVICE_TYPE_BOOKMARK },
- { "com.sun.star.text.Footnote", SW_SERVICE_TYPE_FOOTNOTE },
- { "com.sun.star.text.Endnote", SW_SERVICE_TYPE_ENDNOTE },
- { "com.sun.star.text.DocumentIndexMark", SW_SERVICE_TYPE_INDEXMARK },
- { "com.sun.star.text.DocumentIndex", SW_SERVICE_TYPE_INDEX },
- { "com.sun.star.text.ReferenceMark", SW_SERVICE_REFERENCE_MARK },
- { "com.sun.star.style.CharacterStyle", SW_SERVICE_STYLE_CHARACTER_STYLE },
- { "com.sun.star.style.ParagraphStyle", SW_SERVICE_STYLE_PARAGRAPH_STYLE },
- { "com.sun.star.style.FrameStyle", SW_SERVICE_STYLE_FRAME_STYLE },
- { "com.sun.star.style.PageStyle", SW_SERVICE_STYLE_PAGE_STYLE },
- { "com.sun.star.style.NumberingStyle", SW_SERVICE_STYLE_NUMBERING_STYLE },
- { "com.sun.star.text.ContentIndexMark", SW_SERVICE_CONTENT_INDEX_MARK },
- { "com.sun.star.text.ContentIndex", SW_SERVICE_CONTENT_INDEX },
- { "com.sun.star.text.UserIndexMark", SW_SERVICE_USER_INDEX_MARK },
- { "com.sun.star.text.UserIndex", SW_SERVICE_USER_INDEX },
- { "com.sun.star.text.TextSection", SW_SERVICE_TEXT_SECTION },
- { "com.sun.star.text.TextField.DateTime", SW_SERVICE_FIELDTYPE_DATETIME },
- { "com.sun.star.text.TextField.User", SW_SERVICE_FIELDTYPE_USER },
- { "com.sun.star.text.TextField.SetExpression", SW_SERVICE_FIELDTYPE_SET_EXP },
- { "com.sun.star.text.TextField.GetExpression", SW_SERVICE_FIELDTYPE_GET_EXP },
- { "com.sun.star.text.TextField.FileName", SW_SERVICE_FIELDTYPE_FILE_NAME },
- { "com.sun.star.text.TextField.PageNumber", SW_SERVICE_FIELDTYPE_PAGE_NUM },
- { "com.sun.star.text.TextField.Author", SW_SERVICE_FIELDTYPE_AUTHOR },
- { "com.sun.star.text.TextField.Chapter", SW_SERVICE_FIELDTYPE_CHAPTER },
- { "", SW_SERVICE_FIELDTYPE_DUMMY_0 },
- { "com.sun.star.text.TextField.GetReference", SW_SERVICE_FIELDTYPE_GET_REFERENCE },
- { "com.sun.star.text.TextField.ConditionalText", SW_SERVICE_FIELDTYPE_CONDITIONED_TEXT },
- { "com.sun.star.text.TextField.Annotation", SW_SERVICE_FIELDTYPE_ANNOTATION },
- { "com.sun.star.text.TextField.Input", SW_SERVICE_FIELDTYPE_INPUT },
- { "com.sun.star.text.TextField.Macro", SW_SERVICE_FIELDTYPE_MACRO },
- { "com.sun.star.text.TextField.DDE", SW_SERVICE_FIELDTYPE_DDE },
- { "com.sun.star.text.TextField.HiddenParagraph", SW_SERVICE_FIELDTYPE_HIDDEN_PARA },
- { "" /*com.sun.star.text.TextField.DocumentInfo"*/, SW_SERVICE_FIELDTYPE_DOC_INFO },
- { "com.sun.star.text.TextField.TemplateName", SW_SERVICE_FIELDTYPE_TEMPLATE_NAME },
- { "com.sun.star.text.TextField.ExtendedUser", SW_SERVICE_FIELDTYPE_USER_EXT },
- { "com.sun.star.text.TextField.ReferencePageSet", SW_SERVICE_FIELDTYPE_REF_PAGE_SET },
- { "com.sun.star.text.TextField.ReferencePageGet", SW_SERVICE_FIELDTYPE_REF_PAGE_GET },
- { "com.sun.star.text.TextField.JumpEdit", SW_SERVICE_FIELDTYPE_JUMP_EDIT },
- { "com.sun.star.text.TextField.Script", SW_SERVICE_FIELDTYPE_SCRIPT },
- { "com.sun.star.text.TextField.DatabaseNextSet", SW_SERVICE_FIELDTYPE_DATABASE_NEXT_SET },
- { "com.sun.star.text.TextField.DatabaseNumberOfSet", SW_SERVICE_FIELDTYPE_DATABASE_NUM_SET },
- { "com.sun.star.text.TextField.DatabaseSetNumber", SW_SERVICE_FIELDTYPE_DATABASE_SET_NUM },
- { "com.sun.star.text.TextField.Database", SW_SERVICE_FIELDTYPE_DATABASE },
- { "com.sun.star.text.TextField.DatabaseName", SW_SERVICE_FIELDTYPE_DATABASE_NAME },
- { "com.sun.star.text.TextField.TableFormula", SW_SERVICE_FIELDTYPE_TABLE_FORMULA },
- { "com.sun.star.text.TextField.PageCount", SW_SERVICE_FIELDTYPE_PAGE_COUNT },
- { "com.sun.star.text.TextField.ParagraphCount", SW_SERVICE_FIELDTYPE_PARAGRAPH_COUNT },
- { "com.sun.star.text.TextField.WordCount", SW_SERVICE_FIELDTYPE_WORD_COUNT },
- { "com.sun.star.text.TextField.CharacterCount", SW_SERVICE_FIELDTYPE_CHARACTER_COUNT },
- { "com.sun.star.text.TextField.TableCount", SW_SERVICE_FIELDTYPE_TABLE_COUNT },
- { "com.sun.star.text.TextField.GraphicObjectCount", SW_SERVICE_FIELDTYPE_GRAPHIC_OBJECT_COUNT },
- { "com.sun.star.text.TextField.EmbeddedObjectCount", SW_SERVICE_FIELDTYPE_EMBEDDED_OBJECT_COUNT },
- { "com.sun.star.text.TextField.DocInfo.ChangeAuthor", SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_AUTHOR },
- { "com.sun.star.text.TextField.DocInfo.ChangeDateTime", SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_DATE_TIME },
- { "com.sun.star.text.TextField.DocInfo.EditTime", SW_SERVICE_FIELDTYPE_DOCINFO_EDIT_TIME },
- { "com.sun.star.text.TextField.DocInfo.Description", SW_SERVICE_FIELDTYPE_DOCINFO_DESCRIPTION },
- { "com.sun.star.text.TextField.DocInfo.CreateAuthor", SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_AUTHOR },
- { "com.sun.star.text.TextField.DocInfo.CreateDateTime", SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_DATE_TIME },
- { "", SW_SERVICE_FIELDTYPE_DUMMY_0 },
- { "", SW_SERVICE_FIELDTYPE_DUMMY_1 },
- { "", SW_SERVICE_FIELDTYPE_DUMMY_2 },
- { "", SW_SERVICE_FIELDTYPE_DUMMY_3 },
- { "com.sun.star.text.TextField.DocInfo.Custom", SW_SERVICE_FIELDTYPE_DOCINFO_CUSTOM },
- { "com.sun.star.text.TextField.DocInfo.PrintAuthor", SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_AUTHOR },
- { "com.sun.star.text.TextField.DocInfo.PrintDateTime", SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_DATE_TIME },
- { "com.sun.star.text.TextField.DocInfo.KeyWords", SW_SERVICE_FIELDTYPE_DOCINFO_KEY_WORDS },
- { "com.sun.star.text.TextField.DocInfo.Subject", SW_SERVICE_FIELDTYPE_DOCINFO_SUBJECT },
- { "com.sun.star.text.TextField.DocInfo.Title", SW_SERVICE_FIELDTYPE_DOCINFO_TITLE },
- { "com.sun.star.text.TextField.DocInfo.Revision", SW_SERVICE_FIELDTYPE_DOCINFO_REVISION },
- { "com.sun.star.text.TextField.Bibliography", SW_SERVICE_FIELDTYPE_BIBLIOGRAPHY },
- { "com.sun.star.text.TextField.CombinedCharacters", SW_SERVICE_FIELDTYPE_COMBINED_CHARACTERS },
- { "com.sun.star.text.TextField.DropDown", SW_SERVICE_FIELDTYPE_DROPDOWN },
- { "com.sun.star.text.textfield.MetadataField", SW_SERVICE_FIELDTYPE_METAFIELD },
- { "", SW_SERVICE_FIELDTYPE_DUMMY_4 },
- { "", SW_SERVICE_FIELDTYPE_DUMMY_5 },
- { "", SW_SERVICE_FIELDTYPE_DUMMY_6 },
- { "", SW_SERVICE_FIELDTYPE_DUMMY_7 },
- { "com.sun.star.text.FieldMaster.User", SW_SERVICE_FIELDMASTER_USER },
- { "com.sun.star.text.FieldMaster.DDE", SW_SERVICE_FIELDMASTER_DDE },
- { "com.sun.star.text.FieldMaster.SetExpression", SW_SERVICE_FIELDMASTER_SET_EXP },
- { "com.sun.star.text.FieldMaster.Database", SW_SERVICE_FIELDMASTER_DATABASE },
- { "com.sun.star.text.FieldMaster.Bibliography", SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY },
- { "", SW_SERVICE_FIELDMASTER_DUMMY2 },
- { "", SW_SERVICE_FIELDMASTER_DUMMY3 },
- { "", SW_SERVICE_FIELDMASTER_DUMMY4 },
- { "", SW_SERVICE_FIELDMASTER_DUMMY5 },
- { "com.sun.star.text.IllustrationsIndex", SW_SERVICE_INDEX_ILLUSTRATIONS },
- { "com.sun.star.text.ObjectIndex", SW_SERVICE_INDEX_OBJECTS },
- { "com.sun.star.text.TableIndex", SW_SERVICE_INDEX_TABLES },
- { "com.sun.star.text.Bibliography", SW_SERVICE_INDEX_BIBLIOGRAPHY },
- { "com.sun.star.text.Paragraph", SW_SERVICE_PARAGRAPH },
- { "com.sun.star.text.TextField.InputUser", SW_SERVICE_FIELDTYPE_INPUT_USER },
- { "com.sun.star.text.TextField.HiddenText", SW_SERVICE_FIELDTYPE_HIDDEN_TEXT },
- { "com.sun.star.style.ConditionalParagraphStyle", SW_SERVICE_STYLE_CONDITIONAL_PARAGRAPH_STYLE },
- { "com.sun.star.text.NumberingRules", SW_SERVICE_NUMBERING_RULES },
- { "com.sun.star.text.TextColumns", SW_SERVICE_TEXT_COLUMNS },
- { "com.sun.star.text.IndexHeaderSection", SW_SERVICE_INDEX_HEADER_SECTION },
- { "com.sun.star.text.Defaults", SW_SERVICE_DEFAULTS },
- { "com.sun.star.image.ImageMapRectangleObject", SW_SERVICE_IMAP_RECTANGLE },
- { "com.sun.star.image.ImageMapCircleObject", SW_SERVICE_IMAP_CIRCLE },
- { "com.sun.star.image.ImageMapPolygonObject", SW_SERVICE_IMAP_POLYGON },
- { "com.sun.star.text.TextGraphicObject", SW_SERVICE_TYPE_TEXT_GRAPHIC },
- { "com.sun.star.chart2.data.DataProvider", SW_SERVICE_CHART2_DATA_PROVIDER },
- { "com.sun.star.text.Fieldmark", SW_SERVICE_TYPE_FIELDMARK },
- { "com.sun.star.text.FormFieldmark", SW_SERVICE_TYPE_FORMFIELDMARK },
- { "com.sun.star.text.InContentMetadata", SW_SERVICE_TYPE_META },
- { "ooo.vba.VBAObjectModuleObjectProvider", SW_SERVICE_VBAOBJECTPROVIDER },
- { "ooo.vba.VBACodeNameProvider", SW_SERVICE_VBACODENAMEPROVIDER },
- { "ooo.vba.VBAProjectNameProvider", SW_SERVICE_VBAPROJECTNAMEPROVIDER },
- { "ooo.vba.VBAGlobals", SW_SERVICE_VBAGLOBALS },
+ { "com.sun.star.text.TextTable", SwServiceType::TypeTextTable },
+ { "com.sun.star.text.TextFrame", SwServiceType::TypeTextFrame },
+ { "com.sun.star.text.GraphicObject", SwServiceType::TypeGraphic },
+ { "com.sun.star.text.TextEmbeddedObject", SwServiceType::TypeOLE },
+ { "com.sun.star.text.Bookmark", SwServiceType::TypeBookmark },
+ { "com.sun.star.text.Footnote", SwServiceType::TypeFootnote },
+ { "com.sun.star.text.Endnote", SwServiceType::TypeEndnote },
+ { "com.sun.star.text.DocumentIndexMark", SwServiceType::TypeIndexMark },
+ { "com.sun.star.text.DocumentIndex", SwServiceType::TypeIndex },
+ { "com.sun.star.text.ReferenceMark", SwServiceType::ReferenceMark },
+ { "com.sun.star.style.CharacterStyle", SwServiceType::StyleCharacter },
+ { "com.sun.star.style.ParagraphStyle", SwServiceType::StyleParagraph },
+ { "com.sun.star.style.FrameStyle", SwServiceType::StyleFrame },
+ { "com.sun.star.style.PageStyle", SwServiceType::StylePage },
+ { "com.sun.star.style.NumberingStyle", SwServiceType::StyleNumbering },
+ { "com.sun.star.text.ContentIndexMark", SwServiceType::ContentIndexMark },
+ { "com.sun.star.text.ContentIndex", SwServiceType::ContentIndex },
+ { "com.sun.star.text.UserIndexMark", SwServiceType::UserIndexMark },
+ { "com.sun.star.text.UserIndex", SwServiceType::UserIndex },
+ { "com.sun.star.text.TextSection", SwServiceType::TextSection },
+ { "com.sun.star.text.TextField.DateTime", SwServiceType::FieldTypeDateTime },
+ { "com.sun.star.text.TextField.User", SwServiceType::FieldTypeUser },
+ { "com.sun.star.text.TextField.SetExpression", SwServiceType::FieldTypeSetExp },
+ { "com.sun.star.text.TextField.GetExpression", SwServiceType::FieldTypeGetExp },
+ { "com.sun.star.text.TextField.FileName", SwServiceType::FieldTypeFileName },
+ { "com.sun.star.text.TextField.PageNumber", SwServiceType::FieldTypePageNum },
+ { "com.sun.star.text.TextField.Author", SwServiceType::FieldTypeAuthor },
+ { "com.sun.star.text.TextField.Chapter", SwServiceType::FieldTypeChapter },
+ { "", SwServiceType::FieldTypeDummy0 },
+ { "com.sun.star.text.TextField.GetReference", SwServiceType::FieldTypeGetReference },
+ { "com.sun.star.text.TextField.ConditionalText", SwServiceType::FieldTypeConditionedText },
+ { "com.sun.star.text.TextField.Annotation", SwServiceType::FieldTypeAnnotation },
+ { "com.sun.star.text.TextField.Input", SwServiceType::FieldTypeInput },
+ { "com.sun.star.text.TextField.Macro", SwServiceType::FieldTypeMacro },
+ { "com.sun.star.text.TextField.DDE", SwServiceType::FieldTypeDDE },
+ { "com.sun.star.text.TextField.HiddenParagraph", SwServiceType::FieldTypeHiddenPara },
+ { "" /*com.sun.star.text.TextField.DocumentInfo"*/, SwServiceType::FieldTypeDocInfo },
+ { "com.sun.star.text.TextField.TemplateName", SwServiceType::FieldTypeTemplateName },
+ { "com.sun.star.text.TextField.ExtendedUser", SwServiceType::FieldTypeUserExt },
+ { "com.sun.star.text.TextField.ReferencePageSet", SwServiceType::FieldTypeRefPageSet },
+ { "com.sun.star.text.TextField.ReferencePageGet", SwServiceType::FieldTypeRefPageGet },
+ { "com.sun.star.text.TextField.JumpEdit", SwServiceType::FieldTypeJumpEdit },
+ { "com.sun.star.text.TextField.Script", SwServiceType::FieldTypeScript },
+ { "com.sun.star.text.TextField.DatabaseNextSet", SwServiceType::FieldTypeDatabaseNextSet },
+ { "com.sun.star.text.TextField.DatabaseNumberOfSet", SwServiceType::FieldTypeDatabaseNumSet },
+ { "com.sun.star.text.TextField.DatabaseSetNumber", SwServiceType::FieldTypeDatabaseSetNum },
+ { "com.sun.star.text.TextField.Database", SwServiceType::FieldTypeDatabase },
+ { "com.sun.star.text.TextField.DatabaseName", SwServiceType::FieldTypeDatabaseName },
+ { "com.sun.star.text.TextField.TableFormula", SwServiceType::FieldTypeTableFormula },
+ { "com.sun.star.text.TextField.PageCount", SwServiceType::FieldTypePageCount },
+ { "com.sun.star.text.TextField.ParagraphCount", SwServiceType::FieldTypeParagraphCount },
+ { "com.sun.star.text.TextField.WordCount", SwServiceType::FieldTypeWordCount },
+ { "com.sun.star.text.TextField.CharacterCount", SwServiceType::FieldTypeCharacterCount },
+ { "com.sun.star.text.TextField.TableCount", SwServiceType::FieldTypeTableCount },
+ { "com.sun.star.text.TextField.GraphicObjectCount", SwServiceType::FieldTypeGraphicObjectCount },
+ { "com.sun.star.text.TextField.EmbeddedObjectCount", SwServiceType::FieldTypeEmbeddedObjectCount },
+ { "com.sun.star.text.TextField.DocInfo.ChangeAuthor", SwServiceType::FieldTypeDocInfoChangeAuthor },
+ { "com.sun.star.text.TextField.DocInfo.ChangeDateTime", SwServiceType::FieldTypeDocInfoChangeDateTime },
+ { "com.sun.star.text.TextField.DocInfo.EditTime", SwServiceType::FieldTypeDocInfoEditTime },
+ { "com.sun.star.text.TextField.DocInfo.Description", SwServiceType::FieldTypeDocInfoDescription },
+ { "com.sun.star.text.TextField.DocInfo.CreateAuthor", SwServiceType::FieldTypeDocInfoCreateAuthor },
+ { "com.sun.star.text.TextField.DocInfo.CreateDateTime", SwServiceType::FieldTypeDocInfoCreateDateTime },
+ { "", SwServiceType::FieldTypeDummy0 },
+ { "", SwServiceType::FieldTypeDummy1 },
+ { "", SwServiceType::FieldTypeDummy2 },
+ { "", SwServiceType::FieldTypeDummy3 },
+ { "com.sun.star.text.TextField.DocInfo.Custom", SwServiceType::FieldTypeDocInfoCustom },
+ { "com.sun.star.text.TextField.DocInfo.PrintAuthor", SwServiceType::FieldTypeDocInfoPrintAuthor },
+ { "com.sun.star.text.TextField.DocInfo.PrintDateTime", SwServiceType::FieldTypeDocInfoPrintDateTime },
+ { "com.sun.star.text.TextField.DocInfo.KeyWords", SwServiceType::FieldTypeDocInfoKeywords },
+ { "com.sun.star.text.TextField.DocInfo.Subject", SwServiceType::FieldTypeDocInfoSubject },
+ { "com.sun.star.text.TextField.DocInfo.Title", SwServiceType::FieldTypeDocInfoTitle },
+ { "com.sun.star.text.TextField.DocInfo.Revision", SwServiceType::FieldTypeDocInfoRevision },
+ { "com.sun.star.text.TextField.Bibliography", SwServiceType::FieldTypeBibliography },
+ { "com.sun.star.text.TextField.CombinedCharacters", SwServiceType::FieldTypeCombinedCharacters },
+ { "com.sun.star.text.TextField.DropDown", SwServiceType::FieldTypeDropdown },
+ { "com.sun.star.text.textfield.MetadataField", SwServiceType::FieldTypeMetafield },
+ { "", SwServiceType::FieldTypeDummy4 },
+ { "", SwServiceType::FieldTypeDummy5 },
+ { "", SwServiceType::FieldTypeDummy6 },
+ { "", SwServiceType::FieldTypeDummy7 },
+ { "com.sun.star.text.FieldMaster.User", SwServiceType::FieldMasterUser },
+ { "com.sun.star.text.FieldMaster.DDE", SwServiceType::FieldMasterDDE },
+ { "com.sun.star.text.FieldMaster.SetExpression", SwServiceType::FieldMasterSetExp },
+ { "com.sun.star.text.FieldMaster.Database", SwServiceType::FieldMasterDatabase },
+ { "com.sun.star.text.FieldMaster.Bibliography", SwServiceType::FieldMasterBibliography },
+ { "", SwServiceType::FieldMasterDummy2 },
+ { "", SwServiceType::FieldMasterDummy3 },
+ { "", SwServiceType::FieldMasterDummy4 },
+ { "", SwServiceType::FieldMasterDummy5 },
+ { "com.sun.star.text.IllustrationsIndex", SwServiceType::IndexIllustrations },
+ { "com.sun.star.text.ObjectIndex", SwServiceType::IndexObjects },
+ { "com.sun.star.text.TableIndex", SwServiceType::IndexTables },
+ { "com.sun.star.text.Bibliography", SwServiceType::IndexBibliography },
+ { "com.sun.star.text.Paragraph", SwServiceType::Paragraph },
+ { "com.sun.star.text.TextField.InputUser", SwServiceType::FieldTypeInputUser },
+ { "com.sun.star.text.TextField.HiddenText", SwServiceType::FieldTypeHiddenText },
+ { "com.sun.star.style.ConditionalParagraphStyle", SwServiceType::StyleConditionalParagraph },
+ { "com.sun.star.text.NumberingRules", SwServiceType::NumberingRules },
+ { "com.sun.star.text.TextColumns", SwServiceType::TextColumns },
+ { "com.sun.star.text.IndexHeaderSection", SwServiceType::IndexHeaderSection },
+ { "com.sun.star.text.Defaults", SwServiceType::Defaults },
+ { "com.sun.star.image.ImageMapRectangleObject", SwServiceType::IMapRectangle },
+ { "com.sun.star.image.ImageMapCircleObject", SwServiceType::IMapCircle },
+ { "com.sun.star.image.ImageMapPolygonObject", SwServiceType::IMapPolygon },
+ { "com.sun.star.text.TextGraphicObject", SwServiceType::TypeTextGraphic },
+ { "com.sun.star.chart2.data.DataProvider", SwServiceType::Chart2DataProvider },
+ { "com.sun.star.text.Fieldmark", SwServiceType::TypeFieldMark },
+ { "com.sun.star.text.FormFieldmark", SwServiceType::TypeFormFieldMark },
+ { "com.sun.star.text.InContentMetadata", SwServiceType::TypeMeta },
+ { "ooo.vba.VBAObjectModuleObjectProvider", SwServiceType::VbaObjectProvider },
+ { "ooo.vba.VBACodeNameProvider", SwServiceType::VbaCodeNameProvider },
+ { "ooo.vba.VBAProjectNameProvider", SwServiceType::VbaProjectNameProvider },
+ { "ooo.vba.VBAGlobals", SwServiceType::VbaGlobals },
// case-correct versions of the service names (see #i67811)
- { CSS_TEXT_TEXTFIELD_DATE_TIME, SW_SERVICE_FIELDTYPE_DATETIME },
- { CSS_TEXT_TEXTFIELD_USER, SW_SERVICE_FIELDTYPE_USER },
- { CSS_TEXT_TEXTFIELD_SET_EXPRESSION, SW_SERVICE_FIELDTYPE_SET_EXP },
- { CSS_TEXT_TEXTFIELD_GET_EXPRESSION, SW_SERVICE_FIELDTYPE_GET_EXP },
- { CSS_TEXT_TEXTFIELD_FILE_NAME, SW_SERVICE_FIELDTYPE_FILE_NAME },
- { CSS_TEXT_TEXTFIELD_PAGE_NUMBER, SW_SERVICE_FIELDTYPE_PAGE_NUM },
- { CSS_TEXT_TEXTFIELD_AUTHOR, SW_SERVICE_FIELDTYPE_AUTHOR },
- { CSS_TEXT_TEXTFIELD_CHAPTER, SW_SERVICE_FIELDTYPE_CHAPTER },
- { CSS_TEXT_TEXTFIELD_GET_REFERENCE, SW_SERVICE_FIELDTYPE_GET_REFERENCE },
- { CSS_TEXT_TEXTFIELD_CONDITIONAL_TEXT, SW_SERVICE_FIELDTYPE_CONDITIONED_TEXT },
- { CSS_TEXT_TEXTFIELD_ANNOTATION, SW_SERVICE_FIELDTYPE_ANNOTATION },
- { CSS_TEXT_TEXTFIELD_INPUT, SW_SERVICE_FIELDTYPE_INPUT },
- { CSS_TEXT_TEXTFIELD_MACRO, SW_SERVICE_FIELDTYPE_MACRO },
- { CSS_TEXT_TEXTFIELD_DDE, SW_SERVICE_FIELDTYPE_DDE },
- { CSS_TEXT_TEXTFIELD_HIDDEN_PARAGRAPH, SW_SERVICE_FIELDTYPE_HIDDEN_PARA },
- { CSS_TEXT_TEXTFIELD_TEMPLATE_NAME, SW_SERVICE_FIELDTYPE_TEMPLATE_NAME },
- { CSS_TEXT_TEXTFIELD_EXTENDED_USER, SW_SERVICE_FIELDTYPE_USER_EXT },
- { CSS_TEXT_TEXTFIELD_REFERENCE_PAGE_SET, SW_SERVICE_FIELDTYPE_REF_PAGE_SET },
- { CSS_TEXT_TEXTFIELD_REFERENCE_PAGE_GET, SW_SERVICE_FIELDTYPE_REF_PAGE_GET },
- { CSS_TEXT_TEXTFIELD_JUMP_EDIT, SW_SERVICE_FIELDTYPE_JUMP_EDIT },
- { CSS_TEXT_TEXTFIELD_SCRIPT, SW_SERVICE_FIELDTYPE_SCRIPT },
- { CSS_TEXT_TEXTFIELD_DATABASE_NEXT_SET, SW_SERVICE_FIELDTYPE_DATABASE_NEXT_SET },
- { CSS_TEXT_TEXTFIELD_DATABASE_NUMBER_OF_SET, SW_SERVICE_FIELDTYPE_DATABASE_NUM_SET },
- { CSS_TEXT_TEXTFIELD_DATABASE_SET_NUMBER, SW_SERVICE_FIELDTYPE_DATABASE_SET_NUM },
- { CSS_TEXT_TEXTFIELD_DATABASE, SW_SERVICE_FIELDTYPE_DATABASE },
- { CSS_TEXT_TEXTFIELD_DATABASE_NAME, SW_SERVICE_FIELDTYPE_DATABASE_NAME },
- { CSS_TEXT_TEXTFIELD_TABLE_FORMULA, SW_SERVICE_FIELDTYPE_TABLE_FORMULA },
- { CSS_TEXT_TEXTFIELD_PAGE_COUNT, SW_SERVICE_FIELDTYPE_PAGE_COUNT },
- { CSS_TEXT_TEXTFIELD_PARAGRAPH_COUNT, SW_SERVICE_FIELDTYPE_PARAGRAPH_COUNT },
- { CSS_TEXT_TEXTFIELD_WORD_COUNT, SW_SERVICE_FIELDTYPE_WORD_COUNT },
- { CSS_TEXT_TEXTFIELD_CHARACTER_COUNT, SW_SERVICE_FIELDTYPE_CHARACTER_COUNT },
- { CSS_TEXT_TEXTFIELD_TABLE_COUNT, SW_SERVICE_FIELDTYPE_TABLE_COUNT },
- { CSS_TEXT_TEXTFIELD_GRAPHIC_OBJECT_COUNT, SW_SERVICE_FIELDTYPE_GRAPHIC_OBJECT_COUNT },
- { CSS_TEXT_TEXTFIELD_EMBEDDED_OBJECT_COUNT, SW_SERVICE_FIELDTYPE_EMBEDDED_OBJECT_COUNT },
- { CSS_TEXT_TEXTFIELD_DOCINFO_CHANGE_AUTHOR, SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_AUTHOR },
- { CSS_TEXT_TEXTFIELD_DOCINFO_CHANGE_DATE_TIME, SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_DATE_TIME },
- { CSS_TEXT_TEXTFIELD_DOCINFO_EDIT_TIME, SW_SERVICE_FIELDTYPE_DOCINFO_EDIT_TIME },
- { CSS_TEXT_TEXTFIELD_DOCINFO_DESCRIPTION, SW_SERVICE_FIELDTYPE_DOCINFO_DESCRIPTION },
- { CSS_TEXT_TEXTFIELD_DOCINFO_CREATE_AUTHOR, SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_AUTHOR },
- { CSS_TEXT_TEXTFIELD_DOCINFO_CREATE_DATE_TIME, SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_DATE_TIME },
- { CSS_TEXT_TEXTFIELD_DOCINFO_PRINT_AUTHOR, SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_AUTHOR },
- { CSS_TEXT_TEXTFIELD_DOCINFO_PRINT_DATE_TIME, SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_DATE_TIME },
- { CSS_TEXT_TEXTFIELD_DOCINFO_KEY_WORDS, SW_SERVICE_FIELDTYPE_DOCINFO_KEY_WORDS },
- { CSS_TEXT_TEXTFIELD_DOCINFO_SUBJECT, SW_SERVICE_FIELDTYPE_DOCINFO_SUBJECT },
- { CSS_TEXT_TEXTFIELD_DOCINFO_TITLE, SW_SERVICE_FIELDTYPE_DOCINFO_TITLE },
- { CSS_TEXT_TEXTFIELD_DOCINFO_REVISION, SW_SERVICE_FIELDTYPE_DOCINFO_REVISION },
- { CSS_TEXT_TEXTFIELD_DOCINFO_CUSTOM, SW_SERVICE_FIELDTYPE_DOCINFO_CUSTOM },
- { CSS_TEXT_TEXTFIELD_BIBLIOGRAPHY, SW_SERVICE_FIELDTYPE_BIBLIOGRAPHY },
- { CSS_TEXT_TEXTFIELD_COMBINED_CHARACTERS, SW_SERVICE_FIELDTYPE_COMBINED_CHARACTERS },
- { CSS_TEXT_TEXTFIELD_DROP_DOWN, SW_SERVICE_FIELDTYPE_DROPDOWN },
- { CSS_TEXT_TEXTFIELD_INPUT_USER, SW_SERVICE_FIELDTYPE_INPUT_USER },
- { CSS_TEXT_TEXTFIELD_HIDDEN_TEXT, SW_SERVICE_FIELDTYPE_HIDDEN_TEXT },
- { CSS_TEXT_FIELDMASTER_USER, SW_SERVICE_FIELDMASTER_USER },
- { CSS_TEXT_FIELDMASTER_DDE, SW_SERVICE_FIELDMASTER_DDE },
- { CSS_TEXT_FIELDMASTER_SET_EXPRESSION, SW_SERVICE_FIELDMASTER_SET_EXP },
- { CSS_TEXT_FIELDMASTER_DATABASE, SW_SERVICE_FIELDMASTER_DATABASE },
- { CSS_TEXT_FIELDMASTER_BIBLIOGRAPHY, SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY },
- { "com.sun.star.style.TableStyle", SW_SERVICE_STYLE_TABLE_STYLE },
- { "com.sun.star.style.CellStyle", SW_SERVICE_STYLE_CELL_STYLE }
+ { CSS_TEXT_TEXTFIELD_DATE_TIME, SwServiceType::FieldTypeDateTime },
+ { CSS_TEXT_TEXTFIELD_USER, SwServiceType::FieldTypeUser },
+ { CSS_TEXT_TEXTFIELD_SET_EXPRESSION, SwServiceType::FieldTypeSetExp },
+ { CSS_TEXT_TEXTFIELD_GET_EXPRESSION, SwServiceType::FieldTypeGetExp },
+ { CSS_TEXT_TEXTFIELD_FILE_NAME, SwServiceType::FieldTypeFileName },
+ { CSS_TEXT_TEXTFIELD_PAGE_NUMBER, SwServiceType::FieldTypePageNum },
+ { CSS_TEXT_TEXTFIELD_AUTHOR, SwServiceType::FieldTypeAuthor },
+ { CSS_TEXT_TEXTFIELD_CHAPTER, SwServiceType::FieldTypeChapter },
+ { CSS_TEXT_TEXTFIELD_GET_REFERENCE, SwServiceType::FieldTypeGetReference },
+ { CSS_TEXT_TEXTFIELD_CONDITIONAL_TEXT, SwServiceType::FieldTypeConditionedText },
+ { CSS_TEXT_TEXTFIELD_ANNOTATION, SwServiceType::FieldTypeAnnotation },
+ { CSS_TEXT_TEXTFIELD_INPUT, SwServiceType::FieldTypeInput },
+ { CSS_TEXT_TEXTFIELD_MACRO, SwServiceType::FieldTypeMacro },
+ { CSS_TEXT_TEXTFIELD_DDE, SwServiceType::FieldTypeDDE },
+ { CSS_TEXT_TEXTFIELD_HIDDEN_PARAGRAPH, SwServiceType::FieldTypeHiddenPara },
+ { CSS_TEXT_TEXTFIELD_TEMPLATE_NAME, SwServiceType::FieldTypeTemplateName },
+ { CSS_TEXT_TEXTFIELD_EXTENDED_USER, SwServiceType::FieldTypeUserExt },
+ { CSS_TEXT_TEXTFIELD_REFERENCE_PAGE_SET, SwServiceType::FieldTypeRefPageSet },
+ { CSS_TEXT_TEXTFIELD_REFERENCE_PAGE_GET, SwServiceType::FieldTypeRefPageGet },
+ { CSS_TEXT_TEXTFIELD_JUMP_EDIT, SwServiceType::FieldTypeJumpEdit },
+ { CSS_TEXT_TEXTFIELD_SCRIPT, SwServiceType::FieldTypeScript },
+ { CSS_TEXT_TEXTFIELD_DATABASE_NEXT_SET, SwServiceType::FieldTypeDatabaseNextSet },
+ { CSS_TEXT_TEXTFIELD_DATABASE_NUMBER_OF_SET, SwServiceType::FieldTypeDatabaseNumSet },
+ { CSS_TEXT_TEXTFIELD_DATABASE_SET_NUMBER, SwServiceType::FieldTypeDatabaseSetNum },
+ { CSS_TEXT_TEXTFIELD_DATABASE, SwServiceType::FieldTypeDatabase },
+ { CSS_TEXT_TEXTFIELD_DATABASE_NAME, SwServiceType::FieldTypeDatabaseName },
+ { CSS_TEXT_TEXTFIELD_TABLE_FORMULA, SwServiceType::FieldTypeTableFormula },
+ { CSS_TEXT_TEXTFIELD_PAGE_COUNT, SwServiceType::FieldTypePageCount },
+ { CSS_TEXT_TEXTFIELD_PARAGRAPH_COUNT, SwServiceType::FieldTypeParagraphCount },
+ { CSS_TEXT_TEXTFIELD_WORD_COUNT, SwServiceType::FieldTypeWordCount },
+ { CSS_TEXT_TEXTFIELD_CHARACTER_COUNT, SwServiceType::FieldTypeCharacterCount },
+ { CSS_TEXT_TEXTFIELD_TABLE_COUNT, SwServiceType::FieldTypeTableCount },
+ { CSS_TEXT_TEXTFIELD_GRAPHIC_OBJECT_COUNT, SwServiceType::FieldTypeGraphicObjectCount },
+ { CSS_TEXT_TEXTFIELD_EMBEDDED_OBJECT_COUNT, SwServiceType::FieldTypeEmbeddedObjectCount },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_CHANGE_AUTHOR, SwServiceType::FieldTypeDocInfoChangeAuthor },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_CHANGE_DATE_TIME, SwServiceType::FieldTypeDocInfoChangeDateTime },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_EDIT_TIME, SwServiceType::FieldTypeDocInfoEditTime },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_DESCRIPTION, SwServiceType::FieldTypeDocInfoDescription },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_CREATE_AUTHOR, SwServiceType::FieldTypeDocInfoCreateAuthor },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_CREATE_DATE_TIME, SwServiceType::FieldTypeDocInfoCreateDateTime },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_PRINT_AUTHOR, SwServiceType::FieldTypeDocInfoPrintAuthor },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_PRINT_DATE_TIME, SwServiceType::FieldTypeDocInfoPrintDateTime },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_KEY_WORDS, SwServiceType::FieldTypeDocInfoKeywords },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_SUBJECT, SwServiceType::FieldTypeDocInfoSubject },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_TITLE, SwServiceType::FieldTypeDocInfoTitle },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_REVISION, SwServiceType::FieldTypeDocInfoRevision },
+ { CSS_TEXT_TEXTFIELD_DOCINFO_CUSTOM, SwServiceType::FieldTypeDocInfoCustom },
+ { CSS_TEXT_TEXTFIELD_BIBLIOGRAPHY, SwServiceType::FieldTypeBibliography },
+ { CSS_TEXT_TEXTFIELD_COMBINED_CHARACTERS, SwServiceType::FieldTypeCombinedCharacters },
+ { CSS_TEXT_TEXTFIELD_DROP_DOWN, SwServiceType::FieldTypeDropdown },
+ { CSS_TEXT_TEXTFIELD_INPUT_USER, SwServiceType::FieldTypeInputUser },
+ { CSS_TEXT_TEXTFIELD_HIDDEN_TEXT, SwServiceType::FieldTypeHiddenText },
+ { CSS_TEXT_FIELDMASTER_USER, SwServiceType::FieldMasterUser },
+ { CSS_TEXT_FIELDMASTER_DDE, SwServiceType::FieldMasterDDE },
+ { CSS_TEXT_FIELDMASTER_SET_EXPRESSION, SwServiceType::FieldMasterSetExp },
+ { CSS_TEXT_FIELDMASTER_DATABASE, SwServiceType::FieldMasterDatabase },
+ { CSS_TEXT_FIELDMASTER_BIBLIOGRAPHY, SwServiceType::FieldMasterBibliography },
+ { "com.sun.star.style.TableStyle", SwServiceType::StyleTable },
+ { "com.sun.star.style.CellStyle", SwServiceType::StyleCell }
};
const SvEventDescription* sw_GetSupportedMacroItems()
@@ -471,13 +471,13 @@ const SvEventDescription* sw_GetSupportedMacroItems()
return aMacroDescriptionsImpl;
}
-OUString SwXServiceProvider::GetProviderName(sal_uInt16 nObjectType)
+OUString SwXServiceProvider::GetProviderName(SwServiceType nObjectType)
{
SolarMutexGuard aGuard;
OUString sRet;
const sal_uInt16 nEntries = SAL_N_ELEMENTS(aProvNamesId);
- if(nObjectType < nEntries)
- sRet = OUString::createFromAscii(aProvNamesId[nObjectType].pName);
+ if((sal_uInt16)nObjectType < nEntries)
+ sRet = OUString::createFromAscii(aProvNamesId[(sal_uInt16)nObjectType].pName);
return sRet;
}
@@ -501,61 +501,61 @@ uno::Sequence<OUString> SwXServiceProvider::GetAllServiceNames()
}
-sal_uInt16 SwXServiceProvider::GetProviderType(const OUString& rServiceName)
+SwServiceType SwXServiceProvider::GetProviderType(const OUString& rServiceName)
{
for(const ProvNamesId_Type & i : aProvNamesId)
{
if (rServiceName.equalsAscii(i.pName))
return i.nType;
}
- return SW_SERVICE_INVALID;
+ return SwServiceType::Invalid;
}
uno::Reference<uno::XInterface>
-SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
+SwXServiceProvider::MakeInstance(SwServiceType nObjectType, SwDoc & rDoc)
{
SolarMutexGuard aGuard;
uno::Reference< uno::XInterface > xRet;
switch(nObjectType)
{
- case SW_SERVICE_TYPE_TEXTTABLE:
+ case SwServiceType::TypeTextTable:
{
xRet = SwXTextTable::CreateXTextTable(nullptr);
}
break;
- case SW_SERVICE_TYPE_TEXTFRAME:
+ case SwServiceType::TypeTextFrame:
{
xRet = SwXTextFrame::CreateXTextFrame(rDoc, nullptr);
}
break;
- case SW_SERVICE_TYPE_GRAPHIC :
- case SW_SERVICE_TYPE_TEXT_GRAPHIC /* #i47503# */ :
+ case SwServiceType::TypeGraphic :
+ case SwServiceType::TypeTextGraphic /* #i47503# */ :
{
xRet = SwXTextGraphicObject::CreateXTextGraphicObject(rDoc, nullptr);
}
break;
- case SW_SERVICE_TYPE_OLE :
+ case SwServiceType::TypeOLE :
{
xRet = SwXTextEmbeddedObject::CreateXTextEmbeddedObject(rDoc, nullptr);
}
break;
- case SW_SERVICE_TYPE_BOOKMARK :
+ case SwServiceType::TypeBookmark :
{
xRet = SwXBookmark::CreateXBookmark(rDoc, nullptr);
}
break;
- case SW_SERVICE_TYPE_FIELDMARK :
+ case SwServiceType::TypeFieldMark :
{
xRet = SwXFieldmark::CreateXFieldmark(rDoc, nullptr);
}
break;
- case SW_SERVICE_TYPE_FORMFIELDMARK :
+ case SwServiceType::TypeFormFieldMark :
{
xRet = SwXFieldmark::CreateXFieldmark(rDoc, nullptr, true);
}
break;
- case SW_SERVICE_VBAOBJECTPROVIDER :
+ case SwServiceType::VbaObjectProvider :
#if HAVE_FEATURE_SCRIPTING
{
SwVbaObjectForCodeNameProvider* pObjProv =
@@ -564,7 +564,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
}
#endif
break;
- case SW_SERVICE_VBACODENAMEPROVIDER :
+ case SwServiceType::VbaCodeNameProvider :
#if HAVE_FEATURE_SCRIPTING
{
if (rDoc.GetDocShell() && ooo::vba::isAlienWordDoc(*rDoc.GetDocShell()))
@@ -575,7 +575,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
}
#endif
break;
- case SW_SERVICE_VBAPROJECTNAMEPROVIDER :
+ case SwServiceType::VbaProjectNameProvider :
#if HAVE_FEATURE_SCRIPTING
{
uno::Reference< container::XNameContainer > xProjProv = rDoc.GetVBATemplateToProjectCache();
@@ -589,7 +589,7 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
}
#endif
break;
- case SW_SERVICE_VBAGLOBALS :
+ case SwServiceType::VbaGlobals :
#if HAVE_FEATURE_SCRIPTING
{
uno::Any aGlobs;
@@ -606,179 +606,181 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
#endif
break;
- case SW_SERVICE_TYPE_FOOTNOTE :
+ case SwServiceType::TypeFootnote :
xRet = SwXFootnote::CreateXFootnote(rDoc, nullptr);
break;
- case SW_SERVICE_TYPE_ENDNOTE :
+ case SwServiceType::TypeEndnote :
xRet = SwXFootnote::CreateXFootnote(rDoc, nullptr, true);
break;
- case SW_SERVICE_CONTENT_INDEX_MARK :
- case SW_SERVICE_USER_INDEX_MARK :
- case SW_SERVICE_TYPE_INDEXMARK:
+ case SwServiceType::ContentIndexMark :
+ case SwServiceType::UserIndexMark :
+ case SwServiceType::TypeIndexMark:
{
TOXTypes eType = TOX_INDEX;
- if(SW_SERVICE_CONTENT_INDEX_MARK== nObjectType)
+ if(SwServiceType::ContentIndexMark== nObjectType)
eType = TOX_CONTENT;
- else if(SW_SERVICE_USER_INDEX_MARK == nObjectType)
+ else if(SwServiceType::UserIndexMark == nObjectType)
eType = TOX_USER;
xRet = SwXDocumentIndexMark::CreateXDocumentIndexMark(rDoc, nullptr, eType);
}
break;
- case SW_SERVICE_CONTENT_INDEX :
- case SW_SERVICE_USER_INDEX :
- case SW_SERVICE_TYPE_INDEX :
- case SW_SERVICE_INDEX_ILLUSTRATIONS:
- case SW_SERVICE_INDEX_OBJECTS :
- case SW_SERVICE_INDEX_TABLES:
- case SW_SERVICE_INDEX_BIBLIOGRAPHY :
+ case SwServiceType::ContentIndex :
+ case SwServiceType::UserIndex :
+ case SwServiceType::TypeIndex :
+ case SwServiceType::IndexIllustrations:
+ case SwServiceType::IndexObjects :
+ case SwServiceType::IndexTables:
+ case SwServiceType::IndexBibliography :
{
TOXTypes eType = TOX_INDEX;
- if(SW_SERVICE_CONTENT_INDEX == nObjectType)
+ if(SwServiceType::ContentIndex == nObjectType)
eType = TOX_CONTENT;
- else if(SW_SERVICE_USER_INDEX == nObjectType)
+ else if(SwServiceType::UserIndex == nObjectType)
eType = TOX_USER;
- else if(SW_SERVICE_INDEX_ILLUSTRATIONS == nObjectType)
+ else if(SwServiceType::IndexIllustrations == nObjectType)
{
eType = TOX_ILLUSTRATIONS;
}
- else if(SW_SERVICE_INDEX_OBJECTS == nObjectType)
+ else if(SwServiceType::IndexObjects == nObjectType)
{
eType = TOX_OBJECTS;
}
- else if(SW_SERVICE_INDEX_BIBLIOGRAPHY == nObjectType)
+ else if(SwServiceType::IndexBibliography == nObjectType)
{
eType = TOX_AUTHORITIES;
}
- else if(SW_SERVICE_INDEX_TABLES == nObjectType)
+ else if(SwServiceType::IndexTables == nObjectType)
{
eType = TOX_TABLES;
}
xRet = SwXDocumentIndex::CreateXDocumentIndex(rDoc, nullptr, eType);
}
break;
- case SW_SERVICE_INDEX_HEADER_SECTION :
- case SW_SERVICE_TEXT_SECTION :
+ case SwServiceType::IndexHeaderSection :
+ case SwServiceType::TextSection :
xRet = SwXTextSection::CreateXTextSection(nullptr,
- (SW_SERVICE_INDEX_HEADER_SECTION == nObjectType));
+ (SwServiceType::IndexHeaderSection == nObjectType));
break;
- case SW_SERVICE_REFERENCE_MARK :
+ case SwServiceType::ReferenceMark :
xRet = SwXReferenceMark::CreateXReferenceMark(rDoc, nullptr);
break;
- case SW_SERVICE_STYLE_CHARACTER_STYLE:
- case SW_SERVICE_STYLE_PARAGRAPH_STYLE:
- case SW_SERVICE_STYLE_CONDITIONAL_PARAGRAPH_STYLE:
- case SW_SERVICE_STYLE_FRAME_STYLE:
- case SW_SERVICE_STYLE_PAGE_STYLE:
- case SW_SERVICE_STYLE_NUMBERING_STYLE:
- case SW_SERVICE_STYLE_TABLE_STYLE:
- case SW_SERVICE_STYLE_CELL_STYLE:
+ case SwServiceType::StyleCharacter:
+ case SwServiceType::StyleParagraph:
+ case SwServiceType::StyleConditionalParagraph:
+ case SwServiceType::StyleFrame:
+ case SwServiceType::StylePage:
+ case SwServiceType::StyleNumbering:
+ case SwServiceType::StyleTable:
+ case SwServiceType::StyleCell:
{
SfxStyleFamily eFamily = SfxStyleFamily::Char;
switch(nObjectType)
{
- case SW_SERVICE_STYLE_PARAGRAPH_STYLE:
+ case SwServiceType::StyleParagraph:
eFamily = SfxStyleFamily::Para;
break;
- case SW_SERVICE_STYLE_CONDITIONAL_PARAGRAPH_STYLE:
+ case SwServiceType::StyleConditionalParagraph:
eFamily = SfxStyleFamily::Para;
xRet = SwXStyleFamilies::CreateStyleCondParagraph(rDoc);
break;
- case SW_SERVICE_STYLE_FRAME_STYLE:
+ case SwServiceType::StyleFrame:
eFamily = SfxStyleFamily::Frame;
break;
- case SW_SERVICE_STYLE_PAGE_STYLE:
+ case SwServiceType::StylePage:
eFamily = SfxStyleFamily::Page;
break;
- case SW_SERVICE_STYLE_NUMBERING_STYLE:
+ case SwServiceType::StyleNumbering:
eFamily = SfxStyleFamily::Pseudo;
break;
- case SW_SERVICE_STYLE_TABLE_STYLE:
+ case SwServiceType::StyleTable:
eFamily = SfxStyleFamily::Table;
break;
- case SW_SERVICE_STYLE_CELL_STYLE:
+ case SwServiceType::StyleCell:
eFamily = SfxStyleFamily::Cell;
break;
+ default: break;
}
if(!xRet.is())
xRet = SwXStyleFamilies::CreateStyle(eFamily, rDoc);
}
break;
- case SW_SERVICE_FIELDTYPE_DATETIME:
- case SW_SERVICE_FIELDTYPE_USER:
- case SW_SERVICE_FIELDTYPE_SET_EXP:
- case SW_SERVICE_FIELDTYPE_GET_EXP:
- case SW_SERVICE_FIELDTYPE_FILE_NAME:
- case SW_SERVICE_FIELDTYPE_PAGE_NUM:
- case SW_SERVICE_FIELDTYPE_AUTHOR:
- case SW_SERVICE_FIELDTYPE_CHAPTER:
- case SW_SERVICE_FIELDTYPE_GET_REFERENCE:
- case SW_SERVICE_FIELDTYPE_CONDITIONED_TEXT:
- case SW_SERVICE_FIELDTYPE_INPUT:
- case SW_SERVICE_FIELDTYPE_MACRO:
- case SW_SERVICE_FIELDTYPE_DDE:
- case SW_SERVICE_FIELDTYPE_HIDDEN_PARA:
- case SW_SERVICE_FIELDTYPE_DOC_INFO:
- case SW_SERVICE_FIELDTYPE_TEMPLATE_NAME:
- case SW_SERVICE_FIELDTYPE_USER_EXT:
- case SW_SERVICE_FIELDTYPE_REF_PAGE_SET:
- case SW_SERVICE_FIELDTYPE_REF_PAGE_GET:
- case SW_SERVICE_FIELDTYPE_JUMP_EDIT:
- case SW_SERVICE_FIELDTYPE_SCRIPT:
- case SW_SERVICE_FIELDTYPE_DATABASE_NEXT_SET:
- case SW_SERVICE_FIELDTYPE_DATABASE_NUM_SET:
- case SW_SERVICE_FIELDTYPE_DATABASE_SET_NUM:
- case SW_SERVICE_FIELDTYPE_DATABASE:
- case SW_SERVICE_FIELDTYPE_DATABASE_NAME:
- case SW_SERVICE_FIELDTYPE_PAGE_COUNT :
- case SW_SERVICE_FIELDTYPE_PARAGRAPH_COUNT :
- case SW_SERVICE_FIELDTYPE_WORD_COUNT :
- case SW_SERVICE_FIELDTYPE_CHARACTER_COUNT :
- case SW_SERVICE_FIELDTYPE_TABLE_COUNT :
- case SW_SERVICE_FIELDTYPE_GRAPHIC_OBJECT_COUNT :
- case SW_SERVICE_FIELDTYPE_EMBEDDED_OBJECT_COUNT :
- case SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_AUTHOR :
- case SW_SERVICE_FIELDTYPE_DOCINFO_CHANGE_DATE_TIME :
- case SW_SERVICE_FIELDTYPE_DOCINFO_EDIT_TIME :
- case SW_SERVICE_FIELDTYPE_DOCINFO_DESCRIPTION :
- case SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_AUTHOR :
- case SW_SERVICE_FIELDTYPE_DOCINFO_CREATE_DATE_TIME :
- case SW_SERVICE_FIELDTYPE_DOCINFO_CUSTOM :
- case SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_AUTHOR :
- case SW_SERVICE_FIELDTYPE_DOCINFO_PRINT_DATE_TIME :
- case SW_SERVICE_FIELDTYPE_DOCINFO_KEY_WORDS :
- case SW_SERVICE_FIELDTYPE_DOCINFO_SUBJECT :
- case SW_SERVICE_FIELDTYPE_DOCINFO_TITLE :
- case SW_SERVICE_FIELDTYPE_DOCINFO_REVISION :
- case SW_SERVICE_FIELDTYPE_BIBLIOGRAPHY:
- case SW_SERVICE_FIELDTYPE_INPUT_USER :
- case SW_SERVICE_FIELDTYPE_HIDDEN_TEXT :
- case SW_SERVICE_FIELDTYPE_COMBINED_CHARACTERS :
- case SW_SERVICE_FIELDTYPE_DROPDOWN :
- case SW_SERVICE_FIELDTYPE_TABLE_FORMULA:
+ case SwServiceType::FieldTypeDateTime:
+ case SwServiceType::FieldTypeUser:
+ case SwServiceType::FieldTypeSetExp:
+ case SwServiceType::FieldTypeGetExp:
+ case SwServiceType::FieldTypeFileName:
+ case SwServiceType::FieldTypePageNum:
+ case SwServiceType::FieldTypeAuthor:
+ case SwServiceType::FieldTypeChapter:
+ case SwServiceType::FieldTypeGetReference:
+ case SwServiceType::FieldTypeConditionedText:
+ case SwServiceType::FieldTypeInput:
+ case SwServiceType::FieldTypeMacro:
+ case SwServiceType::FieldTypeDDE:
+ case SwServiceType::FieldTypeHiddenPara:
+ case SwServiceType::FieldTypeDocInfo:
+ case SwServiceType::FieldTypeTemplateName:
+ case SwServiceType::FieldTypeUserExt:
+ case SwServiceType::FieldTypeRefPageSet:
+ case SwServiceType::FieldTypeRefPageGet:
+ case SwServiceType::FieldTypeJumpEdit:
+ case SwServiceType::FieldTypeScript:
+ case SwServiceType::FieldTypeDatabaseNextSet:
+ case SwServiceType::FieldTypeDatabaseNumSet:
+ case SwServiceType::FieldTypeDatabaseSetNum:
+ case SwServiceType::FieldTypeDatabase:
+ case SwServiceType::FieldTypeDatabaseName:
+ case SwServiceType::FieldTypePageCount :
+ case SwServiceType::FieldTypeParagraphCount :
+ case SwServiceType::FieldTypeWordCount :
+ case SwServiceType::FieldTypeCharacterCount :
+ case SwServiceType::FieldTypeTableCount :
+ case SwServiceType::FieldTypeGraphicObjectCount :
+ case SwServiceType::FieldTypeEmbeddedObjectCount :
+ case SwServiceType::FieldTypeDocInfoChangeAuthor :
+ case SwServiceType::FieldTypeDocInfoChangeDateTime :
+ case SwServiceType::FieldTypeDocInfoEditTime :
+ case SwServiceType::FieldTypeDocInfoDescription :
+ case SwServiceType::FieldTypeDocInfoCreateAuthor :
+ case SwServiceType::FieldTypeDocInfoCreateDateTime :
+ case SwServiceType::FieldTypeDocInfoCustom :
+ case SwServiceType::FieldTypeDocInfoPrintAuthor :
+ case SwServiceType::FieldTypeDocInfoPrintDateTime :
+ case SwServiceType::FieldTypeDocInfoKeywords :
+ case SwServiceType::FieldTypeDocInfoSubject :
+ case SwServiceType::FieldTypeDocInfoTitle :
+ case SwServiceType::FieldTypeDocInfoRevision :
+ case SwServiceType::FieldTypeBibliography:
+ case SwServiceType::FieldTypeInputUser :
+ case SwServiceType::FieldTypeHiddenText :
+ case SwServiceType::FieldTypeCombinedCharacters :
+ case SwServiceType::FieldTypeDropdown :
+ case SwServiceType::FieldTypeTableFormula:
// NOTE: the sw.SwXAutoTextEntry unoapi test depends on pDoc = 0
xRet = SwXTextField::CreateXTextField(nullptr, nullptr, nObjectType);
break;
- case SW_SERVICE_FIELDTYPE_ANNOTATION:
+ case SwServiceType::FieldTypeAnnotation:
xRet = SwXTextField::CreateXTextField(&rDoc, nullptr, nObjectType);
break;
- case SW_SERVICE_FIELDMASTER_USER:
- case SW_SERVICE_FIELDMASTER_DDE:
- case SW_SERVICE_FIELDMASTER_SET_EXP :
- case SW_SERVICE_FIELDMASTER_DATABASE:
+ case SwServiceType::FieldMasterUser:
+ case SwServiceType::FieldMasterDDE:
+ case SwServiceType::FieldMasterSetExp :
+ case SwServiceType::FieldMasterDatabase:
{
sal_uInt16 nResId = USHRT_MAX;
switch(nObjectType)
{
- case SW_SERVICE_FIELDMASTER_USER: nResId = RES_USERFLD; break;
- case SW_SERVICE_FIELDMASTER_DDE: nResId = RES_DDEFLD; break;
- case SW_SERVICE_FIELDMASTER_SET_EXP : nResId = RES_SETEXPFLD; break;
- case SW_SERVICE_FIELDMASTER_DATABASE: nResId = RES_DBFLD; break;
+ case SwServiceType::FieldMasterUser: nResId = RES_USERFLD; break;
+ case SwServiceType::FieldMasterDDE: nResId = RES_DDEFLD; break;
+ case SwServiceType::FieldMasterSetExp : nResId = RES_SETEXPFLD; break;
+ case SwServiceType::FieldMasterDatabase: nResId = RES_DBFLD; break;
+ default: break;
}
xRet = SwXFieldMaster::CreateXFieldMaster(&rDoc, nullptr, nResId);
}
break;
- case SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY:
+ case SwServiceType::FieldMasterBibliography:
{
SwFieldType* pType = rDoc.getIDocumentFieldsAccess().GetFieldType(RES_AUTHORITY, aEmptyOUStr, true);
if(!pType)
@@ -789,28 +791,28 @@ SwXServiceProvider::MakeInstance(sal_uInt16 nObjectType, SwDoc & rDoc)
xRet = SwXFieldMaster::CreateXFieldMaster(&rDoc, pType);
}
break;
- case SW_SERVICE_PARAGRAPH :
+ case SwServiceType::Paragraph :
xRet = SwXParagraph::CreateXParagraph(rDoc, nullptr);
break;
- case SW_SERVICE_NUMBERING_RULES :
+ case SwServiceType::NumberingRules :
xRet = static_cast<cppu::OWeakObject*>(new SwXNumberingRules(rDoc));
break;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list