diff --git a/uppsrc/CppBase/CppBase.h b/uppsrc/CppBase/CppBase.h index 5dec400d6..8c9c89bec 100644 --- a/uppsrc/CppBase/CppBase.h +++ b/uppsrc/CppBase/CppBase.h @@ -205,7 +205,7 @@ inline bool IsCppTemplate(int i) { return i == STRUCTTEMPLATE || i >= FUNCTIONTEMPLATE && i <= CLASSFUNCTIONTEMPLATE; } -enum AccessEnum { +enum CppAccess { PUBLIC, PROTECTED, PRIVATE, diff --git a/uppsrc/CtrlCore/GtkClip.cpp b/uppsrc/CtrlCore/GtkClip.cpp index 27dbc9b22..1ceb12001 100644 --- a/uppsrc/CtrlCore/GtkClip.cpp +++ b/uppsrc/CtrlCore/GtkClip.cpp @@ -5,7 +5,7 @@ NAMESPACE_UPP -#define LLOG(x) // DLOG(x) +#define LLOG(x) // DLOG(x) void Ctrl::GtkSelectionDataSet(GtkSelectionData *selection_data, const String& fmt, const String& data) { diff --git a/uppsrc/CtrlCore/GtkTop.cpp b/uppsrc/CtrlCore/GtkTop.cpp index 2943d3d0a..e1d325288 100644 --- a/uppsrc/CtrlCore/GtkTop.cpp +++ b/uppsrc/CtrlCore/GtkTop.cpp @@ -68,18 +68,13 @@ void TopWindow::CenterRect(Ctrl *owner) SetupRect(owner); if(owner && center == 1 || center == 2) { Size sz = GetRect().Size(); - DDUMP(sz); - DDUMP(center); Rect r, wr; wr = Ctrl::GetWorkArea(); Rect fm = GetFrameMargins(); - DDUMP(wr); - DDUMP(fm); if(center == 1) r = owner->GetRect(); else r = wr; - DDUMP(r); Point p = r.CenterPos(sz); r = RectC(p.x, p.y, sz.cx, sz.cy); wr.left += fm.left; diff --git a/uppsrc/CtrlLib/EditCtrl.h b/uppsrc/CtrlLib/EditCtrl.h index 16d905c3f..332556315 100644 --- a/uppsrc/CtrlLib/EditCtrl.h +++ b/uppsrc/CtrlLib/EditCtrl.h @@ -127,6 +127,7 @@ protected: int maxlen; int autosize; byte charset; + int fsell, fselh; // used to hold selection after LostFocus for X11 middle mouse copy int dropcursor; Rect dropcaret; @@ -142,7 +143,6 @@ protected: bool errorbg:1; bool showspaces:1; bool no_internal_margin:1; - bool autoselection:1; bool FrameIsEdge(); void SetEdge(int i); @@ -161,6 +161,7 @@ protected: void DoAutoFormat(); int GetTy() const; void StdPasteFilter(WString&); + void SelSource(); protected: virtual void HighlightText(Vector& hl); diff --git a/uppsrc/CtrlLib/EditField.cpp b/uppsrc/CtrlLib/EditField.cpp index 6e5d1ed49..f9f1d5592 100644 --- a/uppsrc/CtrlLib/EditField.cpp +++ b/uppsrc/CtrlLib/EditField.cpp @@ -446,6 +446,14 @@ void EditField::Layout() Finish(); } +void EditField::SelSource() +{ + if(GetSelection(fsell, fselh)) + SetSelectionSource(ClipFmtsText()); + else + fsell = fselh = -1; +} + void EditField::GotFocus() { if(autoformat && IsEditable() && !IsNull(text) && inactive_convert) { @@ -458,11 +466,8 @@ void EditField::GotFocus() if(!keep_selection && !IsSelection()) { anchor = 0; cursor = text.GetLength(); - autoselection = true; } - else - if(IsSelection()) - SetSelectionSource(ClipFmtsText()); + SelSource(); Finish(); SyncEdge(); } @@ -477,7 +482,7 @@ void EditField::LostFocus() if(s != text) text = s; } } - if(!keep_selection/* && autoselection*/) { + if(!keep_selection) { anchor = -1; cursor = sc = 0; } @@ -572,9 +577,7 @@ void EditField::Move(int newpos, bool select) anchor = -1; cursor = newpos; Finish(refresh); - if(select) - SetSelectionSource(ClipFmtsText()); - autoselection = false; + SelSource(); } void EditField::SetSelection(int l, int h) @@ -587,7 +590,7 @@ void EditField::SetSelection(int l, int h) cursor = l; anchor = -1; } - autoselection = false; + SelSource(); Finish(); } @@ -597,10 +600,10 @@ void EditField::CancelSelection() if(GetSelection(l, h)) { cursor = l; anchor = -1; + fsell = fselh = -1; sc = 0; Finish(); } - autoselection = false; } bool EditField::RemoveSelection() @@ -787,9 +790,8 @@ void EditField::LeftDrag(Point p, dword flags) String EditField::GetSelectionData(const String& fmt) const { - int sell, selh; - if(GetSelection(sell, selh)) - return GetTextClip(text.Mid(sell, selh - sell), fmt); + if(fsell >= 0 && fselh >= 0 && fsell <= text.GetCount() && fselh <= text.GetCount()) + return GetTextClip(text.Mid(fsell, fselh - fsell), fmt); return String(); } @@ -1041,7 +1043,7 @@ void EditField::Reset() font = StdFont(); showspaces = false; no_internal_margin = false; - autoselection = false; + fsell = fselh = -1; } EditField& EditField::SetFont(Font _font) diff --git a/uppsrc/ide/Browser/init b/uppsrc/ide/Browser/init index e30879745..7a2c8bd86 100644 --- a/uppsrc/ide/Browser/init +++ b/uppsrc/ide/Browser/init @@ -4,7 +4,7 @@ #include "ide\Common/init" #include "PdfDraw/init" #include "RichEdit/init" -#define BLITZ_INDEX__ F93222d80ec8e06ccbdf5f9e1c0bd4535 +#define BLITZ_INDEX__ F09f1bfac1925f12219a612fc7165f5a9 #include "TopicI.icpp" #undef BLITZ_INDEX__ #endif