Skip to content

Commit

Permalink
fix divide by zero bug in quickprint. Fix issue preventing quickprint…
Browse files Browse the repository at this point in the history
… test from running

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8733 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Jul 8, 2008
1 parent 7f8cf50 commit cceb43b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/gui/qgsquickprint.cpp
Expand Up @@ -227,6 +227,8 @@ void QgsQuickPrint::printMap()
// so we can restore it properly
//
int myOriginalDpi = mpMapRender->outputDpi();
//sensible default to prevent divide by zero
if (0==myOriginalDpi) myOriginalDpi=96;
QSize myOriginalSize = mpMapRender->outputSize();
int mySymbolScalingAmount = myPrintResolutionDpi / myOriginalDpi;

Expand Down
19 changes: 18 additions & 1 deletion tests/src/core/CMakeLists.txt
Expand Up @@ -76,9 +76,26 @@ ADD_CUSTOM_TARGET(qgis_applicationtestmoc ALL DEPENDS ${qgis_applicationtest_MOC
ADD_EXECUTABLE(qgis_applicationtest ${qgis_applicationtest_SRCS})
ADD_DEPENDENCIES(qgis_applicationtest qgis_applicationtestmoc)
TARGET_LINK_LIBRARIES(qgis_applicationtest ${QT_LIBRARIES} qgis_core)
#No relinking and full RPATH for the install tree
#See: http://www.cmake.org/Wiki/CMake_RPATH_handling#No_relinking_and_full_RPATH_for_the_install_tree
SET_TARGET_PROPERTIES(qgis_applicationtest
# skip the full RPATH for the build tree
PROPERTIES SKIP_BUILD_RPATH TRUE
)
SET_TARGET_PROPERTIES(qgis_applicationtest
# when building, use the install RPATH already
# (so it doesn't need to relink when installing)
PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE
)
SET_TARGET_PROPERTIES(qgis_applicationtest
# the RPATH to be used when installing
PROPERTIES INSTALL_RPATH ${QGIS_LIB_DIR}
INSTALL_RPATH_USE_LINK_PATH true)
)
SET_TARGET_PROPERTIES(qgis_applicationtest
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE
)
IF (APPLE)
# For Mac OS X, the executable must be at the root of the bundle's executable folder
INSTALL(TARGETS qgis_applicationtest RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
Expand Down
2 changes: 1 addition & 1 deletion tests/src/gui/CMakeLists.txt
Expand Up @@ -87,7 +87,7 @@ IF (APPLE)
ADD_TEST(qgis_quickprinttest ${CMAKE_INSTALL_PREFIX}/qgis_quickprinttest)
ELSE (APPLE)
INSTALL(TARGETS qgis_quickprinttest RUNTIME DESTINATION ${QGIS_BIN_DIR})
ADD_TEST(qgis_quickprinttest ${QGIS_BIN_DIR}/qgis_quickprinttest)
ADD_TEST(qgis_quickprinttest ${CMAKE_INSTALL_PREFIX}/bin/qgis_quickprinttest)
ENDIF (APPLE)


Expand Down

0 comments on commit cceb43b

Please sign in to comment.