Fixed bugs found with random testing
svn: r18581
This commit is contained in:
parent
4e30b8dc6b
commit
854a902cbd
|
@ -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)
|
||||
|
|
|
@ -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)))
|
||||
|
|
|
@ -295,7 +295,7 @@
|
|||
#f))))
|
||||
|
||||
(def/public (set-unmodified)
|
||||
void))
|
||||
(void)))
|
||||
|
||||
(defclass internal-snip% snip%
|
||||
(super-new)
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue
Block a user