Resolves: #i122042# corrected adding default values in LineStyleListBox

(cherry picked from commit 33242bbc8350f2b253fae2d4261561796d848455)

Conflicts:
	svx/inc/svx/dlgctrl.hxx
	svx/source/dialog/dlgctrl.cxx

Change-Id: I4391164c0dbdd99c64fe7eca1bdd10cd92e32128
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx
index d24c38f..549b273 100644
--- a/include/svx/dlgctrl.hxx
+++ b/include/svx/dlgctrl.hxx
@@ -307,15 +307,23 @@ public:

class SVX_DLLPUBLIC LineLB : public ListBox
{
private:
    /// bitfield
    /// defines if standard fields (none, solid) are added, default is true
    bool        mbAddStandardFields : 1;

public:
         LineLB( Window* pParent, ResId Id ) : ListBox( pParent, Id ) {}
         LineLB( Window* pParent, WinBits aWB ) : ListBox( pParent, aWB ) {}
    LineLB(Window* pParent, ResId Id);
    LineLB(Window* pParent, WinBits aWB);
    virtual ~LineLB();

    virtual void Fill( const XDashListRef &pList );
    virtual void Fill(const XDashListRef &pList);
    bool getAddStandardFields() const { return mbAddStandardFields; }
    void setAddStandardFields(bool bNew);

    void Append( XDashEntry* pEntry, const Bitmap* pBmp = NULL );
    void Modify( XDashEntry* pEntry, sal_uInt16 nPos, const Bitmap* pBmp = NULL );
    void Append(XDashEntry* pEntry, const Bitmap* pBmp = 0);
    void Modify(XDashEntry* pEntry, sal_uInt16 nPos, const Bitmap* pBmp = 0);
    void SelectEntryByList(const XDashList* pList, const String& rStr, const XDash& rDash, sal_uInt16 nDist = 0);
};

/************************************************************************/
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index c12dc7f..b863c34 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1486,23 +1486,50 @@ void FillTypeLB::Fill()
    SetUpdateMode( sal_True );
}

LineLB::LineLB(Window* pParent, ResId Id)
:   ListBox(pParent, Id),
    mbAddStandardFields(true)
{
}

LineLB::LineLB(Window* pParent, WinBits aWB)
:   ListBox(pParent, aWB),
    mbAddStandardFields(true)
{
}

LineLB::~LineLB()
{
}

void LineLB::setAddStandardFields(bool bNew)
{
    if(getAddStandardFields() != bNew)
    {
        mbAddStandardFields = bNew;
    }
}

// Fills the listbox (provisional) with strings

void LineLB::Fill( const XDashListRef &pList )
{
    Clear();

    // entry for 'none'
    InsertEntry(pList->GetStringForUiNoLine());

    // entry for solid line
    InsertEntry(pList->GetStringForUiSolidLine(), pList->GetBitmapForUISolidLine());

    // entries for dashed lines

    if( !pList.is() )
        return;

    if(getAddStandardFields())
    {
        // entry for 'none'
        InsertEntry(pList->GetStringForUiNoLine());

        // entry for solid line
        InsertEntry(pList->GetStringForUiSolidLine(), pList->GetBitmapForUISolidLine());
    }

    // entries for dashed lines

    long nCount = pList->Count();
    XDashEntry* pEntry;
    SetUpdateMode( sal_False );