File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
gui-lib/framework/private Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 22322232
22332233 (struct snip-special (snip name bytes))
22342234 (define (make-snip-special snip)
2235- (define base (new editor-stream-out-bytes-base%))
2236- (define stream (make-object editor-stream-out% base))
2237- (send snip write stream )
2238- (snip-special snip
2239- (send (send snip get-snipclass) get-classname)
2240- (send base get-bytes)))
2235+ (define the-snipclass (send snip get-snipclass))
2236+ (cond
2237+ [the-snipclass
2238+ (define base (new editor-stream-out-bytes-base%))
2239+ (define stream (make-object editor-stream-out% base))
2240+ (send snip write stream )
2241+ (snip-special snip
2242+ (send the-snipclass get-classname)
2243+ (send base get-bytes))]
2244+ [else
2245+ (snip-special snip #f #f )]))
22412246 (define (snip-special->snip snip-special)
2242- (define snipclass (send (get-the-snip-class-list) find (snip-special-name snip-special)))
2247+ (define the-name (snip-special-name snip-special))
2248+ (define snipclass (and the-name (send (get-the-snip-class-list) find the-name)))
22432249 (cond
22442250 [snipclass
22452251 (define base (make-object editor-stream-in-bytes-base%
You can’t perform that action at this time.
0 commit comments