summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-20 17:21:59 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-21 14:46:11 +0000
commitf9b87a2e50e7cc46a19b5fdee61e14d53550393d (patch)
tree86786cc3c894e3bca8fb240d32fc3d45c83c5f02
parent879aebdf9cd83b07edbca919d623880d94adb40c (diff)
move GetXGraphic to its only user
Change-Id: I72ec4a7e72ca3355a97f987fab70b3e3a8e45168
-rw-r--r--framework/source/uiconfiguration/imagemanagerimpl.cxx18
-rw-r--r--include/vcl/image.hxx1
-rw-r--r--svtools/source/graphic/provider.cxx8
-rw-r--r--toolkit/source/awt/vclxmenu.cxx2
-rw-r--r--toolkit/source/awt/vclxwindows.cxx2
-rw-r--r--vcl/source/image/Image.cxx7
6 files changed, 19 insertions, 19 deletions
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx
index d1e73bc3b633..33c6dd7abe9f 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.cxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx
@@ -717,6 +717,14 @@ throw (css::lang::IllegalArgumentException, css::uno::RuntimeException)
return false;
}
+namespace
+{
+ css::uno::Reference< css::graphic::XGraphic > GetXGraphic(const Image &rImage)
+ {
+ return Graphic(rImage.GetBitmapEx()).GetXGraphic();
+ }
+}
+
Sequence< uno::Reference< XGraphic > > ImageManagerImpl::getImages(
::sal_Int16 nImageType,
const Sequence< OUString >& aCommandURLSequence )
@@ -759,7 +767,7 @@ throw ( css::lang::IllegalArgumentException, css::uno::RuntimeException )
aImage = rGlobalImageList->getImageFromCommandURL( nIndex, aStrArray[n] );
}
- aGraphSeq[n] = aImage.GetXGraphic();
+ aGraphSeq[n] = GetXGraphic(aImage);
}
return aGraphSeq;
@@ -909,7 +917,7 @@ throw ( css::lang::IllegalArgumentException,
{
if ( !pReplacedImages )
pReplacedImages = new CmdToXGraphicNameAccess();
- pReplacedImages->addElement( aCommandURLSequence[i], aNewImage.GetXGraphic() );
+ pReplacedImages->addElement(aCommandURLSequence[i], GetXGraphic(aNewImage));
}
} // if ( m_bUseGlobal )
else
@@ -1013,14 +1021,14 @@ void ImageManagerImpl::reload()
if ( !pReplacedImages )
pReplacedImages = new CmdToXGraphicNameAccess();
pReplacedImages->addElement( aNewUserCmdImageSet[j],
- pImageList->GetImage( aNewUserCmdImageSet[j] ).GetXGraphic() );
+ GetXGraphic(pImageList->GetImage(aNewUserCmdImageSet[j])) );
}
else
{
if ( !pInsertedImages )
pInsertedImages = new CmdToXGraphicNameAccess();
pInsertedImages->addElement( aNewUserCmdImageSet[j],
- pImageList->GetImage( aNewUserCmdImageSet[j] ).GetXGraphic() );
+ GetXGraphic(pImageList->GetImage(aNewUserCmdImageSet[j])) );
}
}
@@ -1058,7 +1066,7 @@ void ImageManagerImpl::reload()
// Image has been found in the module/global image list => replace user image
if ( !pReplacedImages )
pReplacedImages = new CmdToXGraphicNameAccess();
- pReplacedImages->addElement( pIter->first, aImage.GetXGraphic() );
+ pReplacedImages->addElement(pIter->first, GetXGraphic(aImage));
}
} // if ( m_bUseGlobal )
else
diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx
index 752b90048070..af4aa267f48c 100644
--- a/include/vcl/image.hxx
+++ b/include/vcl/image.hxx
@@ -65,7 +65,6 @@ public:
Size GetSizePixel() const;
BitmapEx GetBitmapEx() const;
- css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const;
bool operator!() const { return !mpImplData; }
bool operator==( const Image& rImage ) const;
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index a7709062f858..87fffe6611c8 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -201,19 +201,19 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadStandardImage( co
OUString sImageName( rResourceURL.copy( nIndex ) );
if ( sImageName == "info" )
{
- xRet = InfoBox::GetStandardImage().GetXGraphic();
+ xRet = Graphic(InfoBox::GetStandardImage().GetBitmapEx()).GetXGraphic();
}
else if ( sImageName == "warning" )
{
- xRet = WarningBox::GetStandardImage().GetXGraphic();
+ xRet = Graphic(WarningBox::GetStandardImage().GetBitmapEx()).GetXGraphic();
}
else if ( sImageName == "error" )
{
- xRet = ErrorBox::GetStandardImage().GetXGraphic();
+ xRet = Graphic(ErrorBox::GetStandardImage().GetBitmapEx()).GetXGraphic();
}
else if ( sImageName == "query" )
{
- xRet = QueryBox::GetStandardImage().GetXGraphic();
+ xRet = Graphic(QueryBox::GetStandardImage().GetBitmapEx()).GetXGraphic();
}
}
return xRet;
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index aafa5b9c7529..624e61e0634a 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -873,7 +873,7 @@ throw (css::uno::RuntimeException, std::exception)
{
Image aImage = mpMenu->GetItemImage( nItemId );
if ( !!aImage )
- rxGraphic = aImage.GetXGraphic();
+ rxGraphic = Graphic(aImage.GetBitmapEx()).GetXGraphic();
}
return rxGraphic;
}
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 9ceaf50fc4f6..ff79b033bd37 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -294,7 +294,7 @@ css::uno::Any VCLXGraphicControl::getProperty( const OUString& PropertyName ) th
switch ( nPropType )
{
case BASEPROPERTY_GRAPHIC:
- aProp <<= maImage.GetXGraphic();
+ aProp <<= Graphic(maImage.GetBitmapEx()).GetXGraphic();
break;
case BASEPROPERTY_IMAGEALIGN:
{
diff --git a/vcl/source/image/Image.cxx b/vcl/source/image/Image.cxx
index d873d3eeeb86..eee064b7433d 100644
--- a/vcl/source/image/Image.cxx
+++ b/vcl/source/image/Image.cxx
@@ -110,13 +110,6 @@ BitmapEx Image::GetBitmapEx() const
return aRet;
}
-css::uno::Reference< css::graphic::XGraphic > Image::GetXGraphic() const
-{
- const Graphic aGraphic( GetBitmapEx() );
-
- return aGraphic.GetXGraphic();
-}
-
bool Image::operator==(const Image& rImage) const
{
bool bRet = false;