don't unconditionally enable buttons on switching to accept/reject page

we want to disable all of them when switch to the options page and *restore*
the original enable/disable state when switching back i.e. don't enable them if
they were disabled due to change tracking password protection

regression since 8655095a49

Change-Id: I2dd6c83fd9613adf42571684a08bff81b86c9ee1
This commit is contained in:
Caolán McNamara
2013-08-18 14:16:10 +01:00
parent 1fb69ba279
commit 30ba8fa46a
2 changed files with 21 additions and 5 deletions

View File

@@ -305,6 +305,12 @@ private:
PushButton* m_pRejectAll;
PushButton* m_pUndo;
bool bEnableAccept;
bool bEnableAcceptAll;
bool bEnableReject;
bool bEnableRejectAll;
bool bEnableUndo;
DECL_LINK( PbClickHdl, PushButton* );
public:

View File

@@ -394,6 +394,11 @@ void SvxRedlinTable::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr,
SvxTPView::SvxTPView(Window * pParent)
: TabPage(pParent, "RedlineViewPage", "svx/ui/redlineviewpage.ui")
, bEnableAccept(true)
, bEnableAcceptAll(true)
, bEnableReject(true)
, bEnableRejectAll(true)
, bEnableUndo(true)
{
Dialog *pTopLevel = GetParentDialog();
pTopLevel->get(m_pAccept, "accept");
@@ -422,11 +427,11 @@ SvxTPView::SvxTPView(Window * pParent)
void SvxTPView::ActivatePage()
{
m_pAccept->Enable();
m_pReject->Enable();
m_pAcceptAll->Enable();
m_pRejectAll->Enable();
m_pUndo->Enable();
m_pAccept->Enable(bEnableAccept);
m_pReject->Enable(bEnableReject);
m_pAcceptAll->Enable(bEnableAcceptAll);
m_pRejectAll->Enable(bEnableRejectAll);
m_pUndo->Enable(bEnableUndo);
TabPage::ActivatePage();
}
@@ -477,21 +482,25 @@ void SvxTPView::InsertCalcHeader()
void SvxTPView::EnableAccept(sal_Bool nFlag)
{
bEnableAccept = nFlag;
m_pAccept->Enable(nFlag);
}
void SvxTPView::EnableAcceptAll(sal_Bool nFlag)
{
bEnableAcceptAll = nFlag;
m_pAcceptAll->Enable(nFlag);
}
void SvxTPView::EnableReject(sal_Bool nFlag)
{
bEnableReject = nFlag;
m_pReject->Enable(nFlag);
}
void SvxTPView::EnableRejectAll(sal_Bool nFlag)
{
bEnableRejectAll = nFlag;
m_pRejectAll->Enable(nFlag);
}
@@ -502,6 +511,7 @@ void SvxTPView::ShowUndo(sal_Bool nFlag)
void SvxTPView::EnableUndo(sal_Bool nFlag)
{
bEnableUndo = nFlag;
m_pUndo->Enable(nFlag);
}