[Libreoffice-commits] .: 2 commits - sw/source
August Sodora
augsod at kemper.freedesktop.org
Fri Jan 13 19:53:33 PST 2012
sw/source/filter/html/htmlftn.cxx | 16 +++++++---------
sw/source/filter/xml/xmltbli.cxx | 19 +++++++++----------
sw/source/filter/xml/xmltbli.hxx | 2 +-
3 files changed, 17 insertions(+), 20 deletions(-)
New commits:
commit ffaa6ae12d40419ec043607c9a34fb80677683dd
Author: August Sodora <augsod at gmail.com>
Date: Fri Jan 13 22:53:06 2012 -0500
SvStringsDtor->std::vector
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 61e19c8..978e5e1 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1538,16 +1538,16 @@ void SwXMLTableContext::InsertColumn( sal_Int32 nWidth2, sal_Bool bRelWidth2,
{
if( !pColumnDefaultCellStyleNames )
{
- pColumnDefaultCellStyleNames = new SvStringsDtor;
+ pColumnDefaultCellStyleNames = new std::vector<String>;
sal_uLong nCount = aColumnWidths.size() - 1;
while( nCount-- )
- pColumnDefaultCellStyleNames->Insert( new String,
- pColumnDefaultCellStyleNames->Count() );
+ pColumnDefaultCellStyleNames->push_back(String());
}
- pColumnDefaultCellStyleNames->Insert(
- pDfltCellStyleName ? new String( *pDfltCellStyleName ) : new String,
- pColumnDefaultCellStyleNames->Count() );
+ if(pDfltCellStyleName)
+ pColumnDefaultCellStyleNames->push_back(*pDfltCellStyleName);
+ else
+ pColumnDefaultCellStyleNames->push_back(String());
}
}
@@ -1567,11 +1567,10 @@ sal_Int32 SwXMLTableContext::GetColumnWidth( sal_uInt32 nCol,
OUString SwXMLTableContext::GetColumnDefaultCellStyleName( sal_uInt32 nCol ) const
{
- OUString sRet;
- if( pColumnDefaultCellStyleNames )
- sRet = *(*pColumnDefaultCellStyleNames)[(sal_uInt16)nCol];
+ if( pColumnDefaultCellStyleNames && nCol < pColumnDefaultCellStyleNames->size())
+ return (*pColumnDefaultCellStyleNames)[static_cast<size_t>(nCol)];
- return sRet;
+ return OUString();
}
void SwXMLTableContext::InsertCell( const OUString& rStyleName,
diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx
index ea94139..c83d26b 100644
--- a/sw/source/filter/xml/xmltbli.hxx
+++ b/sw/source/filter/xml/xmltbli.hxx
@@ -70,7 +70,7 @@ class SwXMLTableContext : public XMLTextTableContext
inline ColumnWidthInfo(sal_uInt16 wdth, bool isRel) : width(wdth), isRelative(isRel) {};
};
std::vector<ColumnWidthInfo> aColumnWidths;
- SvStringsDtor *pColumnDefaultCellStyleNames;
+ std::vector<String> *pColumnDefaultCellStyleNames;
::com::sun::star::uno::Reference <
::com::sun::star::text::XTextCursor > xOldCursor;
commit a93df89c4b7f68a079544d9490de552ff0aae2fb
Author: August Sodora <augsod at gmail.com>
Date: Fri Jan 13 22:46:38 2012 -0500
SvStringsDtor->std::vector
diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx
index 39f9a89..f10de6e 100644
--- a/sw/source/filter/html/htmlftn.cxx
+++ b/sw/source/filter/html/htmlftn.cxx
@@ -46,7 +46,7 @@ SV_DECL_PTRARR( SwHTMLTxtFtns, SwTxtFtnPtr, 1, 1 )
struct SwHTMLFootEndNote_Impl
{
SwHTMLTxtFtns aTxtFtns;
- SvStringsDtor aNames;
+ std::vector<String> aNames;
String sName;
String sContent; // Infos fuer die letzte Fussnote
@@ -229,8 +229,7 @@ void SwHTMLParser::FinishFootEndNote()
pFootEndNoteImpl->aTxtFtns.Insert( pTxtFtn,
pFootEndNoteImpl->aTxtFtns.Count() );
- pFootEndNoteImpl->aNames.Insert( new String(pFootEndNoteImpl->sName),
- pFootEndNoteImpl->aNames.Count() );
+ pFootEndNoteImpl->aNames.push_back(pFootEndNoteImpl->sName);
}
pFootEndNoteImpl->sName = aEmptyStr;
pFootEndNoteImpl->sContent = aEmptyStr;
@@ -256,18 +255,17 @@ SwNodeIndex *SwHTMLParser::GetFootEndNoteSection( const String& rName )
if( pFootEndNoteImpl )
{
String aName( rName );
- // TODO: ToUpperAscii
aName.ToUpperAscii();
- sal_uInt16 nCount = pFootEndNoteImpl->aNames.Count();
- for( sal_uInt16 i=0; i<nCount; i++ )
+ size_t nCount = pFootEndNoteImpl->aNames.size();
+ for(size_t i = 0; i < nCount; ++i)
{
- if( *pFootEndNoteImpl->aNames[i] == aName )
+ if(pFootEndNoteImpl->aNames[i] == aName)
{
pStartNodeIdx = pFootEndNoteImpl->aTxtFtns[i]->GetStartNode();
- pFootEndNoteImpl->aNames.DeleteAndDestroy( i, 1 );
+ pFootEndNoteImpl->aNames.erase(pFootEndNoteImpl->aNames.begin() + i);
pFootEndNoteImpl->aTxtFtns.Remove( i, 1 );
- if( !pFootEndNoteImpl->aNames.Count() )
+ if(pFootEndNoteImpl->aNames.empty())
{
delete pFootEndNoteImpl;
pFootEndNoteImpl = 0;
More information about the Libreoffice-commits
mailing list