From ed0c016c2eb2cb1bcd15b0ec8504cd91549ef28d Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 6 Jun 2015 11:51:09 +0000 Subject: [PATCH] Fixed DCopy of global functions namespace problem #1109 git-svn-id: svn://ultimatepp.org/upp/trunk@8514 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/ide/DCopy.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/uppsrc/ide/DCopy.cpp b/uppsrc/ide/DCopy.cpp index 67e244ea3..85245b113 100644 --- a/uppsrc/ide/DCopy.cpp +++ b/uppsrc/ide/DCopy.cpp @@ -51,9 +51,12 @@ void AssistEditor::DCopy() int best = 0; const Index& ns = CodeBase().namespaces; for(int i = 0; i < ns.GetCount(); i++) { - String h = ns[i] + "::"; - if(h.GetCount() > best && cls.StartsWith(h)) - best = h.GetCount(); + String h = ns[i]; + for(int pass = 0; pass < 2; pass++) { + if(h.GetCount() > best && cls.StartsWith(h)) + best = h.GetCount(); + h << "::"; + } } cls.Remove(0, best); CppBase cpp;