From e2b5d44cc85c53b7ba11b2ebe28cb49fc702fab8 Mon Sep 17 00:00:00 2001 From: cxl Date: Mon, 28 Apr 2014 16:55:48 +0000 Subject: [PATCH] CtrlCore: Fixed workares issue in X11/GTK, various cosmetics git-svn-id: svn://ultimatepp.org/upp/trunk@7336 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CodeEditor/CodeEditor.cpp | 6 ++++-- uppsrc/CodeEditor/FindReplace.cpp | 3 ++- uppsrc/CodeEditor/Syntax.cpp | 9 ++++++--- uppsrc/Core/Diag.h | 4 ++-- uppsrc/CtrlCore/DrawOpX11.cpp | 10 +++++----- uppsrc/CtrlCore/GtkTop.cpp | 2 +- uppsrc/CtrlCore/TopWin32.cpp | 4 ++-- uppsrc/CtrlCore/TopWindow.cpp | 4 ++-- uppsrc/CtrlCore/TopWindow.h | 2 +- uppsrc/CtrlCore/Win32Top.h | 2 +- uppsrc/CtrlCore/X11Proc.cpp | 10 +++++----- uppsrc/CtrlCore/X11Top.cpp | 4 ++-- uppsrc/CtrlCore/X11Wnd.cpp | 2 +- uppsrc/TextDiffCtrl/TextCtrl.cpp | 3 ++- uppsrc/ide/Assist.cpp | 15 ++++++++++----- uppsrc/ide/Browser/CodeBrowser.cpp | 3 ++- uppsrc/ide/Browser/File.cpp | 3 ++- uppsrc/ide/Browser/Topic.cpp | 3 ++- uppsrc/ide/Build.cpp | 3 ++- uppsrc/ide/Builders/Build.cpp | 4 ++-- uppsrc/ide/Builders/GccBuilder.icpp | 3 ++- uppsrc/ide/Builders/JavaBuilder.icpp | 3 ++- uppsrc/ide/LayDes/item.cpp | 3 ++- uppsrc/ide/SelectPkg.cpp | 3 ++- uppsrc/ide/UppWspc.cpp | 3 ++- uppsrc/ide/ide.cpp | 3 ++- uppsrc/ide/ide.upp | 2 +- uppsrc/ide/idebar.cpp | 9 ++++++--- uppsrc/ide/t.cpp | 3 ++- uppsrc/plugin/astyle/ASBeautifier.cpp | 6 ++++-- uppsrc/plugin/astyle/ASEnhancer.cpp | 6 ++++-- uppsrc/usvn/SvnSync.cpp | 3 ++- 32 files changed, 87 insertions(+), 56 deletions(-) diff --git a/uppsrc/CodeEditor/CodeEditor.cpp b/uppsrc/CodeEditor/CodeEditor.cpp index 4fe31a2af..a13b48e7a 100644 --- a/uppsrc/CodeEditor/CodeEditor.cpp +++ b/uppsrc/CodeEditor/CodeEditor.cpp @@ -323,11 +323,12 @@ void CodeEditor::IndentEnter(int count) { const wchar *s = pl; while(*s == '\t' || *s == ' ') InsertChar(*s++, 1); - if(st.stmtline == cl || st.blk.GetCount() && st.blk.Top() == cl) + if(st.stmtline == cl || st.blk.GetCount() && st.blk.Top() == cl) { if(indent_spaces || (s > pl && s[-1] == ' ')) InsertChar(' ', indent_amount); else InsertChar('\t', 1); + } } } @@ -512,7 +513,7 @@ void CodeEditor::MoveNextBrk(bool sel) { void CodeEditor::MovePrevBrk(bool sel) { int p = GetCursor(); if(p < 2) return; - if(!isrbrkt(GetChar(p - 1))) + if(!isrbrkt(GetChar(p - 1))) { if(p < GetLength() - 1 && isrbrkt(GetChar(p))) p++; else { @@ -520,6 +521,7 @@ void CodeEditor::MovePrevBrk(bool sel) { PlaceCaret(p, sel); return; } + } int lvl = 1; p -= 2; for(;;) { diff --git a/uppsrc/CodeEditor/FindReplace.cpp b/uppsrc/CodeEditor/FindReplace.cpp index a9235aab2..fe1d983ed 100644 --- a/uppsrc/CodeEditor/FindReplace.cpp +++ b/uppsrc/CodeEditor/FindReplace.cpp @@ -160,7 +160,7 @@ bool CodeEditor::FindFrom(int pos, bool back, const wchar *text, bool wholeword, ft.Cat(c); } else - if(c >= ' ') + if(c >= ' ') { if(wildcards) ft.Cat(c == '*' ? WILDANY : c == '?' ? WILDONE : @@ -171,6 +171,7 @@ bool CodeEditor::FindFrom(int pos, bool back, const wchar *text, bool wholeword, ); else ft.Cat(c); + } } bool wb = wholeword ? iscidl(*ft) : false; bool we = wholeword ? iscidl(*ft.Last()) : false; diff --git a/uppsrc/CodeEditor/Syntax.cpp b/uppsrc/CodeEditor/Syntax.cpp index 9de9c38e3..1d4f9ff0e 100644 --- a/uppsrc/CodeEditor/Syntax.cpp +++ b/uppsrc/CodeEditor/Syntax.cpp @@ -161,8 +161,8 @@ void CodeEditor::SyntaxState::ScanSyntax(const wchar *ln, const wchar *e, int ta break; case 4: - if(id[0] == 'e' && id[1] == 'l') - if(id[2] == 'i' && id[3] == 'f') + if(id[0] == 'e' && id[1] == 'l') { + if(id[2] == 'i' && id[3] == 'f') { if(ifstack.GetCount() == 0) { IfState& ifstate = ifstack.Add(); ifstate.ifline = 0; @@ -177,8 +177,9 @@ void CodeEditor::SyntaxState::ScanSyntax(const wchar *ln, const wchar *e, int ta else ifstate.state = IfState::ELSE_ERROR; } + } else - if(id[2] == 's' && id[3] == 'e') + if(id[2] == 's' && id[3] == 'e') { if(ifstack.GetCount() == 0) { IfState& ifstate = ifstack.Add(); ifstate.ifline = 0; @@ -193,6 +194,8 @@ void CodeEditor::SyntaxState::ScanSyntax(const wchar *ln, const wchar *e, int ta else ifstate.state = IfState::ELSE_ERROR; } + } + } break; case 5: diff --git a/uppsrc/Core/Diag.h b/uppsrc/Core/Diag.h index c7e2ac352..d9e0609ce 100644 --- a/uppsrc/Core/Diag.h +++ b/uppsrc/Core/Diag.h @@ -110,8 +110,8 @@ inline void LOGF(const char *format, ...) {} #define NEVER() LOG_NOP #define NEVER_(msg) LOG_NOP #define XNEVER(d) LOG_NOP -#define CHECK(c) (c) -#define XCHECK(c, d) (c) +#define CHECK(c) (void)(c) +#define XCHECK(c, d) (void)(c) #define TIMING(x) LOG_NOP #define HITCOUNT(x) LOG_NOP diff --git a/uppsrc/CtrlCore/DrawOpX11.cpp b/uppsrc/CtrlCore/DrawOpX11.cpp index 39edb1fb2..199d008f8 100644 --- a/uppsrc/CtrlCore/DrawOpX11.cpp +++ b/uppsrc/CtrlCore/DrawOpX11.cpp @@ -13,7 +13,7 @@ void SystemDraw::BeginOp() Vector newclip; newclip <<= clip.Top(); f.clipi = clip.GetCount(); - clip.Add() = newclip; + clip.Add() = pick(newclip); cloff.Add(f); } @@ -35,7 +35,7 @@ bool SystemDraw::ClipOp(const Rect& r) Vector newclip = Intersect(clip.Top(), r + actual_offset, ch); if(ch) { f.clipi = clip.GetCount(); - clip.Add() = newclip; + clip.Add() = pick(newclip); } cloff.Add(f); if(ch) @@ -51,7 +51,7 @@ bool SystemDraw::ClipoffOp(const Rect& r) Vector newclip = Intersect(clip.Top(), r + actual_offset, ch); if(ch) { f.clipi = clip.GetCount(); - clip.Add() = newclip; + clip.Add() = pick(newclip); } f.offseti = offset.GetCount(); actual_offset += r.TopLeft(); @@ -80,7 +80,7 @@ bool SystemDraw::ExcludeClipOp(const Rect& r) bool ch = false; Vector ncl = Subtract(cl, r + actual_offset, ch); if(ch) { - cl = ncl; + cl = pick(ncl); SetClip(); } return clip.Top().GetCount(); @@ -93,7 +93,7 @@ bool SystemDraw::IntersectClipOp(const Rect& r) bool ch = false; Vector ncl = Intersect(cl, r + actual_offset, ch); if(ch) { - cl = ncl; + cl = pick(ncl); SetClip(); } return clip.Top().GetCount(); diff --git a/uppsrc/CtrlCore/GtkTop.cpp b/uppsrc/CtrlCore/GtkTop.cpp index f1acb76a3..d13e50f1e 100644 --- a/uppsrc/CtrlCore/GtkTop.cpp +++ b/uppsrc/CtrlCore/GtkTop.cpp @@ -58,7 +58,7 @@ void TopWindow::SyncCaption() void TopWindow::CenterRect(Ctrl *owner) { GuiLock __; - SetupRect(); + SetupRect(owner); if(owner && center == 1 || center == 2) { Size sz = GetRect().Size(); Rect r, wr; diff --git a/uppsrc/CtrlCore/TopWin32.cpp b/uppsrc/CtrlCore/TopWin32.cpp index d614b314b..3e358fea2 100644 --- a/uppsrc/CtrlCore/TopWin32.cpp +++ b/uppsrc/CtrlCore/TopWin32.cpp @@ -157,10 +157,10 @@ void TopWindow::SyncCaption() #endif } -void TopWindow::CenterRect(HWND hwnd, int center) +void TopWindow::CenterRect(HWND hwnd, int center, Ctrl *owner) { GuiLock __; - SetupRect(); + SetupRect(owner); if(hwnd && center == 1 || center == 2) { Size sz = GetRect().Size(); Rect frmrc(sz); diff --git a/uppsrc/CtrlCore/TopWindow.cpp b/uppsrc/CtrlCore/TopWindow.cpp index dc4562d4d..d21acfe04 100644 --- a/uppsrc/CtrlCore/TopWindow.cpp +++ b/uppsrc/CtrlCore/TopWindow.cpp @@ -145,14 +145,14 @@ void TopWindow::RejectBreak(int ID) Break(ID); } -void TopWindow::SetupRect() +void TopWindow::SetupRect(Ctrl *owner) { Rect r = GetRect(); if(r.IsEmpty()) SetRect(GetDefaultWindowRect()); else if(r.left == 0 && r.top == 0 && center == 1) { - Rect area = Ctrl::GetWorkArea(); + Rect area = owner ? owner->GetWorkArea() : Ctrl::GetWorkArea(); SetRect(area.CenterRect(min(area.Size(), r.Size()))); } } diff --git a/uppsrc/CtrlCore/TopWindow.h b/uppsrc/CtrlCore/TopWindow.h index effed944f..c1e356b78 100644 --- a/uppsrc/CtrlCore/TopWindow.h +++ b/uppsrc/CtrlCore/TopWindow.h @@ -59,7 +59,7 @@ private: void SyncTitle(); void SyncCaption(); - void SetupRect(); + void SetupRect(Ctrl *owner); void FixIcons(); diff --git a/uppsrc/CtrlCore/Win32Top.h b/uppsrc/CtrlCore/Win32Top.h index 7b7643e46..67acce5e9 100644 --- a/uppsrc/CtrlCore/Win32Top.h +++ b/uppsrc/CtrlCore/Win32Top.h @@ -8,7 +8,7 @@ private: HICON ico, lico; void DeleteIco(); - void CenterRect(HWND owner, int center); + void CenterRect(HWND owner, int center, Ctrl *owner); public: void Open(HWND ownerhwnd); diff --git a/uppsrc/CtrlCore/X11Proc.cpp b/uppsrc/CtrlCore/X11Proc.cpp index 0d9529650..a0c64ffc1 100644 --- a/uppsrc/CtrlCore/X11Proc.cpp +++ b/uppsrc/CtrlCore/X11Proc.cpp @@ -97,12 +97,12 @@ void Ctrl::EventProc(XWindow& w, XEvent *event) if(top) { Window DestW = (parent ? GetParentWindow() : Xroot); XTranslateCoordinates(Xdisplay, top->window, DestW, 0, 0, &x, &y, &dummy); + Rect rect = RectC(x, y, e.width, e.height); + LLOG("CongigureNotify " << rect); + if(GetRect() != rect) + SetWndRect(rect); + // Synchronizes native windows (NOT the main one) } - Rect rect = RectC(x, y, e.width, e.height); - LLOG("CongigureNotify " << rect); - if(GetRect() != rect) - SetWndRect(rect); - // Synchronizes native windows (NOT the main one) SyncNativeWindows(); // 01/12/2007 - END diff --git a/uppsrc/CtrlCore/X11Top.cpp b/uppsrc/CtrlCore/X11Top.cpp index cf23aa31e..dffefc5b4 100644 --- a/uppsrc/CtrlCore/X11Top.cpp +++ b/uppsrc/CtrlCore/X11Top.cpp @@ -237,8 +237,8 @@ Buffer TopWindow::PreperIcon(const Image& icon, int& len) { void TopWindow::CenterRect(Ctrl *owner) { GuiLock __; - SetupRect(); - if((owner&& center == 1) || center == 2) { + SetupRect(owner); + if((owner && center == 1) || center == 2) { Rect r, wr; wr = Ctrl::GetWorkArea(); Size sz = GetRect().Size(); diff --git a/uppsrc/CtrlCore/X11Wnd.cpp b/uppsrc/CtrlCore/X11Wnd.cpp index 1dc3ab8ea..d8be95f17 100644 --- a/uppsrc/CtrlCore/X11Wnd.cpp +++ b/uppsrc/CtrlCore/X11Wnd.cpp @@ -328,7 +328,7 @@ void Ctrl::TimerAndPaint() { if(xw.ctrl) { LLOG("..and paint " << UPP::Name(xw.ctrl)); xw.ctrl->SyncScroll(); - Vector x = xw.invalid; + Vector x = pick(xw.invalid); xw.invalid.Clear(); xw.ctrl->DoPaint(x); } diff --git a/uppsrc/TextDiffCtrl/TextCtrl.cpp b/uppsrc/TextDiffCtrl/TextCtrl.cpp index 47155110e..05ee11ce1 100644 --- a/uppsrc/TextDiffCtrl/TextCtrl.cpp +++ b/uppsrc/TextDiffCtrl/TextCtrl.cpp @@ -67,11 +67,12 @@ void TextCompareCtrl::LeftDouble(Point pt, dword keyflags) void TextCompareCtrl::MouseMove(Point pt, dword flags) { - if(HasCapture()) + if(HasCapture()) { if(gutter_capture) LeftDown(pt, flags); else DoSelection(pt.y, true); + } } void TextCompareCtrl::LeftUp(Point pt, dword keyflags) diff --git a/uppsrc/ide/Assist.cpp b/uppsrc/ide/Assist.cpp index 56091aa7f..fa57282dd 100644 --- a/uppsrc/ide/Assist.cpp +++ b/uppsrc/ide/Assist.cpp @@ -383,7 +383,7 @@ bool AssistEditor::IncludeAssist() FindFile ff(AppendFileName(AppendFileName(include[i], include_path), "*.*")); while(ff) { String fn = ff.GetName(); - if(!ff.IsHidden()) + if(!ff.IsHidden()) { if(ff.IsFolder()) { folder.Add(fn); upper_folder.Add(ToUpper(fn)); @@ -396,6 +396,7 @@ bool AssistEditor::IncludeAssist() upper_file.Add(ToUpper(fn)); } } + } ff.Next(); } } @@ -577,7 +578,7 @@ void AssistEditor::Complete2() Vector id = GetFileIds(); for(int i = 0; i < id.GetCount(); i++) { String s = id[i]; - if(s.StartsWith(q)) + if(s.StartsWith(q)) { if(IsNull(h)) h = s; else { @@ -588,6 +589,7 @@ void AssistEditor::Complete2() break; } } + } } if(h.GetCount() > q.GetCount()) Paste(h.Mid(q.GetCount()).ToWString()); @@ -742,20 +744,22 @@ bool AssistEditor::Key(dword key, int count) if(popup.IsOpen()) { int k = key & ~K_CTRL; ArrayCtrl& kt = key & K_CTRL ? type : assist; - if(k == K_UP || k == K_PAGEUP || k == K_CTRL_PAGEUP || k == K_CTRL_END) + if(k == K_UP || k == K_PAGEUP || k == K_CTRL_PAGEUP || k == K_CTRL_END) { if(kt.IsCursor()) return kt.Key(k, count); else { kt.SetCursor(kt.GetCount() - 1); return true; } - if(k == K_DOWN || k == K_PAGEDOWN || k == K_CTRL_PAGEDOWN || k == K_CTRL_HOME) + } + if(k == K_DOWN || k == K_PAGEDOWN || k == K_CTRL_PAGEDOWN || k == K_CTRL_HOME) { if(kt.IsCursor()) return kt.Key(k, count); else { kt.SetCursor(0); return true; } + } if(key == K_ENTER && assist.IsCursor()) { AssistInsert(); return true; @@ -950,7 +954,7 @@ void AssistEditor::DCopy() decl = false; for(int j = 0; j < n.GetCount(); j++) { const CppItem& m = n[j]; - if(m.IsCode()) + if(m.IsCode()) { if(decl) r << MakeDefinition(cls, m.natural) << "\n{\n}\n\n"; else { @@ -958,6 +962,7 @@ void AssistEditor::DCopy() r << String('\t', Split(cpp.GetKey(i), ':').GetCount()); r << m.natural << ";\n"; } + } if(m.IsData()) { if(cls.GetCount()) { const char *s = m.natural; diff --git a/uppsrc/ide/Browser/CodeBrowser.cpp b/uppsrc/ide/Browser/CodeBrowser.cpp index 8dae43565..03f53705d 100644 --- a/uppsrc/ide/Browser/CodeBrowser.cpp +++ b/uppsrc/ide/Browser/CodeBrowser.cpp @@ -52,7 +52,7 @@ struct ScopeLess { String CodeBrowser::GetPm() { String pm; - if(TheIde() && range) + if(TheIde() && range) { if(range == 1) pm = TheIde()->IdeGetNestFolder(); else { @@ -60,6 +60,7 @@ String CodeBrowser::GetPm() if(range == 2) pm = GetFileFolder(pm); } + } return pm; } diff --git a/uppsrc/ide/Browser/File.cpp b/uppsrc/ide/Browser/File.cpp index 85eaf9d2d..9ff8455a7 100644 --- a/uppsrc/ide/Browser/File.cpp +++ b/uppsrc/ide/Browser/File.cpp @@ -146,11 +146,12 @@ void SaveGroupInc(const String& grouppath) gh << "END_TOPIC\r\n\r\n"; } String fn = AppendFileName(AppendFileName(packagedir, group + ".tpp"), "all.i"); - if(LoadFile(fn) != gh) + if(LoadFile(fn) != gh) { if(IsNull(gh)) DeleteFile(fn); else SaveFile(fn, gh); + } } void SetTopicGroupIncludeable(const char *path, bool set) diff --git a/uppsrc/ide/Browser/Topic.cpp b/uppsrc/ide/Browser/Topic.cpp index e54f41a16..535ad3ba5 100644 --- a/uppsrc/ide/Browser/Topic.cpp +++ b/uppsrc/ide/Browser/Topic.cpp @@ -121,12 +121,13 @@ void TopicEditor::SaveTopic() WString t; for(int i = 0; i < para.GetCount(); i++) if(para[i].IsText()) - for(const wchar *s = para[i].text; *s; s++) + for(const wchar *s = para[i].text; *s; s++) { if(*s == '\t' || *s == 160) t.Cat(' '); else if(*s >= ' ') t.Cat(*s); + } if(!IsNull(t)) title <<= t; } diff --git a/uppsrc/ide/Build.cpp b/uppsrc/ide/Build.cpp index c7bc52d14..4244e8e0d 100644 --- a/uppsrc/ide/Build.cpp +++ b/uppsrc/ide/Build.cpp @@ -61,11 +61,12 @@ void Ide::EndBuilding(bool ok) PutConsole(""); PutConsole((ok ? "OK. " : "There were errors. ") + GetPrintTime(build_time)); SetIdeState(EDITING); - if(GetTopWindow()->IsOpen()) + if(GetTopWindow()->IsOpen()) { if(ok) BeepMuteInformation(); else BeepMuteExclamation(); + } ShowConsole(); } diff --git a/uppsrc/ide/Builders/Build.cpp b/uppsrc/ide/Builders/Build.cpp index fcdb9c97c..0bd2a93fd 100644 --- a/uppsrc/ide/Builders/Build.cpp +++ b/uppsrc/ide/Builders/Build.cpp @@ -633,11 +633,11 @@ void MakeBuild::SaveMakeFile(const String& fn, bool exporting) << "\tif [ -d $(UPPOUT) ]; then rm -rf $(UPPOUT); fi;\n"; bool sv = ::SaveFile(fn, makefile); - if(!exporting) + if(!exporting) { if(sv) PutConsole(NFormat("%s(1): makefile generation complete", fn)); else PutConsole(NFormat("%s: error writing makefile", fn)); - + } EndBuilding(true); } diff --git a/uppsrc/ide/Builders/GccBuilder.icpp b/uppsrc/ide/Builders/GccBuilder.icpp index c02c34e97..045e116cb 100644 --- a/uppsrc/ide/Builders/GccBuilder.icpp +++ b/uppsrc/ide/Builders/GccBuilder.icpp @@ -473,11 +473,12 @@ bool GccBuilder::Link(const Vector& linkfile, const String& linkoptions, lnk << ' ' << GetHostPathQ(FindInDirs(libpath, lib[i])); } else - if(ext != ".a") + if(ext != ".a") { if(ext == ".so" || ext == ".dll" || ext == ".lib") lnk << ' ' << GetHostPathQ(FindInDirs(libpath, lib[i])); else lnk << " -l" << ln; + } } } PutConsole("Linking..."); diff --git a/uppsrc/ide/Builders/JavaBuilder.icpp b/uppsrc/ide/Builders/JavaBuilder.icpp index 7459f37ee..fe053b018 100644 --- a/uppsrc/ide/Builders/JavaBuilder.icpp +++ b/uppsrc/ide/Builders/JavaBuilder.icpp @@ -149,11 +149,12 @@ bool JavaBuilder::BuildPackage(const String& package, Vector& linkfile, String linkcmd; linkcmd << "javac"; linkcmd << (HasFlag("DEBUG") ? " -g" : " -g:none"); - if(!HasFlag("DEBUG")) + if(!HasFlag("DEBUG")) { if(!IsNull(release_options)) linkcmd << ' ' << release_options; else linkcmd << " -O"; + } linkcmd << " -deprecation" << linkoptions << " -sourcepath "; bool win32 = HasFlag("WIN32"); for(i = 0; i < linkfile.GetCount(); i++) { diff --git a/uppsrc/ide/LayDes/item.cpp b/uppsrc/ide/LayDes/item.cpp index b29db8d55..ece131d15 100644 --- a/uppsrc/ide/LayDes/item.cpp +++ b/uppsrc/ide/LayDes/item.cpp @@ -146,7 +146,7 @@ void LayoutItem::ReadProperties(CParser& p, bool addunknown) else { String name = p.ReadId(); int q = FindProperty(name); - if(q < 0) + if(q < 0) { if(addunknown) { q = property.GetCount(); ItemProperty& new_prop = property.Add(new RawProperty); @@ -158,6 +158,7 @@ void LayoutItem::ReadProperties(CParser& p, bool addunknown) ReadPropertyParam(p); p.PassChar(')'); } + } if(q >= 0) { ItemProperty& ip = property[q]; ip.SetCharset(charset); diff --git a/uppsrc/ide/SelectPkg.cpp b/uppsrc/ide/SelectPkg.cpp index 44aa210b1..10983052a 100644 --- a/uppsrc/ide/SelectPkg.cpp +++ b/uppsrc/ide/SelectPkg.cpp @@ -509,11 +509,12 @@ void SelectPackageDlg::SyncBase(String initvars) Sort(varlist, &PackageLess); base.Clear(); Append(base, varlist); - if(!base.FindSetCursor(initvars)) + if(!base.FindSetCursor(initvars)) { if(base.GetCount() > 0) base.SetCursor(0); else OnBase(); + } } bool SelectPackageDlg::Pless(const SelectPackageDlg::PkInfo& a, const SelectPackageDlg::PkInfo& b) diff --git a/uppsrc/ide/UppWspc.cpp b/uppsrc/ide/UppWspc.cpp index 5c6715856..44c71eb68 100644 --- a/uppsrc/ide/UppWspc.cpp +++ b/uppsrc/ide/UppWspc.cpp @@ -255,11 +255,12 @@ void WorkspaceWork::LoadActualPackage() } } Image m = IdeFileImage(f, f.optimize_speed); - if(GetFileExt(p) == ".tpp" && IsFolder(p)) + if(GetFileExt(p) == ".tpp" && IsFolder(p)) { if(FileExists(AppendFileName(p, "all.i"))) m = TopicImg::IGroup(); else m = TopicImg::Group(); + } #ifdef PLATFORM_WIN32 p = ToLower(p); #endif diff --git a/uppsrc/ide/ide.cpp b/uppsrc/ide/ide.cpp index 734fa9fa0..f79637f43 100644 --- a/uppsrc/ide/ide.cpp +++ b/uppsrc/ide/ide.cpp @@ -738,12 +738,13 @@ void Ide::SetIcon() return; } else - if((GetTimeClick() / 800) & 1) + if((GetTimeClick() / 800) & 1) { if(debugger) new_state_icon = 2; else if(idestate == BUILDING) new_state_icon = 3; + } if(state_icon == new_state_icon) return; state_icon = new_state_icon; diff --git a/uppsrc/ide/ide.upp b/uppsrc/ide/ide.upp index 6e2014902..dd411ecdc 100644 --- a/uppsrc/ide/ide.upp +++ b/uppsrc/ide/ide.upp @@ -98,7 +98,7 @@ mainconfig "" = "GUI CHECKCLIPBOARD", "" = "GUI SVO_VALUE", "" = "GUI GTK", - "" = "GUI X11", + "" = "GUI MT X11", "" = "GUI MT NOGTK", "" = "GUI NOGTK"; diff --git a/uppsrc/ide/idebar.cpp b/uppsrc/ide/idebar.cpp index 6ec8614b6..f1bda749c 100644 --- a/uppsrc/ide/idebar.cpp +++ b/uppsrc/ide/idebar.cpp @@ -252,11 +252,12 @@ void Ide::MacroMenu(Bar& menu) VectorMap< String, Vector > submenu_map; for(int i = 0; i < mlist.GetCount(); i++) { const IdeMacro& m = mlist[i]; - if(!IsNull(m.menu)) + if(!IsNull(m.menu)) { if(IsNull(m.submenu)) submenu_map.GetAdd(Null).Add(i); else submenu_map.GetAdd(m.menu).Add(i); + } } if(!submenu_map.IsEmpty()) { Vector order = GetSortOrder(submenu_map.GetKeys()); @@ -331,13 +332,14 @@ void Ide::Setup(Bar& menu) { menu.Add("Source managment..", THISBACK(AutoSetup)) .Help("Source code updater settings.."); menu.Separator(); - if(UpdaterCfg().method%2==0) //local copy or svn + if(UpdaterCfg().method%2==0) { //local copy or svn if(UpdaterCfg().available) menu.Add("Install updates..", IdeImg::install_updates(), THISBACK(CheckUpdatesManual)) .Help("Install newer version of source codes.."); else menu.Add("Check for updates..", IdeImg::check_updates(), THISBACK(CheckUpdatesManual)) .Help("Check for availability of newer source codes.."); + } #endif } @@ -378,11 +380,12 @@ void Ide::Project(Bar& menu) { if(OldLang()) menu.Add("Convert s_ -> t_", THISBACK(ConvertST)); FilePropertiesMenu(menu); - if(SvnDirs(true).GetCount()) + if(SvnDirs(true).GetCount()) { if(menu.IsMenuBar()) menu.Add("SVN", THISBACK(ProjectSvn)); else menu.Add("SVN Synchronize everything..", IdeImg::svn(), THISBACK(SyncSvn)); + } } void Ide::FilePropertiesMenu(Bar& menu) diff --git a/uppsrc/ide/t.cpp b/uppsrc/ide/t.cpp index 249d94e50..5e3ed1fe5 100644 --- a/uppsrc/ide/t.cpp +++ b/uppsrc/ide/t.cpp @@ -85,11 +85,12 @@ bool LngParseTFile(const String& fn, VectorMap& lng) CParser p(data, fn); try { if(p.Char('#')) - while(!p.IsEof()) + while(!p.IsEof()) { if(p.IsChar2('T', '_')) break; else p.SkipTerm(); + } String id; while(!p.IsEof()) { if(p.Id("T_")) { diff --git a/uppsrc/plugin/astyle/ASBeautifier.cpp b/uppsrc/plugin/astyle/ASBeautifier.cpp index 9f0f5e4b3..b8a6c1d72 100644 --- a/uppsrc/plugin/astyle/ASBeautifier.cpp +++ b/uppsrc/plugin/astyle/ASBeautifier.cpp @@ -991,7 +991,7 @@ WString ASBeautifier::beautify(const WString &originalLine) } // handle quotes (such as 'x' and "Hello Dolly") - if (!(isInComment || isInLineComment) && (ch == '"' || ch == '\'')) + if (!(isInComment || isInLineComment) && (ch == '"' || ch == '\'')) { if (!isInQuote) { quoteChar = ch; @@ -1003,6 +1003,7 @@ WString ASBeautifier::beautify(const WString &originalLine) isInStatement = true; continue; } + } if (isInQuote) continue; @@ -1621,11 +1622,12 @@ WString ASBeautifier::beautify(const WString &originalLine) // that both an assignment op and a non-assignment op where found, // e.g. '>>' and '>>='. If this is the case, treat the LONGER one as the // found operator. - if (foundAssignmentOp != NULL && foundNonAssignmentOp != NULL) + if (foundAssignmentOp != NULL && foundNonAssignmentOp != NULL) { if (foundAssignmentOp->GetCount() < foundNonAssignmentOp->GetCount()) foundAssignmentOp = NULL; else foundNonAssignmentOp = NULL; + } if (foundNonAssignmentOp != NULL) { diff --git a/uppsrc/plugin/astyle/ASEnhancer.cpp b/uppsrc/plugin/astyle/ASEnhancer.cpp index 44bb82fd3..a32dbfe96 100644 --- a/uppsrc/plugin/astyle/ASEnhancer.cpp +++ b/uppsrc/plugin/astyle/ASEnhancer.cpp @@ -217,7 +217,7 @@ void ASEnhancer::enhance(WString &line) } // handle quotes (such as 'x' and "Hello Dolly") - if (!(isInComment) && (ch == '"' || ch == '\'')) + if (!(isInComment) && (ch == '"' || ch == '\'')) { if (!isInQuote) { quoteChar = ch; @@ -228,6 +228,7 @@ void ASEnhancer::enhance(WString &line) isInQuote = false; continue; } + } if (isInQuote) continue; @@ -335,11 +336,12 @@ void ASEnhancer::enhance(WString &line) } for (; i < lineLength; i++) // bypass colon { - if (line[i] == ':') + if (line[i] == ':') { if ((i + 1 < lineLength) && (line[i + 1] == ':')) i++; // bypass scope resolution operator else break; + } } i++; for (; i < lineLength; i++) // bypass whitespace diff --git a/uppsrc/usvn/SvnSync.cpp b/uppsrc/usvn/SvnSync.cpp index 81f32bc3f..5354226b5 100644 --- a/uppsrc/usvn/SvnSync.cpp +++ b/uppsrc/usvn/SvnSync.cpp @@ -237,11 +237,12 @@ void MoveSvn(const String& path, const String& tp) String nm = ff.GetName(); String s = AppendFileName(path, nm); String t = AppendFileName(tp, nm); - if(ff.IsFolder()) + if(ff.IsFolder()) { if(nm == ".svn") FileMove(s, t); else MoveSvn(s, t); + } ff.Next(); } }