bug2824fix.diff

Proposed patch; it's not tested, sorry, because I was unsuccessful at installing all dev tools - fhof -, 2010-06-18 05:36 AM

Download (1.7 KB)

View differences:

src/app/qgslabeldialog.cpp (working copy)
294 294
      // font is set to the font the user selected
295 295
      spinFontSize->setValue( mFont.pointSizeF() );
296 296
    }
297
    lblSample->setFont( mFont );
297 298
  }
298 299
  else
299 300
  {
300
    // the user cancelled the dialog; font is set to the initial
301
    // value, in this case Helvetica [Cronyx], 10
301
    // the user cancelled the dialog; so don't change anything
302 302
  }
303
  lblSample->setFont( mFont );
304 303
}
305 304

  
306 305
void QgsLabelDialog::changeFontColor( void )
307 306
{
308 307
  QgsDebugMsg( "entering." );
309 308

  
310
  mFontColor = QColorDialog::getColor( mFontColor );
311
  QPalette palette = lblSample->palette();
312
  palette.setColor( lblSample->foregroundRole(), mFontColor );
313
  lblSample->setPalette( palette );
309
  QColor color = QColorDialog::getColor( mFontColor );
310
  if ( color.isValid() ) 
311
  {
312
    mFontColor = color;
313
    QPalette palette = lblSample->palette();
314
    palette.setColor( lblSample->foregroundRole(), mFontColor );
315
    lblSample->setPalette( palette );
316
  }
314 317
}
315 318

  
316 319
void QgsLabelDialog::changeBufferColor( void )
317 320
{
318 321
  QgsDebugMsg( "entering." );
319 322

  
320
  mBufferColor = QColorDialog::getColor( mBufferColor );
321
  QPalette palette = lblSample->palette();
322
  palette.setColor( lblSample->backgroundRole(), mBufferColor );
323
  lblSample->setPalette( palette );
323
  QColor color = QColorDialog::getColor( mBufferColor );
324
  if ( color.isValid() ) 
325
  {
326
    mBufferColor = color;
327
    QPalette palette = lblSample->palette();
328
    palette.setColor( lblSample->backgroundRole(), mBufferColor );
329
    lblSample->setPalette( palette );
330
  }
324 331
}
325 332

  
326 333