]> git.lyx.org Git - features.git/commitdiff
Fix substitution for $$Contents.
authorRichard Heck <rgheck@lyx.org>
Sun, 31 Jul 2016 04:15:48 +0000 (00:15 -0400)
committerRichard Heck <rgheck@lyx.org>
Sun, 31 Jul 2016 04:17:22 +0000 (00:17 -0400)
The second argument here is the length of the string to replace,
not the position of the final character.

(cherry picked from commit 6b97f2c0751ff79fc19ea0e11b4ef957fd71324c)

src/insets/ExternalSupport.cpp
status.22x

index cbbb88bc2b3e8cf6b076758fe749d1f3d6e38ee4..0bf589a5d829200df7082dd4787caefcea731529 100644 (file)
@@ -199,7 +199,7 @@ string const doSubstitution(InsetExternalParams const & params,
 
                size_t const pos = result.find("$$Contents(\"");
                size_t const end = result.find("\")", pos);
-               result.replace(pos, end + 2, contents);
+               result.replace(pos, end + 2- pos, contents);
        }
 
        return result;
index 35acf5ee38cc698d32ca1eb9254845bd14457c0a..a4a3072df78d301f65b312ae8e9c21570677760c 100644 (file)
@@ -45,6 +45,8 @@ What's new
 
 - Fixed preview of external material with plaintext and DocBook.
 
+- Fixed substitution for $$Contents in external templates.
+
 
 * LYX2LYX