summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNigel Hawkins <n.hawkins@gmx.com>2011-07-13 14:22:48 +0100
committerNigel Hawkins <n.hawkins@gmx.com>2011-07-13 15:57:23 +0100
commit52b7adfe28c4ebff5889ea6b7397ea6c5611d0d4 (patch)
tree84adce83282471fcd00612ed23d6d4acf810283f
parente1edf287ddca68fbc39b40dbb3d934fa6a858f1b (diff)
Replace SvUShorts with vector in extinput.hxx and cascade changes.
LGPLv3+/MPL.
-rw-r--r--sw/inc/extinput.hxx9
-rw-r--r--sw/source/core/doc/extinput.cxx8
-rw-r--r--sw/source/core/text/redlnitr.cxx9
-rw-r--r--sw/source/core/text/redlnitr.hxx13
4 files changed, 18 insertions, 21 deletions
diff --git a/sw/inc/extinput.hxx b/sw/inc/extinput.hxx
index e669b32723..d7cd8aa257 100644
--- a/sw/inc/extinput.hxx
+++ b/sw/inc/extinput.hxx
@@ -28,18 +28,15 @@
#ifndef _EXTINPUT_HXX
#define _EXTINPUT_HXX
-#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
-#endif
#include <pam.hxx>
#include <i18npool/lang.h>
+#include <vector>
class CommandExtTextInputData;
class SwExtTextInput : public SwPaM
{
- SvUShorts aAttrs;
+ std::vector<sal_uInt16> aAttrs;
String sOverwriteText;
sal_Bool bInsText : 1;
sal_Bool bIsOverwriteCursor : 1;
@@ -49,7 +46,7 @@ public:
virtual ~SwExtTextInput();
void SetInputData( const CommandExtTextInputData& rData );
- const SvUShorts& GetAttrs() const { return aAttrs; }
+ const std::vector<sal_uInt16>& GetAttrs() const { return aAttrs; }
void SetInsText( sal_Bool bFlag ) { bInsText = bFlag; }
sal_Bool IsOverwriteCursor() const { return bIsOverwriteCursor; }
void SetOverwriteCursor( sal_Bool bFlag );
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 48afc9b2bd..85b12776ec 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -204,10 +204,12 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData )
GetPoint()->nContent = nSttCnt;
- if( aAttrs.Count() )
- aAttrs.Remove( 0, aAttrs.Count() );
+ aAttrs.clear();
if( rData.GetTextAttr() )
- aAttrs.Insert( rData.GetTextAttr(), rData.GetText().Len(), 0 );
+ {
+ const sal_uInt16 *pAttrs = rData.GetTextAttr();
+ aAttrs.insert( aAttrs.begin(), pAttrs, pAttrs + rData.GetText().Len() );
+ }
}
}
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index ffdd20f9b2..03f1ba7d9f 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -149,7 +149,7 @@ void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, S
MSHORT nRedlPos = pIDRA->GetRedlinePos( rTxtNode, USHRT_MAX );
if( pExtInp || MSHRT_MAX != nRedlPos )
{
- const SvUShorts* pArr = 0;
+ const std::vector<sal_uInt16> *pArr = 0;
xub_StrLen nInputStt = 0;
if( pExtInp )
{
@@ -185,8 +185,9 @@ void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, S
*************************************************************************/
SwRedlineItr::SwRedlineItr( const SwTxtNode& rTxtNd, SwFont& rFnt,
- SwAttrHandler& rAH, MSHORT nRed, sal_Bool bShw, const SvUShorts *pArr,
- xub_StrLen nExtStart )
+ SwAttrHandler& rAH, MSHORT nRed, sal_Bool bShw,
+ const std::vector<sal_uInt16> *pArr,
+ xub_StrLen nExtStart )
: rDoc( *rTxtNd.GetDoc() ), rNd( rTxtNd ), rAttrHandler( rAH ), pSet( 0 ),
nNdIdx( rTxtNd.GetIndex() ), nFirst( nRed ),
nAct( MSHRT_MAX ), bOn( sal_False ), bShow( bShw )
@@ -492,7 +493,7 @@ xub_StrLen SwExtend::Next( xub_StrLen nNext )
{
MSHORT nIdx = nPos - nStart;
MSHORT nAttr = rArr[ nIdx ];
- while( ++nIdx < rArr.Count() && nAttr == rArr[ nIdx ] )
+ while( ++nIdx < rArr.size() && nAttr == rArr[ nIdx ] )
; //nothing
nIdx = nIdx + nStart;
if( nNext > nIdx )
diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx
index 762aeab152..c85c36a822 100644
--- a/sw/source/core/text/redlnitr.hxx
+++ b/sw/source/core/text/redlnitr.hxx
@@ -33,10 +33,7 @@
#include <IDocumentRedlineAccess.hxx>
#include "swfont.hxx"
-#ifndef _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
-#endif
+#include <vector>
class SwTxtNode;
class SwDoc;
@@ -46,7 +43,7 @@ class SwAttrHandler;
class SwExtend
{
SwFont *pFnt;
- const SvUShorts &rArr; // XAMA: Array of xub_StrLen
+ const std::vector<sal_uInt16> &rArr; // XAMA: Array of xub_StrLen
xub_StrLen nStart;
xub_StrLen nPos;
xub_StrLen nEnd;
@@ -54,8 +51,8 @@ class SwExtend
sal_Bool Inside() const { return ( nPos >= nStart && nPos < nEnd ); }
void ActualizeFont( SwFont &rFnt, xub_StrLen nAttr );
public:
- SwExtend( const SvUShorts &rA, xub_StrLen nSt ) : pFnt(0), rArr( rA ),
- nStart( nSt ), nPos( STRING_LEN ), nEnd( nStart + rA.Count() ) {}
+ SwExtend( const std::vector<sal_uInt16> &rA, xub_StrLen nSt ) : pFnt(0), rArr( rA ),
+ nStart( nSt ), nPos( STRING_LEN ), nEnd( nStart + rA.size() ) {}
~SwExtend() { delete pFnt; }
sal_Bool IsOn() const { return pFnt != 0; }
void Reset() { if( pFnt ) { delete pFnt; pFnt = NULL; } nPos = STRING_LEN; }
@@ -94,7 +91,7 @@ class SwRedlineItr
{ if( pExt ) return pExt->Next( nNext ); return nNext; }
public:
SwRedlineItr( const SwTxtNode& rTxtNd, SwFont& rFnt, SwAttrHandler& rAH,
- xub_StrLen nRedlPos, sal_Bool bShw, const SvUShorts *pArr = 0,
+ xub_StrLen nRedlPos, sal_Bool bShw, const std::vector<sal_uInt16> *pArr = 0,
xub_StrLen nStart = STRING_LEN );
~SwRedlineItr();
inline sal_Bool IsOn() const { return bOn || ( pExt && pExt->IsOn() ); }