[Libreoffice-commits] core.git: include/toolkit toolkit/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Thu Mar 15 23:24:50 UTC 2018


 include/toolkit/controls/unocontrols.hxx  |    2 --
 toolkit/source/controls/dialogcontrol.cxx |   13 ++-----------
 toolkit/source/controls/unocontrols.cxx   |   10 +---------
 3 files changed, 3 insertions(+), 22 deletions(-)

New commits:
commit 4bbf37b7ed83491efdfa9cb12cd434f67a1764ae
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Thu Mar 15 21:14:29 2018 +0900

    drop support for GraphicObject URLs in toolkit
    
    Change-Id: I86d18232b8fcb34272d3cc04f65a7dc72248591a
    Reviewed-on: https://gerrit.libreoffice.org/51328
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/toolkit/controls/unocontrols.hxx b/include/toolkit/controls/unocontrols.hxx
index 7da16557cde3..e758cf6e01a8 100644
--- a/include/toolkit/controls/unocontrols.hxx
+++ b/include/toolkit/controls/unocontrols.hxx
@@ -60,8 +60,6 @@
 
 #include <boost/optional.hpp>
 
-#define UNO_NAME_GRAPHOBJ_URLPREFIX                             "vnd.sun.star.GraphicObject:"
-
 class ImageHelper
 {
 public:
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index 8f32a6fcd9b0..a20b22ad81c9 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -413,11 +413,7 @@ void UnoDialogControl::PrepareWindowDescriptor( css::awt::WindowDescriptor& rDes
     if (( ImplGetPropertyValue( PROPERTY_IMAGEURL ) >>= aImageURL ) &&
         ( !aImageURL.isEmpty() ))
     {
-        OUString absoluteUrl = aImageURL;
-        if ( !aImageURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
-            absoluteUrl = getPhysicalLocation( ImplGetPropertyValue( PROPERTY_DIALOGSOURCEURL ),
-                                 uno::makeAny( aImageURL ) );
-
+        OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(PROPERTY_DIALOGSOURCEURL), uno::makeAny(aImageURL));
         xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
         ImplSetPropertyValue( PROPERTY_GRAPHIC, uno::makeAny( xGraphic ), true );
     }
@@ -632,12 +628,7 @@ void UnoDialogControl::ImplModelPropertiesChanged( const Sequence< PropertyChang
             if (( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) ) >>= aImageURL ) &&
                 ( !aImageURL.isEmpty() ))
             {
-                OUString absoluteUrl = aImageURL;
-                if ( !aImageURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
-
-                    absoluteUrl = getPhysicalLocation( ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_DIALOGSOURCEURL )),
-                                         uno::makeAny(aImageURL));
-
+                OUString absoluteUrl = getPhysicalLocation(ImplGetPropertyValue(GetPropertyName(BASEPROPERTY_DIALOGSOURCEURL)), uno::makeAny(aImageURL));
                 xGraphic = ImageHelper::getGraphicFromURL_nothrow( absoluteUrl );
             }
             ImplSetPropertyValue(  GetPropertyName( BASEPROPERTY_GRAPHIC), uno::makeAny( xGraphic ), true );
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index 98b4b8c0b52a..ea98a4d4512d 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -74,15 +74,7 @@ using namespace ::toolkit;
 uno::Reference< graphic::XGraphic >
 ImageHelper::getGraphicAndGraphicObjectFromURL_nothrow( uno::Reference< graphic::XGraphicObject >& xOutGraphicObj, const OUString& _rURL )
 {
-    if ( _rURL.startsWith( UNO_NAME_GRAPHOBJ_URLPREFIX ) )
-    {
-        // graphic manager uniqueid
-        OUString sID = _rURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 );
-        xOutGraphicObj = graphic::GraphicObject::createWithId( ::comphelper::getProcessComponentContext(), sID );
-    }
-    else // linked
-        xOutGraphicObj = nullptr; // release the GraphicObject
-
+    xOutGraphicObj = nullptr;
     return ImageHelper::getGraphicFromURL_nothrow( _rURL );
 }
 


More information about the Libreoffice-commits mailing list