Skip to content

Commit

Permalink
Some cleanups in composer map and disable a recent change in composer…
Browse files Browse the repository at this point in the history
… that may lead to segfaults on some systems

git-svn-id: http://svn.osgeo.org/qgis/trunk@11736 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 30, 2009
1 parent 59a486b commit 1fff70e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
4 changes: 3 additions & 1 deletion src/app/composer/qgscomposer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ void QgsComposer::open( void )
void QgsComposer::paintEvent( QPaintEvent* event )
{
QMainWindow::paintEvent( event );
#if 0 //MH: disabled for now as there are segfaults on some systems
//The cached content of the composer maps need to be recreated it is the first paint event of the composer after reading from XML file.
//Otherwise the resolution of the composer map is not suitable for screen
if ( mFirstPaint )
Expand All @@ -313,12 +314,13 @@ void QgsComposer::paintEvent( QPaintEvent* event )
QgsComposerMap* cm = dynamic_cast<QgsComposerMap*>( it.key() );
if ( cm )
{
mFirstPaint = false;
cm->cache();
cm->update();
}
}
mFirstPaint = false;
}
#endif //0
}

void QgsComposer::activate()
Expand Down
8 changes: 0 additions & 8 deletions src/core/composer/qgscomposermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,6 @@ void QgsComposerMap::paint( QPainter* painter, const QStyleOptionGraphicsItem* i


painter->restore();

mLastScaleFactorX = currentScaleFactorX;
}

void QgsComposerMap::updateCachedImage( void )
Expand Down Expand Up @@ -542,12 +540,6 @@ bool QgsComposerMap::writeXML( QDomElement& elem, QDomDocument & doc ) const
}
composerMapElem.appendChild( layerSetElem );

#if 0
// why is saving the map changing anything about the cache?
mCacheUpdated = false;
mNumCachedLayers = 0;
#endif

elem.appendChild( composerMapElem );
return _writeXML( composerMapElem, doc );
}
Expand Down
6 changes: 0 additions & 6 deletions src/core/composer/qgscomposermap.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,6 @@ class CORE_EXPORT QgsComposerMap : /*public QWidget, private Ui::QgsComposerMapB
/** \brief set to true if in state of drawing. Concurrent requests to draw method are returned if set to true */
bool mDrawing;

/**Store last scale factor to avoid unnecessary repaints in case preview mode is 'Render'*/
double mLastScaleFactorX;

/**Store the last map extent to decide if cache needs to be updatet*/
QgsRectangle mCachedMapExtent;

/**Offset in x direction for showing map cache image*/
double mXOffset;
/**Offset in y direction for showing map cache image*/
Expand Down

0 comments on commit 1fff70e

Please sign in to comment.