ooo-build r13353 - in trunk: . patches/dev300



Author: noelpwer
Date: Tue Jul 22 17:24:21 2008
New Revision: 13353
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13353&view=rev

Log:
2008-07-22  Noel Power  <noel power novell com>

        * patches/dev300/controls-with-images-in-document.diff: simple 
        unowrapper for the GraphicObject


Modified:
   trunk/ChangeLog
   trunk/patches/dev300/controls-with-images-in-document.diff

Modified: trunk/patches/dev300/controls-with-images-in-document.diff
==============================================================================
--- trunk/patches/dev300/controls-with-images-in-document.diff	(original)
+++ trunk/patches/dev300/controls-with-images-in-document.diff	Tue Jul 22 17:24:21 2008
@@ -410,3 +410,307 @@
  		AddAttribute(OAttributeMetaData::getCommonControlAttributeNamespace(_nProperty)
  					,OAttributeMetaData::getCommonControlAttributeName(_nProperty)
  					, sTargetLocation);
+diff --git goodies/source/unographic/graphicuno.cxx goodies/source/unographic/graphicuno.cxx
+index 645c048..b39f7a7 100755
+--- goodies/source/unographic/graphicuno.cxx
++++ goodies/source/unographic/graphicuno.cxx
+@@ -38,11 +38,13 @@
+ #include "renderer.hxx"
+ 
+ #include <com/sun/star/registry/XRegistryKey.hpp>
++#include "comphelper/servicedecl.hxx"
+ 
+ using namespace com::sun::star;
++namespace sdecl = comphelper::service_decl;
+ 
+ namespace unographic {
+-
++extern sdecl::ServiceDecl const serviceDecl;
+ // --------------------
+ // - *_createInstance -
+ // --------------------
+@@ -72,7 +74,7 @@ extern "C" void SAL_CALL component_getIm
+ // - component_writeInfo -
+ // -----------------------
+ 
+-extern "C" sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
++extern "C" sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
+ {
+ 	sal_Bool bRet = sal_False;
+ 
+@@ -105,6 +107,9 @@ extern "C" sal_Bool SAL_CALL component_w
+ 		    
+ 			for( i = 0; i < aServices.getLength(); i++ )
+ 		        xNewKey->createKey( aServices.getConstArray()[ i ] );
++
++   			if ( !component_writeInfoHelper( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ), reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ), serviceDecl ) )
++				return false;
+ 				
+ 			bRet = true;
+ 		}
+@@ -121,7 +126,7 @@ extern "C" sal_Bool SAL_CALL component_w
+ // - component_getFactory -
+ // ------------------------
+ 
+-extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ )
++extern "C" void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey )
+ {
+ 	void * pRet = 0;
+ 	
+@@ -153,7 +158,11 @@ extern "C" void* SAL_CALL component_getF
+ 			pRet = xFactory.get();
+ 		}
+ 	}
++	else 
++    {
++        pRet =  component_getFactoryHelper( pImplName, reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ), serviceDecl );
+ 
++    }
+ 	return pRet;
+ }
+  
+diff --git goodies/source/unographic/graphicunoaccess.cxx goodies/source/unographic/graphicunoaccess.cxx
+new file mode 100755
+index 0000000..83c43e4
+--- /dev/null
++++ goodies/source/unographic/graphicunoaccess.cxx
+@@ -0,0 +1,100 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: graphicuno.cxx,v $
++ * $Revision: 1.6 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_goodies.hxx"
++#include <comphelper/servicedecl.hxx>
++#include <cppuhelper/implbase1.hxx>
++#include <com/sun/star/graphic/XGraphicObjectAccess.hpp>
++#include <com/sun/star/lang/IllegalArgumentException.hpp>
++#include "grfmgr.hxx"
++
++using namespace com::sun::star;
++
++namespace unographic {
++
++typedef ::cppu::WeakImplHelper1< graphic::XGraphicObjectAccess > GObjectAccess_BASE;
++
++class GObjectAccessImpl : public GObjectAccess_BASE
++{
++     std::auto_ptr< GraphicObject > mpGObject;
++public:
++     GObjectAccessImpl( uno::Sequence< uno::Any > const & args, uno::Reference< uno::XComponentContext > const & xComponentContext ) throw (uno::RuntimeException);
++
++     // XGraphicObjectAccess
++    virtual uno::Reference< graphic::XGraphic > SAL_CALL getGraphic() throw (uno::RuntimeException);
++    virtual void SAL_CALL setGraphic( const uno::Reference< graphic::XGraphic >& _graphic ) throw (uno::RuntimeException);
++    ::rtl::OUString SAL_CALL getUniqueID() throw (uno::RuntimeException);
++};
++
++GObjectAccessImpl::GObjectAccessImpl( uno::Sequence< uno::Any > const & args, uno::Reference< uno::XComponentContext > const & xComponentContext ) throw (uno::RuntimeException)
++{
++    if ( args.getLength() == 1 )
++    {
++        rtl::OUString sId;
++        if ( !( args[ 0 ] >>= sId ) )
++            throw lang::IllegalArgumentException();
++        ByteString bsId( sId.getStr(), RTL_TEXTENCODING_UTF8 ); 
++        mpGObject.reset( new GraphicObject( bsId ) ); 
++    }
++    else
++       mpGObject.reset( new GraphicObject() ); 
++}
++
++uno::Reference< graphic::XGraphic > SAL_CALL GObjectAccessImpl::getGraphic() throw (uno::RuntimeException)
++{
++    if ( !mpGObject.get() )
++        throw uno::RuntimeException();
++    return mpGObject->GetGraphic().GetXGraphic();
++}
++
++void SAL_CALL GObjectAccessImpl::setGraphic( const uno::Reference< graphic::XGraphic >& _graphic ) throw (uno::RuntimeException)
++{
++    if ( !mpGObject.get() )
++        throw uno::RuntimeException();
++    Graphic aGraphic( _graphic );
++    mpGObject->SetGraphic( aGraphic );
++}
++
++::rtl::OUString SAL_CALL GObjectAccessImpl::getUniqueID() throw (uno::RuntimeException)
++{
++    rtl::OUString sId;
++    if ( mpGObject.get() )
++        sId = String( mpGObject->GetUniqueID().GetBuffer(), RTL_TEXTENCODING_ASCII_US );
++    return sId;
++}
++
++
++namespace sdecl = comphelper::service_decl;
++sdecl::class_<GObjectAccessImpl, sdecl::with_args<true> > serviceBI;
++extern sdecl::ServiceDecl const serviceDecl( serviceBI, "com.sun.star.graphic.GraphicAccess", "com.sun.star.graphic.GraphicAccess" );
++
++}
+diff --git goodies/source/unographic/makefile.mk goodies/source/unographic/makefile.mk
+index 7eee7f2..7702beb 100755
+--- goodies/source/unographic/makefile.mk
++++ goodies/source/unographic/makefile.mk
+@@ -47,6 +47,7 @@ CXXFILES=							\
+ 			provider.cxx			\
+ 			graphic.cxx				\
+ 			renderer.cxx			\
++			graphicunoaccess.cxx			\
+ 			transformer.cxx
+ 
+ SLOFILES=							\
+@@ -55,6 +56,7 @@ SLOFILES=							\
+ 			$(SLO)$/provider.obj	\
+ 			$(SLO)$/graphic.obj		\
+ 			$(SLO)$/renderer.obj	\
++			$(SLO)$/graphicunoaccess.obj	\
+ 			$(SLO)$/transformer.obj
+ 
+ # --- Target -------------------------------------------------------
+diff --git offapi/com/sun/star/graphic/GraphicObjectAccess.idl offapi/com/sun/star/graphic/GraphicObjectAccess.idl
+new file mode 100755
+index 0000000..04fa387
+--- /dev/null
++++ offapi/com/sun/star/graphic/GraphicObjectAccess.idl
+@@ -0,0 +1,47 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: GraphicProvider.idl,v $
++ * $Revision: 1.5 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#ifndef com_sun_star_graphic_GraphicObjectAccess_idl
++#define com_sun_star_graphic_GraphicObjectAccess_idl
++
++#include <com/sun/star/graphic/XGraphicObjectAccess.idl>
++
++module com { module sun { module star { module graphic
++{
++
++service GraphicObjectAccess : XGraphicObjectAccess
++{
++    createGraphicObject();
++    createGraphicObjectWithId( [in] string uniqueId );
++};
++
++} ; } ; } ; } ; 
++
++#endif
+diff --git offapi/com/sun/star/graphic/XGraphicObjectAccess.idl offapi/com/sun/star/graphic/XGraphicObjectAccess.idl
+new file mode 100755
+index 0000000..c8bea43
+--- /dev/null
++++ offapi/com/sun/star/graphic/XGraphicObjectAccess.idl
+@@ -0,0 +1,47 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: XGraphic.idl,v $
++ * $Revision: 1.5 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#ifndef com_sun_star_graphic_XGraphicObjectAccess_idl
++#define com_sun_star_graphic_XGraphicObjectAccess_idl
++
++#include <com/sun/star/uno/XInterface.idl>
++
++module com { module sun { module star { module graphic
++{
++interface XGraphic;
++interface XGraphicObjectAccess : ::com::sun::star::uno::XInterface
++{
++    [attribute ] XGraphic Graphic;
++    [attribute, readonly ] string UniqueID;
++};
++
++} ; } ; } ; } ; 
++
++#endif
+diff --git offapi/com/sun/star/graphic/makefile.mk offapi/com/sun/star/graphic/makefile.mk
+index 600f60d..8bfa997 100755
+--- offapi/com/sun/star/graphic/makefile.mk
++++ offapi/com/sun/star/graphic/makefile.mk
+@@ -53,6 +53,8 @@ IDLFILES= \
+ 	XGraphic.idl \
+ 	XGraphicProvider.idl \
+ 	XGraphicRenderer.idl \
++	XGraphicObjectAccess.idl \
++	GraphicObjectAccess.idl \
+ 	XGraphicTransformer.idl
+ 	
+ # --- Targets ------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]