summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/animate.cxx46
-rw-r--r--vcl/source/gdi/gdimtf.cxx4
-rw-r--r--vcl/source/gdi/octree.cxx12
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx6
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx18
-rw-r--r--vcl/source/gdi/print.cxx18
-rw-r--r--vcl/source/gdi/print3.cxx6
7 files changed, 53 insertions, 57 deletions
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index f540d5a43b60..a6eb4300334e 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -84,8 +84,8 @@ Animation::Animation( const Animation& rAnimation ) :
mbIsWaiting ( rAnimation.mbIsWaiting )
{
- for( size_t i = 0, nCount = rAnimation.maList.size(); i < nCount; i++ )
- maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) );
+ for(const AnimationBitmap* i : rAnimation.maList)
+ maList.push_back( new AnimationBitmap( *i ) );
maTimer.SetTimeoutHdl( LINK( this, Animation, ImplTimeoutHdl ) );
mnLoops = mbLoopTerminated ? 0 : mnLoopCount;
@@ -97,19 +97,19 @@ Animation::~Animation()
if( mbIsInAnimation )
Stop();
- for( size_t i = 0, n = maList.size(); i < n; ++i )
- delete maList[ i ];
+ for(AnimationBitmap* i : maList)
+ delete i;
- for( size_t i = 0, n = maViewList.size(); i < n; ++i )
- delete maViewList[ i ];
+ for(ImplAnimView* i : maViewList)
+ delete i;
}
Animation& Animation::operator=( const Animation& rAnimation )
{
Clear();
- for( size_t i = 0, nCount = rAnimation.maList.size(); i < nCount; i++ )
- maList.push_back( new AnimationBitmap( *rAnimation.maList[ i ] ) );
+ for(const AnimationBitmap* i : rAnimation.maList)
+ maList.push_back( new AnimationBitmap( *i ) );
maGlobalSize = rAnimation.maGlobalSize;
maBitmapEx = rAnimation.maBitmapEx;
@@ -156,12 +156,12 @@ void Animation::Clear()
maGlobalSize = Size();
maBitmapEx.SetEmpty();
- for( size_t i = 0, n = maList.size(); i < n; ++i )
- delete maList[ i ];
+ for(AnimationBitmap* i : maList)
+ delete i;
maList.clear();
- for( size_t i = 0, n = maViewList.size(); i < n; ++i )
- delete maViewList[ i ];
+ for(ImplAnimView* i : maViewList)
+ delete i;
maViewList.clear();
}
@@ -175,10 +175,8 @@ bool Animation::IsTransparent() const
// we need to be transparent, in order to be displayed correctly
// as the application (?) does not invalidate on non-transparent
// graphics due to performance reasons.
- for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
+ for(const AnimationBitmap* pAnimBmp : maList)
{
- const AnimationBitmap* pAnimBmp = maList[ i ];
-
if( DISPOSE_BACK == pAnimBmp->eDisposal
&& Rectangle( pAnimBmp->aPosPix, pAnimBmp->aSizePix ) != aRect
)
@@ -198,9 +196,8 @@ sal_uLong Animation::GetSizeBytes() const
{
sal_uLong nSizeBytes = GetBitmapEx().GetSizeBytes();
- for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
+ for(const AnimationBitmap* pAnimBmp : maList)
{
- const AnimationBitmap* pAnimBmp = maList[ i ];
nSizeBytes += pAnimBmp->aBmpEx.GetSizeBytes();
}
@@ -225,9 +222,9 @@ BitmapChecksum Animation::GetChecksum() const
UInt32ToSVBT32( (long) meCycleMode, aBT32 );
nCrc = vcl_get_checksum( nCrc, aBT32, 4 );
- for( size_t i = 0, nCount = maList.size(); i < nCount; i++ )
+ for(const AnimationBitmap* i : maList)
{
- BCToBCOA( maList[ i ]->GetChecksum(), aBCOA );
+ BCToBCOA( i->GetChecksum(), aBCOA );
nCrc = vcl_get_checksum( nCrc, aBCOA, BITMAP_CHECKSUM_SIZE );
}
@@ -366,15 +363,14 @@ IMPL_LINK_NOARG_TYPED(Animation, ImplTimeoutHdl, Timer *, void)
if( maNotifyLink.IsSet() )
{
// create AInfo-List
- for( size_t i = 0, n = maViewList.size(); i < n; ++i )
- aAInfoList.push_back( maViewList[ i ]->createAInfo() );
+ for(ImplAnimView* i : maViewList)
+ aAInfoList.push_back( i->createAInfo() );
maNotifyLink.Call( this );
// set view state from AInfo structure
- for( size_t i = 0, n = aAInfoList.size(); i < n; ++i )
+ for(AInfo* pAInfo : aAInfoList)
{
- AInfo* pAInfo = aAInfoList[ i ];
if( !pAInfo->pViewData )
{
pView = new ImplAnimView( this, pAInfo->pOutDev,
@@ -390,8 +386,8 @@ IMPL_LINK_NOARG_TYPED(Animation, ImplTimeoutHdl, Timer *, void)
}
// delete AInfo structures
- for( size_t i = 0, n = aAInfoList.size(); i < n; ++i )
- delete aAInfoList[ i ];
+ for(AInfo* i : aAInfoList)
+ delete i;
aAInfoList.clear();
// delete all unmarked views and reset marked state
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index dad97c76d165..9185ded909c5 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -257,8 +257,8 @@ void GDIMetaFile::Clear()
if( m_bRecord )
Stop();
- for( size_t i = 0, n = m_aList.size(); i < n; ++i )
- m_aList[ i ]->Delete();
+ for(MetaAction* i : m_aList)
+ i->Delete();
m_aList.clear();
}
diff --git a/vcl/source/gdi/octree.cxx b/vcl/source/gdi/octree.cxx
index bfc96cd46477..e67f1152b165 100644
--- a/vcl/source/gdi/octree.cxx
+++ b/vcl/source/gdi/octree.cxx
@@ -115,10 +115,10 @@ void Octree::ImplCreateOctree()
void Octree::ImplDeleteOctree( NODE** ppNode )
{
- for ( sal_uLong i = 0UL; i < 8UL; i++ )
+ for (OctreeNode* i : (*ppNode)->pChild)
{
- if ( (*ppNode)->pChild[ i ] )
- ImplDeleteOctree( &(*ppNode)->pChild[ i ] );
+ if ( i )
+ ImplDeleteOctree( &i );
}
pNodeCache->ImplReleaseNode( *ppNode );
@@ -209,9 +209,9 @@ void Octree::CreatePalette( NODE* pNode )
(sal_uInt8) ( (double) pNode->nGreen / pNode->nCount ),
(sal_uInt8) ( (double) pNode->nBlue / pNode->nCount ) );
}
- else for( sal_uLong i = 0UL; i < 8UL; i++ )
- if( pNode->pChild[ i ] )
- CreatePalette( pNode->pChild[ i ] );
+ else for(OctreeNode* i : pNode->pChild)
+ if( i )
+ CreatePalette( i );
}
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index a0cab66b76a6..03ed698222b0 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -821,11 +821,11 @@ bool PDFExtOutDevData::HasAdequateCompression( const Graphic &rGraphic,
{ 80, 1500 }, { 75, 1700 }
};
sal_Int32 nTargetRatio = 10000;
- for ( size_t i = 0 ; i < SAL_N_ELEMENTS( aRatios ); ++i )
+ for (auto & rRatio : aRatios)
{
- if ( mnCompressionQuality > aRatios[i].mnQuality )
+ if ( mnCompressionQuality > rRatio.mnQuality )
break;
- nTargetRatio = aRatios[i].mnRatio;
+ nTargetRatio = rRatio.mnRatio;
}
return nCurrentRatio > nTargetRatio;
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index c7a177ced98c..f42f4ef76bc2 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1352,10 +1352,10 @@ bool PDFWriterImpl::PDFPage::emit(sal_Int32 nParentObject )
unsigned int nStreamObjects = m_aStreamObjects.size();
if( nStreamObjects > 1 )
aLine.append( '[' );
- for( size_t i = 0; i < m_aStreamObjects.size(); i++ )
+ for(sal_Int32 i : m_aStreamObjects)
{
aLine.append( ' ' );
- aLine.append( m_aStreamObjects[i] );
+ aLine.append( i );
aLine.append( " 0 R" );
}
if( nStreamObjects > 1 )
@@ -3041,7 +3041,7 @@ static bool getPfbSegmentLengths( const unsigned char* pFontBytes, int nByteLen,
const unsigned char* pPtr = pFontBytes;
const unsigned char* pEnd = pFontBytes + nByteLen;
- for( int i = 0; i < 3; ++i) {
+ for(int & rSegmentLength : rSegmentLengths) {
// read segment1 header
if( pPtr+6 >= pEnd )
return false;
@@ -3050,7 +3050,7 @@ static bool getPfbSegmentLengths( const unsigned char* pFontBytes, int nByteLen,
const int nLen = (pPtr[5]<<24) + (pPtr[4]<<16) + (pPtr[3]<<8) + pPtr[2];
if( nLen <= 0)
return false;
- rSegmentLengths[i] = nLen;
+ rSegmentLength = nLen;
pPtr += nLen + 6;
}
@@ -8013,8 +8013,8 @@ bool PDFWriterImpl::emitTrailer()
{
sal_uInt8 nMD5Sum[ RTL_DIGEST_LENGTH_MD5 ];
rtl_digest_getMD5( m_aDocDigest, nMD5Sum, sizeof(nMD5Sum) );
- for( unsigned int i = 0; i < RTL_DIGEST_LENGTH_MD5; i++ )
- appendHex( nMD5Sum[i], aDocChecksum );
+ for(sal_uInt8 i : nMD5Sum)
+ appendHex( i, aDocChecksum );
}
// document id set in setDocInfo method
// emit trailer
@@ -8063,12 +8063,12 @@ bool PDFWriterImpl::emitTrailer()
if( m_aAdditionalStreams.size() > 0 )
{
aLine.append( "/AdditionalStreams [" );
- for( size_t i = 0; i < m_aAdditionalStreams.size(); i++ )
+ for(const PDFAddStream & rAdditionalStream : m_aAdditionalStreams)
{
aLine.append( "/" );
- appendName( m_aAdditionalStreams[i].m_aMimeType, aLine );
+ appendName( rAdditionalStream.m_aMimeType, aLine );
aLine.append( " " );
- aLine.append( m_aAdditionalStreams[i].m_nStreamObject );
+ aLine.append( rAdditionalStream.m_nStreamObject );
aLine.append( " 0 R\n" );
}
aLine.append( "]\n" );
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 4c451817dc17..8c267dbb5a5d 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -376,10 +376,10 @@ SalPrinterQueueInfo::~SalPrinterQueueInfo()
ImplPrnQueueList::~ImplPrnQueueList()
{
ImplSVData* pSVData = ImplGetSVData();
- for( size_t i = 0; i < m_aQueueInfos.size(); i++ )
+ for(ImplPrnQueueData & rQueueInfo : m_aQueueInfos)
{
- delete m_aQueueInfos[i].mpQueueInfo;
- pSVData->mpDefInst->DeletePrinterQueueInfo( m_aQueueInfos[i].mpSalQueueInfo );
+ delete rQueueInfo.mpQueueInfo;
+ pSVData->mpDefInst->DeletePrinterQueueInfo( rQueueInfo.mpSalQueueInfo );
}
}
@@ -850,19 +850,19 @@ SalPrinterQueueInfo* Printer::ImplGetQueueInfo( const OUString& rPrinterName,
return pInfo->mpSalQueueInfo;
// then search case insensitive
- for( size_t i = 0; i < pPrnList->m_aQueueInfos.size(); i++ )
+ for(ImplPrnQueueData & rQueueInfo : pPrnList->m_aQueueInfos)
{
- if( pPrnList->m_aQueueInfos[i].mpSalQueueInfo->maPrinterName.equalsIgnoreAsciiCase( rPrinterName ) )
- return pPrnList->m_aQueueInfos[i].mpSalQueueInfo;
+ if( rQueueInfo.mpSalQueueInfo->maPrinterName.equalsIgnoreAsciiCase( rPrinterName ) )
+ return rQueueInfo.mpSalQueueInfo;
}
// then search for driver name
if ( pDriver )
{
- for( size_t i = 0; i < pPrnList->m_aQueueInfos.size(); i++ )
+ for(ImplPrnQueueData & rQueueInfo : pPrnList->m_aQueueInfos)
{
- if( pPrnList->m_aQueueInfos[i].mpSalQueueInfo->maDriver == *pDriver )
- return pPrnList->m_aQueueInfos[i].mpSalQueueInfo;
+ if( rQueueInfo.mpSalQueueInfo->maDriver == *pDriver )
+ return rQueueInfo.mpSalQueueInfo;
}
}
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index f20da6825f54..bb8081e54320 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1387,10 +1387,10 @@ css::uno::Sequence< css::beans::PropertyValue > PrinterController::getJobPropert
for( int i = 0; i < i_rMergeList.getLength(); i++ )
aResult[i] = i_rMergeList[i];
int nCur = i_rMergeList.getLength();
- for( size_t i = 0; i < mpImplData->maUIProperties.size(); i++ )
+ for(css::beans::PropertyValue & rPropVal : mpImplData->maUIProperties)
{
- if( aMergeSet.find( mpImplData->maUIProperties[i].Name ) == aMergeSet.end() )
- aResult[nCur++] = mpImplData->maUIProperties[i];
+ if( aMergeSet.find( rPropVal.Name ) == aMergeSet.end() )
+ aResult[nCur++] = rPropVal;
}
// append IsFirstPage
if( aMergeSet.find( OUString( "IsFirstPage" ) ) == aMergeSet.end() )