Kaydet (Commit) 5be6008e authored tarafından Philipp Weissenbacher's avatar Philipp Weissenbacher Kaydeden (comit) Stefan Knorr (astron)

Translate German comments

üst b181c48f
...@@ -204,8 +204,7 @@ void SwFtnIdxs::UpdateAllFtn() ...@@ -204,8 +204,7 @@ void SwFtnIdxs::UpdateAllFtn()
if( !Count() ) if( !Count() )
return; return;
// besorge erstmal das Nodes-Array ueber den StartIndex der // Get the NodesArray via the StartIndex of the first Footnote
// ersten Fussnote
SwDoc* pDoc = (SwDoc*) (*this)[ 0 ]->GetTxtNode().GetDoc(); SwDoc* pDoc = (SwDoc*) (*this)[ 0 ]->GetTxtNode().GetDoc();
SwTxtFtn* pTxtFtn; SwTxtFtn* pTxtFtn;
const SwEndNoteInfo& rEndInfo = pDoc->GetEndNoteInfo(); const SwEndNoteInfo& rEndInfo = pDoc->GetEndNoteInfo();
...@@ -215,26 +214,25 @@ void SwFtnIdxs::UpdateAllFtn() ...@@ -215,26 +214,25 @@ void SwFtnIdxs::UpdateAllFtn()
SwRootFrm* pTmpRoot = pDoc->GetCurrentLayout();//swmod 080305 SwRootFrm* pTmpRoot = pDoc->GetCurrentLayout();//swmod 080305
std::set<SwRootFrm*> aAllLayouts = pDoc->GetAllLayouts(); std::set<SwRootFrm*> aAllLayouts = pDoc->GetAllLayouts();
//Fuer normale Fussnoten werden Chapter- und Dokumentweise Nummerierung // For normal Footnotes per-chapter and per-document numbering are treated separately.
//getrennt behandelt. Fuer Endnoten gibt es nur die Dokumentweise // For Endnotes we only have document-wise numbering.
//Nummerierung.
if( FTNNUM_CHAPTER == rFtnInfo.eNum ) if( FTNNUM_CHAPTER == rFtnInfo.eNum )
{ {
const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds(); const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds();
sal_uInt16 nNo = 1, // Nummer fuer die Fussnoten sal_uInt16 nNo = 1, // Number for the Footnotes
nFtnIdx = 0; // Index in das FtnIdx-Array nFtnIdx = 0; // Index into theFtnIdx array
for( sal_uInt16 n = 0; n < rOutlNds.Count(); ++n ) for( sal_uInt16 n = 0; n < rOutlNds.Count(); ++n )
{ {
if ( rOutlNds[ n ]->GetTxtNode()->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei if ( rOutlNds[ n ]->GetTxtNode()->GetAttrOutlineLevel() == 1 )//<-end,zhaojianwei
{ {
sal_uLong nCapStt = rOutlNds[ n ]->GetIndex(); // Start eines neuen Kapitels sal_uLong nCapStt = rOutlNds[ n ]->GetIndex(); // Start of a new chapter
for( ; nFtnIdx < Count(); ++nFtnIdx ) for( ; nFtnIdx < Count(); ++nFtnIdx )
{ {
pTxtFtn = (*this)[ nFtnIdx ]; pTxtFtn = (*this)[ nFtnIdx ];
if( pTxtFtn->GetTxtNode().GetIndex() >= nCapStt ) if( pTxtFtn->GetTxtNode().GetIndex() >= nCapStt )
break; break;
// Endnoten nur Dokumentweise // Endnotes are per-document only
const SwFmtFtn &rFtn = pTxtFtn->GetFtn(); const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
if( !rFtn.IsEndNote() && !rFtn.GetNumStr().Len() && if( !rFtn.IsEndNote() && !rFtn.GetNumStr().Len() &&
!SwUpdFtnEndNtAtEnd::FindSectNdWithEndAttr( *pTxtFtn )) !SwUpdFtnEndNtAtEnd::FindSectNdWithEndAttr( *pTxtFtn ))
...@@ -242,14 +240,14 @@ void SwFtnIdxs::UpdateAllFtn() ...@@ -242,14 +240,14 @@ void SwFtnIdxs::UpdateAllFtn()
&rFtn.GetNumStr() ); &rFtn.GetNumStr() );
} }
if( nFtnIdx >= Count() ) if( nFtnIdx >= Count() )
break; // ok alles geupdatet break; // ok, everything is updated
nNo = 1; nNo = 1;
} }
} }
for( nNo = 1; nFtnIdx < Count(); ++nFtnIdx ) for( nNo = 1; nFtnIdx < Count(); ++nFtnIdx )
{ {
//Endnoten nur Dokumentweise // Endnotes are per-document
pTxtFtn = (*this)[ nFtnIdx ]; pTxtFtn = (*this)[ nFtnIdx ];
const SwFmtFtn &rFtn = pTxtFtn->GetFtn(); const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
if( !rFtn.IsEndNote() && !rFtn.GetNumStr().Len() && if( !rFtn.IsEndNote() && !rFtn.GetNumStr().Len() &&
...@@ -260,8 +258,7 @@ void SwFtnIdxs::UpdateAllFtn() ...@@ -260,8 +258,7 @@ void SwFtnIdxs::UpdateAllFtn()
} }
// sal_Bool, damit hier auch bei Chapter-Einstellung die Endnoten // We use sal_Bool here, so that we also iterate through the Endnotes with a chapter setting.
// durchlaufen.
const sal_Bool bEndNoteOnly = FTNNUM_DOC != rFtnInfo.eNum; const sal_Bool bEndNoteOnly = FTNNUM_DOC != rFtnInfo.eNum;
sal_uInt16 nFtnNo = 0, nEndNo = 0; sal_uInt16 nFtnNo = 0, nEndNo = 0;
for( sal_uInt16 nPos = 0; nPos < Count(); ++nPos ) for( sal_uInt16 nPos = 0; nPos < Count(); ++nPos )
......
...@@ -101,7 +101,7 @@ sal_Bool lcl_GCBorder_GetLastBox_B( const SwTableBox*& rpBox, void* pPara ) ...@@ -101,7 +101,7 @@ sal_Bool lcl_GCBorder_GetLastBox_B( const SwTableBox*& rpBox, void* pPara )
return sal_True; return sal_True;
} }
// suche das "Ende" der vorgegebene BorderLine. Returnt wird die "Layout"Pos! // Find the "end" of the passed BorderLine. Returns the "Layout"Pos!
sal_uInt16 lcl_FindEndPosOfBorder( const SwCollectTblLineBoxes& rCollTLB, sal_uInt16 lcl_FindEndPosOfBorder( const SwCollectTblLineBoxes& rCollTLB,
const SvxBorderLine& rBrdLn, sal_uInt16& rStt, sal_Bool bTop ) const SvxBorderLine& rBrdLn, sal_uInt16& rStt, sal_Bool bTop )
{ {
...@@ -173,8 +173,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara ) ...@@ -173,8 +173,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
{ {
_SwGCLineBorder* pGCPara = (_SwGCLineBorder*)pPara; _SwGCLineBorder* pGCPara = (_SwGCLineBorder*)pPara;
// zuerst die rechte Kante mit der linken Kante der naechsten Box // First the right edge with the left edge of the succeeding Box within this Line
// innerhalb dieser Line
{ {
_SwGCBorder_BoxBrd aBPara; _SwGCBorder_BoxBrd aBPara;
const SvxBorderLine* pBrd; const SvxBorderLine* pBrd;
...@@ -215,7 +214,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara ) ...@@ -215,7 +214,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
} }
} }
// und jetzt die eigene untere Kante mit der nachfolgenden oberen Kante // And now the own bottom edge with the succeeding top edge
if( !pGCPara->IsLastLine() ) if( !pGCPara->IsLastLine() )
{ {
SwCollectTblLineBoxes aBottom( sal_False ); SwCollectTblLineBoxes aBottom( sal_False );
...@@ -226,7 +225,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara ) ...@@ -226,7 +225,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
const SwTableLine* pNextLine = (*pGCPara->pLines)[ pGCPara->nLinePos+1 ]; const SwTableLine* pNextLine = (*pGCPara->pLines)[ pGCPara->nLinePos+1 ];
::lcl_Line_CollectBox( pNextLine, &aTop ); ::lcl_Line_CollectBox( pNextLine, &aTop );
// dann entferne mal alle "doppelten" gleichen Lines // remove all "duplicated" Lines that are the same
sal_uInt16 nBtmPos, nTopPos, sal_uInt16 nBtmPos, nTopPos,
nSttBtm = 0, nSttTop = 0, nSttBtm = 0, nSttTop = 0,
nEndBtm = aBottom.Count(), nEndTop = aTop.Count(); nEndBtm = aBottom.Count(), nEndTop = aTop.Count();
...@@ -245,7 +244,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara ) ...@@ -245,7 +244,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
if( pTopLine && pBtmLine && *pTopLine == *pBtmLine ) if( pTopLine && pBtmLine && *pTopLine == *pBtmLine )
{ {
// dann kann einer entfernt werden, aber welche? // We can remove one, but which one?
sal_uInt16 nSavSttBtm = nSttBtm, nSavSttTop = nSttTop; sal_uInt16 nSavSttBtm = nSttBtm, nSavSttTop = nSttTop;
sal_uInt16 nBtmEndPos = ::lcl_FindEndPosOfBorder( aBottom, sal_uInt16 nBtmEndPos = ::lcl_FindEndPosOfBorder( aBottom,
*pTopLine, nSttBtm, sal_False ); *pTopLine, nSttBtm, sal_False );
...@@ -257,7 +256,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara ) ...@@ -257,7 +256,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
if( nTopEndPos <= nBtmEndPos ) if( nTopEndPos <= nBtmEndPos )
{ {
// dann die TopBorder bis zur BottomEndPos loeschen // Delete the TopBorders until BottomEndPos
nSttTop = nSavSttTop; nSttTop = nSavSttTop;
if( nTopPos <= nBtmEndPos ) if( nTopPos <= nBtmEndPos )
lcl_GCBorder_DelBorder( aTop, --nSttTop, sal_True, lcl_GCBorder_DelBorder( aTop, --nSttTop, sal_True,
...@@ -268,7 +267,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara ) ...@@ -268,7 +267,7 @@ sal_Bool lcl_GC_Line_Border( const SwTableLine*& rpLine, void* pPara )
} }
else else
{ {
// sonst die BottomBorder bis zur TopEndPos loeschen // Else delete the BottomBorders until TopEndPos
nSttBtm = nSavSttBtm; nSttBtm = nSavSttBtm;
if( nBtmPos <= nTopEndPos ) if( nBtmPos <= nTopEndPos )
lcl_GCBorder_DelBorder( aBottom, --nSttBtm, sal_False, lcl_GCBorder_DelBorder( aBottom, --nSttBtm, sal_False,
...@@ -343,7 +342,7 @@ sal_Bool lcl_MergeGCBox( const SwTableBox*& rpTblBox, void* pPara ) ...@@ -343,7 +342,7 @@ sal_Bool lcl_MergeGCBox( const SwTableBox*& rpTblBox, void* pPara )
sal_uInt16 n, nLen = rpBox->GetTabLines().Count(); sal_uInt16 n, nLen = rpBox->GetTabLines().Count();
if( nLen ) if( nLen )
{ {
// ACHTUNG: die Anzahl der Lines kann sich aendern! // ATTENTION: The Line count can change!
_GCLinePara aPara( rpBox->GetTabLines(), (_GCLinePara*)pPara ); _GCLinePara aPara( rpBox->GetTabLines(), (_GCLinePara*)pPara );
for( n = 0; n < rpBox->GetTabLines().Count() && for( n = 0; n < rpBox->GetTabLines().Count() &&
lcl_MergeGCLine( *(rpBox->GetTabLines().GetData() + n), &aPara ); lcl_MergeGCLine( *(rpBox->GetTabLines().GetData() + n), &aPara );
...@@ -352,8 +351,8 @@ sal_Bool lcl_MergeGCBox( const SwTableBox*& rpTblBox, void* pPara ) ...@@ -352,8 +351,8 @@ sal_Bool lcl_MergeGCBox( const SwTableBox*& rpTblBox, void* pPara )
if( 1 == rpBox->GetTabLines().Count() ) if( 1 == rpBox->GetTabLines().Count() )
{ {
// Box mit einer Line, dann verschiebe alle Boxen der Line // Box with a Line, then move all the Line's Boxes after this Box
// hinter diese Box in der Parent-Line und loesche diese Box // into the parent Line and delete this Box
SwTableLine* pInsLine = rpBox->GetUpper(); SwTableLine* pInsLine = rpBox->GetUpper();
SwTableLine* pCpyLine = rpBox->GetTabLines()[0]; SwTableLine* pCpyLine = rpBox->GetTabLines()[0];
sal_uInt16 nInsPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, rpBox ); sal_uInt16 nInsPos = pInsLine->GetTabBoxes().C40_GETPOS( SwTableBox, rpBox );
...@@ -362,10 +361,10 @@ sal_Bool lcl_MergeGCBox( const SwTableBox*& rpTblBox, void* pPara ) ...@@ -362,10 +361,10 @@ sal_Bool lcl_MergeGCBox( const SwTableBox*& rpTblBox, void* pPara )
pInsLine->GetTabBoxes().Insert( &pCpyLine->GetTabBoxes(), nInsPos+1 ); pInsLine->GetTabBoxes().Insert( &pCpyLine->GetTabBoxes(), nInsPos+1 );
pCpyLine->GetTabBoxes().Remove( 0, n ); pCpyLine->GetTabBoxes().Remove( 0, n );
// loesche alte die Box mit der Line // Delete the old Box with the Line
pInsLine->GetTabBoxes().DeleteAndDestroy( nInsPos ); pInsLine->GetTabBoxes().DeleteAndDestroy( nInsPos );
return sal_False; // neu aufsetzen return sal_False; // set up anew
} }
} }
return sal_True; return sal_True;
...@@ -380,31 +379,30 @@ sal_Bool lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara ) ...@@ -380,31 +379,30 @@ sal_Bool lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara )
_GCLinePara* pGCPara = (_GCLinePara*)pPara; _GCLinePara* pGCPara = (_GCLinePara*)pPara;
while( 1 == nLen ) while( 1 == nLen )
{ {
// es gibt eine Box mit Lines // We have a Box with Lines
SwTableBox* pBox = pLn->GetTabBoxes()[0]; SwTableBox* pBox = pLn->GetTabBoxes()[0];
if( !pBox->GetTabLines().Count() ) if( !pBox->GetTabLines().Count() )
break; break;
SwTableLine* pLine = pBox->GetTabLines()[0]; SwTableLine* pLine = pBox->GetTabLines()[0];
// pLine wird zu der aktuellen, also der rpLine, // pLine turns into the current Line (that is rpLine), the rest is moved
// die restlichen werden ins LinesArray hinter der akt. // into the LinesArray past the current one.
// verschoben. // The LinesArray is in pPara!
// Das LinesArray ist im pPara!
nLen = pBox->GetTabLines().Count(); nLen = pBox->GetTabLines().Count();
SwTableLines& rLns = *pGCPara->pLns; SwTableLines& rLns = *pGCPara->pLns;
const SwTableLine* pTmp = pLn; const SwTableLine* pTmp = pLn;
sal_uInt16 nInsPos = rLns.GetPos( pTmp ); sal_uInt16 nInsPos = rLns.GetPos( pTmp );
OSL_ENSURE( USHRT_MAX != nInsPos, "Line nicht gefunden!" ); OSL_ENSURE( USHRT_MAX != nInsPos, "Could not find Line!" );
SwTableBox* pUpper = pLn->GetUpper(); SwTableBox* pUpper = pLn->GetUpper();
rLns.Remove( nInsPos, 1 ); // die Line dem aus Array loeschen rLns.Remove( nInsPos, 1 ); // remove the Line from the array
rLns.Insert( &pBox->GetTabLines(), nInsPos ); rLns.Insert( &pBox->GetTabLines(), nInsPos );
// JP 31.03.99: Bug 60000 - die Attribute der zu loeschenden // JP 31.03.99: Bug 60000
// Line an die "eingefuegten" uebertragen // Pass the attributes of the to-be-deleted Lines to the "inserted" one
const SfxPoolItem* pItem; const SfxPoolItem* pItem;
if( SFX_ITEM_SET == pLn->GetFrmFmt()->GetItemState( if( SFX_ITEM_SET == pLn->GetFrmFmt()->GetItemState(
RES_BACKGROUND, sal_True, &pItem )) RES_BACKGROUND, sal_True, &pItem ))
...@@ -416,19 +414,19 @@ sal_Bool lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara ) ...@@ -416,19 +414,19 @@ sal_Bool lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara )
pGCPara->pShareFmts->SetAttr( *rBoxLns[ nLns ], *pItem ); pGCPara->pShareFmts->SetAttr( *rBoxLns[ nLns ], *pItem );
} }
pBox->GetTabLines().Remove( 0, nLen ); // Lines aus Array loeschen pBox->GetTabLines().Remove( 0, nLen ); // Remove Lines from the array
delete pLn; delete pLn;
// Abhaengigkeit neu setzen // Set the dependency anew
while( nLen-- ) while( nLen-- )
rLns[ nInsPos++ ]->SetUpper( pUpper ); rLns[ nInsPos++ ]->SetUpper( pUpper );
pLn = pLine; // und neu setzen pLn = pLine; // and set up anew
nLen = pLn->GetTabBoxes().Count(); nLen = pLn->GetTabBoxes().Count();
} }
// ACHTUNG: die Anzahl der Boxen kann sich aendern! // ATTENTION: The number of boxes can change!
for( nLen = 0; nLen < pLn->GetTabBoxes().Count(); ++nLen ) for( nLen = 0; nLen < pLn->GetTabBoxes().Count(); ++nLen )
if( !lcl_MergeGCBox( *(pLn->GetTabBoxes().GetData() + nLen ), pPara )) if( !lcl_MergeGCBox( *(pLn->GetTabBoxes().GetData() + nLen ), pPara ))
--nLen; --nLen;
...@@ -436,10 +434,10 @@ sal_Bool lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara ) ...@@ -436,10 +434,10 @@ sal_Bool lcl_MergeGCLine( const SwTableLine*& rpLine, void* pPara )
return sal_True; return sal_True;
} }
// Struktur ein wenig aufraeumen // Clean structure a bit
void SwTable::GCLines() void SwTable::GCLines()
{ {
// ACHTUNG: die Anzahl der Lines kann sich aendern! // ATTENTION: The Line count can change!
_GCLinePara aPara( GetTabLines() ); _GCLinePara aPara( GetTabLines() );
SwShareBoxFmts aShareFmts; SwShareBoxFmts aShareFmts;
aPara.pShareFmts = &aShareFmts; aPara.pShareFmts = &aShareFmts;
......
...@@ -159,16 +159,15 @@ SwNoTxtFrm::SwNoTxtFrm(SwNoTxtNode * const pNode, SwFrm* pSib ) ...@@ -159,16 +159,15 @@ SwNoTxtFrm::SwNoTxtFrm(SwNoTxtNode * const pNode, SwFrm* pSib )
InitCtor(); InitCtor();
} }
// Initialisierung: z.Zt. Eintragen des Frames im Cache // Initialization: Currently add the Frame to the Cache
void SwNoTxtFrm::InitCtor() void SwNoTxtFrm::InitCtor()
{ {
nType = FRMC_NOTXT; nType = FRMC_NOTXT;
// Das Gewicht der Grafik ist 0, wenn sie noch nicht // The graphic's weight is 0 if it has not been read,
// gelesen ist, < 0, wenn ein Lesefehler auftrat und // < 0 if we had a read error and we needed to use the replacement and
// Ersatzdarstellung angewendet werden musste und >0, // > 0 if it is available
// wenn sie zur Verfuegung steht.
nWeight = 0; nWeight = 0;
} }
...@@ -268,7 +267,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ...@@ -268,7 +267,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
!pSh->GetWin() ) !pSh->GetWin() )
StopAnimation(); StopAnimation();
SfxProgress::EnterLock(); //Keine Progress-Reschedules im Paint (SwapIn) SfxProgress::EnterLock(); // No progress reschedules in paint (SwapIn)
OutputDevice *pOut = pSh->GetOut(); OutputDevice *pOut = pSh->GetOut();
pOut->Push(); pOut->Push();
...@@ -303,16 +302,15 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ...@@ -303,16 +302,15 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
aPaintArea._Intersection( aOrigPaint ); aPaintArea._Intersection( aOrigPaint );
SwRect aNormal( Frm().Pos() + Prt().Pos(), Prt().SSize() ); SwRect aNormal( Frm().Pos() + Prt().Pos(), Prt().SSize() );
aNormal.Justify(); //Normalisiertes Rechteck fuer die Vergleiche aNormal.Justify(); // Normalized rectangle for the comparisons
if( aPaintArea.IsOver( aNormal ) ) if( aPaintArea.IsOver( aNormal ) )
{ {
// berechne die 4 zu loeschenden Rechtecke // Calculate the four to-be-deleted rectangles
if( pSh->GetWin() ) if( pSh->GetWin() )
::lcl_ClearArea( *this, *pSh->GetOut(), aPaintArea, aNormal ); ::lcl_ClearArea( *this, *pSh->GetOut(), aPaintArea, aNormal );
// in der Schnittmenge vom PaintBereich und der Bitmap liegt // The intersection of the PaintArea and the Bitmap contains the absolutely visible area of the Frame
// der absolut sichtbare Bereich vom Frame
aPaintArea._Intersection( aNormal ); aPaintArea._Intersection( aNormal );
if ( bClip ) if ( bClip )
...@@ -321,7 +319,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ...@@ -321,7 +319,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
PaintPicture( pOut, aGrfArea ); PaintPicture( pOut, aGrfArea );
} }
else else
// wenn nicht sichtbar, loesche einfach den angegebenen Bereich // If it's not visible, simply delete the given Area
lcl_ClearArea( *this, *pSh->GetOut(), aPaintArea, SwRect() ); lcl_ClearArea( *this, *pSh->GetOut(), aPaintArea, SwRect() );
if( pGrfNd ) if( pGrfNd )
pGrfNd->SetFrameInPaint( sal_False ); pGrfNd->SetFrameInPaint( sal_False );
...@@ -335,12 +333,12 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ...@@ -335,12 +333,12 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
|* void lcl_CalcRect( Point & aPt, Size & aDim, |* void lcl_CalcRect( Point & aPt, Size & aDim,
|* sal_uInt16 nMirror ) |* sal_uInt16 nMirror )
|* |*
|* Beschreibung Errechne die Position und die Groesse der Grafik im |* Calculate the position and the size of the graphic in the Frame,
|* Frame, entsprechen der aktuellen Grafik-Attribute |* corresponding to the current graphic attributes
|* |*
|* Parameter Point& die Position im Frame ( auch Return-Wert ) |* Point& the position in the Frame (also returned)
|* Size& die Groesse der Grafik ( auch Return-Wert ) |* Size& the graphic's size (also returned)
|* MirrorGrf akt. Spiegelungs-Attribut |* nMirror the current mirror attribute
|* |*
*************************************************************************/ *************************************************************************/
...@@ -364,19 +362,18 @@ void lcl_CalcRect( Point& rPt, Size& rDim, sal_uInt16 nMirror ) ...@@ -364,19 +362,18 @@ void lcl_CalcRect( Point& rPt, Size& rDim, sal_uInt16 nMirror )
|* |*
|* void SwNoTxtFrm::GetGrfArea() |* void SwNoTxtFrm::GetGrfArea()
|* |*
|* Beschreibung Errechne die Position und die Groesse der Bitmap |* Calculate the Bitmap's position and the size within the passed rectangle
|* innerhalb des uebergebenem Rechtecks.
|* |*
*************************************************************************/ *************************************************************************/
void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect, void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
sal_Bool ) const sal_Bool ) const
{ {
//currently only used for scaling, cropping and mirroring the contour of graphics! // Currently only used for scaling, cropping and mirroring the contour of graphics!
//all other is handled by the GraphicObject // Everything else is handled by GraphicObject
//In rRect wird das sichbare Rechteck der Grafik gesteckt. // We put the graphic's visible rectangle into rRect.
//In pOrigRect werden Pos+Size der Gesamtgrafik gesteck. // pOrigRect contains position and size of the whole graphic.
const SwAttrSet& rAttrSet = GetNode()->GetSwAttrSet(); const SwAttrSet& rAttrSet = GetNode()->GetSwAttrSet();
const SwCropGrf& rCrop = rAttrSet.GetCropGrf(); const SwCropGrf& rCrop = rAttrSet.GetCropGrf();
...@@ -396,7 +393,8 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect, ...@@ -396,7 +393,8 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
} }
} }
//Grafik wird vom Node eingelesen falls notwendig. Kann aber schiefgehen. // We read graphic from the Node, if needed.
// It may fail, however.
long nLeftCrop, nRightCrop, nTopCrop, nBottomCrop; long nLeftCrop, nRightCrop, nTopCrop, nBottomCrop;
Size aOrigSz( ((SwNoTxtNode*)GetNode())->GetTwipSize() ); Size aOrigSz( ((SwNoTxtNode*)GetNode())->GetTwipSize() );
if ( !aOrigSz.Width() ) if ( !aOrigSz.Width() )
...@@ -449,7 +447,7 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect, ...@@ -449,7 +447,7 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
Point aVisPt( Frm().Pos() + Prt().Pos() ); Point aVisPt( Frm().Pos() + Prt().Pos() );
Point aGrfPt( aVisPt ); Point aGrfPt( aVisPt );
//Erst das 'sichtbare' Rect einstellen. // Set the "visible" rectangle first
if ( nLeftCrop > 0 ) if ( nLeftCrop > 0 )
{ {
aVisPt.X() += nLeftCrop; aVisPt.X() += nLeftCrop;
...@@ -468,7 +466,7 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect, ...@@ -468,7 +466,7 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
rRect.Pos ( aVisPt ); rRect.Pos ( aVisPt );
rRect.SSize( aVisSz ); rRect.SSize( aVisSz );
//Ggf. Die Gesamtgrafik berechnen // Calculate the whole graphic if needed
if ( pOrigRect ) if ( pOrigRect )
{ {
Size aTmpSz( aGrfSz ); Size aTmpSz( aGrfSz );
...@@ -489,15 +487,14 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect, ...@@ -489,15 +487,14 @@ void SwNoTxtFrm::GetGrfArea( SwRect &rRect, SwRect* pOrigRect,
|* |*
|* Size SwNoTxtFrm::GetSize() |* Size SwNoTxtFrm::GetSize()
|* |*
|* Beschreibung Gebe die Groesse des umgebenen FLys und |* By returning the surrounding Fly's size which equals the graphic's size
|* damit die der Grafik zurueck.
|* |*
*************************************************************************/ *************************************************************************/
const Size& SwNoTxtFrm::GetSize() const const Size& SwNoTxtFrm::GetSize() const
{ {
// gebe die Groesse des Frames zurueck // Return the Frame's size
const SwFrm *pFly = FindFlyFrm(); const SwFrm *pFly = FindFlyFrm();
if( !pFly ) if( !pFly )
pFly = this; pFly = this;
...@@ -537,7 +534,7 @@ void SwNoTxtFrm::MakeAll() ...@@ -537,7 +534,7 @@ void SwNoTxtFrm::MakeAll()
|* |*
|* SwNoTxtFrm::Format() |* SwNoTxtFrm::Format()
|* |*
|* Beschreibung Errechne die Groesse der Bitmap, wenn noetig |* Calculate the Bitmap's site, if needed
|* |*
*************************************************************************/ *************************************************************************/
...@@ -546,7 +543,7 @@ void SwNoTxtFrm::Format( const SwBorderAttrs * ) ...@@ -546,7 +543,7 @@ void SwNoTxtFrm::Format( const SwBorderAttrs * )
{ {
const Size aNewSize( GetSize() ); const Size aNewSize( GetSize() );
// hat sich die Hoehe geaendert? // Did the height change?
SwTwips nChgHght = IsVertical() ? SwTwips nChgHght = IsVertical() ?
(SwTwips)(aNewSize.Width() - Prt().Width()) : (SwTwips)(aNewSize.Width() - Prt().Width()) :
(SwTwips)(aNewSize.Height() - Prt().Height()); (SwTwips)(aNewSize.Height() - Prt().Height());
...@@ -577,10 +574,10 @@ sal_Bool SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos, ...@@ -577,10 +574,10 @@ sal_Bool SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos,
rRect.Justify(); rRect.Justify();
// liegt die Bitmap ueberhaupt im sichtbaren Berich ? // Is the Bitmap in the visible area at all?
if( !aFrameRect.IsOver( rRect ) ) if( !aFrameRect.IsOver( rRect ) )
{ {
// wenn nicht dann steht der Cursor auf dem Frame // If not, then the Cursor is on the Frame
rRect = aFrameRect; rRect = aFrameRect;
rRect.Width( 1 ); rRect.Width( 1 );
} }
...@@ -721,7 +718,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) ...@@ -721,7 +718,7 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
else if ( pSh->VisArea().IsOver( aRect ) && else if ( pSh->VisArea().IsOver( aRect ) &&
OUTDEV_WINDOW == pSh->GetOut()->GetOutDevType() ) OUTDEV_WINDOW == pSh->GetOut()->GetOutDevType() )
{ {
//invalidate instead of painting // invalidate instead of painting
pSh->GetWin()->Invalidate( aRect.SVRect() ); pSh->GetWin()->Invalidate( aRect.SVRect() );
} }
...@@ -771,12 +768,12 @@ void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, Out ...@@ -771,12 +768,12 @@ void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, Out
} }
} }
// Ausgabe der Grafik. Hier wird entweder eine QuickDraw-Bmp oder // Paint the graphic.
// eine Grafik vorausgesetzt. Ist nichts davon vorhanden, wird // We require either a QuickDraw-Bitmap or a graphic here. If we do not have
// eine Ersatzdarstellung ausgegeben. // either, we return a replacement.
/// delete unused 3rd parameter. // delete unused 3rd parameter.
/// use aligned rectangle for drawing graphic. // use aligned rectangle for drawing graphic.
/// pixel-align coordinations for drawing graphic. // pixel-align coordinations for drawing graphic.
void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) const void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) const
{ {
ViewShell* pShell = getRootFrm()->GetCurrShell(); ViewShell* pShell = getRootFrm()->GetCurrShell();
...@@ -790,25 +787,25 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons ...@@ -790,25 +787,25 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() ); const bool bIsChart = pOLENd && ChartPrettyPainter::IsChart( pOLENd->GetOLEObj().GetObject() );
/// calculate aligned rectangle from parameter <rGrfArea>. // calculate aligned rectangle from parameter <rGrfArea>.
/// Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in // Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
/// the following code. // the following code.
SwRect aAlignedGrfArea = rGrfArea; SwRect aAlignedGrfArea = rGrfArea;
::SwAlignRect( aAlignedGrfArea, pShell ); ::SwAlignRect( aAlignedGrfArea, pShell );
if( !bIsChart ) if( !bIsChart )
{ {
/// Because for drawing a graphic left-top-corner and size coordinations are // Because for drawing a graphic left-top-corner and size coordinations are
/// used, these coordinations have to be determined on pixel level. // used, these coordinations have to be determined on pixel level.
::SwAlignGrfRect( &aAlignedGrfArea, *pOut ); ::SwAlignGrfRect( &aAlignedGrfArea, *pOut );
} }
else //if( bIsChart ) else //if( bIsChart )
{ {
//#i78025# charts own borders are not completely visible // #i78025# charts own borders are not completely visible
//the above pixel correction is not correct - at least not for charts // the above pixel correction is not correct - at least not for charts
//so a different pixel correction is choosen here // so a different pixel correction is chosen here
//this might be a good idea for all other OLE objects also, // this might be a good idea for all other OLE objects also,
//but as I cannot oversee the consequences I fix it only for charts for now // but as I cannot oversee the consequences I fix it only for charts for now
lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut ); lcl_correctlyAlignRect( aAlignedGrfArea, rGrfArea, pOut );
} }
...@@ -836,7 +833,6 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons ...@@ -836,7 +833,6 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
} }
// #i85717#, #i90395# - check, if asynchronous retrieval // #i85717#, #i90395# - check, if asynchronous retrieval
// if input stream for the graphic is possible // if input stream for the graphic is possible
// else if( GRAPHIC_DEFAULT == rGrfObj.GetType() &&
else if ( ( rGrfObj.GetType() == GRAPHIC_DEFAULT || else if ( ( rGrfObj.GetType() == GRAPHIC_DEFAULT ||
rGrfObj.GetType() == GRAPHIC_NONE ) && rGrfObj.GetType() == GRAPHIC_NONE ) &&
pGrfNd->IsLinkedFile() && pGrfNd->IsLinkedFile() &&
...@@ -893,7 +889,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons ...@@ -893,7 +889,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
OSL_ENSURE( OUTDEV_VIRDEV != pOut->GetOutDevType() || OSL_ENSURE( OUTDEV_VIRDEV != pOut->GetOutDevType() ||
pShell->GetViewOptions()->IsPDFExport(), pShell->GetViewOptions()->IsPDFExport(),
"pOut sollte kein virtuelles Device sein" ); "pOut should not be a virtual device" );
rGrfObj.StartAnimation( pOut, aAlignedGrfArea.Pos(), rGrfObj.StartAnimation( pOut, aAlignedGrfArea.Pos(),
aAlignedGrfArea.SSize(), long(this), aAlignedGrfArea.SSize(), long(this),
...@@ -928,7 +924,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons ...@@ -928,7 +924,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, sal_True ); ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, sal_True );
} }
//Beim Drucken duerfen wir nicht die Grafiken sammeln... // When printing, we must not collect the graphics
if( bSwapped && bPrn ) if( bSwapped && bPrn )
bForceSwap = sal_True; bForceSwap = sal_True;
} }
...@@ -940,13 +936,13 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons ...@@ -940,13 +936,13 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
pOut->SetAntialiasing( nFormerAntialiasingAtOutput ); pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
} }
else if( bIsChart else if( bIsChart
//charts must be painted resolution dependent!! #i82893#, #i75867# // Charts must be painted resolution dependent!! #i82893#, #i75867#
&& ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( pOut ) && ChartPrettyPainter::ShouldPrettyPaintChartOnThisDevice( pOut )
&& svt::EmbeddedObjectRef::TryRunningState( pOLENd->GetOLEObj().GetOleRef() ) && svt::EmbeddedObjectRef::TryRunningState( pOLENd->GetOLEObj().GetOleRef() )
&& ChartPrettyPainter::DoPrettyPaintChart( uno::Reference< frame::XModel >( && ChartPrettyPainter::DoPrettyPaintChart( uno::Reference< frame::XModel >(
pOLENd->GetOLEObj().GetOleRef()->getComponent(), uno::UNO_QUERY), pOut, aAlignedGrfArea.SVRect() ) ) pOLENd->GetOLEObj().GetOleRef()->getComponent(), uno::UNO_QUERY), pOut, aAlignedGrfArea.SVRect() ) )
{ {
(void)(0);//all was done in if statement (void)(0);// all was done in if statement
} }
else if( pOLENd ) else if( pOLENd )
{ {
...@@ -967,8 +963,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons ...@@ -967,8 +963,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
Point aPosition(aAlignedGrfArea.Pos()); Point aPosition(aAlignedGrfArea.Pos());
Size aSize(aAlignedGrfArea.SSize()); Size aSize(aAlignedGrfArea.SSize());
// Im BrowseModus gibt es nicht unbedingt einen Drucker und // We do not have a printer in the BrowseMode and thus no JobSetup, so we create one ...
// damit kein JobSetup, also legen wir eines an ...
const JobSetup* pJobSetup = pOLENd->getIDocumentDeviceAccess()->getJobsetup(); const JobSetup* pJobSetup = pOLENd->getIDocumentDeviceAccess()->getJobsetup();
sal_Bool bDummyJobSetup = 0 == pJobSetup; sal_Bool bDummyJobSetup = 0 == pJobSetup;
if( bDummyJobSetup ) if( bDummyJobSetup )
...@@ -995,7 +990,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons ...@@ -995,7 +990,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
::svt::EmbeddedObjectRef::DrawPaintReplacement( Rectangle( aPosition, aSize ), pOLENd->GetOLEObj().GetCurrentPersistName(), pOut ); ::svt::EmbeddedObjectRef::DrawPaintReplacement( Rectangle( aPosition, aSize ), pOLENd->GetOLEObj().GetCurrentPersistName(), pOut );
if( bDummyJobSetup ) if( bDummyJobSetup )
delete pJobSetup; // ... und raeumen wieder auf. delete pJobSetup; // ... and clean it up again
sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() ); sal_Int64 nMiscStatus = pOLENd->GetOLEObj().GetOleRef()->getStatus( pOLENd->GetAspect() );
if ( !bPrn && pShell->ISA( SwCrsrShell ) && if ( !bPrn && pShell->ISA( SwCrsrShell ) &&
...@@ -1022,14 +1017,14 @@ sal_Bool SwNoTxtFrm::IsTransparent() const ...@@ -1022,14 +1017,14 @@ sal_Bool SwNoTxtFrm::IsTransparent() const
if( 0 != (pNd = GetNode()->GetGrfNode()) ) if( 0 != (pNd = GetNode()->GetGrfNode()) )
return pNd->IsTransparent(); return pNd->IsTransparent();
//#29381# OLE sind immer Transparent. //#29381# OLE are always transparent
return sal_True; return sal_True;
} }
void SwNoTxtFrm::StopAnimation( OutputDevice* pOut ) const void SwNoTxtFrm::StopAnimation( OutputDevice* pOut ) const
{ {
//animierte Grafiken anhalten // Stop animated graphics
SwGrfNode* pGrfNd = (SwGrfNode*)GetNode()->GetGrfNode(); SwGrfNode* pGrfNd = (SwGrfNode*)GetNode()->GetGrfNode();
if( pGrfNd && pGrfNd->IsAnimated() ) if( pGrfNd && pGrfNd->IsAnimated() )
pGrfNd->GetGrfObj().StopAnimation( pOut, long(this) ); pGrfNd->GetGrfObj().StopAnimation( pOut, long(this) );
......
...@@ -76,7 +76,7 @@ sal_Bool SwServerObject::GetData( uno::Any & rData, ...@@ -76,7 +76,7 @@ sal_Bool SwServerObject::GetData( uno::Any & rData,
case BOOKMARK_SERVER: case BOOKMARK_SERVER:
if( CNTNT_TYPE.pBkmk->IsExpanded() ) if( CNTNT_TYPE.pBkmk->IsExpanded() )
{ {
// Bereich aufspannen // Span area
pPam = new SwPaM( CNTNT_TYPE.pBkmk->GetMarkPos(), pPam = new SwPaM( CNTNT_TYPE.pBkmk->GetMarkPos(),
CNTNT_TYPE.pBkmk->GetOtherMarkPos() ); CNTNT_TYPE.pBkmk->GetOtherMarkPos() );
} }
...@@ -99,7 +99,7 @@ sal_Bool SwServerObject::GetData( uno::Any & rData, ...@@ -99,7 +99,7 @@ sal_Bool SwServerObject::GetData( uno::Any & rData,
if( pPam ) if( pPam )
{ {
// Stream anlegen // Create stream
SvMemoryStream aMemStm( 65535, 65535 ); SvMemoryStream aMemStm( 65535, 65535 );
SwWriter aWrt( aMemStm, *pPam, sal_False ); SwWriter aWrt( aMemStm, *pPam, sal_False );
if( !IsError( aWrt.Write( xWrt )) ) if( !IsError( aWrt.Write( xWrt )) )
...@@ -128,7 +128,7 @@ sal_Bool SwServerObject::SetData( const String & , ...@@ -128,7 +128,7 @@ sal_Bool SwServerObject::SetData( const String & ,
void SwServerObject::SendDataChanged( const SwPosition& rPos ) void SwServerObject::SendDataChanged( const SwPosition& rPos )
{ {
// ist an unseren Aenderungen jemand interessiert ? // Is someone interested in our changes?
if( HasDataLinks() ) if( HasDataLinks() )
{ {
int bCall = sal_False; int bCall = sal_False;
...@@ -155,7 +155,7 @@ void SwServerObject::SendDataChanged( const SwPosition& rPos ) ...@@ -155,7 +155,7 @@ void SwServerObject::SendDataChanged( const SwPosition& rPos )
if( bCall ) if( bCall )
{ {
// Recursionen erkennen und flaggen // Recognize recursions and flag them
IsLinkInServer( 0 ); IsLinkInServer( 0 );
SvLinkSource::NotifyDataChanged(); SvLinkSource::NotifyDataChanged();
} }
...@@ -165,7 +165,7 @@ void SwServerObject::SendDataChanged( const SwPosition& rPos ) ...@@ -165,7 +165,7 @@ void SwServerObject::SendDataChanged( const SwPosition& rPos )
void SwServerObject::SendDataChanged( const SwPaM& rRange ) void SwServerObject::SendDataChanged( const SwPaM& rRange )
{ {
// ist an unseren Aenderungen jemand interessiert ? // Is someone interested in our changes?
if( HasDataLinks() ) if( HasDataLinks() )
{ {
int bCall = sal_False; int bCall = sal_False;
...@@ -187,14 +187,14 @@ void SwServerObject::SendDataChanged( const SwPaM& rRange ) ...@@ -187,14 +187,14 @@ void SwServerObject::SendDataChanged( const SwPaM& rRange )
} }
if( pNd ) if( pNd )
{ {
// liegt der Start-Bereich im Node Bereich ? // Is the start area within the node area?
bCall = pStt->nNode.GetIndex() < pNd->EndOfSectionIndex() && bCall = pStt->nNode.GetIndex() < pNd->EndOfSectionIndex() &&
pEnd->nNode.GetIndex() >= pNd->GetIndex(); pEnd->nNode.GetIndex() >= pNd->GetIndex();
} }
if( bCall ) if( bCall )
{ {
// Recursionen erkennen und flaggen // Recognize recursions and flag them
IsLinkInServer( 0 ); IsLinkInServer( 0 );
SvLinkSource::NotifyDataChanged(); SvLinkSource::NotifyDataChanged();
} }
...@@ -243,10 +243,10 @@ sal_Bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const ...@@ -243,10 +243,10 @@ sal_Bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const
if( nSttNd && nEndNd ) if( nSttNd && nEndNd )
{ {
// LinkManager besorgen: // Get LinkManager
const ::sfx2::SvBaseLinks& rLnks = pNds->GetDoc()->GetLinkManager().GetLinks(); const ::sfx2::SvBaseLinks& rLnks = pNds->GetDoc()->GetLinkManager().GetLinks();
// um Rekursionen zu Verhindern: ServerType umsetzen! // To avoid recursions: convert ServerType!
SwServerObject::ServerModes eSave = eType; SwServerObject::ServerModes eSave = eType;
if( !pChkLnk ) if( !pChkLnk )
((SwServerObject*)this)->eType = NONE_SERVER; ((SwServerObject*)this)->eType = NONE_SERVER;
...@@ -322,8 +322,7 @@ SwDataChanged::SwDataChanged( SwDoc* pDc, const SwPosition& rPos, sal_uInt16 nTy ...@@ -322,8 +322,7 @@ SwDataChanged::SwDataChanged( SwDoc* pDc, const SwPosition& rPos, sal_uInt16 nTy
SwDataChanged::~SwDataChanged() SwDataChanged::~SwDataChanged()
{ {
// JP 09.04.96: nur wenn das Layout vorhanden ist ( also waehrend der // JP 09.04.96: Only if the Layout is available (thus during input)
// Eingabe)
if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225 if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{ {
const ::sfx2::SvLinkSources& rServers = pDoc->GetLinkManager().GetServers(); const ::sfx2::SvLinkSources& rServers = pDoc->GetLinkManager().GetServers();
...@@ -331,7 +330,7 @@ SwDataChanged::~SwDataChanged() ...@@ -331,7 +330,7 @@ SwDataChanged::~SwDataChanged()
for( sal_uInt16 nCnt = rServers.Count(); nCnt; ) for( sal_uInt16 nCnt = rServers.Count(); nCnt; )
{ {
::sfx2::SvLinkSourceRef refObj( rServers[ --nCnt ] ); ::sfx2::SvLinkSourceRef refObj( rServers[ --nCnt ] );
// noch jemand am Object interessiert ? // Any one else interested in the Object?
if( refObj->HasDataLinks() && refObj->ISA( SwServerObject )) if( refObj->HasDataLinks() && refObj->ISA( SwServerObject ))
{ {
SwServerObject& rObj = *(SwServerObject*)&refObj; SwServerObject& rObj = *(SwServerObject*)&refObj;
...@@ -341,11 +340,11 @@ SwDataChanged::~SwDataChanged() ...@@ -341,11 +340,11 @@ SwDataChanged::~SwDataChanged()
rObj.SendDataChanged( *pPam ); rObj.SendDataChanged( *pPam );
} }
// sollte jetzt gar keine Verbindung mehr bestehen // We shouldn't have a connection anymore
if( !refObj->HasDataLinks() ) if( !refObj->HasDataLinks() )
{ {
// dann raus aus der Liste (Object bleibt aber bestehen!) // Then remove from the list
// falls es noch da ist !! // Object is not destroyed, if it still is there!
if( nCnt < rServers.Count() && &refObj == rServers[ nCnt ] ) if( nCnt < rServers.Count() && &refObj == rServers[ nCnt ] )
pDoc->GetLinkManager().RemoveServer( nCnt, 1 ); pDoc->GetLinkManager().RemoveServer( nCnt, 1 );
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include <svx/dialmgr.hxx> #include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc> #include <svx/dialogs.hrc>
#define READ_OLDVERS // erstmal noch alte Versionen lesen #define READ_OLDVERS // read the old version for a start
#include <swtypes.hxx> #include <swtypes.hxx>
#include <doc.hxx> #include <doc.hxx>
#include <poolfmt.hxx> #include <poolfmt.hxx>
...@@ -51,13 +51,13 @@ ...@@ -51,13 +51,13 @@
using ::editeng::SvxBorderLine; using ::editeng::SvxBorderLine;
// bis SO5PF // until SO5PF
const sal_uInt16 AUTOFORMAT_ID_X = 9501; const sal_uInt16 AUTOFORMAT_ID_X = 9501;
const sal_uInt16 AUTOFORMAT_ID_358 = 9601; const sal_uInt16 AUTOFORMAT_ID_358 = 9601;
const sal_uInt16 AUTOFORMAT_DATA_ID_X = 9502; const sal_uInt16 AUTOFORMAT_DATA_ID_X = 9502;
// ab SO5 // from SO5
//! in nachfolgenden Versionen muss der Betrag dieser IDs groesser sein //! In follow-up versions these IDs' values need to increase
const sal_uInt16 AUTOFORMAT_ID_504 = 9801; const sal_uInt16 AUTOFORMAT_ID_504 = 9801;
const sal_uInt16 AUTOFORMAT_DATA_ID_504 = 9802; const sal_uInt16 AUTOFORMAT_DATA_ID_504 = 9802;
...@@ -96,11 +96,11 @@ SwBoxAutoFmt* SwTableAutoFmt::pDfltBoxAutoFmt = 0; ...@@ -96,11 +96,11 @@ SwBoxAutoFmt* SwTableAutoFmt::pDfltBoxAutoFmt = 0;
#define sAutoTblFmtName "autotbl.fmt" #define sAutoTblFmtName "autotbl.fmt"
// SwTable Auto-Format-Tabelle // SwTable AutoFormat Table
SV_IMPL_PTRARR( _SwTableAutoFmtTbl, SwTableAutoFmt* ) SV_IMPL_PTRARR( _SwTableAutoFmtTbl, SwTableAutoFmt* )
// Struct mit Versionsnummern der Items // Struct with version numbers of the Items
struct SwAfVersions struct SwAfVersions
{ {
...@@ -405,7 +405,7 @@ sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, s ...@@ -405,7 +405,7 @@ sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, s
rStream >> eSys >> eLge; rStream >> eSys >> eLge;
eSysLanguage = (LanguageType) eSys; eSysLanguage = (LanguageType) eSys;
eNumFmtLanguage = (LanguageType) eLge; eNumFmtLanguage = (LanguageType) eLge;
if ( eSysLanguage == LANGUAGE_SYSTEM ) // von alten Versionen (Calc) if ( eSysLanguage == LANGUAGE_SYSTEM ) // from old versions (Calc)
eSysLanguage = static_cast<LanguageType>(::GetAppLanguage()); eSysLanguage = static_cast<LanguageType>(::GetAppLanguage());
} }
...@@ -481,7 +481,7 @@ sal_Bool SwBoxAutoFmt::Save( SvStream& rStream ) const ...@@ -481,7 +481,7 @@ sal_Bool SwBoxAutoFmt::Save( SvStream& rStream ) const
aOrientation.Store( rStream, aOrientation.GetVersion(SOFFICE_FILEFORMAT_40) ); aOrientation.Store( rStream, aOrientation.GetVersion(SOFFICE_FILEFORMAT_40) );
aMargin.Store( rStream, aMargin.GetVersion(SOFFICE_FILEFORMAT_40) ); aMargin.Store( rStream, aMargin.GetVersion(SOFFICE_FILEFORMAT_40) );
aLinebreak.Store( rStream, aLinebreak.GetVersion(SOFFICE_FILEFORMAT_40) ); aLinebreak.Store( rStream, aLinebreak.GetVersion(SOFFICE_FILEFORMAT_40) );
// Calc Rotation ab SO5 // Calc Rotation from SO5
aRotateAngle.Store( rStream, aRotateAngle.GetVersion(SOFFICE_FILEFORMAT_40) ); aRotateAngle.Store( rStream, aRotateAngle.GetVersion(SOFFICE_FILEFORMAT_40) );
aRotateMode.Store( rStream, aRotateMode.GetVersion(SOFFICE_FILEFORMAT_40) ); aRotateMode.Store( rStream, aRotateMode.GetVersion(SOFFICE_FILEFORMAT_40) );
...@@ -556,9 +556,9 @@ SwTableAutoFmt& SwTableAutoFmt::operator=( const SwTableAutoFmt& rNew ) ...@@ -556,9 +556,9 @@ SwTableAutoFmt& SwTableAutoFmt::operator=( const SwTableAutoFmt& rNew )
delete aBoxAutoFmt[ n ]; delete aBoxAutoFmt[ n ];
SwBoxAutoFmt* pFmt = rNew.aBoxAutoFmt[ n ]; SwBoxAutoFmt* pFmt = rNew.aBoxAutoFmt[ n ];
if( pFmt ) // ist gesetzt -> kopieren if( pFmt ) // if is set -> copy
aBoxAutoFmt[ n ] = new SwBoxAutoFmt( *pFmt ); aBoxAutoFmt[ n ] = new SwBoxAutoFmt( *pFmt );
else // sonst default else // else default
aBoxAutoFmt[ n ] = 0; aBoxAutoFmt[ n ] = 0;
} }
...@@ -586,26 +586,26 @@ SwTableAutoFmt::~SwTableAutoFmt() ...@@ -586,26 +586,26 @@ SwTableAutoFmt::~SwTableAutoFmt()
void SwTableAutoFmt::SetBoxFmt( const SwBoxAutoFmt& rNew, sal_uInt8 nPos ) void SwTableAutoFmt::SetBoxFmt( const SwBoxAutoFmt& rNew, sal_uInt8 nPos )
{ {
OSL_ENSURE( nPos < 16, "falscher Bereich" ); OSL_ENSURE( nPos < 16, "wrong area" );
SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ]; SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ];
if( pFmt ) // ist gesetzt -> kopieren if( pFmt ) // if is set -> copy
*aBoxAutoFmt[ nPos ] = rNew; *aBoxAutoFmt[ nPos ] = rNew;
else // sonst neu setzen else // else set anew
aBoxAutoFmt[ nPos ] = new SwBoxAutoFmt( rNew ); aBoxAutoFmt[ nPos ] = new SwBoxAutoFmt( rNew );
} }
const SwBoxAutoFmt& SwTableAutoFmt::GetBoxFmt( sal_uInt8 nPos ) const const SwBoxAutoFmt& SwTableAutoFmt::GetBoxFmt( sal_uInt8 nPos ) const
{ {
OSL_ENSURE( nPos < 16, "falscher Bereich" ); OSL_ENSURE( nPos < 16, "wrong area" );
SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ]; SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ];
if( pFmt ) // ist gesetzt -> kopieren if( pFmt ) // if is set -> copy
return *pFmt; return *pFmt;
else // sonst den default returnen else // else return the default
{ {
// falls noch nicht vorhanden: // If it doesn't exist yet:
if( !pDfltBoxAutoFmt ) if( !pDfltBoxAutoFmt )
pDfltBoxAutoFmt = new SwBoxAutoFmt; pDfltBoxAutoFmt = new SwBoxAutoFmt;
return *pDfltBoxAutoFmt; return *pDfltBoxAutoFmt;
...@@ -619,10 +619,10 @@ SwBoxAutoFmt& SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos, ...@@ -619,10 +619,10 @@ SwBoxAutoFmt& SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos,
UpdateFlags eFlags, UpdateFlags eFlags,
SvNumberFormatter* pNFmtr ) SvNumberFormatter* pNFmtr )
{ {
OSL_ENSURE( nPos < 16, "falscher Bereich" ); OSL_ENSURE( nPos < 16, "wrong area" );
SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ]; SwBoxAutoFmt* pFmt = aBoxAutoFmt[ nPos ];
if( !pFmt ) // ist gesetzt -> kopieren if( !pFmt ) // if is set -> copy
{ {
pFmt = new SwBoxAutoFmt; pFmt = new SwBoxAutoFmt;
aBoxAutoFmt[ nPos ] = pFmt; aBoxAutoFmt[ nPos ] = pFmt;
...@@ -668,12 +668,12 @@ SwBoxAutoFmt& SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos, ...@@ -668,12 +668,12 @@ SwBoxAutoFmt& SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos,
static_cast<LanguageType>(::GetAppLanguage())); static_cast<LanguageType>(::GetAppLanguage()));
else else
{ {
// defaulten // default
pFmt->SetValueFormat( aEmptyStr, LANGUAGE_SYSTEM, pFmt->SetValueFormat( aEmptyStr, LANGUAGE_SYSTEM,
static_cast<LanguageType>(::GetAppLanguage() )); static_cast<LanguageType>(::GetAppLanguage() ));
} }
} }
// den Rest koennen wir nicht, StarCalc spezifisch // we cannot handle the rest, that's specific to StarCalc
return *pFmt; return *pFmt;
} }
...@@ -763,7 +763,7 @@ void SwTableAutoFmt::UpdateToSet( sal_uInt8 nPos, SfxItemSet& rSet, ...@@ -763,7 +763,7 @@ void SwTableAutoFmt::UpdateToSet( sal_uInt8 nPos, SfxItemSet& rSet,
} }
} }
// den Rest koennen wir nicht, StarCalc spezifisch // we cannot handle the rest, that's specific to StarCalc
} }
...@@ -876,9 +876,9 @@ sal_Bool SwTableAutoFmt::Save( SvStream& rStream ) const ...@@ -876,9 +876,9 @@ sal_Bool SwTableAutoFmt::Save( SvStream& rStream ) const
for( int i = 0; bRet && i < 16; ++i ) for( int i = 0; bRet && i < 16; ++i )
{ {
SwBoxAutoFmt* pFmt = aBoxAutoFmt[ i ]; SwBoxAutoFmt* pFmt = aBoxAutoFmt[ i ];
if( !pFmt ) // nicht gesetzt -> default schreiben if( !pFmt ) // if not set -> write default
{ {
// falls noch nicht vorhanden: // If it doesn't exist yet:
if( !pDfltBoxAutoFmt ) if( !pDfltBoxAutoFmt )
pDfltBoxAutoFmt = new SwBoxAutoFmt; pDfltBoxAutoFmt = new SwBoxAutoFmt;
pFmt = pDfltBoxAutoFmt; pFmt = pDfltBoxAutoFmt;
...@@ -907,13 +907,13 @@ SwTableAutoFmtTbl::SwTableAutoFmtTbl() ...@@ -907,13 +907,13 @@ SwTableAutoFmtTbl::SwTableAutoFmtTbl()
for( i = 0; i < 4; ++i ) for( i = 0; i < 4; ++i )
pNew->SetBoxFmt( aNew, i ); pNew->SetBoxFmt( aNew, i );
// 70% Grau // 70% gray
aBrushItem.SetColor( RGB_COLORDATA( 0x4d, 0x4d, 0x4d ) ); aBrushItem.SetColor( RGB_COLORDATA( 0x4d, 0x4d, 0x4d ) );
aNew.SetBackground( aBrushItem ); aNew.SetBackground( aBrushItem );
for( i = 4; i <= 12; i += 4 ) for( i = 4; i <= 12; i += 4 )
pNew->SetBoxFmt( aNew, i ); pNew->SetBoxFmt( aNew, i );
// 20% Grau // 20% gray
aBrushItem.SetColor( RGB_COLORDATA( 0xcc, 0xcc, 0xcc ) ); aBrushItem.SetColor( RGB_COLORDATA( 0xcc, 0xcc, 0xcc ) );
aNew.SetBackground( aBrushItem ); aNew.SetBackground( aBrushItem );
aColor.SetColor( COL_BLACK ); aColor.SetColor( COL_BLACK );
...@@ -978,7 +978,7 @@ sal_Bool SwTableAutoFmtTbl::Load( SvStream& rStream ) ...@@ -978,7 +978,7 @@ sal_Bool SwTableAutoFmtTbl::Load( SvStream& rStream )
sal_Bool bRet = 0 == rStream.GetError(); sal_Bool bRet = 0 == rStream.GetError();
if (bRet) if (bRet)
{ {
// Achtung hier muss ein allgemeiner Header gelesen werden // Attention: We need to read a general Header here
sal_uInt16 nVal = 0; sal_uInt16 nVal = 0;
rStream >> nVal; rStream >> nVal;
bRet = 0 == rStream.GetError(); bRet = 0 == rStream.GetError();
...@@ -998,7 +998,7 @@ sal_Bool SwTableAutoFmtTbl::Load( SvStream& rStream ) ...@@ -998,7 +998,7 @@ sal_Bool SwTableAutoFmtTbl::Load( SvStream& rStream )
// rStream >> nFileVers; // rStream >> nFileVers;
if( rStream.Tell() != sal_uLong(nPos + nCnt) ) if( rStream.Tell() != sal_uLong(nPos + nCnt) )
{ {
OSL_ENSURE( !this, "Der Header enthaelt mehr/neuere Daten" ); OSL_ENSURE( !this, "The Header contains more or newer Data" );
rStream.Seek( nPos + nCnt ); rStream.Seek( nPos + nCnt );
} }
rStream.SetStreamCharSet( (CharSet)nChrSet ); rStream.SetStreamCharSet( (CharSet)nChrSet );
...@@ -1008,7 +1008,7 @@ sal_Bool SwTableAutoFmtTbl::Load( SvStream& rStream ) ...@@ -1008,7 +1008,7 @@ sal_Bool SwTableAutoFmtTbl::Load( SvStream& rStream )
if( nVal == AUTOFORMAT_ID_358 || nVal == AUTOFORMAT_ID_X || if( nVal == AUTOFORMAT_ID_358 || nVal == AUTOFORMAT_ID_X ||
(AUTOFORMAT_ID_504 <= nVal && nVal <= AUTOFORMAT_ID) ) (AUTOFORMAT_ID_504 <= nVal && nVal <= AUTOFORMAT_ID) )
{ {
aVersions.Load( rStream, nVal ); // Item-Versionen aVersions.Load( rStream, nVal ); // Item versions
SwTableAutoFmt* pNew; SwTableAutoFmt* pNew;
sal_uInt16 nAnz = 0; sal_uInt16 nAnz = 0;
...@@ -1075,16 +1075,15 @@ sal_Bool SwTableAutoFmtTbl::Save( SvStream& rStream ) const ...@@ -1075,16 +1075,15 @@ sal_Bool SwTableAutoFmtTbl::Save( SvStream& rStream ) const
{ {
rStream.SetVersion( SOFFICE_FILEFORMAT_40 ); rStream.SetVersion( SOFFICE_FILEFORMAT_40 );
// Achtung hier muss ein allgemeiner Header gespeichert werden // Attention: We need to save a general Header here
sal_uInt16 nVal = AUTOFORMAT_ID; sal_uInt16 nVal = AUTOFORMAT_ID;
rStream << nVal rStream << nVal
<< (sal_uInt8)2 // Anzahl von Zeichen des Headers incl. diesem << (sal_uInt8)2 // Character count of the Header including this value
<< (sal_uInt8)GetStoreCharSet( ::osl_getThreadTextEncoding() ); << (sal_uInt8)GetStoreCharSet( ::osl_getThreadTextEncoding() );
bRet = 0 == rStream.GetError(); bRet = 0 == rStream.GetError();
//----------------------------------------------------------- // Write this version number for all attributes
// die VersionsNummer fuer alle Attribute schreiben
(*this)[ 0 ]->GetBoxFmt( 0 ).SaveVerionNo( rStream ); (*this)[ 0 ]->GetBoxFmt( 0 ).SaveVerionNo( rStream );
rStream << (sal_uInt16)(Count() - 1); rStream << (sal_uInt16)(Count() - 1);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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