]> git.lyx.org Git - features.git/commitdiff
Add $$OrigAbsName placeholder to external
authorJürgen Spitzmüller <spitz@lyx.org>
Wed, 20 Mar 2024 06:57:43 +0000 (07:57 +0100)
committerJürgen Spitzmüller <spitz@lyx.org>
Wed, 20 Mar 2024 06:57:43 +0000 (07:57 +0100)
This produces the absolute path to the original file.

Documentation will follow in die time (after documentation has been
unfrozen)

src/insets/ExternalSupport.cpp

index 33c14d38be935a6a0b957346bd8e320faaf49e24..5893a5d454ccbf9a1bb175df76a542a8ace20019 100644 (file)
@@ -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,