summaryrefslogtreecommitdiff
path: root/vcl/source/helper/commandinfoprovider.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2018-11-26 16:59:42 +0000
committerMichael Meeks <michael.meeks@collabora.com>2019-09-24 10:58:27 +0100
commit973fd959be877c921ad6b13f622b36067d497f70 (patch)
tree2e14147f3b82b9ecd01c1b134c6fbf6fb62d9267 /vcl/source/helper/commandinfoprovider.cxx
parent0551d70b7d796907a6cdbbe0a51dde3fe932dfa9 (diff)
Use lazy-loading stock Image to simplify framework image lists.private/mmeeks/hidpi-bits
Project stock names through XGraphic via origin URL. (cherry picked from commit 77b88eebaadebb626108172e4f2de36c60960051) Change-Id: Ib445694f7c142a163ef7e7bc0beea39b88b99e14
Diffstat (limited to 'vcl/source/helper/commandinfoprovider.cxx')
-rw-r--r--vcl/source/helper/commandinfoprovider.cxx23
1 files changed, 8 insertions, 15 deletions
diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx
index ee9196c6411e..80bc04f876a5 100644
--- a/vcl/source/helper/commandinfoprovider.cxx
+++ b/vcl/source/helper/commandinfoprovider.cxx
@@ -295,13 +295,13 @@ OUString GetRealCommandForCommand(const OUString& rCommandName,
return GetCommandProperty("TargetURL", rCommandName, rsModuleName);
}
-static BitmapEx GetBitmapForCommand(const OUString& rsCommandName,
- const Reference<frame::XFrame>& rxFrame,
- vcl::ImageType eImageType)
+static Reference<graphic::XGraphic> GetXGraphicForCommand(const OUString& rsCommandName,
+ const Reference<frame::XFrame>& rxFrame,
+ vcl::ImageType eImageType)
{
if (rsCommandName.isEmpty())
- return BitmapEx();
+ return nullptr;
sal_Int16 nImageType(ui::ImageType::COLOR_NORMAL | ui::ImageType::SIZE_DEFAULT);
@@ -324,11 +324,7 @@ static BitmapEx GetBitmapForCommand(const OUString& rsCommandName,
aGraphicSeq = xDocImgMgr->getImages( nImageType, aImageCmdSeq );
Reference<graphic::XGraphic> xGraphic = aGraphicSeq[0];
- const Graphic aGraphic(xGraphic);
- BitmapEx aBitmap(aGraphic.GetBitmapEx());
-
- if (!!aBitmap)
- return aBitmap;
+ return xGraphic;
}
}
catch (Exception&)
@@ -347,23 +343,20 @@ static BitmapEx GetBitmapForCommand(const OUString& rsCommandName,
aGraphicSeq = xModuleImageManager->getImages(nImageType, aImageCmdSeq);
Reference<graphic::XGraphic> xGraphic(aGraphicSeq[0]);
-
- const Graphic aGraphic(xGraphic);
-
- return aGraphic.GetBitmapEx();
+ return xGraphic;
}
catch (Exception&)
{
}
- return BitmapEx();
+ return nullptr;
}
Image GetImageForCommand(const OUString& rsCommandName,
const Reference<frame::XFrame>& rxFrame,
vcl::ImageType eImageType)
{
- return Image(GetBitmapForCommand(rsCommandName, rxFrame, eImageType));
+ return Image(GetXGraphicForCommand(rsCommandName, rxFrame, eImageType));
}
sal_Int32 GetPropertiesForCommand (