]> git.lyx.org Git - features.git/commitdiff
Add calcInzipName.
authorRichard Heck <rgheck@comcast.net>
Sat, 29 Mar 2008 15:37:22 +0000 (15:37 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 29 Mar 2008 15:37:22 +0000 (15:37 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24040 a592a061-630c-0410-9148-cb99ea01b6c8

src/EmbeddedFiles.cpp
src/EmbeddedFiles.h

index a6450073cffd0812c48e5b2f12e56c307e07e57b..63b46ceb3ff5daeeb01680e39cb24fb454d00ee8 100644 (file)
@@ -368,11 +368,13 @@ const std::string absDirName = "LyX.Embed.Dir.Abs";
 const std::string driveName = "LyX.Embed.Drive";
 const std::string spaceName = "LyX.Embed.Space";
 
-std::string EmbeddedFile::calcInzipName(std::string const & buffer_path)
+// static
+std::string EmbeddedFile::calcInzipName(
+       std::string const & file, std::string const & buffer_path)
 {
-       string inzipName = to_utf8(makeRelPath(from_utf8(absFilename()),
+       string inzipName = to_utf8(makeRelPath(from_utf8(file),
                        from_utf8(buffer_path)));
-       
+
        if (FileName(inzipName).isAbsolute())
                inzipName = absDirName + '/' + inzipName;
 
@@ -390,6 +392,12 @@ std::string EmbeddedFile::calcInzipName(std::string const & buffer_path)
 }
 
 
+std::string EmbeddedFile::calcInzipName(std::string const & buffer_path)
+{
+       return calcInzipName(absFilename(), buffer_path);
+}
+
 void EmbeddedFile::syncInzipFile(std::string const & buffer_path)
 {
        BOOST_ASSERT(enabled());
index cca8e5e8e8d762155f1f7744b6d6506496761eeb..a263bb39dfbc20209a5560bbd10ae326bf45da50 100644 (file)
@@ -171,10 +171,13 @@ public:
        /// Calculate checksum of availableFile
        unsigned long checksum() const;
 
-       // calculate inzip_name_ from filename
+       /// calculate inzip_name_ from filename
+       static std::string 
+               calcInzipName(std::string const & file, std::string const & path);
+       /// calculate inzip_name_ from filename
        std::string calcInzipName(std::string const & buffer_path);
-       // move an embedded disk file with an existing inzip_name_ to 
-       // a calculated inzip_name_, if they differ.
+       /// move an embedded disk file with an existing inzip_name_ to 
+       /// a calculated inzip_name_, if they differ.
        void syncInzipFile(std::string const & buffer_path);
        
 private: