Kaydet (Commit) 5a341e12 authored tarafından Julien Nabet's avatar Julien Nabet

Use for-range loops in drawinglayer and dtrans

Change-Id: I4d3368e2ffa4d98c04d69b8f5ef485558d812fda
Reviewed-on: https://gerrit.libreoffice.org/51047Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst e9171066
......@@ -99,9 +99,9 @@ namespace drawinglayer
if(getPositions().size())
{
// get the basic range from the position vector
for(std::vector< basegfx::B2DPoint >::const_iterator aIter(getPositions().begin()), aEnd(getPositions().end()); aIter != aEnd; ++aIter)
for (auto const& pos : getPositions())
{
aRetval.expand(*aIter);
aRetval.expand(pos);
}
if(!getMarker().IsEmpty())
......
......@@ -58,9 +58,9 @@ namespace drawinglayer
basegfx::B2DRange aNewRange;
// get the basic range from the position vector
for(std::vector< basegfx::B2DPoint >::const_iterator aIter(getPositions().begin()), aEnd(getPositions().end()); aIter != aEnd; ++aIter)
for (auto const& pos : getPositions())
{
aNewRange.expand(*aIter);
aNewRange.expand(pos);
}
// assign to buffered value
......
......@@ -235,10 +235,9 @@ namespace drawinglayer
const basegfx::B2DVector aPixelVector(maCurrentTransformation * basegfx::B2DVector(1.0, 0.0));
const double fPixelVectorFactor(aPixelVector.getLength());
for(std::vector< double >::const_iterator aStart(rTextCandidate.getDXArray().begin());
aStart != rTextCandidate.getDXArray().end(); ++aStart)
for (auto const& elem : rTextCandidate.getDXArray())
{
aTransformedDXArray.push_back(basegfx::fround((*aStart) * fPixelVectorFactor));
aTransformedDXArray.push_back(basegfx::fround(elem * fPixelVectorFactor));
}
}
......@@ -921,9 +920,9 @@ namespace drawinglayer
mpOutputDevice->EnableMapMode(false);
for(std::vector< basegfx::B2DPoint >::const_iterator aIter(rPositions.begin()); aIter != rPositions.end(); ++aIter)
for (auto const& pos : rPositions)
{
const basegfx::B2DPoint aDiscreteTopLeft((maCurrentTransformation * (*aIter)) - aDiscreteHalfSize);
const basegfx::B2DPoint aDiscreteTopLeft((maCurrentTransformation * pos) - aDiscreteHalfSize);
const Point aDiscretePoint(basegfx::fround(aDiscreteTopLeft.getX()), basegfx::fround(aDiscreteTopLeft.getY()));
mpOutputDevice->DrawBitmapEx(aDiscretePoint + aOrigin, rMarker);
......@@ -941,9 +940,9 @@ namespace drawinglayer
const basegfx::BColor aRGBColor(maBColorModifierStack.getModifiedColor(rPointArrayCandidate.getRGBColor()));
const Color aVCLColor(aRGBColor);
for(std::vector< basegfx::B2DPoint >::const_iterator aIter(rPositions.begin()); aIter != rPositions.end(); ++aIter)
for (auto const& pos : rPositions)
{
const basegfx::B2DPoint aViewPosition(maCurrentTransformation * (*aIter));
const basegfx::B2DPoint aViewPosition(maCurrentTransformation * pos);
const Point aPos(basegfx::fround(aViewPosition.getX()), basegfx::fround(aViewPosition.getY()));
mpOutputDevice->DrawPixel(aPos, aVCLColor);
......
......@@ -157,12 +157,9 @@ void SAL_CALL ClipboardManager::dispose()
aGuard2.clear();
// dispose all clipboards still in list
ClipboardMap::iterator iter = aCopy.begin();
ClipboardMap::iterator imax = aCopy.end();
for (; iter != imax; ++iter)
for (auto const& elem : aCopy)
{
Reference< XComponent > xComponent(iter->second, UNO_QUERY);
Reference< XComponent > xComponent(elem.second, UNO_QUERY);
if (xComponent.is())
{
try
......
......@@ -347,10 +347,9 @@ size_t CalcSizeForStringListBuffer(const FileList_t& fileList)
return 0;
size_t size = 1; // one for the very final '\0'
FileList_t::const_iterator iter_end = fileList.end();
for (FileList_t::const_iterator iter = fileList.begin(); iter != iter_end; ++iter)
for (auto const& elem : fileList)
{
size += iter->length() + 1; // length including terminating '\0'
size += elem.length() + 1; // length including terminating '\0'
}
return (size * sizeof(FileList_t::value_type::value_type));
}
......@@ -366,12 +365,10 @@ ByteSequence_t FileListToByteSequence(const FileList_t& fileList)
wchar_t* p = reinterpret_cast<wchar_t*>(bseq.getArray());
ZeroMemory(p, size);
FileList_t::const_iterator iter;
FileList_t::const_iterator iter_end = fileList.end();
for (iter = fileList.begin(); iter != iter_end; ++iter)
for (auto const& elem : fileList)
{
wcsncpy(p, iter->c_str(), iter->length());
p += (iter->length() + 1);
wcsncpy(p, elem.c_str(), elem.length());
p += (elem.length() + 1);
}
}
return bseq;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment