summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-10 08:55:04 +0200
committerNoel Grandin <noel@peralex.com>2014-10-10 09:31:43 +0200
commitf453dc0327535056c8c9908c322763db9eca33be (patch)
treec9e3019c2fb28b748d1f78ca832a0f9a582d7d0a
parent8ab1e7cdecc31c481ac5b28aab48fda4151577cf (diff)
convert SWHTML_OPTTYPE #defines to enum
Change-Id: I847c7c116984817c7d66d44431db0601f0a27209
-rw-r--r--sw/inc/SwAppletImpl.hxx12
-rw-r--r--sw/source/filter/html/SwAppletImpl.cxx30
-rw-r--r--sw/source/filter/html/htmlplug.cxx8
-rw-r--r--sw/source/filter/xml/xmltexte.cxx12
4 files changed, 32 insertions, 30 deletions
diff --git a/sw/inc/SwAppletImpl.hxx b/sw/inc/SwAppletImpl.hxx
index dcd5a26cd70d..5a668be8227f 100644
--- a/sw/inc/SwAppletImpl.hxx
+++ b/sw/inc/SwAppletImpl.hxx
@@ -22,10 +22,12 @@
#include <config_features.h>
-#define SWHTML_OPTTYPE_IGNORE 0
-#define SWHTML_OPTTYPE_TAG 1
-#define SWHTML_OPTTYPE_PARAM 2
-#define SWHTML_OPTTYPE_SIZE 3
+enum class SwHtmlOptType {
+ IGNORE = 0,
+ TAG = 1,
+ PARAM = 2,
+ SIZE = 3
+};
#include <com/sun/star/embed/XEmbeddedObject.hpp>
@@ -49,7 +51,7 @@ class SwApplet_Impl
OUString sAlt;
public:
- static sal_uInt16 GetOptionType( const OUString& rName, bool bApplet );
+ static SwHtmlOptType GetOptionType( const OUString& rName, bool bApplet );
SwApplet_Impl( SfxItemPool& rPool, sal_uInt16 nWhich1, sal_uInt16 nWhich2 );
SwApplet_Impl( SfxItemSet& rSet ): aItemSet ( rSet) {}
~SwApplet_Impl();
diff --git a/sw/source/filter/html/SwAppletImpl.cxx b/sw/source/filter/html/SwAppletImpl.cxx
index b95f544292b9..eff1b23497f0 100644
--- a/sw/source/filter/html/SwAppletImpl.cxx
+++ b/sw/source/filter/html/SwAppletImpl.cxx
@@ -38,9 +38,9 @@ static char const sHTML_O_Object[] = "OBJECT";
}
-sal_uInt16 SwApplet_Impl::GetOptionType( const OUString& rName, bool bApplet )
+SwHtmlOptType SwApplet_Impl::GetOptionType( const OUString& rName, bool bApplet )
{
- sal_uInt16 nType = bApplet ? SWHTML_OPTTYPE_PARAM : SWHTML_OPTTYPE_TAG;
+ SwHtmlOptType nType = bApplet ? SwHtmlOptType::PARAM : SwHtmlOptType::TAG;
switch( rName.toChar() )
{
@@ -48,67 +48,67 @@ sal_uInt16 SwApplet_Impl::GetOptionType( const OUString& rName, bool bApplet )
case 'a':
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_align ) ||
rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_alt ) )
- nType = SWHTML_OPTTYPE_IGNORE;
+ nType = SwHtmlOptType::IGNORE;
else if( bApplet &&
(rName.equalsIgnoreAsciiCaseAscii( sHTML_O_archive ) ||
rName.equalsIgnoreAsciiCaseAscii( sHTML_O_Archives )) )
- nType = SWHTML_OPTTYPE_TAG;
+ nType = SwHtmlOptType::TAG;
break;
case 'C':
case 'c':
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_class ) ||
(bApplet && (rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_code ) ||
rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_codebase ))) )
- nType = SWHTML_OPTTYPE_IGNORE;
+ nType = SwHtmlOptType::IGNORE;
break;
case 'H':
case 'h':
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_height ) )
- nType = SWHTML_OPTTYPE_SIZE;
+ nType = SwHtmlOptType::SIZE;
else if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_hspace ) ||
(!bApplet && rName.equalsIgnoreAsciiCase( OOO_STRING_SW_HTML_O_Hidden )) )
- nType = SWHTML_OPTTYPE_IGNORE;
+ nType = SwHtmlOptType::IGNORE;
break;
case 'I':
case 'i':
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_id ) )
- nType = SWHTML_OPTTYPE_IGNORE;
+ nType = SwHtmlOptType::IGNORE;
break;
case 'M':
case 'm':
if( bApplet && rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_mayscript ) )
- nType = SWHTML_OPTTYPE_IGNORE;
+ nType = SwHtmlOptType::IGNORE;
break;
case 'N':
case 'n':
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_name ) )
- nType = SWHTML_OPTTYPE_IGNORE;
+ nType = SwHtmlOptType::IGNORE;
break;
case 'O':
case 'o':
if( bApplet && rName.equalsIgnoreAsciiCaseAscii( sHTML_O_Object ) )
- nType = SWHTML_OPTTYPE_TAG;
+ nType = SwHtmlOptType::TAG;
break;
case 'S':
case 's':
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_style ) ||
(!bApplet && rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_src )) )
- nType = SWHTML_OPTTYPE_IGNORE;
+ nType = SwHtmlOptType::IGNORE;
break;
case 'T':
case 't':
if( !bApplet && rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_type ) )
- nType = SWHTML_OPTTYPE_IGNORE;
+ nType = SwHtmlOptType::IGNORE;
break;
case 'V':
case 'v':
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_vspace ) )
- nType = SWHTML_OPTTYPE_IGNORE;
+ nType = SwHtmlOptType::IGNORE;
break;
case 'W':
case 'w':
if( rName.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_O_width ) )
- nType = SWHTML_OPTTYPE_SIZE;
+ nType = SwHtmlOptType::SIZE;
break;
}
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index a33737b5171b..a4e988fab529 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1164,8 +1164,8 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
{
const SvCommand& rCommand = aCommands[ --i ];
const OUString& rName = rCommand.GetCommand();
- sal_uInt16 nType = SwApplet_Impl::GetOptionType( rName, true );
- if( SWHTML_OPTTYPE_TAG == nType )
+ SwHtmlOptType nType = SwApplet_Impl::GetOptionType( rName, true );
+ if( SwHtmlOptType::TAG == nType )
{
const OUString& rValue = rCommand.GetArgument();
rWrt.Strm().WriteChar( ' ' );
@@ -1173,7 +1173,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
rWrt.Strm().WriteCharPtr( "=\"" );
HTMLOutFuncs::Out_String( rWrt.Strm(), rValue, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters ).WriteChar( '\"' );
}
- else if( SWHTML_OPTTYPE_PARAM == nType )
+ else if( SwHtmlOptType::PARAM == nType )
{
aParams.push_back( i );
}
@@ -1222,7 +1222,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
const SvCommand& rCommand = aCommands[ i ];
const OUString& rName = rCommand.GetCommand();
- if( SwApplet_Impl::GetOptionType( rName, false ) == SWHTML_OPTTYPE_TAG )
+ if( SwApplet_Impl::GetOptionType( rName, false ) == SwHtmlOptType::TAG )
{
const OUString& rValue = rCommand.GetArgument();
rWrt.Strm().WriteChar( ' ' );
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index b8ebe35318da..9198d7abb3f7 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -565,8 +565,8 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
while ( i > 0 )
{
beans::PropertyValue& aProp = aProps[--i];
- const sal_uInt16 nType2 = SwApplet_Impl::GetOptionType( aProp.Name, true );
- if ( nType2 == SWHTML_OPTTYPE_TAG)
+ const SwHtmlOptType nType2 = SwApplet_Impl::GetOptionType( aProp.Name, true );
+ if ( nType2 == SwHtmlOptType::TAG)
{
OUString aStr2;
aProp.Value >>= aStr2;
@@ -660,8 +660,8 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
while ( i > 0 )
{
beans::PropertyValue& aProp = aProps[--i];
- const sal_uInt16 nType2 = SwApplet_Impl::GetOptionType( aProp.Name, true );
- if (SWHTML_OPTTYPE_PARAM == nType2 || SWHTML_OPTTYPE_SIZE == nType2 )
+ const SwHtmlOptType nType2 = SwApplet_Impl::GetOptionType( aProp.Name, true );
+ if (SwHtmlOptType::PARAM == nType2 || SwHtmlOptType::SIZE == nType2 )
{
OUString aStr;
aProp.Value >>= aStr;
@@ -686,8 +686,8 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
while ( i > 0 )
{
beans::PropertyValue& aProp = aProps[--i];
- const sal_uInt16 nType2 = SwApplet_Impl::GetOptionType( aProp.Name, false );
- if ( nType2 == SWHTML_OPTTYPE_TAG)
+ const SwHtmlOptType nType2 = SwApplet_Impl::GetOptionType( aProp.Name, false );
+ if ( nType2 == SwHtmlOptType::TAG)
{
OUString aStr;
aProp.Value >>= aStr;