#79947# optimization: XFormsSupplier implemented at SwXDrawPage

This commit is contained in:
Oliver Specht 2001-05-21 11:40:40 +00:00
parent d0f40bf6bf
commit b1299d18f7
2 changed files with 31 additions and 9 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: unodraw.hxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: os $ $Date: 2001-04-04 12:29:22 $
* last change: $Author: os $ $Date: 2001-05-21 12:38:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -82,8 +82,11 @@
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
#include <com/sun/star/beans/XPropertyState.hpp>
#endif
#ifndef _CPPUHELPER_IMPLBASE3_HXX_
#include <cppuhelper/implbase3.hxx> // helper for implementations
#ifndef _COM_SUN_STAR_FORM_XFORMSSUPPLIER_HPP_
#include <com/sun/star/form/XFormsSupplier.hpp>
#endif
#ifndef _CPPUHELPER_IMPLBASE4_HXX_
#include <cppuhelper/implbase4.hxx> // helper for implementations
#endif
#ifndef _CPPUHELPER_IMPLBASE5_HXX_
#include <cppuhelper/implbase5.hxx> // helper for implementations
@ -130,8 +133,9 @@ public:
/* -----------------09.12.98 08:57-------------------
*
* --------------------------------------------------*/
typedef cppu::WeakAggImplHelper3
typedef cppu::WeakAggImplHelper4
<
::com::sun::star::form::XFormsSupplier,
::com::sun::star::drawing::XDrawPage,
::com::sun::star::lang::XServiceInfo,
::com::sun::star::drawing::XShapeGrouper
@ -165,6 +169,9 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapeGroup > SAL_CALL group(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > & xShapes) throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL ungroup(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapeGroup > & aGroup) throw( ::com::sun::star::uno::RuntimeException );
//XFormsSupplier
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > SAL_CALL getForms( ) throw (::com::sun::star::uno::RuntimeException);
//XServiceInfo
virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );

View file

@ -2,9 +2,9 @@
*
* $RCSfile: unodraw.cxx,v $
*
* $Revision: 1.19 $
* $Revision: 1.20 $
*
* last change: $Author: ama $ $Date: 2001-05-04 13:12:27 $
* last change: $Author: os $ $Date: 2001-05-21 12:40:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -143,6 +143,7 @@
#include <comphelper/stl_types.hxx>
#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
@ -459,7 +460,7 @@ Sequence< Type > SwXDrawPage::getTypes( ) throw(RuntimeException)
Sequence< uno::Type > aSvxTypes = GetSvxPage()->getTypes();
long nIndex = aPageTypes.getLength();
aPageTypes.realloc(aPageTypes.getLength() + aSvxTypes.getLength() + 1);
aPageTypes.realloc(aPageTypes.getLength() + aSvxTypes.getLength());
uno::Type* pPageTypes = aPageTypes.getArray();
const uno::Type* pSvxTypes = aSvxTypes.getConstArray();
@ -468,7 +469,6 @@ Sequence< Type > SwXDrawPage::getTypes( ) throw(RuntimeException)
{
pPageTypes[nIndex++] = pSvxTypes[nPos];
}
pPageTypes[nIndex] = ::getCppuType((Reference< ::com::sun::star::form::XFormsSupplier>*)0);
return aPageTypes;
}
/*-- 22.01.99 11:33:44---------------------------------------------------
@ -739,7 +739,22 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeG
pPage->RemovePageView();
}
}
/* -----------------------------21.05.01 13:47--------------------------------
---------------------------------------------------------------------------*/
Reference< XNameContainer > SwXDrawPage::getForms( ) throw (RuntimeException)
{
vos::OGuard aGuard(Application::GetSolarMutex());
if(!pDoc)
throw uno::RuntimeException();
if(!pDoc->GetDrawModel())
return Reference< XNameContainer > ();
else
{
((SwXDrawPage*)this)->GetSvxPage();
return pDrawPage->getForms();
}
}
/* -----------------05.05.98 17:05-------------------
*
* --------------------------------------------------*/