File tree 3 files changed +14
-7
lines changed
3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ void QgsComposerLabelWidget::on_mHtmlCheckBox_stateChanged( int state )
60
60
61
61
mComposerLabel ->beginCommand ( tr ( " Label text HTML state changed" ), QgsComposerMergeCommand::ComposerLabelSetText );
62
62
mComposerLabel ->blockSignals ( true );
63
- mComposerLabel ->setHtmlSate ( state );
63
+ mComposerLabel ->setHtmlState ( state );
64
64
mComposerLabel ->setText ( mTextEdit ->toPlainText () );
65
65
mComposerLabel ->update ();
66
66
mComposerLabel ->blockSignals ( false );
@@ -245,7 +245,7 @@ void QgsComposerLabelWidget::setGuiElementValues()
245
245
mTextEdit ->setPlainText ( mComposerLabel ->text () );
246
246
mTextEdit ->moveCursor ( QTextCursor::End, QTextCursor::MoveAnchor );
247
247
mMarginDoubleSpinBox ->setValue ( mComposerLabel ->margin () );
248
- mHtmlCheckBox ->setChecked ( mComposerLabel ->htmlSate () );
248
+ mHtmlCheckBox ->setChecked ( mComposerLabel ->htmlState () );
249
249
mTopRadioButton ->setChecked ( mComposerLabel ->vAlign () == Qt::AlignTop );
250
250
mMiddleRadioButton ->setChecked ( mComposerLabel ->vAlign () == Qt::AlignVCenter );
251
251
mBottomRadioButton ->setChecked ( mComposerLabel ->vAlign () == Qt::AlignBottom );
Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ class CORE_EXPORT QgsComposerLabel: public QgsComposerItem
45
45
QString text () { return mText ; }
46
46
void setText ( const QString& text );
47
47
48
- int htmlSate () { return mHtmlState ; }
49
- void setHtmlSate ( int state ) {mHtmlState = state;}
48
+ int htmlState () { return mHtmlState ; }
49
+ void setHtmlState ( int state ) {mHtmlState = state;}
50
50
51
51
/* *Returns the text as it appears on screen (with replaced data field)
52
52
@note this function was added in version 1.2*/
Original file line number Diff line number Diff line change @@ -534,8 +534,9 @@ QgsComposition* QgsConfigParser::createPrintComposition( const QString& composer
534
534
535
535
if ( title.isEmpty () )
536
536
{
537
- // remove exported labels not referenced in the request
538
- if ( !currentLabel->id ().isEmpty () )
537
+ // remove exported labels referenced in the request
538
+ // but with empty string
539
+ if ( parameterMap.contains ( currentLabel->id ().toUpper () ) )
539
540
{
540
541
c->removeItem ( currentLabel );
541
542
delete currentLabel;
@@ -544,7 +545,13 @@ QgsComposition* QgsConfigParser::createPrintComposition( const QString& composer
544
545
}
545
546
546
547
currentLabel->setText ( title );
547
- currentLabel->adjustSizeToText ();
548
+ /* the method adjustSizeToText has some rendering issue
549
+ * for HTML or Simple String
550
+ if ( !currentLabel->htmlState() )
551
+ {
552
+ currentLabel->adjustSizeToText();
553
+ }
554
+ */
548
555
}
549
556
550
557
return c;
You can’t perform that action at this time.
0 commit comments