diff options
-rw-r--r-- | sfx2/source/doc/doctempl.cxx | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index 4c09b9543b82..3e40d2c3ff36 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -1136,37 +1136,29 @@ bool SfxDocumentTemplates::GetLogicNames aFullPath.SetURL( rPath ); const OUString aPath( aFullPath.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); - RegionData_Impl *pData = nullptr; - DocTempl_EntryData_Impl *pEntry = nullptr; - bool bFound = false; - const sal_uInt16 nCount = GetRegionCount(); - for ( sal_uInt16 i=0; !bFound && (i<nCount); i++ ) + for ( sal_uInt16 i=0; i<nCount; ++i ) { - pData = pImp->GetRegion( i ); + RegionData_Impl *pData = pImp->GetRegion( i ); if ( pData ) { - sal_uInt16 nChildCount = pData->GetCount(); + const sal_uInt16 nChildCount = pData->GetCount(); - for ( sal_uInt16 j=0; !bFound && (j<nChildCount); j++ ) + for ( sal_uInt16 j=0; j<nChildCount; ++j ) { - pEntry = pData->GetEntry( j ); + DocTempl_EntryData_Impl *pEntry = pData->GetEntry( j ); if ( pEntry && pEntry->GetTargetURL() == aPath ) { - bFound = true; + rRegion = pData->GetTitle(); + rName = pEntry->GetTitle(); + return true; } } } } - if ( bFound ) - { - rRegion = pData->GetTitle(); - rName = pEntry->GetTitle(); - } - - return bFound; + return false; } |