mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Merge from BRANCH: Workaround for HTML paste problems, reported as Bug #3031672
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@794 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
660716d9f1
commit
3f2826cb0e
1 changed files with 16 additions and 4 deletions
|
@ -650,10 +650,22 @@ namespace Greenshot.Drawing {
|
|||
}
|
||||
}
|
||||
} else if ( ClipboardHelper.GetFormats().Contains("HTML Format")) {
|
||||
HtmlFragment htmlFragment = HtmlFragment.FromClipboard();
|
||||
DeselectAllElements();
|
||||
HtmlContainer htmlContainer = AddHtmlContainer(htmlFragment.Fragment, 0, 0);
|
||||
SelectElement(htmlContainer);
|
||||
try {
|
||||
HtmlFragment htmlFragment = HtmlFragment.FromClipboard();
|
||||
DeselectAllElements();
|
||||
HtmlContainer htmlContainer = AddHtmlContainer(htmlFragment.Fragment, 0, 0);
|
||||
SelectElement(htmlContainer);
|
||||
} catch (Exception e) {
|
||||
LOG.Warn("Problem pasting HTML from the clipboard: ", e);
|
||||
// Switch to plain text
|
||||
string text = Clipboard.GetText();
|
||||
if (text != null) {
|
||||
DeselectAllElements();
|
||||
ITextContainer textContainer = AddTextContainer(text, HorizontalAlignment.Center, VerticalAlignment.CENTER,
|
||||
FontFamily.GenericSansSerif, 12f, false, false, false, 2, Color.Black, Color.Transparent);
|
||||
SelectElement(textContainer);
|
||||
}
|
||||
}
|
||||
} else if (Clipboard.ContainsText()) {
|
||||
string text = Clipboard.GetText();
|
||||
if (text != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue