[Libreoffice-commits] core.git: 2 commits - offapi/com offapi/type_reference offapi/UnoApi_offapi.mk sw/source UnoControls/source

Noel Grandin noel at peralex.com
Thu Jul 18 01:43:05 PDT 2013


 UnoControls/source/controls/framecontrol.cxx |   12 
 UnoControls/source/inc/framecontrol.hxx      |  445 +++++----------------------
 offapi/UnoApi_offapi.mk                      |    3 
 offapi/com/sun/star/frame/FrameControl.idl   |   24 -
 offapi/com/sun/star/frame/XFrameControl.idl  |   65 +++
 offapi/type_reference/offapi.rdb             |binary
 sw/source/ui/inc/unotools.hxx                |   16 
 sw/source/ui/utlui/unotools.cxx              |   84 ++---
 8 files changed, 222 insertions(+), 427 deletions(-)

New commits:
commit 32eaa77db33b3b1f5793e92167b9f8c2708ea543
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jul 8 13:13:28 2013 +0200

    fdo#46808, Convert frame::FrameControl service to new style
    
    Change-Id: I38fc91e70d99472a4336250acd5c7dc3457b21ab

diff --git a/UnoControls/source/controls/framecontrol.cxx b/UnoControls/source/controls/framecontrol.cxx
index c2bfcde..ae4556d 100644
--- a/UnoControls/source/controls/framecontrol.cxx
+++ b/UnoControls/source/controls/framecontrol.cxx
@@ -46,6 +46,18 @@ using namespace ::com::sun::star::util  ;
 
 namespace unocontrols{
 
+#define SERVICENAME_FRAMECONTROL                        "com.sun.star.frame.FrameControl"
+#define IMPLEMENTATIONNAME_FRAMECONTROL                 "stardiv.UnoControls.FrameControl"
+#define PROPERTYNAME_LOADERARGUMENTS                    "LoaderArguments"
+#define PROPERTYNAME_COMPONENTURL                       "ComponentURL"
+#define PROPERTYNAME_FRAME                              "Frame"
+#define ERRORTEXT_VOSENSHURE                            "This is an invalid property handle."
+#define PROPERTY_COUNT                                  3                                                       // you must count the propertys
+#define PROPERTYHANDLE_COMPONENTURL                     0                                                       // Id must be the index into the array
+#define PROPERTYHANDLE_FRAME                            1
+#define PROPERTYHANDLE_LOADERARGUMENTS                  2
+
+
 //______________________________________________________________________________________________________________
 //  construct/destruct
 //______________________________________________________________________________________________________________
diff --git a/UnoControls/source/inc/framecontrol.hxx b/UnoControls/source/inc/framecontrol.hxx
index ed97527..d24490a 100644
--- a/UnoControls/source/inc/framecontrol.hxx
+++ b/UnoControls/source/inc/framecontrol.hxx
@@ -21,6 +21,7 @@
 #define _UNOCONTROLS_FRAMECONTROL_CTRL_HXX
 
 #include <com/sun/star/frame/XFrameActionListener.hpp>
+#include <com/sun/star/frame/XFrameControl.hpp>
 #include <com/sun/star/frame/XComponentLoader.hpp>
 #include <com/sun/star/frame/XFrame2.hpp>
 #include <com/sun/star/frame/FrameActionEvent.hpp>
@@ -39,23 +40,13 @@
 
 namespace unocontrols{
 
-#define SERVICENAME_FRAMECONTROL                        "com.sun.star.frame.FrameControl"
-#define IMPLEMENTATIONNAME_FRAMECONTROL                 "stardiv.UnoControls.FrameControl"
-#define PROPERTYNAME_LOADERARGUMENTS                    "LoaderArguments"
-#define PROPERTYNAME_COMPONENTURL                       "ComponentURL"
-#define PROPERTYNAME_FRAME                              "Frame"
-#define ERRORTEXT_VOSENSHURE                            "This is an invalid property handle."
-#define PROPERTY_COUNT                                  3                                                       // you must count the propertys
-#define PROPERTYHANDLE_COMPONENTURL                     0                                                       // Id must be the index into the array
-#define PROPERTYHANDLE_FRAME                            1
-#define PROPERTYHANDLE_LOADERARGUMENTS                  2
-
 //______________________________________________________________________________________________________________
 //  class
 //______________________________________________________________________________________________________________
 
 class FrameControl  : public ::com::sun::star::awt::XControlModel
                     , public ::com::sun::star::lang::XConnectionPointContainer
+                    , public ::com::sun::star::frame::XFrameControl
                     , public BaseControl                                // This order is necessary for right initialization of m_aMutex!
                     , public ::cppu::OBroadcastHelper
                     , public ::cppu::OPropertySetHelper
@@ -184,6 +175,104 @@ public:
         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&    xListener
     ) throw( ::com::sun::star::uno::RuntimeException );
 
+
+    //__________________________________________________________________________________________________________
+    //  XFrameControl
+    //__________________________________________________________________________________________________________
+
+    virtual rtl::OUString SAL_CALL getComponentURL()
+        throw( ::com::sun::star::uno::RuntimeException )
+    { return m_sComponentURL; }
+    virtual void SAL_CALL setComponentURL(const rtl::OUString& rVal)
+        throw( ::com::sun::star::uno::RuntimeException )
+    { m_sComponentURL = rVal; }
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > SAL_CALL getFrame()
+        throw( ::com::sun::star::uno::RuntimeException )
+    { return m_xFrame; }
+    virtual void SAL_CALL setFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame2 > & rxFrame)
+        throw( ::com::sun::star::uno::RuntimeException )
+    { m_xFrame = rxFrame; }
+    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getLoaderArguments()
+        throw( ::com::sun::star::uno::RuntimeException )
+    { return m_seqLoaderArguments; }
+    virtual void SAL_CALL setLoaderArguments(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & rVal)
+        throw( ::com::sun::star::uno::RuntimeException )
+    { m_seqLoaderArguments = rVal; }
+
+    //__________________________________________________________________________________________________________
+    //  overrides to remove inheritance ambiguity
+    //__________________________________________________________________________________________________________
+    virtual css::uno::Reference<css::awt::XWindowPeer> getPeer() throw (css::uno::RuntimeException)
+        { return BaseControl::getPeer(); }
+    virtual css::awt::Rectangle getPosSize() throw (css::uno::RuntimeException)
+        { return BaseControl::getPosSize(); }
+    virtual void setPosSize(sal_Int32 p1, sal_Int32 p2, sal_Int32 p3, sal_Int32 p4, sal_Int16 p5) throw (css::uno::RuntimeException)
+        { return BaseControl::setPosSize(p1, p2, p3, p4, p5); }
+    virtual void addEventListener(const css::uno::Reference<css::lang::XEventListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::addEventListener(p1); }
+    virtual void removeEventListener(const css::uno::Reference<css::lang::XEventListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::removeEventListener(p1); }
+    virtual void setVisible(sal_Bool p1) throw (css::uno::RuntimeException)
+       { return BaseControl::setVisible(p1); }
+    virtual void setEnable(sal_Bool p1) throw (css::uno::RuntimeException)
+        { return BaseControl::setEnable(p1); }
+    virtual void setFocus() throw (css::uno::RuntimeException)
+        { return BaseControl::setFocus(); }
+    virtual void addWindowListener(const css::uno::Reference<css::awt::XWindowListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::addWindowListener(p1); }
+    virtual void removeWindowListener(const css::uno::Reference<css::awt::XWindowListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::removeWindowListener(p1); }
+    virtual void addFocusListener(const css::uno::Reference<css::awt::XFocusListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::addFocusListener(p1); }
+    virtual void removeFocusListener(const css::uno::Reference<css::awt::XFocusListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::removeFocusListener(p1); }
+    virtual void addKeyListener(const css::uno::Reference<css::awt::XKeyListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::addKeyListener(p1); }
+    virtual void removeKeyListener(const css::uno::Reference<css::awt::XKeyListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::removeKeyListener(p1); }
+    virtual void addMouseListener(const css::uno::Reference<css::awt::XMouseListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::addMouseListener(p1); }
+    virtual void removeMouseListener(const css::uno::Reference<css::awt::XMouseListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::removeMouseListener(p1); }
+    virtual void addMouseMotionListener(const css::uno::Reference<css::awt::XMouseMotionListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::addMouseMotionListener(p1); }
+    virtual void removeMouseMotionListener(const css::uno::Reference<css::awt::XMouseMotionListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::removeMouseMotionListener(p1); }
+    virtual void addPaintListener(const css::uno::Reference<css::awt::XPaintListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::addPaintListener(p1); }
+    virtual void removePaintListener(const css::uno::Reference<css::awt::XPaintListener>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::removePaintListener(p1); }
+    virtual css::awt::Size getSize() throw (css::uno::RuntimeException)
+        { return BaseControl::getSize(); }
+    virtual void draw(sal_Int32 p1, sal_Int32 p2) throw (css::uno::RuntimeException)
+        { return BaseControl::draw(p1, p2); }
+    virtual void setZoom(float p1, float p2) throw (css::uno::RuntimeException)
+        { return BaseControl::setZoom(p1, p2); }
+    virtual void setPropertyValue(const rtl::OUString& p1, const css::uno::Any& p2) throw (css::uno::RuntimeException)
+        { return ::cppu::OPropertySetHelper::setPropertyValue(p1, p2); }
+    virtual css::uno::Any getPropertyValue(const rtl::OUString& p1) throw (css::uno::RuntimeException)
+        { return ::cppu::OPropertySetHelper::getPropertyValue(p1); }
+    virtual void addPropertyChangeListener(const rtl::OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) throw (css::uno::RuntimeException)
+        { return ::cppu::OPropertySetHelper::addPropertyChangeListener(p1, p2); }
+    virtual void removePropertyChangeListener(const rtl::OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) throw (css::uno::RuntimeException)
+        { return ::cppu::OPropertySetHelper::removePropertyChangeListener(p1, p2); }
+    virtual void addVetoableChangeListener(const rtl::OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) throw (css::uno::RuntimeException)
+        { return ::cppu::OPropertySetHelper::addVetoableChangeListener(p1, p2); }
+    virtual void removeVetoableChangeListener(const rtl::OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) throw (css::uno::RuntimeException)
+        { return ::cppu::OPropertySetHelper::removeVetoableChangeListener(p1, p2); }
+    virtual void setContext(const css::uno::Reference<css::uno::XInterface>& p1) throw (css::uno::RuntimeException)
+        { return BaseControl::setContext(p1); }
+    virtual css::uno::Reference<css::uno::XInterface> getContext() throw (css::uno::RuntimeException)
+        { return BaseControl::getContext(); }
+    virtual css::uno::Reference<css::awt::XView> getView() throw (css::uno::RuntimeException)
+        { return BaseControl::getView(); }
+    virtual void setDesignMode(sal_Bool p1) throw (css::uno::RuntimeException)
+        { return BaseControl::setDesignMode(p1); }
+    virtual sal_Bool isDesignMode() throw (css::uno::RuntimeException)
+        { return BaseControl::isDesignMode(); }
+    virtual sal_Bool isTransparent() throw (css::uno::RuntimeException)
+        { return BaseControl::isTransparent(); }
+
     //__________________________________________________________________________________________________________
     //  impl but public methods to register service!
     //__________________________________________________________________________________________________________
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 174c03b..592f1b9 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -199,6 +199,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/frame,\
 	DispatchRecorderSupplier \
 	DocumentTemplates \
 	Frame \
+	FrameControl \
 	FrameLoaderFactory \
 	GlobalEventBroadcaster \
 	LayoutManager \
@@ -942,7 +943,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/frame,\
 	DesktopTask \
 	DesktopTasks \
 	DispatchProvider \
-	FrameControl \
 	FrameLoader \
 	FramesContainer \
 	PopupMenuController \
@@ -2586,6 +2586,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/frame,\
 	XFrame \
 	XFrame2 \
 	XFrameActionListener \
+	XFrameControl \
 	XFrameLoader \
 	XFrameLoaderQuery \
 	XFrameSetModel \
diff --git a/offapi/com/sun/star/frame/FrameControl.idl b/offapi/com/sun/star/frame/FrameControl.idl
index 7a85e6d..692d239 100644
--- a/offapi/com/sun/star/frame/FrameControl.idl
+++ b/offapi/com/sun/star/frame/FrameControl.idl
@@ -19,8 +19,7 @@
 #ifndef __com_sun_star_frame_FrameControl_idl__
 #define __com_sun_star_frame_FrameControl_idl__
 
-#include <com/sun/star/awt/UnoControl.idl>
-#include <com/sun/star/beans/XPropertySet.idl>
+#include <com/sun/star/frame/XFrameControl.idl>
 
 
  module com {  module sun {  module star {  module frame {
@@ -34,26 +33,7 @@
     any UI.
     </p>
  */
-published service FrameControl
-{
-    /** the base service of all controls
-     */
-    service com::sun::star::awt::UnoControl;
-
-    /** contains the type of the component which is loaded into the frame,
-        or the document which implicitly specifies the type
-     */
-    [property] string ComponentUrl;
-
-    /** the frame held by this control
-
-        <p>
-        The Frame is created if the control
-        is shown and the #ComponentUrl is set.
-        </p>
-     */
-    [property, readonly] string Frame;
-};
+published service FrameControl : XFrameControl;
 
 
 }; }; }; };
