Skip to content

Commit ca0eb5c

Browse files
author
mhugent
committedSep 7, 2008
Adjust legend box size when updating. Fix problem where vector class. items were not deleted in update
git-svn-id: http://svn.osgeo.org/qgis/trunk@9277 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent fe4b324 commit ca0eb5c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎src/app/composer/qgscomposerlegendwidget.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ void QgsComposerLegendWidget::on_mUpdatePushButton_clicked()
368368
mLegend->model()->updateItem(currentItem);
369369
}
370370
mLegend->update();
371+
mLegend->adjustBoxSize();
371372
}
372373

373374
void QgsComposerLegendWidget::on_mUpdateAllPushButton_clicked()

‎src/core/composer/qgslegendmodel.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ void QgsLegendModel::updateLayer(QStandardItem* layerItem)
279279
if(mapLayer)
280280
{
281281
//delete all the entries under layer item
282-
for(int i = rowCount() - 1; i >= 0; --i)
282+
int currentRowCount = layerItem->rowCount();
283+
for(int i = currentRowCount - 1; i >= 0; --i)
283284
{
284285
layerItem->removeRow(i);
285286
}

0 commit comments

Comments
 (0)
Please sign in to comment.