Bug SS-2432
1 vote

Image Region: Unexpected overwriting of files

Created by Martin Kraska on 2/22/2017 5:09 PM Last Updated by Martin Kraska on 3/3/2017 12:21 AM
%
 (hrs)
Logged: 0   (hrs)

 Description

How to reproduce the problem:

  • save the attached sm file and png image to any folder.
  • open the sm file
  • clone the image region using Ctrl-drag
  • replace the filename in the new region placeholder by the variable name Grau
  • recalculate

What happens:

- The original region turns grey and you find that the file "fhb_logo_neu.png" has been overwritten (is now grey instead of red)

- perhaps also SMath gets stuck. You can, however, save the file and re-open SMath.

I expect the display of files using image regions not to backfire to the image file under any circumstances. My guess on what might happen (without any real insight):

- any image region has an external file name attribute which is set if you write a file name to the placeholder

- The file name is only changed if a new file name is specified, but not if the file name is replaced by a variable (a random unique file name should be used in that case, if  required at all)

-  upon cloning the region, this file name is not changed

- if the contents of the image changes, then the external file is synchronized.

If these assumptions are correct, then the problem is the item in bold.

 

Document as delivered in the attachment:

 

State after cloning the image region, replacing the name by the variable Grau and re-calculating:

 

State after saving and reloading the document

There are no comments for this issue.