diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-04 08:57:19 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-04 09:11:51 +0000 |
commit | 4e444871a4c9d819c136b383c81b7f7df386a78d (patch) | |
tree | e13952b0da7c2d615380b26d9df1e56dd7d6f20d /sw | |
parent | b62e6b011a3c9a340353546b73ff2eda0e793215 (diff) |
Use std::size_t
And include <cstddef> where necessary.
Change-Id: Icc1208528d6a8b04375d55ccbf3cd6ef046b454f
Reviewed-on: https://gerrit.libreoffice.org/23796
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/doc/textboxhelper.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxtablestyleexport.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 16 |
5 files changed, 21 insertions, 21 deletions
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 933982dada4d..37e5cf50dfc2 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -339,12 +339,12 @@ void SwTiledRenderingTest::testSearch() SwXTextDocument* pXTextDocument = createDoc("search.odt"); pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this); SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell(); - size_t nNode = pWrtShell->getShellCursor(false)->Start()->nNode.GetNode().GetIndex(); + std::size_t nNode = pWrtShell->getShellCursor(false)->Start()->nNode.GetNode().GetIndex(); // First hit, in the second paragraph, before the shape. lcl_search(false); CPPUNIT_ASSERT(!pWrtShell->GetDrawView()->GetTextEditObject()); - size_t nActual = pWrtShell->getShellCursor(false)->Start()->nNode.GetNode().GetIndex(); + std::size_t nActual = pWrtShell->getShellCursor(false)->Start()->nNode.GetNode().GetIndex(); CPPUNIT_ASSERT_EQUAL(nNode + 1, nActual); /// Make sure we get search result selection for normal find as well, not only find all. CPPUNIT_ASSERT(!m_aSearchResultSelection.empty()); @@ -468,7 +468,7 @@ void SwTiledRenderingTest::testSearchAll() })); comphelper::dispatchCommand(".uno:ExecuteSearch", aPropertyValues); // This was 0; should be 2 results in the body text. - CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), m_aSearchResultSelection.size()); + CPPUNIT_ASSERT_EQUAL(static_cast<std::size_t>(2), m_aSearchResultSelection.size()); // Writer documents are always a single part. CPPUNIT_ASSERT_EQUAL(0, m_aSearchResultPart[0]); diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index b52c9cdf34d9..3c55e28a69d7 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -162,7 +162,7 @@ std::set<const SwFrameFormat*> SwTextBoxHelper::findTextBoxes(const SwNode& rNod const SwSortedObjs* pSortedObjs = pContentFrame->GetDrawObjs(); if (pSortedObjs) { - for (size_t i = 0; i < pSortedObjs->size(); ++i) + for (std::size_t i = 0; i < pSortedObjs->size(); ++i) { SwAnchoredObject* pAnchoredObject = (*pSortedObjs)[i]; SwFrameFormat* pTextBox = findTextBox(&pAnchoredObject->GetFrameFormat()); @@ -212,7 +212,7 @@ bool SwTextBoxHelper::isTextBox(const SdrObject* pObject) sal_Int32 SwTextBoxHelper::getCount(SdrPage* pPage, std::set<const SwFrameFormat*>& rTextBoxes) { sal_Int32 nRet = 0; - for (size_t i = 0; i < pPage->GetObjCount(); ++i) + for (std::size_t i = 0; i < pPage->GetObjCount(); ++i) { if (lcl_isTextBox(pPage->GetObj(i), rTextBoxes)) continue; @@ -228,7 +228,7 @@ uno::Any SwTextBoxHelper::getByIndex(SdrPage* pPage, sal_Int32 nIndex, std::set< SdrObject* pRet = nullptr; sal_Int32 nCount = 0; // Current logical index. - for (size_t i = 0; i < pPage->GetObjCount(); ++i) + for (std::size_t i = 0; i < pPage->GetObjCount(); ++i) { if (lcl_isTextBox(pPage->GetObj(i), rTextBoxes)) continue; @@ -251,7 +251,7 @@ sal_Int32 SwTextBoxHelper::getOrdNum(const SdrObject* pObject, std::set<const Sw if (const SdrPage* pPage = pObject->GetPage()) { sal_Int32 nOrder = 0; // Current logical order. - for (size_t i = 0; i < pPage->GetObjCount(); ++i) + for (std::size_t i = 0; i < pPage->GetObjCount(); ++i) { if (lcl_isTextBox(pPage->GetObj(i), rTextBoxes)) continue; @@ -590,7 +590,7 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, sal_uInt16 nWID, sal_u void SwTextBoxHelper::saveLinks(const SwFrameFormats& rFormats, std::map<const SwFrameFormat*, const SwFrameFormat*>& rLinks) { - for (size_t i = 0; i < rFormats.size(); ++i) + for (std::size_t i = 0; i < rFormats.size(); ++i) { const SwFrameFormat* pFormat = rFormats[i]; if (pFormat->Which() != RES_DRAWFRMFMT) @@ -612,13 +612,13 @@ void SwTextBoxHelper::resetLink(SwFrameFormat* pShape, std::map<const SwFrameFor void SwTextBoxHelper::restoreLinks(std::set<_ZSortFly>& rOld, std::vector<SwFrameFormat*>& rNew, SavedLink& rSavedLinks, SavedContent& rOldContent) { - size_t i = 0; + std::size_t i = 0; for (std::set<_ZSortFly>::iterator aSetIt = rOld.begin(); aSetIt != rOld.end(); ++aSetIt, ++i) { SavedLink::iterator aTextBoxIt = rSavedLinks.find(aSetIt->GetFormat()); if (aTextBoxIt != rSavedLinks.end()) { - size_t j = 0; + std::size_t j = 0; for (std::set<_ZSortFly>::iterator aSetJt = rOld.begin(); aSetJt != rOld.end(); ++aSetJt, ++j) { if (aSetJt->GetFormat() == aTextBoxIt->second) diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx index 3d6d075685c3..86e20e9c7ef2 100644 --- a/sw/source/filter/ww8/docxtablestyleexport.cxx +++ b/sw/source/filter/ww8/docxtablestyleexport.cxx @@ -673,7 +673,7 @@ void DocxTableStyleExport::Impl::TableStyle(uno::Sequence<beans::PropertyValue>& tableStyleRPr(aRPr); tableStyleTablePr(aTablePr); tableStyleTcPr(aTcPr); - for (size_t i = 0; i < aTableStylePrs.size(); ++i) + for (std::size_t i = 0; i < aTableStylePrs.size(); ++i) tableStyleTableStylePr(aTableStylePrs[i]); m_pSerializer->endElementNS(XML_w, XML_style); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 9d9f461ccbd6..337a65f0c6bb 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1881,7 +1881,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl(const ww8::Frame& rFrame, const Poi lcl_TextFrameShadow(m_aFlyProperties, rFrameFormat); lcl_TextFrameRelativeSize(m_aFlyProperties, rFrameFormat); - for (size_t i = 0; i < m_aFlyProperties.size(); ++i) + for (std::size_t i = 0; i < m_aFlyProperties.size(); ++i) { m_rExport.Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SP "{"); m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_SN " "); @@ -3974,7 +3974,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat if (!pFlyFrameFormat->GetOpaque().GetValue()) aFlyProperties.push_back(std::make_pair<OString, OString>("fBehindDocument", "1")); - for (size_t i = 0; i < aFlyProperties.size(); ++i) + for (std::size_t i = 0; i < aFlyProperties.size(); ++i) { m_rExport.Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SP "{"); m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_SN " "); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 6ce10997629f..1752e3c99f3c 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -253,7 +253,7 @@ void RtfExport::WriteRevTab() // RTF always seems to use Unknown as the default first entry GetRedline(OUString("Unknown")); - for (size_t i = 0; i < m_pDoc->getIDocumentRedlineAccess().GetRedlineTable().size(); ++i) + for (std::size_t i = 0; i < m_pDoc->getIDocumentRedlineAccess().GetRedlineTable().size(); ++i) { const SwRangeRedline* pRedl = m_pDoc->getIDocumentRedlineAccess().GetRedlineTable()[ i ]; @@ -262,7 +262,7 @@ void RtfExport::WriteRevTab() // Now write the table Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_IGNORE).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_REVTBL).WriteChar(' '); - for (size_t i = 0; i < m_aRedlineTable.size(); ++i) + for (std::size_t i = 0; i < m_aRedlineTable.size(); ++i) { const OUString* pAuthor = GetRedline(i); Strm().WriteChar('{'); @@ -394,7 +394,7 @@ void RtfExport::WriteMainText() std::vector< std::pair<OString, OString> > aProperties; aProperties.push_back(std::make_pair<OString, OString>("shapeType", "1")); aProperties.push_back(std::make_pair<OString, OString>("fillColor", OString::number(msfilter::util::BGRToRGB(oBrush->GetColor().GetColor())))); - for (size_t i = 0; i < aProperties.size(); ++i) + for (std::size_t i = 0; i < aProperties.size(); ++i) { Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SP "{"); Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_SN " "); @@ -536,14 +536,14 @@ void RtfExport::WriteUserProps() void RtfExport::WritePageDescTable() { // Write page descriptions (page styles) - size_t nSize = m_pDoc->GetPageDescCnt(); + std::size_t nSize = m_pDoc->GetPageDescCnt(); if (!nSize) return; Strm().WriteCharPtr(SAL_NEWLINE_STRING); m_bOutPageDescs = true; Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_IGNORE).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PGDSCTBL); - for (size_t n = 0; n < nSize; ++n) + for (std::size_t n = 0; n < nSize; ++n) { const SwPageDesc& rPageDesc = m_pDoc->GetPageDesc(n); @@ -554,7 +554,7 @@ void RtfExport::WritePageDescTable() OutPageDescription(rPageDesc, false, false); // search for the next page description - size_t i = nSize; + std::size_t i = nSize; while (i) if (rPageDesc.GetFollow() == &m_pDoc->GetPageDesc(--i)) break; @@ -670,7 +670,7 @@ void RtfExport::ExportDocument_Impl() if (pSet) { - size_t nPosInDoc; + std::size_t nPosInDoc; pSttPgDsc = static_cast<const SwFormatPageDesc*>(&pSet->Get(RES_PAGEDESC)); if (!pSttPgDsc->GetPageDesc()) pSttPgDsc = nullptr; @@ -1183,7 +1183,7 @@ void RtfExport::OutColorTable() InsColor(pItem->GetColorValue()); } - for (size_t n = 0; n < m_aColTable.size(); ++n) + for (std::size_t n = 0; n < m_aColTable.size(); ++n) { const Color& rCol = m_aColTable[ n ]; if (n || COL_AUTO != rCol.GetColor()) |