summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/vba')
-rw-r--r--sc/source/ui/vba/vbadialog.hxx5
-rw-r--r--sc/source/ui/vba/vbadialogs.hxx4
-rw-r--r--sc/source/ui/vba/vbapagesetup.cxx8
-rw-r--r--sc/source/ui/vba/vbapagesetup.hxx1
-rw-r--r--sc/source/ui/vba/vbawindow.cxx6
-rw-r--r--sc/source/ui/vba/vbawindow.hxx1
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx10
-rw-r--r--sc/source/ui/vba/vbaworkbook.hxx5
8 files changed, 31 insertions, 9 deletions
diff --git a/sc/source/ui/vba/vbadialog.hxx b/sc/source/ui/vba/vbadialog.hxx
index 9317cbfaf20f..46ea538a84dd 100644
--- a/sc/source/ui/vba/vbadialog.hxx
+++ b/sc/source/ui/vba/vbadialog.hxx
@@ -27,7 +27,7 @@ typedef cppu::ImplInheritanceHelper< VbaDialogBase, ov::excel::XDialog > ScVbaDi
class ScVbaDialog : public ScVbaDialog_BASE
{
public:
- ScVbaDialog( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nIndex ):ScVbaDialog_BASE( xParent, xContext, xModel, nIndex ) {}
+ ScVbaDialog( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nIndex ):ScVbaDialog_BASE( xParent, xContext, nIndex ), m_xModel(xModel) {}
// Methods
virtual OUString mapIndexToName( sal_Int32 nIndex ) override;
@@ -35,6 +35,9 @@ public:
virtual OUString getServiceImplName() override;
virtual css::uno::Sequence<OUString> getServiceNames() override;
+ virtual css::uno::Reference< css::frame::XModel > getModel() const override { return m_xModel; }
+private:
+ css::uno::Reference< css::frame::XModel > m_xModel;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbadialogs.hxx b/sc/source/ui/vba/vbadialogs.hxx
index 97cbbda0442a..d5c7c5326655 100644
--- a/sc/source/ui/vba/vbadialogs.hxx
+++ b/sc/source/ui/vba/vbadialogs.hxx
@@ -30,7 +30,7 @@ typedef cppu::ImplInheritanceHelper< VbaDialogsBase, ov::excel::XDialogs > ScVba
class ScVbaDialogs : public ScVbaDialogs_BASE
{
public:
- ScVbaDialogs( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ): ScVbaDialogs_BASE( xParent, xContext, xModel ) {}
+ ScVbaDialogs( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ): ScVbaDialogs_BASE( xParent, xContext ), m_xModel(xModel) {}
// XCollection
virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index ) override;
@@ -38,6 +38,8 @@ public:
// XHelperInterface
virtual OUString getServiceImplName() override;
virtual css::uno::Sequence<OUString> getServiceNames() override;
+private:
+ css::uno::Reference< css::frame::XModel > m_xModel;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx
index 009570e32dca..fa05584049a5 100644
--- a/sc/source/ui/vba/vbapagesetup.cxx
+++ b/sc/source/ui/vba/vbapagesetup.cxx
@@ -44,11 +44,13 @@ using namespace ::ooo::vba;
ScVbaPageSetup::ScVbaPageSetup(const uno::Reference< XHelperInterface >& xParent,
const uno::Reference< uno::XComponentContext >& xContext,
uno::Reference< sheet::XSpreadsheet > xSheet,
- const uno::Reference< frame::XModel >& xModel):
- ScVbaPageSetup_BASE( xParent, xContext ), mxSheet(std::move( xSheet )), mbIsLandscape( false )
+ const uno::Reference< frame::XModel >& xModel)
+: ScVbaPageSetup_BASE( xParent, xContext ),
+ mxModel(xModel),
+ mxSheet(std::move( xSheet )),
+ mbIsLandscape( false )
{
// query for current page style
- mxModel.set( xModel, uno::UNO_SET_THROW );
uno::Reference< beans::XPropertySet > xSheetProps( mxSheet, uno::UNO_QUERY_THROW );
uno::Any aValue = xSheetProps->getPropertyValue(u"PageStyle"_ustr);
OUString aStyleName;
diff --git a/sc/source/ui/vba/vbapagesetup.hxx b/sc/source/ui/vba/vbapagesetup.hxx
index 6f2f8b45c51f..8444b98a9831 100644
--- a/sc/source/ui/vba/vbapagesetup.hxx
+++ b/sc/source/ui/vba/vbapagesetup.hxx
@@ -28,6 +28,7 @@ typedef cppu::ImplInheritanceHelper<VbaPageSetupBase, ov::excel::XPageSetup> ScV
class ScVbaPageSetup : public ScVbaPageSetup_BASE
{
+ css::uno::Reference<css::frame::XModel> mxModel;
css::uno::Reference<css::sheet::XSpreadsheet> mxSheet;
bool mbIsLandscape;
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index 2c860eadcf86..c9847e6d523d 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -192,7 +192,8 @@ ScVbaWindow::ScVbaWindow(
const uno::Reference< uno::XComponentContext >& xContext,
const uno::Reference< frame::XModel >& xModel,
const uno::Reference< frame::XController >& xController ) :
- WindowImpl_BASE( xParent, xContext, xModel, xController )
+ WindowImpl_BASE( xParent, xContext, xController ),
+ m_xModel(xModel)
{
init();
}
@@ -200,7 +201,8 @@ ScVbaWindow::ScVbaWindow(
ScVbaWindow::ScVbaWindow(
const uno::Sequence< uno::Any >& args,
const uno::Reference< uno::XComponentContext >& xContext ) :
- WindowImpl_BASE( args, xContext )
+ WindowImpl_BASE( args, xContext ),
+ m_xModel(getXSomethingFromArgs< frame::XModel >( args, 1, false ))
{
init();
}
diff --git a/sc/source/ui/vba/vbawindow.hxx b/sc/source/ui/vba/vbawindow.hxx
index c4c0a0becb34..bb84719a6be3 100644
--- a/sc/source/ui/vba/vbawindow.hxx
+++ b/sc/source/ui/vba/vbawindow.hxx
@@ -32,6 +32,7 @@ typedef cppu::ImplInheritanceHelper< VbaWindowBase, ov::excel::XWindow > WindowI
class ScVbaWindow : public WindowImpl_BASE
{
private:
+ css::uno::Reference<css::frame::XModel> m_xModel;
css::uno::Reference< ov::excel::XPane > m_xPane;
void init();
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 0313c86c12a8..8c8fcc424757 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -188,13 +188,19 @@ ScVbaWorkbook::init()
pShell->RegisterAutomationWorkbookObject( this );
}
-ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, css::uno::Reference< css::frame::XModel > const & xModel ) : ScVbaWorkbook_BASE( xParent, xContext, xModel )
+ScVbaWorkbook::ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ css::uno::Reference< css::frame::XModel > const & xModel )
+: ScVbaWorkbook_BASE( xParent, xContext ),
+ mxModel(xModel)
{
init();
}
ScVbaWorkbook::ScVbaWorkbook( uno::Sequence< uno::Any> const & args,
- uno::Reference< uno::XComponentContext> const & xContext ) : ScVbaWorkbook_BASE( args, xContext )
+ uno::Reference< uno::XComponentContext> const & xContext )
+: ScVbaWorkbook_BASE( args, xContext ),
+ mxModel(getXSomethingFromArgs< frame::XModel >( args, 1 ))
{
init();
}
diff --git a/sc/source/ui/vba/vbaworkbook.hxx b/sc/source/ui/vba/vbaworkbook.hxx
index e6a838b1ab1e..d6ee4b016779 100644
--- a/sc/source/ui/vba/vbaworkbook.hxx
+++ b/sc/source/ui/vba/vbaworkbook.hxx
@@ -31,6 +31,11 @@ class ScVbaWorkbook : public ScVbaWorkbook_BASE
static bool setFilterPropsFromFormat( sal_Int32 nFormat, css::uno::Sequence< css::beans::PropertyValue >& rProps );
void init();
+ css::uno::Reference< css::frame::XModel > mxModel;
+
+protected:
+ virtual css::uno::Reference< css::frame::XModel > getModel() const override { return mxModel; }
+
public:
ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
css::uno::Reference< css::frame::XModel > const & xModel );