Bug 113938 - Inserting Draw Objects via BASIC command does not place them at given vertical position
Summary: Inserting Draw Objects via BASIC command does not place them at given vertica...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha1+
Hardware: All Linux (All)
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:6.0.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2017-11-19 21:23 UTC by Kai Struck
Modified: 2017-12-02 16:22 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
CreateLines.odt (10.55 KB, application/vnd.oasis.opendocument.text)
2017-11-19 21:25 UTC, Kai Struck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Struck 2017-11-19 21:23:22 UTC
Description:
The vertical position of Draw Objects inserted via BASIC command "insertTextContent" in Writer does not work. The objects are not placed at the given vertical position.


Steps to Reproduce:
1.Click the button "Create Lines" in the attached .odt


Actual Results:  
2 horizontal lines are inserted at the top of the document at the exact same vertical place, layed on top of each other.

Expected Results:
2 horizontal lines should appear below the "Button", each at a different vertical position.


Reproducible: Always


User Profile Reset: No



Additional Info:
This was tested on Linux Mint 64bit with:
master~2017-11-17_23.45.59_LibreOfficeDev_6.0.0.0.alpha1_Linux_x86-64_deb.tar.gz

The bug breaks the main function of the extension:
https://extensions.libreoffice.org/extensions/chorddiagrams



User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:57.0) Gecko/20100101 Firefox/57.0
Comment 1 Kai Struck 2017-11-19 21:25:02 UTC
Created attachment 137863 [details]
CreateLines.odt
Comment 2 Buovjaga 2017-11-20 19:30:46 UTC
Yep, it worked in 3.6.

Arch Linux 64-bit
Version: 6.0.0.0.alpha1+
Build ID: 121303615054568c204def97872343d2014af4a0
CPU threads: 8; OS: Linux 4.13; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on November 17th 2017

Arch Linux 64-bit
Version 3.6.7.2 (Build ID: e183d5b)
Comment 3 Xisco Faulí 2017-11-20 21:39:44 UTC
Regression introduced by:

author	Michael Stahl <mstahl@redhat.com>	2017-11-02 21:13:32 (GMT)
committer	Michael Stahl <mstahl@redhat.com>	2017-11-02 21:35:31 (GMT)
commit c79467ba954987f1d239c594c1e1b3af3f5515f6 (patch)
tree 5138f2c58869a486619bdac51814c0093a5c655f
parent 9a236714e539c772cad7b56caf21dc12b79e77df (diff)
sw: ODF import: default as-char shapes to vertical-pos="top"

Bisected with: bibisect-linux64-6.0

Adding Cc: to Michael Stahl
Comment 4 Michael Stahl (allotropia) 2017-11-24 15:08:02 UTC
oh, that's surprising, i was afraid that other import filters could regress
due to the changed default but didn't expect API users to care...

guess the extension could easily be fixed to set the VertOrient property
on its shapes, but on the other hand if there's more BASIC code
out there relying on this then maybe i should tweak things
so the new default only applies during file import...
Comment 5 Commit Notification 2017-11-24 16:01:40 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=67d11883740da4ef242d0002acde83f67d4b327a

tdf#113938 sw: apply new default vertical orientation only during import

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Michael Stahl (allotropia) 2017-11-24 16:02:09 UTC
fixed on master
Comment 7 Kai Struck 2017-11-24 18:41:54 UTC
Thank you very much!
Oh, you are also right about the workaround.
The extension also could be fixed by adding

newShape.VertOrient = com.sun.star.text.VertOrientation.NONE

to every element. 
I wasn't aware of this as this wasn't required before and isn't mentioned in any tutorial I read.
Now I will just rely on the official fix and be lazy to not correct my code :-)
If there are any disadvantages regarding the official fix then at least there is a way to make the extension work again.
Comment 8 Kai Struck 2017-12-02 13:30:02 UTC
Wonderful.
Seems to be fixed in master~2017-11-25_14.35.30_LibreOfficeDev_6.0.0.0.alpha1_Linux_x86-64_deb.tar.gz
on Linux Mint.

(Now please let me gently point to this bug here that prevents LO to create high quality Vector-PDFs:)
https://bugs.documentfoundation.org/show_bug.cgi?id=96892