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

ManageNames: implement ScNameDlg::IsFormulaValid

üst 10005223
...@@ -266,7 +266,19 @@ bool ScNameDlg::IsNameValid() ...@@ -266,7 +266,19 @@ bool ScNameDlg::IsNameValid()
bool ScNameDlg::IsFormulaValid() bool ScNameDlg::IsFormulaValid()
{ {
return true; ScCompiler aComp( mpDoc, maCursorPos);
aComp.SetGrammar( mpDoc->GetGrammar() );
ScTokenArray* pCode = aComp.CompileString(maEdAssign.GetText());
if (pCode->GetCodeError())
{
delete pCode;
return false;
}
else
{
delete pCode;
return true;
}
} }
ScRangeName* ScNameDlg::GetRangeName(const rtl::OUString& rScope) ScRangeName* ScNameDlg::GetRangeName(const rtl::OUString& rScope)
...@@ -387,7 +399,11 @@ void ScNameDlg::RemovePushed() ...@@ -387,7 +399,11 @@ void ScNameDlg::RemovePushed()
void ScNameDlg::NameModified() void ScNameDlg::NameModified()
{ {
if (!IsFormulaValid()) if (!IsFormulaValid())
{
//TODO: implement an info text
return; return;
}
ScRangeNameLine aLine; ScRangeNameLine aLine;
mpRangeManagerTable->GetCurrentLine(aLine); mpRangeManagerTable->GetCurrentLine(aLine);
rtl::OUString aOldName = aLine.aName; rtl::OUString aOldName = aLine.aName;
......
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