Don't leave a trailing space on the time if there are no frames.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 6 Feb 2008 12:13:57 +0000 (12:13 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 6 Feb 2008 12:13:57 +0000 (12:13 +0000)
git-svn-id: http://svn.voria.com/code@1606 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/time.cpp

index 6755b80..eb4dd50 100644 (file)
@@ -209,13 +209,13 @@ Time::get_string(float fps, Time::Format format)const
 
        if(format<=FORMAT_FULL || hour)
        {
-               ret+=strprintf(format<=FORMAT_NOSPACES?"%dh":"%dh ",hour);
+               ret+=strprintf("%dh",hour);
                started = true;
        }
 
        if(format<=FORMAT_FULL || minute)
        {
-               ret+=strprintf(format<=FORMAT_NOSPACES?"%dm":"%dm ",minute);
+               ret+=strprintf(format<=FORMAT_NOSPACES||!started?"%dm":" %dm",minute);
                started = true;
        }
 
@@ -227,16 +227,16 @@ Time::get_string(float fps, Time::Format format)const
                frame=time*fps;
                if(format<=FORMAT_FULL || second)
                {
-                       ret+=strprintf(format<=FORMAT_NOSPACES?"%ds":"%ds ",(int)second);
+                       ret+=strprintf(format<=FORMAT_NOSPACES||!started?"%ds":" %ds",(int)second);
                        started = true;
                }
 
                if(format<=FORMAT_FULL || frame || !started)
                {
                        if(abs(frame-floor(frame)>=epsilon_()))
-                               ret+=strprintf("%0.3ff",frame);
+                               ret+=strprintf(format<=FORMAT_NOSPACES||!started?"%0.3ff":" %0.3ff",frame);
                        else
-                               ret+=strprintf("%0.0ff",frame);
+                               ret+=strprintf(format<=FORMAT_NOSPACES||!started?"%0.0ff":" %0.0ff",frame);
                }
        }
        else