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

Convert SV_DECL_PTRARR_SORT(SwHTMLPosFlyFrms) to o3tl::sorted_vector

Change-Id: If745de5e44ffffca27166f3ac6f35877189d50a7
üst 22461ae3
......@@ -174,8 +174,6 @@ static HTMLOutEvent aIMapEventTable[] =
SV_IMPL_OP_PTRARR_SORT( SwHTMLPosFlyFrms, SwHTMLPosFlyFrmPtr )
sal_uInt16 SwHTMLWriter::GuessFrmType( const SwFrmFmt& rFrmFmt,
const SdrObject*& rpSdrObj )
{
......@@ -266,7 +264,7 @@ sal_uInt16 SwHTMLWriter::GuessFrmType( const SwFrmFmt& rFrmFmt,
bEmpty = sal_True;
if( pHTMLPosFlyFrms )
{
for( sal_uInt16 i=0; i<pHTMLPosFlyFrms->Count(); i++ )
for( sal_uInt16 i=0; i<pHTMLPosFlyFrms->size(); i++ )
{
sal_uLong nIdx = (*pHTMLPosFlyFrms)[i]
->GetNdIndex().GetIndex();
......@@ -369,7 +367,7 @@ void SwHTMLWriter::CollectFlyFrms()
SwHTMLPosFlyFrm *pNew =
new SwHTMLPosFlyFrm( **it, pSdrObj, nMode );
pHTMLPosFlyFrms->Insert( pNew );
pHTMLPosFlyFrms->insert( pNew );
}
}
......@@ -389,10 +387,10 @@ sal_Bool SwHTMLWriter::OutFlyFrm( sal_uLong nNdIdx, xub_StrLen nCntntIdx, sal_uI
// suche nach dem Anfang der FlyFrames
sal_uInt16 i;
for( i = 0; i < pHTMLPosFlyFrms->Count() &&
for( i = 0; i < pHTMLPosFlyFrms->size() &&
(*pHTMLPosFlyFrms)[i]->GetNdIndex().GetIndex() < nNdIdx; i++ )
;
for( ; !bRestart && i < pHTMLPosFlyFrms->Count() &&
for( ; !bRestart && i < pHTMLPosFlyFrms->size() &&
(*pHTMLPosFlyFrms)[i]->GetNdIndex().GetIndex() == nNdIdx; i++ )
{
SwHTMLPosFlyFrm *pPosFly = (*pHTMLPosFlyFrms)[i];
......@@ -403,9 +401,9 @@ sal_Bool SwHTMLWriter::OutFlyFrm( sal_uLong nNdIdx, xub_StrLen nCntntIdx, sal_uI
// Erst entfernen ist wichtig, weil in tieferen
// Rekursionen evtl. weitere Eintraege oder das
// ganze Array geloscht werden koennte.
pHTMLPosFlyFrms->Remove( i, 1 );
pHTMLPosFlyFrms->erase( i );
i--;
if( !pHTMLPosFlyFrms->Count() )
if( pHTMLPosFlyFrms->empty() )
{
delete pHTMLPosFlyFrms;
pHTMLPosFlyFrms = 0;
......@@ -1929,7 +1927,7 @@ SwHTMLPosFlyFrm::SwHTMLPosFlyFrm( const SwPosFlyFrm& rPosFly,
}
}
sal_Bool SwHTMLPosFlyFrm::operator<( const SwHTMLPosFlyFrm& rFrm ) const
bool SwHTMLPosFlyFrm::operator<( const SwHTMLPosFlyFrm& rFrm ) const
{
if( pNdIdx->GetIndex() == rFrm.pNdIdx->GetIndex() )
{
......@@ -1947,5 +1945,4 @@ sal_Bool SwHTMLPosFlyFrm::operator<( const SwHTMLPosFlyFrm& rFrm ) const
return pNdIdx->GetIndex() < rFrm.pNdIdx->GetIndex();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -30,8 +30,7 @@
#define _HTMLFLY_HXX
#include <tools/solar.h>
#include <svl/svarray.hxx>
#include <o3tl/sorted_vector.hxx>
class SdrObject;
class SwFrmFmt;
......@@ -107,8 +106,8 @@ public:
SwHTMLPosFlyFrm( const SwPosFlyFrm& rPosFly,
const SdrObject *pSdrObj, sal_uInt8 nOutMode );
sal_Bool operator==( const SwHTMLPosFlyFrm& ) const { return sal_False; }
sal_Bool operator<( const SwHTMLPosFlyFrm& ) const;
bool operator==( const SwHTMLPosFlyFrm& ) const { return false; }
bool operator<( const SwHTMLPosFlyFrm& ) const;
const SwFrmFmt& GetFmt() const { return *pFrmFmt; }
const SdrObject *GetSdrObject() const { return pSdrObject; }
......@@ -128,9 +127,7 @@ public:
sal_uInt8 GetOutCntnr() const { return nOutputMode & HTML_CNTNR_MASK; }
};
typedef SwHTMLPosFlyFrm *SwHTMLPosFlyFrmPtr;
SV_DECL_PTRARR_SORT( SwHTMLPosFlyFrms, SwHTMLPosFlyFrmPtr, 10 )
class SwHTMLPosFlyFrms : public o3tl::sorted_vector<SwHTMLPosFlyFrm*, o3tl::less_ptr_to<SwHTMLPosFlyFrm> > {};
#endif
......
......@@ -1392,9 +1392,9 @@ void SwHTMLWriter::GetControls()
if( pHTMLPosFlyFrms )
{
// die absatz-gebundenen Controls einsammeln
for( i=0; i<pHTMLPosFlyFrms->Count(); i++ )
for( i=0; i<pHTMLPosFlyFrms->size(); i++ )
{
const SwHTMLPosFlyFrm* pPosFlyFrm = pHTMLPosFlyFrms->GetObject( i );
const SwHTMLPosFlyFrm* pPosFlyFrm = (*pHTMLPosFlyFrms)[ i ];
if( HTML_OUT_CONTROL != pPosFlyFrm->GetOutFn() )
continue;
......
......@@ -376,7 +376,7 @@ sal_uLong SwHTMLWriter::WriteStream()
OSL_ENSURE( !pHTMLPosFlyFrms, "Wurden nicht alle Rahmen ausgegeben" );
if( pHTMLPosFlyFrms )
{
pHTMLPosFlyFrms->DeleteAndDestroy( 0, pHTMLPosFlyFrms->Count() );
pHTMLPosFlyFrms->DeleteAndDestroyAll();
delete pHTMLPosFlyFrms;
pHTMLPosFlyFrms = 0;
}
......
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