diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-09-30 18:00:49 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-10-08 10:34:31 +0000 |
commit | 2bd7a569720fdd6b808e6076ce7c8ded1cb6a5a7 (patch) | |
tree | b78d8d24b96cecaf724a3917615aa7d0e8937c1c /svx | |
parent | 64a252ffa9d0c30bec195a68c6837a0acdeca29a (diff) |
tdf#89543: Solid line in place of 'none' start|end arrow entry
Change-Id: I20edf3b57a0d3ec98d6765825a718fa77a024999
Reviewed-on: https://gerrit.libreoffice.org/19039
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Yousuf Philips <philipz85@hotmail.com>
Tested-by: Yousuf Philips <philipz85@hotmail.com>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/line/LinePropertyPanelBase.cxx | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index f4ee9cac5ac2..4b05c89eda39 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -60,7 +60,7 @@ const char UNO_SELECTWIDTH[] = ".uno:SelectWidth"; namespace { -void FillLineEndListBox(ListBox& rListBoxStart, ListBox& rListBoxEnd, const XLineEndList& rList) +void FillLineEndListBox(ListBox& rListBoxStart, ListBox& rListBoxEnd, const XLineEndList& rList, const Bitmap& rBitmapZero) { const sal_uInt32 nCount(rList.Count()); const OUString sNone(SVX_RESSTR(RID_SVXSTR_NONE)); @@ -71,10 +71,6 @@ void FillLineEndListBox(ListBox& rListBoxStart, ListBox& rListBoxEnd, const XLin rListBoxStart.Clear(); rListBoxEnd.Clear(); - // add 'none' entries - rListBoxStart.InsertEntry(sNone); - rListBoxEnd.InsertEntry(sNone); - for(sal_uInt32 i(0); i < nCount; i++) { XLineEndEntry* pEntry = rList.GetLineEnd(i); @@ -106,6 +102,28 @@ void FillLineEndListBox(ListBox& rListBoxStart, ListBox& rListBoxEnd, const XLin } } + // add 'none' entries + if (!rBitmapZero.IsEmpty()) + { + const Image aImg = rListBoxStart.GetEntryImage(0); + const Size aImgSize = aImg.GetSizePixel(); + + // take solid line bitmap and crop it to the size of + // line cap entries + Bitmap aCopyZero( rBitmapZero ); + const Rectangle aCropZero( Point(), aImgSize ); + aCopyZero.Crop( aCropZero ); + + // make it 1st item in list + rListBoxStart.InsertEntry( sNone, Image(aCopyZero), 0); + rListBoxEnd.InsertEntry( sNone, Image(aCopyZero), 0); + } + else + { + rListBoxStart.InsertEntry(sNone); + rListBoxEnd.InsertEntry(sNone); + } + rListBoxStart.SetUpdateMode(true); rListBoxEnd.SetUpdateMode(true); } @@ -761,7 +779,12 @@ void LinePropertyPanelBase::FillLineEndList() if (mxLineEndList.is()) { - FillLineEndListBox(*mpLBStart, *mpLBEnd, *mxLineEndList); + Bitmap aZeroBitmap; + + if (mxLineStyleList.is()) + aZeroBitmap = mxLineStyleList->GetBitmapForUISolidLine(); + + FillLineEndListBox(*mpLBStart, *mpLBEnd, *mxLineEndList, aZeroBitmap); } mpLBStart->SelectEntryPos(0); |