Skip to content
Permalink
Browse files

QGIS Server - GetPrint request does not respect text boxes size and p…

…osition if dynamic content passed

This commit brings some correction for the issue #7894
Firstly the use of adjustSizeToText has been inactivate
Secondly if a composerLabel is not in the parameterMap the default value
is conserved.
  • Loading branch information
rldhont committed Jun 3, 2013
1 parent bf9b3e3 commit fe883246707644df37a0960fba57250226b8f001
@@ -60,7 +60,7 @@ void QgsComposerLabelWidget::on_mHtmlCheckBox_stateChanged( int state )

mComposerLabel->beginCommand( tr( "Label text HTML state changed" ), QgsComposerMergeCommand::ComposerLabelSetText );
mComposerLabel->blockSignals( true );
mComposerLabel->setHtmlSate( state );
mComposerLabel->setHtmlState( state );
mComposerLabel->setText( mTextEdit->toPlainText() );
mComposerLabel->update();
mComposerLabel->blockSignals( false );
@@ -245,7 +245,7 @@ void QgsComposerLabelWidget::setGuiElementValues()
mTextEdit->setPlainText( mComposerLabel->text() );
mTextEdit->moveCursor( QTextCursor::End, QTextCursor::MoveAnchor );
mMarginDoubleSpinBox->setValue( mComposerLabel->margin() );
mHtmlCheckBox->setChecked( mComposerLabel->htmlSate() );
mHtmlCheckBox->setChecked( mComposerLabel->htmlState() );
mTopRadioButton->setChecked( mComposerLabel->vAlign() == Qt::AlignTop );
mMiddleRadioButton->setChecked( mComposerLabel->vAlign() == Qt::AlignVCenter );
mBottomRadioButton->setChecked( mComposerLabel->vAlign() == Qt::AlignBottom );
@@ -45,8 +45,8 @@ class CORE_EXPORT QgsComposerLabel: public QgsComposerItem
QString text() { return mText; }
void setText( const QString& text );

int htmlSate() { return mHtmlState; }
void setHtmlSate( int state ) {mHtmlState = state;}
int htmlState() { return mHtmlState; }
void setHtmlState( int state ) {mHtmlState = state;}

/**Returns the text as it appears on screen (with replaced data field)
@note this function was added in version 1.2*/
@@ -534,8 +534,9 @@ QgsComposition* QgsConfigParser::createPrintComposition( const QString& composer

if ( title.isEmpty() )
{
//remove exported labels not referenced in the request
if ( !currentLabel->id().isEmpty() )
//remove exported labels referenced in the request
//but with empty string
if ( parameterMap.contains( currentLabel->id().toUpper() ) )
{
c->removeItem( currentLabel );
delete currentLabel;
@@ -544,7 +545,13 @@ QgsComposition* QgsConfigParser::createPrintComposition( const QString& composer
}

currentLabel->setText( title );
currentLabel->adjustSizeToText();
/* the method adjustSizeToText has some rendering issue
* for HTML or Simple String
if ( !currentLabel->htmlState() )
{
currentLabel->adjustSizeToText();
}
*/
}

return c;

0 comments on commit fe88324

Please sign in to comment.
You can’t perform that action at this time.