View Issue Details

IDProjectCategoryView StatusLast Update
0007427ScribusGeneralpublic2008-09-29 21:50
Reporterugoertz Assigned ToHerm 
PrioritynormalSeveritymajorReproducibilitysometimes
Status closedResolutionfixed 
PlatformLinuxOSDebianOS Versionsid
Product Version1.3.5svn 
Target Version1.3.5Fixed in Version1.3.5svn 
Summary0007427: Contents of Latex Frames can get mixed up because of non-unique temp file names
DescriptionIf several LaTeX frames are used within one document, it may (and often
does) happen that the content of one frame is shown in other frames, too
(and the content of the "other frames" is not displayed). The reason is
that it is not ensured properly that the tempFileBase string assigned to
each LaTeX frame is unique. Of course, once several frames get the same
file name, the same pdf file will be embedded into both frames, and will then be displayed with in Scribus, as well as exported to pdf.

As an ad hoc solution, I changed line 67 in pageitem_latexframe.cpp from

  QTemporaryFile *tempfile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_render_XXXXXX");

to

  QTemporaryFile *tempfile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_render_" + AnName + "_XXXXXX");

Although QTemporaryFile is used in order to get a unique file name, this
does not really work out, because the file is immediately deleted. After
invoking LaTeX, only files with extensions (.aux, .log, ...) remain, but
not a file with the name obtained from QTemporaryFile.

A related minor issue is (maybe) that Scribus does not really check
whether it overwrites non-scribus-related files: even if
scribus_temp_render_123 does not exist, scribus_temp_render_123.pdf
could exist and would be overwritten. This is not resolved by my
change, of course, and is quite unlikely anyway. It might be an issue
if several instances of scribus run on the same machine at the same
time.

I do not know whether my change is the right thing to do. In particular I do
not really understand what happens with the getLongPathName method (on
Windows systems). At least the change above resolves the problem for me.
Another approach might be to keep an (empty) file with the name tempFileBase.

Thanks for all your good work!

Ulrich
Steps To ReproduceCreate a document with several LaTeX frames. Depending on how Qt produces temporary file names, some frames may be "overwritten" by another frame.
TagsNo tags attached.
Patch

Relationships

child of 0007647 acknowledgedHerm Metabug: Render Frames (LaTeX, GnuPlot, LilyPond, GraphViz, etc.) 

Activities

Herm

2008-09-27 21:11

reporter   ~0020346

Fixed in r12601.

An empty file is kept till the render frame is destroyed.

Issue History

Date Modified Username Field Change
2008-09-25 19:37 ugoertz New Issue
2008-09-25 20:02 jghali Target Version => 1.3.5
2008-09-25 20:52 cbradney Status new => assigned
2008-09-25 20:52 cbradney Assigned To => Herm
2008-09-26 18:27 cbradney Severity minor => major
2008-09-27 21:11 Herm Note Added: 0020346
2008-09-27 21:11 Herm Status assigned => resolved
2008-09-27 21:11 Herm Resolution open => fixed
2008-09-29 21:50 cbradney Status resolved => closed
2008-09-29 21:50 cbradney Fixed in Version => 1.3.5svn
2008-12-10 16:32 mhanski Relationship added child of 0007382
2008-12-10 16:32 mhanski Relationship deleted child of 0007382
2008-12-10 16:33 mhanski Relationship added child of 0007647