Description: When dynamically adding a control to a Base form via macro, the default anchor type is 'As Character'. This causes the control to be locked into a position that cannot be changed using the models/control/shape position settings. On a Base form I can't imagine this ever being the desired default. I believe the anchor type should be 'to page' thereby allowing the positioning of the control via code. This RFE is the directly related to bug 146426: https://bugs.documentfoundation.org/show_bug.cgi?id=146426 Steps to Reproduce: 1. Write code to add control to base form 2. Note the anchor type is 'As Character' 3. Note how the control cannot be positioned via code until the anchor type is changed Actual Results: The anchor type is 'As Character' Expected Results: The anchor type is 'At Page' Reproducible: Always User Profile Reset: No Additional Info: Version: 7.2.3.2 (x64) / LibreOffice Community Build ID: d166454616c1632304285822f9c83ce2e660fd92 CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win Locale: en-US (en_US); UI: en-US Calc: threaded
Created attachment 177164 [details] Base file showing unwanted anchor setting Open the base file and double click on 'testform' and it will add a control to the form.
Confirming with Version: 7.2.1.2 / LibreOffice Community Build ID: 87b77fad49947c1441b67c559c339af8f3517e22 CPU threads: 8; OS: Mac OS X 10.16; UI render: default; VCL: osx Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR Calc: threaded
Tried this one: Opened the form for editing. Switched Design Mode off. Pressed the button. Control appears. Control Properties → Anchor → To Page will appear. Tested with LO 7.3.0.1 on OpenSUSE 15.3 64bit rpm Linux. Couldn't find a buggy behavior here.
Anchor is To Paragraph for me. Please test again. Version: 7.3.0.3 / LibreOffice Community Build ID: 30(Build:3) CPU threads: 8; OS: Linux 5.16; UI render: default; VCL: kf5 (cairo+xcb) Locale: de-DE (en_US.UTF-8); UI: en-US 7.3.0-4 Calc: threaded
Created attachment 178277 [details] Anchor will be set to page here. Tested again. 1. Right mouse click on form → Edit 2. Switch Design mode off 3. Press button 4. Switch Design mode on 5. Look at the properties of the field. → Field is shown as anchored to page. Tested with Version: 7.3.1.1 / LibreOffice Community Build ID: 349cd3ad57dce98d6b54b76f8e9f456ac7d7edb7 CPU threads: 6; OS: Linux 5.3; UI render: default; VCL: kf5 (cairo+xcb) Locale: de-DE (de_DE.UTF-8); UI: en-US Calc: threaded on openSuSE 15.3 64bit rpm Linux
My scenario in Writer with a new document (same happens with Base): 1. Form > Text Box 2. Form > Control Properties => Anchor = To Paragraph (changing it is possible, of course) While playing around I managed to reproduce the issue and newly added control went into the document anchored As Character. Happens when the command is still active (checkmark set). Solution is to fix the checked state, which is wrong anyway. It should be active only while drawing the object. Wonder if this is a regression.
I'm sorry, is there an API missing to set the wanted anchoring from macro? I see that it works nicely in the attachment 177164 [details], setting control's AnchorType. If it's there, what is the reason to change the default here? Comment 6 is completely irrelevant, since it talks about UI, not macros.