Optimized wxRTC insertion and deletion when floating objects are present.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2014-02-15 16:19:43 +00:00
parent f2e9e3b4b7
commit 2124c5688b
4 changed files with 203 additions and 46 deletions

View File

@@ -4283,6 +4283,8 @@ public:
virtual ~wxRichTextParagraph();
wxRichTextParagraph(const wxRichTextParagraph& obj): wxRichTextCompositeObject() { Copy(obj); }
void Init();
// Overridables
virtual bool Draw(wxDC& dc, wxRichTextDrawingContext& context, const wxRichTextRange& range, const wxRichTextSelection& selection, const wxRect& rect, int descent, int style);
@@ -4416,10 +4418,23 @@ public:
*/
void LayoutFloat(wxDC& dc, wxRichTextDrawingContext& context, const wxRect& rect, const wxRect& parentRect, int style, wxRichTextFloatCollector* floatCollector);
/**
Whether the paragraph is impacted by floating objects from above.
*/
int GetImpactedByFloatingObjects() const { return m_impactedByFloatingObjects; }
/**
Sets whether the paragraph is impacted by floating objects from above.
*/
void SetImpactedByFloatingObjects(int i) { m_impactedByFloatingObjects = i; }
protected:
// The lines that make up the wrapped paragraph
wxRichTextLineList m_cachedLines;
wxRichTextLineList m_cachedLines;
// Whether the paragraph is impacted by floating objects from above
int m_impactedByFloatingObjects;
// Default tabstops
static wxArrayInt sm_defaultTabs;
@@ -6163,7 +6178,9 @@ public:
Updates the control appearance, optimizing if possible given information from the call to Layout.
*/
void UpdateAppearance(long caretPosition, bool sendUpdateEvent = false,
wxArrayInt* optimizationLineCharPositions = NULL, wxArrayInt* optimizationLineYPositions = NULL, bool isDoCmd = true);
const wxRect& oldFloatRect = wxRect(),
wxArrayInt* optimizationLineCharPositions = NULL, wxArrayInt* optimizationLineYPositions = NULL,
bool isDoCmd = true);
/**
Replaces the buffer paragraphs with the given fragment.
@@ -6216,7 +6233,8 @@ public:
/**
Calculate arrays for refresh optimization.
*/
void CalculateRefreshOptimizations(wxArrayInt& optimizationLineCharPositions, wxArrayInt& optimizationLineYPositions);
void CalculateRefreshOptimizations(wxArrayInt& optimizationLineCharPositions, wxArrayInt& optimizationLineYPositions,
wxRect& oldFloatRect);
/**
Sets the position used for e.g. insertion.