Paste on the canvas causes unhandled exception

Paste on the canvas causes unhandled exception - Messaggi

#1 Pubblicato: 12/02/2014 13:25:25
Davide Carpi

Davide Carpi

1.443 apprezzamenti in 2.936 post.

Gruppo: Moderator

This happens when the clipboard contains strings with spaces (Win7 x64 / SMath Studio 0.97)

P.S. this not happens using the nightly build 0.96.4909

Citazione

Le informazioni su come richiamare il debug JIT (Just-In-Time) anziché questa finestra
sono riportate in fondo al messaggio.

************** Testo dell'eccezione **************
System.NullReferenceException: object reference not set to an instance of an object.
in SMath.Control.Worksheet.(String )
in SMath.Control.Worksheet.Insert(String value)
in SMath.Control.WorksheetControl.OnKeyDown(KeyEventArgs e)
in System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
in System.Windows.Forms.Control.WmKeyChar(Message& m)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



best regards,

Davide
0.96.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#2 Pubblicato: 12/02/2014 16:05:45
Davide Carpi

Davide Carpi

1.443 apprezzamenti in 2.936 post.

Gruppo: Moderator

update: I notice the same issue even when I copy and paste a string with spaces from a text area to the canvas (so probably the HTML data is not the cause)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Pubblicato: 12/02/2014 17:10:56
Andrey Ivashov

Andrey Ivashov

2.343 apprezzamenti in 4.056 post.

Gruppo: Super Administrator

Cannot reproduce on latest 0.97 (tried the same text you shown on screenshot and some others).
May it be caused by some plug-in installed? If you will find it out I hope to find a way to prevent such kind of problems in future.

Best regards.
1 utenti hanno apprezzato questo post
Davide Carpi 12/02/2014 19:20:00
#4 Pubblicato: 12/02/2014 17:32:08
Martin Kraska

Martin Kraska

1.361 apprezzamenti in 2.275 post.

Gruppo: Moderator

I can confirm that strange things happen:

1. Open installed 0.97 with nearly all plugins enabled.
2. paste "ddd " to the canvas - a hyperlink region with that string appears
3. Switch off Hyperlink Region in the extension manager
4. paste "ddd " again - a snapshot region appears
5. Disable snapshot region as well
6. Again pasting "ddd " - a crash happens with the following details:

Mostra spoiler



I can repeat that.

What I cannot repeat: sometimes pasting creates a conditionally formatted label, but I did not yet recognize the pattern how to invoke that.
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1 utenti hanno apprezzato questo post
Davide Carpi 12/02/2014 19:20:00
#5 Pubblicato: 12/02/2014 18:05:16
Davide Carpi

Davide Carpi

1.443 apprezzamenti in 2.936 post.

Gruppo: Moderator

Thank you Martin and Andrey,

I've removed all the plugins and I can reproduce what Martin said...

The crash is caused by a third plugin, DevelopmentTools .... the behavior of the Hyperlink and Snapshot regions is incredible... I'll investigate a little bit more
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#6 Pubblicato: 12/02/2014 18:25:13
Davide Carpi

Davide Carpi

1.443 apprezzamenti in 2.936 post.

Gruppo: Moderator

OK my diagnosis:

- DevelopmentTools:
This code cause the crash (here the plugin doesn't override the Paste(IClipboardManager clipboard) function)

public string[] SupportedClipboardFormats
{
	get { return new string[] { DataFormats.UnicodeText }; }
}

This solve the problem (at least for the users):
public string[] SupportedClipboardFormats
{
	get { return new string[0]; }
}

Hyperlink & Snapshot Regions:
- SMath triggers the public override bool Paste(IClipboardManager clipboard) of any available plugin, even if there aren't regions on the canvas (but this should happens only if a region exists and is focused)
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 utenti hanno apprezzato questo post
Andrey Ivashov 12/02/2014 18:39:00
#7 Pubblicato: 12/02/2014 18:39:15
Andrey Ivashov

Andrey Ivashov

2.343 apprezzamenti in 4.056 post.

Gruppo: Super Administrator

Thank you! I will implement fix asap.
1 utenti hanno apprezzato questo post
Davide Carpi 12/02/2014 19:13:00
#8 Pubblicato: 12/02/2014 20:18:35
Davide Carpi

Davide Carpi

1.443 apprezzamenti in 2.936 post.

Gruppo: Moderator

Thank you very much Andrey

Wrote

What I cannot repeat: sometimes pasting creates a conditionally formatted label, but I did not yet recognize the pattern how to invoke that.


I don't have noticed the bug in the front-end, but I've fixed the code as for the Development tools and I've pushed in the EM an update

If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • Nuovi post
  • Nessun nuovo post