From: Václav Slavík Date: Tue, 15 Jul 2003 18:28:21 +0000 (+0000) Subject: don't break lines in the middle of word X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8ba2f3ec94b86800e6c7ee918ce3901da7e78b7b?ds=inline don't break lines in the middle of word git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/html/htmlcell.h b/include/wx/html/htmlcell.h index c7f8a23a75..80f49c23e1 100644 --- a/include/wx/html/htmlcell.h +++ b/include/wx/html/htmlcell.h @@ -254,6 +254,10 @@ public: // Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default // is true - the cell can be split on two pages void SetCanLiveOnPagebreak(bool can) { m_CanLiveOnPagebreak = can; } + + // Can the line be broken before this cell? + virtual bool IsLinebreakAllowed() const + { return !IsFormattingCell(); } // Returns y-coordinates that contraint the cell, i.e. left is highest // and right lowest coordinate such that the cell lays between then. @@ -338,6 +342,9 @@ public: wxHtmlRenderingInfo& info); wxCursor GetCursor() const; wxString ConvertToText(wxHtmlSelection *sel) const; + bool IsLinebreakAllowed() const { return m_allowLinebreak; } + + void SetPreviousWord(wxHtmlWordCell *cell); protected: void SetSelectionPrivPos(wxDC& dc, wxHtmlSelection *s) const; @@ -346,6 +353,7 @@ protected: unsigned& pos1, unsigned& pos2) const; wxString m_Word; + bool m_allowLinebreak; }; diff --git a/include/wx/html/winpars.h b/include/wx/html/winpars.h index d1eae9c929..5735e2c3cb 100644 --- a/include/wx/html/winpars.h +++ b/include/wx/html/winpars.h @@ -176,13 +176,15 @@ private: wxString m_FontFaceFixed, m_FontFaceNormal; // html font sizes and faces of fixed and proportional fonts - DECLARE_NO_COPY_CLASS(wxHtmlWinParser) - #if !wxUSE_UNICODE wxFontEncoding m_InputEnc, m_OutputEnc; // I/O font encodings wxEncodingConverter *m_EncConv; #endif + + wxHtmlWordCell *m_lastWordCell; + + DECLARE_NO_COPY_CLASS(wxHtmlWinParser) }; @@ -190,12 +192,12 @@ private: -//-------------------------------------------------------------------------------- +//----------------------------------------------------------------------------- // wxHtmlWinTagHandler // This is basicly wxHtmlTagHandler except // it is extended with protected member m_Parser pointing to // the wxHtmlWinParser object -//-------------------------------------------------------------------------------- +//----------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlWinTagHandler : public wxHtmlTagHandler { @@ -217,13 +219,13 @@ protected: -//-------------------------------------------------------------------------------- +//---------------------------------------------------------------------------- // wxHtmlTagsModule // This is basic of dynamic tag handlers binding. // The class provides methods for filling parser's handlers // hash table. // (See documentation for details) -//-------------------------------------------------------------------------------- +//---------------------------------------------------------------------------- class WXDLLIMPEXP_HTML wxHtmlTagsModule : public wxModule { @@ -236,8 +238,8 @@ public: virtual void OnExit(); // This is called by wxHtmlWinParser. - // The method must simply call parser->AddTagHandler(new ); - // for each handler + // The method must simply call parser->AddTagHandler(new + // ); for each handler virtual void FillHandlersTable(wxHtmlWinParser * WXUNUSED(parser)) { } }; @@ -245,8 +247,3 @@ public: #endif #endif // _WX_WINPARS_H_ - - - - -