Paste on the canvas causes unhandled exception

Paste on the canvas causes unhandled exception - Сообщения

#1 Опубликовано: 12.02.2014 13:25:25
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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

Цитата

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 Опубликовано: 12.02.2014 16:05:45
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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 Опубликовано: 12.02.2014 17:10:56
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3730 понравились пользователям.

Группа: 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 пользователям понравился этот пост
Davide Carpi 12.02.2014 19:20:00
#4 Опубликовано: 12.02.2014 17:32:08
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: 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:

Показать спойлер



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.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Davide Carpi 12.02.2014 19:20:00
#5 Опубликовано: 12.02.2014 18:05:16
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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 Опубликовано: 12.02.2014 18:25:13
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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 пользователям понравился этот пост
Andrey Ivashov 12.02.2014 18:39:00
#7 Опубликовано: 12.02.2014 18:39:15
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3730 понравились пользователям.

Группа: Super Administrator

Thank you! I will implement fix asap.
1 пользователям понравился этот пост
Davide Carpi 12.02.2014 19:13:00
#8 Опубликовано: 12.02.2014 20:18:35
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: 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
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений