From ada35cded048fd19660c62266a827a7c8e0f5054 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Tue, 28 Oct 2008 15:03:16 +0000 Subject: CWS-TOOLING: integrate CWS cli002 --- cppcanvas/source/mtfrenderer/textaction.cxx | 2 +- dtrans/source/X11/X11_selection.cxx | 67 ++++++++++++++--------------- svtools/source/config/helpopt.cxx | 4 +- svtools/source/config/miscopt.cxx | 4 ++ svtools/source/config/syslocaleoptions.cxx | 6 +++ svtools/source/config/undoopt.cxx | 2 + svtools/source/control/valueacc.cxx | 2 + svtools/source/dialogs/addresstemplate.cxx | 2 + svtools/source/items1/itempool.cxx | 18 ++++---- svtools/source/numbers/zformat.cxx | 4 +- 10 files changed, 64 insertions(+), 47 deletions(-) diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index c868561c12d8..66bf728418c1 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -2307,7 +2307,7 @@ namespace cppcanvas } } #if defined __GNUC__ -#if __GNUC__ == 4 && __GNUC_MINOR__ == 1 +#if __GNUC__ == 4 && __GNUC_MINOR__ >= 1 // Unreachable; to avoid bogus warning: return ActionSharedPtr(); #endif diff --git a/dtrans/source/X11/X11_selection.cxx b/dtrans/source/X11/X11_selection.cxx index 96a376a39aa8..582dd10d041e 100644 --- a/dtrans/source/X11/X11_selection.cxx +++ b/dtrans/source/X11/X11_selection.cxx @@ -889,6 +889,7 @@ OUString SelectionManager::convertTypeFromNative( Atom nType, Atom selection, in bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_Int8 >& rData ) { + ResettableMutexGuard aGuard(m_aMutex); ::std::hash_map< Atom, Selection* >::iterator it; bool bSuccess = false; @@ -901,45 +902,41 @@ bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_In ); #endif - { - MutexGuard aGuard(m_aMutex); - - if( ! m_pDisplay ) - return false; + if( ! m_pDisplay ) + return false; - it = m_aSelections.find( selection ); - if( it == m_aSelections.end() ) - return false; + it = m_aSelections.find( selection ); + if( it == m_aSelections.end() ) + return false; - Window aSelectionOwner = XGetSelectionOwner( m_pDisplay, selection ); - if( aSelectionOwner == None ) - return false; - if( aSelectionOwner == m_aWindow ) - { - // probably bad timing led us here + Window aSelectionOwner = XGetSelectionOwner( m_pDisplay, selection ); + if( aSelectionOwner == None ) + return false; + if( aSelectionOwner == m_aWindow ) + { + // probably bad timing led us here #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "Innere Nabelschau\n" ); + fprintf( stderr, "Innere Nabelschau\n" ); #endif - return false; - } - - // ICCCM recommends to destroy property before convert request unless - // parameters are transported; we do only in case of MULTIPLE, - // so destroy property unless target is MULTIPLE - if( type != m_nMULTIPLEAtom ) - XDeleteProperty( m_pDisplay, m_aWindow, selection ); - - XConvertSelection( m_pDisplay, selection, type, selection, m_aWindow, selection == m_nXdndSelection ? m_nDropTime : CurrentTime ); - it->second->m_eState = Selection::WaitingForResponse; - it->second->m_aRequestedType = type; - it->second->m_aData = Sequence< sal_Int8 >(); - it->second->m_aDataArrived.reset(); - // really start the request; if we don't flush the - // queue the request won't leave it because there are no more - // X calls after this until the data arrived or timeout - XFlush( m_pDisplay ); + return false; } + // ICCCM recommends to destroy property before convert request unless + // parameters are transported; we do only in case of MULTIPLE, + // so destroy property unless target is MULTIPLE + if( type != m_nMULTIPLEAtom ) + XDeleteProperty( m_pDisplay, m_aWindow, selection ); + + XConvertSelection( m_pDisplay, selection, type, selection, m_aWindow, selection == m_nXdndSelection ? m_nDropTime : CurrentTime ); + it->second->m_eState = Selection::WaitingForResponse; + it->second->m_aRequestedType = type; + it->second->m_aData = Sequence< sal_Int8 >(); + it->second->m_aDataArrived.reset(); + // really start the request; if we don't flush the + // queue the request won't leave it because there are no more + // X calls after this until the data arrived or timeout + XFlush( m_pDisplay ); + // do a reschedule struct timeval tv_last, tv_current; gettimeofday( &tv_last, NULL ); @@ -950,7 +947,6 @@ bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_In { bool bAdjustTime = false; { - ClearableMutexGuard aGuard(m_aMutex); bool bHandle = false; if( XCheckTypedEvent( m_pDisplay, @@ -995,12 +991,15 @@ bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_In TimeValue aTVal; aTVal.Seconds = 0; aTVal.Nanosec = 100000000; + aGuard.clear(); osl_waitThread( &aTVal ); + aGuard.reset(); } if( bHandle ) { aGuard.clear(); handleXEvent( aEvent ); + aGuard.reset(); } } gettimeofday( &tv_current, NULL ); diff --git a/svtools/source/config/helpopt.cxx b/svtools/source/config/helpopt.cxx index 29c2dcaf47c1..0ca09c176072 100644 --- a/svtools/source/config/helpopt.cxx +++ b/svtools/source/config/helpopt.cxx @@ -269,7 +269,9 @@ void SvtHelpOptions_Impl::Load(const uno::Sequence< ::rtl::OUString>& rProperty } } else - DBG_ERRORFILE( "Wrong Type!" ); + { + DBG_ERRORFILE( "Wrong Type!" ); + } } } if ( IsHelpTips() != Help::IsQuickHelpEnabled() ) diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx index 03d7a78a2887..7a6dc4281da6 100644 --- a/svtools/source/config/miscopt.cxx +++ b/svtools/source/config/miscopt.cxx @@ -392,7 +392,9 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl() if( seqValues[nProperty] >>= aSymbolsStyle ) SetSymbolsStyleName( aSymbolsStyle ); else + { DBG_ERROR("Wrong type of \"Misc\\SymbolStyle\"!" ); + } m_bIsSymbolsStyleRO = seqRO[nProperty]; break; } @@ -492,7 +494,9 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames ) if( seqValues[nProperty] >>= aSymbolsStyle ) SetSymbolsStyleName( aSymbolsStyle ); else + { DBG_ERROR("Wrong type of \"Misc\\SymbolStyle\"!" ); + } } break; } diff --git a/svtools/source/config/syslocaleoptions.cxx b/svtools/source/config/syslocaleoptions.cxx index 18f116480cf0..a75c63e34af0 100644 --- a/svtools/source/config/syslocaleoptions.cxx +++ b/svtools/source/config/syslocaleoptions.cxx @@ -186,7 +186,9 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl() if ( pValues[nProp] >>= aStr ) m_aLocaleString = aStr; else + { DBG_ERRORFILE( "Wrong property type!" ); + } m_bROLocale = pROStates[nProp]; } break; @@ -196,7 +198,9 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl() if ( pValues[nProp] >>= aStr ) m_aCurrencyString = aStr; else + { DBG_ERRORFILE( "Wrong property type!" ); + } m_bROCurrency = pROStates[nProp]; } break; @@ -206,7 +210,9 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl() if ( pValues[nProp] >>= bValue ) m_bDecimalSeparator = bValue; else + { DBG_ERRORFILE( "Wrong property type!" ); + } m_bRODecimalSeparator = pROStates[nProp]; } break; diff --git a/svtools/source/config/undoopt.cxx b/svtools/source/config/undoopt.cxx index 18b4f486fbc0..a0c74ef84aac 100644 --- a/svtools/source/config/undoopt.cxx +++ b/svtools/source/config/undoopt.cxx @@ -140,7 +140,9 @@ void SvtUndoOptions_Impl::Load() if ( pValues[nProp] >>= nTemp ) nUndoCount = nTemp; else + { DBG_ERROR( "Wrong Type!" ); + } break; } diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index 352502cbcad7..5451d8ac5572 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -745,7 +745,9 @@ void ValueSetAcc::ThrowIfDisposed (void) static_cast(this)); } else + { DBG_ASSERT (mpParent!=NULL, "ValueSetAcc not disposed but mpParent == NULL"); + } } diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index eda4fe3848d5..ddb34d5d4fd2 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -196,11 +196,13 @@ public: m_aAliases[ pFields->ProgrammaticName ] = pFields->Alias; } else + { DBG_ERROR ( ( ::rtl::OString("AssigmentTransientData::AssigmentTransientData: unknown programmatic name (") += ::rtl::OString(pFields->ProgrammaticName.getStr(), pFields->ProgrammaticName.getLength(), RTL_TEXTENCODING_ASCII_US) += ::rtl::OString(")!") ).getStr() ); + } } } diff --git a/svtools/source/items1/itempool.cxx b/svtools/source/items1/itempool.cxx index 3e4f3c00f178..71eaefcf12cb 100644 --- a/svtools/source/items1/itempool.cxx +++ b/svtools/source/items1/itempool.cxx @@ -673,20 +673,16 @@ void SfxItemPool::SetPoolDefaultItem(const SfxPoolItem &rItem) else if ( pSecondary ) pSecondary->SetPoolDefaultItem(rItem); else + { SFX_ASSERT( 0, rItem.Which(), "unknown Which-Id - cannot set pool default" ); + } } -// ---------------------------------------------------------------------- - +/* + * Resets the default of the given back to the static default. + * If a pool default exists it is removed. + */ void SfxItemPool::ResetPoolDefaultItem( USHORT nWhichId ) - -/* [Beschreibung] - - Diese Methode setzt den Default f"ur die angegeben zur"uck - auf den statischen Default. Falls ein Pool-Default exisitiert, wird - dieser gel"oscht. -*/ - { DBG_CHKTHIS(SfxItemPool, 0); if ( IsInRange(nWhichId) ) @@ -702,7 +698,9 @@ void SfxItemPool::ResetPoolDefaultItem( USHORT nWhichId ) else if ( pSecondary ) pSecondary->ResetPoolDefaultItem(nWhichId); else + { SFX_ASSERT( 0, nWhichId, "unknown Which-Id - cannot set pool default" ); + } } // ----------------------------------------------------------------------- diff --git a/svtools/source/numbers/zformat.cxx b/svtools/source/numbers/zformat.cxx index 7d78035317bd..80b3def0cdf9 100644 --- a/svtools/source/numbers/zformat.cxx +++ b/svtools/source/numbers/zformat.cxx @@ -3945,7 +3945,9 @@ DateFormat SvNumberformat::GetDateOrder() const } } else - DBG_ERROR( "SvNumberformat::GetDateOrder: no date" ); + { + DBG_ERROR( "SvNumberformat::GetDateOrder: no date" ); + } return rLoc().getDateFormat(); } -- cgit v1.2.3