diff options
author | Armin Le Grand <alg@apache.org> | 2013-04-17 10:51:23 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-05-20 11:33:14 +0100 |
commit | ca4a3f26f96843a8b48fdb10df901a102c2c9ca3 (patch) | |
tree | 3e0467600755401b4ac69445e04f3188e73820af | |
parent | 94956686dc4d6ca6b011866bf214c51d3830fcb0 (diff) |
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
-rw-r--r-- | include/svx/dlgctrl.hxx | 18 | ||||
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 41 |
2 files changed, 47 insertions, 12 deletions
diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx index d24c38f8f354..549b27356d88 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 c12dc7f551b4..b863c34573ee 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1486,22 +1486,49 @@ 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()); + if( !pList.is() ) + return; - // entry for solid line - InsertEntry(pList->GetStringForUiSolidLine(), pList->GetBitmapForUISolidLine()); + if(getAddStandardFields()) + { + // entry for 'none' + InsertEntry(pList->GetStringForUiNoLine()); - // entries for dashed lines + // entry for solid line + InsertEntry(pList->GetStringForUiSolidLine(), pList->GetBitmapForUISolidLine()); + } - if( !pList.is() ) - return; + // entries for dashed lines long nCount = pList->Count(); XDashEntry* pEntry; |