diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-04-07 23:05:25 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-04-12 22:36:29 +0200 |
commit | bafc6196c5364c2692e9a4f538a580e3dedec073 (patch) | |
tree | 0828feafe8f30374796ae1f82abf38021e5a676a /sw | |
parent | 6fcb52aa3d8b8f3686ba1dfae03f9d3cc281b5d3 (diff) |
Use size() on array filled by SwEditShell::GetINetAttrs to get number of items
Change-Id: I10d05c6b635c220f2ec833e4207afbd46651aec8
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/editsh.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/text/EnhancedPDFExportHelper.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 5 |
4 files changed, 8 insertions, 8 deletions
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 58f04bad217c..b2e8ee2841a8 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -788,7 +788,7 @@ public: bool InsertURL( const SwFmtINetFmt& rFmt, const OUString& rStr, bool bKeepSelection = false ); - sal_uInt16 GetINetAttrs( SwGetINetAttrs& rArr ); + void GetINetAttrs( SwGetINetAttrs& rArr ); OUString GetDropTxt( const sal_uInt16 nChars ) const; void ReplaceDropTxt( const OUString &rStr, SwPaM* pPaM = NULL ); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 1f328893608f..65c480a0c6ba 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -660,7 +660,7 @@ bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const OUString& rStr, boo return true; } -sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) +void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) { rArr.clear(); @@ -689,7 +689,6 @@ sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) } } } - return rArr.size(); } /// If the cursor is in a INetAttribute then it will be deleted completely (incl. hint text, the diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 7a08004e1095..e63aa81da0ff 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -1623,10 +1623,10 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() // HYPERLINKS SwGetINetAttrs aArr; - const sal_uInt16 nHyperLinkCount = mrSh.GetINetAttrs( aArr ); - for( sal_uInt16 n = 0; n < nHyperLinkCount; ++n ) + mrSh.GetINetAttrs( aArr ); + for( auto &rAttr : aArr ) { - SwGetINetAttr* p = &aArr[ n ]; + SwGetINetAttr* p = &rAttr; OSL_ENSURE( 0 != p, "Enhanced pdf export - SwGetINetAttr is missing" ); const SwTxtNode* pTNd = p->rINetAttr.GetpTxtNode(); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 555406271fa6..bec9651f0370 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -153,8 +153,9 @@ namespace const SwContentType *pCntType) { SwGetINetAttrs aArr; - const sal_uInt16 nCount = pWrtShell->GetINetAttrs( aArr ); - for( sal_uInt16 n = 0; n < nCount; ++n ) + pWrtShell->GetINetAttrs( aArr ); + const SwGetINetAttrs::size_type nCount {aArr.size()}; + for( SwGetINetAttrs::size_type n = 0; n < nCount; ++n ) { SwGetINetAttr* p = &aArr[ n ]; SwURLFieldContent* pCnt = new SwURLFieldContent( |