Kaydet (Commit) 16d14244 authored tarafından Radu Ioan's avatar Radu Ioan Kaydeden (comit) Thomas Arnhold

fdo#43157 - Clean up OSL_ASSERT, DBG_ASSERT

 - replaced osl_trace with sal_info
 - added new log areas to log-area.dox

Change-Id: I20f539bd9fa62bef2e9a2a82b59e0b15f4efdd48
Reviewed-on: https://gerrit.libreoffice.org/3179Reviewed-by: 's avatarThomas Arnhold <thomas@arnhold.org>
Tested-by: 's avatarThomas Arnhold <thomas@arnhold.org>
üst de2ccd8e
...@@ -334,6 +334,7 @@ certain functionality. ...@@ -334,6 +334,7 @@ certain functionality.
@li @c ucbhelper @li @c ucbhelper
@li @c unoidl @li @c unoidl
@li @c uui @li @c uui
@li @c vbahelper
@li @c xmlhelp @li @c xmlhelp
@li @c xmloff @li @c xmloff
@li @c xmlreader @li @c xmlreader
......
...@@ -46,10 +46,10 @@ extern "C" ...@@ -46,10 +46,10 @@ extern "C"
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey ) registry::XRegistryKey * pRegistryKey )
{ {
OSL_TRACE("In component_getFactory for %s", pImplName ); SAL_INFO("vbahelper", "In component_getFactory for " << pImplName );
void* pRet = component_getFactoryHelper( void* pRet = component_getFactoryHelper(
pImplName, pServiceManager, pRegistryKey, controlprovider::serviceDecl, userform::serviceDecl ); pImplName, pServiceManager, pRegistryKey, controlprovider::serviceDecl, userform::serviceDecl );
OSL_TRACE("Ret is 0x%x", pRet); SAL_INFO("vbahelper", "Ret is 0x" << std::hex << pRet);
return pRet; return pRet;
} }
} }
......
...@@ -104,13 +104,13 @@ ScVbaComboBox::getListIndex() throw (uno::RuntimeException) ...@@ -104,13 +104,13 @@ ScVbaComboBox::getListIndex() throw (uno::RuntimeException)
{ {
if ( sItems[ index ].equals( sText ) ) if ( sItems[ index ].equals( sText ) )
{ {
OSL_TRACE("getListIndex returning %d", index ); SAL_INFO("vbahelper", "getListIndex returning " << index );
return uno::makeAny( index ); return uno::makeAny( index );
} }
} }
} }
OSL_TRACE("getListIndex returning %d", -1 ); SAL_INFO("vbahelper", "getListIndex returning -1" );
return uno::makeAny( sal_Int32( -1 ) ); return uno::makeAny( sal_Int32( -1 ) );
} }
......
...@@ -29,13 +29,13 @@ const static OUString TOGGLE( "Toggle" ); ...@@ -29,13 +29,13 @@ const static OUString TOGGLE( "Toggle" );
const static OUString STATE( "State" ); const static OUString STATE( "State" );
ScVbaToggleButton::ScVbaToggleButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : ToggleButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) ScVbaToggleButton::ScVbaToggleButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : ToggleButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
{ {
OSL_TRACE("ScVbaToggleButton(ctor)"); SAL_INFO("vbahelper", "ScVbaToggleButton(ctor)");
m_xProps->setPropertyValue( TOGGLE, uno::makeAny( sal_True ) ); m_xProps->setPropertyValue( TOGGLE, uno::makeAny( sal_True ) );
} }
ScVbaToggleButton::~ScVbaToggleButton() ScVbaToggleButton::~ScVbaToggleButton()
{ {
OSL_TRACE("~ScVbaToggleButton(dtor)"); SAL_INFO("vbahelper", "~ScVbaToggleButton(dtor)");
} }
// Attributes // Attributes
...@@ -67,9 +67,9 @@ ScVbaToggleButton::setValue( const uno::Any& _value ) throw (uno::RuntimeExcepti ...@@ -67,9 +67,9 @@ ScVbaToggleButton::setValue( const uno::Any& _value ) throw (uno::RuntimeExcepti
{ {
sal_Int16 nState = 0; sal_Int16 nState = 0;
_value >>= nState; _value >>= nState;
OSL_TRACE( "nState - %d", nState ); SAL_INFO("vbahelper", "nState - " << nState );
nState = ( nState == -1 ) ? 1 : 0; nState = ( nState == -1 ) ? 1 : 0;
OSL_TRACE( "nState - %d", nState ); SAL_INFO("vbahelper", "nState - " << nState );
m_xProps->setPropertyValue( STATE, uno::makeAny( nState ) ); m_xProps->setPropertyValue( STATE, uno::makeAny( nState ) );
} }
......
...@@ -59,7 +59,7 @@ ScVbaUserForm::~ScVbaUserForm() ...@@ -59,7 +59,7 @@ ScVbaUserForm::~ScVbaUserForm()
void SAL_CALL void SAL_CALL
ScVbaUserForm::Show( ) throw (uno::RuntimeException) ScVbaUserForm::Show( ) throw (uno::RuntimeException)
{ {
OSL_TRACE("ScVbaUserForm::Show( )"); SAL_INFO("vbahelper", "ScVbaUserForm::Show( )");
short aRet = 0; short aRet = 0;
mbDispose = true; mbDispose = true;
...@@ -83,7 +83,7 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException) ...@@ -83,7 +83,7 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException)
aRet = m_xDialog->execute(); aRet = m_xDialog->execute();
} }
OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet); SAL_INFO("vbahelper", "ScVbaUserForm::Show() execute returned " << aRet);
if ( mbDispose ) if ( mbDispose )
{ {
try try
...@@ -276,7 +276,7 @@ ScVbaUserForm::hasProperty( const OUString& aName ) throw (uno::RuntimeException ...@@ -276,7 +276,7 @@ ScVbaUserForm::hasProperty( const OUString& aName ) throw (uno::RuntimeException
{ {
uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY ); uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY );
OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d", OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xControl.is() ); SAL_INFO("vbahelper", "ScVbaUserForm::hasProperty(" << aName << ") " << xControl.is() );
if ( xControl.is() ) if ( xControl.is() )
{ {
uno::Reference< beans::XPropertySet > xDlgProps( xControl->getModel(), uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xDlgProps( xControl->getModel(), uno::UNO_QUERY );
...@@ -284,7 +284,7 @@ ScVbaUserForm::hasProperty( const OUString& aName ) throw (uno::RuntimeException ...@@ -284,7 +284,7 @@ ScVbaUserForm::hasProperty( const OUString& aName ) throw (uno::RuntimeException
{ {
uno::Reference< container::XNameContainer > xAllChildren( xDlgProps->getPropertyValue( "AllDialogChildren" ), uno::UNO_QUERY_THROW ); uno::Reference< container::XNameContainer > xAllChildren( xDlgProps->getPropertyValue( "AllDialogChildren" ), uno::UNO_QUERY_THROW );
sal_Bool bRes = xAllChildren->hasByName( aName ); sal_Bool bRes = xAllChildren->hasByName( aName );
OSL_TRACE("ScVbaUserForm::hasProperty(%s) %d ---> %d", OUStringToOString( aName, RTL_TEXTENCODING_UTF8 ).getStr(), xAllChildren.is(), bRes ); SAL_INFO("vbahelper", "ScVbaUserForm::hasProperty(" << aName << ") " << xAllChildren.is() << " ---> " << bRes );
return bRes; return bRes;
} }
} }
......
...@@ -115,7 +115,7 @@ ScVbaCommandBar::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException) ...@@ -115,7 +115,7 @@ ScVbaCommandBar::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException)
} }
catch(const uno::Exception&) catch(const uno::Exception&)
{ {
OSL_TRACE( "SetVisible get an exception" ); SAL_INFO("vbahelper", "SetVisible get an exception" );
} }
} }
......
...@@ -69,7 +69,7 @@ ScVbaCommandBarControl::setOnAction( const OUString& _onaction ) throw (uno::Run ...@@ -69,7 +69,7 @@ ScVbaCommandBarControl::setOnAction( const OUString& _onaction ) throw (uno::Run
if ( aResolvedMacro.mbFound ) if ( aResolvedMacro.mbFound )
{ {
OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.msResolvedMacro ); OUString aCommandURL = ooo::vba::makeMacroURL( aResolvedMacro.msResolvedMacro );
OSL_TRACE(" ScVbaCommandBarControl::setOnAction: %s", OUStringToOString( aCommandURL, RTL_TEXTENCODING_UTF8 ).getStr() ); SAL_INFO("vbahelper", "ScVbaCommandBarControl::setOnAction: " << aCommandURL);
setPropertyValue( m_aPropertyValues, "CommandURL" , uno::makeAny( aCommandURL ) ); setPropertyValue( m_aPropertyValues, "CommandURL" , uno::makeAny( aCommandURL ) );
ApplyChange(); ApplyChange();
} }
......
...@@ -247,7 +247,7 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css ...@@ -247,7 +247,7 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css
aBuffer.append( sLabel.copy( index + 1 ) ); aBuffer.append( sLabel.copy( index + 1 ) );
} }
OUString sNewLabel = aBuffer.makeStringAndClear(); OUString sNewLabel = aBuffer.makeStringAndClear();
OSL_TRACE("VbaCommandBarHelper::findControlByName, control name: %s", OUStringToOString( sNewLabel, RTL_TEXTENCODING_UTF8 ).getStr() ); SAL_INFO("vbahelper", "VbaCommandBarHelper::findControlByName, control name: " << sNewLabel);
if( sName.equalsIgnoreAsciiCase( sNewLabel ) ) if( sName.equalsIgnoreAsciiCase( sNewLabel ) )
return i; return i;
} }
......
...@@ -188,7 +188,7 @@ VbaDocumentBase::Protect( const uno::Any &aPassword ) throw (uno::RuntimeExcepti ...@@ -188,7 +188,7 @@ VbaDocumentBase::Protect( const uno::Any &aPassword ) throw (uno::RuntimeExcepti
{ {
OUString rPassword; OUString rPassword;
uno::Reference< util::XProtectable > xProt( getModel(), uno::UNO_QUERY_THROW ); uno::Reference< util::XProtectable > xProt( getModel(), uno::UNO_QUERY_THROW );
OSL_TRACE("Workbook::Protect stub"); SAL_INFO("vbahelper", "Workbook::Protect stub");
if( aPassword >>= rPassword ) if( aPassword >>= rPassword )
xProt->protect( rPassword ); xProt->protect( rPassword );
else else
......
...@@ -48,7 +48,7 @@ VbaEventsHelperBase::VbaEventsHelperBase( const uno::Sequence< uno::Any >& rArgs ...@@ -48,7 +48,7 @@ VbaEventsHelperBase::VbaEventsHelperBase( const uno::Sequence< uno::Any >& rArgs
VbaEventsHelperBase::~VbaEventsHelperBase() VbaEventsHelperBase::~VbaEventsHelperBase()
{ {
OSL_ENSURE( mbDisposed, "VbaEventsHelperBase::~VbaEventsHelperBase - missing disposing notification" ); SAL_WARN_IF( !mbDisposed, "vbahelper", "VbaEventsHelperBase::~VbaEventsHelperBase - missing disposing notification" );
} }
sal_Bool SAL_CALL VbaEventsHelperBase::hasVbaEventHandler( sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs ) sal_Bool SAL_CALL VbaEventsHelperBase::hasVbaEventHandler( sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs )
...@@ -93,7 +93,7 @@ sal_Bool SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, cons ...@@ -93,7 +93,7 @@ sal_Bool SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, cons
const EventHandlerInfo& rInfo = getEventHandlerInfo( aEventQueue.front().mnEventId ); const EventHandlerInfo& rInfo = getEventHandlerInfo( aEventQueue.front().mnEventId );
uno::Sequence< uno::Any > aEventArgs = aEventQueue.front().maArgs; uno::Sequence< uno::Any > aEventArgs = aEventQueue.front().maArgs;
aEventQueue.pop_front(); aEventQueue.pop_front();
OSL_TRACE( "VbaEventsHelperBase::processVbaEvent( \"%s\" )", OUStringToOString( rInfo.maMacroName, RTL_TEXTENCODING_UTF8 ).getStr() ); SAL_INFO("vbahelper", "VbaEventsHelperBase::processVbaEvent( \"" << rInfo.maMacroName << "\" )");
/* Let derived classes prepare the event, they may add new events for /* Let derived classes prepare the event, they may add new events for
next iteration. If false is returned, the event handler must not be next iteration. If false is returned, the event handler must not be
...@@ -140,7 +140,7 @@ sal_Bool SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, cons ...@@ -140,7 +140,7 @@ sal_Bool SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, cons
void SAL_CALL VbaEventsHelperBase::notifyEvent( const document::EventObject& rEvent ) throw (uno::RuntimeException) void SAL_CALL VbaEventsHelperBase::notifyEvent( const document::EventObject& rEvent ) throw (uno::RuntimeException)
{ {
OSL_TRACE( "VbaEventsHelperBase::notifyEvent( \"%s\" )", OUStringToOString( rEvent.EventName, RTL_TEXTENCODING_UTF8 ).getStr() ); SAL_INFO("vbahelper", "VbaEventsHelperBase::notifyEvent( \"" << rEvent.EventName << "\" )");
if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ) ) if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ) )
stopListening(); stopListening();
} }
......
...@@ -193,7 +193,7 @@ getCurrentDoc( const OUString& sKey ) throw (uno::RuntimeException) ...@@ -193,7 +193,7 @@ getCurrentDoc( const OUString& sKey ) throw (uno::RuntimeException)
SbxObject* basicChosen = pBasic ; SbxObject* basicChosen = pBasic ;
if ( basicChosen == NULL) if ( basicChosen == NULL)
{ {
OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" ); SAL_INFO("vbahelper", "getModelFromBasic() StarBASIC* is NULL" );
return xModel; return xModel;
} }
SbxObject* p = pBasic; SbxObject* p = pBasic;
...@@ -224,14 +224,12 @@ getCurrentDoc( const OUString& sKey ) throw (uno::RuntimeException) ...@@ -224,14 +224,12 @@ getCurrentDoc( const OUString& sKey ) throw (uno::RuntimeException)
} }
else else
{ {
OSL_TRACE("Have model points to url %s", SAL_INFO("vbahelper", "Have model points to url " << xModel->getURL());
OUStringToOString( xModel->getURL(),
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
} }
} }
else else
{ {
OSL_TRACE("Failed to get %s", OUStringToOString( sKey, RTL_TEXTENCODING_UTF8 ).getStr() ); SAL_INFO("vbahelper", "Failed to get " << sKey);
throw uno::RuntimeException( throw uno::RuntimeException(
"Can't determine the currently selected document" , "Can't determine the currently selected document" ,
uno::Reference< uno::XInterface >() ); uno::Reference< uno::XInterface >() );
...@@ -740,7 +738,7 @@ void setCursorHelper( const uno::Reference< frame::XModel >& xModel, const Point ...@@ -740,7 +738,7 @@ void setCursorHelper( const uno::Reference< frame::XModel >& xModel, const Point
const uno::Reference< awt::XWindow > xWindow ( xFrame->getContainerWindow(), uno::UNO_SET_THROW ); const uno::Reference< awt::XWindow > xWindow ( xFrame->getContainerWindow(), uno::UNO_SET_THROW );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
OSL_ENSURE( pWindow, "ScVbaApplication::setCursor: no window!" ); SAL_WARN_IF( !pWindow, "vbahelper", "ScVbaApplication::setCursor: no window!" );
if ( !pWindow ) if ( !pWindow )
continue; continue;
......
...@@ -116,7 +116,7 @@ ScVbaShape::getType( const css::uno::Reference< drawing::XShape > xShape ) throw ...@@ -116,7 +116,7 @@ ScVbaShape::getType( const css::uno::Reference< drawing::XShape > xShape ) throw
OUString sShapeType; OUString sShapeType;
uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor( xShape, uno::UNO_QUERY_THROW ); uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor( xShape, uno::UNO_QUERY_THROW );
sShapeType = xShapeDescriptor->getShapeType(); sShapeType = xShapeDescriptor->getShapeType();
OSL_TRACE("ScVbaShape::getType: %s", OUStringToOString( sShapeType, RTL_TEXTENCODING_UTF8 ).getStr() ); SAL_INFO("vbahelper", "ScVbaShape::getType: " << sShapeType);
// office::MsoShapeType::msoDiagram to "com.sun.star.drawing.GroupShape" // office::MsoShapeType::msoDiagram to "com.sun.star.drawing.GroupShape"
if( sShapeType == "com.sun.star.drawing.GroupShape" ) if( sShapeType == "com.sun.star.drawing.GroupShape" )
return office::MsoShapeType::msoGroup; return office::MsoShapeType::msoGroup;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment