summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-04-17 00:35:56 +0300
committerTor Lillqvist <tml@collabora.com>2018-05-31 14:28:40 +0300
commitfe1438c1bee05f81039787c8c533bdecaa56e90b (patch)
tree8122402d3c3e1f8e88edf47ef746e98f3d70cb71
parent569d5dc085dd093c7a1bc3ff97118ce8d2acb44c (diff)
Add window geometry attributes, too, to ooo.vba.word.XApplication
Like the other similar attributes and methods added lately, they just forward to the corresponding attributes of the "active window". Whether setting and retrieving such then actually does something useful or not I don't know. My main concern is that Automation and COM clients at least won't complain and abort because of unimplemented APIs. Change-Id: Ia8d22e3137d314268ac6771bb355e9f0686f52dc
-rw-r--r--oovbaapi/ooo/vba/word/XApplication.idl4
-rw-r--r--sw/source/ui/vba/vbaapplication.cxx48
-rw-r--r--sw/source/ui/vba/vbaapplication.hxx8
3 files changed, 60 insertions, 0 deletions
diff --git a/oovbaapi/ooo/vba/word/XApplication.idl b/oovbaapi/ooo/vba/word/XApplication.idl
index 52ece92a4178..4b0f4f4e9a2a 100644
--- a/oovbaapi/ooo/vba/word/XApplication.idl
+++ b/oovbaapi/ooo/vba/word/XApplication.idl
@@ -35,6 +35,10 @@ interface XApplication : XConnectable
[attribute] boolean DisplayAutoCompleteTips;
[attribute] long EnableCancelKey;
[attribute] long WindowState;
+ [attribute] long Width;
+ [attribute] long Height;
+ [attribute] long Left;
+ [attribute] long Top;
any CommandBars( [in] any Index );
any Documents( [in] any Index );
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index bf6eb9011276..52cb6411d1ce 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -221,6 +221,54 @@ void SAL_CALL SwVbaApplication::setWindowState( sal_Int32 _windowstate )
}
}
+sal_Int32 SAL_CALL SwVbaApplication::getWidth()
+{
+ auto pWindow = getActiveSwVbaWindow();
+ return pWindow->getWidth();
+}
+
+void SAL_CALL SwVbaApplication::setWidth( sal_Int32 _width )
+{
+ auto pWindow = getActiveSwVbaWindow();
+ pWindow->setWidth( _width );
+}
+
+sal_Int32 SAL_CALL SwVbaApplication::getHeight()
+{
+ auto pWindow = getActiveSwVbaWindow();
+ return pWindow->getHeight();
+}
+
+void SAL_CALL SwVbaApplication::setHeight( sal_Int32 _height )
+{
+ auto pWindow = getActiveSwVbaWindow();
+ pWindow->setHeight( _height );
+}
+
+sal_Int32 SAL_CALL SwVbaApplication::getLeft()
+{
+ auto pWindow = getActiveSwVbaWindow();
+ return pWindow->getLeft();
+}
+
+void SAL_CALL SwVbaApplication::setLeft( sal_Int32 _left )
+{
+ auto pWindow = getActiveSwVbaWindow();
+ pWindow->setLeft( _left );
+}
+
+sal_Int32 SAL_CALL SwVbaApplication::getTop()
+{
+ auto pWindow = getActiveSwVbaWindow();
+ return pWindow->getTop();
+}
+
+void SAL_CALL SwVbaApplication::setTop( sal_Int32 _top )
+{
+ auto pWindow = getActiveSwVbaWindow();
+ pWindow->setTop( _top );
+}
+
float SAL_CALL SwVbaApplication::CentimetersToPoints( float Centimeters )
{
return VbaApplicationBase::CentimetersToPoints( Centimeters );
diff --git a/sw/source/ui/vba/vbaapplication.hxx b/sw/source/ui/vba/vbaapplication.hxx
index b2c94a3d39d9..101000158a4e 100644
--- a/sw/source/ui/vba/vbaapplication.hxx
+++ b/sw/source/ui/vba/vbaapplication.hxx
@@ -76,6 +76,14 @@ public:
virtual void SAL_CALL setEnableCancelKey( sal_Int32 _enableCancelKey ) override;
virtual sal_Int32 SAL_CALL getWindowState() override;
virtual void SAL_CALL setWindowState( sal_Int32 _windowstate ) override;
+ virtual sal_Int32 SAL_CALL getWidth() override;
+ virtual void SAL_CALL setWidth( sal_Int32 _width ) override;
+ virtual sal_Int32 SAL_CALL getHeight() override;
+ virtual void SAL_CALL setHeight( sal_Int32 _height ) override;
+ virtual sal_Int32 SAL_CALL getLeft() override;
+ virtual void SAL_CALL setLeft( sal_Int32 _left ) override;
+ virtual sal_Int32 SAL_CALL getTop() override;
+ virtual void SAL_CALL setTop( sal_Int32 _top ) override;
virtual float SAL_CALL CentimetersToPoints( float Centimeters ) override;
virtual void SAL_CALL ShowMe() override;
virtual void SAL_CALL Resize( sal_Int32 Width, sal_Int32 Height ) override;