summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-30 19:35:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-03 08:41:11 +0200
commitd3971ec256450e6783920b46f672048b29719949 (patch)
treef4722d0e2bc321cf71b49b7573cf38640e9b28fc /sd
parentf50bf3c5225b49b3c6f77f882e35305e5dc5ccd3 (diff)
new loplugin:blockblock
Change-Id: I7b68b70fa4c7234e8882f7627026959a596968fd Reviewed-on: https://gerrit.libreoffice.org/43025 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/filter/eppt/pptexanimations.cxx6
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx42
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx126
3 files changed, 84 insertions, 90 deletions
diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx
index 1096019a2ccc..30653a9a02f9 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -1277,10 +1277,8 @@ void AnimationExporter::exportAnimEvent( SvStream& rStrm, const Reference< XAnim
Reference< XEnumeration > xE( xEA->createEnumeration(), UNO_QUERY_THROW );
if ( xE.is() && xE->hasMoreElements() )
{
- {
- Reference< XAnimationNode > xClickNode( xE->nextElement(), UNO_QUERY );
- aAny = xClickNode->getBegin();
- }
+ Reference< XAnimationNode > xClickNode( xE->nextElement(), UNO_QUERY );
+ aAny = xClickNode->getBegin();
}
}
else if ( nFlags & 0x40 )
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 6e4fd747d427..48b01a169b38 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1832,35 +1832,33 @@ void CustomAnimationPane::onAdd()
if( pDescriptor.get() )
{
+ mpCustomAnimationList->SelectAll( false );
+
+ // gather shapes from the selection
+ std::vector< Any >::iterator aIter( aTargets.begin() );
+ const std::vector< Any >::iterator aEnd( aTargets.end() );
+ bool bFirst = true;
+ for( ; aIter != aEnd; ++aIter )
{
- mpCustomAnimationList->SelectAll( false );
+ CustomAnimationEffectPtr pCreated = mpMainSequence->append( pDescriptor, (*aIter), fDuration );
- // gather shapes from the selection
- std::vector< Any >::iterator aIter( aTargets.begin() );
- const std::vector< Any >::iterator aEnd( aTargets.end() );
- bool bFirst = true;
- for( ; aIter != aEnd; ++aIter )
+ // if only one shape with text and no fill or outline is selected, animate only by first level paragraphs
+ if( bHasText && (aTargets.size() == 1) )
{
- CustomAnimationEffectPtr pCreated = mpMainSequence->append( pDescriptor, (*aIter), fDuration );
-
- // if only one shape with text and no fill or outline is selected, animate only by first level paragraphs
- if( bHasText && (aTargets.size() == 1) )
+ Reference< XShape > xShape( (*aIter), UNO_QUERY );
+ if( xShape.is() && !hasVisibleShape( xShape ) )
{
- Reference< XShape > xShape( (*aIter), UNO_QUERY );
- if( xShape.is() && !hasVisibleShape( xShape ) )
- {
- mpMainSequence->createTextGroup( pCreated, 1, -1.0, false, false );
- }
+ mpMainSequence->createTextGroup( pCreated, 1, -1.0, false, false );
}
+ }
- if( bFirst )
- bFirst = false;
- else
- pCreated->setNodeType( EffectNodeType::WITH_PREVIOUS );
+ if( bFirst )
+ bFirst = false;
+ else
+ pCreated->setNodeType( EffectNodeType::WITH_PREVIOUS );
- if( pCreated.get() )
- mpCustomAnimationList->select( pCreated );
- }
+ if( pCreated.get() )
+ mpCustomAnimationList->select( pCreated );
}
}
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index cc129aa487f3..90d75e5871f3 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2704,82 +2704,80 @@ void SAL_CALL SdXImpressDocument::dispose()
{
if( !mbDisposed )
{
- {
- ::SolarMutexGuard aGuard;
+ ::SolarMutexGuard aGuard;
- if( mpDoc )
- {
- EndListening( *mpDoc );
- mpDoc = nullptr;
- }
-
- // Call the base class dispose() before setting the mbDisposed flag
- // to true. The reason for this is that if close() has not yet been
- // called this is done in SfxBaseModel::dispose(). At the end of
- // that dispose() is called again. It is important to forward this
- // second dispose() to the base class, too.
- // As a consequence the following code has to be able to be run twice.
- SfxBaseModel::dispose();
- mbDisposed = true;
-
- uno::Reference< container::XNameAccess > xLinks( mxLinks );
- if( xLinks.is() )
- {
- uno::Reference< lang::XComponent > xComp( xLinks, uno::UNO_QUERY );
- if( xComp.is() )
- xComp->dispose();
+ if( mpDoc )
+ {
+ EndListening( *mpDoc );
+ mpDoc = nullptr;
+ }
- xLinks = nullptr;
- }
+ // Call the base class dispose() before setting the mbDisposed flag
+ // to true. The reason for this is that if close() has not yet been
+ // called this is done in SfxBaseModel::dispose(). At the end of
+ // that dispose() is called again. It is important to forward this
+ // second dispose() to the base class, too.
+ // As a consequence the following code has to be able to be run twice.
+ SfxBaseModel::dispose();
+ mbDisposed = true;
+
+ uno::Reference< container::XNameAccess > xLinks( mxLinks );
+ if( xLinks.is() )
+ {
+ uno::Reference< lang::XComponent > xComp( xLinks, uno::UNO_QUERY );
+ if( xComp.is() )
+ xComp->dispose();
- uno::Reference< drawing::XDrawPages > xDrawPagesAccess( mxDrawPagesAccess );
- if( xDrawPagesAccess.is() )
- {
- uno::Reference< lang::XComponent > xComp( xDrawPagesAccess, uno::UNO_QUERY );
- if( xComp.is() )
- xComp->dispose();
+ xLinks = nullptr;
+ }
- xDrawPagesAccess = nullptr;
- }
+ uno::Reference< drawing::XDrawPages > xDrawPagesAccess( mxDrawPagesAccess );
+ if( xDrawPagesAccess.is() )
+ {
+ uno::Reference< lang::XComponent > xComp( xDrawPagesAccess, uno::UNO_QUERY );
+ if( xComp.is() )
+ xComp->dispose();
- uno::Reference< drawing::XDrawPages > xMasterPagesAccess( mxMasterPagesAccess );
- if( xDrawPagesAccess.is() )
- {
- uno::Reference< lang::XComponent > xComp( xMasterPagesAccess, uno::UNO_QUERY );
- if( xComp.is() )
- xComp->dispose();
+ xDrawPagesAccess = nullptr;
+ }
- xDrawPagesAccess = nullptr;
- }
+ uno::Reference< drawing::XDrawPages > xMasterPagesAccess( mxMasterPagesAccess );
+ if( xDrawPagesAccess.is() )
+ {
+ uno::Reference< lang::XComponent > xComp( xMasterPagesAccess, uno::UNO_QUERY );
+ if( xComp.is() )
+ xComp->dispose();
- uno::Reference< container::XNameAccess > xLayerManager( mxLayerManager );
- if( xLayerManager.is() )
- {
- uno::Reference< lang::XComponent > xComp( xLayerManager, uno::UNO_QUERY );
- if( xComp.is() )
- xComp->dispose();
+ xDrawPagesAccess = nullptr;
+ }
- xLayerManager = nullptr;
- }
+ uno::Reference< container::XNameAccess > xLayerManager( mxLayerManager );
+ if( xLayerManager.is() )
+ {
+ uno::Reference< lang::XComponent > xComp( xLayerManager, uno::UNO_QUERY );
+ if( xComp.is() )
+ xComp->dispose();
- uno::Reference< container::XNameContainer > xCustomPresentationAccess( mxCustomPresentationAccess );
- if( xCustomPresentationAccess.is() )
- {
- uno::Reference< lang::XComponent > xComp( xCustomPresentationAccess, uno::UNO_QUERY );
- if( xComp.is() )
- xComp->dispose();
+ xLayerManager = nullptr;
+ }
- xCustomPresentationAccess = nullptr;
- }
+ uno::Reference< container::XNameContainer > xCustomPresentationAccess( mxCustomPresentationAccess );
+ if( xCustomPresentationAccess.is() )
+ {
+ uno::Reference< lang::XComponent > xComp( xCustomPresentationAccess, uno::UNO_QUERY );
+ if( xComp.is() )
+ xComp->dispose();
- mxDashTable = nullptr;
- mxGradientTable = nullptr;
- mxHatchTable = nullptr;
- mxBitmapTable = nullptr;
- mxTransGradientTable = nullptr;
- mxMarkerTable = nullptr;
- mxDrawingPool = nullptr;
+ xCustomPresentationAccess = nullptr;
}
+
+ mxDashTable = nullptr;
+ mxGradientTable = nullptr;
+ mxHatchTable = nullptr;
+ mxBitmapTable = nullptr;
+ mxTransGradientTable = nullptr;
+ mxMarkerTable = nullptr;
+ mxDrawingPool = nullptr;
}
}