Changeset 269:11015f58425e
- Timestamp:
- 07/06/08 09:36:48
(2 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Fix: StyledText? check for null in clipboard paste
Add: version TANGOSVN
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r259 |
r269 |
|
| 24 | 24 | import dwt.dwthelper.utils; |
|---|
| 25 | 25 | |
|---|
| 26 | | static import tango.io.FileConst; |
|---|
| | 26 | version(TANGOSVN) |
|---|
| | 27 | static import tango.io.model.IFile; |
|---|
| | 28 | } |
|---|
| | 29 | else{ |
|---|
| | 30 | static import tango.io.FileConst; |
|---|
| | 31 | } |
|---|
| 27 | 32 | static import tango.text.Text; |
|---|
| 28 | 33 | |
|---|
| … | … | |
| 30 | 35 | |
|---|
| 31 | 36 | class DefaultContent : StyledTextContent { |
|---|
| | 37 | version(TANGOSVN) |
|---|
| | 38 | private final static String LineDelimiter = tango.io.model.IFile.FileConst.NewlineString; |
|---|
| | 39 | } |
|---|
| | 40 | else{ |
|---|
| 32 | 41 | private final static String LineDelimiter = tango.io.FileConst.FileConst.NewlineString; |
|---|
| | 42 | } |
|---|
| 33 | 43 | |
|---|
| 34 | 44 | StyledTextListener[] textListeners; // stores text listeners for event sending |
|---|
| … | … | |
| 735 | 745 | * |
|---|
| 736 | 746 | * @param listener the listener which should no longer be notified |
|---|
| 737 | | * |
|---|
| | 747 | * |
|---|
| 738 | 748 | * @exception IllegalArgumentException <ul> |
|---|
| 739 | 749 | * <li>ERROR_NULL_ARGUMENT when listener is null</li> |
|---|
| r259 |
r269 |
|
| 86 | 86 | static import tango.text.Text; |
|---|
| 87 | 87 | static import tango.text.Util; |
|---|
| 88 | | static import tango.io.FileConst; |
|---|
| | 88 | version(TANGOSVN) |
|---|
| | 89 | static import tango.io.model.IFile; |
|---|
| | 90 | } |
|---|
| | 91 | else{ |
|---|
| | 92 | static import tango.io.FileConst; |
|---|
| | 93 | } |
|---|
| 89 | 94 | static import tango.text.convert.Utf; |
|---|
| 90 | 95 | import tango.util.Convert; |
|---|
| … | … | |
| 153 | 158 | |
|---|
| 154 | 159 | static const char TAB = '\t'; |
|---|
| | 160 | version(TANGOSVN){ |
|---|
| | 161 | static const String PlatformLineDelimiter = tango.io.model.IFile.FileConst.NewlineString; |
|---|
| | 162 | } |
|---|
| | 163 | else { |
|---|
| 155 | 164 | static const String PlatformLineDelimiter = tango.io.FileConst.FileConst.NewlineString; |
|---|
| | 165 | } |
|---|
| 156 | 166 | static const int BIDI_CARET_WIDTH = 3; |
|---|
| 157 | 167 | static const int DEFAULT_WIDTH = 64; |
|---|
| … | … | |
| 3825 | 3835 | * |
|---|
| 3826 | 3836 | * @return the top pixel of a given line index |
|---|
| 3827 | | * |
|---|
| | 3837 | * |
|---|
| 3828 | 3838 | * @since 3.2 |
|---|
| 3829 | 3839 | */ |
|---|
| … | … | |
| 3852 | 3862 | * Returns the line index for a y, relative to the client area. |
|---|
| 3853 | 3863 | * The line index returned is always in the range 0..lineCount - 1. |
|---|
| 3854 | | * |
|---|
| | 3864 | * |
|---|
| 3855 | 3865 | * @param y the y-coordinate pixel |
|---|
| 3856 | | * |
|---|
| | 3866 | * |
|---|
| 3857 | 3867 | * @return the line index for a given y-coordinate pixel |
|---|
| 3858 | 3868 | * |
|---|
| … | … | |
| 6033 | 6043 | public void paste(){ |
|---|
| 6034 | 6044 | checkWidget(); |
|---|
| 6035 | | String text = (cast(ArrayWrapperString) getClipboardContent(DND.CLIPBOARD)).array; |
|---|
| | 6045 | String text = null; |
|---|
| | 6046 | if( auto o = cast(ArrayWrapperString) getClipboardContent(DND.CLIPBOARD)){ |
|---|
| | 6047 | text = o.array; |
|---|
| | 6048 | } |
|---|
| 6036 | 6049 | if (text !is null && text.length > 0) { |
|---|
| 6037 | 6050 | Event event = new Event(); |
|---|
| … | … | |
| 6263 | 6276 | * |
|---|
| 6264 | 6277 | * @param listener the listener which should no longer be notified |
|---|
| 6265 | | * |
|---|
| | 6278 | * |
|---|
| 6266 | 6279 | * @exception DWTException <ul> |
|---|
| 6267 | 6280 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 6271 | 6284 | * <li>ERROR_NULL_ARGUMENT when listener is null</li> |
|---|
| 6272 | 6285 | * </ul> |
|---|
| 6273 | | * |
|---|
| | 6286 | * |
|---|
| 6274 | 6287 | * @since 2.0 |
|---|
| 6275 | 6288 | */ |
|---|
| … | … | |
| 6301 | 6314 | * |
|---|
| 6302 | 6315 | * @param listener the listener which should no longer be notified |
|---|
| 6303 | | * |
|---|
| | 6316 | * |
|---|
| 6304 | 6317 | * @exception DWTException <ul> |
|---|
| 6305 | 6318 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 6319 | 6332 | * |
|---|
| 6320 | 6333 | * @param listener the listener which should no longer be notified |
|---|
| 6321 | | * |
|---|
| | 6334 | * |
|---|
| 6322 | 6335 | * @exception DWTException <ul> |
|---|
| 6323 | 6336 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 6337 | 6350 | * |
|---|
| 6338 | 6351 | * @param modifyListener the listener which should no longer be notified |
|---|
| 6339 | | * |
|---|
| | 6352 | * |
|---|
| 6340 | 6353 | * @exception DWTException <ul> |
|---|
| 6341 | 6354 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 6355 | 6368 | * |
|---|
| 6356 | 6369 | * @param listener the listener which should no longer be notified |
|---|
| 6357 | | * |
|---|
| | 6370 | * |
|---|
| 6358 | 6371 | * @exception DWTException <ul> |
|---|
| 6359 | 6372 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 6396 | 6409 | * |
|---|
| 6397 | 6410 | * @param verifyListener the listener which should no longer be notified |
|---|
| 6398 | | * |
|---|
| | 6411 | * |
|---|
| 6399 | 6412 | * @exception DWTException <ul> |
|---|
| 6400 | 6413 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 6414 | 6427 | * |
|---|
| 6415 | 6428 | * @param listener the listener which should no longer be notified |
|---|
| 6416 | | * |
|---|
| | 6429 | * |
|---|
| 6417 | 6430 | * @exception DWTException <ul> |
|---|
| 6418 | 6431 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| … | … | |
| 6431 | 6444 | * |
|---|
| 6432 | 6445 | * @param listener the listener which should no longer be notified |
|---|
| 6433 | | * |
|---|
| | 6446 | * |
|---|
| 6434 | 6447 | * @exception DWTException <ul> |
|---|
| 6435 | 6448 | * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
|---|
| r259 |
r269 |
|
| 44 | 44 | static import tango.text.Text; |
|---|
| 45 | 45 | static import tango.text.Util; |
|---|
| 46 | | static import tango.io.FileConst; |
|---|
| 47 | 46 | static import tango.text.convert.Utf; |
|---|
| 48 | 47 | import tango.util.Convert; |
|---|