summaryrefslogtreecommitdiff
path: root/vcl/source/helper
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-20 16:46:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-20 16:46:14 +0000
commitc41b7a397411814c98dceeea07b0a26f0d01c530 (patch)
treea66af5f264d2fa0c5b159a8838f0b37fb3b2c7bd /vcl/source/helper
parentaa0951b22d958813a41f71f536bb4a07aa0e7f07 (diff)
split GetImageForCommand into GetBitmapForCommand and co
Change-Id: I89431532ef26fc33146252e218096e690825b896
Diffstat (limited to 'vcl/source/helper')
-rw-r--r--vcl/source/helper/commandinfoprovider.cxx28
1 files changed, 19 insertions, 9 deletions
diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx
index e48367cc0b1e..7a844c607300 100644
--- a/vcl/source/helper/commandinfoprovider.cxx
+++ b/vcl/source/helper/commandinfoprovider.cxx
@@ -209,14 +209,14 @@ OUString CommandInfoProvider::GetRealCommandForCommand(const OUString& rCommandN
return GetCommandProperty("TargetURL", rCommandName);
}
-Image CommandInfoProvider::GetImageForCommand(const OUString& rsCommandName,
- const Reference<frame::XFrame>& rxFrame,
- vcl::ImageType eImageType)
+BitmapEx CommandInfoProvider::GetBitmapForCommand(const OUString& rsCommandName,
+ const Reference<frame::XFrame>& rxFrame,
+ vcl::ImageType eImageType)
{
SetFrame(rxFrame);
if (rsCommandName.isEmpty())
- return Image();
+ return BitmapEx();
sal_Int16 nImageType(ui::ImageType::COLOR_NORMAL | ui::ImageType::SIZE_DEFAULT);
@@ -241,10 +241,11 @@ Image CommandInfoProvider::GetImageForCommand(const OUString& rsCommandName,
aGraphicSeq = xDocImgMgr->getImages( nImageType, aImageCmdSeq );
Reference<graphic::XGraphic> xGraphic = aGraphicSeq[0];
- Image aImage(xGraphic);
+ const Graphic aGraphic(xGraphic);
+ BitmapEx aBitmap(aGraphic.GetBitmapEx());
- if (!!aImage)
- return aImage;
+ if (!!aBitmap)
+ return aBitmap;
}
}
catch (Exception&)
@@ -264,13 +265,22 @@ Image CommandInfoProvider::GetImageForCommand(const OUString& rsCommandName,
Reference<graphic::XGraphic> xGraphic(aGraphicSeq[0]);
- return Image(xGraphic);
+ const Graphic aGraphic(xGraphic);
+
+ return aGraphic.GetBitmapEx();
}
catch (Exception&)
{
}
- return Image();
+ return BitmapEx();
+}
+
+Image CommandInfoProvider::GetImageForCommand(const OUString& rsCommandName,
+ const Reference<frame::XFrame>& rxFrame,
+ vcl::ImageType eImageType)
+{
+ return Image(GetBitmapForCommand(rsCommandName, rxFrame, eImageType));
}
sal_Int32 CommandInfoProvider::GetPropertiesForCommand (