Bug 111731 - changing properties of inserted graphic-objects via macro (Basic) causes file store error
Summary: changing properties of inserted graphic-objects via macro (Basic) causes file...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: Macro
  Show dependency treegraph
 
Reported: 2017-08-12 15:51 UTC by Thomas Krumbein
Modified: 2024-12-22 03:16 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
error message during storing prozess (120.35 KB, image/png)
2017-08-12 15:51 UTC, Thomas Krumbein
Details
testfile with macro (69.99 KB, application/vnd.oasis.opendocument.text)
2017-08-12 15:52 UTC, Thomas Krumbein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Krumbein 2017-08-12 15:51:09 UTC
Created attachment 135491 [details]
error message during storing prozess

situation:

You do have a writer document and insert a picture/graphic via UI (Icon or menu insert-> picture). 
- store that file.  

Everything is ok.

Now you manipulate the properties of ths graphic object via API - in ths case with basic macros. 

- I checked size, position and some others.

- works fine during processing and visible on screen (UI).

Try to store document afterwards it will cause a error message, that the "content.xml" can not be written. (see attaches pic 1).

You cannot store document - not even with "store as".

You can kill the document.... or delete the manipulated graphic. this takes away the error. 

Attached is a sample-file to show the behaviour:
Store the file on a local drive. Open it. accept Macros.

add same text or something. store the file  -> ok

select the graphic, run the macro. Pic ist reduced in size. 

now try to store the doc again.....


Included small macro just for test:

#######
Sub ChangeBildSize

  oDoc = thisComponent

  sName = oDoc.CurrentController.ViewCursor.textframe.name
  
'msgbox sName

  oObj = oDoc.GraphicObjects.getbyName(sName) 
REM Change size
  oSize = oObj.getSize()
  oSize.Height = oSize.Height/2
  oSize.Width = oSize.Width/2
  oObj.setSize(oSize)

End Sub
#######
Comment 1 Thomas Krumbein 2017-08-12 15:52:30 UTC
Created attachment 135492 [details]
testfile with macro
Comment 2 Thomas Krumbein 2017-08-12 16:46:54 UTC
Some more information:

problem causes in this line:

  sName = oDoc.CurrentController.ViewCursor.textframe.name

I do not know why, but this line removes the supported service "com.sun.star.text.TextGraphicObject" out of the graphic-object - and couses in the descripted problems.

Just removing this line and pass the name of the pic manually 

sName = "Bild1"

and all manipulations works fine inclusive storing. 

so, maybe it helps you?
Comment 3 Regina Henschel 2017-08-12 22:53:44 UTC
If the document is in this state it hangs in a loop while automatic saving and process needs to be killed.
Comment 4 Xisco Faulí 2018-10-19 12:17:35 UTC
Hi Thomas,
Some changes have been done to image handling in 6.1 version
Could you please try to reproduce it with the latest version of LibreOffice
from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to
'UNCONFIRMED' if the bug is still present in the latest version.
Comment 5 Thomas Krumbein 2018-10-25 06:11:31 UTC
Just tested with LibreOffice 6.1.0.3 (x64) on Windows 10 : 

Still the same behaviour. No change.

Status is set to UNCONFIRMED
Comment 6 Xisco Faulí 2019-04-30 08:41:59 UTC
Reproduced in

Version: 6.3.0.0.alpha0+
Build ID: f45f8d0c6eb1d5d28a92399b82d13c2894f06069
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

in previous versions

Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

it crashes at export time...

@Miklos, I thought you might be interested in this issue...
Comment 7 QA Administrators 2021-04-30 04:01:28 UTC Comment hidden (obsolete)
Comment 8 Andreas Heinisch 2022-12-22 11:15:32 UTC
In:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 73e062be1ff10e2dd889d9ec9c2d07b692077f62
CPU threads: 16; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL threaded

The following line does not work anymore:
sName = oDoc.CurrentController.ViewCursor.textframe.name
Comment 9 QA Administrators 2024-12-22 03:16:30 UTC
Dear Thomas Krumbein,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug