Skip to content

Commit

Permalink
Fixed bug in NativeClipboard.SetText where only one value was getting…
Browse files Browse the repository at this point in the history
… set. (#355)
  • Loading branch information
dahall committed Jan 24, 2023
1 parent ab28c36 commit 98362b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Windows.Shell.Common/NativeClipboard.cs
Expand Up @@ -536,12 +536,12 @@ public static void SetShellItems(ShellFolder parent, IEnumerable<ShellItem> rela
/// <param name="text">The Unicode Text value.</param>
/// <param name="htmlText">The HTML text value. If <see langword="null"/>, this format will not be set.</param>
/// <param name="rtfText">The Rich Text Format value. If <see langword="null"/>, this format will not be set.</param>
public static void SetText(string text, string htmlText = null, string rtfText = null)
public static void SetText(string text, string htmlText = null, string rtfText = null) => Setter(ido =>
{
if (text is not null) SetText(text, TextDataFormat.UnicodeText);
if (htmlText is not null) SetText(htmlText, TextDataFormat.Html);
if (rtfText is not null) SetText(rtfText, TextDataFormat.Rtf);
}
if (text is not null) ido.SetData(CLIPFORMAT.CF_UNICODETEXT, text);
if (htmlText is not null) ido.SetData(ShellClipboardFormat.CF_HTML, htmlText);
if (rtfText is not null) ido.SetData(ShellClipboardFormat.CF_RTF, rtfText);
});

/// <summary>Sets a specific text type to the Clipboard.</summary>
/// <param name="value">The text value.</param>
Expand Down

0 comments on commit 98362b3

Please sign in to comment.