Skip to content

Commit

Permalink
Oops fix some more windows issues
Browse files Browse the repository at this point in the history
I swear my VS in VM compiled fine before this, but these are
definitely problems.
  • Loading branch information
HazardousPeach committed Oct 15, 2024
1 parent dd129ca commit 675f576
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/gui/clipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ namespace Toolbox {

Result<MimeData, ClipboardError>
getContentType(std::unordered_map<std::string, UINT> &mime_to_format,
const std::string &type) const {
const std::string &type) {
if (!OpenClipboard(nullptr)) {
return make_clipboard_error<MimeData>("Failed to open the clipboard!");
}

UINT format = CF_NULL;
if (mime_to_format.find(type) == mime_to_format.end()) {
format = FormatForMime(type);
format = SystemClipboard::FormatForMime(type);

Check failure on line 67 in src/gui/clipboard.cpp

View workflow job for this annotation

GitHub Actions / build (Windows Build, windows-latest, x64, windows, /*)

'Toolbox::SystemClipboard::FormatForMime': cannot access protected member declared in class 'Toolbox::SystemClipboard'
if (format == CF_NULL) {
mime_to_format[type] = RegisterClipboardFormat(type.c_str());
format = mime_to_format[type];
Expand Down Expand Up @@ -273,8 +273,9 @@ namespace Toolbox {
return make_clipboard_error<void>("Can't set clipboard to mulitple types at once on Windows!");
}
TOOLBOX_ASSERT(formats.size() > 0);
auto type = formats[0];

std::optional<Buffer> result = mimedata.get_data(formats[0]);
std::optional<Buffer> result = mimedata.get_data(type);
if (!result) {
return make_clipboard_error<void>(
std::format("Failed to find MIME data type \"{}\"", type));
Expand All @@ -284,7 +285,7 @@ namespace Toolbox {

UINT format = CF_NULL;
if (m_mime_to_format.find(type) == m_mime_to_format.end()) {
format = FormatForMime(type);
format = SystemClipboard::FormatForMime(type);
if (format == CF_NULL) {
m_mime_to_format[type] = RegisterClipboardFormat(type.c_str());
format = m_mime_to_format[type];
Expand Down

0 comments on commit 675f576

Please sign in to comment.