extensions/source/propctrlr/formcomponenthandler.cxx | 9 +++++ forms/source/component/FormComponent.cxx | 33 ++++++++++++------- solenv/gdb/libreoffice/tl.py | 20 +++++------ svx/source/fmcomp/gridcell.cxx | 4 ++ svx/source/form/fmobjfac.cxx | 2 + toolkit/source/controls/unocontrols.cxx | 1 vcl/source/control/field2.cxx | 10 +++-- xmloff/source/core/xmlimp.cxx | 9 ++++- xmloff/source/forms/elementexport.cxx | 4 ++ xmloff/source/forms/elementimport.cxx | 16 ++++++--- 10 files changed, 76 insertions(+), 32 deletions(-)
New commits: commit e39a959429234aef5348a8b5800b27c29de02a6f Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sun Jul 28 16:10:17 2013 +0200 surely this is a typo Change-Id: Ic7a6b330094c597aaed09377cde55c2e7be1b08f diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index a75a8a0..9f451b7 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -720,8 +720,8 @@ namespace xmloff case OControlElement::IMAGE_FRAME: pServiceName = "com.sun.star.form.component.DatabaseImageControl"; break; case OControlElement::HIDDEN: pServiceName = "com.sun.star.form.component.HiddenControl"; break; case OControlElement::GRID: pServiceName = "com.sun.star.form.component.GridControl"; break; - case OControlElement::TIME: pServiceName = "com.sun.star.form.component.DateField"; break; - case OControlElement::DATE: pServiceName = "com.sun.star.form.component.TimeField"; break; + case OControlElement::TIME: pServiceName = "com.sun.star.form.component.TimeField"; break; + case OControlElement::DATE: pServiceName = "com.sun.star.form.component.DateField"; break; default: break; } if ( pServiceName != NULL ) commit b7f90b8f1e3324417e3618dd90811295466676d4 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sun Jul 28 15:56:25 2013 +0200 protect against past-the-end access of empty string Change-Id: I4518d1a2795f4775aec7f3eb495e39afe30ec7be diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index a6b8782..be0f9e1 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -2290,13 +2290,13 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, return false; nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() ); - if ( aStr[0] == '-' ) + if ( !aStr.isEmpty() && aStr[0] == '-' ) bNegative = true; if ( nSepPos >= 0 ) { if ( !ImplCutTimePortion( aStr, nSepPos, _bSkipInvalidCharacters, &nSecond ) ) return false; - if ( aStr[0] == '-' ) + if ( !aStr.isEmpty() && aStr[0] == '-' ) bNegative = true; n100Sec = (short)aStr.toString().toInt32(); } @@ -2320,7 +2320,7 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, aStr.remove( 0, nSepPos+1 ); nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() ); - if ( aStr[0] == '-' ) + if ( !aStr.isEmpty() && aStr[0] == '-' ) bNegative = true; if ( nSepPos >= 0 ) { @@ -2329,7 +2329,7 @@ static bool ImplTimeGetValue( const OUString& rStr, Time& rTime, aStr.remove( 0, nSepPos+1 ); nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() ); - if ( aStr[0] == '-' ) + if ( !aStr.isEmpty() && aStr[0] == '-' ) bNegative = true; if ( nSepPos >= 0 ) { commit a6f3beadde3ed3636fbcce1592a30af7ed146009 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sun Jul 28 15:53:00 2013 +0200 Adapt gdb python pretty-printer to time nano-second precision API change Change-Id: I416d98a298f00ae445a480c738a47758544d317c diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py index 71ff822..7c18a95 100644 --- a/solenv/gdb/libreoffice/tl.py +++ b/solenv/gdb/libreoffice/tl.py @@ -149,27 +149,27 @@ class DatePrinter(object): class TimeImpl(DateTimeImpl): - def __init__(self, hour, minute, second, hundreth_of_second = 0): + def __init__(self, hour, minute, second, nanosecond = 0): super(TimeImpl, self).__init__(None, self) self.hour = hour self.minute = minute self.second = second - self.hundreth_of_second = hundreth_of_second + self.nanosecond = nanosecond def __str__(self): decimal = '' - if self.hundreth_of_second != 0: - decimal = '.%d' % self.hundreth_of_second - return "%d:%d:%d%s" % (self.hour, self.minute, self.second, decimal) + if self.nanosecond != 0: + decimal = '.%09d' % self.nanosecond + return "%02d:%02d:%02d%s" % (self.hour, self.minute, self.second, decimal) @staticmethod def parse(val): time = val['nTime'] - h = time / 1000000 - m = (time / 10000) % 100 - s = (time / 100) % 100 - s_100 = time % 100 - return TimeImpl(h, m, s, s_100) + h = time / 10000000000000 + m = (time / 100000000000) % 100 + s = (time / 1000000000) % 100 + ns = time % 1000000000 + return TimeImpl(h, m, s, ns) class TimePrinter(object): '''Prints time''' commit 5bdc7103befd92313085824f51b5a8559f464e9a Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sun Jul 28 15:50:56 2013 +0200 More details in debug output In particular, give type and message of exception when unexpectedly caught. Also miscellaneous other details. Change-Id: I87d71028dbc902e1770fee4c3643c85e75b7646d diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index d3d670a..4db1549 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2003,6 +2003,7 @@ namespace pcr catch( const Exception& ) { OSL_FAIL( "FormComponentPropertyHandler::impl_updateDependentProperty_nothrow: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -2074,6 +2075,7 @@ namespace pcr catch( const Exception& ) { OSL_FAIL( "FormComponentPropertyHandler::impl_initComponentMetaData_throw: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -2328,6 +2330,7 @@ namespace pcr catch( const Exception& ) { OSL_FAIL( "FormComponentPropertyHandler::impl_getRowSet_nothrow: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return xReturn; } @@ -2367,6 +2370,7 @@ namespace pcr catch (const Exception&) { OSL_FAIL( "FormComponentPropertyHandler::impl_initFieldList_nothrow: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -2423,6 +2427,7 @@ namespace pcr catch( const Exception& ) { OSL_FAIL( "FormComponentPropertyHandler::impl_ensureRowsetConnection_nothrow: caught an exception during error handling!" ); + DBG_UNHANDLED_EXCEPTION(); } // additional info about what happended INetURLObject aParser( sDataSourceName ); @@ -2481,6 +2486,7 @@ namespace pcr catch (const Exception&) { OSL_FAIL("FormComponentPropertyHandler::impl_describeCursorSource_nothrow: caught an exception !"); + DBG_UNHANDLED_EXCEPTION(); } } @@ -2658,6 +2664,7 @@ namespace pcr catch( const Exception& ) { OSL_FAIL( "FormComponentPropertyHandler::impl_dialogFilterOrSort_nothrow: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } if ( aErrorInfo.isValid() ) @@ -2752,6 +2759,7 @@ namespace pcr catch( const Exception& ) { OSL_FAIL( "FormComponentPropertyHandler::impl_dialogFormatting_nothrow: : caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return bChanged; } @@ -3282,6 +3290,7 @@ namespace pcr catch( const Exception& ) { OSL_FAIL( "FormComponentPropertyHandler::impl_hasValidDataSourceSignature_nothrow: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } return bHas; diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index 79e92da..1bd3acd 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -551,6 +551,7 @@ void OControlModel::readHelpTextCompatibly(const staruno::Reference< stario::XOb catch(const Exception&) { SAL_WARN("forms.component", "OControlModel::readHelpTextCompatibly: could not forward the property value to the aggregate!"); + DBG_UNHANDLED_EXCEPTION(); } } @@ -566,6 +567,7 @@ void OControlModel::writeHelpTextCompatibly(const staruno::Reference< stario::XO catch(const Exception&) { SAL_WARN("forms.component", "OControlModel::writeHelpTextCompatibly: could not retrieve the property value from the aggregate!"); + DBG_UNHANDLED_EXCEPTION(); } ::comphelper::operator<<( _rxOutStream, sHelpText); } @@ -608,7 +610,8 @@ OControlModel::OControlModel( } catch( const Exception& ) { - SAL_WARN("forms.component", "OControlModel::OControlModel: caught an exception!" ); + SAL_WARN("forms.component", "OControlModel::OControlModel: caught an exception!"); + DBG_UNHANDLED_EXCEPTION(); } } } @@ -996,7 +999,7 @@ Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const if ( m_aPropertyBagHelper.hasDynamicPropertyByHandle( _nHandle ) ) m_aPropertyBagHelper.getDynamicPropertyDefaultByHandle( _nHandle, aReturn ); else - SAL_WARN("forms.component", "OControlModel::convertFastPropertyValue: unknown handle!" ); + SAL_WARN("forms.component", "OControlModel::convertFastPropertyValue: unknown handle " << _nHandle); } return aReturn; } @@ -1073,7 +1076,7 @@ sal_Bool OControlModel::convertFastPropertyValue( if ( m_aPropertyBagHelper.hasDynamicPropertyByHandle( _nHandle ) ) bModified = m_aPropertyBagHelper.convertDynamicFastPropertyValue( _nHandle, _rValue, _rConvertedValue, _rOldValue ); else - SAL_WARN("forms.component", "OControlModel::convertFastPropertyValue: unknown handle!" ); + SAL_WARN("forms.component", "OControlModel::convertFastPropertyValue: unknown handle " << _nHandle); break; } return bModified; @@ -1117,7 +1120,7 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const A if ( m_aPropertyBagHelper.hasDynamicPropertyByHandle( _nHandle ) ) m_aPropertyBagHelper.setDynamicFastPropertyValue( _nHandle, _rValue ); else - SAL_WARN("forms.component", "OControlModel::setFastPropertyValue_NoBroadcast: unknown handle!" ); + SAL_WARN("forms.component", "OControlModel::setFastPropertyValue_NoBroadcast: unknown handle " << _nHandle ); break; } } @@ -2002,7 +2005,8 @@ void SAL_CALL OBoundControlModel::propertyChange( const PropertyChangeEvent& evt } catch( const Exception& ) { - SAL_WARN("forms.component", "OBoundControlModel::propertyChange: could not adjust my binding-controlled property!" ); + SAL_WARN("forms.component", "OBoundControlModel::propertyChange: could not adjust my binding-controlled property!"); + DBG_UNHANDLED_EXCEPTION(); } } } @@ -2168,7 +2172,7 @@ sal_Bool OBoundControlModel::connectToField(const Reference<XRowSet>& rForm) } else { - SAL_WARN("forms.component", "OBoundControlModel::connectToField: property NAME not supported!"); + SAL_WARN("forms.component", "OBoundControlModel::connectToField: property " << PROPERTY_VALUE << " not supported!"); impl_setField_noNotify( NULL ); } } @@ -2377,7 +2381,8 @@ void OBoundControlModel::doSetControlValue( const Any& _rValue ) } catch( const Exception& ) { - SAL_WARN("forms.component", "OBoundControlModel::doSetControlValue: caught an exception!" ); + SAL_WARN("forms.component", "OBoundControlModel::doSetControlValue: caught an exception!"); + DBG_UNHANDLED_EXCEPTION(); } } @@ -2397,7 +2402,8 @@ void OBoundControlModel::onConnectedValidator( ) } catch( const Exception& ) { - SAL_WARN("forms.component", "OBoundControlModel::onConnectedValidator: caught an exception!" ); + SAL_WARN("forms.component", "OBoundControlModel::onConnectedValidator: caught an exception!"); + DBG_UNHANDLED_EXCEPTION(); } recheckValidity( false ); } @@ -2415,7 +2421,8 @@ void OBoundControlModel::onDisconnectedValidator( ) } catch( const Exception& ) { - SAL_WARN("forms.component", "OBoundControlModel::onDisconnectedValidator: caught an exception!" ); + SAL_WARN("forms.component", "OBoundControlModel::onDisconnectedValidator: caught an exception!"); + DBG_UNHANDLED_EXCEPTION(); } recheckValidity( false ); } @@ -2504,6 +2511,7 @@ void OBoundControlModel::reset() throw (RuntimeException) catch( const SQLException& ) { SAL_WARN("forms.component", "OBoundControlModel::reset: caught an SQL exception!" ); + DBG_UNHANDLED_EXCEPTION(); } // #i24495# - don't count the insert row as "invalid" @@ -2550,6 +2558,7 @@ void OBoundControlModel::reset() throw (RuntimeException) catch(const Exception&) { SAL_WARN("forms.component", "OBoundControlModel::reset: this should have succeeded in all cases!"); + DBG_UNHANDLED_EXCEPTION(); } sal_Bool bNeedValueTransfer = sal_True; @@ -2712,7 +2721,8 @@ void OBoundControlModel::disconnectExternalValueBinding( ) } catch( const Exception& ) { - SAL_WARN("forms.component", "OBoundControlModel::disconnectExternalValueBinding: caught an exception!" ); + SAL_WARN("forms.component", "OBoundControlModel::disconnectExternalValueBinding: caught an exception!"); + DBG_UNHANDLED_EXCEPTION(); } // if the binding also acts as our validator, disconnect the validator, too @@ -3081,7 +3091,8 @@ void OBoundControlModel::recheckValidity( bool _bForceNotification ) } catch( const Exception& ) { - SAL_WARN("forms.component", "OBoundControlModel::recheckValidity: caught an exception!" ); + SAL_WARN("forms.component", "OBoundControlModel::recheckValidity: caught an exception!"); + DBG_UNHANDLED_EXCEPTION(); } } diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 91aebe7..c81d1e0 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -121,6 +121,7 @@ namespace catch( const Exception& ) { OSL_FAIL( "getModelLineEndSetting: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return eFormat; } @@ -587,6 +588,7 @@ DbCellControl::DbCellControl( DbGridColumn& _rColumn, sal_Bool /*_bText*/ ) catch( const Exception& ) { OSL_FAIL( "DbCellControl::doPropertyListening: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } } @@ -611,6 +613,7 @@ void DbCellControl::implDoPropertyListening(const OUString& _rPropertyName, sal_ catch( const Exception& ) { OSL_FAIL( "DbCellControl::doPropertyListening: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -1121,6 +1124,7 @@ void DbTextField::Init( Window& rParent, const Reference< XRowSet >& xCursor) catch( const Exception& ) { OSL_FAIL( "DbTextField::Init: caught an exception while determining the multi-line capabilities!" ); + DBG_UNHANDLED_EXCEPTION(); } m_bIsSimpleEdit = !bIsMultiLine; diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx index 39be34a..1f9a108 100644 --- a/svx/source/form/fmobjfac.cxx +++ b/svx/source/form/fmobjfac.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <tools/diagnose_ex.h> #include <comphelper/stl_types.hxx> #include <svx/svdobj.hxx> #include "svx/fmtools.hxx" @@ -119,6 +120,7 @@ namespace catch( const Exception& ) { OSL_FAIL( "lcl_initProperty: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } } diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index f5ec93a..4b3a8f5 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -627,6 +627,7 @@ void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 n catch( const ::com::sun::star::uno::Exception& ) { OSL_FAIL( "GraphicControlModel::setFastPropertyValue_NoBroadcast: caught an exception while aligning the ImagePosition/ImageAlign properties!" ); + DBG_UNHANDLED_EXCEPTION(); mbAdjustingImagePosition = sal_False; } } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 1efc629..a6b8782 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -19,6 +19,7 @@ #include "sal/config.h" +#include <tools/diagnose_ex.h> #include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> #include <tools/rc.h> @@ -165,6 +166,7 @@ static int ImplIsPatternChar( sal_Unicode cChar, sal_Char cEditMask ) catch (const ::com::sun::star::uno::Exception&) { SAL_WARN( "vcl.control", "ImplIsPatternChar: Exception caught!" ); + DBG_UNHANDLED_EXCEPTION(); return sal_False; } diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 121b4d4..bde6cca 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -19,6 +19,7 @@ #include <string.h> +#include <tools/diagnose_ex.h> #include <com/sun/star/beans/XPropertySetInfo.hpp> #include <tools/debug.hxx> #include <tools/urlobj.hxx> @@ -172,7 +173,8 @@ getBuildIdsProperty(uno::Reference<beans::XPropertySet> const& xImportInfo) } catch (Exception const& e) { - SAL_WARN("xmloff.core", "exception getting BuildId" << e.Message); + SAL_WARN("xmloff.core", "exception getting BuildId"); + DBG_UNHANDLED_EXCEPTION(); } } return OUString(); @@ -849,7 +851,8 @@ void SAL_CALL SvXMLImport::setTargetDocument( const uno::Reference< lang::XCompo } catch (uno::Exception const& e) { - SAL_WARN("xmloff.core", "exception caught: " << e.Message); + SAL_WARN("xmloff.core", "exception caught"); + DBG_UNHANDLED_EXCEPTION(); } if (!mxEventListener.is()) { @@ -1456,10 +1459,12 @@ void SvXMLImport::AddNumberStyle(sal_Int32 nKey, const OUString& rName) catch ( uno::Exception& ) { SAL_WARN( "xmloff.core", "Numberformat could not be inserted"); + DBG_UNHANDLED_EXCEPTION(); } } else { SAL_WARN( "xmloff.core", "not possible to create NameContainer"); + DBG_UNHANDLED_EXCEPTION(); } } diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index d4eeda7..dbcb9c0 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -1862,6 +1862,7 @@ namespace xmloff catch( const Exception& ) { OSL_FAIL( "OControlExport::exportCellBindingAttributes: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -1907,6 +1908,7 @@ namespace xmloff catch( const Exception& ) { OSL_FAIL( "OControlExport::exportCellListSourceRange: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -1981,6 +1983,7 @@ namespace xmloff catch( const Exception& ) { OSL_FAIL( "OColumnExport::controlHasActiveDataBinding: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return false; @@ -2012,6 +2015,7 @@ namespace xmloff catch( const Exception& ) { OSL_FAIL( "OControlExport::controlHasUserSuppliedListEntries: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } OSL_FAIL( "OControlExport::controlHasUserSuppliedListEntries: unreachable code!" ); diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index 443209f..a75a8a0 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -306,9 +306,10 @@ namespace xmloff xMultiProps->setPropertyValues(aNames, aValues); bSuccess = sal_True; } - catch(Exception&) + catch(const Exception&) { OSL_FAIL("OElementImport::implApplySpecificProperties: could not set the properties (using the XMultiPropertySet)!"); + DBG_UNHANDLED_EXCEPTION(); } } @@ -326,11 +327,12 @@ namespace xmloff { m_xElement->setPropertyValue(aPropValues->Name, aPropValues->Value); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL(OStringBuffer("OElementImport::implApplySpecificProperties: could not set the property \""). append(OUStringToOString(aPropValues->Name, RTL_TEXTENCODING_ASCII_US)). append("\"!").getStr()); + DBG_UNHANDLED_EXCEPTION(); } } } @@ -468,11 +470,12 @@ namespace xmloff m_xElement->setPropertyValue( aPropValues->Name, aPropValues->Value ); } - catch(Exception&) + catch(const Exception&) { OSL_FAIL(OStringBuffer("OElementImport::EndElement: could not set the property \""). append(OUStringToOString(aPropValues->Name, RTL_TEXTENCODING_ASCII_US)). append("\"!").getStr()); + DBG_UNHANDLED_EXCEPTION(); } } } @@ -1031,6 +1034,7 @@ namespace xmloff catch( const Exception& ) { OSL_FAIL( "OControlImport::EndElement: caught an exception while retrieving the class id!" ); + DBG_UNHANDLED_EXCEPTION(); } const sal_Char* pValueProperty = NULL; @@ -1068,6 +1072,7 @@ namespace xmloff catch( const Exception& ) { OSL_FAIL( "OControlImport::EndElement: caught an exception while retrieving the current value property!" ); + DBG_UNHANDLED_EXCEPTION(); } } } @@ -1085,6 +1090,7 @@ namespace xmloff catch( const Exception& ) { OSL_FAIL( "OControlImport::EndElement: caught an exception while restoring the value property!" ); + DBG_UNHANDLED_EXCEPTION(); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits