From c8e27bcaf76da427f16e4749651b9581901706dd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 11 Sep 2014 20:33:27 +0000 Subject: [PATCH] Simplify Direct2D DLLs loading code a little. Bail out earlier: if d2d1.dll is not there, it doesn't make sense to try to load dwrite.dll. Also use Load() return value directly instead of ignoring it and then checking for IsLoaded(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/graphicsd2d.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index 02fa76774c..302f160437 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -128,12 +128,10 @@ public: private: static bool LoadLibraries() { - m_dllDirect2d.Load(wxT("d2d1.dll"), wxDL_VERBATIM | wxDL_QUIET); - m_dllDirectWrite.Load(wxT("dwrite.dll"), wxDL_VERBATIM | wxDL_QUIET); + if ( !m_dllDirect2d.Load(wxT("d2d1.dll"), wxDL_VERBATIM | wxDL_QUIET) ) + return false; - bool hasDirect2dSupport = m_dllDirect2d.IsLoaded() && m_dllDirectWrite.IsLoaded(); - - if (!hasDirect2dSupport) + if ( !m_dllDirectWrite.Load(wxT("dwrite.dll"), wxDL_VERBATIM | wxDL_QUIET) ) return false; #define wxLOAD_FUNC(dll, name) \