diff options
-rw-r--r-- | oovbaapi/ooo/vba/word/XApplication.idl | 1 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaapplication.cxx | 13 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaapplication.hxx | 1 |
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; |