[Libreoffice-commits] .: sw/inc sw/source
Nigel Hawkins
nhawkins at kemper.freedesktop.org
Mon Jul 25 09:08:05 PDT 2011
sw/inc/redline.hxx | 5 ++---
sw/source/core/doc/docredln.cxx | 16 +++++++++-------
2 files changed, 11 insertions(+), 10 deletions(-)
New commits:
commit 831a6250a4ec974d78bbaa3cfe5a112be4babd53
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date: Mon Jul 25 17:07:22 2011 +0100
Replace SvUShorts with vector in redline.hxx and docredln.cxx
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 7b5ac15..45cd65c 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -31,13 +31,12 @@
#include <tools/datetime.hxx>
#include <tools/string.hxx>
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
#include <pam.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <svl/smplhint.hxx>
+#include <vector>
class SfxItemSet;
class SwView;
@@ -77,7 +76,7 @@ public:
class SwRedlineExtraData_Format : public SwRedlineExtraData
{
- SvUShorts aWhichIds;
+ std::vector<sal_uInt16> aWhichIds;
SwRedlineExtraData_Format( const SwRedlineExtraData_Format& rCpy );
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index e0f6c31..e62bfae 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2949,7 +2949,7 @@ SwRedlineExtraData_Format::SwRedlineExtraData_Format( const SfxItemSet& rSet )
const SfxPoolItem* pItem = aIter.FirstItem();
while( sal_True )
{
- aWhichIds.Insert( pItem->Which(), aWhichIds.Count() );
+ aWhichIds.push_back( pItem->Which() );
if( aIter.IsAtEnd() )
break;
pItem = aIter.NextItem();
@@ -2958,9 +2958,9 @@ SwRedlineExtraData_Format::SwRedlineExtraData_Format( const SfxItemSet& rSet )
SwRedlineExtraData_Format::SwRedlineExtraData_Format(
const SwRedlineExtraData_Format& rCpy )
- : SwRedlineExtraData(), aWhichIds( (sal_uInt8)rCpy.aWhichIds.Count() )
+ : SwRedlineExtraData()
{
- aWhichIds.Insert( &rCpy.aWhichIds, 0 );
+ aWhichIds.insert( aWhichIds.begin(), rCpy.aWhichIds.begin(), rCpy.aWhichIds.end() );
}
SwRedlineExtraData_Format::~SwRedlineExtraData_Format()
@@ -2980,9 +2980,10 @@ void SwRedlineExtraData_Format::Reject( SwPaM& rPam ) const
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld & ~(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_IGNORE)));
// eigentlich muesste hier das Attribut zurueck gesetzt werden!!!
- for( sal_uInt16 n = 0, nEnd = aWhichIds.Count(); n < nEnd; ++n )
+ std::vector<sal_uInt16>::const_iterator it;
+ for( it = aWhichIds.begin(); it != aWhichIds.end(); ++it )
{
- pDoc->InsertPoolItem( rPam, *GetDfltAttr( aWhichIds[ n ] ),
+ pDoc->InsertPoolItem( rPam, *GetDfltAttr( *it ),
nsSetAttrMode::SETATTR_DONTEXPAND );
}
@@ -2992,8 +2993,9 @@ void SwRedlineExtraData_Format::Reject( SwPaM& rPam ) const
int SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) const
{
int nRet = 1;
- sal_uInt16 n = 0, nEnd = aWhichIds.Count();
- if( nEnd != ((SwRedlineExtraData_Format&)rCmp).aWhichIds.Count() )
+ size_t n = 0;
+ size_t nEnd = aWhichIds.size();
+ if( nEnd != ((SwRedlineExtraData_Format&)rCmp).aWhichIds.size() )
nRet = 0;
else
for( ; n < nEnd; ++n )
More information about the Libreoffice-commits
mailing list