Re: [PUSHED-3-5] fdo#45995 fdo#45992

2012-02-15 Thread Noel Power

On 14/02/12 19:17, Petr Mladek wrote:
It did not work because the test document used linked picture. It 
works well with the updated test document. The changes look 
reasonable. They work well = I have pushed them into the 3-5 branch, 
see 
http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5id=4ea4f80121eedc7f87d950ea8e15336fb691e52f 
http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5id=8015cd2cdbdb05b0048753e12b39fa940add2021 
Noel, please ask for review once you have a working solution for 3.4 
branch.
the solution for 3.4 is the same, the bogus test document fooled me into 
thinking that the part addressed by

http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5id=4ea4f80121eedc7f87d950ea8e15336fb691e52f
was already working in 3.4. I attach a version of that patch back-ported 
to 3.4


thanks again

Noel
diff --git toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx
index 673f4d6..c4d2dd5 100644
--- toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx
+++ toolkit/inc/toolkit/controls/controlmodelcontainerbase.hxx
@@ -233,7 +233,6 @@ protected:
 virtual void		ImplSetPosSize( ::com::sun::star::uno::Reference ::com::sun::star::awt::XControl  rxCtrl );
 voidImplUpdateResourceResolver();
 voidImplStartListingForResourceEvents();
-::com::sun::star::uno::Reference ::com::sun::star::graphic::XGraphic  Impl_getGraphicFromURL_nothrow( const ::rtl::OUString _rURL );
 
 ControlContainerBase();
 
diff --git toolkit/inc/toolkit/controls/dialogcontrol.hxx toolkit/inc/toolkit/controls/dialogcontrol.hxx
index 78fc078..cf6717c 100644
--- toolkit/inc/toolkit/controls/dialogcontrol.hxx
+++ toolkit/inc/toolkit/controls/dialogcontrol.hxx
@@ -33,6 +33,7 @@
 #include com/sun/star/awt/XDialog2.hpp
 #include com/sun/star/awt/XSimpleTabController.hpp
 #include com/sun/star/resource/XStringResourceResolver.hpp
+#include com/sun/star/graphic/XGraphicObject.hpp
 #include toolkit/helper/servicenames.hxx
 #include toolkit/helper/macros.hxx
 #include toolkit/controls/unocontrolcontainer.hxx
@@ -47,8 +48,11 @@
 class UnoControlDialogModel :	public ControlModelContainerBase
 {
 protected:	
+::com::sun::star::uno::Reference ::com::sun::star::graphic::XGraphicObject  mxGrfObj;
 ::com::sun::star::uno::Any			ImplGetDefaultValue( sal_uInt16 nPropId ) const;
 ::cppu::IPropertyArrayHelper		SAL_CALL getInfoHelper();
+// ::cppu::OPropertySetHelper
+	void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any rValue ) throw (::com::sun::star::uno::Exception);
 public:
 UnoControlDialogModel( const ::com::sun::star::uno::Reference ::com::sun::star::lang::XMultiServiceFactory  i_factory );
 UnoControlDialogModel( const UnoControlDialogModel rModel );
diff --git toolkit/inc/toolkit/controls/unocontrols.hxx toolkit/inc/toolkit/controls/unocontrols.hxx
index 91b8e2a..3fffee3 100644
--- toolkit/inc/toolkit/controls/unocontrols.hxx
+++ toolkit/inc/toolkit/controls/unocontrols.hxx
@@ -72,6 +72,19 @@
 #define UNO_NAME_GRAPHOBJ_URLPREFIX vnd.sun.star.GraphicObject:
 #define UNO_NAME_GRAPHOBJ_URLPKGPREFIX  vnd.sun.star.Package:
 
+class ImageHelper
+{
+public:
+// The routine will always attempt to return a valid XGraphic for the
+// passed _rURL, additionallly xOutGraphicObject will contain the
+// associated XGraphicObject ( if url is valid for that ) and is set
+// appropriately ( e.g. NULL if non GraphicObject scheme ) or a valid
+// object if the rURL points to a valid object
+static ::com::sun::star::uno::Reference ::com::sun::star::graphic::XGraphic  getGraphicAndGraphicObjectFromURL_nothrow( ::com::sun::star::uno::Reference ::com::sun::star::graphic::XGraphicObject  xOutGraphicObject, const ::rtl::OUString _rURL );
+static ::com::sun::star::uno::Reference ::com::sun::star::graphic::XGraphic  getGraphicFromURL_nothrow( const ::rtl::OUString _rURL );
+
+};
+
 //	
 //	class UnoControlEditModel
 //	
diff --git toolkit/source/controls/controlmodelcontainerbase.cxx toolkit/source/controls/controlmodelcontainerbase.cxx
index 2be6fa2..f2dd50a 100644
--- toolkit/source/controls/controlmodelcontainerbase.cxx
+++ toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -1842,31 +1842,6 @@ void ControlContainerBase::ImplUpdateResourceResolver()
 }
 }
 
-
-uno::Reference graphic::XGraphic  ControlContainerBase::Impl_getGraphicFromURL_nothrow( const ::rtl::OUString _rURL )
-{
-uno::Reference graphic::XGraphic  xGraphic;
-if ( !_rURL.getLength() )
-return xGraphic;
-
-try
-{
-uno::Reference graphic::XGraphicProvider  xProvider;
-if ( maContext.createComponent( 

Re: [PUSHED-3-5] fdo#45995 fdo#45992

2012-02-14 Thread Petr Mladek
Petr Mladek píše v Út 14. 02. 2012 v 17:46 +0100:
 Noel Power píše v Út 14. 02. 2012 v 11:11 +:
  On 14/02/12 10:39, Noel Power wrote:
   handle imported picture attribute from MSO Dialog ( fdo#45995 ) needed 
   for 3.5 ( and possibly 3.4... I need to check that )
   core:58255c47b1d540fd2493b4ed132aa7fa82da156e 
  I sorta got mixed up with my comments about these bugs, this one is 
  indeed ( and I always expected it ) valid for 3.4 ( this is the one to 
  do with the ImageURL property in oox )
 
 Hmm, this was not enough for 3.4. It did not show the picture. Instead
 it did a screenshot of the current background.
 
   fix support for embedded images for basic Dialogs ( fdo#45992 ) needed 
   for 3.5 ( and definitely 3.5, didn't notice that ImageURL property 
   wasn't processed for UserForms in oox import when I removed msocximex ) 
  this is the one I thought may be needed for 3.4 but it turns out that 
  the merge badness happened later than I thought and this is not an issue 
  in the 3.4 branch
 
 It needed small update to apply in 3-5. It helped to get working the
 example from fdo#45995. It did not fix fdo#45992, though. I see white
 background instead of a picture in the dialog.

It did not work because the test document used linked picture. It works
well with the updated test document.

The changes look reasonable. They work well = I have pushed them into
the 3-5 branch, see
http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5id=4ea4f80121eedc7f87d950ea8e15336fb691e52f
http://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-3-5id=8015cd2cdbdb05b0048753e12b39fa940add2021


Noel, please ask for review once you have a working solution for 3.4
branch.


Best Regards,
Petr

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice