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.
@li @c ucbhelper
@li @c unoidl
@li @c uui
@li @c vbahelper
@li @c xmlhelp
@li @c xmloff
@li @c xmlreader
......
......@@ -46,10 +46,10 @@ extern "C"
const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
registry::XRegistryKey * pRegistryKey )
{
OSL_TRACE("In component_getFactory for %s", pImplName );
SAL_INFO("vbahelper", "In component_getFactory for " << pImplName );
void* pRet = component_getFactoryHelper(
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;
}
}
......
......@@ -104,13 +104,13 @@ ScVbaComboBox::getListIndex() throw (uno::RuntimeException)
{
if ( sItems[ index ].equals( sText ) )
{
OSL_TRACE("getListIndex returning %d", index );
SAL_INFO("vbahelper", "getListIndex returning " << index );
return uno::makeAny( index );
}
}
}
OSL_TRACE("getListIndex returning %d", -1 );
SAL_INFO("vbahelper", "getListIndex returning -1" );
return uno::makeAny( sal_Int32( -1 ) );
}
......
......@@ -29,13 +29,13 @@ const static OUString TOGGLE( "Toggle" );
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 )
{
OSL_TRACE("ScVbaToggleButton(ctor)");
SAL_INFO("vbahelper", "ScVbaToggleButton(ctor)");
m_xProps->setPropertyValue( TOGGLE, uno::makeAny( sal_True ) );
}
ScVbaToggleButton::~ScVbaToggleButton()
{
OSL_TRACE("~ScVbaToggleButton(dtor)");
SAL_INFO("vbahelper", "~ScVbaToggleButton(dtor)");
}
// Attributes
......@@ -67,9 +67,9 @@ ScVbaToggleButton::setValue( const uno::Any& _value ) throw (uno::RuntimeExcepti
{
sal_Int16 nState = 0;
_value >>= nState;
OSL_TRACE( "nState - %d", nState );
SAL_INFO("vbahelper", "nState - " << nState );
nState = ( nState == -1 ) ? 1 : 0;
OSL_TRACE( "nState - %d", nState );
SAL_INFO("vbahelper", "nState - " << nState );
m_xProps->setPropertyValue( STATE, uno::makeAny( nState ) );
}
......
......@@ -59,7 +59,7 @@ ScVbaUserForm::~ScVbaUserForm()
void SAL_CALL
ScVbaUserForm::Show( ) throw (uno::RuntimeException)
{
OSL_TRACE("ScVbaUserForm::Show( )");
SAL_INFO("vbahelper", "ScVbaUserForm::Show( )");
short aRet = 0;
mbDispose = true;
......@@ -83,7 +83,7 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException)
aRet = m_xDialog->execute();
}
OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet);
SAL_INFO("vbahelper", "ScVbaUserForm::Show() execute returned " << aRet);
if ( mbDispose )
{
try
......@@ -276,7 +276,7 @@ ScVbaUserForm::hasProperty( const OUString& aName ) throw (uno::RuntimeException
{
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() )
{
uno::Reference< beans::XPropertySet > xDlgProps( xControl->getModel(), uno::UNO_QUERY );
......@@ -284,7 +284,7 @@ ScVbaUserForm::hasProperty( const OUString& aName ) throw (uno::RuntimeException
{
uno::Reference< container::XNameContainer > xAllChildren( xDlgProps->getPropertyValue( "AllDialogChildren" ), uno::UNO_QUERY_THROW );
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;
}
}
......
......@@ -115,7 +115,7 @@ ScVbaCommandBar::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException)
}
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
if ( aResolvedMacro.mbFound )
{
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 ) );
ApplyChange();
}
......
......@@ -247,7 +247,7 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css
aBuffer.append( sLabel.copy( index + 1 ) );
}
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 ) )
return i;
}
......
......@@ -188,7 +188,7 @@ VbaDocumentBase::Protect( const uno::Any &aPassword ) throw (uno::RuntimeExcepti
{
OUString rPassword;
uno::Reference< util::XProtectable > xProt( getModel(), uno::UNO_QUERY_THROW );
OSL_TRACE("Workbook::Protect stub");
SAL_INFO("vbahelper", "Workbook::Protect stub");
if( aPassword >>= rPassword )
xProt->protect( rPassword );
else
......
......@@ -48,7 +48,7 @@ VbaEventsHelperBase::VbaEventsHelperBase( const uno::Sequence< uno::Any >& rArgs
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 )
......@@ -93,7 +93,7 @@ sal_Bool SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, cons
const EventHandlerInfo& rInfo = getEventHandlerInfo( aEventQueue.front().mnEventId );
uno::Sequence< uno::Any > aEventArgs = aEventQueue.front().maArgs;
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
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
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 ) )
stopListening();
}
......
......@@ -193,7 +193,7 @@ getCurrentDoc( const OUString& sKey ) throw (uno::RuntimeException)
SbxObject* basicChosen = pBasic ;
if ( basicChosen == NULL)
{
OSL_TRACE("getModelFromBasic() StarBASIC* is NULL" );
SAL_INFO("vbahelper", "getModelFromBasic() StarBASIC* is NULL" );
return xModel;
}
SbxObject* p = pBasic;
......@@ -224,14 +224,12 @@ getCurrentDoc( const OUString& sKey ) throw (uno::RuntimeException)
}
else
{
OSL_TRACE("Have model points to url %s",
OUStringToOString( xModel->getURL(),
RTL_TEXTENCODING_ASCII_US ).pData->buffer );
SAL_INFO("vbahelper", "Have model points to url " << xModel->getURL());
}
}
else
{
OSL_TRACE("Failed to get %s", OUStringToOString( sKey, RTL_TEXTENCODING_UTF8 ).getStr() );
SAL_INFO("vbahelper", "Failed to get " << sKey);
throw uno::RuntimeException(
"Can't determine the currently selected document" ,
uno::Reference< uno::XInterface >() );
......@@ -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 );
Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
OSL_ENSURE( pWindow, "ScVbaApplication::setCursor: no window!" );
SAL_WARN_IF( !pWindow, "vbahelper", "ScVbaApplication::setCursor: no window!" );
if ( !pWindow )
continue;
......
......@@ -116,7 +116,7 @@ ScVbaShape::getType( const css::uno::Reference< drawing::XShape > xShape ) throw
OUString sShapeType;
uno::Reference< drawing::XShapeDescriptor > xShapeDescriptor( xShape, uno::UNO_QUERY_THROW );
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"
if( sShapeType == "com.sun.star.drawing.GroupShape" )
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