From ce22935a8586eda71fd29d4ff969d9cd7a2ec15b Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 29 Oct 2021 10:03:36 +0300 Subject: Prepare for removal of non-const operator[] from Sequence in sfx2 Change-Id: I0cdce64983901a6cc3b50dc9873a370ff08b9eb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124387 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sfx2/source/doc/graphhelp.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'sfx2/source/doc/graphhelp.cxx') diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx index 6371d10112e4..b309625206a5 100644 --- a/sfx2/source/doc/graphhelp.cxx +++ b/sfx2/source/doc/graphhelp.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -210,18 +211,16 @@ bool GraphicHelper::getThumbnailReplacement_Impl(std::u16string_view rResID, con uno::Reference< graphic::XGraphicProvider > xGraphProvider(graphic::GraphicProvider::create(xContext)); const OUString aURL{OUString::Concat("private:graphicrepository/") + rResID}; - uno::Sequence< beans::PropertyValue > aMediaProps( 1 ); - aMediaProps[0].Name = "URL"; - aMediaProps[0].Value <<= aURL; + uno::Sequence< beans::PropertyValue > aMediaProps{ comphelper::makePropertyValue("URL", + aURL) }; uno::Reference< graphic::XGraphic > xGraphic = xGraphProvider->queryGraphic( aMediaProps ); if ( xGraphic.is() ) { - uno::Sequence< beans::PropertyValue > aStoreProps( 2 ); - aStoreProps[0].Name = "OutputStream"; - aStoreProps[0].Value <<= xStream; - aStoreProps[1].Name = "MimeType"; - aStoreProps[1].Value <<= OUString("image/png"); + uno::Sequence< beans::PropertyValue > aStoreProps{ + comphelper::makePropertyValue("OutputStream", xStream), + comphelper::makePropertyValue("MimeType", OUString("image/png")) + }; xGraphProvider->storeGraphic( xGraphic, aStoreProps ); bResult = true; -- cgit