Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 71271 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/wst/xml/core/internal/provisional/format/FormatProcessorXML.java (-5 / +5 lines)
Lines 38-55 Link Here
38
				((IStructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
38
				((IStructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
39
				fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
39
				fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
40
40
41
				String indentChar = " "; //$NON-NLS-1$
41
				char indentChar = ' ';
42
				String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
42
				String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
43
				if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
43
				if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
44
					indentChar = "\t"; //$NON-NLS-1$
44
					indentChar = '\t';
45
				}
45
				}
46
				int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
46
				int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
47
47
48
				String indent = ""; //$NON-NLS-1$
48
				StringBuffer indent = new StringBuffer();
49
				for (int i = 0; i < indentationWidth; i++) {
49
				for (int i = 0; i < indentationWidth; i++) {
50
					indent += indentChar;
50
					indent.append(indentChar);
51
				}
51
				}
52
				fFormatPreferences.setIndent(indent);
52
				fFormatPreferences.setIndent(indent.toString());
53
			}
53
			}
54
		}
54
		}
55
55
(-)src/org/eclipse/wst/xml/core/internal/provisional/format/NodeFormatter.java (-5 / +5 lines)
Lines 419-436 Link Here
419
				((IStructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
419
				((IStructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
420
				fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
420
				fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
421
421
422
				String indentChar = " "; //$NON-NLS-1$
422
				char indentChar = ' ';
423
				String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
423
				String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
424
				if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
424
				if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
425
					indentChar = "\t"; //$NON-NLS-1$
425
					indentChar = '\t';
426
				}
426
				}
427
				int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
427
				int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);
428
428
429
				String indent = ""; //$NON-NLS-1$
429
				StringBuffer indent = new StringBuffer();
430
				for (int i = 0; i < indentationWidth; i++) {
430
				for (int i = 0; i < indentationWidth; i++) {
431
					indent += indentChar;
431
					indent.append(indentChar);
432
				}
432
				}
433
				fFormatPreferences.setIndent(indent);
433
				fFormatPreferences.setIndent(indent.toString());
434
			}
434
			}
435
		}
435
		}
436
436

Return to bug 71271