diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-02-26 11:15:37 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-02-26 06:04:43 +0100 |
commit | 3400424877032595490f38711b5e8520ed889fee (patch) | |
tree | 970b521dd0c5d18f37362ec53ebd52c3fa80f5e9 /xmloff | |
parent | 6fa55d39bc43383fcdb3276e9b7f612fa96d1b67 (diff) |
xmloff: remove unused code when loading/saving the bitmap table
Change-Id: I6bffe243e813079538a4cb57111266b41d7c03f1
Reviewed-on: https://gerrit.libreoffice.org/50333
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/FillStyleContext.cxx | 31 | ||||
-rw-r--r-- | xmloff/source/style/ImageStyle.cxx | 38 |
2 files changed, 3 insertions, 66 deletions
diff --git a/xmloff/source/style/FillStyleContext.cxx b/xmloff/source/style/FillStyleContext.cxx index 5c89613e826f..7a565fe74ecb 100644 --- a/xmloff/source/style/FillStyleContext.cxx +++ b/xmloff/source/style/FillStyleContext.cxx @@ -184,37 +184,6 @@ void XMLBitmapStyleContext::EndElement() catch (container::ElementExistException&) {} } - else - { - OUString sURL; - maAny >>= sURL; - - if( sURL.isEmpty() && mxBase64Stream.is() ) - { - sURL = GetImport().ResolveGraphicObjectURLFromBase64( mxBase64Stream ); - mxBase64Stream = nullptr; - maAny <<= sURL; - } - - uno::Reference< container::XNameContainer > xBitmap( GetImport().GetBitmapHelper() ); - - try - { - if(xBitmap.is()) - { - if( xBitmap->hasByName( maStrName ) ) - { - xBitmap->replaceByName( maStrName, maAny ); - } - else - { - xBitmap->insertByName( maStrName, maAny ); - } - } - } - catch( container::ElementExistException& ) - {} - } } bool XMLBitmapStyleContext::IsTransient() const diff --git a/xmloff/source/style/ImageStyle.cxx b/xmloff/source/style/ImageStyle.cxx index 5842b659dc11..9976327103d8 100644 --- a/xmloff/source/style/ImageStyle.cxx +++ b/xmloff/source/style/ImageStyle.cxx @@ -83,38 +83,6 @@ void XMLImageStyle::exportXML(OUString const & rStrName, uno::Any const & rValue rExport.AddEmbeddedXGraphicAsBase64(xGraphic); } } - else if (rValue.has<OUString>()) // TODO: Remove when GraphicObject URL aren't used anymore - { - OUString sImageURL = rValue.get<OUString>(); - - // Name - bool bEncoded = false; - rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, - rExport.EncodeStyleName( rStrName, - &bEncoded ) ); - if( bEncoded ) - rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_DISPLAY_NAME, - rStrName ); - - // uri - const OUString aStr( rExport.AddEmbeddedGraphicObject( sImageURL ) ); - if( !aStr.isEmpty() ) - { - rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aStr ); - rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); - rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_EMBED ); - rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD ); - } - - // Do Write - SvXMLElementExport aElem( rExport, XML_NAMESPACE_DRAW, XML_FILL_IMAGE, true, true ); - - if( !sImageURL.isEmpty() ) - { - // optional office:binary-data - rExport.AddEmbeddedGraphicObjectAsBase64( sImageURL ); - } - } } bool XMLImageStyle::importXML(uno::Reference<xml::sax::XAttributeList> const & xAttrList, @@ -179,7 +147,8 @@ bool XMLImageStyle::importXML(uno::Reference<xml::sax::XAttributeList> const & x } } - rValue <<= xGraphic; + if (xGraphic.is()) + rValue <<= xGraphic; if( !aDisplayName.isEmpty() ) { @@ -188,8 +157,7 @@ bool XMLImageStyle::importXML(uno::Reference<xml::sax::XAttributeList> const & x rStrName = aDisplayName; } - bool bRet = bHasName && bHasHRef; - return bRet; + return bHasName && bHasHRef; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |