diff options
author | Kurt Zenker <kz@openoffice.org> | 2006-01-03 15:11:41 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2006-01-03 15:11:41 +0000 |
commit | c4d009e80fd8f3737a48b49d2e02137f044d6163 (patch) | |
tree | 232a99ee16ea874722126030fdc4a6a1b2510af9 /svx/source/fmcomp/fmgridif.cxx | |
parent | dbd4b94323767a14de4afb31bf6b1b6e9acdb004 (diff) |
INTEGRATION: CWS dba202c (1.48.116); FILE MERGED
2005/12/09 09:37:05 fs 1.48.116.1: #128690# createPeer: catch cursor-related exceptions
Diffstat (limited to 'svx/source/fmcomp/fmgridif.cxx')
-rw-r--r-- | svx/source/fmcomp/fmgridif.cxx | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 3cf4c49cfbb7..32ea7139874f 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -4,9 +4,9 @@ * * $RCSfile: fmgridif.cxx,v $ * - * $Revision: 1.48 $ + * $Revision: 1.49 $ * - * last change: $Author: kz $ $Date: 2005-10-05 14:38:32 $ + * last change: $Author: kz $ $Date: 2006-01-03 16:11:41 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -125,6 +125,9 @@ #ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ #include <cppuhelper/typeprovider.hxx> #endif +#ifndef TOOLS_DIAGNOSE_EX_H +#include <tools/diagnose_ex.h> +#endif #ifndef SVX_FORM_SDBDATACOLUMN_HXX #include "sdbdatacolumn.hxx" #endif @@ -645,8 +648,18 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< ::com::sun::star::awt: // cursor position (and restore afterwards) // OJ: but only when we stand on a valid row Reference< XResultSet > xResultSet(xForm, UNO_QUERY); - if(!(xResultSet->isBeforeFirst() || xResultSet->isAfterLast())) - aOldCursorBookmark = Reference< ::com::sun::star::sdbcx::XRowLocate > (xForm, UNO_QUERY)->getBookmark(); + if ( !xResultSet->isBeforeFirst() && !xResultSet->isAfterLast() ) + { + try + { + aOldCursorBookmark = Reference< ::com::sun::star::sdbcx::XRowLocate > (xForm, UNO_QUERY)->getBookmark(); + } + catch( const Exception& e ) + { + DBG_UNHANDLED_EXCEPTION(); + (void)e; + } + } } } } @@ -655,11 +668,19 @@ void SAL_CALL FmXGridControl::createPeer(const Reference< ::com::sun::star::awt: } pPeer->setDesignMode(mbDesignMode && !bForceAlivePeer); - if (aOldCursorBookmark.hasValue()) - { // we have a valid bookmark, so we have to restore the cursor's position - Reference< XFormComponent > xComp(getModel(), UNO_QUERY); - Reference< ::com::sun::star::sdbcx::XRowLocate > xLocate(xComp->getParent(), UNO_QUERY); - xLocate->moveToBookmark(aOldCursorBookmark); + try + { + if (aOldCursorBookmark.hasValue()) + { // we have a valid bookmark, so we have to restore the cursor's position + Reference< XFormComponent > xComp(getModel(), UNO_QUERY); + Reference< ::com::sun::star::sdbcx::XRowLocate > xLocate(xComp->getParent(), UNO_QUERY); + xLocate->moveToBookmark(aOldCursorBookmark); + } + } + catch( const Exception& e ) + { + DBG_UNHANDLED_EXCEPTION(); + (void)e; } Reference< ::com::sun::star::awt::XView > xPeerView(getPeer(), UNO_QUERY); |