diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-03-31 12:17:55 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2018-03-31 13:25:28 +0200 |
commit | 0d06d1d16775fde3b0b34f3374907e07cbba763d (patch) | |
tree | bd74c0df75afe158c8ae9a67dd1c41d2cd2239eb /oox/source/ppt/presentationfragmenthandler.cxx | |
parent | 67c04cecc86f4a2e11da3b1fd982940a526cb6cb (diff) |
Use for-range loops in oox (part2)
Change-Id: I7cbeb67a1adcdb9b0003e22b61789a882fc336c9
Reviewed-on: https://gerrit.libreoffice.org/52182
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'oox/source/ppt/presentationfragmenthandler.cxx')
-rw-r--r-- | oox/source/ppt/presentationfragmenthandler.cxx | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index a874c73099b5..9b6a35c804ee 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -85,13 +85,13 @@ PresentationFragmentHandler::PresentationFragmentHandler(XmlFilterBase& rFilter, , mpTextListStyle( new TextListStyle ) , mbCommentAuthorsRead(false) { + // TODO JNA Typo TextParagraphPropertiesVector& rParagraphDefaulsVector( mpTextListStyle->getListStyle() ); - TextParagraphPropertiesVector::iterator aParagraphDefaultIter( rParagraphDefaulsVector.begin() ); - while( aParagraphDefaultIter != rParagraphDefaulsVector.end() ) + for (auto const& elem : rParagraphDefaulsVector) { // ppt is having zero bottom margin per default, whereas OOo is 0,5cm, // so this attribute needs to be set always - (*aParagraphDefaultIter++)->getParaBottomMargin() = TextSpacing( 0 ); + elem->getParaBottomMargin() = TextSpacing( 0 ); } } @@ -105,14 +105,13 @@ void ResolveTextFields( XmlFilterBase const & rFilter ) if ( !rTextFields.empty() ) { Reference< frame::XModel > xModel( rFilter.getModel() ); - oox::core::TextFieldStack::const_iterator aIter( rTextFields.begin() ); - while( aIter != rTextFields.end() ) + for (auto const& textField : rTextFields) { const OUString sURL = "URL"; Reference< drawing::XDrawPagesSupplier > xDPS( xModel, uno::UNO_QUERY_THROW ); Reference< drawing::XDrawPages > xDrawPages( xDPS->getDrawPages(), uno::UNO_QUERY_THROW ); - const oox::core::TextField& rTextField( *aIter++ ); + const oox::core::TextField& rTextField( textField ); Reference< XPropertySet > xPropSet( rTextField.xTextField, UNO_QUERY ); Reference< XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); if ( xPropSetInfo->hasPropertyByName( sURL ) ) @@ -257,15 +256,13 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage { // check if the corresponding masterpage+layout has already been imported std::vector< SlidePersistPtr >& rMasterPages( rFilter.getMasterPages() ); - std::vector< SlidePersistPtr >::iterator aIter( rMasterPages.begin() ); - while( aIter != rMasterPages.end() ) + for (auto const& masterPage : rMasterPages) { - if ( ( (*aIter)->getPath() == aMasterFragmentPath ) && ( (*aIter)->getLayoutPath() == aLayoutFragmentPath ) ) + if ( ( masterPage->getPath() == aMasterFragmentPath ) && ( masterPage->getLayoutPath() == aLayoutFragmentPath ) ) { - pMasterPersistPtr = *aIter; + pMasterPersistPtr = masterPage; break; } - ++aIter; } if ( !pMasterPersistPtr.get() ) @@ -471,9 +468,7 @@ void PresentationFragmentHandler::finalizeImport() } StringRangeEnumerator aRangeEnumerator( aPageRange, 0, nPageCount - 1 ); - StringRangeEnumerator::Iterator aIter = aRangeEnumerator.begin(); - StringRangeEnumerator::Iterator aEnd = aRangeEnumerator.end(); - if (aIter!=aEnd) + if (aRangeEnumerator.size()) { // todo: localized progress bar text const Reference< task::XStatusIndicator >& rxStatusIndicator( getFilter().getStatusIndicator() ); @@ -483,14 +478,13 @@ void PresentationFragmentHandler::finalizeImport() try { int nPagesImported = 0; - while (aIter!=aEnd) + for (auto const& elem : aRangeEnumerator) { if ( rxStatusIndicator.is() ) rxStatusIndicator->setValue((nPagesImported * 10000) / aRangeEnumerator.size()); - importSlide(*aIter, !nPagesImported, bImportNotesPages); + importSlide(elem, !nPagesImported, bImportNotesPages); nPagesImported++; - ++aIter; } ResolveTextFields( rFilter ); } |