diff options
71 files changed, 302 insertions, 364 deletions
diff --git a/animations/source/animcore/targetpropertiescreator.cxx b/animations/source/animcore/targetpropertiescreator.cxx index ca8ce793f744..fb953ee67f37 100644 --- a/animations/source/animcore/targetpropertiescreator.cxx +++ b/animations/source/animcore/targetpropertiescreator.cxx @@ -195,8 +195,7 @@ namespace animcore { if( !xNode.is() ) { - OSL_ENSURE( false, - "AnimCore: NodeFunctor::operator(): invalid XAnimationNode" ); + OSL_FAIL( "AnimCore: NodeFunctor::operator(): invalid XAnimationNode" ); return; } @@ -217,8 +216,7 @@ namespace animcore // TODO(E1): I'm not too sure what to expect here... if( !xIterNode->getTarget().hasValue() ) { - OSL_ENSURE( false, - "animcore: NodeFunctor::operator(): no target on ITERATE node" ); + OSL_FAIL( "animcore: NodeFunctor::operator(): no target on ITERATE node" ); return; } @@ -232,8 +230,7 @@ namespace animcore // no shape provided. Maybe a ParagraphTarget? if( !(xIterNode->getTarget() >>= aTarget) ) { - OSL_ENSURE( false, - "animcore: NodeFunctor::operator(): could not extract any " + OSL_FAIL( "animcore: NodeFunctor::operator(): could not extract any " "target information" ); return; } @@ -243,8 +240,7 @@ namespace animcore if( !xTargetShape.is() ) { - OSL_ENSURE( false, - "animcore: NodeFunctor::operator(): invalid shape in ParagraphTarget" ); + OSL_FAIL( "animcore: NodeFunctor::operator(): invalid shape in ParagraphTarget" ); return; } } @@ -260,8 +256,7 @@ namespace animcore if( !::anim::for_each_childNode( xNode, aFunctor ) ) { - OSL_ENSURE( false, - "AnimCore: NodeFunctor::operator(): child node iteration failed, " + OSL_FAIL( "AnimCore: NodeFunctor::operator(): child node iteration failed, " "or extraneous container nodes encountered" ); } } @@ -320,8 +315,7 @@ namespace animcore if( !(xAnimateNode->getTarget() >>= aUnoTarget) ) { - OSL_ENSURE( false, - "AnimCore: NodeFunctor::operator(): unknown target type encountered" ); + OSL_FAIL( "AnimCore: NodeFunctor::operator(): unknown target type encountered" ); break; } @@ -332,8 +326,7 @@ namespace animcore if( !aTarget.mxRef.is() ) { - OSL_ENSURE( false, - "AnimCore: NodeFunctor::operator(): Found target, but XShape is NULL" ); + OSL_FAIL( "AnimCore: NodeFunctor::operator(): Found target, but XShape is NULL" ); break; // invalid target XShape } diff --git a/sd/inc/pglink.hxx b/sd/inc/pglink.hxx index 359bd302622d..668e59793d2b 100644 --- a/sd/inc/pglink.hxx +++ b/sd/inc/pglink.hxx @@ -29,8 +29,6 @@ #ifndef _PGLINK_HXX #define _PGLINK_HXX -#ifndef SVX_LIGHT - #include <sfx2/lnkbase.hxx> class SdPage; @@ -51,12 +49,6 @@ public: bool Connect() { return 0 != SvBaseLink::GetRealObject(); } }; -#else - -class SdPageLink; - -#endif - #endif // _PGLINK_HXX diff --git a/sd/source/core/CustomAnimationCloner.cxx b/sd/source/core/CustomAnimationCloner.cxx index 3a039fb18af1..5776e930c93e 100644 --- a/sd/source/core/CustomAnimationCloner.cxx +++ b/sd/source/core/CustomAnimationCloner.cxx @@ -140,7 +140,7 @@ namespace sd catch( Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (OString("sd::CustomAnimationClonerImpl::Clone(), " "exception caught: ") + rtl::OUStringToOString( @@ -225,7 +225,7 @@ namespace sd catch( Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (OString("sd::CustomAnimationClonerImpl::transformNode(), " "exception caught: ") + rtl::OUStringToOString( @@ -300,7 +300,7 @@ namespace sd catch( Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (OString("sd::CustomAnimationClonerImpl::transformValue(), " "exception caught: ") + rtl::OUStringToOString( diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index 464cbfb3d719..f62401fa8267 100755 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -550,7 +550,7 @@ void CustomAnimationPresets::importPresets( const Reference< XMultiServiceFactor { ByteString aTmp( "sd::CustomAnimationPresets::importPresets(), invalid preset id!\n" ); aTmp += ByteString( aMissedPresetIds, RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aTmp.GetBuffer() ); + OSL_FAIL( aTmp.GetBuffer() ); } #endif } diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 6f32b90725ab..97553d30b2fe 100755 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -1294,7 +1294,7 @@ SvStream* SdDrawDocument::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) catch( uno::Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (rtl::OString("sd::SdDrawDocument::GetDocumentStream(), " "exception caught: ") + rtl::OUStringToOString( diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 3a90a78a27c4..d929dc9f8948 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -239,7 +239,7 @@ void SdPage::EnsureMasterPageDefaultBackground() else { // no style found, assert and set at least XFILL_NONE - OSL_ENSURE(false, "No Style for MasterPageBackground fill found (!)"); + OSL_FAIL("No Style for MasterPageBackground fill found (!)"); getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE)); } } diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx index be75d6f6cc9e..561e0635e674 100644 --- a/sd/source/core/stlfamily.cxx +++ b/sd/source/core/stlfamily.cxx @@ -538,7 +538,7 @@ void SAL_CALL SdStyleFamily::removeEventListener( const Reference< XEventListene Reference<XPropertySetInfo> SdStyleFamily::getPropertySetInfo() throw (RuntimeException) { - OSL_ENSURE( 0, "###unexpected!" ); + OSL_FAIL( "###unexpected!" ); return Reference<XPropertySetInfo>(); } @@ -546,7 +546,7 @@ Reference<XPropertySetInfo> SdStyleFamily::getPropertySetInfo() throw (RuntimeEx void SdStyleFamily::setPropertyValue( const OUString& , const Any& ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - OSL_ENSURE( 0, "###unexpected!" ); + OSL_FAIL( "###unexpected!" ); } // ---------------------------------------------------------- @@ -575,28 +575,28 @@ Any SdStyleFamily::getPropertyValue( const OUString& PropertyName ) throw (Unkno void SdStyleFamily::addPropertyChangeListener( const OUString& , const Reference<XPropertyChangeListener>& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { - OSL_ENSURE( 0, "###unexpected!" ); + OSL_FAIL( "###unexpected!" ); } // ---------------------------------------------------------- void SdStyleFamily::removePropertyChangeListener( const OUString& , const Reference<XPropertyChangeListener>& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { - OSL_ENSURE( 0, "###unexpected!" ); + OSL_FAIL( "###unexpected!" ); } // ---------------------------------------------------------- void SdStyleFamily::addVetoableChangeListener( const OUString& , const Reference<XVetoableChangeListener>& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { - OSL_ENSURE( 0, "###unexpected!" ); + OSL_FAIL( "###unexpected!" ); } // ---------------------------------------------------------- void SdStyleFamily::removeVetoableChangeListener( const OUString& , const Reference<XVetoableChangeListener>& ) throw (UnknownPropertyException, WrappedTargetException, RuntimeException) { - OSL_ENSURE( 0, "###unexpected!" ); + OSL_FAIL( "###unexpected!" ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 0b439edd3b26..fc106cf4f51d 100755 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -777,8 +777,8 @@ void SAL_CALL SdStyleSheet::release( ) throw () } catch (RuntimeException const& exc) { // don't break throw () - OSL_ENSURE( - false, OUStringToOString( + OSL_FAIL( + OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); static_cast<void>(exc); } diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx index a40a84e693c0..d66e3f28c036 100755 --- a/sd/source/filter/grf/sdgrffilter.cxx +++ b/sd/source/filter/grf/sdgrffilter.cxx @@ -547,7 +547,7 @@ void SdGRFFilter::SaveGraphic( const ::com::sun::star::uno::Reference< ::com::su } catch( Exception& ) { - DBG_ERROR( + OSL_FAIL( (rtl::OString("SdGRFFilter::SaveGraphic(), " "exception caught: ") + rtl::OUStringToOString( diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index fd46e1412a5e..69bdef30bc66 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -3084,7 +3084,7 @@ bool HtmlExport::checkFileExists( Reference< ::com::sun::star::ucb::XSimpleFileA catch( com::sun::star::uno::Exception& e ) { (void)e; - DBG_ERROR((OString("sd::HtmlExport::checkFileExists(), exception caught: ") + + OSL_FAIL((OString("sd::HtmlExport::checkFileExists(), exception caught: ") + rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 )).getStr() ); } @@ -3147,7 +3147,7 @@ bool HtmlExport::checkForExistingFiles() catch( Exception& e ) { (void)e; - DBG_ERROR((OString("sd::HtmlExport::checkForExistingFiles(), exception caught: ") + + OSL_FAIL((OString("sd::HtmlExport::checkForExistingFiles(), exception caught: ") + rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 )).getStr() ); bFound = false; } diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 1683734512fc..5b7f42d3878b 100755 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -287,7 +287,7 @@ sal_Int32 ReadThroughComponent( #if OSL_DEBUG_LEVEL > 1 ByteString aError( "SAX parse exception catched while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); + OSL_FAIL( aError.GetBuffer() ); #endif String sErr( String::CreateFromInt32( r.LineNumber )); @@ -321,7 +321,7 @@ sal_Int32 ReadThroughComponent( #if OSL_DEBUG_LEVEL > 1 ByteString aError( "SAX exception catched while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); + OSL_FAIL( aError.GetBuffer() ); #endif return SD_XML_READERROR; } @@ -331,7 +331,7 @@ sal_Int32 ReadThroughComponent( #if OSL_DEBUG_LEVEL > 1 ByteString aError( "Zip exception catched while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); + OSL_FAIL( aError.GetBuffer() ); #endif return ERRCODE_IO_BROKENPACKAGE; } @@ -341,7 +341,7 @@ sal_Int32 ReadThroughComponent( #if OSL_DEBUG_LEVEL > 1 ByteString aError( "IO exception catched while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); + OSL_FAIL( aError.GetBuffer() ); #endif return SD_XML_READERROR; } @@ -351,7 +351,7 @@ sal_Int32 ReadThroughComponent( #if OSL_DEBUG_LEVEL > 1 ByteString aError( "uno exception catched while importing:\n" ); aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); + OSL_FAIL( aError.GetBuffer() ); #endif return SD_XML_READERROR; } @@ -1093,7 +1093,7 @@ sal_Bool SdXMLFilter::Export() #if OSL_DEBUG_LEVEL > 1 ByteString aError( "uno Exception caught while exporting:\n" ); aError += ByteString( String( e.Message), RTL_TEXTENCODING_ASCII_US ); - DBG_ERROR( aError.GetBuffer() ); + OSL_FAIL( aError.GetBuffer() ); #endif bDocRet = sal_False; } diff --git a/sd/source/helper/simplereferencecomponent.cxx b/sd/source/helper/simplereferencecomponent.cxx index 551c6d700365..e449170c9bd3 100644 --- a/sd/source/helper/simplereferencecomponent.cxx +++ b/sd/source/helper/simplereferencecomponent.cxx @@ -75,7 +75,7 @@ void SimpleReferenceComponent::release() { #if OSL_DEBUG_LEVEL > 0 rtl::OString msg( rtl::OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) ); - OSL_ENSURE( 0, msg.getStr() ); + OSL_FAIL( msg.getStr() ); #endif } } diff --git a/sd/source/ui/dlg/filedlg.cxx b/sd/source/ui/dlg/filedlg.cxx index a27ce2178f2c..a80feb80e3f7 100644 --- a/sd/source/ui/dlg/filedlg.cxx +++ b/sd/source/ui/dlg/filedlg.cxx @@ -240,7 +240,7 @@ void SdFileDialog_Imp::CheckSelectionState() catch( css::lang::IllegalArgumentException ) { #ifdef DBG_UTIL - DBG_ERROR( "Cannot access \"selection\" checkbox" ); + OSL_FAIL( "Cannot access \"selection\" checkbox" ); #endif } } diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 5f461a5885f0..98cee39db011 100755 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -517,8 +517,8 @@ IMPL_LINK( SdNavigatorWin, ShapeFilterCallback, Menu *, pMenu ) break; default: - OSL_ENSURE( - false, "SdNavigatorWin::ShapeFilterCallback called for unknown menu entry"); + OSL_FAIL( + "SdNavigatorWin::ShapeFilterCallback called for unknown menu entry"); break; } diff --git a/sd/source/ui/framework/factories/TaskPanelFactory.cxx b/sd/source/ui/framework/factories/TaskPanelFactory.cxx index 0cfbc942df87..9e0c5ae645ef 100644 --- a/sd/source/ui/framework/factories/TaskPanelFactory.cxx +++ b/sd/source/ui/framework/factories/TaskPanelFactory.cxx @@ -272,7 +272,7 @@ void SAL_CALL TaskPanelFactory::releaseResource ( } else { - OSL_ENSURE( false, "TaskPanelFactory::releaseResource: don't know what to do with this resource!" ); + OSL_FAIL( "TaskPanelFactory::releaseResource: don't know what to do with this resource!" ); } } } diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 13f8420b52e9..59a1d9a0b65d 100755 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -630,14 +630,16 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) nFormat = EE_FORMAT_HTML; ::Outliner* pDocliner = static_cast<OutlineView*>(mpView)->GetOutliner(); - List* pList = pDocliner->GetView(0)->CreateSelectionList(); - Paragraph* pPara = (Paragraph*)pList->First(); + + std::vector<Paragraph*> aSelList; + pDocliner->GetView(0)->CreateSelectionList(aSelList); + + Paragraph* pPara = aSelList.empty() ? NULL : *(aSelList.begin()); // wo soll eingefuegt werden? while( !pDocliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) ) - { pPara = pDocliner->GetParent(pPara); - } + sal_uLong nTargetPos = pDocliner->GetAbsPos(pPara) + 1; // Layout der Vorgaengerseite uebernehmen diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx index fdbd0cb35b09..9175ccb1bd3e 100755 --- a/sd/source/ui/func/fuprobjs.cxx +++ b/sd/source/ui/func/fuprobjs.cxx @@ -99,13 +99,20 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) OutlineView* pOlView = static_cast<OutlineView*>(pOutlineViewShell->GetView()); OutlinerView* pOutlinerView = pOlView->GetViewByWindow( (Window*) mpWindow ); ::Outliner* pOutl = pOutlinerView->GetOutliner(); - List* pList = pOutlinerView->CreateSelectionList(); - Paragraph* pPara = (Paragraph*)pList->First(); + + std::vector<Paragraph*> aSelList; + pOutlinerView->CreateSelectionList(aSelList); + + std::vector<Paragraph*>::const_iterator iter = aSelList.begin(); + Paragraph* pPara = aSelList.empty() ? NULL : *iter; + nDepth = pOutl->GetDepth((sal_uInt16)pOutl->GetAbsPos( pPara ) ); bool bPage = pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ); - while( pPara ) + while( iter != aSelList.end() ) { + pPara = *iter; + nTmp = pOutl->GetDepth((sal_uInt16) pOutl->GetAbsPos( pPara ) ); if( nDepth != nTmp ) @@ -120,8 +127,7 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) break; } bUnique = sal_True; - - pPara = (Paragraph*) pList->Next(); + ++iter; } if( bUnique ) diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx index fe9d0cfecaa8..c9bc27ed6f59 100644 --- a/sd/source/ui/inc/OutlineView.hxx +++ b/sd/source/ui/inc/OutlineView.hxx @@ -191,8 +191,8 @@ private: SdrOutliner* mpOutliner; OutlinerView* mpOutlinerView[MAX_OUTLINERVIEWS]; - List* mpOldParaOrder; - List* mpSelectedParas; + std::vector<Paragraph*> maOldParaOrder; + std::vector<Paragraph*> maSelectedParas; sal_uInt16 mnPagesToProcess; // fuer die Fortschrittsanzeige sal_uInt16 mnPagesProcessed; diff --git a/sd/source/ui/notes/TextLogger.cxx b/sd/source/ui/notes/TextLogger.cxx index b7b70c0bf420..f7645ef92ea8 100644 --- a/sd/source/ui/notes/TextLogger.cxx +++ b/sd/source/ui/notes/TextLogger.cxx @@ -63,7 +63,7 @@ TextLogger::TextLogger (void) void TextLogger::AppendText (const char* sText) { - OSL_TRACE (sText); + OSL_TRACE("%s", sText); if (mpEditWindow != NULL) mpEditWindow->InsertText (UniString::CreateFromAscii(sText)); } @@ -74,7 +74,7 @@ void TextLogger::AppendText (const char* sText) void TextLogger::AppendText (const String& sText) { ByteString s(sText, RTL_TEXTENCODING_ISO_8859_1); - OSL_TRACE (s.GetBuffer()); + OSL_TRACE("%s", s.GetBuffer()); if (mpEditWindow != NULL) mpEditWindow->InsertText (sText); } diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 8fcf76f2f728..a18c3ff7e48c 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -344,7 +344,7 @@ bool AnimationSlideController::getSlideAPI( sal_Int32 nSlideNumber, Reference< X catch( Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (OString("sd::AnimationSlideController::getSlideAPI(), " "exception caught: ") + rtl::OUStringToOString( @@ -666,7 +666,7 @@ void SAL_CALL SlideshowImpl::disposing() catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::stop(), " "exception caught: ") + rtl::OUStringToOString( @@ -801,7 +801,7 @@ bool SlideshowImpl::startPreview( if (supportedServices[pos].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.MasterPage") )) { - DBG_ERROR("sd::SlideshowImpl::startPreview() " + OSL_FAIL("sd::SlideshowImpl::startPreview() " "not allowed on master page!"); return false; } @@ -895,7 +895,7 @@ bool SlideshowImpl::startPreview( catch( Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::startPreview(), " "exception caught: ") + rtl::OUStringToOString( @@ -1144,7 +1144,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) catch( Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::startShow(), " "exception caught: ") + rtl::OUStringToOString( @@ -1207,7 +1207,7 @@ bool SlideshowImpl::startShowImpl( const Sequence< beans::PropertyValue >& aProp catch( Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::startShowImpl(), " "exception caught: ") + rtl::OUStringToOString( @@ -1246,7 +1246,7 @@ void SlideshowImpl::paint( const Rectangle& /* rRect */ ) catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::paint(), " "exception caught: ") + rtl::OUStringToOString( @@ -1301,7 +1301,7 @@ void SlideshowImpl::removeShapeEvents() catch( Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::removeShapeEvents(), " "exception caught: ") + rtl::OUStringToOString( @@ -1337,7 +1337,7 @@ void SlideshowImpl::registerShapeEvents(sal_Int32 nSlideNumber) catch( Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::registerShapeEvents(), " "exception caught: ") + rtl::OUStringToOString( @@ -1417,7 +1417,7 @@ void SlideshowImpl::registerShapeEvents( Reference< XShapes >& xShapes ) throw( catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::registerShapeEvents(), " "exception caught: ") + rtl::OUStringToOString( @@ -1497,7 +1497,7 @@ void SAL_CALL SlideshowImpl::pause() throw (RuntimeException) catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::pause(), " "exception caught: ") + rtl::OUStringToOString( @@ -1534,7 +1534,7 @@ void SAL_CALL SlideshowImpl::resume() throw (RuntimeException) catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::resume(), " "exception caught: ") + rtl::OUStringToOString( @@ -1951,7 +1951,7 @@ sal_Int32 SlideshowImpl::updateSlideShow (void) catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::updateSlideShow(), exception caught: ") + rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), @@ -2083,7 +2083,7 @@ bool SlideshowImpl::keyInput(const KeyEvent& rKEvt) { bRet = false; static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::keyInput(), " "exception caught: ") + rtl::OUStringToOString( @@ -2477,7 +2477,7 @@ Reference< XSlideShow > SlideshowImpl::createSlideShow() const catch( uno::Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::createSlideShow(), " "exception caught: ") + rtl::OUStringToOString( @@ -2687,7 +2687,7 @@ void SlideshowImpl::resize( const Size& rSize ) catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::resize(), " "exception caught: ") + rtl::OUStringToOString( @@ -3048,7 +3048,7 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::setUsePen(), " "exception caught: ") + rtl::OUStringToOString( @@ -3123,7 +3123,7 @@ void SAL_CALL SlideshowImpl::setEraseAllInk(bool bEraseAllInk) throw (RuntimeExc catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_TRACE( (OString("sd::SlideshowImpl::setEraseAllInk(), " "exception caught: ") + rtl::OUStringToOString( @@ -3344,7 +3344,7 @@ void SlideshowImpl::gotoPreviousSlide (const bool bSkipAllMainSequenceEffects) catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::gotoPreviousSlide(), " "exception caught: ") + rtl::OUStringToOString( @@ -3445,7 +3445,7 @@ void SAL_CALL SlideshowImpl::stopSound( ) throw (RuntimeException) catch( Exception& e ) { static_cast<void>(e); - DBG_ERROR( + OSL_FAIL( (OString("sd::SlideshowImpl::stopSound(), " "exception caught: ") + rtl::OUStringToOString( diff --git a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx index 352999836a3c..4d6bbf3b8891 100644 --- a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx +++ b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.cxx @@ -107,7 +107,7 @@ void MasterPageDescriptor::SetToken (MasterPageContainer::Token aToken) -Image MasterPageDescriptor::GetPreview (MasterPageContainer::PreviewSize eSize) +Image MasterPageDescriptor::GetPreview (MasterPageContainer::PreviewSize eSize) const { if (eSize == MasterPageContainer::SMALL) return maSmallPreview; diff --git a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx index 0bbd4cc3773b..dde3afca173d 100644 --- a/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx +++ b/sd/source/ui/toolpanel/controls/MasterPageDescriptor.hxx @@ -78,7 +78,7 @@ public: @return The returned preview may be empty. */ - Image GetPreview (MasterPageContainer::PreviewSize ePreviewSize); + Image GetPreview (MasterPageContainer::PreviewSize ePreviewSize) const; /** Use the PreviewProvider to get access to a preview of the master page. diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx index 89108df710d1..b1a1022a546d 100644 --- a/sd/source/ui/unoidl/DrawController.cxx +++ b/sd/source/ui/unoidl/DrawController.cxx @@ -532,7 +532,7 @@ void DrawController::FireSwitchCurrentPage (SdPage* pNewCurrentPage) throw() catch( uno::Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (::rtl::OString("sd::SdUnoDrawView::FireSwitchCurrentPage(), " "exception caught: ") + ::rtl::OUStringToOString( diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index a5c9680f2f6e..c21b61942f17 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -45,23 +45,15 @@ #include <vcl/svapp.hxx> #include "drawdoc.hxx" -#ifndef SVX_LIGHT #include "DrawDocShell.hxx" -#endif #include "unomodel.hxx" -#ifndef SVX_LIGHT #include "optsitem.hxx" #include <sfx2/printer.hxx> #include "sdattr.hxx" -#endif #include "../inc/ViewShell.hxx" #include "../inc/FrameView.hxx" -#ifndef SVX_LIGHT #include "Outliner.hxx" -#else -#include <svx/svdoutl.hxx> -#endif #include <editeng/editstat.hxx> #include <svx/unoapi.hxx> @@ -176,7 +168,6 @@ enum SdDocumentSettingsPropertyHandles { MAP_LEN("DefaultTabStop"), HANDLE_TABSTOP, &::getCppuType((const sal_Int32*)0), 0, 0 }, { MAP_LEN("PrinterName"), HANDLE_PRINTERNAME, &::getCppuType((const OUString*)0), 0, 0 }, { MAP_LEN("PrinterSetup"), HANDLE_PRINTERJOB, &::getCppuType((const uno::Sequence < sal_Int8 > *)0), 0, MID_PRINTER }, -#ifndef SVX_LIGHT { MAP_LEN("IsPrintPageName"), HANDLE_PRINTPAGENAME, &::getBooleanCppuType(), 0, MID_PRINTER }, { MAP_LEN("IsPrintDate"), HANDLE_PRINTDATE, &::getBooleanCppuType(), 0, MID_PRINTER }, @@ -188,7 +179,6 @@ enum SdDocumentSettingsPropertyHandles { MAP_LEN("IsPrintBookletFront"), HANDLE_PRINTBOOKLETFRONT, &::getBooleanCppuType(), 0, MID_PRINTER }, { MAP_LEN("IsPrintBookletBack"), HANDLE_PRINTBOOKLETBACK, &::getBooleanCppuType(), 0, MID_PRINTER }, { MAP_LEN("PrintQuality"), HANDLE_PRINTQUALITY, &::getCppuType((const sal_Int32*)0), 0, MID_PRINTER }, -#endif { MAP_LEN("ColorTableURL"), HANDLE_COLORTABLEURL, &::getCppuType((const OUString*)0), 0, 0 }, { MAP_LEN("DashTableURL"), HANDLE_DASHTABLEURL, &::getCppuType((const OUString*)0), 0, 0 }, { MAP_LEN("LineEndTableURL"), HANDLE_LINEENDTABLEURL, &::getCppuType((const OUString*)0), 0, 0 }, diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index bbbfc8c14c55..a8cff18d535d 100755 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -42,9 +42,7 @@ // folgende fuer InsertSdPage() #include <svx/svdlayer.hxx> -#ifndef SVX_LIGHT #include "DrawDocShell.hxx" -#endif #include <drawdoc.hxx> #include <unomodel.hxx> #include "unoprnms.hxx" @@ -268,10 +266,8 @@ void SAL_CALL SdLayer::setPropertyValue( const OUString& aPropertyName, const un throw beans::UnknownPropertyException(); } -#ifndef SVX_LIGHT if( pLayerManager->GetDocShell() ) pLayerManager->GetDocShell()->SetModified(); -#endif } uno::Any SAL_CALL SdLayer::getPropertyValue( const OUString& PropertyName ) @@ -343,7 +339,6 @@ sal_Bool SdLayer::get( LayerAttribute what ) throw() } } -#ifndef SVX_LIGHT // Versuch 2. Info von der FrameView besorgen if(pLayerManager->GetDocShell()) { @@ -356,7 +351,6 @@ sal_Bool SdLayer::get( LayerAttribute what ) throw() case LOCKED: return pFrameView->GetLockedLayers().IsSet(pLayer->GetID()); } } -#endif } return sal_False; //TODO: uno::Exception? } @@ -385,7 +379,6 @@ void SdLayer::set( LayerAttribute what, sal_Bool flag ) throw() } } -#ifndef SVX_LIGHT // Versuch 2. Info von der FrameView besorgen if(pLayerManager->GetDocShell()) { @@ -418,7 +411,6 @@ void SdLayer::set( LayerAttribute what, sal_Bool flag ) throw() return; } } -#endif } //TODO: uno::Exception? } diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index a85b486a6780..9d3cc6f343f7 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -303,8 +303,8 @@ void SAL_CALL SdXImpressDocument::release() throw ( ) } catch (uno::RuntimeException const& exc) { // don't break throw () - OSL_ENSURE( - false, OUStringToOString( + OSL_FAIL( + OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); static_cast<void>(exc); } diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index ebb75d0043e4..35c31916b4c1 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -72,9 +72,7 @@ #include "ViewShell.hxx" #include "unokywds.hxx" #include "unopage.hxx" -#ifndef SVX_LIGHT #include "DrawDocShell.hxx" -#endif #include "helpids.h" #include "glob.hxx" #include "glob.hrc" diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 879128104a5c..7a98dac9bf4b 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -73,9 +73,7 @@ #include <svx/svdpool.hxx> #include <svx/svdview.hxx> #include "View.hxx" -#ifndef SVX_LIGHT #include "DrawDocShell.hxx" -#endif #include "ViewShell.hxx" #include "DrawViewShell.hxx" #include "unoobj.hxx" diff --git a/sd/source/ui/unoidl/unopage.hxx b/sd/source/ui/unoidl/unopage.hxx index ef2654e7965c..0d80a97a5d86 100644 --- a/sd/source/ui/unoidl/unopage.hxx +++ b/sd/source/ui/unoidl/unopage.hxx @@ -52,10 +52,6 @@ class SvxShape; class SdrObject; struct SfxItemPropertySimpleEntry; -#ifdef SVX_LIGHT -#define SvxFmDrawPage SvxDrawPage -#endif - /*********************************************************************** * * ***********************************************************************/ diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index 7aaac3e01326..9da83f3659b5 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -206,7 +206,7 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet, // Presentation object outline OutlinerView* pOV = GetTextEditOutlinerView(); ::Outliner* pOutliner = pOV->GetOutliner(); - List* pList = (List*)pOV->CreateSelectionList(); + aTemplateName += String(SdResId(STR_LAYOUT_OUTLINE)); pOutliner->SetUpdateMode(sal_False); @@ -219,7 +219,12 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet, aComment.Insert( String((SdResId(STR_PSEUDOSHEET_OUTLINE))), nPos); mpDocSh->GetUndoManager()->EnterListAction( aComment, String() ); - Paragraph* pPara = (Paragraph*)pList->Last(); + std::vector<Paragraph*> aSelList; + pOV->CreateSelectionList(aSelList); + + std::vector<Paragraph*>::reverse_iterator iter = aSelList.rbegin(); + Paragraph* pPara = iter != aSelList.rend() ? *iter : NULL; + while (pPara) { sal_uLong nParaPos = pOutliner->GetAbsPos( pPara ); @@ -260,10 +265,11 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet, pOutlSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); } - pPara = (Paragraph*)pList->Prev(); + ++iter; + pPara = iter != aSelList.rend() ? *iter : NULL; if( !pPara && nDepth > 0 && rSet.GetItemState( EE_PARA_NUMBULLET ) == SFX_ITEM_ON && - pOutliner->GetDepth( (sal_uInt16) pOutliner->GetAbsPos( (Paragraph*) pList->First() ) ) > 0 ) + pOutliner->GetDepth( (sal_uInt16) pOutliner->GetAbsPos(*(aSelList.begin())) ) > 0 ) pPara = pOutliner->GetParagraph( 0 ); // Put NumBulletItem in outline level 1 } @@ -272,7 +278,6 @@ sal_Bool DrawView::SetAttributes(const SfxItemSet& rSet, mpDocSh->GetUndoManager()->LeaveListAction(); - delete pList; bOk = sal_True; } else diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index a6a8f378a9f1..f4f653675ebb 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -262,8 +262,10 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) { // Outliner im Gliederungsmodus ::Outliner* pOutl = pOLV->GetOutliner(); - List* pList = pOLV->CreateSelectionList(); - Paragraph* pPara = (Paragraph*) pList->First(); + + std::vector<Paragraph*> aSelList; + pOLV->CreateSelectionList(aSelList); + Paragraph* pPara = aSelList.empty() ? NULL : *(aSelList.begin()); // find out if we are a OutlineView sal_Bool bIsOutlineView(OUTLINERMODE_OUTLINEVIEW == pOLV->GetOutliner()->GetMode()); @@ -289,8 +291,10 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) } } - while (pPara) + for (std::vector<Paragraph*>::const_iterator iter = aSelList.begin(); iter != aSelList.end(); ++iter) { + pPara = *iter; + sal_Int16 nDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) ); if (nDepth > 0 || (bOutlineViewSh && (nDepth <= 0) && !pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE )) ) @@ -305,11 +309,9 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) // Nicht maximale Tiefe und nicht ganz oben bDisableRight = sal_False; } - - pPara = static_cast<Paragraph*>( pList->Next() ); } - if ( ( pOutl->GetAbsPos((Paragraph*) pList->Last()) < pOutl->GetParagraphCount() - 1 ) && + if ( ( pOutl->GetAbsPos(pPara) < pOutl->GetParagraphCount() - 1 ) && ( pOutl->GetParagraphCount() > 1 || !bOutlineViewSh) ) { // Nicht letzter Absatz @@ -317,7 +319,8 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) } // disable when first para and 2nd is not a title - pPara = static_cast< Paragraph* >( pList->First() ); + pPara = aSelList.empty() ? NULL : *(aSelList.begin()); + if(!bDisableDown && bIsOutlineView && pPara && 0 == pOutl->GetAbsPos(pPara) @@ -327,8 +330,6 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) // Needs to be disabled bDisableDown = sal_True; } - - delete pList; } if (bDisableLeft) diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index f31c56f5bc2c..66e19195bd9e 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -258,7 +258,7 @@ void DrawViewShell::SelectionHasChanged (void) catch( ::com::sun::star::uno::Exception& e ) { (void)e; - DBG_ERROR( + OSL_FAIL( (rtl::OString("sd::DrawViewShell::SelectionHasChanged(), " "exception caught: ") + rtl::OUStringToOString( diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index e5f588165f5b..0a2f8ca87349 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -862,29 +862,39 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) sal_Bool bDisableExpand = sal_True; sal_Bool bUnique = sal_True; OutlinerView* pOutlinerView = pOlView->GetViewByWindow(GetActiveWindow()); - List* pList = pOutlinerView->CreateSelectionList(); - Paragraph* pPara = (Paragraph*)pList->First(); - sal_Int16 nDepth; - sal_Int16 nTmpDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) ); - bool bPage = pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ); - while (pPara) + std::vector<Paragraph*> aSelList; + pOutlinerView->CreateSelectionList(aSelList); + + if (!aSelList.empty()) { - nDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) ); + std::vector<Paragraph*>::const_iterator iter = aSelList.begin(); + Paragraph* pPara = *iter; - if( nDepth != nTmpDepth ) - bUnique = sal_False; - if( bPage != pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ) ) - bUnique = sal_False; - if (!pOutl->IsExpanded(pPara) && pOutl->HasChilds(pPara)) - bDisableExpand = sal_False; - if (pOutl->IsExpanded(pPara) && pOutl->HasChilds(pPara)) - bDisableCollapse = sal_False; + sal_Int16 nDepth; + sal_Int16 nTmpDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) ); + bool bPage = pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ); - pPara = (Paragraph*)pList->Next(); - } + while (iter != aSelList.begin()) + { + pPara = *iter; - delete pList; + nDepth = pOutl->GetDepth( (sal_uInt16) pOutl->GetAbsPos( pPara ) ); + + if( nDepth != nTmpDepth || bPage != pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE )) + bUnique = sal_False; + + if (pOutl->HasChilds(pPara)) + { + if (!pOutl->IsExpanded(pPara)) + bDisableExpand = sal_False; + else + bDisableCollapse = sal_False; + } + + ++iter; + } + } if (bDisableExpand) rSet.DisableItem(SID_OUTLINE_EXPAND); @@ -919,7 +929,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) if (bDisableCollapseAll || bDisableExpandAll) { sal_uLong nParaPos = 0; - pPara = pOutl->GetParagraph( nParaPos ); + Paragraph* pPara = pOutl->GetParagraph( nParaPos ); while (pPara && (bDisableCollapseAll || bDisableExpandAll)) { if (!pOutl->IsExpanded(pPara) && pOutl->HasChilds(pPara)) @@ -1407,9 +1417,18 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet) ::sd::Window* pWin = GetActiveWindow(); OutlinerView* pActiveView = pOlView->GetViewByWindow( pWin ); ::Outliner* pOutliner = pOlView->GetOutliner(); - List* pSelList = (List*)pActiveView->CreateSelectionList(); - Paragraph* pFirstPara = (Paragraph*)pSelList->First(); - Paragraph* pLastPara = (Paragraph*)pSelList->Last(); + + std::vector<Paragraph*> aSelList; + pActiveView->CreateSelectionList(aSelList); + + Paragraph *pFirstPara = NULL; + Paragraph *pLastPara = NULL; + + if (!aSelList.empty()) + { + pFirstPara = *(aSelList.begin()); + pLastPara = *(aSelList.rbegin()); + } if( !pOutliner->HasParaFlag(pFirstPara,PARAFLAG_ISPAGE) ) pFirstPara = pOlView->GetPrevTitle( pFirstPara ); @@ -1417,8 +1436,6 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet) if( !pOutliner->HasParaFlag(pLastPara, PARAFLAG_ISPAGE) ) pLastPara = pOlView->GetPrevTitle( pLastPara ); - delete pSelList; // has been created only for us - // only one page selected? if( pFirstPara == pLastPara ) { @@ -1764,7 +1781,6 @@ SdPage* OutlineViewShell::GetActualPage() return pOlView->GetActualPage(); } - void OutlineViewShell::UpdatePreview( SdPage* pPage, sal_Bool ) { const bool bNewPage = pPage != pLastPage; diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 0bc619036739..683476117eb5 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -113,8 +113,6 @@ OutlineView::OutlineView( DrawDocShell* pDocSh, ::Window* pWindow, OutlineViewSh : ::sd::View(pDocSh->GetDoc(), pWindow, pOutlineViewSh) , mpOutlineViewShell(pOutlineViewSh) , mpOutliner( mpDoc->GetOutliner(sal_True) ) -, mpOldParaOrder(NULL) -, mpSelectedParas(NULL) , mnPagesToProcess(0) , mnPagesProcessed(0) , mbFirstPaint(sal_True) @@ -228,9 +226,6 @@ OutlineView::~OutlineView() mpOutliner->ForceAutoColor( aOptions.GetIsAutomaticFontColor() ); mpOutliner->Clear(); } - - DBG_ASSERT(!mpSelectedParas, "Absatzliste nicht geloescht"); - DBG_ASSERT(!mpOldParaOrder, "Absatzliste nicht geloescht"); } @@ -669,14 +664,18 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) { Window* pActWin = mpOutlineViewShell->GetActiveWindow(); OutlinerView* pOlView = GetViewByWindow(pActWin); - List* pList = pOlView->CreateSelectionList(); - Paragraph* pParagraph = (Paragraph*)pList->First(); - while (pParagraph) + std::vector<Paragraph*> aSelList; + pOlView->CreateSelectionList(aSelList); + + Paragraph *pParagraph = NULL; + for (std::vector<Paragraph*>::const_iterator iter = aSelList.begin(); iter != aSelList.end(); ++iter) { - if( !pOutliner->HasParaFlag( pParagraph, PARAFLAG_ISPAGE ) && (pOutliner->GetDepth( (sal_uInt16) pOutliner->GetAbsPos( pParagraph ) ) <= 0) ) + pParagraph = *iter; + + if( !pOutliner->HasParaFlag( pParagraph, PARAFLAG_ISPAGE ) && + (pOutliner->GetDepth( (sal_uInt16) pOutliner->GetAbsPos( pParagraph ) ) <= 0) ) mnPagesToProcess++; - pParagraph = (Paragraph*)pList->Next(); } mnPagesToProcess++; // the paragraph being in level 0 already @@ -695,7 +694,6 @@ IMPL_LINK( OutlineView, DepthChangedHdl, ::Outliner *, pOutliner ) { mpDocSh->SetWaitCursor( sal_True ); } - delete pList; } ParagraphInsertedHdl(pOutliner); @@ -918,46 +916,37 @@ IMPL_LINK( OutlineView, EndDropHdl, void *, EMPTYARG ) IMPL_LINK( OutlineView, BeginMovingHdl, ::Outliner *, pOutliner ) { - DBG_ASSERT(!mpSelectedParas, "Absatzliste nicht geloescht"); - DBG_ASSERT(!mpOldParaOrder, "Absatzliste nicht geloescht"); - OutlineViewPageChangesGuard aGuard(this); - mpOldParaOrder = new List; - // list of selected title paragraphs - mpSelectedParas = mpOutlinerView[0]->CreateSelectionList(); - Paragraph* pPara = static_cast<Paragraph*>(mpSelectedParas->First()); - while (pPara) + mpOutlinerView[0]->CreateSelectionList(maSelectedParas); + + for (std::vector<Paragraph*>::iterator it = maSelectedParas.begin(); it != maSelectedParas.end();) { - if( !pOutliner->HasParaFlag(pPara, PARAFLAG_ISPAGE) ) - { - mpSelectedParas->Remove(); - pPara = static_cast<Paragraph*>(mpSelectedParas->GetCurObject()); - } + if (!pOutliner->HasParaFlag(*it, PARAFLAG_ISPAGE)) + it = maSelectedParas.erase(it); else - { - pPara = static_cast<Paragraph*>(mpSelectedParas->Next()); - } + ++it; } // select the pages belonging to the paragraphs on level 0 to select sal_uInt16 nPos = 0; sal_uLong nParaPos = 0; - pPara = pOutliner->GetParagraph( 0 ); + Paragraph* pPara = pOutliner->GetParagraph( 0 ); + std::vector<Paragraph*>::const_iterator fiter; while(pPara) { if( pOutliner->HasParaFlag(pPara, PARAFLAG_ISPAGE) ) // one page? { - mpOldParaOrder->Insert(pPara, LIST_APPEND); + maOldParaOrder.push_back(pPara); SdPage* pPage = mpDoc->GetSdPage(nPos, PK_STANDARD); - pPage->SetSelected(sal_False); - if (mpSelectedParas->Seek(pPara)) // selected? - { - pPage->SetSelected(sal_True); - } - nPos++; + + fiter = std::find(maSelectedParas.begin(),maSelectedParas.end(),pPara); + + pPage->SetSelected(fiter != maSelectedParas.end()); + + ++nPos; } pPara = pOutliner->GetParagraph( ++nParaPos ); } @@ -975,12 +964,10 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner ) { OutlineViewPageChangesGuard aGuard(this); - DBG_ASSERT(mpSelectedParas, "keine Absatzliste"); - DBG_ASSERT(mpOldParaOrder, "keine Absatzliste"); DBG_ASSERT( isRecordingUndo(), "sd::OutlineView::EndMovingHdl(), model change without undo?!" ); // look for insertion position via the first paragraph - Paragraph* pSearchIt = (Paragraph*)mpSelectedParas->First(); + Paragraph* pSearchIt = maSelectedParas.empty() ? NULL : *(maSelectedParas.begin()); // look for the first of the selected paragraphs in the new ordering sal_uInt16 nPosNewOrder = 0; @@ -1005,14 +992,22 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner ) else { // look for the predecessor in the old ordering - nPos = (sal_uInt16)mpOldParaOrder->GetPos(pPrev); + std::vector<Paragraph*>::const_iterator it = std::find(maOldParaOrder.begin(), + maOldParaOrder.end(), + pPrev); + + if (it != maOldParaOrder.end()) + nPos = static_cast<sal_uInt16>(it-maOldParaOrder.begin()); + else + nPos = 0xffff; + DBG_ASSERT(nPos != 0xffff, "Absatz nicht gefunden"); } mpDoc->MovePages(nPos); // deselect the pages again - sal_uInt16 nPageCount = (sal_uInt16)mpSelectedParas->Count(); + sal_uInt16 nPageCount = (sal_uInt16)maSelectedParas.size(); while (nPageCount) { SdPage* pPage = mpDoc->GetSdPage(nPosNewOrder, PK_STANDARD); @@ -1023,10 +1018,8 @@ IMPL_LINK( OutlineView, EndMovingHdl, ::Outliner *, pOutliner ) pOutliner->UpdateFields(); - delete mpSelectedParas; - mpSelectedParas = NULL; - delete mpOldParaOrder; - mpOldParaOrder = NULL; + maSelectedParas.clear(); + maOldParaOrder.clear(); InvalidateSlideNumberArea(); @@ -1350,17 +1343,22 @@ SdPage* OutlineView::GetActualPage() { ::sd::Window* pWin = mpOutlineViewShell->GetActiveWindow(); OutlinerView* pActiveView = GetViewByWindow(pWin); - std::auto_ptr<List> pSelList( static_cast< List* >(pActiveView->CreateSelectionList()) ); - SdPage* pCurrent = GetPageForParagraph(static_cast<Paragraph*>(pSelList->First()) ); + std::vector<Paragraph*> aSelList; + pActiveView->CreateSelectionList(aSelList); + + Paragraph *pPar = aSelList.empty() ? NULL : *(aSelList.begin()); + SdPage* pCurrent = GetPageForParagraph(pPar); + DBG_ASSERT( pCurrent || (mpDocSh->GetUndoManager() && static_cast< sd::UndoManager *>(mpDocSh->GetUndoManager())->IsDoing()) || maDragAndDropModelGuard.get(), "sd::OutlineView::GetActualPage(), no current page?" ); + if( pCurrent ) return pCurrent; - else - return mpDoc->GetSdPage( 0, PK_STANDARD ); + + return mpDoc->GetSdPage( 0, PK_STANDARD ); } SdPage* OutlineView::GetPageForParagraph( Paragraph* pPara ) @@ -1378,8 +1376,8 @@ SdPage* OutlineView::GetPageForParagraph( Paragraph* pPara ) if( nPageToSelect < (sal_uInt32)mpDoc->GetSdPageCount( PK_STANDARD ) ) return static_cast< SdPage* >( mpDoc->GetSdPage( (sal_uInt16)nPageToSelect, PK_STANDARD) ); - else - return 0; + + return 0; } Paragraph* OutlineView::GetParagraphForPage( ::Outliner* pOutl, SdPage* pPage ) @@ -1447,26 +1445,22 @@ SfxStyleSheet* OutlineView::GetStyleSheet() const void OutlineView::SetSelectedPages() { // list of selected title paragraphs - List* pSelParas = mpOutlinerView[0]->CreateSelectionList(); - Paragraph* pPara = (Paragraph*) pSelParas->First(); + std::vector<Paragraph*> aSelParas; + mpOutlinerView[0]->CreateSelectionList(aSelParas); - while(pPara) + for (std::vector<Paragraph*>::iterator it = aSelParas.begin(); it != aSelParas.end();) { - if( !mpOutliner->HasParaFlag(pPara, PARAFLAG_ISPAGE) ) - { - pSelParas->Remove(); - pPara = (Paragraph*) pSelParas->GetCurObject(); - } + if (!mpOutliner->HasParaFlag(*it, PARAFLAG_ISPAGE)) + it = aSelParas.erase(it); else - { - pPara = (Paragraph*) pSelParas->Next(); - } + ++it; } // select the pages belonging to the paragraphs on level 0 to select sal_uInt16 nPos = 0; sal_uLong nParaPos = 0; - pPara = mpOutliner->GetParagraph( 0 ); + Paragraph *pPara = mpOutliner->GetParagraph( 0 ); + std::vector<Paragraph*>::const_iterator fiter; while(pPara) { @@ -1475,12 +1469,11 @@ void OutlineView::SetSelectedPages() SdPage* pPage = mpDoc->GetSdPage(nPos, PK_STANDARD); DBG_ASSERT(pPage!=NULL, "Trying to select non-existing page OutlineView::SetSelectedPages()"); - if (pPage != NULL) - { - pPage->SetSelected(sal_False); - if (pSelParas->Seek(pPara)) // selected? - pPage->SetSelected(sal_True); + if (pPage) + { + fiter = std::find(aSelParas.begin(),aSelParas.end(),pPara); + pPage->SetSelected(fiter != aSelParas.end()); } nPos++; diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx index 1fb16798b489..ef0febf94c09 100644 --- a/sd/source/ui/view/viewshe2.cxx +++ b/sd/source/ui/view/viewshe2.cxx @@ -1199,7 +1199,7 @@ void ViewShell::AdaptDefaultsForChart( } catch( const uno::Exception & ) { - OSL_ENSURE( false, "Exception caught in AdaptDefaultsForChart" ); + OSL_FAIL( "Exception caught in AdaptDefaultsForChart" ); } } } diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx b/slideshow/source/engine/activities/activitiesfactory.cxx index 9308d0b80217..c29a385855ce 100644 --- a/slideshow/source/engine/activities/activitiesfactory.cxx +++ b/slideshow/source/engine/activities/activitiesfactory.cxx @@ -661,8 +661,7 @@ AnimationActivitySharedPtr createActivity( catch( ParseError& ) { // parse error, thus no formula - OSL_ENSURE( false, - "createActivity(): Error parsing formula string" ); + OSL_FAIL( "createActivity(): Error parsing formula string" ); } } @@ -728,7 +727,7 @@ AnimationActivitySharedPtr createActivity( } default: - OSL_ENSURE( false, "createActivity(): unexpected case" ); + OSL_FAIL( "createActivity(): unexpected case" ); // FALLTHROUGH intended case animations::AnimationCalcMode::PACED: // FALLTHROUGH intended @@ -796,7 +795,7 @@ AnimationActivitySharedPtr createActivity( } default: - OSL_ENSURE( false, "createActivity(): unexpected case" ); + OSL_FAIL( "createActivity(): unexpected case" ); // FALLTHROUGH intended case animations::AnimationCalcMode::PACED: // FALLTHROUGH intended diff --git a/slideshow/source/engine/activities/interpolation.hxx b/slideshow/source/engine/activities/interpolation.hxx index 12fa27ffb1ea..a8baa1e3832c 100644 --- a/slideshow/source/engine/activities/interpolation.hxx +++ b/slideshow/source/engine/activities/interpolation.hxx @@ -56,8 +56,7 @@ namespace basegfx const sal_Int16& rTo, double ) { - OSL_ENSURE( false, - "lerp<sal_Int16> called" ); + OSL_FAIL( "lerp<sal_Int16> called" ); return rTo; } @@ -66,8 +65,7 @@ namespace basegfx const ::rtl::OUString& rTo, double ) { - OSL_ENSURE( false, - "lerp<::rtl::OUString> called" ); + OSL_FAIL( "lerp<::rtl::OUString> called" ); return rTo; } @@ -76,8 +74,7 @@ namespace basegfx const bool& rTo, double ) { - OSL_ENSURE( false, - "lerp<bool> called" ); + OSL_FAIL( "lerp<bool> called" ); return rTo; } } diff --git a/slideshow/source/engine/activitiesqueue.cxx b/slideshow/source/engine/activitiesqueue.cxx index 673c029e2cbc..cc7b738d0756 100644 --- a/slideshow/source/engine/activitiesqueue.cxx +++ b/slideshow/source/engine/activitiesqueue.cxx @@ -73,7 +73,7 @@ namespace slideshow } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -141,8 +141,7 @@ namespace slideshow // since this will also capture segmentation // violations and the like. In such a case, we // still better let our clients now... - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); } diff --git a/slideshow/source/engine/animationfactory.cxx b/slideshow/source/engine/animationfactory.cxx index 890b42df76ae..b5fda4da99d3 100644 --- a/slideshow/source/engine/animationfactory.cxx +++ b/slideshow/source/engine/animationfactory.cxx @@ -693,7 +693,7 @@ namespace slideshow if( !rAny.hasValue() ) { - OSL_ENSURE( false, "getDefault(): cannot get requested shape property" ); + OSL_FAIL( "getDefault(): cannot get requested shape property" ); OSL_TRACE( "getDefault(): cannot get '%s' shape property", ::rtl::OUStringToOString( rPropertyName, RTL_TEXTENCODING_ASCII_US ).getStr() ); @@ -705,7 +705,7 @@ namespace slideshow if( !(rAny >>= aValue) ) { - OSL_ENSURE( false, "getDefault(): cannot extract requested shape property" ); + OSL_FAIL( "getDefault(): cannot extract requested shape property" ); OSL_TRACE( "getDefault(): cannot extract '%s' shape property", ::rtl::OUStringToOString( rPropertyName, RTL_TEXTENCODING_ASCII_US ).getStr() ); @@ -724,7 +724,7 @@ namespace slideshow if( !rAny.hasValue() ) { - OSL_ENSURE( false, "getDefault(): cannot get requested shape color property" ); + OSL_FAIL( "getDefault(): cannot get requested shape color property" ); OSL_TRACE( "getDefault(): cannot get '%s' shape color property", ::rtl::OUStringToOString( rPropertyName, RTL_TEXTENCODING_ASCII_US ).getStr() ); @@ -736,7 +736,7 @@ namespace slideshow if( !(rAny >>= nValue) ) { - OSL_ENSURE( false, "getDefault(): cannot extract requested shape color property" ); + OSL_FAIL( "getDefault(): cannot extract requested shape color property" ); OSL_TRACE( "getDefault(): cannot extract '%s' shape color property", ::rtl::OUStringToOString( rPropertyName, RTL_TEXTENCODING_ASCII_US ).getStr() ); diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx index 9125cc6bcac5..22c4266ee00c 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.cxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx @@ -217,7 +217,7 @@ bool AnimationBaseNode::init_st() mpActivity = createActivity(); } catch (uno::Exception const&) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString(cppu::getCaughtException()), RTL_TEXTENCODING_UTF8 ) ); // catch and ignore. We later handle empty activities, but for diff --git a/slideshow/source/engine/animationnodes/animationnodefactory.cxx b/slideshow/source/engine/animationnodes/animationnodefactory.cxx index c4a205cf6588..f4ab9343087e 100644 --- a/slideshow/source/engine/animationnodes/animationnodefactory.cxx +++ b/slideshow/source/engine/animationnodes/animationnodefactory.cxx @@ -371,8 +371,7 @@ bool implCreateIteratedNodes( { // will not animate the whole paragraph, when // only the paragraph is animated at all. - OSL_ENSURE( false, - "implCreateIteratedNodes(): Ignoring paragraph iteration for paragraph master" ); + OSL_FAIL( "implCreateIteratedNodes(): Ignoring paragraph iteration for paragraph master" ); } else { @@ -475,7 +474,7 @@ BaseNodeSharedPtr implCreateAnimationNode( switch( xNode->getType() ) { case animations::AnimationNodeType::CUSTOM: - OSL_ENSURE( false, "implCreateAnimationNode(): " + OSL_FAIL( "implCreateAnimationNode(): " "CUSTOM not yet implemented" ); return pCreatedNode; @@ -538,7 +537,7 @@ BaseNodeSharedPtr implCreateAnimationNode( break; default: - OSL_ENSURE( false, "implCreateAnimationNode(): " + OSL_FAIL( "implCreateAnimationNode(): " "invalid AnimationNodeType" ); return pCreatedNode; } @@ -579,7 +578,7 @@ BaseNodeSharedPtr implCreateAnimationNode( NodeCreator aCreator( pCreatedContainer, rContext ); if( !::anim::for_each_childNode( xNode, aCreator ) ) { - OSL_ENSURE( false, "implCreateAnimationNode(): " + OSL_FAIL( "implCreateAnimationNode(): " "child node creation failed" ); return BaseNodeSharedPtr(); } diff --git a/slideshow/source/engine/animationnodes/basecontainernode.cxx b/slideshow/source/engine/animationnodes/basecontainernode.cxx index bd5c9a8868b3..9d513fa367e4 100644 --- a/slideshow/source/engine/animationnodes/basecontainernode.cxx +++ b/slideshow/source/engine/animationnodes/basecontainernode.cxx @@ -133,7 +133,7 @@ bool BaseContainerNode::notifyDeactivatedChild( return false; if (! isChildNode(pChildNode)) { - OSL_ENSURE( false, "unknown notifier!" ); + OSL_FAIL( "unknown notifier!" ); return false; } diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx index e7343857f98b..cc3cd5b6da55 100644 --- a/slideshow/source/engine/animationnodes/basenode.cxx +++ b/slideshow/source/engine/animationnodes/basenode.cxx @@ -218,8 +218,8 @@ const int* getStateTransitionTable( sal_Int16 nRestartMode, default: case animations::AnimationRestart::DEFAULT: // same value: animations::AnimationRestart::INHERIT: - OSL_ENSURE( - false, "getStateTransitionTable(): unexpected case for restart" ); + OSL_FAIL( + "getStateTransitionTable(): unexpected case for restart" ); // FALLTHROUGH intended case animations::AnimationRestart::NEVER: nRestartValue = 0; @@ -238,8 +238,8 @@ const int* getStateTransitionTable( sal_Int16 nRestartMode, case animations::AnimationFill::AUTO: case animations::AnimationFill::DEFAULT: // same value: animations::AnimationFill::INHERIT: - OSL_ENSURE( - false, "getStateTransitionTable(): unexpected case for fill" ); + OSL_FAIL( + "getStateTransitionTable(): unexpected case for fill" ); // FALLTHROUGH intended case animations::AnimationFill::REMOVE: nFillValue = 0; diff --git a/slideshow/source/engine/animationnodes/generateevent.cxx b/slideshow/source/engine/animationnodes/generateevent.cxx index afb9f2bf4aa5..62904feb9d0f 100644 --- a/slideshow/source/engine/animationnodes/generateevent.cxx +++ b/slideshow/source/engine/animationnodes/generateevent.cxx @@ -72,7 +72,7 @@ EventSharedPtr generateEvent( case animations::Timing_INDEFINITE: break; // don't schedule no event case animations::Timing_MEDIA: - OSL_ENSURE( false, "MEDIA timing not yet implemented!" ); + OSL_FAIL( "MEDIA timing not yet implemented!" ); break; default: ENSURE_OR_THROW( false, "unexpected case!" ); @@ -83,7 +83,7 @@ EventSharedPtr generateEvent( // try to extract additional event delay double nDelay2 = 0.0; if (aEvent.Offset.hasValue() && !(aEvent.Offset >>= nDelay2)) { - OSL_ENSURE( false, "offset values apart from DOUBLE not " + OSL_FAIL( "offset values apart from DOUBLE not " "recognized in animations::Event!" ); } @@ -101,10 +101,10 @@ EventSharedPtr generateEvent( // no event at all break; case animations::EventTrigger::ON_BEGIN: - OSL_ENSURE( false, "event trigger ON_BEGIN not yet implemented!" ); + OSL_FAIL( "event trigger ON_BEGIN not yet implemented!" ); break; case animations::EventTrigger::ON_END: - OSL_ENSURE( false, "event trigger ON_END not yet implemented!" ); + OSL_FAIL( "event trigger ON_END not yet implemented!" ); break; case animations::EventTrigger::BEGIN_EVENT: // try to extract XAnimationNode event source @@ -116,7 +116,7 @@ EventSharedPtr generateEvent( pEvent, xNode ); } else { - OSL_ENSURE(false, "could not extract source XAnimationNode " + OSL_FAIL("could not extract source XAnimationNode " "for BEGIN_EVENT!" ); } break; @@ -130,7 +130,7 @@ EventSharedPtr generateEvent( pEvent, xNode ); } else { - OSL_ENSURE( false, "could not extract source XAnimationNode " + OSL_FAIL( "could not extract source XAnimationNode " "for END_EVENT!" ); } break; @@ -146,7 +146,7 @@ EventSharedPtr generateEvent( pEvent, pShape ); } else { - OSL_ENSURE( false, "could not extract source XAnimationNode " + OSL_FAIL( "could not extract source XAnimationNode " "for ON_CLICK!" ); } break; @@ -162,7 +162,7 @@ EventSharedPtr generateEvent( pEvent, pShape ); } else { - OSL_ENSURE( false, "could not extract source XAnimationNode " + OSL_FAIL( "could not extract source XAnimationNode " "for ON_DBL_CLICK!" ); } break; @@ -178,7 +178,7 @@ EventSharedPtr generateEvent( pEvent, pShape ); } else { - OSL_ENSURE( false, "could not extract source XAnimationNode " + OSL_FAIL( "could not extract source XAnimationNode " "for ON_MOUSE_ENTER!" ); } break; @@ -194,12 +194,12 @@ EventSharedPtr generateEvent( pEvent, pShape ); } else { - OSL_ENSURE( false, "could not extract source XAnimationNode " + OSL_FAIL( "could not extract source XAnimationNode " "for ON_MOUSE_LEAVE!" ); } break; case animations::EventTrigger::ON_PREV: - OSL_ENSURE( false, "event trigger ON_PREV not yet implemented, " + OSL_FAIL( "event trigger ON_PREV not yet implemented, " "mapped to ON_NEXT!" ); // FALLTHROUGH intended case animations::EventTrigger::ON_NEXT: @@ -218,17 +218,17 @@ EventSharedPtr generateEvent( pEvent, xNode ); } else { - OSL_ENSURE( false, "could not extract source XAnimationNode " + OSL_FAIL( "could not extract source XAnimationNode " "for ON_STOP_AUDIO!" ); } break; case animations::EventTrigger::REPEAT: - OSL_ENSURE( false, "event trigger REPEAT not yet implemented!" ); + OSL_FAIL( "event trigger REPEAT not yet implemented!" ); break; } } else if (rEventDescription >>= aSequence) { - OSL_ENSURE( false, "sequence of timing primitives " + OSL_FAIL( "sequence of timing primitives " "not yet implemented!" ); } else if (rEventDescription >>= nDelay1) { diff --git a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx index cf7340cd14fc..298900b67d25 100644 --- a/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx +++ b/slideshow/source/engine/animationnodes/sequentialtimecontainer.cxx @@ -52,7 +52,7 @@ void SequentialTimeContainer::activate_st() break; else { // node still UNRESOLVED, no need to deactivate or end... - OSL_ENSURE( false, "### resolving child failed!" ); + OSL_FAIL( "### resolving child failed!" ); } } @@ -94,7 +94,7 @@ void SequentialTimeContainer::skipEffect( "SequentialTimeContainer::deactivate, skipEffect with delay") ); } else - OSL_ENSURE( false, "unknown notifier!" ); + OSL_FAIL( "unknown notifier!" ); } void SequentialTimeContainer::rewindEffect( diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index 54a212746a4a..1d2185cf8495 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -475,7 +475,7 @@ UnoViewSharedPtr EventMultiplexerImpl::findUnoView( boost::cref( xView ), boost::bind( &UnoView::getUnoView, _1 )))) == aEnd ) { - OSL_ENSURE(false, "EventMultiplexer::findUnoView(): unexpected message source" ); + OSL_FAIL("EventMultiplexer::findUnoView(): unexpected message source" ); return UnoViewSharedPtr(); } diff --git a/slideshow/source/engine/eventqueue.cxx b/slideshow/source/engine/eventqueue.cxx index 1c72af8c1628..cc19ede90867 100644 --- a/slideshow/source/engine/eventqueue.cxx +++ b/slideshow/source/engine/eventqueue.cxx @@ -90,7 +90,7 @@ namespace slideshow } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -266,8 +266,7 @@ namespace slideshow // since this will also capture segmentation // violations and the like. In such a case, we // still better let our clients now... - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); } diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx index c98d34afae17..808a9756e17c 100644 --- a/slideshow/source/engine/rehearsetimingsactivity.cxx +++ b/slideshow/source/engine/rehearsetimingsactivity.cxx @@ -197,7 +197,7 @@ RehearseTimingsActivity::~RehearseTimingsActivity() } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/shapes/drawinglayeranimation.cxx b/slideshow/source/engine/shapes/drawinglayeranimation.cxx index ef5ba29fe169..323f16849123 100644 --- a/slideshow/source/engine/shapes/drawinglayeranimation.cxx +++ b/slideshow/source/engine/shapes/drawinglayeranimation.cxx @@ -969,8 +969,7 @@ boost::shared_ptr<Activity> createDrawingLayerAnimActivity( catch( uno::Exception& ) { // translate any error into empty factory product. - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); } diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx index e018c8015b0a..e2492a4ddd3a 100644 --- a/slideshow/source/engine/shapes/drawshape.cxx +++ b/slideshow/source/engine/shapes/drawshape.cxx @@ -174,7 +174,7 @@ namespace slideshow } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -791,7 +791,7 @@ namespace slideshow } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -1101,7 +1101,7 @@ namespace slideshow { if (!maHyperlinkIndices.empty() && maHyperlinkIndices.back().second == -1) { - OSL_ENSURE( false, "### pending FIELD_SEQ_END!" ); + OSL_FAIL( "### pending FIELD_SEQ_END!" ); maHyperlinkIndices.pop_back(); maHyperlinkRegions.pop_back(); } @@ -1133,7 +1133,7 @@ namespace slideshow } if (!maHyperlinkIndices.empty() && maHyperlinkIndices.back().second == -1) { - OSL_ENSURE( false, "### pending FIELD_SEQ_END!" ); + OSL_FAIL( "### pending FIELD_SEQ_END!" ); maHyperlinkIndices.pop_back(); maHyperlinkRegions.pop_back(); } diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx b/slideshow/source/engine/shapes/drawshapesubsetting.cxx index ed4238a538f7..f0ede5bf4bea 100644 --- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx +++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx @@ -639,8 +639,7 @@ namespace slideshow case DocTreeNode::NODETYPE_INVALID: // FALLTHROUGH intended default: - OSL_ENSURE(false, - "DrawShapeSubsetting::mapDocTreeNode(): unexpected node type"); + OSL_FAIL("DrawShapeSubsetting::mapDocTreeNode(): unexpected node type"); return DrawShapeSubsetting::CLASS_NOOP; case DocTreeNode::NODETYPE_LOGICAL_SHAPE: diff --git a/slideshow/source/engine/shapes/externalshapebase.cxx b/slideshow/source/engine/shapes/externalshapebase.cxx index 7874143ca916..25ffa679a789 100644 --- a/slideshow/source/engine/shapes/externalshapebase.cxx +++ b/slideshow/source/engine/shapes/externalshapebase.cxx @@ -123,7 +123,7 @@ namespace slideshow } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index e7dc67f79e0b..5971082a4242 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -99,7 +99,7 @@ bool importShapeGraphic( if(nIndex >= aURL.getLength()) { - OSL_ENSURE( false, "ShapeImporter::importShape(): " + OSL_FAIL( "ShapeImporter::importShape(): " "embedded graphic has no graphic ID" ); return false; } @@ -137,7 +137,7 @@ bool importShapeGraphic( STREAM_READ ) ); if( !pGraphicStream ) { - OSL_ENSURE( false, "ShapeImporter::importShape(): " + OSL_FAIL( "ShapeImporter::importShape(): " "cannot create input stream for graphic" ); return false; } @@ -146,7 +146,7 @@ bool importShapeGraphic( if( GraphicConverter::Import( *pGraphicStream, aTmpGraphic ) != ERRCODE_NONE ) { - OSL_ENSURE( false, "ShapeImporter::importShape(): " + OSL_FAIL( "ShapeImporter::importShape(): " "Failed to import shape graphic from given URL" ); return false; } diff --git a/slideshow/source/engine/shapes/viewappletshape.cxx b/slideshow/source/engine/shapes/viewappletshape.cxx index f22927ddd520..e7e638a632b3 100644 --- a/slideshow/source/engine/shapes/viewappletshape.cxx +++ b/slideshow/source/engine/shapes/viewappletshape.cxx @@ -121,7 +121,7 @@ namespace slideshow } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/shapes/viewbackgroundshape.cxx b/slideshow/source/engine/shapes/viewbackgroundshape.cxx index e8b0930e1940..18f9bc94a956 100644 --- a/slideshow/source/engine/shapes/viewbackgroundshape.cxx +++ b/slideshow/source/engine/shapes/viewbackgroundshape.cxx @@ -198,8 +198,7 @@ namespace slideshow } catch( uno::Exception& ) { - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index 28dbc5f05237..f46ac03cab23 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -115,7 +115,7 @@ namespace slideshow } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -331,8 +331,7 @@ namespace slideshow } catch( uno::Exception& ) { - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); } @@ -491,8 +490,7 @@ namespace slideshow } catch( uno::Exception& ) { - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); } @@ -550,8 +548,7 @@ namespace slideshow } catch( uno::Exception& ) { - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); } diff --git a/slideshow/source/engine/shapesubset.cxx b/slideshow/source/engine/shapesubset.cxx index 0c8ad7319a30..29e635b43404 100644 --- a/slideshow/source/engine/shapesubset.cxx +++ b/slideshow/source/engine/shapesubset.cxx @@ -93,7 +93,7 @@ namespace slideshow } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx index bf05913b56cc..e8d3a3aa23ab 100644 --- a/slideshow/source/engine/slide/layermanager.cxx +++ b/slideshow/source/engine/slide/layermanager.cxx @@ -657,8 +657,7 @@ namespace slideshow virtual void setPriority( const basegfx::B1DRange& /*rRange*/ ) { - OSL_ENSURE( false, - "BitmapView::setPriority(): This method is not supposed to be called!" ); + OSL_FAIL( "BitmapView::setPriority(): This method is not supposed to be called!" ); } virtual ::basegfx::B2DHomMatrix getTransformation() const @@ -668,21 +667,18 @@ namespace slideshow virtual ::basegfx::B2DHomMatrix getSpriteTransformation() const { - OSL_ENSURE( false, - "BitmapView::getSpriteTransformation(): This method is not supposed to be called!" ); + OSL_FAIL( "BitmapView::getSpriteTransformation(): This method is not supposed to be called!" ); return ::basegfx::B2DHomMatrix(); } virtual void setClip( const ::basegfx::B2DPolyPolygon& /*rClip*/ ) { - OSL_ENSURE( false, - "BitmapView::setClip(): This method is not supposed to be called!" ); + OSL_FAIL( "BitmapView::setClip(): This method is not supposed to be called!" ); } virtual bool resize( const ::basegfx::B2DRange& /*rArea*/ ) { - OSL_ENSURE( false, - "BitmapView::resize(): This method is not supposed to be called!" ); + OSL_FAIL( "BitmapView::resize(): This method is not supposed to be called!" ); return false; } @@ -717,8 +713,7 @@ namespace slideshow { // TODO(E1): Might be superfluous. Nowadays, // addViewLayer swallows all errors, anyway. - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/slide/slideanimations.cxx b/slideshow/source/engine/slide/slideanimations.cxx index 92adddce4108..b2b90cda722e 100644 --- a/slideshow/source/engine/slide/slideanimations.cxx +++ b/slideshow/source/engine/slide/slideanimations.cxx @@ -68,7 +68,7 @@ namespace slideshow } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 506bd53fa775..82f0792abd36 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -843,8 +843,7 @@ bool SlideImpl::implPrefetchShow() { if( !maAnimations.importAnimations( mxRootNode ) ) { - OSL_ENSURE( false, - "SlideImpl::implPrefetchShow(): have animation nodes, " + OSL_FAIL( "SlideImpl::implPrefetchShow(): have animation nodes, " "but import animations failed." ); // could not import animation framework, @@ -874,8 +873,7 @@ bool SlideImpl::implPrefetchShow() } catch( uno::Exception& ) { - OSL_ENSURE( - false, + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString(cppu::getCaughtException()), RTL_TEXTENCODING_UTF8 ) ); @@ -1002,8 +1000,7 @@ bool SlideImpl::applyInitialShapeAttributes( } catch( uno::Exception& ) { - OSL_ENSURE( - false, + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString(cppu::getCaughtException()), RTL_TEXTENCODING_UTF8 ) ); @@ -1047,8 +1044,7 @@ bool SlideImpl::applyInitialShapeAttributes( if( !pShape ) { - OSL_ENSURE( false, - "SlideImpl::applyInitialShapeAttributes(): no shape found for given target" ); + OSL_FAIL( "SlideImpl::applyInitialShapeAttributes(): no shape found for given target" ); continue; } @@ -1057,8 +1053,7 @@ bool SlideImpl::applyInitialShapeAttributes( if( !pAttrShape ) { - OSL_ENSURE( false, - "SlideImpl::applyInitialShapeAttributes(): shape found does not " + OSL_FAIL( "SlideImpl::applyInitialShapeAttributes(): shape found does not " "implement AttributableShape interface" ); continue; } @@ -1076,8 +1071,7 @@ bool SlideImpl::applyInitialShapeAttributes( if( !pAttrShape ) { - OSL_ENSURE( false, - "SlideImpl::applyInitialShapeAttributes(): shape found does not " + OSL_FAIL( "SlideImpl::applyInitialShapeAttributes(): shape found does not " "provide a subset for requested paragraph index" ); continue; } @@ -1098,8 +1092,7 @@ bool SlideImpl::applyInitialShapeAttributes( } else { - OSL_ENSURE( false, - "SlideImpl::applyInitialShapeAttributes(): Unexpected " + OSL_FAIL( "SlideImpl::applyInitialShapeAttributes(): Unexpected " "(and unimplemented) property encountered" ); } } @@ -1174,15 +1167,13 @@ bool SlideImpl::loadShapes() catch( ShapeLoadFailedException& ) { // TODO(E2): Error handling. For now, bail out - OSL_ENSURE( false, - "SlideImpl::loadShapes(): caught ShapeLoadFailedException" ); + OSL_FAIL( "SlideImpl::loadShapes(): caught ShapeLoadFailedException" ); return false; } catch( uno::Exception& ) { - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -1219,14 +1210,12 @@ bool SlideImpl::loadShapes() catch( ShapeLoadFailedException& ) { // TODO(E2): Error handling. For now, bail out - OSL_ENSURE( false, - "SlideImpl::loadShapes(): caught ShapeLoadFailedException" ); + OSL_FAIL( "SlideImpl::loadShapes(): caught ShapeLoadFailedException" ); return false; } catch( uno::Exception& ) { - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index 88e3e38425b7..d060f139f0d9 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -550,7 +550,7 @@ namespace slideshow } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/slidebitmap.cxx b/slideshow/source/engine/slidebitmap.cxx index 469843fad659..2f73a3e9dfbc 100644 --- a/slideshow/source/engine/slidebitmap.cxx +++ b/slideshow/source/engine/slidebitmap.cxx @@ -97,8 +97,7 @@ namespace slideshow } catch( uno::Exception& ) { - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index d29dea85d9c7..7ede504abc20 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -1069,7 +1069,7 @@ public: } else { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( rProperty.Name, RTL_TEXTENCODING_UTF8 ).getStr() ); } } @@ -1310,7 +1310,7 @@ sal_Bool SlideShowImpl::startShapeActivity( DBG_TESTSOLARMUTEX(); // TODO(F3): NYI - OSL_ENSURE( false, "not yet implemented!" ); + OSL_FAIL( "not yet implemented!" ); return false; } @@ -1324,7 +1324,7 @@ sal_Bool SlideShowImpl::stopShapeActivity( DBG_TESTSOLARMUTEX(); // TODO(F3): NYI - OSL_ENSURE( false, "not yet implemented!" ); + OSL_FAIL( "not yet implemented!" ); return false; } @@ -2137,8 +2137,7 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout ) } catch( uno::Exception& ) { - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); } diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx index 04f840f4458f..fc632afd3b13 100644 --- a/slideshow/source/engine/slideview.cxx +++ b/slideshow/source/engine/slideview.cxx @@ -792,8 +792,7 @@ SlideView::SlideView( const uno::Reference<presentation::XSlideShowView>& xView, basegfx::B2DVector(aViewTransform.m01, aViewTransform.m11).getLength()) ) { - OSL_ENSURE( false, - "SlideView::SlideView(): Singular matrix!" ); + OSL_FAIL( "SlideView::SlideView(): Singular matrix!" ); canvas::tools::setIdentityAffineMatrix2D(aViewTransform); } @@ -950,8 +949,7 @@ void SlideView::setPriority( const basegfx::B1DRange& /*rRange*/ ) { osl::MutexGuard aGuard( m_aMutex ); - OSL_ENSURE( false, - "SlideView::setPriority() is a NOOP for slide view - " + OSL_FAIL( "SlideView::setPriority() is a NOOP for slide view - " "content will always be shown in the background" ); } @@ -988,8 +986,7 @@ bool SlideView::resize( const ::basegfx::B2DRange& /*rArea*/ ) { osl::MutexGuard aGuard( m_aMutex ); - OSL_ENSURE( false, - "SlideView::resize(): ignored for the View, can't change size " + OSL_FAIL( "SlideView::resize(): ignored for the View, can't change size " "effectively, anyway" ); return false; @@ -1056,8 +1053,7 @@ void SlideView::modified( const lang::EventObject& /*aEvent*/ ) basegfx::B2DVector(aViewTransform.m01, aViewTransform.m11).getLength()) ) { - OSL_ENSURE( false, - "SlideView::modified(): Singular matrix!" ); + OSL_FAIL( "SlideView::modified(): Singular matrix!" ); canvas::tools::setIdentityAffineMatrix2D(aViewTransform); } diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx index 535277285d2a..a49f88d061ba 100644 --- a/slideshow/source/engine/smilfunctionparser.cxx +++ b/slideshow/source/engine/smilfunctionparser.cxx @@ -191,8 +191,7 @@ namespace slideshow { if( !mpContext->mbParseAnimationFunction ) { - OSL_ENSURE( false, - "ValueTFunctor::operator(): variable encountered, but we're not parsing a function here" ); + OSL_FAIL( "ValueTFunctor::operator(): variable encountered, but we're not parsing a function here" ); throw ParseError(); } diff --git a/slideshow/source/engine/soundplayer.cxx b/slideshow/source/engine/soundplayer.cxx index f856dc91d241..fa68c1741528 100644 --- a/slideshow/source/engine/soundplayer.cxx +++ b/slideshow/source/engine/soundplayer.cxx @@ -135,7 +135,7 @@ namespace slideshow dispose(); } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/transitions/shapetransitionfactory.cxx b/slideshow/source/engine/transitions/shapetransitionfactory.cxx index 6d2a43ae7119..3f2ac271f7f7 100644 --- a/slideshow/source/engine/transitions/shapetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/shapetransitionfactory.cxx @@ -126,7 +126,7 @@ ClippingAnimation::~ClippingAnimation() } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -252,8 +252,7 @@ AnimationActivitySharedPtr TransitionFactory::createShapeTransition( { default: case TransitionInfo::TRANSITION_INVALID: - OSL_ENSURE( false, - "TransitionFactory::createShapeTransition(): Invalid transition type. " + OSL_FAIL( "TransitionFactory::createShapeTransition(): Invalid transition type. " "Don't ask me for a 0 TransitionType, have no XTransitionFilter node instead!" ); return AnimationActivitySharedPtr(); @@ -396,8 +395,7 @@ AnimationActivitySharedPtr TransitionFactory::createShapeTransition( "combination encountered", xTransition->getTransition(), xTransition->getSubtype() ); - OSL_ENSURE( - false, + OSL_FAIL( "TransitionFactory::createShapeTransition(): Unknown type/subtype " "combination encountered" ); } diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx index 76996a6098c5..42dc86ac8858 100644 --- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx @@ -729,8 +729,7 @@ NumberAnimationSharedPtr createPushWipeTransition( switch( nTransitionSubType ) { default: - OSL_ENSURE( - false, + OSL_FAIL( "createPushWipeTransition(): Unexpected transition " "subtype for animations::TransitionType::PUSHWIPE " "transitions" ); @@ -821,8 +820,7 @@ NumberAnimationSharedPtr createSlideWipeTransition( switch( nTransitionSubType ) { default: - OSL_ENSURE( - false, + OSL_FAIL( "createSlideWipeTransition(): Unexpected transition " "subtype for animations::TransitionType::SLIDEWIPE " "transitions" ); @@ -1022,8 +1020,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( switch( nTransitionType ) { default: - OSL_ENSURE( - false, + OSL_FAIL( "TransitionFactory::createSlideTransition(): " "Unexpected transition type for " "TRANSITION_SPECIAL transitions" ); @@ -1158,8 +1155,7 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( "Unknown type/subtype (%d/%d) combination encountered", nTransitionType, nTransitionSubType ); - OSL_ENSURE( - false, + OSL_FAIL( "TransitionFactory::createSlideTransition(): " "Unknown type/subtype combination encountered" ); diff --git a/slideshow/source/engine/usereventqueue.cxx b/slideshow/source/engine/usereventqueue.cxx index b1791a47b9a3..c550a982b300 100644 --- a/slideshow/source/engine/usereventqueue.cxx +++ b/slideshow/source/engine/usereventqueue.cxx @@ -687,7 +687,7 @@ UserEventQueue::~UserEventQueue() clear(); } catch (uno::Exception &) { - OSL_ENSURE( false, rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/slideshow/source/engine/waitsymbol.cxx b/slideshow/source/engine/waitsymbol.cxx index 3b834b1d1e60..c96b11f6d4e9 100644 --- a/slideshow/source/engine/waitsymbol.cxx +++ b/slideshow/source/engine/waitsymbol.cxx @@ -148,8 +148,7 @@ void WaitSymbol::viewAdded( const UnoViewSharedPtr& rView ) } catch( uno::Exception& ) { - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); } diff --git a/slideshow/test/demoshow.cxx b/slideshow/test/demoshow.cxx index 68cb0893d531..e9f99967241c 100644 --- a/slideshow/test/demoshow.cxx +++ b/slideshow/test/demoshow.cxx @@ -550,8 +550,7 @@ void DemoApp::Main() } catch( uno::Exception& ) { - OSL_ENSURE( false, - rtl::OUStringToOString( + OSL_FAIL( rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); } |