[Libreoffice-commits] core.git: 5 commits - oovbaapi/ooo scp2/source sw/source

Tor Lillqvist tml at collabora.com
Thu May 31 11:30:46 UTC 2018


 oovbaapi/ooo/vba/excel/XApplication.idl |   11 ----
 oovbaapi/ooo/vba/word/XApplication.idl  |    5 ++
 scp2/source/calc/registryitem_calc.scp  |   15 ++++++
 sw/source/ui/vba/vbaapplication.cxx     |   79 +++++++++++++++++++++++++++-----
 sw/source/ui/vba/vbaapplication.hxx     |    9 +++
 5 files changed, 97 insertions(+), 22 deletions(-)

New commits:
commit b7939ff897a173086643819451c7b2b4553c11c3
Author: Tor Lillqvist <tml at collabora.com>
Date:   Sun Apr 22 10:02:53 2018 +0300

    Add entries for Calc.Applcation
    
    Change-Id: Icee6f97abf9182621e43a0039b52c2f2e141fa01

diff --git a/scp2/source/calc/registryitem_calc.scp b/scp2/source/calc/registryitem_calc.scp
index beb890f472d9..7464e701ca7c 100644
--- a/scp2/source/calc/registryitem_calc.scp
+++ b/scp2/source/calc/registryitem_calc.scp
@@ -806,6 +806,21 @@ RegistryItem gid_Regitem_Openoffice_Calcdocument_1_Shell_Printto_Command
     Value = "\"<progpath>\program\soffice.exe\" -pt \"%2\" \"%1\"";
 End
 
+RegistryItem gid_Regitem_CalcApplication
+    ParentID = PREDEFINED_HKEY_CLASSES_ROOT;
+    ModuleID = gid_Module_Prg_Calc_Bin;
+    Subkey = "Calc.Application\CLSID";
+    Value = "{82154425-0FBF-11d4-8313-005004526AB4}";
+    Styles = ();
+End
+
+RegistryItem gid_Regitem_Clsid__82154425_0FBF_11d4_8313_005004526AB4__Localserver32
+    ParentID = PREDEFINED_HKEY_CLASSES_ROOT;
+    ModuleID = gid_Module_Prg_Wrt_Bin;
+    Subkey = "CLSID\{82154425-0FBF-11d4-8313-005004526AB4}\LocalServer32";
+    Value = "<progpath>\program\soffice.exe --nodefault --nologo";
+End
+
 // .fods
 
 RegistryItem gid_Regitem__Fods
commit fcf5a8f0f32dd97acee8271c1ccfc50e159667b5
Author: Tor Lillqvist <tml at collabora.com>
Date:   Sat Apr 21 01:50:16 2018 +0300

    Move two functions to perhaps less confusing locations
    
    Change-Id: I4360c588ee4866f4e680095c0cd0e8f7aceaa6d7

diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index 52cb6411d1ce..897be10a8c11 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -305,12 +305,6 @@ SwVbaApplication::getIID()
     return OUString("{82154421-0FBF-11d4-8313-005004526AB4}");
 }
 
-uno::Reference< frame::XModel >
-SwVbaApplication::getCurrentDocument()
-{
-    return getCurrentWordDoc( mxContext );
-}
-
 // XConnectable
 
 OUString SAL_CALL
@@ -337,8 +331,6 @@ SwVbaApplication::FindConnectionPoint()
     return xCP;
 }
 
-// XHelperInterface
-
 OUString
 SwVbaApplication::getServiceImplName()
 {
@@ -357,9 +349,10 @@ SwVbaApplication::getServiceNames()
     return aServiceNames;
 }
 
-SwVbaApplicationOutgoingConnectionPoint::SwVbaApplicationOutgoingConnectionPoint( SwVbaApplication* pApp ) :
-    mpApp(pApp)
+uno::Reference< frame::XModel >
+SwVbaApplication::getCurrentDocument()
 {
+    return getCurrentWordDoc( mxContext );
 }
 
 // XSinkCaller
@@ -376,6 +369,11 @@ SwVbaApplication::CallSinks( const OUString& Method, uno::Sequence< uno::Any >&
 
 // SwVbaApplicationOutgoingConnectionPoint
 
+SwVbaApplicationOutgoingConnectionPoint::SwVbaApplicationOutgoingConnectionPoint( SwVbaApplication* pApp ) :
+    mpApp(pApp)
+{
+}
+
 // XConnectionPoint
 sal_uInt32 SAL_CALL
 SwVbaApplicationOutgoingConnectionPoint::Advise( const uno::Reference< XSink >& Sink )
commit c4cd61e7efd0c898c7bd304747c595871e97be6f
Author: Tor Lillqvist <tml at collabora.com>
Date:   Sat Apr 21 00:29:04 2018 +0300

    Can simplify, our IDL compiler is more clever nowadays
    
    Change-Id: Ia5f8c0fcc8d1eb9f6ec3db82b947a16ed3762d01

diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl
index e08627651507..e315b27ddaf3 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -21,20 +21,9 @@
 
 #include <com/sun/star/beans/XExactName.idl>
 #include <com/sun/star/script/XInvocation.idl>
-#include <ooo/vba/XHelperInterface.idl>
-#include <ooo/vba/XAssistant.idl>
-#include <ooo/vba/XFileDialog.idl>
 
 module ooo {  module vba {  module excel {
 
-interface XRange;
-interface XWorkbook;
-interface XWorkbooks;
-interface XWorksheets;
-interface XWorksheetFunction;
-interface XWindow;
-interface XWorksheet;
-
 interface XApplication
 {
     // Application serves as WorksheetFunction object with little differences
commit fe1438c1bee05f81039787c8c533bdecaa56e90b
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Apr 17 00:35:56 2018 +0300

    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

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;
commit 569d5dc085dd093c7a1bc3ff97118ce8d2acb44c
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Apr 17 00:19:54 2018 +0300

    Add Move() to ooo.vba.word.XApplication
    
    Change-Id: Ib230e730f68a30b82915ed6d7898bf1c02690b70

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;


More information about the Libreoffice-commits mailing list