X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3da9cffc79cd41b5f1d0c517c8c945596751e86f..8fdbcf4de8eeff67ccfaf3deec833d203f112629:/src/common/ctrlcmn.cpp diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 72e1d342b8..5130048c9d 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -149,6 +149,12 @@ void wxControlBase::DoUpdateWindowUI(wxUpdateUIEvent& event) #endif // wxUSE_RADIOBTN } +wxSize wxControlBase::DoGetSizeFromTextSize(int WXUNUSED(xlen), + int WXUNUSED(ylen)) const +{ + return wxSize(-1, -1); +} + /* static */ wxString wxControlBase::GetLabelText(const wxString& label) { @@ -236,6 +242,8 @@ wxControlBase::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(va // wxControl markup support // ---------------------------------------------------------------------------- +#if wxUSE_MARKUP + /* static */ wxString wxControlBase::RemoveMarkup(const wxString& markup) { @@ -253,6 +261,8 @@ bool wxControlBase::DoSetLabelMarkup(const wxString& markup) return true; } +#endif // wxUSE_MARKUP + // ---------------------------------------------------------------------------- // wxControlBase - ellipsization code // ---------------------------------------------------------------------------- @@ -530,15 +540,10 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc, // add this (ellipsized) row to the rest of the label ret << curLine; if ( pc == label.end() ) - { - // NOTE: this is the return which always exits the function - return ret; - } - else - { - ret << *pc; - curLine.clear(); - } + break; + + ret << *pc; + curLine.clear(); } // we need to remove mnemonics from the label for correct calculations else if ( *pc == wxS('&') && (flags & wxELLIPSIZE_FLAGS_PROCESS_MNEMONICS) ) @@ -561,14 +566,9 @@ wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc, } } - // this return would generate a - // warning C4702: unreachable code - // with MSVC since the function always exits from inside the loop - //return ret; + return ret; } - - // ---------------------------------------------------------------------------- // wxStaticBitmap // ---------------------------------------------------------------------------- @@ -584,7 +584,7 @@ wxSize wxStaticBitmapBase::DoGetBestSize() const { wxSize best; wxBitmap bmp = GetBitmap(); - if ( bmp.Ok() ) + if ( bmp.IsOk() ) best = wxSize(bmp.GetWidth(), bmp.GetHeight()); else // this is completely arbitrary