changeset 187:cd8dc3f19679

Fix: missing styles in StyleRange
author Frank Benoit <benoit@tionex.de>
date Sun, 02 Mar 2008 23:00:45 +0100
parents 1fa3c8d88486
children df23b11d0b70
files dwt/custom/StyleRange.d dwt/graphics/TextStyle.d
diffstat 2 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/custom/StyleRange.d	Sun Mar 02 22:02:57 2008 +0100
+++ b/dwt/custom/StyleRange.d	Sun Mar 02 23:00:45 2008 +0100
@@ -45,6 +45,16 @@
      */
     public int fontStyle = DWT.NORMAL;
 
+/++
+ + DWT extension for clone implementation
+ +/
+protected this( StyleRange other ){
+    super( other );
+    start = other.start;
+    length = other.length;
+    fontStyle = other.fontStyle;
+}
+
 /**
  * Create a new style range with no styles
  *
@@ -156,7 +166,7 @@
  * @return a shallow copy of this StyleRange
  */
 public /+override+/ Object clone() {
-    return new StyleRange( start, length, foreground, background, fontStyle );
+    return new StyleRange( this );
 }
 
 /**
--- a/dwt/graphics/TextStyle.d	Sun Mar 02 22:02:57 2008 +0100
+++ b/dwt/graphics/TextStyle.d	Sun Mar 02 23:00:45 2008 +0100
@@ -84,6 +84,19 @@
      */
     public int rise;
 
+/++
+ + DWT extension for clone implementation
+ +/
+protected this( TextStyle other ){
+    font = other.font;
+    foreground = other.foreground;
+    background = other.background;
+    underline = other.underline;
+    strikeout = other.strikeout;
+    metrics = other.metrics;
+    rise = other.rise;
+}
+
 /**
  * Create a new text style with the specified font, foreground
  * and background.