From 6bae09a746cf8ca525faeeb823fffffaaa2c8445 Mon Sep 17 00:00:00 2001 From: cxl Date: Wed, 3 Mar 2010 16:07:56 +0000 Subject: [PATCH] *RichText: Fixed Image typesetting/caching issue git-svn-id: svn://ultimatepp.org/upp/trunk@2167 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Value.h | 2 +- uppsrc/CtrlLib/TabCtrl.cpp | 1 + uppsrc/RichText/Para.h | 1 + uppsrc/RichText/ParaType.cpp | 3 ++- uppsrc/RichText/RichText.h | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/uppsrc/Core/Value.h b/uppsrc/Core/Value.h index 510917581..75eea064a 100644 --- a/uppsrc/Core/Value.h +++ b/uppsrc/Core/Value.h @@ -133,7 +133,7 @@ protected: public: static void Register(dword w, Void* (*c)(Stream& s)) init_; - + dword GetType() const { return ptr->GetType(); } bool IsError() const { return GetType() == ERROR_V; } bool IsVoid() const { return GetType() == VOID_V || IsError(); } diff --git a/uppsrc/CtrlLib/TabCtrl.cpp b/uppsrc/CtrlLib/TabCtrl.cpp index af48d6207..3c2f6574a 100644 --- a/uppsrc/CtrlLib/TabCtrl.cpp +++ b/uppsrc/CtrlLib/TabCtrl.cpp @@ -312,6 +312,7 @@ int TabCtrl::Find(const Ctrl& slave) const for(int i = 0; i < tab.GetCount(); i++) if(tab[i].slave == &slave) return i; + return -1; } void TabCtrl::Set(Ctrl& slave) diff --git a/uppsrc/RichText/Para.h b/uppsrc/RichText/Para.h index b0d98ed73..3f18bbfaf 100644 --- a/uppsrc/RichText/Para.h +++ b/uppsrc/RichText/Para.h @@ -195,6 +195,7 @@ struct RichPara { Buffer format; Array line; Array hformat; + Array object; int first_indent; int next_indent; diff --git a/uppsrc/RichText/ParaType.cpp b/uppsrc/RichText/ParaType.cpp index 98344e2c5..2d366f4f0 100644 --- a/uppsrc/RichText/ParaType.cpp +++ b/uppsrc/RichText/ParaType.cpp @@ -100,7 +100,8 @@ void RichPara::StorePart::Store(Lines& lines, const Part& part, int pinc) h->ascent = sz.cy - h->ydelta; h->descent = max(h->ydelta, 0); h->external = 0; - h->object = &part.object; + lines.object.Add(part.object); + h->object = &lines.object.Top(); h++; *t++ = 'x'; *p++ = pos; diff --git a/uppsrc/RichText/RichText.h b/uppsrc/RichText/RichText.h index 7980d5602..b20307d85 100644 --- a/uppsrc/RichText/RichText.h +++ b/uppsrc/RichText/RichText.h @@ -180,7 +180,7 @@ public: static int FindType(const String& name) { return Map().Find(name); } static RichObjectType& GetType(int i) { return *Map()[i]; } static String GetTypeName(int i) { return Map().GetKey(i); } - + void SetSize(int cx, int cy) { size = Size(cx, cy); NewSerial(); } void SetSize(Size sz) { size = sz; NewSerial(); } Size GetSize() const { return size; }