diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-01-07 15:02:23 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-01-07 15:02:23 +0000 |
commit | 0c0d79e27c1f61caab6ff62488eef8c57adca593 (patch) | |
tree | 08081bad7e1fbe523b5eaf93051a6496f459cc70 /svx/source/form/fmshimp.cxx | |
parent | 977dbaeb3d187abb51addab66ef5643373499079 (diff) |
INTEGRATION: CWS geordi2q12 (1.45.22); FILE MERGED
2004/01/07 14:41:22 hr 1.45.22.1: #111934#: merge CWS dba01pp2 -> SRC680
Diffstat (limited to 'svx/source/form/fmshimp.cxx')
-rw-r--r-- | svx/source/form/fmshimp.cxx | 74 |
1 files changed, 46 insertions, 28 deletions
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 1d3d350f5f3c..a34d9743592c 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fmshimp.cxx,v $ * - * $Revision: 1.45 $ + * $Revision: 1.46 $ * - * last change: $Author: kz $ $Date: 2003-12-11 12:18:40 $ + * last change: $Author: rt $ $Date: 2004-01-07 16:02:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1790,13 +1790,22 @@ sal_Bool FmXFormShell::CanMoveLeft(const Reference< XFormController>& xControlle //------------------------------------------------------------------------------ sal_Bool FmXFormShell::CanMoveLeft(const Reference< XPropertySet>& _xControllerModel) { - if (!_xControllerModel.is()) - return sal_False; - - Reference< XResultSet> xCursor(_xControllerModel, UNO_QUERY); - sal_Bool bIsNew = ::comphelper::getBOOL(_xControllerModel->getPropertyValue(FM_PROP_ISNEW)); - sal_Int32 nCount = ::comphelper::getINT32(_xControllerModel->getPropertyValue(FM_PROP_ROWCOUNT)); - return nCount && (!xCursor->isFirst() || bIsNew); + sal_Bool bCan = sal_False; + try + { + if ( _xControllerModel.is() ) + { + Reference< XResultSet> xCursor(_xControllerModel, UNO_QUERY); + sal_Bool bIsNew = ::comphelper::getBOOL(_xControllerModel->getPropertyValue(FM_PROP_ISNEW)); + sal_Int32 nCount = ::comphelper::getINT32(_xControllerModel->getPropertyValue(FM_PROP_ROWCOUNT)); + bCan = ( nCount && ( !xCursor->isFirst() || bIsNew ) ); + } + } + catch( const Exception& ) + { + DBG_ERROR( "FmXFormShell::CanMoveLeft: caught an exception!" ); + } + return bCan; } //------------------------------------------------------------------------------ @@ -1812,25 +1821,34 @@ sal_Bool FmXFormShell::CanMoveRight(const Reference< XFormController>& xControll //------------------------------------------------------------------------------ sal_Bool FmXFormShell::CanMoveRight(const Reference< XPropertySet>& _xControllerModel) { - if (!_xControllerModel.is()) - return sal_False; - - Reference< XResultSet> xCursor(_xControllerModel, UNO_QUERY); - sal_Int32 nCount = ::comphelper::getINT32(_xControllerModel->getPropertyValue(FM_PROP_ROWCOUNT)); - sal_Bool bIsModified = ::comphelper::getBOOL(_xControllerModel->getPropertyValue(FM_PROP_ISMODIFIED)); - sal_Bool bIsNew = ::comphelper::getBOOL(_xControllerModel->getPropertyValue(FM_PROP_ISNEW)); - sal_Bool bCanInsert = OStaticDataAccessTools().canInsert(_xControllerModel); - - return ( - ( nCount - && !xCursor->isLast() - && !bIsNew - ) - ) - || - ( - bCanInsert && (!bIsNew || bIsModified) - ); + sal_Bool bCan = sal_False; + try + { + if ( _xControllerModel.is() ) + { + Reference< XResultSet> xCursor(_xControllerModel, UNO_QUERY); + sal_Int32 nCount = ::comphelper::getINT32(_xControllerModel->getPropertyValue(FM_PROP_ROWCOUNT)); + sal_Bool bIsModified = ::comphelper::getBOOL(_xControllerModel->getPropertyValue(FM_PROP_ISMODIFIED)); + sal_Bool bIsNew = ::comphelper::getBOOL(_xControllerModel->getPropertyValue(FM_PROP_ISNEW)); + sal_Bool bCanInsert = OStaticDataAccessTools().canInsert(_xControllerModel); + + bCan = ( + ( nCount + && !xCursor->isLast() + && !bIsNew + ) + ) + || + ( + bCanInsert && (!bIsNew || bIsModified) + ); + } + } + catch( const Exception& ) + { + DBG_ERROR( "FmXFormShell::CanMoveLeft: caught an exception!" ); + } + return bCan; } //------------------------------------------------------------------------ |