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