Kaydet (Commit) 9dc652ec authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR_DEL(SwGetINetAttrs) to boost::ptr_vector

Change-Id: Iad3903162219e1b015c1266592e5ea742fa967d2
üst cf0e08c6
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <set> #include <set>
#include <swundo.hxx> #include <swundo.hxx>
#include <svtools/embedhlp.hxx> #include <svtools/embedhlp.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
class PolyPolygon; class PolyPolygon;
class SwDoc; class SwDoc;
...@@ -139,7 +140,7 @@ struct SwGetINetAttr ...@@ -139,7 +140,7 @@ struct SwGetINetAttr
: sText( rTxt ), rINetAttr( rAttr ) : sText( rTxt ), rINetAttr( rAttr )
{} {}
}; };
SV_DECL_PTRARR_DEL( SwGetINetAttrs, SwGetINetAttr*, 0 ) typedef boost::ptr_vector<SwGetINetAttr> SwGetINetAttrs;
// Types of forms of content. // Types of forms of content.
#define CNT_TXT 0x0001 #define CNT_TXT 0x0001
......
...@@ -71,8 +71,6 @@ ...@@ -71,8 +71,6 @@
using namespace com::sun::star; using namespace com::sun::star;
SV_IMPL_PTRARR(SwGetINetAttrs, SwGetINetAttr*)
/****************************************************************************** /******************************************************************************
* void SwEditShell::Insert(char c) * void SwEditShell::Insert(char c)
******************************************************************************/ ******************************************************************************/
...@@ -772,8 +770,7 @@ sal_Bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const String& rStr, s ...@@ -772,8 +770,7 @@ sal_Bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const String& rStr, s
sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
{ {
if( rArr.Count() ) rArr.clear();
rArr.DeleteAndDestroy( 0, rArr.Count() );
const SwTxtNode* pTxtNd; const SwTxtNode* pTxtNd;
const SwCharFmts* pFmts = GetDoc()->GetCharFmts(); const SwCharFmts* pFmts = GetDoc()->GetCharFmts();
...@@ -795,12 +792,12 @@ sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) ...@@ -795,12 +792,12 @@ sal_uInt16 SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr )
if( sTxt.Len() ) if( sTxt.Len() )
{ {
SwGetINetAttr* pNew = new SwGetINetAttr( sTxt, rAttr ); SwGetINetAttr* pNew = new SwGetINetAttr( sTxt, rAttr );
rArr.C40_INSERT( SwGetINetAttr, pNew, rArr.Count() ); rArr.push_back( pNew );
} }
} }
} }
} }
return rArr.Count(); return rArr.size();
} }
......
...@@ -1665,7 +1665,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() ...@@ -1665,7 +1665,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
const sal_uInt16 nHyperLinkCount = mrSh.GetINetAttrs( aArr ); const sal_uInt16 nHyperLinkCount = mrSh.GetINetAttrs( aArr );
for( sal_uInt16 n = 0; n < nHyperLinkCount; ++n ) for( sal_uInt16 n = 0; n < nHyperLinkCount; ++n )
{ {
SwGetINetAttr* p = aArr[ n ]; SwGetINetAttr* p = &aArr[ n ];
OSL_ENSURE( 0 != p, "Enhanced pdf export - SwGetINetAttr is missing" ); OSL_ENSURE( 0 != p, "Enhanced pdf export - SwGetINetAttr is missing" );
const SwTxtNode* pTNd = p->rINetAttr.GetpTxtNode(); const SwTxtNode* pTNd = p->rINetAttr.GetpTxtNode();
......
...@@ -366,7 +366,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow) ...@@ -366,7 +366,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
nMemberCount = pWrtShell->GetINetAttrs( aArr ); nMemberCount = pWrtShell->GetINetAttrs( aArr );
for( sal_uInt16 n = 0; n < nMemberCount; ++n ) for( sal_uInt16 n = 0; n < nMemberCount; ++n )
{ {
SwGetINetAttr* p = aArr[ n ]; SwGetINetAttr* p = &aArr[ n ];
SwURLFieldContent* pCnt = new SwURLFieldContent( SwURLFieldContent* pCnt = new SwURLFieldContent(
this, this,
p->sText, p->sText,
...@@ -675,7 +675,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged) ...@@ -675,7 +675,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged)
nMemberCount = pWrtShell->GetINetAttrs( aArr ); nMemberCount = pWrtShell->GetINetAttrs( aArr );
for( sal_uInt16 n = 0; n < nMemberCount; ++n ) for( sal_uInt16 n = 0; n < nMemberCount; ++n )
{ {
SwGetINetAttr* p = aArr[ n ]; SwGetINetAttr* p = &aArr[ n ];
SwURLFieldContent* pCnt = new SwURLFieldContent( SwURLFieldContent* pCnt = new SwURLFieldContent(
this, this,
p->sText, p->sText,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment