Fix several occurrences of raise exception('some string'), in effect casting a string into an exception, instead of raise exception.create(). Issue #40860. Patch by n7800 (slightly modified).

(cherry picked from commit db6ed214b9)
This commit is contained in:
Bart 2024-03-23 23:16:38 +01:00 committed by Maxim Ganetsky
parent d81e62425d
commit 452adce230
2 changed files with 4 additions and 4 deletions

View File

@ -461,7 +461,7 @@ var
begin begin
if m_attr_storage.size = 0 then if m_attr_storage.size = 0 then
raise svg_exception(PChar('end_path : The path was not begun' ) ); raise svg_exception.Construct(PChar('end_path : The path was not begun' ) );
attr.Construct(cur_attr ); attr.Construct(cur_attr );
@ -636,7 +636,7 @@ end;
procedure path_renderer.pop_attr; procedure path_renderer.pop_attr;
begin begin
if m_attr_stack.size = 0 then if m_attr_stack.size = 0 then
raise svg_exception(PChar('pop_attr : Attribute stack is empty' ) ); raise svg_exception.Construct(PChar('pop_attr : Attribute stack is empty' ) );
m_attr_stack.remove_last; m_attr_stack.remove_last;

View File

@ -4394,10 +4394,10 @@ var
begin begin
// do some checks // do some checks
if (Index<0) then if (Index<0) then
raise Exception('TListPropertyEditor.GetElement Index='+IntToStr(Index)); raise Exception.Create('TListPropertyEditor.GetElement Index='+IntToStr(Index));
ElementCount:=GetElementCount; ElementCount:=GetElementCount;
if Index>=ElementCount then if Index>=ElementCount then
raise Exception('TListPropertyEditor.GetElement Index='+IntToStr(Index) raise Exception.Create('TListPropertyEditor.GetElement Index='+IntToStr(Index)
+' Count='+IntToStr(ElementCount)); +' Count='+IntToStr(ElementCount));
// get element // get element
if not IsSaving then if not IsSaving then