[Libreoffice-commits] core.git: editeng/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Wed May 13 13:16:43 UTC 2020


 editeng/source/items/frmitems.cxx |    5 -----
 1 file changed, 5 deletions(-)

New commits:
commit 6edcbde02520500812d969dd5bcba5ff68d59c58
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Mon May 11 19:59:16 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed May 13 15:16:09 2020 +0200

    Related tdf#132945: fix warning
    
    I noticed this log:
    warn:sw.uno:555419:555419:sw/source/core/unocore/unostyle.cxx:2303: error getting attribute from RES_BACKGROUND
    
    Git history provides:
    https://cgit.freedesktop.org/libreoffice/core/commit/?id=7a8ed362eb163ac15a000ba1cfc74b58315800a1
    [API CHANGE] revert and deprecate *BackGraphicURL add *BackGraphic
    *BackGraphicURL include the following properties:
    - BackGraphicURL
    - FooterBackGraphicURL
    - HeaderBackGraphicURL
    - ParaBackGraphicURL
    
    This were removed, but for backwards compatibility this commit
    adds them back again and depreactes them in the UNO API. The
    behaviour also changes as internal vnd.sun.star.GraphicObject
    scheme URLs aren't supported so this properties can only be set
    and only if a external URL is provided. If getting such a property
    then a RuntimeException will be thrown.
    
    But why "MID_GRAPHIC_URL" wouldn't be dealt in SvxBrushItem::QueryValue
    whereas:
    1) we got this code
       2892         case MID_GRAPHIC:
       2893         {
       2894             uno::Reference<graphic::XGraphic> xGraphic;
       2895             if (!maStrLink.isEmpty())
       2896             {
       2897                 Graphic aGraphic(vcl::graphic::loadFromURL(maStrLink));
       2898                 xGraphic = aGraphic.GetXGraphic();
       2899             }
       2900             else if (xGraphicObject)
       2901             {
       2902                 xGraphic = xGraphicObject->GetGraphic().GetXGraphic();
       2903             }
       2904             rVal <<= xGraphic;
       2905         }
    
    => so dealt in 2895 "if" block
    See https://opengrok.libreoffice.org/xref/core/editeng/source/items/frmitems.cxx?r=e12fa18c#2892
    
    2) MID_GRAPHIC_URL is dealt in SvxBrushItem::PutValue
       2974         case MID_GRAPHIC_URL:
       2975         case MID_GRAPHIC:
       2976         {
       2977             Graphic aGraphic;
       2978
       2979             if (rVal.getValueType() == ::cppu::UnoType<OUString>::get())
       2980             {
       2981                 OUString aURL = rVal.get<OUString>();
       2982                 aGraphic = vcl::graphic::loadFromURL(aURL);
       2983             }
       2984             else if (rVal.getValueType() == cppu::UnoType<graphic::XGraphic>::get())
       2985             {
       2986                 auto xGraphic = rVal.get<uno::Reference<graphic::XGraphic>>();
       2987                 aGraphic = Graphic(xGraphic);
       2988             }
    ...
    See https://opengrok.libreoffice.org/xref/core/editeng/source/items/frmitems.cxx?r=e12fa18c#2974
    
    Change-Id: I3ad42c4343d9875647cc8f01504da91b68fe220f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94010
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 8c0a44be5911..d931ed6f839f 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -2884,11 +2884,6 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
         break;
 
         case MID_GRAPHIC_URL:
-        {
-            SAL_INFO("editeng.items", "Getting GraphicURL property is not supported");
-            return false;
-        }
-        break;
         case MID_GRAPHIC:
         {
             uno::Reference<graphic::XGraphic> xGraphic;


More information about the Libreoffice-commits mailing list