Bug 573546: Clear old selection in hover on annotation ruler

The select can be called twice when the expansion first opens,
so clear out the old selection before processing the new one.

If this isn't done, the oldStyles gets set to the highlighted
version on the second call, which prevents deselect from
removing the highlight.

Change-Id: Ibc8ae45d4164d380b7946cd492c29f33c9fac981
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/AnnotationExpansionControl.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/AnnotationExpansionControl.java
index fd07514..49e2a35 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/AnnotationExpansionControl.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/AnnotationExpansionControl.java
@@ -110,6 +110,12 @@
 		StyleRange[] oldStyles;
 
 		public void selected() {
+			if (fSelection != null) {
+				// We can get two selection events back to back because of
+				// code in org.eclipse.cdt.internal.ui.text.c.hover.AnnotationExpansionControl.setVisible(boolean)
+				// which forces a select on first open
+				deselect();
+			}
 			Display disp = fShell.getDisplay();
 			canvas.setCursor(getHandCursor(disp));
 			// TODO: shade - for now: set grey background