From c8b1432e8fd2c6a7d3d0039816884f33dafb97cb Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Thu, 22 Feb 2018 07:10:02 +0900 Subject: remove "FillBitmapURL" property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Icac13a412ae16e4b367362ca85a37fa29802c68b Reviewed-on: https://gerrit.libreoffice.org/50169 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- svx/source/xoutdev/xattrbmp.cxx | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) (limited to 'svx') diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index 8e28d1ab2646..fa318829e613 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -252,7 +252,6 @@ bool XFillBitmapItem::QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId) const // needed for complete item (MID 0) OUString aInternalName; - OUString aURL; css::uno::Reference< css::awt::XBitmap > xBmp; if( nMemberId == MID_NAME ) @@ -264,23 +263,14 @@ bool XFillBitmapItem::QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId) const aInternalName = GetName(); } - if (nMemberId == MID_GRAFURL) - { - aURL = UNO_NAME_GRAPHOBJ_URLPREFIX; - aURL += OStringToOUString( - GetGraphicObject().GetUniqueID(), - RTL_TEXTENCODING_ASCII_US); - } if( nMemberId == MID_BITMAP || nMemberId == 0 ) { - xBmp.set(VCLUnoHelper::CreateBitmap(GetGraphicObject().GetGraphic().GetBitmapEx())); + xBmp.set(GetGraphicObject().GetGraphic().GetXGraphic(), uno::UNO_QUERY); } if( nMemberId == MID_NAME ) rVal <<= aApiName; - else if( nMemberId == MID_GRAFURL ) - rVal <<= aURL; else if( nMemberId == MID_BITMAP ) rVal <<= xBmp; else @@ -305,12 +295,10 @@ bool XFillBitmapItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) nMemberId &= ~CONVERT_TWIPS; OUString aName; - OUString aURL; css::uno::Reference< css::awt::XBitmap > xBmp; css::uno::Reference< css::graphic::XGraphic > xGraphic; bool bSetName = false; - bool bSetURL = false; bool bSetBitmap = false; if( nMemberId == MID_NAME ) @@ -341,31 +329,19 @@ bool XFillBitmapItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) { SetName( aName ); } - if( bSetURL ) - { - GraphicObject aGraphicObject = GraphicObject::CreateGraphicObjectFromURL(aURL); - if( aGraphicObject.GetType() != GraphicType::NONE ) - maGraphicObject = aGraphicObject; - - // #121194# Prefer GraphicObject over bitmap object if both are provided - if(bSetBitmap && GraphicType::NONE != maGraphicObject.GetType()) - { - bSetBitmap = false; - } - } if( bSetBitmap ) { - if(xBmp.is()) + if (xBmp.is()) { - maGraphicObject.SetGraphic(VCLUnoHelper::GetBitmap(xBmp)); + xGraphic.set(xBmp, uno::UNO_QUERY); } - else if(xGraphic.is()) + if (xGraphic.is()) { maGraphicObject.SetGraphic(xGraphic); } } - return (bSetName || bSetURL || bSetBitmap); + return (bSetName || bSetBitmap); } bool XFillBitmapItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ) -- cgit