Bug 163531 - LibreOffice Draw fails to restore Arrow Styles of Lines in Line Properties
Summary: LibreOffice Draw fails to restore Arrow Styles of Lines in Line Properties
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Shapes-Line
  Show dependency treegraph
 
Reported: 2024-10-19 13:13 UTC by neswal.peter
Modified: 2024-11-19 07:56 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
DrawSnipBug (12.50 KB, image/jpeg)
2024-11-09 23:08 UTC, Henry G.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description neswal.peter 2024-10-19 13:13:04 UTC
Description:
LibreOffice Draw (Tested with LibreOffice 24.8.2 Linux amd64 on Ubuntu 22.04 using LibreOffice original .deb amd64 packages for install) fails to restore Arrow Styles information for both Lines and Connectors in the Line Properties dialog window.

The Arrow Styles themself are properly applied in the drawing.


Steps to Reproduce:
1. Create a new empty LibreOffice Draw document
2. Add a new Line or Connector
3. Change the Arrow Style(s) (the problem is existing for both ends) in the Line properties dialog box
4. (Optional) Also change the Arrow Style Width
5. Save the document
6. Close Draw
7. Reopen the Draw document

Actual Results:
1. Open the Properties of the Line.
2. The Width of the modified Arrow Style of the Line is there but disabled and greyed out. All Arrow Styles are changed to "none".

Expected Results:
1. Open the Properties of the Line.
2. The Width of the Line should be there. The Arrow Style(s) should be there as specified and, if a specific Arrow Style is set, the related Width property should be enabled.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 6; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL threaded
Comment 1 Julien Nabet 2024-10-19 20:53:01 UTC
Did you use sidebar or right click then "Edit Style..."?
Comment 2 neswal.peter 2024-10-21 18:22:09 UTC
right click on the line shows arrow style "- none -"
Arrow styles in "Line" Properties in the sidebar show straight line endings without arrow heads
Comment 3 Julien Nabet 2024-10-21 18:43:26 UTC
Ok so it seems more a sync pb between sidebar and the rest.
Comment 4 raal 2024-10-21 19:31:43 UTC
No repro with Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 693b230aed7b1ca5b6f1a95ed1a76d938f5a6645
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 5 neswal.peter 2024-10-21 20:35:16 UTC
both entries are wrong - both show the wrong (empty) arrow style
Comment 6 neswal.peter 2024-10-21 20:41:22 UTC
Also tested in LibreOffice 24.2.6.2 / Linux amd64 with the same result.
If I remember correctly - this behavior was also present in 7.6.
Comment 7 Henry G. 2024-11-09 23:08:08 UTC
Created attachment 197509 [details]
DrawSnipBug

Reproduced the bug in version 24.8.2.1
The arrow has no defined style after opening the document as well as a greyed out width value. 

Version: 24.8.2.1 - Windows OS
Comment 8 Buovjaga 2024-11-18 14:00:49 UTC
This changed in 7.0 with commit 22a1557314ffa7c8ae57ebe5d0056893ed1103a8
tdf#126648 Update Arrow Style sorting after size and fill options

Found not via full bibisecting, but by first finding the version where it started and then searching with "fixed" and whiteboard: target:7.0.0 (and then checking in 7.0 repo).

It seems something in the code is relying on the arrow style names to display the correct one in the dialog. Strangely I could not find with grep anything relevant to this, although I did found some other places where bugs will also occur due to this. I will continue to investigate.
Comment 9 Buovjaga 2024-11-18 17:02:50 UTC
Dialog: cui/uiconfig/ui/linedialog.ui

Interesting id: RID_SVXPAGE_LINEEND_DEF

cui/source/tabpages/tabline.cxx
else if (rId == "RID_SVXPAGE_LINEEND_DEF")
{
    static_cast<SvxLineEndDefTabPage&>(rPage).SetLineEndList( pLineEndList );

After some explorations, put a breakpoint in a debugger to
XLineEndEntry* XLineEndList::GetLineEnd(tools::Long nIndex) const
in svx/source/xoutdev/xtablend.cxx and opened the Line dialog in Draw.

Giving "next" after breakpoint is hit takes me to
SvxLineEndLB::Fill (this=0x5a908c4b31f0, pList=rtl::Reference to 0x5a90846d2e70, bStart=true) at svx/source/dialog/dlgctrl.cxx:1029
1029            const BitmapEx aBitmap = pList->GetUiBitmap( i );

(gdb) p *pEntry
$2 = {<XPropertyEntry> = {_vptr$XPropertyEntry = 0x76afcdc43d20 <vtable for XLineEndEntry+16>, maPropEntryName = "Arrow short", maUiBitmap = {maBitmap = {
        mxSalBmp = std::shared_ptr<SalBitmap> (use count 1, weak count 0) = {get() = 0x5a908c339900}, maPrefMapMode = {mpImplMapMode = {m_pimpl = 0x5a90832f0b20}}, maPrefSize = Size = {
          width = 0, height = 0}}, maAlphaMask = {maBitmap = {mxSalBmp = std::shared_ptr<SalBitmap> (empty) = {get() = 0x0}, maPrefMapMode = {mpImplMapMode = {m_pimpl = 0x5a90832f0b20}}, 
          maPrefSize = Size = {width = 0, height = 0}}}, maBitmapSize = Size = {width = 68, height = 16}}}, m_aB2DPolyPolygon = Python Exception <class 'AttributeError'>: 'B2DPolyPolygonPrinter' object has no attribute 'exists'
}

It's not much, but it's a start in case someone wants to continue.
Comment 10 Buovjaga 2024-11-19 07:56:54 UTC
More tips:

cui/uiconfig/ui/linetabpage.ui has LB_START_STYLE and LB_END_STYLE.

cui/source/tabpages/tpline.cxx deals with these, see m_xLbStartStyle and m_xLbEndStyle.

Relevant is SvxLineTabPage::FillXLSet_Impl() where if you have applied the start style "Arrow", which exists both before and after Andreas's renaming change, nPos = m_xLbStartStyle->get_active() will get the value 3 and m_xLbStartStyle->get_active_text() correctly returns "Arrow".

If you have applied the style "Arrow Short", nPos will be 0 and m_xLbStartStyle->get_active_text() returns "- none -".

The inner workings of the get_active() function remain a mystery to me. Ie. how can we observe what m_xControl->get_active() is actually doing?