Tag: cws_src680_odbmacros2 User: fs Date: 2008-02-06 08:34:04+0000 Modified: dba/dbaccess/source/ui/app/AppControllerGen.cxx
Log: slight refactoring during #i49133# File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppControllerGen.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerGen.cxx?r1=1.28.56.5&r2=1.28.56.6 Delta lines: +11 -26 --------------------- --- AppControllerGen.cxx 2008-02-04 22:31:46+0000 1.28.56.5 +++ AppControllerGen.cxx 2008-02-06 08:34:02+0000 1.28.56.6 @@ -4,9 +4,9 @@ * * $RCSfile: AppControllerGen.cxx,v $ * - * $Revision: 1.28.56.5 $ + * $Revision: 1.28.56.6 $ * - * last change: $Author: fs $ $Date: 2008/02/04 22:31:46 $ + * last change: $Author: fs $ $Date: 2008/02/06 08:34:02 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -563,32 +563,17 @@ { try { - Sequence<PropertyValue> aFields; - m_xDataSource->getPropertyValue(PROPERTY_LAYOUTINFORMATION) >>= aFields; - PropertyValue *pIter = aFields.getArray(); - PropertyValue *pEnd = pIter + aFields.getLength(); - const static ::rtl::OUString s_sPreview(RTL_CONSTASCII_USTRINGPARAM("Preview")); - for (; pIter != pEnd && pIter->Name != s_sPreview; ++pIter) - ; - - if ( pIter == pEnd ) - { - sal_Int32 nLen = aFields.getLength(); - aFields.realloc( nLen + 1 ); - pIter = aFields.getArray() + nLen; - pIter->Name = s_sPreview; - } - sal_Int32 nOldMode = 0; - pIter->Value >>= nOldMode; + ::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) ); + sal_Int32 nOldMode = aLayoutInfo.getOrDefault( "Preview", _nMode ); if ( nOldMode != _nMode ) { - pIter->Value <<= _nMode; - m_xDataSource->setPropertyValue(PROPERTY_LAYOUTINFORMATION,makeAny(aFields)); + aLayoutInfo.put( "Preview", _nMode ); + m_xDataSource->setPropertyValue( PROPERTY_LAYOUTINFORMATION, makeAny( aLayoutInfo.getPropertyValues() ) ); } } - catch(Exception) + catch ( const Exception& ) { - OSL_ENSURE(0,"Exception caught!"); + DBG_UNHANDLED_EXCEPTION(); } } InvalidateFeature(SID_DB_APP_DISABLE_PREVIEW); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
