Kaydet (Commit) 269c2913 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Add a WindowState attribute to ooo.vba.word.XApplication, too

It seems to be something 3rd-party VB6 clients expect to be able to
get and put.

Change-Id: If5079da8ba99fde74b12b9590737d575f6636210
üst a5a8346c
......@@ -34,6 +34,7 @@ interface XApplication : XConnectable
[attribute, readonly] XSelection Selection;
[attribute] boolean DisplayAutoCompleteTips;
[attribute] long EnableCancelKey;
[attribute] long WindowState;
any CommandBars( [in] any Index );
any Documents( [in] any Index );
......
......@@ -29,6 +29,7 @@
#include "vbadialogs.hxx"
#include <ooo/vba/XConnectionPoint.hpp>
#include <ooo/vba/word/WdEnableCancelKey.hpp>
#include <ooo/vba/word/WdWindowState.hpp>
#include <ooo/vba/word/XApplicationOutgoing.hpp>
#include <basic/sbuno.hxx>
#include <editeng/acorrcfg.hxx>
......@@ -189,6 +190,31 @@ void SAL_CALL SwVbaApplication::setEnableCancelKey( sal_Int32/* _enableCancelKey
// seems not supported in Writer
}
sal_Int32 SAL_CALL SwVbaApplication::getWindowState()
{
auto xWindow = getActiveWindow();
if (xWindow.is())
{
uno::Any aState = xWindow->getWindowState();
sal_Int32 nState;
if (aState >>= nState)
return nState;
}
return word::WdWindowState::wdWindowStateNormal; // ?
}
void SAL_CALL SwVbaApplication::setWindowState( sal_Int32 _windowstate )
{
auto xWindow = getActiveWindow();
if (xWindow.is())
{
uno::Any aState;
aState <<= _windowstate;
xWindow->setWindowState( aState );
}
}
float SAL_CALL SwVbaApplication::CentimetersToPoints( float Centimeters )
{
return VbaApplicationBase::CentimetersToPoints( Centimeters );
......
......@@ -71,6 +71,8 @@ public:
virtual void SAL_CALL setDisplayAutoCompleteTips( sal_Bool _displayAutoCompleteTips ) override;
virtual sal_Int32 SAL_CALL getEnableCancelKey() override;
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 float SAL_CALL CentimetersToPoints( float Centimeters ) override;
virtual void SAL_CALL ShowMe() 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