summaryrefslogtreecommitdiffstats
path: root/framework
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2020-09-07 23:25:50 +0300
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2020-09-30 04:33:52 +0200
commit80e3ad82b1cfaa9e8de24cea6f118193d5a59621 (patch)
treeb9b2a72df621c764bdb3f131dce741f0849a1b50 /framework
parenttdf#136520 allow color popdowns to be tearable again (diff)
downloadcore-80e3ad82b1cfaa9e8de24cea6f118193d5a59621.tar.gz
core-80e3ad82b1cfaa9e8de24cea6f118193d5a59621.zip
tdf#130445 Use actual icon size
maImageSize was always 0x0, unless the image list was first loaded from a correctly saved file. Just drop it, and use the actual size of the first icon of the list. Change-Id: Ifcda130ed1acdde7ce53dda6f4e1b3636be2bb03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102224 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> (cherry picked from commit 8ef781e68f66a9bf7501ef82ee5625b3758b6c88) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103621 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uiconfiguration/ImageList.cxx9
-rw-r--r--framework/source/uiconfiguration/ImageList.hxx1
2 files changed, 4 insertions, 6 deletions
diff --git a/framework/source/uiconfiguration/ImageList.cxx b/framework/source/uiconfiguration/ImageList.cxx
index dfe936b50abd..8e775aeda62d 100644
--- a/framework/source/uiconfiguration/ImageList.cxx
+++ b/framework/source/uiconfiguration/ImageList.cxx
@@ -44,16 +44,16 @@ BitmapEx ImageList::GetAsHorizontalStrip() const
sal_uInt16 nCount = maImages.size();
if( !nCount )
return BitmapEx();
- Size aSize( maImageSize.Width() * nCount, maImageSize.Height() );
BitmapEx aTempl = maImages[ 0 ]->maImage.GetBitmapEx();
+ Size aImageSize(aTempl.GetSizePixel());
+ Size aSize(aImageSize.Width() * nCount, aImageSize.Height());
BitmapEx aResult( aTempl, Point(), aSize );
- tools::Rectangle aSrcRect( Point( 0, 0 ), maImageSize );
+ tools::Rectangle aSrcRect( Point( 0, 0 ), aImageSize );
for (sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++)
{
- tools::Rectangle aDestRect( Point( nIdx * maImageSize.Width(), 0 ),
- maImageSize );
+ tools::Rectangle aDestRect( Point( nIdx * aImageSize.Width(), 0 ), aImageSize );
ImageAryData *pData = maImages[ nIdx ].get();
BitmapEx aTmp = pData->maImage.GetBitmapEx();
aResult.CopyPixel( aDestRect, aSrcRect, &aTmp);
@@ -77,7 +77,6 @@ void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
maImages.clear();
maNameHash.clear();
maImages.reserve( nItems );
- maImageSize = aSize;
maPrefix.clear();
for (sal_uInt16 nIdx = 0; nIdx < nItems; nIdx++)
diff --git a/framework/source/uiconfiguration/ImageList.hxx b/framework/source/uiconfiguration/ImageList.hxx
index 7a7af3d1bb63..946805f6cdd2 100644
--- a/framework/source/uiconfiguration/ImageList.hxx
+++ b/framework/source/uiconfiguration/ImageList.hxx
@@ -65,7 +65,6 @@ private:
std::vector< std::unique_ptr<ImageAryData> > maImages;
std::unordered_map< OUString, ImageAryData * > maNameHash;
OUString maPrefix;
- Size maImageSize;
sal_uInt16 ImplGetImageId( const OUString& rImageName ) const;
void ImplAddImage( const OUString &aPrefix, const OUString &aName, sal_uInt16 nId, const Image &aImage );