Kaydet (Commit) 5abf9d26 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Add Resize() method to ooo.vba.word.XApplication

Seems to be commonly called by 3rd-party Automation (and VB6) client
code.

Change-Id: I29ee5e7d95f3da2ffae0fac44151148be6e272ee
üst 269c2913
...@@ -43,6 +43,7 @@ interface XApplication : XConnectable ...@@ -43,6 +43,7 @@ interface XApplication : XConnectable
any ListGalleries( [in] any aIndex ); any ListGalleries( [in] any aIndex );
float CentimetersToPoints([in] float Centimeters ); float CentimetersToPoints([in] float Centimeters );
void ShowMe(); void ShowMe();
void Resize( [in] long Width, [in] long Height );
}; };
}; }; }; }; }; };
......
...@@ -99,8 +99,8 @@ SwVbaApplication::getActiveDocument() ...@@ -99,8 +99,8 @@ SwVbaApplication::getActiveDocument()
return new SwVbaDocument( this, mxContext, getCurrentDocument() ); return new SwVbaDocument( this, mxContext, getCurrentDocument() );
} }
uno::Reference< word::XWindow > SAL_CALL SwVbaWindow *
SwVbaApplication::getActiveWindow() SwVbaApplication::getActiveSwVbaWindow()
{ {
// #FIXME so far can't determine Parent // #FIXME so far can't determine Parent
uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW ); uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW );
...@@ -108,6 +108,12 @@ SwVbaApplication::getActiveWindow() ...@@ -108,6 +108,12 @@ SwVbaApplication::getActiveWindow()
return new SwVbaWindow( uno::Reference< XHelperInterface >(), mxContext, xModel, xController ); return new SwVbaWindow( uno::Reference< XHelperInterface >(), mxContext, xModel, xController );
} }
uno::Reference< word::XWindow > SAL_CALL
SwVbaApplication::getActiveWindow()
{
return getActiveSwVbaWindow();
}
uno::Reference<word::XSystem > SAL_CALL uno::Reference<word::XSystem > SAL_CALL
SwVbaApplication::getSystem() SwVbaApplication::getSystem()
{ {
...@@ -225,6 +231,13 @@ void SAL_CALL SwVbaApplication::ShowMe() ...@@ -225,6 +231,13 @@ void SAL_CALL SwVbaApplication::ShowMe()
// No idea what we should or could do // No idea what we should or could do
} }
void SAL_CALL SwVbaApplication::Resize( sal_Int32 Width, sal_Int32 Height )
{
auto pWindow = getActiveSwVbaWindow();
pWindow->setWidth( Width );
pWindow->setHeight( Height );
}
// XInterfaceWithIID // XInterfaceWithIID
OUString SAL_CALL OUString SAL_CALL
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
#include <vbahelper/vbaapplicationbase.hxx> #include <vbahelper/vbaapplicationbase.hxx>
#include <cppuhelper/implbase.hxx> #include <cppuhelper/implbase.hxx>
#include "vbawindow.hxx"
typedef cppu::ImplInheritanceHelper< VbaApplicationBase, ooo::vba::word::XApplication, ooo::vba::XSinkCaller > SwVbaApplication_BASE; typedef cppu::ImplInheritanceHelper< VbaApplicationBase, ooo::vba::word::XApplication, ooo::vba::XSinkCaller > SwVbaApplication_BASE;
// This class is currently not a singleton. One instance is created per document with (potential?) // This class is currently not a singleton. One instance is created per document with (potential?)
...@@ -47,6 +49,7 @@ typedef cppu::ImplInheritanceHelper< VbaApplicationBase, ooo::vba::word::XApplic ...@@ -47,6 +49,7 @@ typedef cppu::ImplInheritanceHelper< VbaApplicationBase, ooo::vba::word::XApplic
class SwVbaApplication : public SwVbaApplication_BASE class SwVbaApplication : public SwVbaApplication_BASE
{ {
std::vector<css::uno::Reference< ooo::vba::XSink >> mvSinks; std::vector<css::uno::Reference< ooo::vba::XSink >> mvSinks;
SwVbaWindow* getActiveSwVbaWindow();
public: public:
explicit SwVbaApplication( css::uno::Reference< css::uno::XComponentContext >& m_xContext ); explicit SwVbaApplication( css::uno::Reference< css::uno::XComponentContext >& m_xContext );
...@@ -75,6 +78,7 @@ public: ...@@ -75,6 +78,7 @@ public:
virtual void SAL_CALL setWindowState( sal_Int32 _windowstate ) override; virtual void SAL_CALL setWindowState( sal_Int32 _windowstate ) override;
virtual float SAL_CALL CentimetersToPoints( float Centimeters ) override; virtual float SAL_CALL CentimetersToPoints( float Centimeters ) override;
virtual void SAL_CALL ShowMe() override; virtual void SAL_CALL ShowMe() override;
virtual void SAL_CALL Resize( sal_Int32 Width, sal_Int32 Height ) override;
// XInterfaceWithIID // XInterfaceWithIID
virtual OUString SAL_CALL getIID() override; virtual OUString SAL_CALL getIID() override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment