Kaydet (Commit) 302bdaf2 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

use the new possibility as modal dialog

Change-Id: I407740279d8b0e48b7b934655deb590b3abf5aa9
üst df46e745
......@@ -381,8 +381,6 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond
maBtnAdd.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, AddBtnHdl ) );
maBtnRemove.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, RemoveBtnHdl ) );
maEdRange.SetModifyHdl( LINK( this, ScCondFormatDlg, EdRangeModifyHdl ) );
maBtnOk.SetClickHdl( LINK( this, ScCondFormatDlg, OkBtnHdl ) );
maBtnCancel.SetClickHdl( LINK( this, ScCondFormatDlg, CancelBtnHdl ) );
maEdRange.SetGetFocusHdl( LINK( this, ScCondFormatDlg, RangeGetFocusHdl ) );
maEdRange.SetLoseFocusHdl( LINK( this, ScCondFormatDlg, RangeLoseFocusHdl ) );
FreeResource();
......@@ -484,34 +482,6 @@ IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit*, pEdit )
return 0;
}
sal_Bool ScCondFormatDlg::Close()
{
sal_uInt16 nId = 1;
EndDialog();
return DoClose(nId);
}
IMPL_LINK_NOARG( ScCondFormatDlg, OkBtnHdl )
{
ScConditionalFormat* pFormat = GetConditionalFormat();
SfxObjectShell* pObjectShell = mpDoc->GetDocumentShell();
sal_Int32 nKey = 0;
if(mpFormat)
nKey = mpFormat->GetKey();
static_cast<ScDocShell*>(pObjectShell)->GetDocFunc().ReplaceConditionalFormat(nKey, pFormat, maPos.Tab(), pFormat->GetRange());
Close();
return 0;
}
IMPL_LINK_NOARG( ScCondFormatDlg, CancelBtnHdl )
{
Close();
return 0;
}
IMPL_LINK( ScCondFormatDlg, RangeGetFocusHdl, formula::RefEdit*, pEdit )
{
mpLastEdit = pEdit;
......
......@@ -119,10 +119,6 @@ private:
condformat::dialog::ScCondFormatDialogType meType;
DECL_LINK( EdRangeModifyHdl, Edit* );
DECL_LINK( OkBtnHdl, void* );
DECL_LINK( CancelBtnHdl, void* );
virtual sal_Bool Close();
protected:
virtual void RefInputDone( sal_Bool bForced = false );
......
......@@ -1792,13 +1792,17 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
aRangeList.push_back(pRange);
}
sal_Int32 nKey = 0;
const ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(aPos.Col(), aPos.Row(), aPos.Tab());
ScCondFormatDlg* pCondFormatDlg = NULL;
boost::scoped_ptr<ScCondFormatDlg> pCondFormatDlg;
if(pCondFormat)
{
const ScRangeList& rCondFormatRange = pCondFormat->GetRange();
if(rCondFormatRange == aRangeList)
pCondFormatDlg = new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE );
{
nKey = pCondFormat->GetKey();
pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) );
}
}
if(!pCondFormatDlg)
......@@ -1818,9 +1822,13 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
default:
break;
}
pCondFormatDlg = new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), eType );
pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), eType ) );
}
if( pCondFormatDlg->Execute() == RET_OK )
{
ScConditionalFormat* pFormat = pCondFormatDlg->GetConditionalFormat();
pData->GetDocShell()->GetDocFunc().ReplaceConditionalFormat(nKey, pFormat, aPos.Tab(), pFormat->GetRange());
}
pCondFormatDlg->Execute();
pScMod->SetRefDialog( nId, false );
......
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