summaryrefslogtreecommitdiff
path: root/svx/source/sidebar/line/LinePropertyPanelBase.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/sidebar/line/LinePropertyPanelBase.cxx')
-rw-r--r--svx/source/sidebar/line/LinePropertyPanelBase.cxx35
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);