diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-20 17:21:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-21 14:46:11 +0000 |
commit | f9b87a2e50e7cc46a19b5fdee61e14d53550393d (patch) | |
tree | 86786cc3c894e3bca8fb240d32fc3d45c83c5f02 /framework | |
parent | 879aebdf9cd83b07edbca919d623880d94adb40c (diff) |
move GetXGraphic to its only user
Change-Id: I72ec4a7e72ca3355a97f987fab70b3e3a8e45168
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/uiconfiguration/imagemanagerimpl.cxx | 18 |
1 files changed, 13 insertions, 5 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 |