[LyX features/biginset] Add $$OrigAbsName placeholder to external

Juergen Spitzmueller spitz at lyx.org
Fri Apr 5 13:41:43 UTC 2024


commit 0d3d91c0551cf3158fe89e765b4e076fcc613e73
Author: Jürgen Spitzmüller <spitz at lyx.org>
Date:   Wed Mar 20 07:57:43 2024 +0100

    Add $$OrigAbsName placeholder to external
    
    This produces the absolute path to the original file.
    
    Documentation will follow in die time (after documentation has been
    unfrozen)
---
 src/insets/ExternalSupport.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/insets/ExternalSupport.cpp b/src/insets/ExternalSupport.cpp
index 33c14d38be..5893a5d454 100644
--- a/src/insets/ExternalSupport.cpp
+++ b/src/insets/ExternalSupport.cpp
@@ -106,8 +106,10 @@ string const doSubstitution(InsetExternalParams const & params,
 		params.filename.mangledFileName() :
 		params.filename.outputFileName(parentpath);
 	string const basename = changeExtension(
-			onlyFileName(filename), string());
+		    onlyFileName(filename), string());
 	string const absname = makeAbsPath(filename, parentpath).absFileName();
+	string const origabsname = makeAbsPath(params.filename.outputFileName(parentpath),
+					       parentpath).absFileName();
 
 	if (what != ALL_BUT_PATHS) {
 		string const filepath = onlyPath(filename);
@@ -136,6 +138,10 @@ string const doSubstitution(InsetExternalParams const & params,
 				    use_latex_path,
 				    PROTECT_EXTENSION,
 				    ESCAPE_DOTS);
+		result = subst_path(result, "$$OrigAbsName", origabsname,
+				    use_latex_path,
+				    PROTECT_EXTENSION,
+				    ESCAPE_DOTS);
 		result = subst_path(result, "$$RelPathMaster",
 				    relToMasterPath, use_latex_path,
 				    PROTECT_EXTENSION,


More information about the lyx-cvs mailing list