Skip to content

Commit

Permalink
Слэш в окне ругани про отсутствие файла шаблона
Browse files Browse the repository at this point in the history
  • Loading branch information
zamtmn committed Dec 16, 2024
1 parent 8913ed2 commit e13d028
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions cad_source/components/zebase/uzbpaths.pas
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface
type
TFromDirIterator=procedure (const filename:String;pdata:pointer);
TFromDirIteratorObj=procedure (const filename:String;pdata:pointer) of object;
function ExpandPath(path:String):String;
function ExpandPath(APath:String;AItDirectory:boolean=false):String;
function FindInSupportPath(const PPaths:String; FileName:String):String;
function FindInPaths(const Paths:String; FileName:String):String;

Expand Down Expand Up @@ -175,17 +175,17 @@ function FindInSupportPath(const PPaths:String; FileName:String):String;
result:='';
zDebugLn(sysutils.Format('{E}FindInSupportPath: file not found:"%s"',[{$IFNDEF DELPHI}utf8tosys{$ENDIF}(FileName)]));
end;
function ExpandPath(path:String):String;
function ExpandPath(APath:String;AItDirectory:boolean=false):String;
begin
DefaultMacros.SubstituteMacros(path);
if path='' then
DefaultMacros.SubstituteMacros(APath);
if APath='' then
result:=programpath
{else if path[1]='*' then
result:=programpath+'/'+copy(path,2,length(path)-1)}
{else if APath[1]='*' then
result:=programpath+'/'+copy(APath,2,length(APath)-1)}
else
result:=path;
result:=APath;
result:=StringReplace(result,'/', PathDelim,[rfReplaceAll, rfIgnoreCase]);
if DirectoryExists({$IFNDEF DELPHI}utf8tosys{$ENDIF}(result)) then
if AItDirectory or DirectoryExists({$IFNDEF DELPHI}utf8tosys{$ENDIF}(result)) then
if (result[length(result)]<>{'/'}PathDelim)
//or (result[length(result)]<>'\')
then
Expand Down
2 changes: 1 addition & 1 deletion cad_source/zcad/commands/uzccommand_dwgnew.pas
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function DWGNew_com(const Context:TZCADCommandContext;operands:TCommandOperands)
ZCADMainWindow.PageControl.ActivePage:=TabSheet;

if not fileexists(FileName) then begin
FileName:=expandpath(sysvar.PATH.Template_Path^)+sysvar.PATH.Template_File^;
FileName:=expandpath(sysvar.PATH.Template_Path^,true)+sysvar.PATH.Template_File^;
if fileExists(utf8tosys(FileName)) then
Load_merge(FileName,TLOLoad)
else
Expand Down

0 comments on commit e13d028

Please sign in to comment.