32 uno::Reference< container::XIndexAccess > mxIndexAccess;
36 explicit CellsEnumWrapper( uno::Reference< container::XIndexAccess > xIndexAccess ) : mxIndexAccess(
std::move( xIndexAccess )),
mnIndex( 0 )
39 virtual sal_Bool SAL_CALL hasMoreElements( )
override
41 return ( mnIndex < mxIndexAccess->getCount() );
44 virtual uno::Any SAL_CALL nextElement( )
override
46 if( mnIndex < mxIndexAccess->getCount() )
48 return mxIndexAccess->getByIndex( mnIndex++ );
50 throw container::NoSuchElementException();
54class CellCollectionHelper :
public ::cppu::WeakImplHelper< container::XIndexAccess,
55 container::XEnumerationAccess >
58 uno::Reference< XHelperInterface >
mxParent;
59 uno::Reference< uno::XComponentContext >
mxContext;
60 uno::Reference< css::text::XTextTable > mxTextTable;
68 CellCollectionHelper( css::uno::Reference< ov::XHelperInterface > xParent, css::uno::Reference< css::uno::XComponentContext > xContext, css::uno::Reference< css::text::XTextTable > xTextTable, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ):
mxParent(
std::move( xParent )),
mxContext(
std::move( xContext )), mxTextTable(
std::move( xTextTable )),
mnLeft( nLeft ),
mnTop( nTop ),
mnRight( nRight ),
mnBottom( nBottom )
72 virtual sal_Int32 SAL_CALL getCount( )
override
76 virtual uno::Any SAL_CALL getByIndex( sal_Int32
Index )
override
79 throw css::lang::IndexOutOfBoundsException();
81 for( sal_Int32 row = mnTop; row <=
mnBottom; row++ )
85 if(
Index == ( ( row - mnTop ) * ( mnRight - mnLeft + 1 ) + ( col - mnLeft ) ) )
86 return uno::Any( uno::Reference< word::XCell >(
new SwVbaCell( mxParent, mxContext, mxTextTable, col, row ) ) );
89 throw css::lang::IndexOutOfBoundsException();
92 virtual uno::Type SAL_CALL getElementType( )
override
96 virtual sal_Bool SAL_CALL hasElements( )
override
101 virtual uno::Reference< container::XEnumeration > SAL_CALL createEnumeration( )
override
103 return new CellsEnumWrapper(
this );
109SwVbaCells::SwVbaCells(
const uno::Reference< XHelperInterface >& xParent,
const uno::Reference< uno::XComponentContext > & xContext,
const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom ) :
SwVbaCells_BASE( xParent, xContext,
uno::
Reference< container::XIndexAccess >( new CellCollectionHelper( xParent, xContext, xTextTable, nLeft, nTop, nRight, nBottom ) ) ), mxTextTable( xTextTable ),
mnTop( nTop ),
mnBottom( nBottom )
115 uno::Reference< word::XCell > xCell(
m_xIndexAccess->getByIndex( 0 ), uno::UNO_QUERY_THROW );
116 return xCell->getWidth();
122 while( nIndex < m_xIndexAccess->
getCount() )
124 uno::Reference< word::XCell > xCell(
m_xIndexAccess->getByIndex(
nIndex++ ), uno::UNO_QUERY_THROW );
125 xCell->setWidth( _width );
132 return xRow->getHeight();
140 xRow->setHeight( _height );
147 return xRow->getHeightRule();
155 xRow->setHeightRule( _heightrule );
162 while( nIndex < m_xIndexAccess->
getCount() )
164 uno::Reference< word::XCell > xCell(
m_xIndexAccess->getByIndex(
nIndex++ ), uno::UNO_QUERY_THROW );
165 xCell->SetWidth( width, rulestyle );
174 xRow->SetHeight( height, heightrule );
185uno::Reference< container::XEnumeration >
188 uno::Reference< container::XEnumerationAccess > xEnumAccess(
m_xIndexAccess, uno::UNO_QUERY_THROW );
189 return xEnumAccess->createEnumeration();
204uno::Sequence<OUString>
207 static uno::Sequence< OUString >
const sNames
unotools::WeakReference< AnimationNode > mxParent
css::uno::Reference< css::uno::XComponentContext > mxContext
virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent() override
css::uno::Reference< css::container::XIndexAccess > m_xIndexAccess
virtual ::sal_Int32 SAL_CALL getCount() override
virtual css::uno::Type SAL_CALL getElementType() override
virtual OUString getServiceImplName() override
virtual void SAL_CALL setWidth(::sal_Int32 _width) override
virtual void SAL_CALL SetWidth(float width, sal_Int32 rulestyle) override
virtual void SAL_CALL SetHeight(float height, sal_Int32 heightrule) override
virtual void SAL_CALL setHeightRule(::sal_Int32 _heightrule) override
virtual void SAL_CALL setHeight(const css::uno::Any &_height) override
css::uno::Reference< css::text::XTextTable > mxTextTable
virtual ::sal_Int32 SAL_CALL getHeightRule() override
virtual ::sal_Int32 SAL_CALL getWidth() override
virtual css::uno::Any createCollectionObject(const css::uno::Any &aSource) override
SwVbaCells(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::text::XTextTable > &xTextTable, sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom)
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
virtual css::uno::Any SAL_CALL getHeight() override
css::uno::Type const & get()
RttiCompleteObjectLocator col
::cppu::WeakImplHelper< css::container::XEnumeration > EnumerationHelper_BASE