diff --git a/offapi/com/sun/star/frame/XFrameControl.idl b/offapi/com/sun/star/frame/XFrameControl.idl
new file mode 100644
index 0000000..0375f34
--- /dev/null
+++ b/offapi/com/sun/star/frame/XFrameControl.idl
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_frame_XFrameControl_idl__
+#define __com_sun_star_frame_XFrameControl_idl__
+
+#include <com/sun/star/awt/UnoControl.idl>
+#include <com/sun/star/beans/XPropertySet.idl>
+#include <com/sun/star/beans/PropertyValue.idl>
+#include <com/sun/star/frame/XFrame2.idl>
+
+
+ module com {  module sun {  module star {  module frame {
+
+/**
+    Unified interface for the FrameControl service.
+    This is not the complete set of interfaces this service implements, just the bare minimum
+    that we use internally.
+
+    @since LibreOffice 4.2
+ */
+published interface XFrameControl
+{
+    interface com::sun::star::awt::XControl;
+
+    interface com::sun::star::awt::XWindow;
+
+    /** contains the type of the component which is loaded into the frame,
+        or the document which implicitly specifies the type
+     */
+    [attribute] string ComponentURL;
+
+    /** the frame held by this control
+
+        <p>
+        The Frame is created if the control
+        is shown and the #ComponentUrl is set.
+        </p>
+     */
+    [attribute] com::sun::star::frame::XFrame2 Frame;
+
+    [attribute] sequence< ::com::sun::star::beans::PropertyValue > LoaderArguments;
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/type_reference/offapi.rdb b/offapi/type_reference/offapi.rdb
index fd83b22..667b727 100644
Binary files a/offapi/type_reference/offapi.rdb and b/offapi/type_reference/offapi.rdb differ
diff --git a/sw/source/ui/inc/unotools.hxx b/sw/source/ui/inc/unotools.hxx
index 33a8cba..87b296f 100644
--- a/sw/source/ui/inc/unotools.hxx
+++ b/sw/source/ui/inc/unotools.hxx
@@ -26,11 +26,11 @@
 #include <vcl/fixed.hxx>
 #include <vcl/layout.hxx>
 #include <actctrl.hxx>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/text/XTextCursor.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/awt/XControl.hpp>
 #include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XFrameControl.hpp>
+#include <com/sun/star/text/XTextCursor.hpp>
 #include <tools/resary.hxx>
 #include "swdllapi.h"
 
@@ -68,7 +68,7 @@ class SwView;
 
 class SW_DLLPUBLIC SwOneExampleFrame
 {
-    ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >         _xControl;
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameControl >  m_xFrameControl;
     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >         _xModel;
     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >    _xController;
     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor >     _xCursor;
@@ -102,10 +102,10 @@ public:
                     String* pURL = 0);
     ~SwOneExampleFrame();
 
-    ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > &       GetControl()    {return _xControl; }
-    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &       GetModel()      {return _xModel;}
-    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > &  GetController() {return _xController;}
-    ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > &   GetTextCursor() {return _xCursor;}
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameControl > & GetFrameControl() {return m_xFrameControl; }
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > &        GetModel()      {return _xModel;}
+    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > &   GetController() {return _xController;}
+    ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > &    GetTextCursor() {return _xCursor;}
 
     void ClearDocument( sal_Bool bStartTimer = sal_False );
 
diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index a0fd65d..62fadcc 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -38,6 +38,7 @@
 #include <com/sun/star/awt/PosSize.hpp>
 #include <com/sun/star/view/XViewSettingsSupplier.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/frame/FrameControl.hpp>
 #include <com/sun/star/frame/XLayoutManager.hpp>
 #include <comphelper/processfactory.hxx>
 #include <sfx2/dispatch.hxx>
@@ -106,62 +107,51 @@ SwOneExampleFrame::~SwOneExampleFrame()
 
 void SwOneExampleFrame::CreateControl()
 {
-    if(_xControl.is())
+    if(m_xFrameControl.is())
         return ;
     uno::Reference< lang::XMultiServiceFactory >
                                     xMgr = comphelper::getProcessServiceFactory();
     uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
-    uno::Reference< uno::XInterface >  xInst = xMgr->createInstance( "com.sun.star.frame.FrameControl" );
-    _xControl = uno::Reference< awt::XControl >(xInst, uno::UNO_QUERY);
-    if(_xControl.is())
-    {
-        uno::Reference< awt::XWindowPeer >  xParent( aTopWindow.GetComponentInterface() );
+    m_xFrameControl = frame::FrameControl::create(xContext);
 
-        uno::Reference< awt::XToolkit >  xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW );
+    uno::Reference< awt::XWindowPeer >  xParent( aTopWindow.GetComponentInterface() );
 
-        _xControl->createPeer( xToolkit, xParent );
+    uno::Reference< awt::XToolkit >  xToolkit( awt::Toolkit::create(xContext), uno::UNO_QUERY_THROW );
 
-        uno::Reference< awt::XWindow >  xWin( _xControl, uno::UNO_QUERY );
-        xWin->setVisible(sal_False);
-        Size aWinSize(aTopWindow.GetOutputSizePixel());
-        xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
-
-        uno::Reference< beans::XPropertySet >  xPrSet(xInst, uno::UNO_QUERY);
-        uno::Any aURL;
-        // create new doc
-        OUString sTempURL(cFactory);
-        if(sArgumentURL.Len())
-            sTempURL = sArgumentURL;
-        aURL <<= sTempURL;
-
-        uno::Sequence<beans::PropertyValue> aSeq(3);
-        beans::PropertyValue* pValues = aSeq.getArray();
-        pValues[0].Name = "ReadOnly";
-        sal_Bool bTrue = sal_True;
-        pValues[0].Value.setValue(&bTrue, ::getBooleanCppuType());
-        pValues[1].Name = "OpenFlags";
-        pValues[1].Value <<= OUString("-RB");
-        pValues[2].Name = "Referer";
-        pValues[2].Value <<= OUString("private:user");
-        uno::Any aArgs;
-        aArgs.setValue(&aSeq, ::getCppuType((uno::Sequence<beans::PropertyValue>*)0));
+    m_xFrameControl->createPeer( xToolkit, xParent );
 
-        xPrSet->setPropertyValue( "LoaderArguments", aArgs );
-        //save and set readonly???
+    m_xFrameControl->setVisible(sal_False);
+    Size aWinSize(aTopWindow.GetOutputSizePixel());
+    m_xFrameControl->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
 
-        xPrSet->setPropertyValue("ComponentURL", aURL);
+    // create new doc
+    OUString sTempURL(cFactory);
+    if(sArgumentURL.Len())
+        sTempURL = sArgumentURL;
 
-        aLoadedTimer.Start();
-        bServiceAvailable = sal_True;
-    }
+    uno::Sequence<beans::PropertyValue> aSeq(3);
+    beans::PropertyValue* pValues = aSeq.getArray();
+    pValues[0].Name = "ReadOnly";
+    sal_Bool bTrue = sal_True;
+    pValues[0].Value.setValue(&bTrue, ::getBooleanCppuType());
+    pValues[1].Name = "OpenFlags";
+    pValues[1].Value <<= OUString("-RB");
+    pValues[2].Name = "Referer";
+    pValues[2].Value <<= OUString("private:user");
+
+    m_xFrameControl->setLoaderArguments( aSeq );
+    //save and set readonly???
+
+    m_xFrameControl->setComponentURL( sTempURL );
+
+    aLoadedTimer.Start();
+    bServiceAvailable = sal_True;
 }
 
 void    SwOneExampleFrame::DisposeControl()
 {
     _xCursor = 0;
-    if(_xControl.is())
-        _xControl->dispose();
-    _xControl = 0;
+    m_xFrameControl.clear();
     _xModel = 0;
     _xController = 0;
 }
@@ -193,14 +183,11 @@ static void disableScrollBars(uno::Reference< beans::XPropertySet > xViewProps,
 
 IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
 {
-    if(!_xControl.is())
+    if(!m_xFrameControl.is())
         return 0;
 
     // now get the model
-    uno::Reference< beans::XPropertySet >  xPrSet(_xControl, uno::UNO_QUERY);
-    uno::Any aFrame = xPrSet->getPropertyValue("Frame");
-    uno::Reference< frame::XFrame >  xFrm;
-    aFrame >>= xFrm;
+    uno::Reference< frame::XFrame >  xFrm = m_xFrameControl->getFrame();
 
     uno::Reference< beans::XPropertySet > xPropSet( xFrm, uno::UNO_QUERY );
     if ( xPropSet.is() )
@@ -362,9 +349,8 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
             xPProp->setPropertyValue(OUString::createFromAscii(SW_PROP_NAME_STR(UNO_NAME_RIGHT_MARGIN)), aZero);
         }
 
-        uno::Reference< awt::XWindow >  xWin( _xControl, uno::UNO_QUERY );
         Size aWinSize(aTopWindow.GetOutputSizePixel());
-        xWin->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
+        m_xFrameControl->setPosSize( 0, 0, aWinSize.Width(), aWinSize.Height(), awt::PosSize::SIZE );
 
         // can only be done here - the SFX changes the ScrollBar values
         disableScrollBars(xViewProps, nStyleFlags&EX_SHOW_ONLINE_LAYOUT);
@@ -377,7 +363,7 @@ IMPL_LINK( SwOneExampleFrame, TimeoutHdl, Timer*, pTimer )
         if(xScrCrsr.is())
             xScrCrsr->screenUp();
 
-        xWin->setVisible( sal_True );
+        m_xFrameControl->setVisible( sal_True );
         aTopWindow.Show();
 
         if( xTunnel.is() )
commit 8ac910bb21517a127616d1e08e2fc9b7a99ecd68
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Jul 2 13:27:48 2013 +0200

    remove some useless comment blocks
    
    Change-Id: I3fd6c7ee6ae5b6c634c14ad9d60ae4abc8c03880

diff --git a/UnoControls/source/inc/framecontrol.hxx b/UnoControls/source/inc/framecontrol.hxx
index 8da8c67..ed97527 100644
--- a/UnoControls/source/inc/framecontrol.hxx
+++ b/UnoControls/source/inc/framecontrol.hxx
@@ -71,53 +71,14 @@ public:
     //  construct/destruct
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     FrameControl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual ~FrameControl();
 
     //__________________________________________________________________________________________________________
     //  XInterface
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(
         const ::com::sun::star::uno::Type& aType
     ) throw( ::com::sun::star::uno::RuntimeException );
@@ -158,19 +119,6 @@ public:
     //  XTypeProvider
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes()
         throw( ::com::sun::star::uno::RuntimeException );
 
@@ -178,19 +126,6 @@ public:
     //  XAggregation
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     ::com::sun::star::uno::Any SAL_CALL queryAggregation(
         const ::com::sun::star::uno::Type& aType
     ) throw( ::com::sun::star::uno::RuntimeException );
@@ -199,54 +134,15 @@ public:
     //  XControl
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual void SAL_CALL createPeer(
         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >&      xToolkit ,
         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >&   xParent
     ) throw ( ::com::sun::star::uno::RuntimeException );
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual sal_Bool SAL_CALL setModel(
         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& xModel
     ) throw( ::com::sun::star::uno::RuntimeException );
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel()
         throw( ::com::sun::star::uno::RuntimeException );
 
@@ -254,55 +150,16 @@ public:
     //  XComponent
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException );
 
     //__________________________________________________________________________________________________________
     //  XView
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual sal_Bool SAL_CALL setGraphics(
         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xDevice
     ) throw( ::com::sun::star::uno::RuntimeException );
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL getGraphics()
         throw( ::com::sun::star::uno::RuntimeException );
 
@@ -310,70 +167,18 @@ public:
     //  XConnectionPointContainer
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getConnectionPointTypes()
         throw( ::com::sun::star::uno::RuntimeException );
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XConnectionPoint > SAL_CALL queryConnectionPoint(
         const ::com::sun::star::uno::Type& aType
     ) throw ( ::com::sun::star::uno::RuntimeException );
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual void SAL_CALL advise(
         const ::com::sun::star::uno::Type&                                aType       ,
         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&    xListener
     ) throw( ::com::sun::star::uno::RuntimeException );
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual void SAL_CALL unadvise(
         const ::com::sun::star::uno::Type&                                aType ,
         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&    xListener
@@ -383,34 +188,8 @@ public:
     //  impl but public methods to register service!
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     static const ::com::sun::star::uno::Sequence< OUString > impl_getStaticSupportedServiceNames();
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     static const OUString impl_getStaticImplementationName();
 
 //______________________________________________________________________________________________________________
@@ -423,19 +202,6 @@ protected:
     //  OPropertySetHelper
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual sal_Bool SAL_CALL convertFastPropertyValue(
         ::com::sun::star::uno::Any&       rConvertedValue   ,
         ::com::sun::star::uno::Any&       rOldValue         ,
@@ -443,72 +209,20 @@ protected:
         const ::com::sun::star::uno::Any& rValue
     ) throw( ::com::sun::star::lang::IllegalArgumentException );
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
         sal_Int32 nHandle ,
         const ::com::sun::star::uno::Any& rValue
     ) throw ( ::com::sun::star::uno::Exception );
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any&   rValue  ,
                                                 sal_Int32       nHandle ) const ;
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
 
     //__________________________________________________________________________________________________________
     //  XPropertySet
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
         throw( ::com::sun::star::uno::RuntimeException );
 
@@ -516,19 +230,6 @@ protected:
     //  BaseControl
     //__________________________________________________________________________________________________________
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     virtual ::com::sun::star::awt::WindowDescriptor* impl_getWindowDescriptor(
         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParentPeer
     );
@@ -539,51 +240,12 @@ protected:
 
 private:
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     void impl_createFrame(  const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >&       xPeer           ,
                             const OUString&                                         sURL            ,
                             const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&    seqArguments    );
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     void impl_deleteFrame();
 
-    /**_________________________________________________________________________________________________________
-        @short
-        @descr
-
-        @seealso
-
-        @param
-
-        @return
-
-        @onerror
-    */
-
     static const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > impl_getStaticPropertyDescriptor();
 
 


More information about the Libreoffice-commits mailing list