Kaydet (Commit) 7afacb97 authored tarafından Matúš Kukan's avatar Matúš Kukan

Use anonymous namespace for these. (mostly EnumWrapper)

Change-Id: Ice90e519bbd32a12de59d696a6dfedaaf45bd45e
üst af73a28e
...@@ -39,6 +39,8 @@ typedef ::std::vector< AxesCoordinate > vecAxesIndices; ...@@ -39,6 +39,8 @@ typedef ::std::vector< AxesCoordinate > vecAxesIndices;
typedef ::cppu::WeakImplHelper1< container::XIndexAccess > AxisIndexWrapper_BASE; typedef ::cppu::WeakImplHelper1< container::XIndexAccess > AxisIndexWrapper_BASE;
namespace {
class EnumWrapper : public EnumerationHelper_BASE class EnumWrapper : public EnumerationHelper_BASE
{ {
uno::Reference<container::XIndexAccess > m_xIndexAccess; uno::Reference<container::XIndexAccess > m_xIndexAccess;
...@@ -58,6 +60,8 @@ public: ...@@ -58,6 +60,8 @@ public:
} }
}; };
}
uno::Reference< excel::XAxis > 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 ) 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: ...@@ -78,6 +82,8 @@ ScVbaAxes::createAxis( const uno::Reference< excel::XChart >& xChart, const uno:
return new ScVbaAxis( xParent, xContext, xAxisPropertySet, nType, nAxisGroup); return new ScVbaAxis( xParent, xContext, xAxisPropertySet, nType, nAxisGroup);
} }
namespace {
class AxisIndexWrapper : public AxisIndexWrapper_BASE class AxisIndexWrapper : public AxisIndexWrapper_BASE
{ {
// if necessary for better performance we could change this into a map and cache the // 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 ...@@ -133,6 +139,8 @@ uno::Reference< container::XIndexAccess > createIndexWrapper( const uno::Referen
return new AxisIndexWrapper( xContext, xChart ); return new AxisIndexWrapper( xContext, xChart );
} }
}
// #FIXME The collection semantics will never work as this object is not yet initialised correctly // #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 ) 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 )
{ {
......
...@@ -66,7 +66,7 @@ ScVbaFormatConditions::getElementType() throw (css::uno::RuntimeException) ...@@ -66,7 +66,7 @@ ScVbaFormatConditions::getElementType() throw (css::uno::RuntimeException)
return cppu::UnoType<excel::XFormatCondition>::get(); 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; uno::Reference< sheet::XSheetConditionalEntry > xSheetConditionalEntry;
aObject >>= xSheetConditionalEntry; aObject >>= xSheetConditionalEntry;
...@@ -82,6 +82,8 @@ ScVbaFormatConditions::createCollectionObject(const uno::Any& aObject ) ...@@ -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 ); return xSheetConditionToFormatCondition( uno::Reference< XHelperInterface >( mxRangeParent, uno::UNO_QUERY_THROW ), mxContext, mxStyles, this, mxParentRangePropertySet, aObject );
} }
namespace {
class EnumWrapper : public EnumerationHelper_BASE class EnumWrapper : public EnumerationHelper_BASE
{ {
uno::Reference<container::XIndexAccess > m_xIndexAccess; uno::Reference<container::XIndexAccess > m_xIndexAccess;
...@@ -107,6 +109,8 @@ public: ...@@ -107,6 +109,8 @@ public:
} }
}; };
}
uno::Reference< excel::XFormatCondition > SAL_CALL 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) ScVbaFormatConditions::Add( ::sal_Int32 _nType, const uno::Any& _aOperator, const uno::Any& _aFormula1, const uno::Any& _aFormula2 ) throw (script::BasicErrorException, uno::RuntimeException, std::exception)
{ {
......
...@@ -30,6 +30,8 @@ using namespace ooo::vba; ...@@ -30,6 +30,8 @@ using namespace ooo::vba;
typedef ::cppu::WeakImplHelper1< container::XIndexAccess > XIndexAccess_BASE; typedef ::cppu::WeakImplHelper1< container::XIndexAccess > XIndexAccess_BASE;
namespace {
class IndexAccessWrapper : public XIndexAccess_BASE class IndexAccessWrapper : public XIndexAccess_BASE
{ {
typedef std::vector< uno::Reference< drawing::XControlShape > > OLEObjects; typedef std::vector< uno::Reference< drawing::XControlShape > > OLEObjects;
...@@ -102,6 +104,8 @@ uno::Reference< container::XIndexAccess > oleObjectIndexWrapper( const uno::Refe ...@@ -102,6 +104,8 @@ uno::Reference< container::XIndexAccess > oleObjectIndexWrapper( const uno::Refe
return new IndexAccessWrapper( xIndexAccess ); return new IndexAccessWrapper( xIndexAccess );
} }
}
ScVbaOLEObjects::ScVbaOLEObjects( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, ScVbaOLEObjects::ScVbaOLEObjects( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext,
const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ) const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess )
: OLEObjectsImpl_BASE( xParent, xContext, oleObjectIndexWrapper( xIndexAccess ) ) : OLEObjectsImpl_BASE( xParent, xContext, oleObjectIndexWrapper( xIndexAccess ) )
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
using namespace ::ooo::vba; using namespace ::ooo::vba;
using namespace ::com::sun::star; using namespace ::com::sun::star;
static OUString SDEFAULTCELLSTYLENAME("Default");
static css::uno::Any 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 ) 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) ...@@ -63,6 +62,8 @@ ScVbaStyles::getElementType() throw (uno::RuntimeException)
return cppu::UnoType<excel::XStyle>::get(); return cppu::UnoType<excel::XStyle>::get();
} }
namespace {
class EnumWrapper : public EnumerationHelper_BASE class EnumWrapper : public EnumerationHelper_BASE
{ {
uno::Reference<container::XIndexAccess > m_xIndexAccess; uno::Reference<container::XIndexAccess > m_xIndexAccess;
...@@ -85,6 +86,8 @@ public: ...@@ -85,6 +86,8 @@ public:
} }
}; };
}
uno::Reference< container::XEnumeration > SAL_CALL uno::Reference< container::XEnumeration > SAL_CALL
ScVbaStyles::createEnumeration() throw (uno::RuntimeException) ScVbaStyles::createEnumeration() throw (uno::RuntimeException)
{ {
...@@ -125,7 +128,7 @@ ScVbaStyles::Add( const OUString& _sName, const uno::Any& _aBasedOn ) throw (scr ...@@ -125,7 +128,7 @@ ScVbaStyles::Add( const OUString& _sName, const uno::Any& _aBasedOn ) throw (scr
{ {
mxNameContainerCellStyles->insertByName(_sName, uno::makeAny( xStyle) ); mxNameContainerCellStyles->insertByName(_sName, uno::makeAny( xStyle) );
} }
if (!sParentCellStyleName.equals(SDEFAULTCELLSTYLENAME)) if (!sParentCellStyleName.equals("Default"))
{ {
xStyle->setParentStyle( sParentCellStyleName ); xStyle->setParentStyle( sParentCellStyleName );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment