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

prevent creating cond formats without a attached range

Change-Id: Ic4c13fa3d0eae54b7db1fa5a4e5c5040582b21ed
üst 7f127204
......@@ -1133,6 +1133,7 @@ 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 ) );
FreeResource();
maEdRange.SetText(aRangeString);
......@@ -1207,5 +1208,21 @@ IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit*, pEdit )
return 0;
}
IMPL_LINK_NOARG( ScCondFormatDlg, OkBtnHdl )
{
rtl::OUString aRangeStr = maEdRange.GetText();
ScRangeList aRange;
aRange.Parse(aRangeStr, mpDoc, SCA_VALID, mpDoc->GetAddressConvention());
boost::scoped_ptr<ScConditionalFormat> pFormat(maCondFormList.GetConditionalFormat());
if(pFormat && pFormat->GetRange().empty() && aRange.empty())
return 0;
else
{
EndDialog(RET_OK);
}
return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -205,6 +205,7 @@ private:
ScDocument* mpDoc;
DECL_LINK( EdRangeModifyHdl, Edit* );
DECL_LINK( OkBtnHdl, void* );
public:
ScCondFormatDlg(Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType);
......
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