diff --git a/src/libslic3r/GCode/PostProcessor.cpp b/src/libslic3r/GCode/PostProcessor.cpp index df4acc1bf..25982959b 100644 --- a/src/libslic3r/GCode/PostProcessor.cpp +++ b/src/libslic3r/GCode/PostProcessor.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #ifdef WIN32 @@ -11,6 +12,7 @@ #define WIN32_LEAN_AND_MEAN #define NOMINMAX #include +#include // https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/ // This routine appends the given argument to a command line such that CommandLineToArgvW will return the argument string unchanged. diff --git a/src/slic3r/Config/Version.cpp b/src/slic3r/Config/Version.cpp index 70b12f23b..2eda135d6 100644 --- a/src/slic3r/Config/Version.cpp +++ b/src/slic3r/Config/Version.cpp @@ -1,5 +1,7 @@ #include "Version.hpp" +#include + #include #include #include diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index 361d16bfe..c845ca4b4 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -32,7 +32,7 @@ #include "GUI.hpp" #ifdef HAS_GLSAFE -void glAssertRecentCallImpl() +void glAssertRecentCallImpl(const char *file_name, unsigned int line, const char *function_name) { GLenum err = glGetError(); if (err == GL_NO_ERROR) @@ -48,7 +48,7 @@ void glAssertRecentCallImpl() case GL_OUT_OF_MEMORY: sErr = "Out Of Memory"; break; default: sErr = "Unknown"; break; } - BOOST_LOG_TRIVIAL(error) << "OpenGL error " << (int)err << ": " << sErr; + BOOST_LOG_TRIVIAL(error) << "OpenGL error in " << file_name << ":" << line << ", function " << function_name << "() : " << (int)err << " - " << sErr; assert(false); } #endif diff --git a/src/slic3r/GUI/3DScene.hpp b/src/slic3r/GUI/3DScene.hpp index d571f862f..e421997e5 100644 --- a/src/slic3r/GUI/3DScene.hpp +++ b/src/slic3r/GUI/3DScene.hpp @@ -16,9 +16,9 @@ #endif #ifdef HAS_GLSAFE -extern void glAssertRecentCallImpl(); -inline void glAssertRecentCall() { glAssertRecentCallImpl(); } -#define glsafe(cmd) do { cmd; glAssertRecentCallImpl(); } while (false) +extern void glAssertRecentCallImpl(const char *file_name, unsigned int line, const char *function_name); +inline void glAssertRecentCall() { glAssertRecentCallImpl(__FILE__, __LINE__, __FUNCTION__); } +#define glsafe(cmd) do { cmd; glAssertRecentCallImpl(__FILE__, __LINE__, __FUNCTION__); } while (false) #else inline void glAssertRecentCall() { } #define glsafe(cmd) cmd diff --git a/src/slic3r/GUI/GLTexture.cpp b/src/slic3r/GUI/GLTexture.cpp index b48ca2044..c1a035754 100644 --- a/src/slic3r/GUI/GLTexture.cpp +++ b/src/slic3r/GUI/GLTexture.cpp @@ -108,7 +108,7 @@ bool GLTexture::load_from_svg_files_as_sprites_array(const std::vectorGetFirstVisibleItem(); if (!cur_item || !m_treectrl->IsVisible(cur_item)) return; - auto selection = m_treectrl->GetItemText(m_treectrl->GetSelection()); + + auto selected_item = m_treectrl->GetSelection(); + auto selection = selected_item ? m_treectrl->GetItemText(selected_item) : ""; + while (cur_item) { auto title = m_treectrl->GetItemText(cur_item); for (auto page : m_pages) @@ -2497,7 +2500,10 @@ void Tab::rebuild_page_tree() if (!have_selection) { // this is triggered on first load, so we don't disable the sel change event - m_treectrl->SelectItem(m_treectrl->GetFirstVisibleItem());//! (treectrl->GetFirstChild(rootItem)); + auto item = m_treectrl->GetFirstVisibleItem(); + if (item) { + m_treectrl->SelectItem(item); + } } // Thaw(); } @@ -2524,7 +2530,10 @@ void Tab::update_page_tree_visibility() if (!have_selection) { // this is triggered on first load, so we don't disable the sel change event - m_treectrl->SelectItem(m_treectrl->GetFirstVisibleItem());//! (treectrl->GetFirstChild(rootItem)); + auto item = m_treectrl->GetFirstVisibleItem(); + if (item) { + m_treectrl->SelectItem(item); + } } }