Kaydet (Commit) 3d14fb1e authored tarafından Julien Nabet's avatar Julien Nabet

Use for-range loops in lotuswordpro

Change-Id: Ib14bc1f00914253f000a2bb9c3f780b04fdd126c
Reviewed-on: https://gerrit.libreoffice.org/52125Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 932c9065
...@@ -127,11 +127,10 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, LwpBulletOverrid ...@@ -127,11 +127,10 @@ OUString LwpBulletStyleMgr::RegisterBulletStyle(LwpPara* pPara, LwpBulletOverrid
std::shared_ptr<LwpBulletOverride> pBulletOver(pBullOver->clone()); std::shared_ptr<LwpBulletOverride> pBulletOver(pBullOver->clone());
sal_uInt16 nNameIndex = 0; sal_uInt16 nNameIndex = 0;
std::vector <OverridePair>::iterator iter; for (auto const& vIDsPair : m_vIDsPairList)
for(iter = m_vIDsPairList.begin(); iter != m_vIDsPairList.end(); ++iter)
{ {
if (iter->first->GetSilverBullet() == aBulletID && iter->second == aIndentID if (vIDsPair.first->GetSilverBullet() == aBulletID && vIDsPair.second == aIndentID
&& iter->first->IsRightAligned() == pBullOver->IsRightAligned()) && vIDsPair.first->IsRightAligned() == pBullOver->IsRightAligned())
{ {
return m_vStyleNameList[nNameIndex]; return m_vStyleNameList[nNameIndex];
} }
......
...@@ -108,8 +108,7 @@ void LwpChangeMgr::AddChangeFrib(LwpFrib* pFrib) ...@@ -108,8 +108,7 @@ void LwpChangeMgr::AddChangeFrib(LwpFrib* pFrib)
OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib) OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib)
{ {
std::map<LwpFrib*,OUString>::iterator iter; auto iter = m_pFribMap->find(pFrib);
iter = m_pFribMap->find(pFrib);
if (iter == m_pFribMap->end()) if (iter == m_pFribMap->end())
return OUString(); return OUString();
else else
...@@ -118,41 +117,38 @@ OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib) ...@@ -118,41 +117,38 @@ OUString LwpChangeMgr::GetChangeID(LwpFrib* pFrib)
void LwpChangeMgr::ConvertAllChange(IXFStream* pStream) void LwpChangeMgr::ConvertAllChange(IXFStream* pStream)
{ {
std::map<LwpFrib*,OUString>::iterator iter; for (auto const& docFrib : m_DocFribMap)
for (iter=m_DocFribMap.begin();iter !=m_DocFribMap.end();++iter)
{ {
if (iter->first->GetRevisionType() == LwpFrib::REV_INSERT) if (docFrib.first->GetRevisionType() == LwpFrib::REV_INSERT)
{ {
XFChangeInsert* pInsert = new XFChangeInsert; XFChangeInsert* pInsert = new XFChangeInsert;
pInsert->SetChangeID(iter->second); pInsert->SetChangeID(docFrib.second);
pInsert->SetEditor(iter->first->GetEditor()); pInsert->SetEditor(docFrib.first->GetEditor());
m_ChangeList.push_back(pInsert); m_ChangeList.push_back(pInsert);
} }
else if (iter->first->GetRevisionType() == LwpFrib::REV_DELETE) else if (docFrib.first->GetRevisionType() == LwpFrib::REV_DELETE)
{ {
XFChangeDelete* pDelete = new XFChangeDelete; XFChangeDelete* pDelete = new XFChangeDelete;
pDelete->SetChangeID(iter->second); pDelete->SetChangeID(docFrib.second);
pDelete->SetEditor(iter->first->GetEditor()); pDelete->SetEditor(docFrib.first->GetEditor());
m_ChangeList.push_back(pDelete); m_ChangeList.push_back(pDelete);
} }
} }
std::vector<XFChangeRegion*>::iterator iter1;
pStream->GetAttrList()->Clear(); pStream->GetAttrList()->Clear();
if (m_ChangeList.empty()) if (m_ChangeList.empty())
return; return;
// Add for disable change tracking // Add for disable change tracking
pStream->GetAttrList()->AddAttribute( "text:track-changes","false"); pStream->GetAttrList()->AddAttribute( "text:track-changes","false");
pStream->StartElement( "text:tracked-changes" ); pStream->StartElement( "text:tracked-changes" );
for (iter1=m_ChangeList.begin();iter1 !=m_ChangeList.end();++iter1) for (auto const& elem : m_ChangeList)
(*iter1)->ToXml(pStream); elem->ToXml(pStream);
pStream->EndElement("text:tracked-changes"); pStream->EndElement("text:tracked-changes");
for (iter1=m_ChangeList.begin();iter1 !=m_ChangeList.end();++iter1) for (auto const& elem : m_ChangeList)
{ {
delete *iter1; delete elem;
*iter1=nullptr;
} }
m_ChangeList.clear(); m_ChangeList.clear();
} }
...@@ -169,23 +165,22 @@ void LwpChangeMgr::SetHeadFootFribMap(bool bFlag) ...@@ -169,23 +165,22 @@ void LwpChangeMgr::SetHeadFootFribMap(bool bFlag)
void LwpChangeMgr::SetHeadFootChange(XFContentContainer* pCont) void LwpChangeMgr::SetHeadFootChange(XFContentContainer* pCont)
{ {
std::map<LwpFrib*,OUString>::iterator iter;
XFChangeList* pChangeList = new XFChangeList; XFChangeList* pChangeList = new XFChangeList;
for (iter=m_HeadFootFribMap.begin();iter !=m_HeadFootFribMap.end();++iter) for (auto const& headFootFrib : m_HeadFootFribMap)
{ {
if (iter->first->GetRevisionType() == LwpFrib::REV_INSERT) if (headFootFrib.first->GetRevisionType() == LwpFrib::REV_INSERT)
{ {
XFChangeInsert* pInsert = new XFChangeInsert; XFChangeInsert* pInsert = new XFChangeInsert;
pInsert->SetChangeID(iter->second); pInsert->SetChangeID(headFootFrib.second);
pInsert->SetEditor(iter->first->GetEditor()); pInsert->SetEditor(headFootFrib.first->GetEditor());
pChangeList->Add(pInsert); pChangeList->Add(pInsert);
} }
else if (iter->first->GetRevisionType() == LwpFrib::REV_DELETE) else if (headFootFrib.first->GetRevisionType() == LwpFrib::REV_DELETE)
{ {
XFChangeDelete* pDelete = new XFChangeDelete; XFChangeDelete* pDelete = new XFChangeDelete;
pDelete->SetChangeID(iter->second); pDelete->SetChangeID(headFootFrib.second);
pDelete->SetEditor(iter->first->GetEditor()); pDelete->SetEditor(headFootFrib.first->GetEditor());
pChangeList->Add(pDelete); pChangeList->Add(pDelete);
} }
} }
......
...@@ -208,10 +208,9 @@ void LwpGraphicObject::XFConvert (XFContentContainer* pCont) ...@@ -208,10 +208,9 @@ void LwpGraphicObject::XFConvert (XFContentContainer* pCont)
{ {
if (m_sServerContextFormat[1]=='s'&&m_sServerContextFormat[2]=='d'&&m_sServerContextFormat[3]=='w') if (m_sServerContextFormat[1]=='s'&&m_sServerContextFormat[2]=='d'&&m_sServerContextFormat[3]=='w')
{ {
std::vector< rtl::Reference<XFFrame> >::iterator iter; for (auto const& vXFDrawObject : m_vXFDrawObjects)
for (iter = m_vXFDrawObjects.begin(); iter != m_vXFDrawObjects.end(); ++iter)
{ {
pCont->Add(iter->get()); pCont->Add(vXFDrawObject.get());
} }
} }
else if (IsGrafFormatValid() && !m_vXFDrawObjects.empty()) else if (IsGrafFormatValid() && !m_vXFDrawObjects.empty())
......
...@@ -245,9 +245,9 @@ void LwpStory::SortPageLayout() ...@@ -245,9 +245,9 @@ void LwpStory::SortPageLayout()
//put all the sorted layouts into list //put all the sorted layouts into list
m_LayoutList.clear(); m_LayoutList.clear();
for( aIt = aLayoutList.begin(); aIt != aLayoutList.end(); ++aIt) for (auto const& layout : aLayoutList)
{ {
m_LayoutList.push_back(*aIt); m_LayoutList.push_back(layout);
} }
} }
......
...@@ -448,10 +448,9 @@ OUString LwpFormulaFunc::ToString(LwpTableLayout* pCellsMap) ...@@ -448,10 +448,9 @@ OUString LwpFormulaFunc::ToString(LwpTableLayout* pCellsMap)
aFormula += " ";//Append a blank space aFormula += " ";//Append a blank space
//Append args //Append args
std::vector<LwpFormulaArg*>::iterator aItr; for (auto const& elem : m_aArgs)
for (aItr=m_aArgs.begin();aItr!=m_aArgs.end();++aItr)
{ {
aFormula += (*aItr)->ToArgString(pCellsMap) + "|"; //separator aFormula += elem->ToArgString(pCellsMap) + "|"; //separator
} }
//erase the last "|" //erase the last "|"
......
...@@ -170,10 +170,9 @@ void XFColumns::ToXml(IXFStream *pStrm) ...@@ -170,10 +170,9 @@ void XFColumns::ToXml(IXFStream *pStrm)
if(!(m_nFlag&XFCOLUMNS_FLAG_GAP) ) if(!(m_nFlag&XFCOLUMNS_FLAG_GAP) )
{ {
std::vector<XFColumn>::iterator it; for (auto & column : m_aColumns)
for( it = m_aColumns.begin(); it != m_aColumns.end(); ++it )
{ {
(*it).ToXml(pStrm); column.ToXml(pStrm);
} }
} }
pStrm->EndElement( "style:columns" ); pStrm->EndElement( "style:columns" );
......
...@@ -128,11 +128,9 @@ enumXFContent XFContentContainer::GetContentType() ...@@ -128,11 +128,9 @@ enumXFContent XFContentContainer::GetContentType()
void XFContentContainer::ToXml(IXFStream *pStrm) void XFContentContainer::ToXml(IXFStream *pStrm)
{ {
std::vector< rtl::Reference<XFContent> >::iterator it; for (auto const& content : m_aContents)
for( it = m_aContents.begin(); it != m_aContents.end(); ++it )
{ {
XFContent *pContent = it->get(); XFContent *pContent = content.get();
if( pContent ) if( pContent )
pContent->DoToXml(pStrm); pContent->DoToXml(pStrm);
} }
...@@ -140,6 +138,7 @@ void XFContentContainer::ToXml(IXFStream *pStrm) ...@@ -140,6 +138,7 @@ void XFContentContainer::ToXml(IXFStream *pStrm)
rtl::Reference<XFContent> XFContentContainer::GetLastContent() rtl::Reference<XFContent> XFContentContainer::GetLastContent()
{ {
// TODO JNA : if m_aContents size is 0, there's some pb
sal_uInt32 index = m_aContents.size()-1; sal_uInt32 index = m_aContents.size()-1;
if(index >0) if(index >0)
{ {
......
...@@ -67,12 +67,10 @@ OUString XFSvgPathEntry::ToString() ...@@ -67,12 +67,10 @@ OUString XFSvgPathEntry::ToString()
{ {
assert(!m_strCommand.isEmpty()); assert(!m_strCommand.isEmpty());
OUString str = m_strCommand; OUString str = m_strCommand;
std::vector<XFPoint>::iterator it;
for( it = m_aPoints.begin(); it != m_aPoints.end(); ++it ) for (auto const& point : m_aPoints)
{ {
XFPoint aPt= *it; str += OUString::number(point.GetX()*1000) + " " + OUString::number(point.GetY()*1000) + " ";
str += OUString::number(aPt.GetX()*1000) + " " + OUString::number(aPt.GetY()*1000) + " ";
} }
return str.trim(); return str.trim();
} }
...@@ -135,11 +133,9 @@ void XFDrawPath::ToXml(IXFStream *pStrm) ...@@ -135,11 +133,9 @@ void XFDrawPath::ToXml(IXFStream *pStrm)
//points //points
OUString strPath; OUString strPath;
std::vector<XFSvgPathEntry>::iterator it; for (auto & path : m_aPaths)
for( it = m_aPaths.begin(); it != m_aPaths.end(); ++it )
{ {
XFSvgPathEntry aSvg = *it; strPath += path.ToString();
strPath += aSvg.ToString();
} }
strPath = strPath.trim(); strPath = strPath.trim();
pAttrList->AddAttribute( "svg:d", strPath); pAttrList->AddAttribute( "svg:d", strPath);
......
...@@ -78,11 +78,10 @@ void XFDrawPolygon::ToXml(IXFStream *pStrm) ...@@ -78,11 +78,10 @@ void XFDrawPolygon::ToXml(IXFStream *pStrm)
//points //points
OUString strPoints; OUString strPoints;
for( it = m_aPoints.begin(); it != m_aPoints.end(); ++it ) for (auto const& point : m_aPoints)
{ {
XFPoint pt = *it; double x = (point.GetX()-rect.GetX())*1000;
double x = (pt.GetX()-rect.GetX())*1000; double y = (point.GetY()-rect.GetY())*1000;
double y = (pt.GetY()-rect.GetY())*1000;
strPoints += OUString::number(x) + " " + OUString::number(y) + " "; strPoints += OUString::number(x) + " " + OUString::number(y) + " ";
} }
strPoints = strPoints.trim(); strPoints = strPoints.trim();
......
...@@ -66,7 +66,6 @@ XFDrawPolyline::XFDrawPolyline() ...@@ -66,7 +66,6 @@ XFDrawPolyline::XFDrawPolyline()
void XFDrawPolyline::ToXml(IXFStream *pStrm) void XFDrawPolyline::ToXml(IXFStream *pStrm)
{ {
IXFAttrList *pAttrList = pStrm->GetAttrList(); IXFAttrList *pAttrList = pStrm->GetAttrList();
std::vector<XFPoint>::iterator it;
pAttrList->Clear(); pAttrList->Clear();
//view-box: //view-box:
...@@ -78,11 +77,10 @@ void XFDrawPolyline::ToXml(IXFStream *pStrm) ...@@ -78,11 +77,10 @@ void XFDrawPolyline::ToXml(IXFStream *pStrm)
//points //points
OUString strPoints; OUString strPoints;
for( it = m_aPoints.begin(); it != m_aPoints.end(); ++it ) for (auto const& point : m_aPoints)
{ {
XFPoint pt = *it; double x = (point.GetX()-rect.GetX())*1000;
double x = (pt.GetX()-rect.GetX())*1000; double y = (point.GetY()-rect.GetY())*1000;
double y = (pt.GetY()-rect.GetY())*1000;
strPoints += OUString::number(x) + "," + OUString::number(y) + " "; strPoints += OUString::number(x) + "," + OUString::number(y) + " ";
} }
strPoints = strPoints.trim(); strPoints = strPoints.trim();
...@@ -103,27 +101,24 @@ XFRect XFDrawPolyline::CalcViewBox() ...@@ -103,27 +101,24 @@ XFRect XFDrawPolyline::CalcViewBox()
double x2 = 0; double x2 = 0;
double y2 = 0; double y2 = 0;
XFPoint aPoint; XFPoint aPoint;
std::vector<XFPoint>::iterator it = m_aPoints.begin();
assert(!m_aPoints.empty()); assert(!m_aPoints.empty());
aPoint = *it;
x1 = aPoint.GetX(); x1 = aPoint.GetX();
x2 = aPoint.GetX(); x2 = aPoint.GetX();
y1 = aPoint.GetY(); y1 = aPoint.GetY();
y2 = aPoint.GetY(); y2 = aPoint.GetY();
for( ; it != m_aPoints.end(); ++it ) for (auto const& point : m_aPoints)
{ {
aPoint = *it; if( x1>point.GetX() )
if( x1>aPoint.GetX() ) x1 = point.GetX();
x1 = aPoint.GetX(); if( x2<point.GetX() )
if( x2<aPoint.GetX() ) x2 = point.GetX();
x2 = aPoint.GetX();
if( y1>aPoint.GetY() ) if( y1>point.GetY() )
y1 = aPoint.GetY(); y1 = point.GetY();
if( y2<aPoint.GetY() ) if( y2<point.GetY() )
y2 = aPoint.GetY(); y2 = point.GetY();
} }
return XFRect(x1,y1,x2-x1,y2-y1); return XFRect(x1,y1,x2-x1,y2-y1);
} }
......
...@@ -74,11 +74,10 @@ void XFFontFactory::AddFont(rtl::Reference<XFFont> const & pFont) ...@@ -74,11 +74,10 @@ void XFFontFactory::AddFont(rtl::Reference<XFFont> const & pFont)
rtl::Reference<XFFont> XFFontFactory::FindSameFont(rtl::Reference<XFFont> const & pFont) rtl::Reference<XFFont> XFFontFactory::FindSameFont(rtl::Reference<XFFont> const & pFont)
{ {
std::vector< rtl::Reference<XFFont> >::iterator it; for (auto const& font : s_aFonts)
for( it = s_aFonts.begin(); it != s_aFonts.end(); ++it )
{ {
if( *pFont == **it ) if( *pFont == *font )
return *it; return font;
} }
return nullptr; return nullptr;
......
...@@ -183,11 +183,10 @@ void XFIndex::ToXml(IXFStream *pStrm) ...@@ -183,11 +183,10 @@ void XFIndex::ToXml(IXFStream *pStrm)
pStrm->EndElement( "text:index-title-template" ); pStrm->EndElement( "text:index-title-template" );
//entry templates: //entry templates:
std::vector<XFIndexTemplate *>::iterator it; for (auto const& elem : m_aTemplates)
for (it = m_aTemplates.begin(); it != m_aTemplates.end(); ++it)
{ {
(*it)->SetTagName( strTplName); elem->SetTagName( strTplName);
(*it)->ToXml(pStrm); elem->ToXml(pStrm);
} }
// by // by
...@@ -205,11 +204,10 @@ void XFIndex::ToXml(IXFStream *pStrm) ...@@ -205,11 +204,10 @@ void XFIndex::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute( "text:outline-level", OUString::number(i)); pAttrList->AddAttribute( "text:outline-level", OUString::number(i));
pStrm->StartElement( "text:index-source-styles" ); pStrm->StartElement( "text:index-source-styles" );
std::vector<OUString>::iterator it_str; for (auto const& elemTOCSource : m_aTOCSource[i])
for (it_str = m_aTOCSource[i].begin(); it_str != m_aTOCSource[i].end(); ++it_str)
{ {
pAttrList->Clear(); pAttrList->Clear();
pAttrList->AddAttribute( "text:style-name", *it_str); pAttrList->AddAttribute( "text:style-name", elemTOCSource);
pStrm->StartElement( "text:index-source-style" ); pStrm->StartElement( "text:index-source-style" );
pStrm->EndElement( "text:index-source-style" ); pStrm->EndElement( "text:index-source-style" );
} }
......
...@@ -112,11 +112,10 @@ void XFRow::ToXml(IXFStream *pStrm) ...@@ -112,11 +112,10 @@ void XFRow::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute( "table:number-rows-repeated", OUString::number(m_nRepeat) ); pAttrList->AddAttribute( "table:number-rows-repeated", OUString::number(m_nRepeat) );
pStrm->StartElement( "table:table-row" ); pStrm->StartElement( "table:table-row" );
auto it = m_aCells.begin(); for (auto const& cell : m_aCells)
for( ; it!=m_aCells.end(); ++it )
{ {
int col = (*it).first; int col = cell.first;
XFCell *pCell = (*it).second.get(); XFCell *pCell = cell.second.get();
if( !pCell ) if( !pCell )
continue; continue;
if( col>lastCol+1 ) if( col>lastCol+1 )
......
...@@ -72,22 +72,17 @@ XFStyleContainer::XFStyleContainer(const OUString& strStyleNamePrefix) ...@@ -72,22 +72,17 @@ XFStyleContainer::XFStyleContainer(const OUString& strStyleNamePrefix)
XFStyleContainer::~XFStyleContainer() XFStyleContainer::~XFStyleContainer()
{ {
std::vector<IXFStyle*>::iterator it; for (auto const& style : m_aStyles)
for( it = m_aStyles.begin(); it != m_aStyles.end(); ++it )
{ {
IXFStyle *pStyle = *it; delete style;
delete pStyle;
} }
} }
void XFStyleContainer::Reset() void XFStyleContainer::Reset()
{ {
std::vector<IXFStyle*>::iterator it; for (auto const& style : m_aStyles)
for( it = m_aStyles.begin(); it != m_aStyles.end(); ++it )
{ {
IXFStyle *pStyle = *it; delete style;
delete pStyle;
} }
m_aStyles.clear(); m_aStyles.clear();
} }
...@@ -141,13 +136,11 @@ IXFStyleRet XFStyleContainer::AddStyle(IXFStyle *pStyle) ...@@ -141,13 +136,11 @@ IXFStyleRet XFStyleContainer::AddStyle(IXFStyle *pStyle)
IXFStyle* XFStyleContainer::FindSameStyle(IXFStyle *pStyle) IXFStyle* XFStyleContainer::FindSameStyle(IXFStyle *pStyle)
{ {
std::vector<IXFStyle*>::iterator it; for (auto const& style : m_aStyles)
for( it = m_aStyles.begin(); it != m_aStyles.end(); ++it )
{ {
IXFStyle *pConStyle = *it; assert(style);
assert(pConStyle); if( style->Equal(pStyle) )
if( pConStyle->Equal(pStyle) ) return style;
return pConStyle;
} }
return nullptr; return nullptr;
...@@ -155,13 +148,11 @@ IXFStyle* XFStyleContainer::FindSameStyle(IXFStyle *pStyle) ...@@ -155,13 +148,11 @@ IXFStyle* XFStyleContainer::FindSameStyle(IXFStyle *pStyle)
IXFStyle* XFStyleContainer::FindStyle(const OUString& name) IXFStyle* XFStyleContainer::FindStyle(const OUString& name)
{ {
std::vector<IXFStyle*>::iterator it; for (auto const& style : m_aStyles)
for( it = m_aStyles.begin(); it != m_aStyles.end(); ++it )
{ {
IXFStyle *pConStyle = *it; assert(style);
assert(pConStyle); if( style->GetStyleName() == name )
if( pConStyle->GetStyleName() == name ) return style;
return pConStyle;
} }
return nullptr; return nullptr;
...@@ -179,13 +170,10 @@ const IXFStyle* XFStyleContainer::Item(size_t index) const ...@@ -179,13 +170,10 @@ const IXFStyle* XFStyleContainer::Item(size_t index) const
void XFStyleContainer::ToXml(IXFStream *pStrm) void XFStyleContainer::ToXml(IXFStream *pStrm)
{ {
std::vector<IXFStyle*>::iterator it; for (auto const& style : m_aStyles)
for( it = m_aStyles.begin(); it != m_aStyles.end(); ++it )
{ {
IXFStyle *pStyle = *it; assert(style);
assert(pStyle); style->ToXml(pStrm);
pStyle->ToXml(pStrm);
} }
} }
......
...@@ -314,21 +314,18 @@ void XFStyleManager::SetEndnoteConfig(XFEndnoteConfig *pENConfig) ...@@ -314,21 +314,18 @@ void XFStyleManager::SetEndnoteConfig(XFEndnoteConfig *pENConfig)
void XFStyleManager::ToXml(IXFStream *pStrm) void XFStyleManager::ToXml(IXFStream *pStrm)
{ {
std::vector<XFFontDecl>::iterator itDecl;
IXFAttrList *pAttrList = pStrm->GetAttrList(); IXFAttrList *pAttrList = pStrm->GetAttrList();
pAttrList->Clear(); pAttrList->Clear();
pStrm->StartElement( "office:font-decls" ); pStrm->StartElement( "office:font-decls" );
//font declarations: //font declarations:
for( itDecl = s_aFontDecls.begin(); itDecl != s_aFontDecls.end(); ++itDecl ) for (auto & fontDecl : s_aFontDecls)
{ {
XFFontDecl &f = *itDecl;
pAttrList->Clear(); pAttrList->Clear();
pAttrList->AddAttribute( "style:name", f.GetFontName() ); pAttrList->AddAttribute( "style:name", fontDecl.GetFontName() );
pAttrList->AddAttribute( "fo:font-family", f.GetFontFamily() ); pAttrList->AddAttribute( "fo:font-family", fontDecl.GetFontFamily() );
if( f.GetFontPitchFixed() ) if( fontDecl.GetFontPitchFixed() )
pAttrList->AddAttribute( "style:font-pitch", "fixed" ); pAttrList->AddAttribute( "style:font-pitch", "fixed" );
else else
pAttrList->AddAttribute( "style:font-pitch", "variable" ); pAttrList->AddAttribute( "style:font-pitch", "variable" );
......
...@@ -125,10 +125,10 @@ OUString XFTable::GetTableName() ...@@ -125,10 +125,10 @@ OUString XFTable::GetTableName()
sal_uInt16 XFTable::GetRowCount() sal_uInt16 XFTable::GetRowCount()
{ {
sal_uInt16 rowMax = 0; sal_uInt16 rowMax = 0;
for(auto it=m_aRows.begin(); it!=m_aRows.end(); ++it ) for (auto const& row : m_aRows)
{ {
if (it->first > rowMax) if (row.first > rowMax)
rowMax = it->first; rowMax = row.first;
} }
return rowMax; return rowMax;
...@@ -142,11 +142,10 @@ XFRow* XFTable::GetRow(sal_Int32 row) ...@@ -142,11 +142,10 @@ XFRow* XFTable::GetRow(sal_Int32 row)
sal_Int32 XFTable::GetColumnCount() sal_Int32 XFTable::GetColumnCount()
{ {
int colMax = -1; int colMax = -1;
std::map<sal_Int32,OUString>::iterator it; for (auto const& column : m_aColumns)
for( it=m_aColumns.begin(); it!=m_aColumns.end(); ++it )
{ {
if( it->first>colMax ) if( column.first>colMax )
colMax = it->first; colMax = column.first;
} }
return colMax; return colMax;
} }
...@@ -176,10 +175,9 @@ void XFTable::ToXml(IXFStream *pStrm) ...@@ -176,10 +175,9 @@ void XFTable::ToXml(IXFStream *pStrm)
//output columns: //output columns:
{ {
int lastCol = 0; int lastCol = 0;
std::map<sal_Int32,OUString>::iterator it; for (auto const& column : m_aColumns)
for( it=m_aColumns.begin(); it!=m_aColumns.end(); ++it )
{ {
sal_Int32 col = (*it).first; sal_Int32 col = column.first;
OUString style = m_aColumns[col]; OUString style = m_aColumns[col];
//default col repeated: //default col repeated:
...@@ -217,11 +215,10 @@ void XFTable::ToXml(IXFStream *pStrm) ...@@ -217,11 +215,10 @@ void XFTable::ToXml(IXFStream *pStrm)
{ {
int lastRow = 0; int lastRow = 0;
auto it = m_aRows.begin(); for (auto const& elem : m_aRows)
for( ; it!=m_aRows.end(); ++it )
{ {
int row = (*it).first; int row = elem.first;
XFRow *pRow = (*it).second.get(); XFRow *pRow = elem.second.get();
//null row repeated: //null row repeated:
if( row>lastRow+1 ) if( row>lastRow+1 )
......
...@@ -107,10 +107,9 @@ void XFTextSpan::ToXml(IXFStream *pStrm) ...@@ -107,10 +107,9 @@ void XFTextSpan::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute( "text:style-name", GetStyleName() ); pAttrList->AddAttribute( "text:style-name", GetStyleName() );
pStrm->StartElement( "text:span" ); pStrm->StartElement( "text:span" );
std::vector< rtl::Reference<XFContent> >::iterator it; for (auto const& content : m_aContents)
for( it= m_aContents.begin(); it!= m_aContents.end(); ++it )
{ {
XFContent *pContent = it->get(); XFContent *pContent = content.get();
if( pContent ) if( pContent )
pContent->DoToXml(pStrm); pContent->DoToXml(pStrm);
} }
...@@ -130,20 +129,18 @@ void XFTextSpanStart::ToXml(IXFStream *pStrm) ...@@ -130,20 +129,18 @@ void XFTextSpanStart::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute( "text:style-name", GetStyleName() ); pAttrList->AddAttribute( "text:style-name", GetStyleName() );
pStrm->StartElement( "text:span" ); pStrm->StartElement( "text:span" );
std::vector< rtl::Reference<XFContent> >::iterator it; for (auto const& content : m_aContents)
for( it= m_aContents.begin(); it!= m_aContents.end(); ++it )
{ {
XFContent *pContent = it->get(); XFContent *pContent = content.get();
if( pContent ) if( pContent )
pContent->DoToXml(pStrm); pContent->DoToXml(pStrm);
} }
} }
void XFTextSpanEnd::ToXml(IXFStream *pStrm) void XFTextSpanEnd::ToXml(IXFStream *pStrm)
{ {
std::vector< rtl::Reference<XFContent> >::iterator it; for (auto const& content : m_aContents)
for( it= m_aContents.begin(); it!= m_aContents.end(); ++it )
{ {
XFContent *pContent = it->get(); XFContent *pContent = content.get();
if( pContent ) if( pContent )
pContent->DoToXml(pStrm); pContent->DoToXml(pStrm);
} }
......
...@@ -134,10 +134,9 @@ void XFTimeStyle::ToXml(IXFStream *pStrm) ...@@ -134,10 +134,9 @@ void XFTimeStyle::ToXml(IXFStream *pStrm)
pAttrList->AddAttribute( "number:truncate-on-overflow", "false" ); pAttrList->AddAttribute( "number:truncate-on-overflow", "false" );
pStrm->StartElement( "number:time-style" ); pStrm->StartElement( "number:time-style" );
std::vector<XFTimePart>::iterator it; for (auto & part : m_aParts)
for( it = m_aParts.begin(); it != m_aParts.end(); ++it )
{ {
(*it).ToXml(pStrm); part.ToXml(pStrm);
} }
if( m_bAmPm ) if( m_bAmPm )
{ {
......
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