diff options
author | Rishabh Kumar <kris.kr296@gmail.com> | 2016-07-05 18:01:00 +0530 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-07-06 10:09:49 +0000 |
commit | 21f36336c96743503e2732ff2fc1d3542e1a0088 (patch) | |
tree | 065a0ad2f4aa89359a2579c23a15dc79594a489b | |
parent | 246eca3e5a698671e4ce7e078d994ffd317c2a68 (diff) |
Make gradient UI bitmap resizable
Change-Id: Icaa06911a620697d86a8854ba6bc46874c195b97
Reviewed-on: https://gerrit.libreoffice.org/26949
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r-- | include/svx/xtable.hxx | 4 | ||||
-rw-r--r-- | svx/source/xoutdev/xtabgrdt.cxx | 16 |
2 files changed, 17 insertions, 3 deletions
diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx index 586b2e5650f4..93b6f39706ce 100644 --- a/include/svx/xtable.hxx +++ b/include/svx/xtable.hxx @@ -352,6 +352,9 @@ public: class SVX_DLLPUBLIC XGradientList : public XPropertyList { +private: + Bitmap CreateBitmap(long nIndex, const Size& rSize) const; + protected: virtual Bitmap CreateBitmapForUI(long nIndex) override; @@ -364,6 +367,7 @@ public: using XPropertyList::Remove; XGradientEntry* Remove(long nIndex); XGradientEntry* GetGradient(long nIndex) const; + Bitmap GetBitmapForPreview(long nIndex, const Size& rSize); virtual css::uno::Reference< css::container::XNameContainer > createInstance() override; virtual bool Create() override; diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx index 4d9a8b614626..b8c25e2e9a7a 100644 --- a/svx/source/xoutdev/xtabgrdt.cxx +++ b/svx/source/xoutdev/xtabgrdt.cxx @@ -87,7 +87,7 @@ bool XGradientList::Create() return true; } -Bitmap XGradientList::CreateBitmapForUI( long nIndex ) +Bitmap XGradientList::CreateBitmap( long nIndex, const Size& rSize ) const { Bitmap aRetval; @@ -96,8 +96,6 @@ Bitmap XGradientList::CreateBitmapForUI( long nIndex ) if(nIndex < Count()) { const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - const Size& rSize = rStyleSettings.GetListBoxPreviewDefaultPixelSize(); - // prepare polygon geometry for rectangle const basegfx::B2DPolygon aRectangle( basegfx::tools::createPolygonFromRect( @@ -212,4 +210,16 @@ Bitmap XGradientList::CreateBitmapForUI( long nIndex ) return aRetval; } +Bitmap XGradientList::CreateBitmapForUI(long nIndex) +{ + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + const Size& rSize = rStyleSettings.GetListBoxPreviewDefaultPixelSize(); + return CreateBitmap(nIndex, rSize); +} + +Bitmap XGradientList::GetBitmapForPreview(long nIndex, const Size& rSize) +{ + return CreateBitmap(nIndex, rSize); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |