Kaydet (Commit) d55c0c90 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: fdo#66815 fix the column dialog's 'enable' dependencies of widgets

a) entire block at the bottom depends on > 1 column
b) everything in that block, except the line style widgets themselves, depend
   on line style not "none".
b) additionally then line position has an extra dependency on line height !=
   100%

Change-Id: Ia3c904c7beaa2a3f7b9157d2ec8ab51813601873
üst 33fe41cf
......@@ -703,18 +703,21 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ )
}
// nothing is turned off
const sal_uInt16 nPos = m_pLineTypeDLB->GetSelectEntryPos();
sal_Bool bEnable = 0 != nPos;
bool bEnable = isLineNotNone();
m_pLineHeightEdit->Enable( bEnable );
m_pLineHeightLbl->Enable( bEnable );
m_pLineWidthLbl->Enable( bEnable );
m_pLineWidthEdit->Enable( bEnable );
m_pLineColorDLB->Enable( bEnable );
m_pLineColorLbl->Enable( bEnable );
long nLineWidth = static_cast<long>(MetricField::ConvertDoubleValue(
m_pLineWidthEdit->GetValue( ),
m_pLineWidthEdit->GetDecimalDigits( ),
m_pLineWidthEdit->GetUnit(), MAP_TWIP ));
if( !bEnable )
pColMgr->SetNoLine();
else if( LISTBOX_ENTRY_NOTFOUND != nPos )
else
{
pColMgr->SetLineWidthAndColor(
::editeng::SvxBorderStyle( m_pLineTypeDLB->GetSelectEntryStyle( ) ),
......@@ -824,6 +827,13 @@ void SwColumnPage::Init()
std::min(long(nMaxCols), long( pColMgr->GetActualSize() / nMinWidth) )));
}
bool SwColumnPage::isLineNotNone() const
{
// nothing is turned off
const sal_uInt16 nPos = m_pLineTypeDLB->GetSelectEntryPos();
return nPos != LISTBOX_ENTRY_NOTFOUND && nPos != 0;
}
/*------------------------------------------------------------------------
Description: The number of columns has changed -- here the controls for
editing of the columns are en- or disabled according to the
......@@ -855,7 +865,9 @@ void SwColumnPage::UpdateCols()
}
}
aEd1.Enable( bEnable12 );
aDistEd1.Enable(nCols > 1);
bool bEnable = nCols > 1;
aDistEd1.Enable(bEnable);
m_pAutoWidthBox->Enable( bEnable && !bHtmlMode );
aEd2.Enable( bEnable12 );
aDistEd2.Enable(bEnable3);
aEd3.Enable( bEnable3 );
......@@ -865,21 +877,28 @@ void SwColumnPage::UpdateCols()
m_pBtnBack->Enable( bEnableBtns );
m_pBtnNext->Enable( bEnableBtns );
const sal_Bool bEnable = nCols > 1;
if( !bEnable )
m_pLineTypeDLB->Enable( bEnable );
m_pLineTypeLbl->Enable( bEnable );
if (bEnable)
{
m_pLinePosDLB->Enable( sal_False );
m_pLinePosLbl->Enable( sal_False );
bEnable = isLineNotNone();
}
//all these depend on > 1 column and line style != none
m_pLineHeightEdit->Enable( bEnable );
m_pLineHeightLbl->Enable( bEnable );
m_pLineTypeDLB->Enable( bEnable );
m_pLineTypeLbl->Enable( bEnable );
m_pLineWidthLbl->Enable( bEnable );
m_pLineWidthEdit->Enable( bEnable );
m_pLineColorDLB->Enable( bEnable );
m_pLineColorLbl->Enable( bEnable );
m_pAutoWidthBox->Enable( bEnable && !bHtmlMode );
if (bEnable)
bEnable = pColMgr->GetLineHeightPercent() != 100;
//and these additionally depend on line height != 100%
m_pLinePosDLB->Enable( bEnable );
m_pLinePosLbl->Enable( bEnable );
}
void SwColumnPage::SetLabels( sal_uInt16 nVis )
......
......@@ -171,6 +171,8 @@ class SwColumnPage : public SfxTabPage
void connectPercentFieldWrapper(PercentFieldWrap &rWrap, const OString &rName);
bool isLineNotNone() const;
public:
virtual ~SwColumnPage();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment