Hello, everyone! After I renewed efforts, I have solved the problem that bothers me for a long time.
I downloaded the 'AStyle official release version 1.24' from official website, and replace all astyle source to lastest version.
Then, I make these patch for add '--pad-header' features.
It's works well now. :lol:
Index: src/plugins/astyle/astyleconfigdlg.cpp
===================================================================
--- src/plugins/astyle/astyleconfigdlg.cpp (revision 6196)
+++ src/plugins/astyle/astyleconfigdlg.cpp (working copy)
@@ -224,6 +224,7 @@
XRCCTRL(*this, "chkPadOperators", wxCheckBox)->Enable(!en);
XRCCTRL(*this, "chkPadParensOut", wxCheckBox)->Enable(!en);
XRCCTRL(*this, "chkPadParensIn", wxCheckBox)->Enable(!en);
+ XRCCTRL(*this, "chkPadHeader", wxCheckBox)->Enable(!en);
XRCCTRL(*this, "chkUnpadParens", wxCheckBox)->Enable(!en);
XRCCTRL(*this, "chkKeepComplex", wxCheckBox)->Enable(!en);
XRCCTRL(*this, "chkKeepBlocks", wxCheckBox)->Enable(!en);
@@ -310,6 +311,7 @@
XRCCTRL(*this, "chkPadOperators", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_operators"), false));
XRCCTRL(*this, "chkPadParensIn", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_parentheses_in"), false));
XRCCTRL(*this, "chkPadParensOut", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_parentheses_out"), false));
+ XRCCTRL(*this, "chkPadHeader", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_header"), false));
XRCCTRL(*this, "chkUnpadParens", wxCheckBox)->SetValue(cfg->ReadBool(_T("/unpad_parentheses"), false));
XRCCTRL(*this, "chkKeepComplex", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_complex"), false));
XRCCTRL(*this, "chkKeepBlocks", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_blocks"), false));
@@ -365,6 +367,7 @@
cfg->Write(_T("/pad_operators"), XRCCTRL(*this, "chkPadOperators", wxCheckBox)->GetValue());
cfg->Write(_T("/pad_parentheses_in"), XRCCTRL(*this, "chkPadParensIn", wxCheckBox)->GetValue());
cfg->Write(_T("/pad_parentheses_out"), XRCCTRL(*this, "chkPadParensOut", wxCheckBox)->GetValue());
+ cfg->Write(_T("/pad_header"), XRCCTRL(*this, "chkPadHeader", wxCheckBox)->GetValue());
cfg->Write(_T("/unpad_parentheses"), XRCCTRL(*this, "chkUnpadParens", wxCheckBox)->GetValue());
cfg->Write(_T("/keep_complex"), XRCCTRL(*this, "chkKeepComplex", wxCheckBox)->GetValue());
cfg->Write(_T("/keep_blocks"), XRCCTRL(*this, "chkKeepBlocks", wxCheckBox)->GetValue());
Index: src/plugins/astyle/formattersettings.cpp
===================================================================
--- src/plugins/astyle/formattersettings.cpp (revision 6196)
+++ src/plugins/astyle/formattersettings.cpp (working copy)
@@ -137,6 +137,7 @@
formatter.setOperatorPaddingMode(cfg->ReadBool(_T("/pad_operators")));
formatter.setParensOutsidePaddingMode(cfg->ReadBool(_T("/pad_parentheses_out")));
formatter.setParensInsidePaddingMode(cfg->ReadBool(_T("/pad_parentheses_in")));
+ formatter.setParensHeaderPaddingMode(cfg->ReadBool(_T("/pad_header")));
formatter.setParensUnPaddingMode(cfg->ReadBool(_T("/unpad_parentheses")));
formatter.setSingleStatementsMode(!cfg->ReadBool(_T("/keep_complex")));
formatter.setBreakOneLineBlocksMode(!cfg->ReadBool(_T("/keep_blocks")));
Index: src/plugins/astyle/resources/configuration.xrc
===================================================================
--- src/plugins/astyle/resources/configuration.xrc (revision 6196)
+++ src/plugins/astyle/resources/configuration.xrc (working copy)
@@ -325,6 +325,13 @@
<border>8</border>
</object>
<object class="sizeritem">
+ <object class="wxCheckBox" name="chkPadHeader">
+ <label>Insert space padding after paren headers only</label>
+ </object>
+ <flag>wxTOP|wxALIGN_LEFT|wxALIGN_TOP</flag>
+ <border>8</border>
+ </object>
+ <object class="sizeritem">
<object class="wxCheckBox" name="chkUnpadParens">
<label>Remove extra space padding around parenthesis</label>
</object>