Index: src/app/qgslabeldialog.cpp =================================================================== --- src/app/qgslabeldialog.cpp (revision 13746) +++ src/app/qgslabeldialog.cpp (working copy) @@ -294,33 +294,40 @@ // font is set to the font the user selected spinFontSize->setValue( mFont.pointSizeF() ); } + lblSample->setFont( mFont ); } else { - // the user cancelled the dialog; font is set to the initial - // value, in this case Helvetica [Cronyx], 10 + // the user cancelled the dialog; so don't change anything } - lblSample->setFont( mFont ); } void QgsLabelDialog::changeFontColor( void ) { QgsDebugMsg( "entering." ); - mFontColor = QColorDialog::getColor( mFontColor ); - QPalette palette = lblSample->palette(); - palette.setColor( lblSample->foregroundRole(), mFontColor ); - lblSample->setPalette( palette ); + QColor color = QColorDialog::getColor( mFontColor ); + if ( color.isValid() ) + { + mFontColor = color; + QPalette palette = lblSample->palette(); + palette.setColor( lblSample->foregroundRole(), mFontColor ); + lblSample->setPalette( palette ); + } } void QgsLabelDialog::changeBufferColor( void ) { QgsDebugMsg( "entering." ); - mBufferColor = QColorDialog::getColor( mBufferColor ); - QPalette palette = lblSample->palette(); - palette.setColor( lblSample->backgroundRole(), mBufferColor ); - lblSample->setPalette( palette ); + QColor color = QColorDialog::getColor( mBufferColor ); + if ( color.isValid() ) + { + mBufferColor = color; + QPalette palette = lblSample->palette(); + palette.setColor( lblSample->backgroundRole(), mBufferColor ); + lblSample->setPalette( palette ); + } }