summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbacomments.cxx
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2010-06-15 20:02:53 +0200
committerDaniel Rentz <dr@openoffice.org>2010-06-15 20:02:53 +0200
commit5624330c20ccbbcbbbc90631130e7d2f7a06d0bd (patch)
tree27308cb5a7f8c3eca0655d99c1fd654d8580de7a /sc/source/ui/vba/vbacomments.cxx
parentfc1ac6254cde85bedfff1f8f78d678d4e10cc3dd (diff)
mib16: contributed bugfixes and various new symbols in VBA compatibility implementation
Diffstat (limited to 'sc/source/ui/vba/vbacomments.cxx')
-rw-r--r--sc/source/ui/vba/vbacomments.cxx29
1 files changed, 21 insertions, 8 deletions
diff --git a/sc/source/ui/vba/vbacomments.cxx b/sc/source/ui/vba/vbacomments.cxx
index 5090fa6f5ee6..a68dd4245741 100644
--- a/sc/source/ui/vba/vbacomments.cxx
+++ b/sc/source/ui/vba/vbacomments.cxx
@@ -34,30 +34,43 @@
using namespace ::ooo::vba;
using namespace ::com::sun::star;
-uno::Any AnnotationToComment( const uno::Any& aSource, uno::Reference< uno::XComponentContext > & xContext )
+uno::Any AnnotationToComment( const uno::Any& aSource, uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< frame::XModel >& xModel )
{
uno::Reference< sheet::XSheetAnnotation > xAnno( aSource, uno::UNO_QUERY_THROW );
uno::Reference< container::XChild > xChild( xAnno, uno::UNO_QUERY_THROW );
uno::Reference< table::XCellRange > xCellRange( xChild->getParent(), uno::UNO_QUERY_THROW );
// #FIXME needs to find the correct Parent
- return uno::makeAny( uno::Reference< excel::XComment > ( new ScVbaComment( uno::Reference< XHelperInterface >(), xContext, xCellRange ) ) );
+ return uno::makeAny( uno::Reference< excel::XComment > (
+ new ScVbaComment( uno::Reference< XHelperInterface >(), xContext, xModel, xCellRange ) ) );
}
class CommentEnumeration : public EnumerationHelperImpl
{
+ css::uno::Reference< css::frame::XModel > mxModel;
public:
- CommentEnumeration( const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration ) throw ( uno::RuntimeException ) : EnumerationHelperImpl( xContext, xEnumeration ) {}
+ CommentEnumeration(
+ const uno::Reference< uno::XComponentContext >& xContext,
+ const uno::Reference< container::XEnumeration >& xEnumeration,
+ const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) :
+ EnumerationHelperImpl( xContext, xEnumeration ),
+ mxModel( xModel, uno::UNO_SET_THROW )
+ {}
virtual uno::Any SAL_CALL nextElement() throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
{
- return AnnotationToComment( m_xEnumeration->nextElement(), m_xContext );
+ return AnnotationToComment( m_xEnumeration->nextElement(), m_xContext, mxModel );
}
};
-ScVbaComments::ScVbaComments( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess )
-: ScVbaComments_BASE( xParent, xContext, xIndexAccess )
+ScVbaComments::ScVbaComments(
+ const uno::Reference< XHelperInterface >& xParent,
+ const uno::Reference< uno::XComponentContext > & xContext,
+ const uno::Reference< frame::XModel >& xModel,
+ const uno::Reference< container::XIndexAccess >& xIndexAccess ) :
+ ScVbaComments_BASE( xParent, xContext, xIndexAccess ),
+ mxModel( xModel, uno::UNO_SET_THROW )
{
}
@@ -68,13 +81,13 @@ ScVbaComments::createEnumeration() throw (uno::RuntimeException)
{
uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xIndexAccess, uno::UNO_QUERY_THROW );
- return new CommentEnumeration( mxContext, xEnumAccess->createEnumeration() );
+ return new CommentEnumeration( mxContext, xEnumAccess->createEnumeration(), mxModel );
}
uno::Any
ScVbaComments::createCollectionObject( const css::uno::Any& aSource )
{
- return AnnotationToComment( aSource, mxContext );
+ return AnnotationToComment( aSource, mxContext, mxModel );
}
uno::Type