# HG changeset patch # User Frank Benoit # Date 1215351408 -7200 # Node ID 11015f58425e64f047be079c4b94cf7307e6a475 # Parent 5995c228c72fe4d5904a75460c208ec4c6960100 Fix: StyledText check for null in clipboard paste Add: version TANGOSVN diff -r 5995c228c72f -r 11015f58425e dwt/custom/DefaultContent.d --- a/dwt/custom/DefaultContent.d Sun Jul 06 15:35:58 2008 +0200 +++ b/dwt/custom/DefaultContent.d Sun Jul 06 15:36:48 2008 +0200 @@ -23,13 +23,23 @@ import dwt.custom.StyledText; import dwt.dwthelper.utils; -static import tango.io.FileConst; +version(TANGOSVN) + static import tango.io.model.IFile; +} +else{ + static import tango.io.FileConst; +} static import tango.text.Text; alias tango.text.Text.Text!(char) StringBuffer; class DefaultContent : StyledTextContent { +version(TANGOSVN) + private final static String LineDelimiter = tango.io.model.IFile.FileConst.NewlineString; +} +else{ private final static String LineDelimiter = tango.io.FileConst.FileConst.NewlineString; +} StyledTextListener[] textListeners; // stores text listeners for event sending char[] textStore; // stores the actual text @@ -734,7 +744,7 @@ *

* * @param listener the listener which should no longer be notified - * + * * @exception IllegalArgumentException

diff -r 5995c228c72f -r 11015f58425e dwt/custom/StyledText.d --- a/dwt/custom/StyledText.d Sun Jul 06 15:35:58 2008 +0200 +++ b/dwt/custom/StyledText.d Sun Jul 06 15:36:48 2008 +0200 @@ -85,7 +85,12 @@ static import tango.text.Text; static import tango.text.Util; -static import tango.io.FileConst; +version(TANGOSVN) + static import tango.io.model.IFile; +} +else{ + static import tango.io.FileConst; +} static import tango.text.convert.Utf; import tango.util.Convert; import dwt.dwthelper.utils; @@ -152,7 +157,12 @@ alias Canvas.computeSize computeSize; static const char TAB = '\t'; +version(TANGOSVN){ + static const String PlatformLineDelimiter = tango.io.model.IFile.FileConst.NewlineString; +} +else { static const String PlatformLineDelimiter = tango.io.FileConst.FileConst.NewlineString; +} static const int BIDI_CARET_WIDTH = 3; static const int DEFAULT_WIDTH = 64; static const int DEFAULT_HEIGHT = 64; @@ -3824,7 +3834,7 @@ * It means this function can be used to retrieve the bottom pixel of any line. * * @return the top pixel of a given line index - * + * * @since 3.2 */ public int getLinePixel(int lineIndex) { @@ -3851,9 +3861,9 @@ /** * Returns the line index for a y, relative to the client area. * The line index returned is always in the range 0..lineCount - 1. - * + * * @param y the y-coordinate pixel - * + * * @return the line index for a given y-coordinate pixel * * @since 3.2 @@ -6032,7 +6042,10 @@ */ public void paste(){ checkWidget(); - String text = (cast(ArrayWrapperString) getClipboardContent(DND.CLIPBOARD)).array; + String text = null; + if( auto o = cast(ArrayWrapperString) getClipboardContent(DND.CLIPBOARD)){ + text = o.array; + } if (text !is null && text.length > 0) { Event event = new Event(); event.start = selection.x; @@ -6262,7 +6275,7 @@ * Removes the specified bidirectional segment listener. * * @param listener the listener which should no longer be notified - * + * * @exception DWTException