[Libreoffice-commits] core.git: svx/source
Katarina Behrens
Katarina.Behrens at cib.de
Thu Oct 8 03:34:51 PDT 2015
svx/source/sidebar/line/LinePropertyPanelBase.cxx | 35 ++++++++++++++++++----
1 file changed, 29 insertions(+), 6 deletions(-)
New commits:
commit 2bd7a569720fdd6b808e6076ce7c8ded1cb6a5a7
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Wed Sep 30 18:00:49 2015 +0200
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 at libreoffice.org>
Reviewed-by: Yousuf Philips <philipz85 at hotmail.com>
Tested-by: Yousuf Philips <philipz85 at hotmail.com>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index f4ee9ca..4b05c89e 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);
More information about the Libreoffice-commits
mailing list