Skip to content

Commit b627e2c

Browse files
author
timlinux
committedJul 8, 2008
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
1 parent 2e92419 commit b627e2c

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed
 

‎src/gui/qgsquickprint.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ void QgsQuickPrint::printMap()
227227
// so we can restore it properly
228228
//
229229
int myOriginalDpi = mpMapRender->outputDpi();
230+
//sensible default to prevent divide by zero
231+
if (0==myOriginalDpi) myOriginalDpi=96;
230232
QSize myOriginalSize = mpMapRender->outputSize();
231233
int mySymbolScalingAmount = myPrintResolutionDpi / myOriginalDpi;
232234

‎tests/src/core/CMakeLists.txt

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,26 @@ ADD_CUSTOM_TARGET(qgis_applicationtestmoc ALL DEPENDS ${qgis_applicationtest_MOC
7676
ADD_EXECUTABLE(qgis_applicationtest ${qgis_applicationtest_SRCS})
7777
ADD_DEPENDENCIES(qgis_applicationtest qgis_applicationtestmoc)
7878
TARGET_LINK_LIBRARIES(qgis_applicationtest ${QT_LIBRARIES} qgis_core)
79+
#No relinking and full RPATH for the install tree
80+
#See: http://www.cmake.org/Wiki/CMake_RPATH_handling#No_relinking_and_full_RPATH_for_the_install_tree
7981
SET_TARGET_PROPERTIES(qgis_applicationtest
82+
# skip the full RPATH for the build tree
83+
PROPERTIES SKIP_BUILD_RPATH TRUE
84+
)
85+
SET_TARGET_PROPERTIES(qgis_applicationtest
86+
# when building, use the install RPATH already
87+
# (so it doesn't need to relink when installing)
88+
PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE
89+
)
90+
SET_TARGET_PROPERTIES(qgis_applicationtest
91+
# the RPATH to be used when installing
8092
PROPERTIES INSTALL_RPATH ${QGIS_LIB_DIR}
81-
INSTALL_RPATH_USE_LINK_PATH true)
93+
)
94+
SET_TARGET_PROPERTIES(qgis_applicationtest
95+
# add the automatically determined parts of the RPATH
96+
# which point to directories outside the build tree to the install RPATH
97+
PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE
98+
)
8299
IF (APPLE)
83100
# For Mac OS X, the executable must be at the root of the bundle's executable folder
84101
INSTALL(TARGETS qgis_applicationtest RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})

‎tests/src/gui/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ IF (APPLE)
8787
ADD_TEST(qgis_quickprinttest ${CMAKE_INSTALL_PREFIX}/qgis_quickprinttest)
8888
ELSE (APPLE)
8989
INSTALL(TARGETS qgis_quickprinttest RUNTIME DESTINATION ${QGIS_BIN_DIR})
90-
ADD_TEST(qgis_quickprinttest ${QGIS_BIN_DIR}/qgis_quickprinttest)
90+
ADD_TEST(qgis_quickprinttest ${CMAKE_INSTALL_PREFIX}/bin/qgis_quickprinttest)
9191
ENDIF (APPLE)
9292

9393

0 commit comments

Comments
 (0)
Please sign in to comment.