Обсуждение: Formatted text confuses table grid under windows
Hi developers! Testing pgAdmin v.1.8.2 (Feb 5 2008), rev: 7050) on WinXP; host: pg 8.2.6 on Debian Etch Congrats on 1.8.2, guys! Better late than never. :) (My congratulations, not the release, mind you!) Upgrading was smooth, it works (mostly) stable. I do get occasional crashes, but I cannot connect them to a specific cause. I was able to pin down another (minor) issue, which I'll report instead. In today´s bug report I'd like to return to a classic: editing text in the table grid under windows. To see my point you might want to just reproduce the bug. Create an email hyperlink in an OOo document. (Insert -> Hyperlink ..) Then copy/paste the email-address to a text field in the table grid. As long as you are in edit mode, the field displays (in blue, so obviously something is different): test@foo.org As soon as you leave the field, to another column or row, saving the data or not, the display changes to: HYPERLINK "mailto:test@foo.org" test@foo.org If you re-enter the field, the text switches back to: test@foo.org No chance to get rid of the markup. Only if you enter edit mode in same field in another tuple, with _different_ content (markup or not), the behavior switches back to normal and you can edit what you see. Took me some time to discern that from mere randomness. I checked in psql an pgadmin with SELECT '|' || foo || '|' from bar; No additional characters, just HYPERLINK "mailto:test@foo.org" test@foo.org You can even reactivate the unwelcome behavior by entering the _same_ prepared email-address in the same field of another tuple. Then you cannot edit the markup-part of either field in the column with same content, until fixed as above. This might shares roots with the pesky (well-known) bug that gives us additional newlines when copying field values: the windows rich-text (?) control does not always talk straight with the rest of the application. So, not sure if you can do something about that. Regards Erwin
Hi Erwin, On Feb 9, 2008 2:56 AM, Erwin Brandstetter <brandstetter@falter.at> wrote: > Congrats on 1.8.2, guys! Better late than never. :) (My congratulations, not > the release, mind you!) Upgrading was smooth, it works (mostly) stable. I do > get occasional crashes, but I cannot connect them to a specific cause. :-( I'm sure you'll let us know if you ever figure it out! > I was able to pin down another (minor) issue, which I'll report instead. In > today´s bug report I'd like to return to a classic: editing text in the table > grid under windows. Grrr. > To see my point you might want to just reproduce the bug. Create an email > hyperlink in an OOo document. (Insert -> Hyperlink ..) Then copy/paste the > email-address to a text field in the table grid. > > As long as you are in edit mode, the field displays (in blue, so obviously > something is different): > test@foo.org > > As soon as you leave the field, to another column or row, saving the data or > not, the display changes to: > HYPERLINK "mailto:test@foo.org" test@foo.org > Unfortunately I cannot find any way around this. If we stop using the rich text control, we limit the amount of data we can handle as the non-rich text variant will simply truncate oversized data on win32. There is no way in wxWidgets to remove the URL formatting that I can find, nor is there any way offered by the rich text controls own API :-(. It is somewhat odd that we can get the text with the other formatting (font etc) though - perhaps an overisght on Microsoft's behalf? The only other option I can see is to rewrite the grid text editor to use the styled text control, but that will be some work. I'll add a TODO for it though. Cheers, Dave -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com The Oracle-compatible database company
Dave Page wrote: > Hi Erwin, >> To see my point you might want to just reproduce the bug. Create an email >> hyperlink in an OOo document. (Insert -> Hyperlink ..) Then copy/paste the >> email-address to a text field in the table grid. >> >> As long as you are in edit mode, the field displays (in blue, so obviously >> something is different): >> test@foo.org >> >> As soon as you leave the field, to another column or row, saving the data or >> not, the display changes to: >> HYPERLINK "mailto:test@foo.org" test@foo.org >> > > Unfortunately I cannot find any way around this. If we stop using the > rich text control, we limit the amount of data we can handle as the > non-rich text variant will simply truncate oversized data on win32. > There is no way in wxWidgets to remove the URL formatting that I can > find, nor is there any way offered by the rich text controls own API > :-(. It is somewhat odd that we can get the text with the other > formatting (font etc) though - perhaps an overisght on Microsoft's > behalf? AFAIK, none of that auto-formatting is a part of what Windows richtext control does, I think it's all in wx. Not that it helps you, though :-( Unless you want to add code to wx to do it... //Magnus
On Feb 12, 2008 9:46 AM, Magnus Hagander <magnus@hagander.net> wrote: > AFAIK, none of that auto-formatting is a part of what Windows richtext > control does, I think it's all in wx. Not that it helps you, though :-( > Unless you want to add code to wx to do it... No, the HYPERLINK text does come from the control itself. wxWidget's GetValue() code just uses the EM_GETTEXTRANGE message across the entire text range to retrieve the value from what I can see. -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com The Oracle-compatible database company
Dave Page wrote: > On Feb 12, 2008 9:46 AM, Magnus Hagander <magnus@hagander.net> wrote: > >> AFAIK, none of that auto-formatting is a part of what Windows richtext >> control does, I think it's all in wx. Not that it helps you, though :-( >> Unless you want to add code to wx to do it... > > No, the HYPERLINK text does come from the control itself. wxWidget's > GetValue() code just uses the EM_GETTEXTRANGE message across the > entire text range to retrieve the value from what I can see. Hmm. Ok. Then ignore what I said :-) In that case, no clue. //Magnus