From 854a902cbd675c39481b85d43de521e1e63d8df6 Mon Sep 17 00:00:00 2001 From: Casey Klein Date: Fri, 19 Mar 2010 11:39:02 +0000 Subject: [PATCH] Fixed bugs found with random testing svn: r18581 --- collects/mred/private/syntax.ss | 4 +++- collects/mred/private/wxme/pasteboard.ss | 17 ++++++++++------- collects/mred/private/wxme/snip.ss | 2 +- collects/mred/private/wxme/text.ss | 8 ++++---- collects/scribblings/gui/editor-intf.scrbl | 6 +++--- collects/scribblings/gui/pasteboard-class.scrbl | 2 +- collects/scribblings/gui/snip-class.scrbl | 2 +- collects/scribblings/gui/text-class.scrbl | 3 ++- 8 files changed, 25 insertions(+), 19 deletions(-) diff --git a/collects/mred/private/syntax.ss b/collects/mred/private/syntax.ss index 196c7ce897..21b0b23142 100644 --- a/collects/mred/private/syntax.ss +++ b/collects/mred/private/syntax.ss @@ -4,7 +4,7 @@ (for-syntax scheme/base)) (provide defclass defclass* - def/public def/override def/override-final define/top case-args + def/public def/public-final def/override def/override-final define/top case-args maybe-box? any? bool? nonnegative-real? make-or-false make-box make-list make-alts make-literal symbol-in make-procedure method-name init-name @@ -24,6 +24,8 @@ (define-syntax (def/public stx) #`(def/thing define/public #,stx)) +(define-syntax (def/public-final stx) + #`(def/thing define/public-final #,stx)) (define-syntax (def/override stx) #`(def/thing define/override #,stx)) (define-syntax (def/override-final stx) diff --git a/collects/mred/private/wxme/pasteboard.ss b/collects/mred/private/wxme/pasteboard.ss index 00d84ef3e7..511c6ba448 100644 --- a/collects/mred/private/wxme/pasteboard.ss +++ b/collects/mred/private/wxme/pasteboard.ss @@ -983,12 +983,15 @@ (define/public (change-style . args) (case-args args - [([style-delta% delta]) - (do-change-style #f delta #f)] - [([style-delta% delta] [snip% snip]) - (do-change-style #f delta snip)] - [([style<%> style] [snip% snip]) - (do-change-style style #f snip)] + [() (do-change-style #f #f #f)] + [([not delta]) (do-change-style #f #f #f)] + [([style-delta% delta]) (do-change-style #f delta #f)] + [([style-delta% delta] [snip% snip]) (do-change-style #f delta snip)] + [([style<%> style] [snip% snip]) (do-change-style style #f snip)] + [([style-delta% delta] [not snip]) (do-change-style #f delta #f)] + [([style<%> style] [not snip]) (do-change-style style #f #f)] + [([not style] [snip% snip]) (do-change-style style #f snip)] + [([not style] [not snip]) (do-change-style #f #f snip)] (method-name 'pasteboard% 'change-style))) ;; ---------------------------------------- @@ -1748,7 +1751,7 @@ (let-values ([(start) snips] [(cx cy) (get-center)]) - (do-buffer-paste cb time) + (do-buffer-paste cb time #f) (if (and s-admin (not (eq? snips start))) diff --git a/collects/mred/private/wxme/snip.ss b/collects/mred/private/wxme/snip.ss index 472fc82b5f..f6281dccbb 100644 --- a/collects/mred/private/wxme/snip.ss +++ b/collects/mred/private/wxme/snip.ss @@ -295,7 +295,7 @@ #f)))) (def/public (set-unmodified) - void)) + (void))) (defclass internal-snip% snip% (super-new) diff --git a/collects/mred/private/wxme/text.ss b/collects/mred/private/wxme/text.ss index f4f84c5d8e..1fc4a463c7 100644 --- a/collects/mred/private/wxme/text.ss +++ b/collects/mred/private/wxme/text.ss @@ -654,11 +654,11 @@ (set! flow-invalid? #t)) (set! snip-cache-invalid? #t)) - (def/override (locked-for-read?) + (def/override-final (locked-for-read?) read-locked?) (def/override-final (locked-for-flow?) flow-locked?) - (def/override (locked-for-write?) + (def/override-final (locked-for-write?) write-locked?) ;; ---------------------------------------- @@ -2975,8 +2975,8 @@ (mline-get-line line))])) - (def/public (get-snip-position-and-location [snip% thesnip] [maybe-box? pos] - [maybe-box? [x #f]] [maybe-box? [y #f]]) + (def/public-final (get-snip-position-and-location [snip% thesnip] [maybe-box? pos] + [maybe-box? [x #f]] [maybe-box? [y #f]]) (cond [(not (check-recalc (or x y) #f)) #f] diff --git a/collects/scribblings/gui/editor-intf.scrbl b/collects/scribblings/gui/editor-intf.scrbl index a7635e95a3..eb14fc38ac 100644 --- a/collects/scribblings/gui/editor-intf.scrbl +++ b/collects/scribblings/gui/editor-intf.scrbl @@ -742,7 +742,7 @@ Gets the maximum display height for the contents of the editor; zero or } @defmethod[(get-max-undo-history) - (integer-in 0 100000)]{ + (or/c (integer-in 0 100000) 'forever)]{ Returns the maximum number of undoables that will be remembered by the editor. Note that undoables are counted by insertion, deletion, @@ -1192,7 +1192,7 @@ Reports whether the editor is internally locked for flowing. See } -@defmethod[(locked-for-read?) +@defmethod[#:mode public-final (locked-for-read?) boolean?]{ Reports whether the editor is internally locked for reading. See @@ -1201,7 +1201,7 @@ Reports whether the editor is internally locked for reading. See } -@defmethod[(locked-for-write?) +@defmethod[#:mode public-final (locked-for-write?) boolean?]{ Reports whether the editor is internally locked for writing. See diff --git a/collects/scribblings/gui/pasteboard-class.scrbl b/collects/scribblings/gui/pasteboard-class.scrbl index bd767748f2..317d653e19 100644 --- a/collects/scribblings/gui/pasteboard-class.scrbl +++ b/collects/scribblings/gui/pasteboard-class.scrbl @@ -969,7 +969,7 @@ Does nothing. (on-reorder [snip (is-a?/c snip%)] [to-snip (is-a?/c snip%)] [before? any/c]) - boolean?]{ + void?]{ @methspec{ Called before a snip is moved in the pasteboard's front-to-back snip diff --git a/collects/scribblings/gui/snip-class.scrbl b/collects/scribblings/gui/snip-class.scrbl index 517f0b4104..3d27c532bf 100644 --- a/collects/scribblings/gui/snip-class.scrbl +++ b/collects/scribblings/gui/snip-class.scrbl @@ -394,7 +394,7 @@ Returns @scheme[0.0]. @defmethod[(get-snipclass) - (is-a?/c snip-class%)]{ + (or/c #f (is-a?/c snip-class%))]{ Returns the snip's class, which is used for file saving and cut-and-paste. diff --git a/collects/scribblings/gui/text-class.scrbl b/collects/scribblings/gui/text-class.scrbl index 1e90a6d74f..d495850229 100644 --- a/collects/scribblings/gui/text-class.scrbl +++ b/collects/scribblings/gui/text-class.scrbl @@ -873,7 +873,8 @@ Returns the starting @techlink{position} of a given snip or } -@defmethod[(get-snip-position-and-location [snip (is-a?/c snip%)] +@defmethod[#:mode public-final + (get-snip-position-and-location [snip (is-a?/c snip%)] [pos (or/c (box/c exact-nonnegative-integer?) #f)] [x (or/c (box/c real?) #f) #f] [y (or/c (box/c real?) #f) #f])