From 7a3b67561a6f17c7059013b3532cb3a082d1a19f Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Fri, 22 Oct 2010 09:18:42 +0000 Subject: [PATCH] Follow-up fix for Bug 325783 --- .../formatter/CodeFormatterVisitor.java | 1 + .../cdt/ui/tests/text/CodeFormatterTest.java | 26 ++++++++++--------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java index db89cdcfccf..b1bfeb7af9c 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java @@ -1868,6 +1868,7 @@ public class CodeFormatterVisitor extends ASTVisitor implements ICPPASTVisitor, align.fSpaceBetweenEmptyParen= preferences.insert_space_between_empty_parens_in_method_invocation; align.fSpaceBeforeComma= preferences.insert_space_before_comma_in_method_invocation_arguments; align.fSpaceAfterComma= preferences.insert_space_after_comma_in_method_invocation_arguments; + align.fTieBreakRule = Alignment.R_OUTERMOST; formatList(expressions, align, true, false); } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java index a43e0851306..79ae96635f7 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java @@ -742,11 +742,13 @@ public class CodeFormatterTest extends BaseUITestCase { // int aVeryLongParameterThatShouldBeInOneLine1; // int aVeryLongParameterThatShouldBeInOneLine2; // - // myNewFunctionCall1(Object(aVeryLongParameterThatShouldBeInOneLine1, - // aVeryLongParameterThatShouldBeInOneLine2)); + // myNewFunctionCall1( + // Object(aVeryLongParameterThatShouldBeInOneLine1, + // aVeryLongParameterThatShouldBeInOneLine2)); // - // myNewFunctionCall2(new Object(aVeryLongParameterThatShouldBeInOneLine1, - // aVeryLongParameterThatShouldBeInOneLine2)); + // myNewFunctionCall2( + // new Object(aVeryLongParameterThatShouldBeInOneLine1, + // aVeryLongParameterThatShouldBeInOneLine2)); //} public void testLineWrappingOfConstructorCall_Bug237097() throws Exception { assertFormatterResult(); @@ -1216,14 +1218,14 @@ public class CodeFormatterTest extends BaseUITestCase { //void f() { // Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale, (200 + yoff) * ScaleY); // Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale, (200 + yoff) * ScaleY); - // Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale, ((200 + yoff) * ScaleY) - // - 1); - // Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale, ((200 + yoff) * ScaleY) - // - 1); - // Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale, ((200 + yoff) * ScaleY) - // + 1); - // Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale, ((200 + yoff) * ScaleY) - // + 1); + // Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale, + // ((200 + yoff) * ScaleY) - 1); + // Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale, + // ((200 + yoff) * ScaleY) - 1); + // Canvas1->MoveTo((50 + (24 * 20) + xoff) * Scale, + // ((200 + yoff) * ScaleY) + 1); + // Canvas1->LineTo((67 + (24 * 20) + xoff) * Scale, + // ((200 + yoff) * ScaleY) + 1); //} public void testScannerErrorWithIntegerFollowedByStar_Bug278118() throws Exception { assertFormatterResult();