[Libreoffice-commits] .: 5 commits - sw/inc sw/source
Nigel Hawkins
nhawkins at kemper.freedesktop.org
Wed Jul 13 13:13:19 PDT 2011
sw/inc/extinput.hxx | 9 +++------
sw/inc/ftnidx.hxx | 9 +++------
sw/source/core/doc/extinput.cxx | 8 +++++---
sw/source/core/doc/ftnidx.cxx | 6 +++---
sw/source/core/text/inftxt.hxx | 8 ++++----
sw/source/core/text/itradj.cxx | 9 ++++-----
sw/source/core/text/itrcrsr.cxx | 22 +++++++++++-----------
sw/source/core/text/porlay.cxx | 4 ++--
sw/source/core/text/porlay.hxx | 9 +++++----
sw/source/core/text/redlnitr.cxx | 9 +++++----
sw/source/core/text/redlnitr.hxx | 13 +++++--------
sw/source/filter/xml/xmlexpit.cxx | 14 +++++++-------
sw/source/filter/xml/xmlexpit.hxx | 6 +++---
sw/source/ui/envelp/label1.cxx | 6 +++---
sw/source/ui/inc/label.hxx | 9 +++++----
15 files changed, 68 insertions(+), 73 deletions(-)
New commits:
commit a465ceb1f8f48e84af19cf7639c6d46fce094216
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date: Wed Jul 13 15:55:53 2011 +0100
Replace SvUShorts with deque in porlay.hxx and cascade.
LGPLv3+/MPL
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index ef427b4..5fb1903 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -178,7 +178,7 @@ protected:
SwTxtPortionTable aMaxWidth;
// for each line, an array of compression values is calculated
// this array is passed over to the info structure
- SvUShorts* pKanaComp;
+ std::deque<sal_uInt16>* pKanaComp;
ViewShell *pVsh;
@@ -365,10 +365,10 @@ public:
inline void ResetKanaIdx(){ nKanaIdx = 0; }
inline void SetKanaIdx( MSHORT nNew ) { nKanaIdx = nNew; }
inline void IncKanaIdx() { ++nKanaIdx; }
- inline void SetKanaComp( SvUShorts *pNew ){ pKanaComp = pNew; }
- inline SvUShorts* GetpKanaComp() const { return pKanaComp; }
+ inline void SetKanaComp( std::deque<sal_uInt16> *pNew ){ pKanaComp = pNew; }
+ inline std::deque<sal_uInt16>* GetpKanaComp() const { return pKanaComp; }
inline sal_uInt16 GetKanaComp() const
- { return ( pKanaComp && nKanaIdx < pKanaComp->Count() )
+ { return ( pKanaComp && nKanaIdx < pKanaComp->size() )
? (*pKanaComp)[nKanaIdx] : 0; }
#if OSL_DEBUG_LEVEL > 1
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index d11dc5e..59b6cae 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -423,7 +423,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
OSL_ENSURE( pCurrent->Height(), "SwTxtAdjuster::CalcBlockAdjust: missing CalcLine()" );
OSL_ENSURE( !pCurrent->GetpKanaComp(), "pKanaComp already exists!!" );
- SvUShorts *pNewKana = new SvUShorts;
+ std::deque<sal_uInt16> *pNewKana = new std::deque<sal_uInt16>();
pCurrent->SetKanaComp( pNewKana );
const sal_uInt16 nNull = 0;
@@ -461,8 +461,8 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
}
else if( pPos->InGlueGrp() && pPos->InFixMargGrp() )
{
- if ( nKanaIdx == pCurrent->GetKanaComp().Count() )
- pCurrent->GetKanaComp().Insert( nNull, nKanaIdx );
+ if ( nKanaIdx == pCurrent->GetKanaComp().size() )
+ pCurrent->GetKanaComp().push_back( nNull );
sal_uInt16 nRest;
@@ -549,8 +549,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
// set fix width to width
((SwTabPortion*)pPos)->SetFixWidth( pPos->Width() );
- const SvUShorts& rKanaComp = pCurrent->GetKanaComp();
- if ( ++nKanaIdx < rKanaComp.Count() )
+ if ( ++nKanaIdx < pCurrent->GetKanaComp().size() )
nCompress = ( pCurrent->GetKanaComp() )[ nKanaIdx ];
nKanaDiffSum = 0;
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 26e092d..ee7307a 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -537,7 +537,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
SwLinePortion *pPor = pCurr->GetFirstPortion();
SwBidiPortion* pLastBidiPor = 0;
SwTwips nLastBidiPorWidth = 0;
- SvUShorts* pKanaComp = pCurr->GetpKanaComp();
+ std::deque<sal_uInt16>* pKanaComp = pCurr->GetpKanaComp();
MSHORT nSpaceIdx = 0;
MSHORT nKanaIdx = 0;
long nSpaceAdd = pCurr->IsSpaceAdd() ? pCurr->GetLLSpaceAdd( 0 ) : 0;
@@ -573,7 +573,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nSpaceAdd = 0;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
++nKanaIdx;
}
if( pPor->InFixMargGrp() )
@@ -591,7 +591,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nSpaceAdd = 0;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
++nKanaIdx;
}
}
@@ -648,7 +648,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
}
if ( pKanaComp &&
- ( nKanaIdx + 1 ) < pKanaComp->Count()
+ ( nKanaIdx + 1 ) < pKanaComp->size()
)
++nKanaIdx;
}
@@ -668,7 +668,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nSpaceAdd = 0;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
++nKanaIdx;
}
@@ -988,7 +988,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nSpaceAdd = 0;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
++nKanaIdx;
}
if ( !pPor->IsFlyPortion() || ( pPor->GetPortion() &&
@@ -1006,7 +1006,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nSpaceAdd = 0;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
++nKanaIdx;
}
if( !pPor->IsFlyPortion() )
@@ -1298,10 +1298,10 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
sal_Bool bHolePortion = sal_False;
sal_Bool bLastHyph = sal_False;
- SvUShorts *pKanaComp = pCurr->GetpKanaComp();
+ std::deque<sal_uInt16> *pKanaComp = pCurr->GetpKanaComp();
xub_StrLen nOldIdx = GetInfo().GetIdx();
MSHORT nSpaceIdx = 0;
- MSHORT nKanaIdx = 0;
+ size_t nKanaIdx = 0;
long nSpaceAdd = pCurr->IsSpaceAdd() ? pCurr->GetLLSpaceAdd( 0 ) : 0;
short nKanaComp = pKanaComp ? (*pKanaComp)[0] : 0;
@@ -1330,7 +1330,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
if( pKanaComp )
{
- if ( nKanaIdx + 1 < pKanaComp->Count() )
+ if ( nKanaIdx + 1 < pKanaComp->size() )
nKanaComp = (*pKanaComp)[++nKanaIdx];
else
nKanaComp = 0;
@@ -1375,7 +1375,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
if ( pKanaComp )
{
- if( nKanaIdx + 1 < pKanaComp->Count() )
+ if( nKanaIdx + 1 < pKanaComp->size() )
nKanaComp = (*pKanaComp)[++nKanaIdx];
else
nKanaComp = 0;
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index c5369b5..285580c 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -339,8 +339,8 @@ SwMarginPortion *SwLineLayout::CalcLeftMargin()
// Die FlyPortion wird ausgesogen ...
pLeft->Join( (SwGluePortion*)pPos );
pPos = pLeft->GetPortion();
- if( GetpKanaComp() )
- GetKanaComp().Remove( 0, 1 );
+ if( GetpKanaComp() && !GetKanaComp().empty() )
+ GetKanaComp().pop_front();
}
else
pPos = 0;
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 7aa26e2..1007c2c 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -37,6 +37,7 @@
#include "swfont.hxx"
#include <vector>
+#include <deque>
class SwMarginPortion;
class SwDropPortion;
@@ -101,7 +102,7 @@ class SwLineLayout : public SwTxtPortion
private:
SwLineLayout *pNext; // Die naechste Zeile.
std::vector<long>* pLLSpaceAdd; // Used for justified alignment.
- SvUShorts* pKanaComp; // Used for Kana compression.
+ std::deque<sal_uInt16>* pKanaComp; // Used for Kana compression.
KSHORT nRealHeight; // Die aus Zeilenabstand/Register resultierende Hoehe.
sal_Bool bFormatAdj : 1;
sal_Bool bDummy : 1;
@@ -210,10 +211,10 @@ public:
//
// STUFF FOR KANA COMPRESSION
//
- inline void SetKanaComp( SvUShorts* pNew ){ pKanaComp = pNew; }
+ inline void SetKanaComp( std::deque<sal_uInt16>* pNew ){ pKanaComp = pNew; }
inline void FinishKanaComp() { delete pKanaComp; pKanaComp = NULL; }
- inline SvUShorts* GetpKanaComp() const { return pKanaComp; }
- inline SvUShorts& GetKanaComp() { return *pKanaComp; }
+ inline std::deque<sal_uInt16>* GetpKanaComp() const { return pKanaComp; }
+ inline std::deque<sal_uInt16>& GetKanaComp() { return *pKanaComp; }
/** determine ascent and descent for positioning of as-character anchored
object
commit 70e75ecc947bc94e634e58a41919d4806eedf0c2
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date: Wed Jul 13 15:07:04 2011 +0100
Replace SvUShorts with vector in xmlexpit.[ch]xx
LGPLv3+/MPL
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index 624f061..04a31ae 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -82,7 +82,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap,
sal_uInt16 nFlags,
- SvUShorts* pIndexArray ) const
+ std::vector<sal_uInt16> *pIndexArray ) const
{
const sal_uInt16 nCount = mrMapEntries->getCount();
sal_uInt16 nIndex = 0;
@@ -104,7 +104,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
// element items do not add any properties,
// we export it later
if( pIndexArray )
- pIndexArray->Insert( nIndex, pIndexArray->Count() );
+ pIndexArray->push_back( nIndex );
}
else
@@ -240,14 +240,14 @@ void SvXMLExportItemMapper::exportElementItems(
const SvXMLUnitConverter& rUnitConverter,
const SfxItemSet &rSet,
sal_uInt16 nFlags,
- const SvUShorts& rIndexArray ) const
+ const std::vector<sal_uInt16> &rIndexArray ) const
{
- const sal_uInt16 nCount = rIndexArray.Count();
+ const sal_uInt16 nCount = rIndexArray.size();
sal_Bool bItemsExported = sal_False;
for( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ )
{
- const sal_uInt16 nElement = rIndexArray.GetObject( nIndex );
+ const sal_uInt16 nElement = rIndexArray[ nIndex ];
SvXMLItemMapEntry* pEntry = mrMapEntries->getByIndex( nElement );
OSL_ENSURE( 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_EXPORT),
"wrong mid flag!" );
@@ -313,14 +313,14 @@ void SvXMLExportItemMapper::exportXML( SvXMLExport& rExport,
XMLTokenEnum ePropToken,
sal_uInt16 nFlags ) const
{
- SvUShorts aIndexArray;
+ std::vector<sal_uInt16> aIndexArray;
exportXML( rExport, rExport.GetAttrList(), rSet, rUnitConverter,
rExport.GetNamespaceMap(), nFlags, &aIndexArray );
if( rExport.GetAttrList().getLength() > 0L ||
(nFlags & XML_EXPORT_FLAG_EMPTY) != 0 ||
- aIndexArray.Count() != 0 )
+ !aIndexArray.empty() )
{
if( (nFlags & XML_EXPORT_FLAG_IGN_WS) != 0 )
{
diff --git a/sw/source/filter/xml/xmlexpit.hxx b/sw/source/filter/xml/xmlexpit.hxx
index e622a6c..55090e9 100644
--- a/sw/source/filter/xml/xmlexpit.hxx
+++ b/sw/source/filter/xml/xmlexpit.hxx
@@ -32,6 +32,7 @@
#include <tools/solar.h>
#include <tools/ref.hxx>
#include "xmlitmap.hxx"
+#include <vector>
#define XML_EXPORT_FLAG_DEFAULTS 0x0001 // export also default items
#define XML_EXPORT_FLAG_DEEP 0x0002 // export also items from
@@ -46,7 +47,6 @@ class SfxPoolItem;
class SfxItemSet;
class SvXMLAttributeList;
class SvXMLNamespaceMap;
-class SvUShorts;
class SvXMLExport;
@@ -62,7 +62,7 @@ protected:
const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap,
sal_uInt16 nFlags,
- SvUShorts* pIndexArray ) const;
+ std::vector<sal_uInt16> *pIndexArray ) const;
void exportXML( const SvXMLExport& rExport,
SvXMLAttributeList& rAttrList,
@@ -78,7 +78,7 @@ protected:
const SvXMLUnitConverter& rUnitConverter,
const SfxItemSet &rSet,
sal_uInt16 nFlags,
- const SvUShorts& rIndexArray ) const;
+ const std::vector<sal_uInt16> &rIndexArray ) const;
static const SfxPoolItem* GetItem( const SfxItemSet &rSet,
sal_uInt16 nWhichId,
commit 6c1ac29131e32037f0153b8d61f16900d168c6ac
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date: Wed Jul 13 14:46:39 2011 +0100
Replace SvUShorts with vector in ftnidx.[ch]xx
LGPLv3+/MPL
diff --git a/sw/inc/ftnidx.hxx b/sw/inc/ftnidx.hxx
index a3e755a..87a7e40 100644
--- a/sw/inc/ftnidx.hxx
+++ b/sw/inc/ftnidx.hxx
@@ -28,9 +28,8 @@
#ifndef _FTNIDX_HXX
#define _FTNIDX_HXX
-
-#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
+#include <vector>
class SwTxtFtn;
class SwNodeIndex;
@@ -60,12 +59,10 @@ public:
class SwUpdFtnEndNtAtEnd
{
SvPtrarr aFtnSects, aEndSects;
- SvUShorts aFtnNums, aEndNums;
+ std::vector<sal_uInt16> aFtnNums, aEndNums;
public:
- SwUpdFtnEndNtAtEnd() : aFtnSects( 0, 4 ), aEndSects( 0, 4 ),
- aFtnNums( 0, 4 ), aEndNums( 0, 4 )
- {}
+ SwUpdFtnEndNtAtEnd() : aFtnSects( 0, 4 ), aEndSects( 0, 4 ) {}
static const SwSectionNode* FindSectNdWithEndAttr(
const SwTxtFtn& rTxtFtn );
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index 7cf4ad5..39db8ad 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -356,7 +356,7 @@ sal_uInt16 SwUpdFtnEndNtAtEnd::GetNumber( const SwTxtFtn& rTxtFtn,
{
sal_uInt16 nRet = 0, nWh;
SvPtrarr* pArr;
- SvUShorts* pNum;
+ std::vector<sal_uInt16> *pNum;
if( rTxtFtn.GetFtn().IsEndNote() )
{
pArr = &aEndSects;
@@ -374,7 +374,7 @@ sal_uInt16 SwUpdFtnEndNtAtEnd::GetNumber( const SwTxtFtn& rTxtFtn,
for( sal_uInt16 n = pArr->Count(); n; )
if( pArr->GetObject( --n ) == pNd )
{
- nRet = ++pNum->GetObject( n );
+ nRet = ++((*pNum)[ n ]);
break;
}
@@ -384,7 +384,7 @@ sal_uInt16 SwUpdFtnEndNtAtEnd::GetNumber( const SwTxtFtn& rTxtFtn,
nRet = ((SwFmtFtnEndAtTxtEnd&)rNd.GetSection().GetFmt()->
GetFmtAttr( nWh )).GetOffset();
++nRet;
- pNum->Insert( nRet, pNum->Count() );
+ pNum->push_back( nRet );
}
return nRet;
}
commit 52b7adfe28c4ebff5889ea6b7397ea6c5611d0d4
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date: Wed Jul 13 14:22:48 2011 +0100
Replace SvUShorts with vector in extinput.hxx and cascade changes.
LGPLv3+/MPL.
diff --git a/sw/inc/extinput.hxx b/sw/inc/extinput.hxx
index e669b32..d7cd8aa 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 48afc9b..85b1277 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 ffdd20f..03f1ba7 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 762aeab..c85c36a 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 ⇒ // XAMA: Array of xub_StrLen
+ const std::vector<sal_uInt16> ⇒ // 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() ); }
commit e1edf287ddca68fbc39b40dbb3d934fa6a858f1b
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date: Wed Jul 13 13:41:41 2011 +0100
Replace SvUShorts with vector in label.hxx and label1.cxx.
LGPLv3+/MPL
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index ad5ea2a..94f7153 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -412,7 +412,7 @@ IMPL_LINK( SwLabPage, MakeHdl, ListBox *, EMPTYARG )
aTypeBox.Clear();
aHiddenSortTypeBox.Clear();
- GetParent()->TypeIds().Remove( 0, GetParent()->TypeIds().Count() );
+ GetParent()->TypeIds().clear();
const String aMake = aMakeBox.GetSelectEntry();
GetParent()->ReplaceGroup( aMake );
@@ -443,9 +443,9 @@ IMPL_LINK( SwLabPage, MakeHdl, ListBox *, EMPTYARG )
}
if(bInsert)
{
- GetParent()->TypeIds().Insert(i, GetParent()->TypeIds().Count());
+ GetParent()->TypeIds().push_back(i);
if ( !nLstType && aType == String(aItem.aLstType) )
- nLstType = GetParent()->TypeIds().Count();
+ nLstType = GetParent()->TypeIds().size();
}
}
for(sal_uInt16 nEntry = 0; nEntry < aHiddenSortTypeBox.GetEntryCount(); nEntry++)
diff --git a/sw/source/ui/inc/label.hxx b/sw/source/ui/inc/label.hxx
index 4f18062..9a330e7 100644
--- a/sw/source/ui/inc/label.hxx
+++ b/sw/source/ui/inc/label.hxx
@@ -30,12 +30,13 @@
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
-#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
#endif
#include <sfx2/tabdlg.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <labelcfg.hxx>
+#include <vector>
+
class SwLabRec;
class SwLabRecs;
class SwLabItem;
@@ -49,7 +50,7 @@ class SwLabDlg : public SfxTabDialog
SwNewDBMgr* pNewDBMgr;
SwLabPrtPage* pPrtPage;
- SvUShorts aTypeIds;
+ std::vector<sal_uInt16> aTypeIds;
SvStringsDtor aMakes;
SwLabRecs* pRecs;
@@ -73,8 +74,8 @@ public:
SwLabRecs &Recs() { return *pRecs; }
const SwLabRecs &Recs() const { return *pRecs; }
- SvUShorts &TypeIds() { return aTypeIds; }
- const SvUShorts &TypeIds() const { return aTypeIds; }
+ std::vector<sal_uInt16> &TypeIds() { return aTypeIds; }
+ const std::vector<sal_uInt16> &TypeIds() const { return aTypeIds; }
SvStringsDtor &Makes() { return aMakes; }
const SvStringsDtor &Makes() const { return aMakes; }
More information about the Libreoffice-commits
mailing list