* Convenience class to ensure LineLayout objects are always disposed. */
| 414 | * Convenience class to ensure LineLayout objects are always disposed. |
| 415 | */ |
| 416 | class AutoLineLayout |
| 417 | { |
| 418 | LineLayoutCache &llc; |
| 419 | LineLayout *ll; |
| 420 | AutoLineLayout &operator= ( const AutoLineLayout & ); |
| 421 | public: |
| 422 | AutoLineLayout ( LineLayoutCache &llc_, LineLayout *ll_ ) : llc ( llc_ ), ll ( ll_ ) {} |
| 423 | ~AutoLineLayout() { |
| 424 | llc.Dispose ( ll ); |
| 425 | ll = 0; |
| 426 | } |
| 427 | LineLayout *operator->() const { |
| 428 | return ll; |
| 429 | } |
| 430 | operator LineLayout *() const { |
| 431 | return ll; |
| 432 | } |
| 433 | void Set ( LineLayout *ll_ ) { |
| 434 | llc.Dispose ( ll ); |
| 435 | ll = ll_; |
| 436 | } |
| 437 | }; |
| 438 | |
| 439 | SelectionPosition Editor::ClampPositionIntoDocument ( SelectionPosition sp ) const |
| 440 | { |
nothing calls this directly
no outgoing calls
no test coverage detected