Gentoo Archives: gentoo-commits

From: Mart Raudsepp <leio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/codeblocks/files/, dev-util/codeblocks/
Date: Sat, 14 Jul 2018 19:33:31
Message-Id: 1531596732.27c7e3e956953056c4da2cac4521c40062687445.leio@gentoo
1 commit: 27c7e3e956953056c4da2cac4521c40062687445
2 Author: band-a-prend <torokhov-s-a <AT> yandex <DOT> ru>
3 AuthorDate: Sat May 26 21:08:45 2018 +0000
4 Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 14 19:32:12 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27c7e3e9
7
8 dev-util/codeblocks: unbundle dev-util/astyle lib
9
10 Unbundle the dev-util/astyle library in favor of system installed
11 by adding it as build dependency ( >=dev-util/astyle-3.0.1-r1:0= ):
12
13 1. patching (update) the Codeblocks Astyle plugin to be compatible with dev-util/astyle-3.1:
14 "codeblocks-17.12_update_astyle_plugin_to_v3.1.patch" that is taken from upstream:
15
16 https://sourceforge.net/p/codeblocks/code/11266/
17
18 * updated astyle plugin to v3.1
19 * removed obsolete astyle options
20 * added new astyle options
21 Authored by: jenslody 2018-01-15
22
23 (using conditional patching depends on if '>=dev-util/astyle-3.1' is installed in system);
24
25 2. use sub-sloting of dev-util/astyle to force rebuild Codeblocks on system update
26 if sub-slot of dev-util/astyle is changed;
27
28 3. remove KEYWORD "arm" to avoid repoman QA warning about "dependency.bad" and
29 "dependency.badindev" due to dev-util/astyle dependency doesn't have this KEYWORD.
30
31 Closes: https://bugs.gentoo.org/383037
32 Closes: https://bugs.gentoo.org/656758
33
34 dev-util/codeblocks/codeblocks-17.12-r1.ebuild | 8 +-
35 dev-util/codeblocks/codeblocks-17.12-r301.ebuild | 8 +-
36 ...blocks-17.12_update_astyle_plugin_to_v3.1.patch | 414 +++++++++++++++++++++
37 3 files changed, 426 insertions(+), 4 deletions(-)
38
39 diff --git a/dev-util/codeblocks/codeblocks-17.12-r1.ebuild b/dev-util/codeblocks/codeblocks-17.12-r1.ebuild
40 index daeb448b5c2..0c02036d954 100644
41 --- a/dev-util/codeblocks/codeblocks-17.12-r1.ebuild
42 +++ b/dev-util/codeblocks/codeblocks-17.12-r1.ebuild
43 @@ -11,7 +11,7 @@ DESCRIPTION="The open source, cross platform, free C, C++ and Fortran IDE"
44 HOMEPAGE="http://www.codeblocks.org/"
45 LICENSE="GPL-3"
46 SLOT="0"
47 -KEYWORDS="~amd64 ~arm ~ppc ~x86 ~x86-fbsd"
48 +KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
49 SRC_URI="mirror://sourceforge/${PN}/${P/-/_}.tar.xz https://dev.gentoo.org/~leio/distfiles/${P}-fortran.tar.xz"
50
51 # USE="fortran" enables FortranProject plugin (v1.5)
52 @@ -31,15 +31,19 @@ RDEPEND="app-arch/zip
53
54 DEPEND="${RDEPEND}
55 >=dev-libs/tinyxml-2.6.2-r3
56 + >=dev-util/astyle-3.0.1-r1:0=
57 virtual/pkgconfig"
58
59 PATCHES=(
60 "${FILESDIR}"/codeblocks-17.12-nodebug.diff
61 "${WORKDIR}"/patches/
62 -)
63 + )
64
65 src_prepare() {
66 default
67 + if has_version ">=dev-util/astyle-3.1" ; then
68 + epatch "${FILESDIR}"/codeblocks-17.12_update_astyle_plugin_to_v3.1.patch
69 + fi
70 eautoreconf
71 }
72
73
74 diff --git a/dev-util/codeblocks/codeblocks-17.12-r301.ebuild b/dev-util/codeblocks/codeblocks-17.12-r301.ebuild
75 index 164c9d11fd4..82d63b0809f 100644
76 --- a/dev-util/codeblocks/codeblocks-17.12-r301.ebuild
77 +++ b/dev-util/codeblocks/codeblocks-17.12-r301.ebuild
78 @@ -11,7 +11,7 @@ DESCRIPTION="The open source, cross platform, free C, C++ and Fortran IDE"
79 HOMEPAGE="http://www.codeblocks.org/"
80 LICENSE="GPL-3"
81 SLOT="0"
82 -KEYWORDS="~amd64 ~arm ~ppc ~x86 ~x86-fbsd"
83 +KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
84 SRC_URI="mirror://sourceforge/${PN}/${P/-/_}.tar.xz https://dev.gentoo.org/~leio/distfiles/${P}-fortran.tar.xz"
85
86 # USE="fortran" enables FortranProject plugin (v1.5)
87 @@ -31,15 +31,19 @@ RDEPEND="app-arch/zip
88
89 DEPEND="${RDEPEND}
90 >=dev-libs/tinyxml-2.6.2-r3
91 + >=dev-util/astyle-3.0.1-r1:0=
92 virtual/pkgconfig"
93
94 PATCHES=(
95 "${FILESDIR}"/codeblocks-17.12-nodebug.diff
96 "${WORKDIR}"/patches/
97 -)
98 + )
99
100 src_prepare() {
101 default
102 + if has_version ">=dev-util/astyle-3.1" ; then
103 + epatch "${FILESDIR}"/codeblocks-17.12_update_astyle_plugin_to_v3.1.patch
104 + fi
105 eautoreconf
106 }
107
108
109 diff --git a/dev-util/codeblocks/files/codeblocks-17.12_update_astyle_plugin_to_v3.1.patch b/dev-util/codeblocks/files/codeblocks-17.12_update_astyle_plugin_to_v3.1.patch
110 new file mode 100644
111 index 00000000000..c70cf083a44
112 --- /dev/null
113 +++ b/dev-util/codeblocks/files/codeblocks-17.12_update_astyle_plugin_to_v3.1.patch
114 @@ -0,0 +1,414 @@
115 +# Patch from: https://sourceforge.net/p/codeblocks/code/11266/
116 +# * updated astyle plugin to v3.1
117 +# * removed obsolete astyle options
118 +# * added new astyle options
119 +# Authored by: jenslody 2018-01-15
120 +diff -Naur codeblocks-17.12/src/plugins/astyle/asstreamiterator.cpp codeblocks-code-11266-trunk/src/plugins/astyle/asstreamiterator.cpp
121 +--- codeblocks-17.12/src/plugins/astyle/asstreamiterator.cpp 2017-11-01 02:32:42.000000000 +0300
122 ++++ codeblocks-code-11266-trunk/src/plugins/astyle/asstreamiterator.cpp 2018-01-15 20:54:23.000000000 +0300
123 +@@ -2,9 +2,9 @@
124 + * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
125 + * http://www.gnu.org/licenses/gpl-3.0.html
126 + *
127 +- * $Revision: 9995 $
128 +- * $Id: asstreamiterator.cpp 9995 2014-10-16 09:01:46Z mortenmacfly $
129 +- * $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-17.xx/src/plugins/astyle/asstreamiterator.cpp $
130 ++ * $Revision: 11266 $
131 ++ * $Id: asstreamiterator.cpp 11266 2018-01-15 17:54:23Z jenslody $
132 ++ * $HeadURL: file:///svn/p/codeblocks/code/trunk/src/plugins/astyle/asstreamiterator.cpp $
133 + */
134 +
135 + #include "asstreamiterator.h"
136 +@@ -53,8 +53,10 @@
137 +
138 + std::string ASStreamIterator::peekNextLine()
139 + {
140 +- if (!m_SavedCharPtr)
141 ++ if (!m_SavedCharPtr){
142 + m_SavedCharPtr = m_CharPtr;
143 ++ m_SavedCurChar = m_CurChar;
144 ++ }
145 +
146 + return readLine();
147 + }
148 +@@ -62,6 +64,7 @@
149 + void ASStreamIterator::peekReset()
150 + {
151 + m_CharPtr = m_SavedCharPtr;
152 ++ m_CurChar = m_SavedCurChar;
153 + m_SavedCharPtr = 0;
154 + }
155 +
156 +diff -Naur codeblocks-17.12/src/plugins/astyle/asstreamiterator.h codeblocks-code-11266-trunk/src/plugins/astyle/asstreamiterator.h
157 +--- codeblocks-17.12/src/plugins/astyle/asstreamiterator.h 2017-11-01 02:32:42.000000000 +0300
158 ++++ codeblocks-code-11266-trunk/src/plugins/astyle/asstreamiterator.h 2018-01-15 20:54:23.000000000 +0300
159 +@@ -22,6 +22,7 @@
160 +
161 + bool hasMoreLines() const;
162 + int getStreamLength() const;
163 ++ std::streamoff getPeekStart() const { return 0; }
164 + std::string nextLine(bool emptyLineWasDeleted = false);
165 + std::string peekNextLine();
166 + void peekReset();
167 +@@ -39,6 +40,7 @@
168 + const wxChar* m_CharPtr;
169 + const wxChar* m_SavedCharPtr;
170 + int m_CurChar;
171 ++ int m_SavedCurChar;
172 + int m_CurLine;
173 + bool m_FoundBookmark;
174 + bool m_FoundBreakpoint;
175 +diff -Naur codeblocks-17.12/src/plugins/astyle/astyleconfigdlg.cpp codeblocks-code-11266-trunk/src/plugins/astyle/astyleconfigdlg.cpp
176 +--- codeblocks-17.12/src/plugins/astyle/astyleconfigdlg.cpp 2017-11-01 02:32:42.000000000 +0300
177 ++++ codeblocks-code-11266-trunk/src/plugins/astyle/astyleconfigdlg.cpp 2018-01-15 20:54:23.000000000 +0300
178 +@@ -2,9 +2,9 @@
179 + * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
180 + * http://www.gnu.org/licenses/gpl-3.0.html
181 + *
182 +- * $Revision: 10955 $
183 +- * $Id: astyleconfigdlg.cpp 10955 2016-12-29 08:55:24Z mortenmacfly $
184 +- * $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-17.xx/src/plugins/astyle/astyleconfigdlg.cpp $
185 ++ * $Revision: 11266 $
186 ++ * $Id: astyleconfigdlg.cpp 11266 2018-01-15 17:54:23Z jenslody $
187 ++ * $HeadURL: file:///svn/p/codeblocks/code/trunk/src/plugins/astyle/astyleconfigdlg.cpp $
188 + */
189 +
190 + #include <sdk.h>
191 +@@ -34,7 +34,7 @@
192 + EVT_RADIOBUTTON(XRCID("rbStroustrup"), AstyleConfigDlg::OnStyleChange)
193 + EVT_RADIOBUTTON(XRCID("rbWhitesmith"), AstyleConfigDlg::OnStyleChange)
194 + EVT_RADIOBUTTON(XRCID("rbVTK"), AstyleConfigDlg::OnStyleChange)
195 +- EVT_RADIOBUTTON(XRCID("rbBanner"), AstyleConfigDlg::OnStyleChange)
196 ++ EVT_RADIOBUTTON(XRCID("rbRatliff"), AstyleConfigDlg::OnStyleChange)
197 + EVT_RADIOBUTTON(XRCID("rbGNU"), AstyleConfigDlg::OnStyleChange)
198 + EVT_RADIOBUTTON(XRCID("rbLinux"), AstyleConfigDlg::OnStyleChange)
199 + EVT_RADIOBUTTON(XRCID("rbHorstmann"), AstyleConfigDlg::OnStyleChange)
200 +@@ -158,7 +158,7 @@
201 + XRCCTRL(*this, "rbVTK", wxRadioButton)->SetValue(true);
202 + break;
203 + #undef AS_VTK
204 +-#define AS_BANNER "\
205 ++#define AS_RATLIFF "\
206 + int Foo(bool isBar) {\n\
207 + if (isBar) {\n\
208 + bar();\n\
209 +@@ -167,11 +167,11 @@
210 + else\n\
211 + return 0;\n\
212 + }"
213 +- case aspsBanner:
214 +- sample = _T(AS_BANNER);
215 +- XRCCTRL(*this, "rbBanner", wxRadioButton)->SetValue(true);
216 ++ case aspsRatliff:
217 ++ sample = _T(AS_RATLIFF);
218 ++ XRCCTRL(*this, "rbRatliff", wxRadioButton)->SetValue(true);
219 + break;
220 +-#undef AS_BANNER
221 ++#undef AS_RATLIFF
222 + #define AS_GNU "\
223 + int Foo(bool isBar)\n\
224 + {\n\
225 +@@ -307,8 +307,8 @@
226 + SetStyle(aspsWhitesmith);
227 + else if (event.GetId() == XRCID("rbVTK"))
228 + SetStyle(aspsVTK);
229 +- else if (event.GetId() == XRCID("rbBanner"))
230 +- SetStyle(aspsBanner);
231 ++ else if (event.GetId() == XRCID("rbRatliff"))
232 ++ SetStyle(aspsRatliff);
233 + else if (event.GetId() == XRCID("rbGNU"))
234 + SetStyle(aspsGnu);
235 + else if (event.GetId() == XRCID("rbLinux"))
236 +@@ -376,6 +376,7 @@
237 + XRCCTRL(*this, "chkAttachExternC", wxCheckBox)->SetValue(cfg->ReadBool(_T("/attach_extern_c"), false));
238 + XRCCTRL(*this, "chkAttachNamespaces", wxCheckBox)->SetValue(cfg->ReadBool(_T("/attach_namespaces"), false));
239 + XRCCTRL(*this, "chkAttachInlines", wxCheckBox)->SetValue(cfg->ReadBool(_T("/attach_inlines"), false));
240 ++ XRCCTRL(*this, "chkAttachClosingWhiles", wxCheckBox)->SetValue(cfg->ReadBool(_T("/attach_closing_whiles"), false));
241 +
242 + XRCCTRL(*this, "spnIndentation", wxSpinCtrl)->SetValue(cfg->ReadInt(_T("/indentation"), 4));
243 + XRCCTRL(*this, "spnContinuation", wxSpinCtrl)->SetValue(cfg->ReadInt(_T("/continuation"), 0));
244 +@@ -386,6 +387,7 @@
245 + XRCCTRL(*this, "chkIndentLabels", wxCheckBox)->SetValue(cfg->ReadBool(_T("/indent_labels"), false));
246 + XRCCTRL(*this, "chkIndentModifiers", wxCheckBox)->SetValue(cfg->ReadBool(_T("/indent_modifiers"), false));
247 + XRCCTRL(*this, "chkIndentNamespaces", wxCheckBox)->SetValue(cfg->ReadBool(_T("/indent_namespaces"), false));
248 ++ XRCCTRL(*this, "chkIndentAfterParens", wxCheckBox)->SetValue(cfg->ReadBool(_T("/indent_after_parens"), false));
249 + XRCCTRL(*this, "chkIndentSwitches", wxCheckBox)->SetValue(cfg->ReadBool(_T("/indent_switches"), false));
250 + XRCCTRL(*this, "chkIndentPreprocBlock", wxCheckBox)->SetValue(cfg->ReadBool(_T("/indent_preproc_block"), false));
251 + XRCCTRL(*this, "chkIndentPreprocDefine", wxCheckBox)->SetValue(cfg->ReadBool(_T("/indent_preproc_define"), false));
252 +@@ -399,6 +401,10 @@
253 + XRCCTRL(*this, "chkAddBrackets", wxCheckBox)->SetValue(cfg->ReadBool(_T("/add_brackets"), false));
254 + XRCCTRL(*this, "chkAddOneLineBrackets", wxCheckBox)->SetValue(cfg->ReadBool(_T("/add_one_line_brackets"), false));
255 + XRCCTRL(*this, "chkRemoveBrackets", wxCheckBox)->SetValue(cfg->ReadBool(_T("/remove_brackets"), false));
256 ++ XRCCTRL(*this, "chkBreakReturnType", wxCheckBox)->SetValue(cfg->ReadBool(_T("/break_return_type"), false));
257 ++ XRCCTRL(*this, "chkBreakReturnTypeDecl", wxCheckBox)->SetValue(cfg->ReadBool(_T("/break_return_type_decl"),false));
258 ++ XRCCTRL(*this, "chkAttachReturnType", wxCheckBox)->SetValue(cfg->ReadBool(_T("/attach_return_type"), false));
259 ++ XRCCTRL(*this, "chkAttachReturnTypeDecl",wxCheckBox)->SetValue(cfg->ReadBool(_T("/attach_return_type_decl"),false));
260 + XRCCTRL(*this, "chkKeepBlocks", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_blocks"), false));
261 + XRCCTRL(*this, "chkKeepHeaders", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_headers"), false));
262 + XRCCTRL(*this, "chkKeepStatements", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_statements"), false));
263 +@@ -455,8 +461,8 @@
264 + style = aspsWhitesmith;
265 + else if (XRCCTRL(*this, "rbVTK", wxRadioButton)->GetValue())
266 + style = aspsVTK;
267 +- else if (XRCCTRL(*this, "rbBanner", wxRadioButton)->GetValue())
268 +- style = aspsBanner;
269 ++ else if (XRCCTRL(*this, "rbRatliff", wxRadioButton)->GetValue())
270 ++ style = aspsRatliff;
271 + else if (XRCCTRL(*this, "rbGNU", wxRadioButton)->GetValue())
272 + style = aspsGnu;
273 + else if (XRCCTRL(*this, "rbLinux", wxRadioButton)->GetValue())
274 +@@ -480,6 +486,7 @@
275 + cfg->Write(_T("/attach_extern_c"), XRCCTRL(*this, "chkAttachExternC", wxCheckBox)->GetValue());
276 + cfg->Write(_T("/attach_namespaces"), XRCCTRL(*this, "chkAttachNamespaces", wxCheckBox)->GetValue());
277 + cfg->Write(_T("/attach_inlines"), XRCCTRL(*this, "chkAttachInlines", wxCheckBox)->GetValue());
278 ++ cfg->Write(_T("/attach_closing_whiles"), XRCCTRL(*this, "chkAttachClosingWhiles", wxCheckBox)->GetValue());
279 +
280 + cfg->Write(_T("/indentation"), XRCCTRL(*this, "spnIndentation", wxSpinCtrl)->GetValue());
281 + cfg->Write(_T("/continuation"), XRCCTRL(*this, "spnContinuation", wxSpinCtrl)->GetValue());
282 +@@ -490,6 +497,7 @@
283 + cfg->Write(_T("/indent_labels"), XRCCTRL(*this, "chkIndentLabels", wxCheckBox)->GetValue());
284 + cfg->Write(_T("/indent_modifiers"), XRCCTRL(*this, "chkIndentModifiers", wxCheckBox)->GetValue());
285 + cfg->Write(_T("/indent_namespaces"), XRCCTRL(*this, "chkIndentNamespaces", wxCheckBox)->GetValue());
286 ++ cfg->Write(_T("/indent_after_parens"), XRCCTRL(*this, "chkIndentAfterParens", wxCheckBox)->GetValue());
287 + cfg->Write(_T("/indent_switches"), XRCCTRL(*this, "chkIndentSwitches", wxCheckBox)->GetValue());
288 + cfg->Write(_T("/indent_preproc_block"), XRCCTRL(*this, "chkIndentPreprocBlock", wxCheckBox)->GetValue());
289 + cfg->Write(_T("/indent_preproc_define"), XRCCTRL(*this, "chkIndentPreprocDefine", wxCheckBox)->GetValue());
290 +@@ -503,6 +511,10 @@
291 + cfg->Write(_T("/add_brackets"), XRCCTRL(*this, "chkAddBrackets", wxCheckBox)->GetValue());
292 + cfg->Write(_T("/add_one_line_brackets"), XRCCTRL(*this, "chkAddOneLineBrackets", wxCheckBox)->GetValue());
293 + cfg->Write(_T("/remove_brackets"), XRCCTRL(*this, "chkRemoveBrackets", wxCheckBox)->GetValue());
294 ++ cfg->Write(_T("/break_return_type_decl"), XRCCTRL(*this, "chkBreakReturnTypeDecl", wxCheckBox)->GetValue());
295 ++ cfg->Write(_T("/break_return_type"), XRCCTRL(*this, "chkBreakReturnType", wxCheckBox)->GetValue());
296 ++ cfg->Write(_T("/attach_return_type"), XRCCTRL(*this, "chkAttachReturnType", wxCheckBox)->GetValue());
297 ++ cfg->Write(_T("/attach_return_type_decl"), XRCCTRL(*this, "chkAttachReturnTypeDecl",wxCheckBox)->GetValue());
298 + cfg->Write(_T("/keep_blocks"), XRCCTRL(*this, "chkKeepBlocks", wxCheckBox)->GetValue());
299 + cfg->Write(_T("/keep_headers"), XRCCTRL(*this, "chkKeepHeaders", wxCheckBox)->GetValue());
300 + cfg->Write(_T("/keep_statements"), XRCCTRL(*this, "chkKeepStatements", wxCheckBox)->GetValue());
301 +diff -Naur codeblocks-17.12/src/plugins/astyle/astyleplugin.cpp codeblocks-code-11266-trunk/src/plugins/astyle/astyleplugin.cpp
302 +--- codeblocks-17.12/src/plugins/astyle/astyleplugin.cpp 2017-11-01 02:32:42.000000000 +0300
303 ++++ codeblocks-code-11266-trunk/src/plugins/astyle/astyleplugin.cpp 2017-10-09 00:31:56.000000000 +0300
304 +@@ -4,7 +4,7 @@
305 + *
306 + * $Revision: 11193 $
307 + * $Id: astyleplugin.cpp 11193 2017-10-08 21:31:56Z fuscated $
308 +- * $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-17.xx/src/plugins/astyle/astyleplugin.cpp $
309 ++ * $HeadURL: file:///svn/p/codeblocks/code/trunk/src/plugins/astyle/astyleplugin.cpp $
310 + */
311 +
312 + #include <sdk.h>
313 +diff -Naur codeblocks-17.12/src/plugins/astyle/astylepredefinedstyles.h codeblocks-code-11266-trunk/src/plugins/astyle/astylepredefinedstyles.h
314 +--- codeblocks-17.12/src/plugins/astyle/astylepredefinedstyles.h 2017-11-01 02:32:42.000000000 +0300
315 ++++ codeblocks-code-11266-trunk/src/plugins/astyle/astylepredefinedstyles.h 2018-01-15 20:54:23.000000000 +0300
316 +@@ -14,7 +14,7 @@
317 + aspsStroustrup,
318 + aspsWhitesmith,
319 + aspsVTK,
320 +- aspsBanner,
321 ++ aspsRatliff,
322 + aspsGnu,
323 + aspsLinux,
324 + aspsHorstmann,
325 +diff -Naur codeblocks-17.12/src/plugins/astyle/dlgformattersettings.cpp codeblocks-code-11266-trunk/src/plugins/astyle/dlgformattersettings.cpp
326 +--- codeblocks-17.12/src/plugins/astyle/dlgformattersettings.cpp 2017-11-01 02:32:42.000000000 +0300
327 ++++ codeblocks-code-11266-trunk/src/plugins/astyle/dlgformattersettings.cpp 2018-01-15 20:54:23.000000000 +0300
328 +@@ -2,9 +2,9 @@
329 + * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
330 + * http://www.gnu.org/licenses/gpl-3.0.html
331 + *
332 +- * $Revision: 10950 $
333 +- * $Id: dlgformattersettings.cpp 10950 2016-12-29 06:16:39Z mortenmacfly $
334 +- * $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-17.xx/src/plugins/astyle/dlgformattersettings.cpp $
335 ++ * $Revision: 11266 $
336 ++ * $Id: dlgformattersettings.cpp 11266 2018-01-15 17:54:23Z jenslody $
337 ++ * $HeadURL: file:///svn/p/codeblocks/code/trunk/src/plugins/astyle/dlgformattersettings.cpp $
338 + */
339 +
340 + #include "dlgformattersettings.h"
341 +@@ -39,8 +39,8 @@
342 + formatter.setFormattingStyle(astyle::STYLE_WHITESMITH);
343 + else if (XRCCTRL(*m_dlg, "rbVTK", wxRadioButton)->GetValue())
344 + formatter.setFormattingStyle(astyle::STYLE_VTK);
345 +- else if (XRCCTRL(*m_dlg, "rbBanner", wxRadioButton)->GetValue())
346 +- formatter.setFormattingStyle(astyle::STYLE_BANNER);
347 ++ else if (XRCCTRL(*m_dlg, "rbRatliff", wxRadioButton)->GetValue())
348 ++ formatter.setFormattingStyle(astyle::STYLE_RATLIFF);
349 + else if (XRCCTRL(*m_dlg, "rbGNU", wxRadioButton)->GetValue())
350 + formatter.setFormattingStyle(astyle::STYLE_GNU);
351 + else if (XRCCTRL(*m_dlg, "rbLinux", wxRadioButton)->GetValue())
352 +@@ -58,10 +58,11 @@
353 + else if (XRCCTRL(*m_dlg, "rbLisp", wxRadioButton)->GetValue())
354 + formatter.setFormattingStyle(astyle::STYLE_LISP);
355 +
356 +- formatter.setAttachClass(XRCCTRL(*m_dlg, "chkAttachClasses", wxCheckBox)->GetValue());
357 +- formatter.setAttachExternC(XRCCTRL(*m_dlg, "chkAttachExternC", wxCheckBox)->GetValue());
358 +- formatter.setAttachNamespace(XRCCTRL(*m_dlg, "chkAttachNamespaces", wxCheckBox)->GetValue());
359 +- formatter.setAttachInline(XRCCTRL(*m_dlg, "chkAttachInlines", wxCheckBox)->GetValue());
360 ++ formatter.setAttachClass(XRCCTRL(*m_dlg, "chkAttachClasses", wxCheckBox)->GetValue());
361 ++ formatter.setAttachExternC(XRCCTRL(*m_dlg, "chkAttachExternC", wxCheckBox)->GetValue());
362 ++ formatter.setAttachNamespace(XRCCTRL(*m_dlg, "chkAttachNamespaces", wxCheckBox)->GetValue());
363 ++ formatter.setAttachInline(XRCCTRL(*m_dlg, "chkAttachInlines", wxCheckBox)->GetValue());
364 ++ formatter.setAttachClosingWhile(XRCCTRL(*m_dlg, "chkAttachClosingWhiles", wxCheckBox)->GetValue());
365 +
366 + bool value = XRCCTRL(*m_dlg, "chkForceUseTabs", wxCheckBox)->GetValue();
367 + int spaceNum = XRCCTRL(*m_dlg, "spnIndentation", wxSpinCtrl)->GetValue();
368 +@@ -79,6 +80,7 @@
369 + formatter.setLabelIndent(XRCCTRL(*m_dlg, "chkIndentLabels", wxCheckBox)->GetValue());
370 + formatter.setModifierIndent(XRCCTRL(*m_dlg, "chkIndentModifiers", wxCheckBox)->GetValue());
371 + formatter.setNamespaceIndent(XRCCTRL(*m_dlg, "chkIndentNamespaces", wxCheckBox)->GetValue());
372 ++ formatter.setAfterParenIndent(XRCCTRL(*m_dlg, "chkIndentAfterParens", wxCheckBox)->GetValue());
373 + formatter.setSwitchIndent(XRCCTRL(*m_dlg, "chkIndentSwitches", wxCheckBox)->GetValue());
374 + formatter.setPreprocBlockIndent(XRCCTRL(*m_dlg, "chkIndentPreprocBlock", wxCheckBox)->GetValue());
375 + formatter.setPreprocDefineIndent(XRCCTRL(*m_dlg, "chkIndentPreprocDefine", wxCheckBox)->GetValue());
376 +@@ -88,11 +90,15 @@
377 + formatter.setMinConditionalIndentOption(minConditionalEvent);
378 + formatter.setMaxInStatementIndentLength( wxAtoi(XRCCTRL(*m_dlg, "txtMaxInStatementIndent", wxTextCtrl)->GetValue()) );
379 +
380 +- formatter.setBreakClosingHeaderBracketsMode(XRCCTRL(*m_dlg, "chkBreakClosing", wxCheckBox)->GetValue());
381 ++ formatter.setBreakClosingHeaderBracesMode(XRCCTRL(*m_dlg, "chkBreakClosing", wxCheckBox)->GetValue());
382 + formatter.setBreakElseIfsMode(XRCCTRL(*m_dlg, "chkBreakElseIfs", wxCheckBox)->GetValue());
383 +- formatter.setAddBracketsMode(XRCCTRL(*m_dlg, "chkAddBrackets", wxCheckBox)->GetValue());
384 +- formatter.setAddOneLineBracketsMode(XRCCTRL(*m_dlg, "chkAddOneLineBrackets", wxCheckBox)->GetValue());
385 +- formatter.setRemoveBracketsMode(XRCCTRL(*m_dlg, "chkRemoveBrackets", wxCheckBox)->GetValue());
386 ++ formatter.setAddBracesMode(XRCCTRL(*m_dlg, "chkAddBrackets", wxCheckBox)->GetValue());
387 ++ formatter.setAddOneLineBracesMode(XRCCTRL(*m_dlg, "chkAddOneLineBrackets", wxCheckBox)->GetValue());
388 ++ formatter.setRemoveBracesMode(XRCCTRL(*m_dlg, "chkRemoveBrackets", wxCheckBox)->GetValue());
389 ++ formatter.setBreakReturnType(XRCCTRL(*m_dlg, "chkBreakReturnType", wxCheckBox)->GetValue());
390 ++ formatter.setBreakReturnTypeDecl(XRCCTRL(*m_dlg, "chkBreakReturnTypeDecl", wxCheckBox)->GetValue());
391 ++ formatter.setAttachReturnType(XRCCTRL(*m_dlg, "chkAttachReturnType", wxCheckBox)->GetValue());
392 ++ formatter.setAttachReturnTypeDecl(XRCCTRL(*m_dlg, "chkAttachReturnTypeDecl", wxCheckBox)->GetValue());
393 + formatter.setBreakOneLineBlocksMode(!XRCCTRL(*m_dlg, "chkKeepBlocks", wxCheckBox)->GetValue());
394 + formatter.setBreakOneLineHeadersMode(!XRCCTRL(*m_dlg, "chkKeepHeaders", wxCheckBox)->GetValue());
395 + formatter.setBreakOneLineStatementsMode(!XRCCTRL(*m_dlg, "chkKeepStatements", wxCheckBox)->GetValue());
396 +diff -Naur codeblocks-17.12/src/plugins/astyle/formattersettings.cpp codeblocks-code-11266-trunk/src/plugins/astyle/formattersettings.cpp
397 +--- codeblocks-17.12/src/plugins/astyle/formattersettings.cpp 2017-11-01 02:32:42.000000000 +0300
398 ++++ codeblocks-code-11266-trunk/src/plugins/astyle/formattersettings.cpp 2018-01-15 20:54:23.000000000 +0300
399 +@@ -2,9 +2,9 @@
400 + * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
401 + * http://www.gnu.org/licenses/gpl-3.0.html
402 + *
403 +- * $Revision: 10950 $
404 +- * $Id: formattersettings.cpp 10950 2016-12-29 06:16:39Z mortenmacfly $
405 +- * $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-17.xx/src/plugins/astyle/formattersettings.cpp $
406 ++ * $Revision: 11266 $
407 ++ * $Id: formattersettings.cpp 11266 2018-01-15 17:54:23Z jenslody $
408 ++ * $HeadURL: file:///svn/p/codeblocks/code/trunk/src/plugins/astyle/formattersettings.cpp $
409 + */
410 +
411 + #include <sdk.h>
412 +@@ -54,8 +54,8 @@
413 + formatter.setFormattingStyle(astyle::STYLE_VTK);
414 + break;
415 +
416 +- case aspsBanner: // Banner
417 +- formatter.setFormattingStyle(astyle::STYLE_BANNER);
418 ++ case aspsRatliff: // Ratliff
419 ++ formatter.setFormattingStyle(astyle::STYLE_RATLIFF);
420 + break;
421 +
422 + case aspsGnu: // GNU
423 +@@ -123,7 +123,7 @@
424 + formatter.setMinConditionalIndentOption(cfg->ReadInt(_T("/min_conditional_indent"), 2));
425 + formatter.setMaxInStatementIndentLength(cfg->ReadInt(_T("/max_instatement_indent"), 40));
426 +
427 +- formatter.setBreakClosingHeaderBracketsMode(cfg->ReadBool(_T("/break_closing")));
428 ++ formatter.setBreakClosingHeaderBracesMode(cfg->ReadBool(_T("/break_closing")));
429 + formatter.setBreakElseIfsMode(cfg->ReadBool(_T("/break_elseifs")));
430 + formatter.setAddBracketsMode(cfg->ReadBool(_T("/add_brackets")));
431 + formatter.setAddOneLineBracketsMode(cfg->ReadBool(_T("/add_one_line_brackets")));
432 +diff -Naur codeblocks-17.12/src/plugins/astyle/resources/configuration.xrc codeblocks-code-11266-trunk/src/plugins/astyle/resources/configuration.xrc
433 +--- codeblocks-17.12/src/plugins/astyle/resources/configuration.xrc 2017-11-01 02:32:42.000000000 +0300
434 ++++ codeblocks-code-11266-trunk/src/plugins/astyle/resources/configuration.xrc 2018-01-15 20:54:23.000000000 +0300
435 +@@ -61,9 +61,9 @@
436 + <border>5</border>
437 + </object>
438 + <object class="sizeritem">
439 +- <object class="wxRadioButton" name="rbBanner">
440 +- <label>Banner</label>
441 +- <tooltip>Banner style uses attached, indented brackets. Switch blocks and class blocks are indented to prevent a &apos;hanging indent&apos; with following case statements and C++ class modifiers (public, private, protected).</tooltip>
442 ++ <object class="wxRadioButton" name="rbRatliff">
443 ++ <label>Ratliff</label>
444 ++ <tooltip>Ratliff style uses attached, indented brackets. Switch blocks and class blocks are indented to prevent a &apos;hanging indent&apos; with following case statements and C++ class modifiers (public, private, protected).</tooltip>
445 + </object>
446 + <flag>wxTOP|wxLEFT|wxRIGHT|wxALIGN_LEFT</flag>
447 + <border>5</border>
448 +@@ -212,6 +212,13 @@
449 + <flag>wxTOP|wxALIGN_LEFT</flag>
450 + <border>5</border>
451 + </object>
452 ++ <object class="sizeritem">
453 ++ <object class="wxCheckBox" name="chkAttachClosingWhiles">
454 ++ <label>Attach closing &quot;while&quot;</label>
455 ++ </object>
456 ++ <flag>wxTOP|wxALIGN_LEFT</flag>
457 ++ <border>5</border>
458 ++ </object>
459 + </object>
460 + <flag>wxEXPAND</flag>
461 + <border>5</border>
462 +@@ -320,6 +327,13 @@
463 + <border>5</border>
464 + </object>
465 + <object class="sizeritem">
466 ++ <object class="wxCheckBox" name="chkIndentAfterParens">
467 ++ <label>Indent after parens</label>
468 ++ </object>
469 ++ <flag>wxTOP|wxALIGN_LEFT</flag>
470 ++ <border>5</border>
471 ++ </object>
472 ++ <object class="sizeritem">
473 + <object class="wxCheckBox" name="chkIndentSwitches">
474 + <label>Indent switches (keyword case:)</label>
475 + </object>
476 +@@ -427,21 +441,49 @@
477 + </object>
478 + <object class="sizeritem">
479 + <object class="wxCheckBox" name="chkAddBrackets">
480 +- <label>Add brackets to unbracketed one line conditional statements</label>
481 ++ <label>Add braces to unbraced one line conditional statements</label>
482 + </object>
483 + <flag>wxTOP|wxALIGN_LEFT</flag>
484 + <border>5</border>
485 + </object>
486 + <object class="sizeritem">
487 + <object class="wxCheckBox" name="chkAddOneLineBrackets">
488 +- <label>Add one line brackets to unbracketed one line conditional statements</label>
489 ++ <label>Add one line braces to unbraced one line conditional statements</label>
490 + </object>
491 + <flag>wxTOP|wxALIGN_LEFT</flag>
492 + <border>5</border>
493 + </object>
494 + <object class="sizeritem">
495 + <object class="wxCheckBox" name="chkRemoveBrackets">
496 +- <label>Remove brackets from conditional statements (single statement on a single line)</label>
497 ++ <label>Remove braces from conditional statements (single statement on a single line)</label>
498 ++ </object>
499 ++ <flag>wxTOP|wxALIGN_LEFT</flag>
500 ++ <border>5</border>
501 ++ </object>
502 ++ <object class="sizeritem">
503 ++ <object class="wxCheckBox" name="chkBreakReturnType">
504 ++ <label>Break the return type from the function name in function definitions</label>
505 ++ </object>
506 ++ <flag>wxTOP|wxALIGN_LEFT</flag>
507 ++ <border>5</border>
508 ++ </object>
509 ++ <object class="sizeritem">
510 ++ <object class="wxCheckBox" name="chkBreakReturnTypeDecl">
511 ++ <label>Break the return type from the function name in function declarations or signatures</label>
512 ++ </object>
513 ++ <flag>wxTOP|wxALIGN_LEFT</flag>
514 ++ <border>5</border>
515 ++ </object>
516 ++ <object class="sizeritem">
517 ++ <object class="wxCheckBox" name="chkAttachReturnType">
518 ++ <label>Attach the return type to the function name in function definitions</label>
519 ++ </object>
520 ++ <flag>wxTOP|wxALIGN_LEFT</flag>
521 ++ <border>5</border>
522 ++ </object>
523 ++ <object class="sizeritem">
524 ++ <object class="wxCheckBox" name="chkAttachReturnTypeDecl">
525 ++ <label>Attach the return type to the function name in function declarations or signatures</label>
526 + </object>
527 + <flag>wxTOP|wxALIGN_LEFT</flag>
528 + <border>5</border>