summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-04-17 00:19:54 +0300
committerTor Lillqvist <tml@collabora.com>2018-05-31 14:28:21 +0300
commit569d5dc085dd093c7a1bc3ff97118ce8d2acb44c (patch)
treec09c2faea39e792aa5bec5848d621faf219b5a04
parent5abf9d268d51afeaea2ed6f2a81a92ad46dea1cd (diff)
Add Move() to ooo.vba.word.XApplication
Change-Id: Ib230e730f68a30b82915ed6d7898bf1c02690b70
-rw-r--r--oovbaapi/ooo/vba/word/XApplication.idl1
-rw-r--r--sw/source/ui/vba/vbaapplication.cxx13
-rw-r--r--sw/source/ui/vba/vbaapplication.hxx1
3 files changed, 14 insertions, 1 deletions
diff --git a/oovbaapi/ooo/vba/word/XApplication.idl b/oovbaapi/ooo/vba/word/XApplication.idl
index ce047e0d08ac..52ece92a4178 100644
--- a/oovbaapi/ooo/vba/word/XApplication.idl
+++ b/oovbaapi/ooo/vba/word/XApplication.idl
@@ -44,6 +44,7 @@ interface XApplication : XConnectable
float CentimetersToPoints([in] float Centimeters );
void ShowMe();
void Resize( [in] long Width, [in] long Height );
+ void Move( [in] long Left, [in] long Top );
};
}; }; };
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index ee743252c698..bf6eb9011276 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column:100 -*- */
/*
* This file is part of the LibreOffice project.
*
@@ -233,11 +233,22 @@ void SAL_CALL SwVbaApplication::ShowMe()
void SAL_CALL SwVbaApplication::Resize( sal_Int32 Width, sal_Int32 Height )
{
+ // Have to do it like this as the Width and Height are hidden away in the ooo::vba::XWindowBase
+ // which ooo::vba::word::XApplication does not inherit from. SwVbaWindow, however, does inherit
+ // from XWindowBase. Ugh.
auto pWindow = getActiveSwVbaWindow();
pWindow->setWidth( Width );
pWindow->setHeight( Height );
}
+void SAL_CALL SwVbaApplication::Move( sal_Int32 Left, sal_Int32 Top )
+{
+ // See comment in Resize().
+ auto pWindow = getActiveSwVbaWindow();
+ pWindow->setLeft( Left );
+ pWindow->setTop( Top );
+}
+
// XInterfaceWithIID
OUString SAL_CALL
diff --git a/sw/source/ui/vba/vbaapplication.hxx b/sw/source/ui/vba/vbaapplication.hxx
index 137db4d95591..b2c94a3d39d9 100644
--- a/sw/source/ui/vba/vbaapplication.hxx
+++ b/sw/source/ui/vba/vbaapplication.hxx
@@ -79,6 +79,7 @@ public:
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;
+ virtual void SAL_CALL Move( sal_Int32 Left, sal_Int32 Top ) override;
// XInterfaceWithIID
virtual OUString SAL_CALL getIID() override;