diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-08-22 23:02:09 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-08-22 23:04:14 +0200 |
commit | 7afacb97a7f8a6f98daba0f5c8dfcd4035218ce4 (patch) | |
tree | cf023a96c6130d4d283a81a75d68b0dd6a2a9b54 | |
parent | af73a28e8538f5b2df6bbfd592d8987511520d4d (diff) |
Use anonymous namespace for these. (mostly EnumWrapper)
Change-Id: Ice90e519bbd32a12de59d696a6dfedaaf45bd45e
-rw-r--r-- | sc/source/ui/vba/vbaaxes.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaformatconditions.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaoleobjects.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbastyles.cxx | 7 |
4 files changed, 22 insertions, 3 deletions
diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx index ca76ea4ab5e0..46d9672d2001 100644 --- a/sc/source/ui/vba/vbaaxes.cxx +++ b/sc/source/ui/vba/vbaaxes.cxx @@ -39,6 +39,8 @@ typedef ::std::vector< AxesCoordinate > vecAxesIndices; typedef ::cppu::WeakImplHelper1< container::XIndexAccess > AxisIndexWrapper_BASE; +namespace { + class EnumWrapper : public EnumerationHelper_BASE { uno::Reference<container::XIndexAccess > m_xIndexAccess; @@ -58,6 +60,8 @@ public: } }; +} + uno::Reference< excel::XAxis > ScVbaAxes::createAxis( const uno::Reference< excel::XChart >& xChart, const uno::Reference< uno::XComponentContext >& xContext, sal_Int32 nType, sal_Int32 nAxisGroup ) throw ( uno::RuntimeException, script::BasicErrorException ) { @@ -78,6 +82,8 @@ ScVbaAxes::createAxis( const uno::Reference< excel::XChart >& xChart, const uno: return new ScVbaAxis( xParent, xContext, xAxisPropertySet, nType, nAxisGroup); } +namespace { + class AxisIndexWrapper : public AxisIndexWrapper_BASE { // if necessary for better performance we could change this into a map and cache the @@ -133,6 +139,8 @@ uno::Reference< container::XIndexAccess > createIndexWrapper( const uno::Referen return new AxisIndexWrapper( xContext, xChart ); } +} + // #FIXME The collection semantics will never work as this object is not yet initialised correctly ScVbaAxes::ScVbaAxes( const uno::Reference< XHelperInterface >& xParent,const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< excel::XChart >& xChart ) : ScVbaAxes_BASE( xParent, xContext, createIndexWrapper( xChart, xContext )), moChartParent( xChart ) { diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx index 10fbede1a6a9..21e8158fcdbd 100644 --- a/sc/source/ui/vba/vbaformatconditions.cxx +++ b/sc/source/ui/vba/vbaformatconditions.cxx @@ -66,7 +66,7 @@ ScVbaFormatConditions::getElementType() throw (css::uno::RuntimeException) return cppu::UnoType<excel::XFormatCondition>::get(); } -uno::Any xSheetConditionToFormatCondition( const uno::Reference< XHelperInterface >& xRangeParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< excel::XStyles >& xStyles, const uno::Reference< excel::XFormatConditions >& xFormatConditions, const uno::Reference< beans::XPropertySet >& xRangeProps, const uno::Any& aObject ) +static uno::Any xSheetConditionToFormatCondition( const uno::Reference< XHelperInterface >& xRangeParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< excel::XStyles >& xStyles, const uno::Reference< excel::XFormatConditions >& xFormatConditions, const uno::Reference< beans::XPropertySet >& xRangeProps, const uno::Any& aObject ) { uno::Reference< sheet::XSheetConditionalEntry > xSheetConditionalEntry; aObject >>= xSheetConditionalEntry; @@ -82,6 +82,8 @@ ScVbaFormatConditions::createCollectionObject(const uno::Any& aObject ) return xSheetConditionToFormatCondition( uno::Reference< XHelperInterface >( mxRangeParent, uno::UNO_QUERY_THROW ), mxContext, mxStyles, this, mxParentRangePropertySet, aObject ); } +namespace { + class EnumWrapper : public EnumerationHelper_BASE { uno::Reference<container::XIndexAccess > m_xIndexAccess; @@ -107,6 +109,8 @@ public: } }; +} + uno::Reference< excel::XFormatCondition > SAL_CALL ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, const uno::Any& _aFormula1, const uno::Any& _aFormula2 ) throw (script::BasicErrorException, uno::RuntimeException, std::exception) { diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx index cabfaa201d4e..426dc12e5bff 100644 --- a/sc/source/ui/vba/vbaoleobjects.cxx +++ b/sc/source/ui/vba/vbaoleobjects.cxx @@ -30,6 +30,8 @@ using namespace ooo::vba; typedef ::cppu::WeakImplHelper1< container::XIndexAccess > XIndexAccess_BASE; +namespace { + class IndexAccessWrapper : public XIndexAccess_BASE { typedef std::vector< uno::Reference< drawing::XControlShape > > OLEObjects; @@ -102,6 +104,8 @@ uno::Reference< container::XIndexAccess > oleObjectIndexWrapper( const uno::Refe return new IndexAccessWrapper( xIndexAccess ); } +} + ScVbaOLEObjects::ScVbaOLEObjects( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) : OLEObjectsImpl_BASE( xParent, xContext, oleObjectIndexWrapper( xIndexAccess ) ) diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx index 79fe5c11e003..44de5c97f3b0 100644 --- a/sc/source/ui/vba/vbastyles.cxx +++ b/sc/source/ui/vba/vbastyles.cxx @@ -23,7 +23,6 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -static OUString SDEFAULTCELLSTYLENAME("Default"); static css::uno::Any lcl_createAPIStyleToVBAObject( const css::uno::Any& aObject, const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) { @@ -63,6 +62,8 @@ ScVbaStyles::getElementType() throw (uno::RuntimeException) return cppu::UnoType<excel::XStyle>::get(); } +namespace { + class EnumWrapper : public EnumerationHelper_BASE { uno::Reference<container::XIndexAccess > m_xIndexAccess; @@ -85,6 +86,8 @@ public: } }; +} + uno::Reference< container::XEnumeration > SAL_CALL ScVbaStyles::createEnumeration() throw (uno::RuntimeException) { @@ -125,7 +128,7 @@ ScVbaStyles::Add( const OUString& _sName, const uno::Any& _aBasedOn ) throw (scr { mxNameContainerCellStyles->insertByName(_sName, uno::makeAny( xStyle) ); } - if (!sParentCellStyleName.equals(SDEFAULTCELLSTYLENAME)) + if (!sParentCellStyleName.equals("Default")) { xStyle->setParentStyle( sParentCellStyleName ); } |