X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/01a9232b5e06fc1e24cbd051661d37a46827379d..86ac84b8ce086e6bbda58f422d41f84268606e35:/include/wx/convauto.h diff --git a/include/wx/convauto.h b/include/wx/convauto.h index 398888a788..b3dde4c73a 100644 --- a/include/wx/convauto.h +++ b/include/wx/convauto.h @@ -26,7 +26,8 @@ public: // default ctor, the real conversion will be created on demand wxConvAuto(wxFontEncoding enc = wxFONTENCODING_DEFAULT) { - m_conv = NULL; // the rest will be initialized later + Init(); + m_encDefault = enc; } @@ -34,7 +35,8 @@ public: // deduced on first use wxConvAuto(const wxConvAuto& other) : wxMBConv() { - m_conv = NULL; + Init(); + m_encDefault = other.m_encDefault; } @@ -84,6 +86,15 @@ private: // return the BOM type of this buffer static BOMType DetectBOM(const char *src, size_t srcLen); + // common part of all ctors + void Init() + { + // no need to initialize m_bomType and m_consumedBOM here, this will be + // done when m_conv is created + m_conv = NULL; + m_ownsConv = false; + } + // initialize m_conv with the UTF-8 conversion void InitWithUTF8() { @@ -126,7 +137,7 @@ private: bool m_consumedBOM; - DECLARE_NO_ASSIGN_CLASS(wxConvAuto) + wxDECLARE_NO_ASSIGN_CLASS(wxConvAuto); }; #endif // wxUSE_WCHAR_T