Use anonymous namespace for these. (mostly EnumWrapper)

Change-Id: Ice90e519bbd32a12de59d696a6dfedaaf45bd45e
This commit is contained in:
Matúš Kukan 2014-08-22 23:02:09 +02:00
parent af73a28e85
commit 7afacb97a7
4 changed files with 22 additions and 3 deletions

View file

@ -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 )
{

View file

@ -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)
{

View file

@ -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 ) )

View file

@ -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 );
}