summaryrefslogtreecommitdiff
path: root/sc/source/ui/condformat
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-03 18:48:44 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-03 18:52:51 +0100
commit0ec762f00cf5dfbbbd73b55059ac832cc251c73b (patch)
treeaa39750ca02c6e3dd035185791d86b4205cc4fe4 /sc/source/ui/condformat
parent302bdaf2f4e3dac8c719ab0f51624209fb81ac28 (diff)
make the Add and the Edit button work again
Change-Id: I956ff1fce8f897553c8a16d45e0bfdd529b9fd66
Diffstat (limited to 'sc/source/ui/condformat')
-rw-r--r--sc/source/ui/condformat/condformatmgr.cxx35
1 files changed, 23 insertions, 12 deletions
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index b8fb97231ff3..295a83e75eab 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -183,9 +183,6 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(Window* pParent, ScDocument* pDoc
maBtnEdit.SetClickHdl(LINK(this, ScCondFormatManagerDlg, EditBtnHdl));
maBtnAdd.SetClickHdl(LINK(this, ScCondFormatManagerDlg, AddBtnHdl));
maCtrlManager.GetListControl().SetDoubleClickHdl(LINK(this, ScCondFormatManagerDlg, EditBtnHdl));
-
- maBtnAdd.Disable();
- maBtnEdit.Disable();
}
ScCondFormatManagerDlg::~ScCondFormatManagerDlg()
@@ -224,21 +221,29 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl)
if(!pFormat)
return 0;
- boost::scoped_ptr<ScCondFormatDlg> pDlg;//(new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(),
- // pFormat->GetRange().GetTopLeftCorner(), condformat::dialog::NONE));
- /*
+ sal_uInt16 nId = 1;
+ ScModule* pScMod = SC_MOD();
+ pScMod->SetRefDialog( nId, true );
+ boost::scoped_ptr<ScCondFormatDlg> pDlg(new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(),
+ pFormat->GetRange().GetTopLeftCorner(), condformat::dialog::NONE));
+ Disable();
if(pDlg->Execute() == RET_OK)
{
sal_Int32 nKey = pFormat->GetKey();
mpFormatList->erase(nKey);
ScConditionalFormat* pNewFormat = pDlg->GetConditionalFormat();
- pNewFormat->SetKey(nKey);
- mpFormatList->InsertNew(pNewFormat);
+ if(pNewFormat)
+ {
+ pNewFormat->SetKey(nKey);
+ mpFormatList->InsertNew(pNewFormat);
+ }
+
maCtrlManager.Update();
+ mbModified = true;
}
- */
+ Enable();
- mbModified = true;
+ pScMod->SetRefDialog( nId, false );
return 0;
}
@@ -262,8 +267,12 @@ sal_uInt32 FindKey(ScConditionalFormatList* pFormatList)
IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl)
{
- boost::scoped_ptr<ScCondFormatDlg> pDlg;//(new ScCondFormatDlg(this, mpDoc, NULL, ScRangeList(),
- // maPos, condformat::dialog::CONDITION));
+ sal_uInt16 nId = 1;
+ ScModule* pScMod = SC_MOD();
+ pScMod->SetRefDialog( nId, true );
+ boost::scoped_ptr<ScCondFormatDlg> pDlg(new ScCondFormatDlg(this, mpDoc, NULL, ScRangeList(),
+ maPos, condformat::dialog::CONDITION));
+ Disable();
if(pDlg->Execute() == RET_OK)
{
ScConditionalFormat* pNewFormat = pDlg->GetConditionalFormat();
@@ -276,6 +285,8 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl)
mbModified = true;
}
+ Enable();
+ pScMod->SetRefDialog( nId, false );
return 0;
}