Kaydet (Commit) e89804f1 authored tarafından Philipp Riemer's avatar Philipp Riemer

fdo#39468: Translate German comments in sw/source/core/graphic

Change-Id: Ic78269f73b31125d7326b9aa1bfca76d7e881177
üst 24c3a58a
...@@ -79,7 +79,7 @@ bool SwMirrorGrf::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const ...@@ -79,7 +79,7 @@ bool SwMirrorGrf::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
{ {
bool bRet = true; bool bRet = true;
sal_Bool bVal; sal_Bool bVal;
// Vertikal und Horizontal sind mal getauscht worden! // vertical and horizontal were swapped at some point
nMemberId &= ~CONVERT_TWIPS; nMemberId &= ~CONVERT_TWIPS;
switch ( nMemberId ) switch ( nMemberId )
{ {
...@@ -105,7 +105,7 @@ bool SwMirrorGrf::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) ...@@ -105,7 +105,7 @@ bool SwMirrorGrf::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{ {
bool bRet = true; bool bRet = true;
sal_Bool bVal = *(sal_Bool*)rVal.getValue(); sal_Bool bVal = *(sal_Bool*)rVal.getValue();
// Vertikal und Horizontal sind mal getauscht worden! // vertical and horizontal were swapped at some point
nMemberId &= ~CONVERT_TWIPS; nMemberId &= ~CONVERT_TWIPS;
switch ( nMemberId ) switch ( nMemberId )
{ {
......
...@@ -94,8 +94,12 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, ...@@ -94,8 +94,12 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
bGrafikArrived = sal_True; bGrafikArrived = sal_True;
} }
// Konstruktor fuer den SW/G-Reader. Dieser ctor wird verwendet, /** Create new SW/G reader.
// wenn eine gelinkte Grafik gelesen wird. Sie liest diese NICHT ein. *
* Use this ctor if you want to read a linked graphic.
*
* @note Does not read/open the image itself!
*/
SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
const String& rGrfName, const String& rFltName, const String& rGrfName, const String& rFltName,
SwGrfFmtColl *pGrfColl, SwGrfFmtColl *pGrfColl,
...@@ -123,7 +127,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, ...@@ -123,7 +127,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
if( INET_PROT_FILE == aUrl.GetProtocol() && if( INET_PROT_FILE == aUrl.GetProtocol() &&
FStatHelper::IsDocument( aUrl.GetMainURL( INetURLObject::NO_DECODE ) )) FStatHelper::IsDocument( aUrl.GetMainURL( INetURLObject::NO_DECODE ) ))
{ {
// File vorhanden, Verbindung herstellen ohne ein Update // file exists, so create connection without an update
((SwBaseLink*)&refLink)->Connect(); ((SwBaseLink*)&refLink)->Connect();
} }
} }
...@@ -141,15 +145,14 @@ sal_Bool SwGrfNode::ReRead( ...@@ -141,15 +145,14 @@ sal_Bool SwGrfNode::ReRead(
OSL_ENSURE( pGraphic || pGrfObj || rGrfName.Len(), OSL_ENSURE( pGraphic || pGrfObj || rGrfName.Len(),
"GraphicNode without a name, Graphic or GraphicObject" ); "GraphicNode without a name, Graphic or GraphicObject" );
// ReadRead mit Namen // with name
if( refLink.Is() ) if( refLink.Is() )
{ {
OSL_ENSURE( !bInSwapIn, "ReRead: stehe noch im SwapIn" ); OSL_ENSURE( !bInSwapIn, "ReRead: I am still in SwapIn" );
if( rGrfName.Len() ) if( rGrfName.Len() )
{ {
// Besonderheit: steht im FltNamen DDE, handelt es sich um eine // Note: If there is DDE in the FltName, than it is a DDE-linked graphic
// DDE-gelinkte Grafik
String sCmd( rGrfName ); String sCmd( rGrfName );
if( rFltName.Len() ) if( rFltName.Len() )
{ {
...@@ -171,7 +174,7 @@ sal_Bool SwGrfNode::ReRead( ...@@ -171,7 +174,7 @@ sal_Bool SwGrfNode::ReRead(
refLink->SetLinkSourceName( sCmd ); refLink->SetLinkSourceName( sCmd );
} }
else // kein Name mehr, Link aufheben else // no name anymore, so remove link
{ {
GetDoc()->GetLinkManager().Remove( refLink ); GetDoc()->GetLinkManager().Remove( refLink );
refLink.Clear(); refLink.Clear();
...@@ -194,9 +197,8 @@ sal_Bool SwGrfNode::ReRead( ...@@ -194,9 +197,8 @@ sal_Bool SwGrfNode::ReRead(
} }
else else
{ {
// MIB 25.02.97: Daten der alten Grafik zuruecksetzen, damit // reset data of the old graphic so that the correct placeholder is
// die korrekte Ersatz-Darstellung erscheint, wenn die // shown in case the new link could not be loaded
// der neue Link nicht geladen werden konnte.
Graphic aGrf; aGrf.SetDefaultType(); Graphic aGrf; aGrf.SetDefaultType();
maGrfObj.SetGraphic( aGrf, rGrfName ); maGrfObj.SetGraphic( aGrf, rGrfName );
...@@ -242,17 +244,15 @@ sal_Bool SwGrfNode::ReRead( ...@@ -242,17 +244,15 @@ sal_Bool SwGrfNode::ReRead(
maGrfObj.SetSwapState(); maGrfObj.SetSwapState();
bReadGrf = sal_True; bReadGrf = sal_True;
} }
// Import einer Grafik: // Was the graphic already loaded?
// Ist die Grafik bereits geladen?
else if( !bNewGrf && GRAPHIC_NONE != maGrfObj.GetType() ) else if( !bNewGrf && GRAPHIC_NONE != maGrfObj.GetType() )
return sal_True; return sal_True;
else else
{ {
if( HasStreamName() ) if( HasStreamName() )
DelStreamName(); DelStreamName();
// einen neuen Grafik-Link anlegen // create new link for the graphic object
InsertLink( rGrfName, rFltName ); InsertLink( rGrfName, rFltName );
if( GetNodes().IsDocNodes() ) if( GetNodes().IsDocNodes() )
...@@ -262,7 +262,7 @@ sal_Bool SwGrfNode::ReRead( ...@@ -262,7 +262,7 @@ sal_Bool SwGrfNode::ReRead(
maGrfObj.SetGraphic( *pGraphic, rGrfName ); maGrfObj.SetGraphic( *pGraphic, rGrfName );
onGraphicChanged(); onGraphicChanged();
bReadGrf = sal_True; bReadGrf = sal_True;
// Verbindung herstellen ohne ein Update; Grafik haben wir! // create connection without update, as we have the graphic
((SwBaseLink*)&refLink)->Connect(); ((SwBaseLink*)&refLink)->Connect();
} }
else if( pGrfObj ) else if( pGrfObj )
...@@ -271,14 +271,13 @@ sal_Bool SwGrfNode::ReRead( ...@@ -271,14 +271,13 @@ sal_Bool SwGrfNode::ReRead(
maGrfObj.SetLink( rGrfName ); maGrfObj.SetLink( rGrfName );
onGraphicChanged(); onGraphicChanged();
bReadGrf = sal_True; bReadGrf = sal_True;
// Verbindung herstellen ohne ein Update; Grafik haben wir! // create connection without update, as we have the graphic
((SwBaseLink*)&refLink)->Connect(); ((SwBaseLink*)&refLink)->Connect();
} }
else else
{ {
// MIB 25.02.97: Daten der alten Grafik zuruecksetzen, damit // reset data of the old graphic so that the correct placeholder is
// die korrekte Ersatz-Darstellung erscheint, wenn die // shown in case the new link could not be loaded
// der neue Kink nicht geladen werden konnte.
Graphic aGrf; aGrf.SetDefaultType(); Graphic aGrf; aGrf.SetDefaultType();
maGrfObj.SetGraphic( aGrf, rGrfName ); maGrfObj.SetGraphic( aGrf, rGrfName );
onGraphicChanged(); onGraphicChanged();
...@@ -291,12 +290,12 @@ sal_Bool SwGrfNode::ReRead( ...@@ -291,12 +290,12 @@ sal_Bool SwGrfNode::ReRead(
} }
} }
// Bug 39281: Size nicht sofort loeschen - Events auf ImageMaps // Bug 39281: Do not delete Size immediately - Events on ImageMaps should have
// sollten nicht beim Austauschen nicht ins "leere greifen" // something to work with when swapping
if( bSetTwipSize ) if( bSetTwipSize )
SetTwipSize( ::GetGraphicSizeTwip( maGrfObj.GetGraphic(), 0 ) ); SetTwipSize( ::GetGraphicSizeTwip( maGrfObj.GetGraphic(), 0 ) );
// erzeuge noch einen Update auf die Frames // create an updates for the frames
if( bReadGrf && bNewGrf ) if( bReadGrf && bNewGrf )
{ {
SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR ); SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
...@@ -317,7 +316,7 @@ SwGrfNode::~SwGrfNode() ...@@ -317,7 +316,7 @@ SwGrfNode::~SwGrfNode()
SwDoc* pDoc = GetDoc(); SwDoc* pDoc = GetDoc();
if( refLink.Is() ) if( refLink.Is() )
{ {
OSL_ENSURE( !bInSwapIn, "DTOR: stehe noch im SwapIn" ); OSL_ENSURE( !bInSwapIn, "DTOR: I am still in SwapIn" );
pDoc->GetLinkManager().Remove( refLink ); pDoc->GetLinkManager().Remove( refLink );
refLink->Disconnect(); refLink->Disconnect();
} }
...@@ -335,8 +334,7 @@ SwGrfNode::~SwGrfNode() ...@@ -335,8 +334,7 @@ SwGrfNode::~SwGrfNode()
// if( !pDoc->IsInDtor() && HasStreamName() ) // if( !pDoc->IsInDtor() && HasStreamName() )
// DelStreamName(); // DelStreamName();
} }
//#39289# Die Frames muessen hier bereits geloescht weil der DTor der //#39289# delete frames already here since the Frms' dtor needs the graphic for its StopAnimation
//Frms die Grafik noch fuer StopAnimation braucht.
if( GetDepends() ) if( GetDepends() )
DelFrms(); DelFrms();
} }
...@@ -433,7 +431,7 @@ SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere, ...@@ -433,7 +431,7 @@ SwGrfNode * SwNodes::MakeGrfNode( const SwNodeIndex & rWhere,
{ {
OSL_ENSURE( pGrfColl, "MakeGrfNode: Formatpointer ist 0." ); OSL_ENSURE( pGrfColl, "MakeGrfNode: Formatpointer ist 0." );
SwGrfNode *pNode; SwGrfNode *pNode;
// Delayed erzeugen nur aus dem SW/G-Reader // create object delayed, only from a SW/G-reader
if( bDelayed ) if( bDelayed )
pNode = new SwGrfNode( rWhere, rGrfName, pNode = new SwGrfNode( rWhere, rGrfName,
rFltName, pGrfColl, pAutoAttr ); rFltName, pGrfColl, pAutoAttr );
...@@ -476,14 +474,14 @@ sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm ) ...@@ -476,14 +474,14 @@ sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm )
return sal_False; return sal_False;
} }
// Returnwert: /**
// -1 : ReRead erfolgreich * @return -1 if ReRead successful,
// 0 : nicht geladen * 1 if reading successful,
// 1 : Einlesen erfolgreich * 0 if not loaded
*/
short SwGrfNode::SwapIn( sal_Bool bWaitForData ) short SwGrfNode::SwapIn( sal_Bool bWaitForData )
{ {
if( bInSwapIn ) // nicht rekuriv!! if( bInSwapIn ) // not recursively!
return !maGrfObj.IsSwappedOut(); return !maGrfObj.IsSwappedOut();
short nRet = 0; short nRet = 0;
...@@ -495,13 +493,13 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData ) ...@@ -495,13 +493,13 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
if( GRAPHIC_NONE == maGrfObj.GetType() || if( GRAPHIC_NONE == maGrfObj.GetType() ||
GRAPHIC_DEFAULT == maGrfObj.GetType() ) GRAPHIC_DEFAULT == maGrfObj.GetType() )
{ {
// noch nicht geladener Link // link was not loaded yet
//TODO pLink->setInputStream(getInputStream()); //TODO pLink->setInputStream(getInputStream());
if( pLink->SwapIn( bWaitForData ) ) if( pLink->SwapIn( bWaitForData ) )
nRet = -1; nRet = -1;
else if( GRAPHIC_DEFAULT == maGrfObj.GetType() ) else if( GRAPHIC_DEFAULT == maGrfObj.GetType() )
{ {
// keine default Bitmap mehr, also neu Painten! // no default bitmap anymore, thus re-paint
delete mpReplacementGraphic; delete mpReplacementGraphic;
mpReplacementGraphic = 0; mpReplacementGraphic = 0;
...@@ -512,7 +510,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData ) ...@@ -512,7 +510,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
} }
} }
else if( maGrfObj.IsSwappedOut() ) { else if( maGrfObj.IsSwappedOut() ) {
// nachzuladender Link // link to download
//TODO pLink->setInputStream(getInputStream()); //TODO pLink->setInputStream(getInputStream());
nRet = pLink->SwapIn( bWaitForData ) ? 1 : 0; nRet = pLink->SwapIn( bWaitForData ) ? 1 : 0;
} }
...@@ -521,7 +519,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData ) ...@@ -521,7 +519,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
} }
else if( maGrfObj.IsSwappedOut() ) else if( maGrfObj.IsSwappedOut() )
{ {
// Die Grafik ist im Storage oder im TempFile drin // graphic is in storage or in a temp file
if( !HasStreamName() ) if( !HasStreamName() )
nRet = (short)maGrfObj.SwapIn(); nRet = (short)maGrfObj.SwapIn();
else else
...@@ -557,7 +555,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData ) ...@@ -557,7 +555,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
} }
else else
nRet = 1; nRet = 1;
OSL_ENSURE( nRet, "Grafik kann nicht eingeswapt werden" ); OSL_ENSURE( nRet, "Cannot swap in graphic" );
if( nRet ) if( nRet )
{ {
...@@ -576,15 +574,14 @@ short SwGrfNode::SwapOut() ...@@ -576,15 +574,14 @@ short SwGrfNode::SwapOut()
{ {
if( !refLink.Is() ) if( !refLink.Is() )
{ {
// Das Swapping brauchen wir nur fuer Embedded Pictures // Swapping is only needed for embedded pictures.
// Die Grafik wird in eine TempFile geschrieben, wenn // The graphic will be written into a temp file if it is new, i.e.
// sie frisch eingefuegt war, d.h. wenn es noch keinen // if there is no stream name in the storage yet
// Streamnamen im Storage gibt.
if( !HasStreamName() ) if( !HasStreamName() )
if( !maGrfObj.SwapOut() ) if( !maGrfObj.SwapOut() )
return 0; return 0;
} }
// Geschriebene Grafiken oder Links werden jetzt weggeschmissen // written graphics and links are removed here
return (short) maGrfObj.SwapOut( NULL ); return (short) maGrfObj.SwapOut( NULL );
} }
return 1; return 1;
...@@ -616,18 +613,20 @@ bool SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const ...@@ -616,18 +613,20 @@ bool SwGrfNode::GetFileFilterNms( String* pFileNm, String* pFilterNm ) const
return bRet; return bRet;
} }
// Eine Grafik Undo-faehig machen. Falls sie sich bereits in /** Make a graphic object ready for UNDO.
// einem Storage befindet, muss sie geladen werden. *
* If it is already in storage, it needs to be loaded.
*/
sal_Bool SwGrfNode::SavePersistentData() sal_Bool SwGrfNode::SavePersistentData()
{ {
if( refLink.Is() ) if( refLink.Is() )
{ {
OSL_ENSURE( !bInSwapIn, "SavePersistentData: stehe noch im SwapIn" ); OSL_ENSURE( !bInSwapIn, "SavePersistentData: I am still in SwapIn" );
GetDoc()->GetLinkManager().Remove( refLink ); GetDoc()->GetLinkManager().Remove( refLink );
return sal_True; return sal_True;
} }
// Erst mal reinswappen, falls sie im Storage ist // swap in first if already in storage
if( HasStreamName() && !SwapIn() ) if( HasStreamName() && !SwapIn() )
return sal_False; return sal_False;
...@@ -644,7 +643,7 @@ sal_Bool SwGrfNode::SavePersistentData() ...@@ -644,7 +643,7 @@ sal_Bool SwGrfNode::SavePersistentData()
// if( HasStreamName() ) // if( HasStreamName() )
// DelStreamName(); // DelStreamName();
// Und in TempFile rausswappen // swap out into temp file
return (sal_Bool) SwapOut(); return (sal_Bool) SwapOut();
} }
...@@ -710,16 +709,15 @@ void SwGrfNode::ReleaseLink() ...@@ -710,16 +709,15 @@ void SwGrfNode::ReleaseLink()
} }
} }
void SwGrfNode::SetTwipSize( const Size& rSz ) void SwGrfNode::SetTwipSize( const Size& rSz )
{ {
nGrfSize = rSz; nGrfSize = rSz;
if( IsScaleImageMap() && nGrfSize.Width() && nGrfSize.Height() ) if( IsScaleImageMap() && nGrfSize.Width() && nGrfSize.Height() )
{ {
// Image-Map an Grafik-Groesse anpassen // resize Image-Map to size of the graphic
ScaleImageMap(); ScaleImageMap();
// Image-Map nicht noch einmal skalieren // do not re-scale Image-Map
SetScaleImageMap( sal_False ); SetScaleImageMap( sal_False );
} }
} }
...@@ -729,7 +727,7 @@ void SwGrfNode::ScaleImageMap() ...@@ -729,7 +727,7 @@ void SwGrfNode::ScaleImageMap()
if( !nGrfSize.Width() || !nGrfSize.Height() ) if( !nGrfSize.Width() || !nGrfSize.Height() )
return; return;
// dann die Image-Map skalieren // re-scale Image-Map
SwFrmFmt* pFmt = GetFlyFmt(); SwFrmFmt* pFmt = GetFlyFmt();
if( !pFmt ) if( !pFmt )
...@@ -753,7 +751,7 @@ void SwGrfNode::ScaleImageMap() ...@@ -753,7 +751,7 @@ void SwGrfNode::ScaleImageMap()
nWidth -= rBox.CalcLineSpace(BOX_LINE_LEFT) + nWidth -= rBox.CalcLineSpace(BOX_LINE_LEFT) +
rBox.CalcLineSpace(BOX_LINE_RIGHT); rBox.CalcLineSpace(BOX_LINE_RIGHT);
OSL_ENSURE( nWidth>0, "Gibt es 0 twip breite Grafiken!?" ); OSL_ENSURE( nWidth>0, "Do any 0 twip wide graphics exist!?" );
if( nGrfSize.Width() != nWidth ) if( nGrfSize.Width() != nWidth )
{ {
...@@ -768,7 +766,7 @@ void SwGrfNode::ScaleImageMap() ...@@ -768,7 +766,7 @@ void SwGrfNode::ScaleImageMap()
nHeight -= rBox.CalcLineSpace(BOX_LINE_TOP) + nHeight -= rBox.CalcLineSpace(BOX_LINE_TOP) +
rBox.CalcLineSpace(BOX_LINE_BOTTOM); rBox.CalcLineSpace(BOX_LINE_BOTTOM);
OSL_ENSURE( nHeight>0, "Gibt es 0 twip hohe Grafiken!?" ); OSL_ENSURE( nHeight>0, "Do any 0 twip high graphics exist!?" );
if( nGrfSize.Height() != nHeight ) if( nGrfSize.Height() != nHeight )
{ {
...@@ -784,12 +782,11 @@ void SwGrfNode::ScaleImageMap() ...@@ -784,12 +782,11 @@ void SwGrfNode::ScaleImageMap()
} }
} }
void SwGrfNode::DelStreamName() void SwGrfNode::DelStreamName()
{ {
if( HasStreamName() ) if( HasStreamName() )
{ {
// Dann die Grafik im Storage loeschen // then remove graphic from storage
uno::Reference < embed::XStorage > xDocStg = GetDoc()->GetDocStorage(); uno::Reference < embed::XStorage > xDocStg = GetDoc()->GetDocStorage();
if( xDocStg.is() ) if( xDocStg.is() )
{ {
...@@ -936,7 +933,7 @@ void SwGrfNode::_GetStreamStorageNames( String& rStrmName, ...@@ -936,7 +933,7 @@ void SwGrfNode::_GetStreamStorageNames( String& rStrmName,
SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
{ {
// kopiere die Formate in das andere Dokument: // copy formats into the other document
SwGrfFmtColl* pColl = pDoc->CopyGrfColl( *GetGrfColl() ); SwGrfFmtColl* pColl = pDoc->CopyGrfColl( *GetGrfColl() );
Graphic aTmpGrf; Graphic aTmpGrf;
...@@ -1058,12 +1055,12 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj ) ...@@ -1058,12 +1055,12 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
return (long)pRet; return (long)pRet;
} }
// alle QuickDraw-Bitmaps eines speziellen Docs loeschen /// delete all QuickDraw-Bitmaps in the specified document
void DelAllGrfCacheEntries( SwDoc* pDoc ) void DelAllGrfCacheEntries( SwDoc* pDoc )
{ {
if( pDoc ) if( pDoc )
{ {
// alle Graphic-Links mit dem Namen aus dem Cache loeschen // delete all Graphic-Links with this name from cache
const sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager(); const sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager();
const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks(); const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks();
SwGrfNode* pGrfNd; SwGrfNode* pGrfNd;
......
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