diff options
-rw-r--r-- | basegfx/source/inc/hommatrixtemplate.hxx | 8 | ||||
-rw-r--r-- | desktop/source/deployment/registry/configuration/dp_configuration.cxx | 6 | ||||
-rw-r--r-- | desktop/source/deployment/registry/dp_backend.cxx | 14 | ||||
-rw-r--r-- | desktop/source/deployment/registry/inc/dp_backend.h | 6 | ||||
-rw-r--r-- | desktop/source/deployment/registry/sfwk/dp_sfwk.cxx | 6 | ||||
-rw-r--r-- | oox/inc/drawingml/textspacing.hxx | 20 | ||||
-rw-r--r-- | oox/source/drawingml/textparagraphpropertiescontext.cxx | 12 | ||||
-rw-r--r-- | oox/source/drawingml/textspacingcontext.cxx | 4 |
8 files changed, 35 insertions, 41 deletions
diff --git a/basegfx/source/inc/hommatrixtemplate.hxx b/basegfx/source/inc/hommatrixtemplate.hxx index f9b3e2260481..08c5b538f995 100644 --- a/basegfx/source/inc/hommatrixtemplate.hxx +++ b/basegfx/source/inc/hommatrixtemplate.hxx @@ -37,10 +37,8 @@ namespace basegfx return 0.0; } - template < unsigned int RowSize_ > class ImplMatLine + template < sal_uInt16 RowSize > class ImplMatLine { - enum { RowSize = RowSize_ }; - double mfValue[RowSize]; public: @@ -74,10 +72,8 @@ namespace basegfx } }; - template < unsigned int RowSize_ > class ImplHomMatrixTemplate + template < sal_uInt16 RowSize > class ImplHomMatrixTemplate { - enum { RowSize = RowSize_ }; - ImplMatLine< RowSize > maLine[RowSize - 1]; ImplMatLine< RowSize >* mpLine; diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 81ef9588b334..b27478669263 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -710,20 +710,20 @@ void BackendImpl::PackageImpl::processPackage_( } //No need for live-deployment for bundled extension, because OOo //restarts after installation - if (that->m_eContext != CONTEXT_BUNDLED + if (that->m_eContext != Context::Bundled && !startup) { if (m_isSchema) { css::configuration::Update::get( that->m_xComponentContext)->insertExtensionXcsFile( - that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); + that->m_eContext == Context::Shared, expandUnoRcUrl(url)); } else { css::configuration::Update::get( that->m_xComponentContext)->insertExtensionXcuFile( - that->m_eContext == CONTEXT_SHARED, expandUnoRcUrl(url)); + that->m_eContext == Context::Shared, expandUnoRcUrl(url)); } } that->addToConfigmgrIni( m_isSchema, true, url, xCmdEnv ); diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 4b81c5e51197..7393d9ba6b8b 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -76,7 +76,7 @@ PackageRegistryBackend::PackageRegistryBackend( Reference<XComponentContext> const & xContext ) : t_BackendBase( getMutex() ), m_xComponentContext( xContext ), - m_eContext( CONTEXT_UNKNOWN ), + m_eContext( Context::Unknown ), m_readOnly( false ) { assert(xContext.is()); @@ -89,17 +89,17 @@ PackageRegistryBackend::PackageRegistryBackend( m_readOnly = *readOnly; if ( m_context == "user" ) - m_eContext = CONTEXT_USER; + m_eContext = Context::User; else if ( m_context == "shared" ) - m_eContext = CONTEXT_SHARED; + m_eContext = Context::Shared; else if ( m_context == "bundled" ) - m_eContext = CONTEXT_BUNDLED; + m_eContext = Context::Bundled; else if ( m_context == "tmp" ) - m_eContext = CONTEXT_TMP; + m_eContext = Context::Tmp; else if (m_context.matchIgnoreAsciiCase("vnd.sun.star.tdoc:/")) - m_eContext = CONTEXT_DOCUMENT; + m_eContext = Context::Document; else - m_eContext = CONTEXT_UNKNOWN; + m_eContext = Context::Unknown; } diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h index d94d30f1b25c..b126f4b132dd 100644 --- a/desktop/source/deployment/registry/inc/dp_backend.h +++ b/desktop/source/deployment/registry/inc/dp_backend.h @@ -286,10 +286,8 @@ protected: OUString m_context; // currently only for library containers: - enum { - CONTEXT_UNKNOWN, - CONTEXT_USER, CONTEXT_SHARED,CONTEXT_BUNDLED, CONTEXT_TMP, - CONTEXT_DOCUMENT + enum class Context { + Unknown, User, Shared, Bundled, Tmp, Document } m_eContext; bool m_readOnly; diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx index 1e578a370098..e19df09bc353 100644 --- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx +++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx @@ -289,15 +289,15 @@ void BackendImpl::PackageImpl:: initPackageHandler() BackendImpl * that = getMyBackend(); Any aContext; - if ( that->m_eContext == CONTEXT_USER ) + if ( that->m_eContext == Context::User ) { aContext <<= OUString("user"); } - else if ( that->m_eContext == CONTEXT_SHARED ) + else if ( that->m_eContext == Context::Shared ) { aContext <<= OUString("share"); } - else if ( that->m_eContext == CONTEXT_BUNDLED ) + else if ( that->m_eContext == Context::Bundled ) { aContext <<= OUString("bundled"); } diff --git a/oox/inc/drawingml/textspacing.hxx b/oox/inc/drawingml/textspacing.hxx index efe0dab06674..d1ed9a988169 100644 --- a/oox/inc/drawingml/textspacing.hxx +++ b/oox/inc/drawingml/textspacing.hxx @@ -33,34 +33,34 @@ namespace oox { namespace drawingml { class TextSpacing { public: - enum { - POINTS = 0, - PERCENT + enum class Unit { + Points = 0, + Percent }; TextSpacing() - : nUnit( POINTS ), nValue( 0 ), bHasValue( false ) + : nUnit( Unit::Points ), nValue( 0 ), bHasValue( false ) { } - TextSpacing( sal_Int32 nPoints ) : nUnit( POINTS ), nValue( nPoints ), bHasValue( true ){}; + TextSpacing( sal_Int32 nPoints ) : nUnit( Unit::Points ), nValue( nPoints ), bHasValue( true ){}; css::style::LineSpacing toLineSpacing() const { css::style::LineSpacing aSpacing; - aSpacing.Mode = ( nUnit == PERCENT + aSpacing.Mode = ( nUnit == Unit::Percent ? css::style::LineSpacingMode::PROP : css::style::LineSpacingMode::MINIMUM ); - aSpacing.Height = static_cast< sal_Int16 >( nUnit == PERCENT ? nValue / 1000 : nValue ); + aSpacing.Height = static_cast< sal_Int16 >( nUnit == Unit::Percent ? nValue / 1000 : nValue ); return aSpacing; } sal_Int32 toMargin( float fFontSize ) const { - if ( nUnit == PERCENT ) + if ( nUnit == Unit::Percent ) return GetTextSpacingPoint(static_cast<sal_Int32>((fFontSize*nValue)/1000)); else return nValue; } - sal_Int32 nUnit; + Unit nUnit; sal_Int32 nValue; - bool bHasValue; + bool bHasValue; }; } } diff --git a/oox/source/drawingml/textparagraphpropertiescontext.cxx b/oox/source/drawingml/textparagraphpropertiescontext.cxx index 3a0eb4156849..460bc2e2d4d6 100644 --- a/oox/source/drawingml/textparagraphpropertiescontext.cxx +++ b/oox/source/drawingml/textparagraphpropertiescontext.cxx @@ -270,7 +270,7 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl if (oBefore.has()) { TextSpacing& rSpacing = mrTextParagraphProperties.getParaTopMargin(); - rSpacing.nUnit = TextSpacing::POINTS; + rSpacing.nUnit = TextSpacing::Unit::Points; rSpacing.nValue = TWIPS_TO_MM(oBefore.get()); rSpacing.bHasValue = true; } @@ -280,7 +280,7 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl if (oBeforeLines.has()) { TextSpacing& rSpacing = mrTextParagraphProperties.getParaTopMargin(); - rSpacing.nUnit = TextSpacing::PERCENT; + rSpacing.nUnit = TextSpacing::Unit::Percent; rSpacing.nValue = oBeforeLines.get() * MAX_PERCENT / 100; rSpacing.bHasValue = true; } @@ -294,7 +294,7 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl if (oAfter.has()) { TextSpacing& rSpacing = mrTextParagraphProperties.getParaBottomMargin(); - rSpacing.nUnit = TextSpacing::POINTS; + rSpacing.nUnit = TextSpacing::Unit::Points; rSpacing.nValue = TWIPS_TO_MM(oAfter.get()); rSpacing.bHasValue = true; } @@ -304,7 +304,7 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl if (oAfterLines.has()) { TextSpacing& rSpacing = mrTextParagraphProperties.getParaBottomMargin(); - rSpacing.nUnit = TextSpacing::PERCENT; + rSpacing.nUnit = TextSpacing::Unit::Percent; rSpacing.nValue = oAfterLines.get() * MAX_PERCENT / 100; rSpacing.bHasValue = true; } @@ -318,12 +318,12 @@ ContextHandlerRef TextParagraphPropertiesContext::onCreateContext( sal_Int32 aEl { if( !oLineRule.has() || oLineRule.get() == "auto" ) { - maLineSpacing.nUnit = TextSpacing::PERCENT; + maLineSpacing.nUnit = TextSpacing::Unit::Percent; maLineSpacing.nValue = oLineSpacing.get() * MAX_PERCENT / 240; } else { - maLineSpacing.nUnit = TextSpacing::POINTS; + maLineSpacing.nUnit = TextSpacing::Unit::Points; maLineSpacing.nValue = TWIPS_TO_MM(oLineSpacing.get()); } maLineSpacing.bHasValue = true; diff --git a/oox/source/drawingml/textspacingcontext.cxx b/oox/source/drawingml/textspacingcontext.cxx index fc6dfd813139..f33b1c10a4e5 100644 --- a/oox/source/drawingml/textspacingcontext.cxx +++ b/oox/source/drawingml/textspacingcontext.cxx @@ -43,11 +43,11 @@ namespace oox { namespace drawingml { switch( aElement ) { case A_TOKEN( spcPct ): - maSpacing.nUnit = TextSpacing::PERCENT; + maSpacing.nUnit = TextSpacing::Unit::Percent; maSpacing.nValue = GetPercent( rAttribs.getString( XML_val ).get() ); break; case A_TOKEN( spcPts ): - maSpacing.nUnit = TextSpacing::POINTS; + maSpacing.nUnit = TextSpacing::Unit::Points; maSpacing.nValue = GetTextSpacingPoint( rAttribs.getString( XML_val ).get() ); break; default: |