[Libreoffice-commits] .: 2 commits - sw/inc sw/source
Nigel Hawkins
nhawkins at kemper.freedesktop.org
Fri Jul 22 07:59:16 PDT 2011
sw/inc/doc.hxx | 3 +--
sw/inc/ndtxt.hxx | 2 +-
sw/inc/node.hxx | 2 +-
sw/source/core/doc/docedt.cxx | 10 +++++-----
sw/source/core/doc/docfmt.cxx | 7 +++----
sw/source/core/docnode/ndtbl.cxx | 12 ++++++------
sw/source/core/docnode/node.cxx | 12 +++++-------
sw/source/core/edit/autofmt.cxx | 16 ++++++----------
sw/source/core/inc/UndoTable.hxx | 9 ++-------
sw/source/core/inc/rolbck.hxx | 11 ++++-------
sw/source/core/txtnode/ndtxt.cxx | 24 ++++++++++++------------
sw/source/core/undo/rolbck.cxx | 22 +++++++++++-----------
sw/source/core/undo/unattr.cxx | 5 ++---
sw/source/core/undo/untbl.cxx | 5 ++---
14 files changed, 61 insertions(+), 79 deletions(-)
New commits:
commit e22b1ed77884bb08e4fd00f23cdfc4b32077ed95
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date: Fri Jul 22 15:08:35 2011 +0100
Replace SvUShorts with vector in rolbck.hxx and cascade changes.
LGPLv3+/MPL
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index f5c2610..0b8f9f7 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -242,7 +242,7 @@ public:
virtual sal_Bool SetAttr( const SfxPoolItem& );
virtual sal_Bool SetAttr( const SfxItemSet& rSet );
virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
- virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr );
+ virtual sal_Bool ResetAttr( const std::vector<sal_uInt16>& rWhichArr );
virtual sal_uInt16 ResetAllAttr();
/// insert text content
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 0492fee..84555e1 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -452,7 +452,7 @@ public:
virtual sal_Bool SetAttr( const SfxPoolItem& );
virtual sal_Bool SetAttr( const SfxItemSet& rSet );
virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
- virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr );
+ virtual sal_Bool ResetAttr( const std::vector<sal_uInt16>& rWhichArr );
virtual sal_uInt16 ResetAllAttr();
// Obtains attribute that is not delivered via conditional style!
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 7f6a5f3..7cd35a5 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -1255,9 +1255,9 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
}
// Convert list of ranges of whichIds to a corresponding list of whichIds
-SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges)
+std::vector<sal_uInt16> * lcl_RangesToVector(sal_uInt16 * pRanges)
{
- SvUShorts * pResult = new SvUShorts();
+ std::vector<sal_uInt16> * pResult = new std::vector<sal_uInt16>();
int i = 0;
while (pRanges[i] != 0)
@@ -1265,7 +1265,7 @@ SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges)
OSL_ENSURE(pRanges[i+1] != 0, "malformed ranges");
for (sal_uInt16 j = pRanges[i]; j < pRanges[i+1]; j++)
- pResult->Insert(j, pResult->Count());
+ pResult->push_back(j);
i += 2;
}
@@ -1423,8 +1423,8 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
first resetting all character attributes in first
paragraph (pTxtNd).
*/
- SvUShorts * pShorts =
- lcl_RangesToUShorts(aCharFmtSetRange);
+ std::vector<sal_uInt16> * pShorts =
+ lcl_RangesToVector(aCharFmtSetRange);
pTxtNd->ResetAttr(*pShorts);
delete pShorts;
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 7116ed5..1bfe62a 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -31,7 +31,6 @@
#define _ZFORLIST_DECLARE_TABLE
-#define _SVSTDARR_USHORTS
#include <hintids.hxx>
#include <rtl/logfile.hxx>
#include <svl/itemiter.hxx>
@@ -213,7 +212,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
0 );
const SfxItemSet* pSet = pNode->GetpSwAttrSet();
- SvUShorts aClearWhichIds;
+ std::vector<sal_uInt16> aClearWhichIds;
// restoring all paragraph list attributes
{
SfxItemSet aListAttrSet( pDoc->GetAttrPool(),
@@ -227,7 +226,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
const SfxPoolItem* pItem = aIter.GetCurItem();
while( pItem )
{
- aClearWhichIds.Insert( pItem->Which(), aClearWhichIds.Count() );
+ aClearWhichIds.push_back( pItem->Which() );
pItem = aIter.NextItem();
}
}
@@ -265,7 +264,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
if( bSave )
{
aSet.Put( *pItem );
- aClearWhichIds.Insert( aSavIds[n], aClearWhichIds.Count() );
+ aClearWhichIds.push_back( aSavIds[n] );
}
}
}
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 1b80f83..b639676 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1561,7 +1561,7 @@ sal_Bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
}
return bRet;
}
-sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
+sal_Bool SwCntntNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr )
{
if( !GetpSwAttrSet() )
return sal_False;
@@ -1576,10 +1576,7 @@ sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
sal_uInt16 nDel = 0;
if( IsModifyLocked() )
{
- std::vector<sal_uInt16> aClearWhichIds;
- for( sal_uInt16 n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n )
- aClearWhichIds.push_back( rWhichArr[ n ] );
-
+ std::vector<sal_uInt16> aClearWhichIds(rWhichArr);
nDel = ClearItemsFromAttrSet( aClearWhichIds );
}
else
@@ -1587,8 +1584,9 @@ sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ),
aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() );
- for( sal_uInt16 n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n )
- if( AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, rWhichArr[ n ], &aOld, &aNew ))
+ std::vector<sal_uInt16>::const_iterator it;
+ for ( it = rWhichArr.begin(); it != rWhichArr.end(); ++it )
+ if( AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, *it, &aOld, &aNew ))
++nDel;
if( nDel )
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index f493f4b..8d914af 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -29,12 +29,9 @@
#define _ROLBCK_HXX
#include <tools/solar.h>
-#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
-#endif
#include <svl/itemset.hxx>
+#include <vector>
#include <set>
//Nur die History anziehen, um das docnew.cxx gegen die CLOOK's zu behaupten.
@@ -282,7 +279,7 @@ class SwHistoryBookmark : public SwHistoryHint
class SwHistorySetAttrSet : public SwHistoryHint
{
SfxItemSet m_OldSet;
- SvUShorts m_ResetArray;
+ std::vector<sal_uInt16> m_ResetArray;
const sal_uLong m_nNodeIndex;
public:
@@ -297,7 +294,7 @@ class SwHistoryResetAttrSet : public SwHistoryHint
const sal_uLong m_nNodeIndex;
const xub_StrLen m_nStart;
const xub_StrLen m_nEnd;
- SvUShorts m_Array;
+ std::vector<sal_uInt16> m_Array;
public:
SwHistoryResetAttrSet( const SfxItemSet& rSet, sal_uLong nNode,
@@ -305,7 +302,7 @@ public:
xub_StrLen nEnd = STRING_MAXLEN );
virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
- const SvUShorts& GetArr() const { return m_Array; }
+ const std::vector<sal_uInt16>& GetArr() const { return m_Array; }
sal_uLong GetNode() const { return m_nNodeIndex; }
xub_StrLen GetCntnt() const { return m_nStart; }
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 4151c66..68d8340 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -4454,7 +4454,7 @@ namespace {
const sal_uInt16 nWhich1,
const sal_uInt16 nWhich2 );
HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
- const SvUShorts& rWhichArr );
+ const std::vector<sal_uInt16>& rWhichArr );
HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode );
~HandleResetAttrAtTxtNode();
@@ -4567,7 +4567,7 @@ namespace {
}
HandleResetAttrAtTxtNode::HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
- const SvUShorts& rWhichArr )
+ const std::vector<sal_uInt16>& rWhichArr )
: mrTxtNode( rTxtNode ),
mbListStyleOrIdReset( false ),
mbUpdateListLevel( false ),
@@ -4576,17 +4576,17 @@ namespace {
{
bool bRemoveFromList( false );
{
- const sal_uInt16 nEnd = rWhichArr.Count();
- for ( sal_uInt16 n = 0; n < nEnd; ++n )
+ std::vector<sal_uInt16>::const_iterator it;
+ for ( it = rWhichArr.begin(); it != rWhichArr.end(); ++it)
{
// RES_PARATR_NUMRULE and RES_PARATR_LIST_ID
- if ( rWhichArr[ n ] == RES_PARATR_NUMRULE )
+ if ( *it == RES_PARATR_NUMRULE )
{
bRemoveFromList = bRemoveFromList ||
mrTxtNode.GetNumRule() != 0;
mbListStyleOrIdReset = true;
}
- else if ( rWhichArr[ n ] == RES_PARATR_LIST_ID )
+ else if ( *it == RES_PARATR_LIST_ID )
{
bRemoveFromList = bRemoveFromList ||
( mrTxtNode.GetpSwAttrSet() &&
@@ -4596,7 +4596,7 @@ namespace {
}
// #i70748#
// RES_PARATR_OUTLINELEVEL
- else if ( rWhichArr[ n ] == RES_PARATR_OUTLINELEVEL )
+ else if ( *it == RES_PARATR_OUTLINELEVEL )
{
mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
}
@@ -4605,19 +4605,19 @@ namespace {
{
// RES_PARATR_LIST_LEVEL
mbUpdateListLevel = mbUpdateListLevel ||
- ( rWhichArr[ n ] == RES_PARATR_LIST_LEVEL &&
+ ( *it == RES_PARATR_LIST_LEVEL &&
mrTxtNode.HasAttrListLevel() );
// RES_PARATR_LIST_ISRESTART and RES_PARATR_LIST_RESTARTVALUE
mbUpdateListRestart = mbUpdateListRestart ||
- ( rWhichArr[ n ] == RES_PARATR_LIST_ISRESTART &&
+ ( *it == RES_PARATR_LIST_ISRESTART &&
mrTxtNode.IsListRestart() ) ||
- ( rWhichArr[ n ] == RES_PARATR_LIST_RESTARTVALUE &&
+ ( *it == RES_PARATR_LIST_RESTARTVALUE &&
mrTxtNode.HasAttrListRestartValue() );
// RES_PARATR_LIST_ISCOUNTED
mbUpdateListCount = mbUpdateListCount ||
- ( rWhichArr[ n ] == RES_PARATR_LIST_ISCOUNTED &&
+ ( *it == RES_PARATR_LIST_ISCOUNTED &&
!mrTxtNode.IsCountedInList() );
}
}
@@ -4718,7 +4718,7 @@ sal_Bool SwTxtNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
return bRet;
}
-sal_Bool SwTxtNode::ResetAttr( const SvUShorts& rWhichArr )
+sal_Bool SwTxtNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr )
{
const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
mbInSetOrResetAttr = true;
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 27f44b0..1d77c66 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -729,7 +729,7 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
do {
if( !rSetArr.count( pOrigItem->Which() ))
{
- m_ResetArray.Insert( pOrigItem->Which(), m_ResetArray.Count() );
+ m_ResetArray.push_back( pOrigItem->Which() );
m_OldSet.ClearItem( pOrigItem->Which() );
}
else
@@ -798,7 +798,7 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
if ( pNode->IsCntntNode() )
{
static_cast<SwCntntNode*>(pNode)->SetAttr( m_OldSet );
- if ( m_ResetArray.Count() )
+ if ( !m_ResetArray.empty() )
{
static_cast<SwCntntNode*>(pNode)->ResetAttr( m_ResetArray );
}
@@ -808,9 +808,9 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
SwFmt& rFmt =
*static_cast<SwTableNode*>(pNode)->GetTable().GetFrmFmt();
rFmt.SetFmtAttr( m_OldSet );
- if ( m_ResetArray.Count() )
+ if ( !m_ResetArray.empty() )
{
- rFmt.ResetFmtAttr( *m_ResetArray.GetData() );
+ rFmt.ResetFmtAttr( m_ResetArray.front() );
}
}
}
@@ -857,7 +857,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
}
else
{
- m_Array.Insert( aIter.GetCurItem()->Which(), m_Array.Count() );
+ m_Array.push_back( aIter.GetCurItem()->Which() );
}
if( aIter.IsAtEnd() )
@@ -868,7 +868,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
if ( bAutoStyle )
{
- m_Array.Insert( RES_TXTATR_AUTOFMT, m_Array.Count() );
+ m_Array.push_back( RES_TXTATR_AUTOFMT );
}
}
@@ -882,22 +882,22 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
if (pCntntNd)
{
- const sal_uInt16* pArr = m_Array.GetData();
+ std::vector<sal_uInt16>::iterator it;
if ( USHRT_MAX == m_nEnd && USHRT_MAX == m_nStart )
{
// no area: use ContentNode
- for ( sal_uInt16 n = m_Array.Count(); n; --n, ++pArr )
+ for ( it = m_Array.begin(); it != m_Array.end(); ++it )
{
- pCntntNd->ResetAttr( *pArr );
+ pCntntNd->ResetAttr( *it );
}
}
else
{
// area: use TextNode
- for ( sal_uInt16 n = m_Array.Count(); n; --n, ++pArr )
+ for ( it = m_Array.begin(); it != m_Array.end(); ++it )
{
static_cast<SwTxtNode*>(pCntntNd)->
- DeleteAttributes( *pArr, m_nStart, m_nEnd );
+ DeleteAttributes( *it, m_nStart, m_nEnd );
}
}
}
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index c30d924..5d3ab70 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#define _SVSTDARR_USHORTS
#include <UndoAttribute.hxx>
#include <svl/itemiter.hxx>
@@ -967,8 +966,8 @@ void SwUndoAttr::RemoveIdx( SwDoc& rDoc )
nCntnt = pHistoryHint->GetCntnt();
if ( STRING_MAXLEN != nCntnt )
{
- const SvUShorts& rArr = pHistoryHint->GetArr();
- for ( sal_uInt16 i = rArr.Count(); i; )
+ const std::vector<sal_uInt16>& rArr = pHistoryHint->GetArr();
+ for ( sal_uInt16 i = rArr.size(); i; )
{
if ( RES_TXTATR_FTN == rArr[ --i ] )
{
commit 2a8471f621f913b22693b275c84fbbd62310f430
Author: Nigel Hawkins <n.hawkins at gmx.com>
Date: Fri Jul 22 11:26:58 2011 +0100
Replace SvUShorts with vector in UndoTable.hxx and cascade changes.
LGPLv3+/MPL
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 32d438c..f527a1a 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -110,7 +110,6 @@ class VirtualDevice;
class SfxPrinter;
class SvNumberFormatter;
class SvStringsSort;
-class SvUShorts;
class SvxMacro;
class SvxMacroTableDtor;
class SwAutoCompleteWord;
@@ -1568,7 +1567,7 @@ public:
const SwPosition& rPos, sal_uInt16 nRows,
sal_uInt16 nCols, short eAdjust,
const SwTableAutoFmt* pTAFmt = 0,
- const SvUShorts* pColArr = 0,
+ const std::vector<sal_uInt16> *pColArr = 0,
sal_Bool bCalledFromShell = sal_False,
sal_Bool bNewModel = sal_True );
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 1148bfe..f1a111f 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -339,7 +339,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
const SwPosition& rPos, sal_uInt16 nRows,
sal_uInt16 nCols, sal_Int16 eAdjust,
const SwTableAutoFmt* pTAFmt,
- const SvUShorts* pColArr,
+ const std::vector<sal_uInt16> *pColArr,
sal_Bool bCalledFromShell,
sal_Bool bNewModel )
{
@@ -354,7 +354,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
// sollte das ColumnArray die falsche Anzahl haben wird es ignoriert!
if( pColArr &&
- (nCols + ( text::HoriOrientation::NONE == eAdjust ? 2 : 1 )) != pColArr->Count() )
+ (nCols + ( text::HoriOrientation::NONE == eAdjust ? 2 : 1 )) != pColArr->size() )
pColArr = 0;
}
@@ -426,12 +426,12 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
SwTwips nWidth = USHRT_MAX;
if( pColArr )
{
- sal_uInt16 nSttPos = (*pColArr)[ 0 ];
- sal_uInt16 nLastPos = (*pColArr)[ sal_uInt16(pColArr->Count()-1)];
+ sal_uInt16 nSttPos = pColArr->front();
+ sal_uInt16 nLastPos = pColArr->back();
if( text::HoriOrientation::NONE == eAdjust )
{
sal_uInt16 nFrmWidth = nLastPos;
- nLastPos = (*pColArr)[ sal_uInt16(pColArr->Count()-2)];
+ nLastPos = (*pColArr)[ pColArr->size()-2 ];
pTableFmt->SetFmtAttr( SvxLRSpaceItem( nSttPos, nFrmWidth - nLastPos, 0, 0, RES_LR_SPACE ) );
}
nWidth = nLastPos - nSttPos;
@@ -531,7 +531,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
// Positionen der Spalten!! (nicht deren Breite!)
if( pColArr )
{
- nWidth = (*pColArr)[ sal_uInt16(i + 1) ] - (*pColArr)[ i ];
+ nWidth = (*pColArr)[ i + 1 ] - (*pColArr)[ i ];
if( pBoxF->GetFrmSize().GetWidth() != nWidth )
{
if( pBoxF->GetDepends() ) // neues Format erzeugen!
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 25156a1..cf30fef 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -29,13 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#define _SVSTDARR_USHORTS
-
#include <ctype.h>
#include <hintids.hxx>
-#include <svl/svstdarr.hxx>
-
#include <unotools/charclass.hxx>
#include <vcl/msgbox.hxx>
@@ -660,7 +656,7 @@ sal_Bool SwAutoFormat::DoTable()
xub_StrLen n = nSttPlus;
const sal_Unicode* pStr = rTmp.GetBuffer() + n;
- SvUShorts aPosArr( 5, 5 );
+ std::vector<sal_uInt16> aPosArr;
while( *pStr )
{
@@ -675,7 +671,7 @@ sal_Bool SwAutoFormat::DoTable()
case '+':
case '|':
- aPosArr.Insert( static_cast<sal_uInt16>(aInfo.GetCharPos(n)), aPosArr.Count() );
+ aPosArr.push_back( static_cast<sal_uInt16>(aInfo.GetCharPos(n)) );
break;
default:
@@ -687,10 +683,10 @@ sal_Bool SwAutoFormat::DoTable()
++pStr;
}
- if( 1 < aPosArr.Count() )
+ if( 1 < aPosArr.size() )
{
// Ausrichtung vom Textnode besorgen:
- sal_uInt16 nColCnt = aPosArr.Count() - 1;
+ sal_uInt16 nColCnt = aPosArr.size() - 1;
SwTwips nSttPos = aPosArr[ 0 ];
sal_Int16 eHori;
switch( pAktTxtNd->GetSwAttrSet().GetAdjust().GetAdjust() )
@@ -704,7 +700,7 @@ sal_Bool SwAutoFormat::DoTable()
eHori = text::HoriOrientation::NONE;
// dann muss als letztes noch die akt. FrameBreite
// ins Array
- aPosArr.Insert( static_cast<sal_uInt16>(pAktTxtFrm->Frm().Width()), aPosArr.Count() );
+ aPosArr.push_back( static_cast<sal_uInt16>(pAktTxtFrm->Frm().Width()) );
}
else
eHori = text::HoriOrientation::LEFT;
@@ -720,7 +716,7 @@ sal_Bool SwAutoFormat::DoTable()
0, &aPosArr );
aDelPam.GetPoint()->nNode = aIdx;
}
- return 1 < aPosArr.Count();
+ return 1 < aPosArr.size();
}
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index be93d4a..a661bc2 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -30,11 +30,6 @@
#include <undobj.hxx>
-#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
-#endif
-
#include <vector>
#include <set>
#include <swtypes.hxx>
@@ -63,7 +58,7 @@ class SwUndoInsTbl : public SwUndo
String sTblNm;
SwInsertTableOptions aInsTblOpts;
SwDDEFieldType* pDDEFldType;
- SvUShorts* pColWidth;
+ std::vector<sal_uInt16> *pColWidth;
SwRedlineData* pRedlData;
SwTableAutoFmt* pAutoFmt;
sal_uLong nSttNode;
@@ -73,7 +68,7 @@ class SwUndoInsTbl : public SwUndo
public:
SwUndoInsTbl( const SwPosition&, sal_uInt16 nCols, sal_uInt16 nRows,
sal_uInt16 eAdjust, const SwInsertTableOptions& rInsTblOpts,
- const SwTableAutoFmt* pTAFmt, const SvUShorts* pColArr,
+ const SwTableAutoFmt* pTAFmt, const std::vector<sal_uInt16> *pColArr,
const String & rName);
virtual ~SwUndoInsTbl();
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 72db551..f054e25 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -240,7 +240,7 @@ sal_uInt16 aSave_BoxCntntSet[] = {
SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 nRw,
sal_uInt16 nAdj, const SwInsertTableOptions& rInsTblOpts,
const SwTableAutoFmt* pTAFmt,
- const SvUShorts* pColArr,
+ const std::vector<sal_uInt16> *pColArr,
const String & rName)
: SwUndo( UNDO_INSTABLE ),
aInsTblOpts( rInsTblOpts ), pDDEFldType( 0 ), pColWidth( 0 ), pRedlData( 0 ), pAutoFmt( 0 ),
@@ -248,8 +248,7 @@ SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 n
{
if( pColArr )
{
- pColWidth = new SvUShorts( 0, 1 );
- pColWidth->Insert( pColArr, 0 );
+ pColWidth = new std::vector<sal_uInt16>(*pColArr);
}
if( pTAFmt )
pAutoFmt = new SwTableAutoFmt( *pTAFmt );
More information about the Libreoffice-commits
mailing list