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 ...@@ -381,8 +381,6 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond
maBtnAdd.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, AddBtnHdl ) ); maBtnAdd.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, AddBtnHdl ) );
maBtnRemove.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, RemoveBtnHdl ) ); maBtnRemove.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, RemoveBtnHdl ) );
maEdRange.SetModifyHdl( LINK( this, ScCondFormatDlg, EdRangeModifyHdl ) ); 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.SetGetFocusHdl( LINK( this, ScCondFormatDlg, RangeGetFocusHdl ) );
maEdRange.SetLoseFocusHdl( LINK( this, ScCondFormatDlg, RangeLoseFocusHdl ) ); maEdRange.SetLoseFocusHdl( LINK( this, ScCondFormatDlg, RangeLoseFocusHdl ) );
FreeResource(); FreeResource();
...@@ -484,34 +482,6 @@ IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit*, pEdit ) ...@@ -484,34 +482,6 @@ IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit*, pEdit )
return 0; 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 ) IMPL_LINK( ScCondFormatDlg, RangeGetFocusHdl, formula::RefEdit*, pEdit )
{ {
mpLastEdit = pEdit; mpLastEdit = pEdit;
......
...@@ -119,10 +119,6 @@ private: ...@@ -119,10 +119,6 @@ private:
condformat::dialog::ScCondFormatDialogType meType; condformat::dialog::ScCondFormatDialogType meType;
DECL_LINK( EdRangeModifyHdl, Edit* ); DECL_LINK( EdRangeModifyHdl, Edit* );
DECL_LINK( OkBtnHdl, void* );
DECL_LINK( CancelBtnHdl, void* );
virtual sal_Bool Close();
protected: protected:
virtual void RefInputDone( sal_Bool bForced = false ); virtual void RefInputDone( sal_Bool bForced = false );
......
...@@ -1792,13 +1792,17 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ...@@ -1792,13 +1792,17 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
aRangeList.push_back(pRange); aRangeList.push_back(pRange);
} }
sal_Int32 nKey = 0;
const ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(aPos.Col(), aPos.Row(), aPos.Tab()); const ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(aPos.Col(), aPos.Row(), aPos.Tab());
ScCondFormatDlg* pCondFormatDlg = NULL; boost::scoped_ptr<ScCondFormatDlg> pCondFormatDlg;
if(pCondFormat) if(pCondFormat)
{ {
const ScRangeList& rCondFormatRange = pCondFormat->GetRange(); const ScRangeList& rCondFormatRange = pCondFormat->GetRange();
if(rCondFormatRange == aRangeList) 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) if(!pCondFormatDlg)
...@@ -1818,9 +1822,13 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ...@@ -1818,9 +1822,13 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
default: default:
break; 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 ); 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