diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-02-21 12:45:12 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-02-21 18:26:21 +0100 |
commit | 895dc882c451bcc03236267d3ce33be218451721 (patch) | |
tree | c1ce54188d19d0850a0cfcdc0d0019c4aa10c137 /xmloff | |
parent | 93363ff6ba8198e83417eb805b9342e8711b8c09 (diff) |
generic integers to enums
Change-Id: Ic43283b9e1666c0f2162e277dc79fc6f992ef616
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/XMLFontAutoStylePool.hxx | 9 | ||||
-rw-r--r-- | xmloff/source/style/XMLFontAutoStylePool.cxx | 32 | ||||
-rw-r--r-- | xmloff/source/style/xmlnume.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/text/txtexppr.cxx | 11 |
4 files changed, 29 insertions, 31 deletions
diff --git a/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx b/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx index 8ed243daa321..a4c64250aaaa 100644 --- a/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx +++ b/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx @@ -23,6 +23,7 @@ #include "sal/config.h" #include "xmloff/dllapi.h" #include <rtl/ustring.hxx> +#include <tools/fontenum.hxx> #include <xmloff/uniref.hxx> #include <set> @@ -53,15 +54,15 @@ public: ::rtl::OUString Add( const ::rtl::OUString& rFamilyName, const ::rtl::OUString& rStyleName, - sal_Int16 nFamily, - sal_Int16 nPitch, + FontFamily nFamily, + FontPitch nPitch, rtl_TextEncoding eEnc ); ::rtl::OUString Find( const ::rtl::OUString& rFamilyName, const ::rtl::OUString& rStyleName, - sal_Int16 nFamily, - sal_Int16 nPitch, + FontFamily nFamily, + FontPitch nPitch, rtl_TextEncoding eEnc )const; ::rtl::OUString Find( const ::rtl::OUString& rInternalName ) const; diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx index 0f92d66c41e9..9163ef593476 100644 --- a/xmloff/source/style/XMLFontAutoStylePool.cxx +++ b/xmloff/source/style/XMLFontAutoStylePool.cxx @@ -44,8 +44,8 @@ class XMLFontAutoStylePoolEntry_Impl OUString sName; OUString sFamilyName; OUString sStyleName; - sal_Int16 nFamily; - sal_Int16 nPitch; + FontFamily nFamily; + FontPitch nPitch; rtl_TextEncoding eEnc; public: @@ -54,22 +54,22 @@ public: const ::rtl::OUString& rName, const ::rtl::OUString& rFamilyName, const ::rtl::OUString& rStyleName, - sal_Int16 nFamily, - sal_Int16 nPitch, + FontFamily nFamily, + FontPitch nPitch, rtl_TextEncoding eEnc ); inline XMLFontAutoStylePoolEntry_Impl( const ::rtl::OUString& rFamilyName, const ::rtl::OUString& rStyleName, - sal_Int16 nFamily, - sal_Int16 nPitch, + FontFamily nFamily, + FontPitch nPitch, rtl_TextEncoding eEnc ); const OUString& GetName() const { return sName; } const OUString& GetFamilyName() const { return sFamilyName; } const OUString& GetStyleName() const { return sStyleName; } - sal_Int16 GetFamily() const { return nFamily; } - sal_Int16 GetPitch() const { return nPitch; } + FontFamily GetFamily() const { return nFamily; } + FontPitch GetPitch() const { return nPitch; } rtl_TextEncoding GetEncoding() const { return eEnc; } }; @@ -78,8 +78,8 @@ inline XMLFontAutoStylePoolEntry_Impl::XMLFontAutoStylePoolEntry_Impl( const ::rtl::OUString& rName, const ::rtl::OUString& rFamilyName, const ::rtl::OUString& rStyleName, - sal_Int16 nFam, - sal_Int16 nP, + FontFamily nFam, + FontPitch nP, rtl_TextEncoding eE ) : sName( rName ), sFamilyName( rFamilyName ), @@ -93,8 +93,8 @@ inline XMLFontAutoStylePoolEntry_Impl::XMLFontAutoStylePoolEntry_Impl( inline XMLFontAutoStylePoolEntry_Impl::XMLFontAutoStylePoolEntry_Impl( const ::rtl::OUString& rFamilyName, const ::rtl::OUString& rStyleName, - sal_Int16 nFam, - sal_Int16 nP, + FontFamily nFam, + FontPitch nP, rtl_TextEncoding eE ) : sFamilyName( rFamilyName ), sStyleName( rStyleName ), @@ -149,8 +149,8 @@ XMLFontAutoStylePool::~XMLFontAutoStylePool() OUString XMLFontAutoStylePool::Add( const OUString& rFamilyName, const OUString& rStyleName, - sal_Int16 nFamily, - sal_Int16 nPitch, + FontFamily nFamily, + FontPitch nPitch, rtl_TextEncoding eEnc ) { OUString sPoolName; @@ -203,8 +203,8 @@ OUString XMLFontAutoStylePool::Add( ::rtl::OUString XMLFontAutoStylePool::Find( const OUString& rFamilyName, const OUString& rStyleName, - sal_Int16 nFamily, - sal_Int16 nPitch, + FontFamily nFamily, + FontPitch nPitch, rtl_TextEncoding eEnc ) const { OUString sName; diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx index 6c94cbd222b5..4a6bd2b66c3b 100644 --- a/xmloff/source/style/xmlnume.cxx +++ b/xmloff/source/style/xmlnume.cxx @@ -118,8 +118,8 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, sal_Unicode cBullet = 0xf095; OUString sBulletFontName, sBulletFontStyleName ; - sal_Int16 eBulletFontFamily = FAMILY_DONTKNOW; - sal_Int16 eBulletFontPitch = PITCH_DONTKNOW; + FontFamily eBulletFontFamily = FAMILY_DONTKNOW; + FontPitch eBulletFontPitch = PITCH_DONTKNOW; rtl_TextEncoding eBulletFontEncoding = RTL_TEXTENCODING_DONTKNOW; OUString sImageURL; @@ -177,8 +177,8 @@ void SvxXMLNumRuleExport::exportLevelStyle( sal_Int32 nLevel, { sBulletFontName = rFDesc.Name; sBulletFontStyleName = rFDesc.StyleName; - eBulletFontFamily = (sal_Int16)rFDesc.Family; - eBulletFontPitch = (sal_Int16)rFDesc.Pitch; + eBulletFontFamily = static_cast< FontFamily >( rFDesc.Family ); + eBulletFontPitch = static_cast< FontPitch >( rFDesc.Pitch ); eBulletFontEncoding = (rtl_TextEncoding)rFDesc.CharSet; } } diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx index 56e36e7663f9..c2c042a89644 100644 --- a/xmloff/source/text/txtexppr.cxx +++ b/xmloff/source/text/txtexppr.cxx @@ -24,8 +24,6 @@ #include <com/sun/star/text/SizeType.hpp> #include <com/sun/star/text/WrapTextMode.hpp> #include <com/sun/star/text/TextContentAnchorType.hpp> -#include <com/sun/star/awt/FontFamily.hpp> -#include <com/sun/star/awt/FontPitch.hpp> #include <com/sun/star/awt/FontUnderline.hpp> #include <com/sun/star/text/XChapterNumberingSupplier.hpp> @@ -43,7 +41,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::style; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::text; -using namespace ::com::sun::star::awt; void XMLTextExportPropertySetMapper::handleElementItem( SvXMLExport& rExp, @@ -204,8 +201,8 @@ void XMLTextExportPropertySetMapper::ContextFontFilter( { OUString sFamilyName; OUString sStyleName; - sal_Int16 nFamily = awt::FontFamily::DONTKNOW; - sal_Int16 nPitch = awt::FontPitch::DONTKNOW; + FontFamily nFamily = FAMILY_DONTKNOW; + FontPitch nPitch = PITCH_DONTKNOW; rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW; OUString sTmp; @@ -216,9 +213,9 @@ void XMLTextExportPropertySetMapper::ContextFontFilter( sal_Int16 nTmp = sal_Int16(); if( pFontFamilyState && (pFontFamilyState->maValue >>= nTmp ) ) - nFamily = nTmp; + nFamily = static_cast< FontFamily >( nTmp ); if( pFontPitchState && (pFontPitchState->maValue >>= nTmp ) ) - nPitch = nTmp; + nPitch = static_cast< FontPitch >( nTmp ); if( pFontCharsetState && (pFontCharsetState->maValue >>= nTmp ) ) eEnc = (rtl_TextEncoding)nTmp; |