Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2010-01-05 13:58:02 +0000
committerDani Megert2010-01-05 13:58:02 +0000
commit353a71a77209f19b3c490187929e5dc51a4801f9 (patch)
treec630de9d971f983a532591db1e89f2655cb018ec
parent29808c46b9485f739bc459548484b86f6eace517 (diff)
downloadeclipse.platform.text-R3_5_maintenance.tar.gz
eclipse.platform.text-R3_5_maintenance.tar.xz
eclipse.platform.text-R3_5_maintenance.zip
Backported fix for bug 278817 and bug 278831 to 3.5 maintenance.r352_v20100105R3_5_2R3_5_maintenance
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java23
1 files changed, 7 insertions, 16 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
index 2cabb82ab..0fecd7636 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -735,6 +735,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
Font blockFont= JFaceResources.getFont(BLOCK_SELECTION_MODE_FONT);
setFont(fSourceViewer, blockFont);
disposeFont();
+ updateCaret();
return;
}
if (getFontPropertyPreferenceKey().equals(property) && !isBlockSelectionModeEnabled()) {
@@ -7231,8 +7232,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
StyledText styledText= viewer.getTextWidget();
if (styledText != null) {
/*
- * Font switching. block selection mode needs a monospace font. We try to adapt the
- * column font size to the current (normal) font size.
+ * Font switching. block selection mode needs a monospace font.
* - set the font _before enabling_ block selection mode in order to maintain the
* selection
* - revert the font _after disabling_ block selection mode in order to maintain the
@@ -7242,27 +7242,18 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
Font blockFont= JFaceResources.getFont(BLOCK_SELECTION_MODE_FONT);
Font normalFont= styledText.getFont();
if (!blockFont.equals(normalFont) && !normalFont.getFontData()[0].equals(blockFont.getFontData()[0])) {
- int size= normalFont.getFontData()[0].getHeight();
- FontData[] fontData= blockFont.getFontData();
- boolean created= false;
- if (fontData[0].getHeight() != size) {
- for (int i= 0; i < fontData.length; i++) {
- fontData[i].setHeight(size);
- }
- blockFont= new Font(blockFont.getDevice(), fontData);
- created= true;
- }
setFont(viewer, blockFont);
disposeFont();
- if (created)
- fFont= blockFont;
+ updateCaret();
}
}
styledText.setBlockSelection(enable);
- if (!enable)
+ if (!enable) {
initializeViewerFont(viewer);
+ updateCaret();
+ }
}
}
}

Back to the top