<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>121106</bug_id>
          
          <creation_ts>2006-01-31 19:38:54 +0000</creation_ts>
          <short_desc>[PATCH] reformat source option &quot;Pad Parentheses&quot; ignored</short_desc>
          <delta_ts>2006-06-30 17:23:35 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kdevelop</product>
          <component>Astyle</component>
          <version>3.3.0</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Luser">yahoomailguard2004-main</reporter>
          <assigned_to>kdevelop-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>410379</commentid>
    <comment_count>0</comment_count>
    <who name="Luser">yahoomailguard2004-main</who>
    <bug_when>2006-01-31 19:38:54 +0000</bug_when>
    <thetext>Version:           3.3 (using KDE 3.5.0 Level &quot;a&quot; , SUSE 10.0 UNSUPPORTED)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-15.7-smp

It seems astyle adaptor is using &quot;PadOperators&quot; option for padding both operators and parenthesis:

http://websvn.kde.org/*checkout*/trunk/KDE/kdevelop/parts/astyle/astyle_widget.cpp?content-type=text%2Fplain&amp;rev=443141
  // padding
  config-&gt;writeEntry(&quot;PadParentheses&quot;, Pad_Parentheses-&gt;isChecked());
  config-&gt;writeEntry(&quot;PadOperators&quot;, Pad_Operators-&gt;isChecked());

http://websvn.kde.org/*checkout*/trunk/KDE/kdevelop/parts/astyle/astyle_adaptor.cpp?content-type=text%2Fplain&amp;rev=443141
  // padding
  setOperatorPaddingMode(config-&gt;readBoolEntry(&quot;PadOperators&quot;, false));
  setParenthesisPaddingMode(config-&gt;readBoolEntry(&quot;PadOperators&quot;, false));</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>410382</commentid>
    <comment_count>1</comment_count>
    <who name="Amilcar do Carmo Lucas">amilcar</who>
    <bug_when>2006-01-31 19:51:04 +0000</bug_when>
    <thetext>Can someone commit it ?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>410393</commentid>
    <comment_count>2</comment_count>
    <who name="Luser">yahoomailguard2004-main</who>
    <bug_when>2006-01-31 20:23:50 +0000</bug_when>
    <thetext>The fix is obvious but just in case :)

- setParenthesisPaddingMode(config-&gt;readBoolEntry(&quot;PadOperators&quot;, false));
+ setParenthesisPaddingMode(config-&gt;readBoolEntry(&quot;PadParentheses&quot;, false));

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>450808</commentid>
    <comment_count>3</comment_count>
    <who name="">geiseri</who>
    <bug_when>2006-06-30 17:23:33 +0000</bug_when>
    <thetext>SVN commit 556535 by geiseri:

Fixed astyle adaptor is using &quot;PadOperators&quot; option for padding both 
operators and parenthesis.
Bug# 121106

Fixed keep one-line blocks option does nothing.
Bug# 105396

Fixed custom style preview.  This was closed, but it was not working 
right, the preview would always be wrong.
Bug# 70818

BUG: 121106
BUG: 105396
BUG: 78020



 M  +3 -3      astyle_adaptor.cpp  
 M  +18 -1     astyle_widget.cpp  


--- tags/kdevelop/3.3.91/parts/astyle/astyle_adaptor.cpp #556534:556535
@@ -90,11 +90,11 @@
 
   // padding
   setOperatorPaddingMode(config-&gt;readBoolEntry(&quot;PadOperators&quot;, false));
-  setParenthesisPaddingMode(config-&gt;readBoolEntry(&quot;PadOperators&quot;, false));
+  setParenthesisPaddingMode(config-&gt;readBoolEntry(&quot;PadParentheses&quot;, false));
 
   // oneliner
-  setBreakOneLineBlocksMode(config-&gt;readBoolEntry(&quot;KeepBlocks&quot;, false));
-  setSingleStatementsMode(config-&gt;readBoolEntry(&quot;KeepStatements&quot;, false));
+  setBreakOneLineBlocksMode(!config-&gt;readBoolEntry(&quot;KeepBlocks&quot;, false));
+  setSingleStatementsMode(!config-&gt;readBoolEntry(&quot;KeepStatements&quot;, false));
 }
 
 KDevFormatter::KDevFormatter( AStyleWidget * widget )
--- tags/kdevelop/3.3.91/parts/astyle/astyle_widget.cpp #556534:556535
@@ -138,7 +138,24 @@
 
 void AStyleWidget::styleChanged( int id )
 {
-	QString sample = &quot;namespace foospace { class Bar { public: int foo(); private: int m_foo; }; int Bar::foo() { switch (x) { case 1: break; default: break; } if (isBar) { bar(); return m_foo+1; } else return 0; } }&quot;;
+	QString sample = &quot;namespace foospace {\n&quot;
+		&quot;class Bar {\n&quot;
+		&quot;public:\n&quot;
+		&quot;int foo();\n&quot;
+		&quot;private:\n&quot;
+		&quot;int m_foo;\n&quot;
+		&quot;};\n&quot;
+		&quot;int Bar::foo() {\n&quot;
+		&quot;switch (x) {\n&quot;
+		&quot;case 1:\n&quot;
+		&quot;break;\n&quot;
+		&quot;default:\n&quot;
+		&quot;break;\n&quot;
+		&quot;} if (isBar) {\n&quot;
+		&quot;bar();\n&quot;
+		&quot;return m_foo+1;\n&quot;
+		&quot;} else return 0; \n&quot;
+		&quot;}\n }\n&quot;;
 
 	ConfigTabs-&gt;setTabEnabled(tab_2, id == 0);
 	ConfigTabs-&gt;setTabEnabled(tab_3, id == 0);
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>