[Libreoffice-commits] .: 2 commits - Makefile sw/source unusedcode.easy
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Mar 21 09:01:15 PDT 2012
Makefile | 1 +
sw/source/core/doc/doctxm.cxx | 19 +++++++++----------
sw/source/core/inc/txmsrt.hxx | 6 +++---
sw/source/core/tox/txmsrt.cxx | 5 +----
unusedcode.easy | 7 +------
5 files changed, 15 insertions(+), 23 deletions(-)
New commits:
commit 034bc34ddc1bac817a6ef51bba19675551a461f4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 21 15:25:27 2012 +0000
convert SwTOXSources to a std::vector
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index b1c9199..c8dd379 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1563,7 +1563,7 @@ String lcl_GetNumString( const SwTOXSortTabBase& rBase, sal_Bool bUsePrefix, sal
{
String sRet;
- if( !rBase.pTxtMark && rBase.aTOXSources.Count() > 0 )
+ if( !rBase.pTxtMark && !rBase.aTOXSources.empty() )
{ // only if it's not a Mark
const SwTxtNode* pNd = rBase.aTOXSources[0].pNd->GetTxtNode();
if( pNd )
@@ -1721,11 +1721,11 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
// Place holder for the PageNumber; we only respect the first one
{
// The count of similiar entries gives the PagerNumber pattern
- sal_uInt16 nSize = rBase.aTOXSources.Count();
- if( nSize > 0 )
+ size_t nSize = rBase.aTOXSources.size();
+ if (nSize > 0)
{
String aInsStr( cNumRepl );
- for(sal_uInt16 i=1; i < nSize; ++i)
+ for (size_t i = 1; i < nSize; ++i)
{
aInsStr.AppendAscii( sPageDeli );
aInsStr += cNumRepl;
@@ -1740,7 +1740,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
{
// A bit tricky: Find a random Frame
const SwTOXSource* pTOXSource = 0;
- if(rBase.aTOXSources.Count())
+ if (!rBase.aTOXSources.empty())
pTOXSource = &rBase.aTOXSources[0];
// #i53420#
@@ -1906,9 +1906,8 @@ void SwTOXBaseSection::UpdatePageNum()
for(sal_uInt16 nRunInEntry = nCnt; nRunInEntry < nCnt + nRange; nRunInEntry++)
{
SwTOXSortTabBase* pSortBase = aSortArr[nRunInEntry];
- sal_uInt16 nSize = pSortBase->aTOXSources.Count();
- sal_uInt16 i;
- for( sal_uInt16 j = 0; j < nSize; ++j )
+ size_t nSize = pSortBase->aTOXSources.size();
+ for (size_t j = 0; j < nSize; ++j)
{
::SetProgressState( 0, pDoc->GetDocShell() );
@@ -1936,6 +1935,7 @@ void SwTOXBaseSection::UpdatePageNum()
}
// Insert as sorted
+ sal_uInt16 i;
for( i = 0; i < aNums.size() && aNums[i] < nPage; ++i )
;
@@ -2220,8 +2220,7 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew)
return;
}
// If the own entry is already present, add it to the references list
- pOld->aTOXSources.Insert( pNew->aTOXSources[0],
- pOld->aTOXSources.Count() );
+ pOld->aTOXSources.push_back(pNew->aTOXSources[0]);
delete pNew;
return;
diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index 5b3e79d..e707741 100644
--- a/sw/source/core/inc/txmsrt.hxx
+++ b/sw/source/core/inc/txmsrt.hxx
@@ -58,13 +58,13 @@ struct SwTOXSource
xub_StrLen nPos;
sal_Bool bMainEntry;
- SwTOXSource() : pNd(0), nPos(0), bMainEntry(sal_False) {}
SwTOXSource( const SwCntntNode* pNode, xub_StrLen n, sal_Bool bMain )
: pNd(pNode), nPos(n), bMainEntry(bMain)
- {}
+ {
+ }
};
-SV_DECL_VARARR( SwTOXSources, SwTOXSource, 0 )
+typedef std::vector<SwTOXSource> SwTOXSources;
class SwTOXInternational
{
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 13e51e8..e6f18c1 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -64,9 +64,6 @@ using ::rtl::OUString;
sal_uInt16 SwTOXSortTabBase::nOpt = 0;
-SV_IMPL_VARARR( SwTOXSources, SwTOXSource )
-
-
SwTOXInternational::SwTOXInternational( LanguageType nLang, sal_uInt16 nOpt,
const String& rSortAlgorithm ) :
eLang( nLang ),
@@ -164,7 +161,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd,
n = *pTxtMark->GetStart();
SwTOXSource aTmp( pNd, n,
pTxtMark ? pTxtMark->GetTOXMark().IsMainEntry() : sal_False );
- aTOXSources.Insert( aTmp, aTOXSources.Count() );
+ aTOXSources.push_back(aTmp);
nPos = pNd->GetIndex();
diff --git a/unusedcode.easy b/unusedcode.easy
index a63332e..08c0f96 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -272,11 +272,6 @@ SwSortTableLines::Remove(SwTableLine* const&, unsigned short)
SwSortTableLines::Remove(unsigned short, unsigned short)
SwSyncChildWin::GetChildWindowId()
SwTOXMarks::DeleteAndDestroy(unsigned short, unsigned short)
-SwTOXSources::Insert(SwTOXSources const*, unsigned short, unsigned short, unsigned short)
-SwTOXSources::Remove(unsigned short, unsigned short)
-SwTOXSources::Replace(SwTOXSource const&, unsigned short)
-SwTOXSources::Replace(SwTOXSource const*, unsigned short, unsigned short)
-SwTOXSources::_ForEach(unsigned short, unsigned short, unsigned char (*)(SwTOXSource const&, void*), void*)
SwTabFrm::GetLeaf(MakePageType, unsigned char)
SwTableSortBoxes::DeleteAndDestroy(unsigned short, unsigned short)
SwTableSortBoxes::Insert(SwTableBox* const&, unsigned short&)
@@ -368,6 +363,7 @@ XMLTextListAutoStylePoolNames_Impl::Remove(rtl::OUString*)
XMLTextListAutoStylePool_Impl::GetPos(XMLTextListAutoStylePoolEntry_Impl const*) const
XMLTextListAutoStylePool_Impl::Remove(XMLTextListAutoStylePoolEntry_Impl*)
XclExpPivotCache::GetFieldAcc(rtl::OUString const&)
+XclPCField::GetBaseFieldIndex() const
_CpyTabFrms::Insert(_CpyTabFrm const&, unsigned short&)
_CpyTabFrms::Insert(_CpyTabFrm const*, unsigned short)
_CpyTabFrms::Insert(_CpyTabFrms const*, unsigned short, unsigned short)
commit 067eaf954dfa4da6e72bc0f8c779d5b711678385
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 21 13:45:09 2012 +0000
writeU8 is unused in the external libcdr lib, but filter it out from easy
diff --git a/Makefile b/Makefile
index 79ccd2e..4386267 100644
--- a/Makefile
+++ b/Makefile
@@ -485,6 +485,7 @@ findunusedcode:
| grep -v ^WP6 \
| grep -v ^WPG \
| grep -v ^WPS \
+ | grep -v WPXBinaryData \
> unusedcode.easy
check: dev-install subsequentcheck
diff --git a/unusedcode.easy b/unusedcode.easy
index 88c477c..a63332e 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1,4 +1,3 @@
-(anonymous namespace)::writeU8(WPXBinaryData&, int)
CertificateExtension_XmlSecImpl::setCertExtn(com::sun::star::uno::Sequence<signed char>, com::sun::star::uno::Sequence<signed char>, unsigned char)
CharPosArray::Insert(CharPosArray const*, unsigned short, unsigned short, unsigned short)
CharPosArray::Replace(int const&, unsigned short)
More information about the Libreoffice-commits
mailing list