diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-12-03 18:48:44 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-12-03 18:52:51 +0100 |
commit | 0ec762f00cf5dfbbbd73b55059ac832cc251c73b (patch) | |
tree | aa39750ca02c6e3dd035185791d86b4205cc4fe4 /sc | |
parent | 302bdaf2f4e3dac8c719ab0f51624209fb81ac28 (diff) |
make the Add and the Edit button work again
Change-Id: I956ff1fce8f897553c8a16d45e0bfdd529b9fd66
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/condformat/condformatmgr.cxx | 35 | ||||
-rw-r--r-- | sc/source/ui/inc/condformatdlg.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 1 |
3 files changed, 24 insertions, 14 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; } diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index ce270e109037..588d04dbd678 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -125,7 +125,7 @@ protected: public: - ScCondFormatDlg(Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat, + SC_DLLPUBLIC ScCondFormatDlg(Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType); virtual ~ScCondFormatDlg(); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index d7fa1acae417..d7816eabca49 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1771,7 +1771,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_OPENDLG_DATABAR: { sal_uInt16 nId = 1; - pScMod->SetRefDialog( nId, true ); ScRangeList aRangeList; |