From 452adce230d14633b261dbd6d5cb63efe4a6b50b Mon Sep 17 00:00:00 2001 From: Bart <9132501-flyingsheep@users.noreply.gitlab.com> Date: Sat, 23 Mar 2024 23:16:38 +0100 Subject: [PATCH] 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 db6ed214b9647d2729a5cde1c69893048ce0b18c) --- components/aggpas/src/svg/agg_svg_path_renderer.pas | 4 ++-- components/ideintf/propedits.pp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/aggpas/src/svg/agg_svg_path_renderer.pas b/components/aggpas/src/svg/agg_svg_path_renderer.pas index 7673542448..b053f2c96d 100644 --- a/components/aggpas/src/svg/agg_svg_path_renderer.pas +++ b/components/aggpas/src/svg/agg_svg_path_renderer.pas @@ -461,7 +461,7 @@ var begin 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 ); @@ -636,7 +636,7 @@ end; procedure path_renderer.pop_attr; begin 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; diff --git a/components/ideintf/propedits.pp b/components/ideintf/propedits.pp index 7180c41124..a77c0b79b5 100644 --- a/components/ideintf/propedits.pp +++ b/components/ideintf/propedits.pp @@ -4394,10 +4394,10 @@ var begin // do some checks if (Index<0) then - raise Exception('TListPropertyEditor.GetElement Index='+IntToStr(Index)); + raise Exception.Create('TListPropertyEditor.GetElement Index='+IntToStr(Index)); ElementCount:=GetElementCount; if Index>=ElementCount then - raise Exception('TListPropertyEditor.GetElement Index='+IntToStr(Index) + raise Exception.Create('TListPropertyEditor.GetElement Index='+IntToStr(Index) +' Count='+IntToStr(ElementCount)); // get element if not IsSaving then