~ubuntu-branches/debian/sid/librecad/sid

« back to all changes in this revision

Viewing changes to src/lib/actions/rs_previewactioninterface.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Howard
  • Date: 2011-12-17 20:08:57 UTC
  • mfrom: (0.2.4)
  • Revision ID: package-import@ubuntu.com-20111217200857-r9wmynaloj230qm1
Tags: 1.0.0+nolibs-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
 */
117
117
void RS_PreviewActionInterface::deletePreview() {
118
118
        graphicView->getOverlayContainer(RS2::ActionPreviewEntity)->clear();
119
 
        preview->clear();
 
119
        if (preview!=NULL && !preview->isEmpty()) {
 
120
                //avoid deletiong NULL or empty preview
 
121
            preview->clear();
 
122
        }
120
123
        graphicView->redraw(RS2::RedrawOverlay);
121
124
}
122
125
 
126
129
 * Draws / deletes the current preview.
127
130
 */
128
131
void RS_PreviewActionInterface::drawPreview() {
129
 
    if (preview && !preview->isEmpty()) {
 
132
    if (preview!=NULL && !preview->isEmpty()) {
130
133
                // RVT_PORT How does offset work??        painter->setOffset(offset);
131
134
                RS_EntityContainer *container=graphicView->getOverlayContainer(RS2::ActionPreviewEntity);
132
135
                container->clear();