summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-07-11 16:51:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-07-11 17:13:52 +0100
commit22347f6180cec13c2f1101300e4f0b45b6d1ae39 (patch)
treeceae6eba2378455731034de9ae497aa1cab49680
parentd55c0c902838540573e32a7cf34cd8c45587adb9 (diff)
Resolves: fdo#66815 avoid resetting the selection when values are unchanged
Change-Id: I88534e0b0e8302630193f77d2d85c4029a5a8f52
-rw-r--r--include/svtools/ctrlbox.hxx8
-rw-r--r--sw/source/ui/frmdlg/column.cxx9
2 files changed, 9 insertions, 8 deletions
diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx
index ac3e2061c824..c83a94eb6425 100644
--- a/include/svtools/ctrlbox.hxx
+++ b/include/svtools/ctrlbox.hxx
@@ -325,6 +325,7 @@ public:
/** Set the width in Twips */
void SetWidth( long nWidth );
+ long GetWidth() const { return m_nWidth; }
void SetNone( const XubString& sNone );
using ListBox::InsertEntry;
@@ -356,7 +357,7 @@ public:
inline FieldUnit GetSourceUnit() const { return eSourceUnit; }
void SetColor( const Color& rColor );
- inline Color GetColor( void ) const;
+ Color GetColor() const { return aColor; }
protected:
@@ -389,11 +390,6 @@ inline void LineListBox::SetColor( const Color& rColor )
UpdateEntries( m_nWidth );
}
-inline Color LineListBox::GetColor( void ) const
-{
- return aColor;
-}
-
const Color& LineListBox::GetPaintColor( void ) const
{
return maPaintCol;
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 99381d8f677c..aa75d0b4782e 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -731,8 +731,13 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ )
m_pLinePosLbl->Enable( bEnable );
m_pLinePosDLB->Enable( bEnable );
- m_pLineTypeDLB->SetWidth( nLineWidth );
- m_pLineTypeDLB->SetColor( m_pLineColorDLB->GetSelectEntryColor( ) );
+ //fdo#66815 if the values are going to be the same, don't update
+ //them to avoid the listbox selection resetting
+ if (nLineWidth != m_pLineTypeDLB->GetWidth())
+ m_pLineTypeDLB->SetWidth(nLineWidth);
+ Color aColor(m_pLineColorDLB->GetSelectEntryColor());
+ if (aColor != m_pLineTypeDLB->GetColor())
+ m_pLineTypeDLB->SetColor(aColor);
}
else
{