Return the translation of the local layer name, rather than always using the English...
[synfig.git] / synfig-core / trunk / src / synfig / listimporter.cpp
index aec3fd9..01ef02f 100644 (file)
@@ -2,7 +2,7 @@
 /*!    \file listimporter.cpp
 **     \brief Template File
 **
-**     $Id: listimporter.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $
+**     $Id$
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
@@ -63,7 +63,7 @@ ListImporter::ListImporter(const String &filename)
                return;
        }
        String line;
-       String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEPERATOR;
+       String prefix=etl::dirname(filename)+ETL_DIRECTORY_SEPARATOR;
        while(!stream.eof())
        {
                getline(stream,line);
@@ -96,7 +96,7 @@ bool
 ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb)
 {
 //                     DEBUGPOINT();
-       int frame=static_cast<int>(time*fps);
+       int frame=round_to_int(time*fps);
 //                     DEBUGPOINT();
 
        if(!filename_list.size())
@@ -112,10 +112,10 @@ ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb)
 
 //                     DEBUGPOINT();
        // See if that frame is cached
-       std::list<std::pair<int,Surface> >::iterator iter;
+       std::list<std::pair<String,Surface> >::iterator iter;
        for(iter=frame_cache.begin();iter!=frame_cache.end();++iter)
        {
-               if(iter->first==frame)
+               if(iter->first==filename_list[frame])
                {
 //                     DEBUGPOINT();
                        surface.mirror(iter->second);
@@ -150,7 +150,7 @@ ListImporter::get_frame(Surface &surface,Time time, ProgressCallback *cb)
 
 //     DEBUGPOINT();
 
-       frame_cache.push_back(std::pair<int,Surface>(frame,surface));
+       frame_cache.push_back(std::pair<String,Surface>(filename_list[frame],surface));
 
 //     DEBUGPOINT();