Bug 105771 - UI: consecutive showing of changed dialog from Basic application, currently doesn't always dispose controls that are (to be) removed
Summary: UI: consecutive showing of changed dialog from Basic application, currently d...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.4.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest
Depends on:
Blocks:
 
Reported: 2017-02-05 14:48 UTC by Cor Nouws
Modified: 2017-02-10 09:48 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Zip with librelex demo / neohs folder to place in your home / readme (869.19 KB, application/zip)
2017-02-06 10:04 UTC, Cor Nouws
Details
this is what step 5 looks like (178.28 KB, image/png)
2017-02-09 11:44 UTC, Caolán McNamara
Details
screenshot good and bad (144.29 KB, image/png)
2017-02-09 13:47 UTC, Cor Nouws
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2017-02-05 14:48:49 UTC
Hi,

Take attachment 128579 [details] from bug 102957.
1. Install, the extension;
2. Place the folder neohs in your computers working directory;
3. New Writer document
4. menu LibreLex > New Document
   (first list box shows 'Letter')
5. click on red logo with P in the top row (presentations)
   > Note that some controls are displayed mixed
   > This is wrong

6. click on blue logo with T in the top row (Text documents/various..)
   (first list box shows 'Letter')
7. now choose any of the other three documents in the list box.
   > dialog builds fine, all old controls are disposed
   > this is expected


This does not happen in for example LibreOffice 4.4.7.2
So something happened. There may be a hidden error in the config/code of LibreLex. Will look at that too. But..

thanks,
Cor
Comment 1 Cor Nouws 2017-02-05 15:45:30 UTC
Version: 5.4.0.0.alpha0+
Build ID: c6dd735afb2e1b3837c4f8c5659f52fafab4c56f
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-01-30_03:01:16
Locale: nl-NL (nl_NL.UTF-8); Calc: group


@caolán: something you can have a look at?
Comment 2 Cor Nouws 2017-02-05 18:02:26 UTC
forget about  attachment 128579 [details]  - crashes in newer version. Will upload new one soon.
Comment 3 Cor Nouws 2017-02-06 10:04:41 UTC
Created attachment 130936 [details]
Zip with librelex demo / neohs folder to place in your home / readme
Comment 4 Cor Nouws 2017-02-06 10:15:30 UTC
In the dailys I have available:

was ok in Version: 5.3.0.0.alpha1+
Build ID: a6ce5d391476e4b6a2cb2d92ff45548c1d75684b
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; Layout Engine: new; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-11-03_23:34:51
Locale: nl-NL (nl_NL.UTF-8); Calc: group
  (Version without fix for bug 102957 )

is not OK in Version: 5.3.0.0.alpha1+
Build ID: 883024d657fb45c7da459017d2f936aac5644bfb
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; Layout Engine: new; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2016-11-21_22:42:51
Locale: nl-NL (nl_NL.UTF-8); Calc: group
Comment 5 Caolán McNamara 2017-02-09 11:44:54 UTC
Created attachment 131037 [details]
this is what step 5 looks like

I'm trying to understand the problem, is it visible in this screenshot ?
Comment 6 Cor Nouws 2017-02-09 13:47:01 UTC
Created attachment 131040 [details]
screenshot good and bad

(In reply to Caolán McNamara from comment #5)
> I'm trying to understand the problem, is it visible in this screenshot ?

No. (Ignoring the fact that the text boxes overlap)

Please see the screen shot.
Comment 7 Caolán McNamara 2017-02-10 09:08:25 UTC
gtk2 only. I believe the problem here is that when the dialog resizes it doesn't invalidate its contents, so the "old" drawing contents remain when the dialog is reused and resized.

So, here's how you can fix this in your macro in
Sub UpdateLstDocSoortenForCategory(sCat$)

	oControl.removeItems(0, uBound(oControl.getItems)+1)
+	with com.sun.star.awt.InvalidateStyle
+		PoDocDlg.getPeer().invalidate(.NOERASE)
+	end with
	' show the display names, not the template names
	oControl.addItems(PsDocSoortenDisplayNames(), 0)
Comment 8 Cor Nouws 2017-02-10 09:44:25 UTC
(In reply to Caolán McNamara from comment #7)
> gtk2 only. I believe the problem here is that when the dialog resizes it
> doesn't invalidate its contents, so the "old" drawing contents remain when
> the dialog is reused and resized.

The problem has been covered somehow in older LibreOffice /

> So, here's how you can fix this in your macro in
> Sub UpdateLstDocSoortenForCategory(sCat$)

Indeed. Thanks.
I applied the fix at a different place, since there are also cases where a different document type in the same category has the same problem (I didn't include that scenario in the test).

at ln 718 in Sub lstDocSoorten_Change ()

    yPosStart = yPos : yPosColumn1 = yPosStart: yPosColumn2 = yPosStart 
    End If
+    ' tdf#105771
+    with com.sun.star.awt.InvalidateStyle
+        PoDocDlg.getPeer().invalidate(.NOERASE)
+    end with
    ' place the controls for the fields/bookmarks
    For i = NDOCDATAFLDSTART to UBound (PsDocSoortNew())


Thanks again,
Cor
Comment 9 Cor Nouws 2017-02-10 09:48:43 UTC
(In reply to Cor Nouws from comment #8)

> at ln 718 in Sub lstDocSoorten_Change ()

line 867 .. (statusbar updating is sometimes odd)