mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
fix divide by zero bug in quickprint. Fix issue preventing quickprint test from running
git-svn-id: http://svn.osgeo.org/qgis/trunk@8733 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
2e924199aa
commit
b627e2c8af
@ -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;
|
||||
|
||||
|
@ -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})
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user