Kaydet (Commit) 8989823b authored tarafından Rafael Dominguez's avatar Rafael Dominguez Kaydeden (comit) Petr Mladek

Replace List with std::vector<ScAddress>.

üst 95ae7d1d
...@@ -224,7 +224,7 @@ private: ...@@ -224,7 +224,7 @@ private:
ScHeaderFieldData aFieldData; ScHeaderFieldData aFieldData;
List aNotePosList; // Reihenfolge der Notizen std::vector<ScAddress> aNotePosList; // Reihenfolge der Notizen
ScPageBreakData* pPageData; // zum Eintragen der Umbrueche etc. ScPageBreakData* pPageData; // zum Eintragen der Umbrueche etc.
......
...@@ -410,14 +410,6 @@ void ScPrintFunc::FillPageData() ...@@ -410,14 +410,6 @@ void ScPrintFunc::FillPageData()
ScPrintFunc::~ScPrintFunc() ScPrintFunc::~ScPrintFunc()
{ {
ScAddress* pTripel = (ScAddress*) aNotePosList.First();
while (pTripel)
{
delete pTripel;
pTripel = (ScAddress*) aNotePosList.Next();
}
aNotePosList.Clear();
delete[] pPageEndX; delete[] pPageEndX;
delete[] pPageEndY; delete[] pPageEndY;
delete[] pPageRows; delete[] pPageRows;
...@@ -1927,14 +1919,16 @@ long ScPrintFunc::DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocation ...@@ -1927,14 +1919,16 @@ long ScPrintFunc::DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocation
long nPosY = aPageRect.Top(); long nPosY = aPageRect.Top();
long nCount = 0; long nCount = 0;
long nSize = aNotePosList.size();
sal_Bool bOk; sal_Bool bOk;
do do
{ {
bOk = false; bOk = false;
ScAddress* pPos = (ScAddress*) aNotePosList.GetObject( nNoteStart+nCount ); if ( nNoteStart + nCount < nSize)
if (pPos)
{ {
ScBaseCell* pCell = pDoc->GetCell( *pPos); ScAddress &rPos = aNotePosList[ nNoteStart + nCount ];
ScBaseCell* pCell = pDoc->GetCell( rPos);
if( const ScPostIt* pNote = pCell->GetNote() ) if( const ScPostIt* pNote = pCell->GetNote() )
{ {
if(const EditTextObject *pEditText = pNote->GetEditTextObject()) if(const EditTextObject *pEditText = pNote->GetEditTextObject())
...@@ -1947,7 +1941,7 @@ long ScPrintFunc::DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocation ...@@ -1947,7 +1941,7 @@ long ScPrintFunc::DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocation
pEditEngine->Draw( pDev, Point( nPosX, nPosY ), 0 ); pEditEngine->Draw( pDev, Point( nPosX, nPosY ), 0 );
String aMarkStr; String aMarkStr;
pPos->Format( aMarkStr, SCA_VALID, pDoc, pDoc->GetAddressConvention() ); rPos.Format( aMarkStr, SCA_VALID, pDoc, pDoc->GetAddressConvention() );
aMarkStr += ':'; aMarkStr += ':';
// Zellposition auch per EditEngine, damit die Position stimmt // Zellposition auch per EditEngine, damit die Position stimmt
...@@ -1958,9 +1952,9 @@ long ScPrintFunc::DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocation ...@@ -1958,9 +1952,9 @@ long ScPrintFunc::DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocation
if ( pLocationData ) if ( pLocationData )
{ {
Rectangle aTextRect( Point( nPosX, nPosY ), Size( aDataSize.Width(), nTextHeight ) ); Rectangle aTextRect( Point( nPosX, nPosY ), Size( aDataSize.Width(), nTextHeight ) );
pLocationData->AddNoteText( aTextRect, *pPos ); pLocationData->AddNoteText( aTextRect, rPos );
Rectangle aMarkRect( Point( aPageRect.Left(), nPosY ), Size( nMarkLen, nTextHeight ) ); Rectangle aMarkRect( Point( aPageRect.Left(), nPosY ), Size( nMarkLen, nTextHeight ) );
pLocationData->AddNoteMark( aMarkRect, *pPos ); pLocationData->AddNoteMark( aMarkRect, rPos );
} }
nPosY += nTextHeight; nPosY += nTextHeight;
...@@ -1978,7 +1972,7 @@ long ScPrintFunc::DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocation ...@@ -1978,7 +1972,7 @@ long ScPrintFunc::DoNotes( long nNoteStart, sal_Bool bDoPrint, ScPreviewLocation
long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, sal_Bool bDoPrint, ScPreviewLocationData* pLocationData ) long ScPrintFunc::PrintNotes( long nPageNo, long nNoteStart, sal_Bool bDoPrint, ScPreviewLocationData* pLocationData )
{ {
if ( nNoteStart >= (long) aNotePosList.Count() || !aTableParam.bNotes ) if ( nNoteStart >= (long) aNotePosList.size() || !aTableParam.bNotes )
return 0; return 0;
if ( bDoPrint && bClearWin ) if ( bDoPrint && bClearWin )
...@@ -2577,7 +2571,7 @@ long ScPrintFunc::CountNotePages() ...@@ -2577,7 +2571,7 @@ long ScPrintFunc::CountNotePages()
{ {
if (pCell->HasNote()) if (pCell->HasNote())
{ {
aNotePosList.Insert( new ScAddress( nCol,nRow,nPrintTab ), LIST_APPEND ); aNotePosList.push_back( ScAddress( nCol,nRow,nPrintTab ) );
++nCount; ++nCount;
} }
......
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