diff options
author | Pesi Taototo <pipapipapibo@gmail.com> | 2021-12-05 22:34:33 -0800 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2021-12-07 16:25:47 +0100 |
commit | 47503fce3ebc0874534175c0d9ea40d3a5bbffde (patch) | |
tree | 49cb43244172842cde83a974af0e1a45fc3d6002 /xmloff | |
parent | 5120fe8f2929d9f4464aff26f266198bff038606 (diff) |
tdf#145614 Convert #define to 'enum class'
Change-Id: I991cd44b13465e63c5adc1aed3cfbc038847c0f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126396
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/txtparai.cxx | 12 | ||||
-rw-r--r-- | xmloff/source/text/txtparaimphint.hxx | 40 |
2 files changed, 28 insertions, 24 deletions
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index ac05986ffe6a..5cee4085e693 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -1851,7 +1851,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) xAttrCursor->gotoRange( pHint->GetEnd(), true ); switch( pHint->GetType() ) { - case XML_HINT_STYLE: + case XMLHintType::XML_HINT_STYLE: { const OUString& rStyleName = static_cast<XMLStyleHint_Impl *>(pHint)->GetStyleName(); @@ -1861,7 +1861,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) false ); } break; - case XML_HINT_REFERENCE: + case XMLHintType::XML_HINT_REFERENCE: { const OUString& rRefName = static_cast<XMLReferenceHint_Impl *>(pHint)->GetRefName(); @@ -1880,7 +1880,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) } } break; - case XML_HINT_HYPERLINK: + case XMLHintType::XML_HINT_HYPERLINK: { const XMLHyperlinkHint_Impl *pHHint = static_cast<const XMLHyperlinkHint_Impl *>(pHint); @@ -1894,7 +1894,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) pHHint->GetEventsContext() ); } break; - case XML_HINT_INDEX_MARK: + case XMLHintType::XML_HINT_INDEX_MARK: { Reference<beans::XPropertySet> xMark( static_cast<const XMLIndexMarkHint_Impl *>(pHint)->GetMark()); @@ -1910,7 +1910,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) } } break; - case XML_HINT_TEXT_FRAME: + case XMLHintType::XML_HINT_TEXT_FRAME: { const XMLTextFrameHint_Impl *pFHint = static_cast<const XMLTextFrameHint_Impl *>(pHint); @@ -1955,7 +1955,7 @@ void XMLParaContext::endFastElement(sal_Int32 ) /* Core impl. of the unification of drawing objects and Writer fly frames (#i26791#) */ - case XML_HINT_DRAW: + case XMLHintType::XML_HINT_DRAW: { const XMLDrawHint_Impl *pDHint = static_cast<const XMLDrawHint_Impl*>(pHint); diff --git a/xmloff/source/text/txtparaimphint.hxx b/xmloff/source/text/txtparaimphint.hxx index 63cc49cfa67e..f60b87be5984 100644 --- a/xmloff/source/text/txtparaimphint.hxx +++ b/xmloff/source/text/txtparaimphint.hxx @@ -23,24 +23,28 @@ #include "XMLTextFrameHyperlinkContext.hxx" #include <xmloff/XMLEventsImportContext.hxx> -#define XML_HINT_STYLE 1 -#define XML_HINT_REFERENCE 2 -#define XML_HINT_HYPERLINK 3 -#define XML_HINT_INDEX_MARK 5 -#define XML_HINT_TEXT_FRAME 6 -// Core impl. of the unification of drawing objects and Writer fly frames (#i26791#) -#define XML_HINT_DRAW 7 +enum class XMLHintType +{ + XML_HINT_STYLE = 1, + XML_HINT_REFERENCE = 2, + XML_HINT_HYPERLINK = 3, + // There is no 4 defined here + XML_HINT_INDEX_MARK = 5, + XML_HINT_TEXT_FRAME = 6, + // Core impl. of the unification of drawing objects and Writer fly frames (#i26791#) + XML_HINT_DRAW = 7 +}; class XMLHint_Impl { css::uno::Reference < css::text::XTextRange > xStart; css::uno::Reference < css::text::XTextRange > xEnd; - sal_uInt8 nType; + XMLHintType nType; public: - XMLHint_Impl( sal_uInt8 nTyp, + XMLHint_Impl( XMLHintType nTyp, const css::uno::Reference < css::text::XTextRange > & rS, const css::uno::Reference < css::text::XTextRange > & rE ) : xStart( rS ), @@ -57,8 +61,8 @@ public: // We don't use virtual methods to differ between the sub classes, // because this seems to be too expensive if compared to inline methods. - sal_uInt8 GetType() const { return nType; } - bool IsReference() const { return XML_HINT_REFERENCE==nType; } + XMLHintType GetType() const { return nType; } + bool IsReference() const { return XMLHintType::XML_HINT_REFERENCE==nType; } }; class XMLStyleHint_Impl : public XMLHint_Impl @@ -69,7 +73,7 @@ public: XMLStyleHint_Impl( const OUString& rStyleName, const css::uno::Reference < css::text::XTextRange > & rPos ) : - XMLHint_Impl( XML_HINT_STYLE, rPos, rPos ), + XMLHint_Impl( XMLHintType::XML_HINT_STYLE, rPos, rPos ), sStyleName( rStyleName ) { } @@ -85,7 +89,7 @@ public: XMLReferenceHint_Impl( const OUString& rRefName, const css::uno::Reference < css::text::XTextRange > & rPos ) : - XMLHint_Impl( XML_HINT_REFERENCE, rPos, rPos ), + XMLHint_Impl( XMLHintType::XML_HINT_REFERENCE, rPos, rPos ), sRefName( rRefName ) { } @@ -105,7 +109,7 @@ class XMLHyperlinkHint_Impl : public XMLHint_Impl public: XMLHyperlinkHint_Impl( const css::uno::Reference < css::text::XTextRange > & rPos ) : - XMLHint_Impl( XML_HINT_HYPERLINK, rPos, rPos ) + XMLHint_Impl( XMLHintType::XML_HINT_HYPERLINK, rPos, rPos ) { } @@ -139,7 +143,7 @@ public: XMLIndexMarkHint_Impl( const css::uno::Reference < css::beans::XPropertySet > & rPropSet, const css::uno::Reference < css::text::XTextRange > & rPos ) : - XMLHint_Impl( XML_HINT_INDEX_MARK, rPos, rPos ), + XMLHint_Impl( XMLHintType::XML_HINT_INDEX_MARK, rPos, rPos ), xIndexMarkPropSet( rPropSet ), sID() { @@ -148,7 +152,7 @@ public: XMLIndexMarkHint_Impl( const css::uno::Reference < css::beans::XPropertySet > & rPropSet, const css::uno::Reference < css::text::XTextRange > & rPos, const OUString& sIDString) : - XMLHint_Impl( XML_HINT_INDEX_MARK, rPos, rPos ), + XMLHint_Impl( XMLHintType::XML_HINT_INDEX_MARK, rPos, rPos ), xIndexMarkPropSet( rPropSet ), sID(sIDString) { @@ -168,7 +172,7 @@ public: XMLTextFrameHint_Impl( SvXMLImportContext* pContext, const css::uno::Reference < css::text::XTextRange > & rPos ) : - XMLHint_Impl( XML_HINT_TEXT_FRAME, rPos, rPos ), + XMLHint_Impl( XMLHintType::XML_HINT_TEXT_FRAME, rPos, rPos ), xContext( pContext ) { } @@ -221,7 +225,7 @@ public: XMLDrawHint_Impl( SvXMLShapeContext* pContext, const css::uno::Reference < css::text::XTextRange > & rPos ) : - XMLHint_Impl( XML_HINT_DRAW, rPos, rPos ), + XMLHint_Impl( XMLHintType::XML_HINT_DRAW, rPos, rPos ), xContext( pContext ) { } |