From 2bd7a569720fdd6b808e6076ce7c8ded1cb6a5a7 Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Wed, 30 Sep 2015 18:00:49 +0200 Subject: 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 Reviewed-by: Yousuf Philips Tested-by: Yousuf Philips Reviewed-by: Katarina Behrens --- svx/source/sidebar/line/LinePropertyPanelBase.cxx | 35 +++++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'svx') 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); -- cgit