[Libreoffice-commits] .: 3 commits - sw/source
Tor Lillqvist
tml at kemper.freedesktop.org
Mon May 28 06:31:01 PDT 2012
sw/source/core/undo/rolbck.cxx | 59 ++++++++++++++---------------
sw/source/core/undo/undobj1.cxx | 79 +++++++++++++++++++---------------------
sw/source/core/undo/unins.cxx | 51 ++++++++++++-------------
3 files changed, 93 insertions(+), 96 deletions(-)
New commits:
commit ef195be10b5d987855d14a48a41bdd9c68d1b3a2
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Sat May 26 16:05:52 2012 +0200
Translate German comments in sw/source/core/undo/rolbck.cxx
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index b0ca37d..d16c951 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -58,12 +58,12 @@
#include <ndtxt.hxx> // SwTxtNode
#include <paratr.hxx> //
#include <cellatr.hxx> //
-#include <fldbas.hxx> // fuer Felder
-#include <pam.hxx> // fuer SwPaM
+#include <fldbas.hxx>
+#include <pam.hxx>
#include <swtable.hxx>
#include <ndgrf.hxx> // SwGrfNode
#include <UndoCore.hxx>
-#include <IMark.hxx> // fuer SwBookmark
+#include <IMark.hxx>
#include <charfmt.hxx> // #i27615#
#include <comcore.hrc>
#include <undo.hrc>
@@ -90,7 +90,7 @@ SwHistorySetFmt::SwHistorySetFmt( const SfxPoolItem* pFmtHt, sal_uLong nNd )
break;
case RES_BOXATR_FORMULA:
{
- //JP 30.07.98: Bug 54295 - Formeln immer im Klartext speichern
+ //JP 30.07.98: Bug 54295 - save formulas always in plain text
SwTblBoxFormula& rNew = static_cast<SwTblBoxFormula&>(*m_pAttr);
if ( rNew.IsIntrnlName() )
{
@@ -214,12 +214,12 @@ SwHistorySetTxt::SwHistorySetTxt( SwTxtAttr* pTxtHt, sal_uLong nNodePos )
, m_nStart( *pTxtHt->GetStart() )
, m_nEnd( *pTxtHt->GetAnyEnd() )
{
- // !! Achtung: folgende Attribute erzeugen keine FormatAttribute:
+ // Caution: the following attributes generate no format attributes:
// - NoLineBreak, NoHypen, Inserted, Deleted
- // Dafuer muessen Sonderbehandlungen gemacht werden !!!
+ // These cases must be handled separately !!!
- // ein bisschen kompliziert, aber ist Ok so: erst vom default
- // eine Kopie und dann die Werte aus dem Text Attribut zuweisen
+ // a little bit complicated but works: first assign a copy of the
+ // default value and afterwards the values from text attribute
sal_uInt16 nWhich = pTxtHt->Which();
if ( RES_TXTATR_CHARFMT == nWhich )
{
@@ -442,13 +442,13 @@ SwHistorySetFootnote::SwHistorySetFootnote( SwTxtFtn* pTxtFtn, sal_uLong nNodePo
OSL_ENSURE( pTxtFtn->GetStartNode(),
"SwHistorySetFootnote: Footnote without Section" );
- // merke die alte NodePos, denn wer weiss was alles in der SaveSection
- // gespeichert (geloescht) wird
+ // keep the old NodePos (because who knows what later will be saved/deleted
+ // in SaveSection)
SwDoc* pDoc = const_cast<SwDoc*>(pTxtFtn->GetTxtNode().GetDoc());
SwNode* pSaveNd = pDoc->GetNodes()[ m_nNodeIndex ];
- //Pointer auf StartNode der FtnSection merken und erstmal den Pointer im
- //Attribut zuruecksetzen -> Damit werden automatisch die Frms vernichtet.
+ // keep pointer to StartNode of FtnSection and reset its attribute for now
+ // (as a result, its/all Frms will be deleted automatically)
SwNodeIndex aSttIdx( *pTxtFtn->GetStartNode() );
pTxtFtn->SetStartNode( 0, sal_False );
@@ -744,10 +744,10 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
case RES_BOXATR_FORMULA:
{
- //JP 20.04.98: Bug 49502 - wenn eine Formel gesetzt ist, nie den
- // Value mit sichern. Der muss gegebenfalls neu
- // errechnet werden!
- //JP 30.07.98: Bug 54295 - Formeln immer im Klartext speichern
+ //JP 20.04.98: Bug 49502 - When a formula is set, never save
+ // the value. It possibly must be recalculated!
+ //JP 30.07.98: Bug 54295 - Save formulas always in plain
+ // text
m_OldSet.ClearItem( RES_BOXATR_VALUE );
SwTblBoxFormula& rNew =
@@ -1030,7 +1030,6 @@ SwHistory::~SwHistory()
|*
|* void SwHistory::Add()
|*
-|* Beschreibung Dokument 1.0
|*
*************************************************************************/
@@ -1043,7 +1042,7 @@ void SwHistory::Add( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue,
if( (nWhich >= POOLATTR_END) || (nWhich == RES_TXTATR_FIELD) )
return;
- // no default Attribute?
+ // no default attribute?
SwHistoryHint * pHt;
if ( pOldValue && pOldValue != GetDfltAttr( pOldValue->Which() ) )
{
@@ -1182,7 +1181,6 @@ void SwHistory::Add(const SfxItemSet & rSet, const SwCharFmt & rFmt)
|*
|* sal_Bool SwHistory::Rollback()
|*
-|* Beschreibung Dokument 1.0
|*
*************************************************************************/
@@ -1296,20 +1294,20 @@ void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
const xub_StrLen * pEndIdx;
for( sal_uInt16 n = 0; n < pHts->Count(); n++ )
{
- // BP: nAttrStt muss auch bei !pEndIdx gesetzt werden
+ // BP: nAttrStt must even be set when !pEndIdx
pHt = pHts->GetTextHint(n);
nAttrStt = *pHt->GetStart();
-// JP: ???? wieso nAttrStt >= nEnd
+// JP: ???? why nAttrStt >= nEnd
// if( 0 != ( pEndIdx = pHt->GetEnd() ) && nAttrStt >= nEnd )
if( 0 != ( pEndIdx = pHt->GetEnd() ) && nAttrStt > nEnd )
break;
- // Flys und Ftn nie kopieren !!
+ // never copy Flys and Ftn !!
sal_Bool bNextAttr = sal_False;
switch( pHt->Which() )
{
case RES_TXTATR_FIELD:
- // keine Felder, .. kopieren ??
+ // no fields, ... copy ??
if( !bFields )
bNextAttr = sal_True;
break;
@@ -1326,7 +1324,7 @@ void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
if ( nStart <= nAttrStt )
{
if ( nEnd > nAttrStt
-// JP: ???? wieso nAttrStt >= nEnd
+// JP: ???? why nAttrStt >= nEnd
// || (nEnd == nAttrStt && (!pEndIdx || nEnd == pEndIdx->GetIndex()))
)
{
@@ -1343,7 +1341,7 @@ void SwHistory::CopyAttr( SwpHints* pHts, sal_uLong nNodeIdx,
/*************************************************************************/
-// Klasse zum Registrieren der History am Node, Format, HintsArray, ...
+// Class to register the history at a Node, Format, HintsArray, ...
SwRegHistory::SwRegHistory( SwHistory* pHst )
: SwClient( 0 )
@@ -1438,10 +1436,11 @@ bool SwRegHistory::InsertItems( const SfxItemSet& rSet,
const bool bInserted = pTxtNode->SetAttr( rSet, nStart, nEnd, nFlags );
- // Achtung: Durch das Einfuegen eines Attributs kann das Array
- // geloescht werden!!! Wenn das einzufuegende zunaechst ein vorhandenes
- // loescht, selbst aber nicht eingefuegt werden braucht, weil die
- // Absatzattribute identisch sind( -> bForgetAttr in SwpHints::Insert )
+ // Caution: The array can be deleted when inserting an attribute!
+ // This can happen when the value that should be added first deletes
+ // an existing attribute but does not need to be added itself because
+ // the paragraph attributes are identical
+ // ( -> bForgetAttr in SwpHints::Insert )
if ( pTxtNode->GetpSwpHints() && m_pHistory )
{
pTxtNode->GetpSwpHints()->DeRegister();
@@ -1451,7 +1450,7 @@ bool SwRegHistory::InsertItems( const SfxItemSet& rSet,
{
SwHistoryHint* pNewHstr = new SwHistoryResetAttrSet( rSet,
pTxtNode->GetIndex(), nStart, nEnd );
- // der NodeIndex kann verschoben sein !!
+ // the NodeIndex might be moved!
m_pHistory->m_SwpHstry.push_back( pNewHstr );
}
commit 78b727f9cf1728ce55178bb0c1b19c0467c1c4fa
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Sat May 26 15:55:59 2012 +0200
Translate German comments in sw/source/core/undo/unins.cxx
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 8a451c4..626ac4e 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -41,7 +41,7 @@
#include <frmfmt.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
-#include <swundo.hxx> // fuer die UndoIds
+#include <swundo.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
#include <UndoCore.hxx>
@@ -92,7 +92,7 @@ String * SwUndoInsert::GetTxtFromDoc() const
void SwUndoInsert::Init(const SwNodeIndex & rNd)
{
- // Redline beachten
+ // consider Redline
pDoc = rNd.GetNode().GetDoc();
if( pDoc->IsRedlineOn() )
{
@@ -129,9 +129,9 @@ SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd )
Init(rNd);
}
-// stelle fest, ob das naechste Insert mit dem aktuellen zusammengefasst
-// werden kann. Wenn ja, dann aender die Laenge und die InsPos.
-// Dann wird von SwDoc::Insert kein neues Object in die Undoliste gestellt.
+// Check if the next Insert can be combined with the current one. If so
+// change the length and InsPos. As a result, SwDoc::Inser will not add a
+// new object into the Undo list.
sal_Bool SwUndoInsert::CanGrouping( sal_Unicode cIns )
{
@@ -155,17 +155,16 @@ sal_Bool SwUndoInsert::CanGrouping( const SwPosition& rPos )
if( nNode == rPos.nNode.GetIndex() &&
nCntnt == rPos.nContent.GetIndex() )
{
- // Redline beachten
+ // consider Redline
SwDoc& rDoc = *rPos.nNode.GetNode().GetDoc();
if( ( ~nsRedlineMode_t::REDLINE_SHOW_MASK & rDoc.GetRedlineMode() ) ==
( ~nsRedlineMode_t::REDLINE_SHOW_MASK & GetRedlineMode() ) )
{
bRet = sal_True;
- // dann war oder ist noch Redline an:
- // pruefe, ob an der InsPosition ein anderer Redline
- // rumsteht. Wenn der gleiche nur einmalig vorhanden ist,
- // kann zusammen gefasst werden.
+ // than there is or was still an active Redline:
+ // Check if there is another Redline at the InsPosition. If the
+ // same exists only once, it can be combined.
const SwRedlineTbl& rTbl = rDoc.GetRedlineTbl();
if( rTbl.Count() )
{
@@ -194,14 +193,14 @@ sal_Bool SwUndoInsert::CanGrouping( const SwPosition& rPos )
SwUndoInsert::~SwUndoInsert()
{
- if( pPos ) // loesche noch den Bereich aus dem UndoNodes Array
+ if( pPos ) // delete the section from UndoNodes array
{
- // Insert speichert den Inhalt in der IconSection
+ // Insert saves the content in IconSection
SwNodes& rUNds = pPos->nNode.GetNode().GetNodes();
- if( pPos->nContent.GetIndex() ) // nicht den gesamten Node loeschen
+ if( pPos->nContent.GetIndex() ) // do not delete the whole node
{
SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode();
- OSL_ENSURE( pTxtNd, "kein TextNode, aus dem geloescht werden soll" );
+ OSL_ENSURE( pTxtNd, "no TextNode to delete from" );
pTxtNd->EraseText( pPos->nContent );
pPos->nNode++;
}
@@ -210,7 +209,7 @@ SwUndoInsert::~SwUndoInsert()
pPos->nNode.GetIndex() );
delete pPos;
}
- else if( pTxt ) // der eingefuegte Text
+ else if( pTxt ) // the inserted text
delete pTxt;
delete pRedlData;
delete pUndoTxt;
@@ -261,7 +260,7 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext)
pTxt = new String( pTxtNode->GetTxt().Copy(nCntnt-nLen, nLen) );
pTxtNode->EraseText( aPaM.GetPoint()->nContent, nLen );
}
- else // ansonsten Grafik/OLE/Text/...
+ else // otherwise Graphics/OLE/Text/...
{
aPaM.Move(fnMoveBackward);
if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
@@ -342,7 +341,7 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext)
}
else
{
- // Inhalt wieder einfuegen. (erst pPos abmelden !!)
+ // re-insert content (log out pPos before!)
sal_uLong nMvNd = pPos->nNode.GetIndex();
xub_StrLen nMvCnt = pPos->nContent.GetIndex();
DELETEZ( pPos );
@@ -380,7 +379,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
SwNodeIndex aNd( rDoc.GetNodes(), nNode );
SwCntntNode* pCNd = aNd.GetNode().GetCntntNode();
- if( !bIsAppend && 1 == nLen ) // >1 dann immer nur Text, ansonsten Grafik/OLE/Text/...
+ if( !bIsAppend && 1 == nLen ) // >1 than always Text, otherwise Graphics/OLE/Text/...
{
SwPaM aPaM( *pCNd, nCntnt );
aPaM.SetMark();
@@ -388,7 +387,7 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
pCNd = aPaM.GetCntntNode();
}
-// Was passiert mit dem evt. selektierten Bereich ???
+// What happens with the possible selected range ???
switch( pCNd->GetNodeType() )
{
@@ -414,13 +413,13 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext)
rDoc.Insert( rContext.GetRepeatPaM(), sFile, sFilter,
&pGrfNd->GetGrf(),
- 0/* Grafik-Collection*/, NULL, NULL );
+ 0/* Graphics collection*/, NULL, NULL );
}
break;
case ND_OLENODE:
{
- // StarView bietet noch nicht die Moeglichkeit ein StarOBJ zu kopieren
+ // StarView does not yet provide an option to copy a StarOBJ
SvStorageRef aRef = new SvStorage( aEmptyStr );
SwOLEObj& rSwOLE = (SwOLEObj&)((SwOLENode*)pCNd)->GetOLEObj();
@@ -712,10 +711,10 @@ void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext)
pHistory->TmpRollback( pDoc, m_nSetPos, false );
if ( m_nSetPos ) // there were footnotes/FlyFrames
{
- // gibts ausser diesen noch andere ?
+ // are there others than these?
if( m_nSetPos < pHistory->Count() )
{
- // dann sicher die Attribute anderen Attribute
+ // than save those attributes as well
SwHistory aHstr;
aHstr.Move( 0, pHistory, m_nSetPos );
pHistory->Rollback( pDoc );
@@ -813,7 +812,7 @@ void SwUndoReRead::SetAndSave(::sw::UndoRedoContext & rContext)
if( !pGrfNd )
return ;
- // die alten Werte zwischen speichern
+ // cache the old values
Graphic* pOldGrf = pGrf;
String* pOldNm = pNm;
String* pOldFltr = pFltr;
@@ -911,7 +910,7 @@ void SwUndoInsertLabel::UndoImpl(::sw::UndoRedoContext & rContext)
if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType )
{
- OSL_ENSURE( OBJECT.pUndoAttr && OBJECT.pUndoFly, "Pointer nicht initialisiert" );
+ OSL_ENSURE( OBJECT.pUndoAttr && OBJECT.pUndoFly, "Pointer not initialized" );
SwFrmFmt* pFmt;
SdrObject *pSdrObj = 0;
if( OBJECT.pUndoAttr &&
@@ -951,7 +950,7 @@ void SwUndoInsertLabel::RedoImpl(::sw::UndoRedoContext & rContext)
if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType )
{
- OSL_ENSURE( OBJECT.pUndoAttr && OBJECT.pUndoFly, "Pointer nicht initialisiert" );
+ OSL_ENSURE( OBJECT.pUndoAttr && OBJECT.pUndoFly, "Pointer not initialized" );
SwFrmFmt* pFmt;
SdrObject *pSdrObj = 0;
if( OBJECT.pUndoAttr &&
commit ced6b3fe4b87b35715a3d762ed024ba3165a9100
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Sat May 26 15:10:00 2012 +0200
Translate German comments in sw/source/core/undo/undobj1.cxx
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 86e0481..cbeb084 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -39,11 +39,11 @@
#include <flyfrm.hxx>
#include <UndoCore.hxx>
#include <UndoDraw.hxx>
-#include <rolbck.hxx> // fuer die Attribut History
+#include <rolbck.hxx>
#include <doc.hxx>
#include <docary.hxx>
#include <rootfrm.hxx>
-#include <swundo.hxx> // fuer die UndoIds
+#include <swundo.hxx>
#include <pam.hxx>
#include <ndtxt.hxx>
// OD 26.06.2003 #108784#
@@ -61,7 +61,7 @@ SwUndoFlyBase::SwUndoFlyBase( SwFrmFmt* pFormat, SwUndoId nUndoId )
SwUndoFlyBase::~SwUndoFlyBase()
{
- if( bDelFmt ) // loeschen waehrend eines Undo's ??
+ if( bDelFmt ) // delete during an Undo?
delete pFrmFmt;
}
@@ -69,7 +69,7 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
{
SwDoc *const pDoc = & rContext.GetDoc();
- // ins Array wieder eintragen
+ // add again into array
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Insert( pFrmFmt, rFlyFmts.Count() );
@@ -105,23 +105,23 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
aAnchor.SetAnchor( &aNewPos );
}
- pFrmFmt->SetFmtAttr( aAnchor ); // Anker neu setzen
+ pFrmFmt->SetFmtAttr( aAnchor ); // reset anchor
if( RES_DRAWFRMFMT != pFrmFmt->Which() )
{
- // Content holen und -Attribut neu setzen
+ // get Content and reset ContentAttribute
SwNodeIndex aIdx( pDoc->GetNodes() );
RestoreSection( pDoc, &aIdx, SwFlyStartNode );
pFrmFmt->SetFmtAttr( SwFmtCntnt( aIdx.GetNode().GetStartNode() ));
}
- //JP 18.12.98: Bug 60505 - InCntntAttribut erst setzen, wenn der Inhalt
- // vorhanden ist! Sonst wuerde das Layout den Fly vorher
- // formatieren, aber keine Inhalt finden; so geschene bei
- // Grafiken aus dem Internet
+ //JP 18.12.98: Bug 60505 - set InCntntAttribute not until there is content!
+ // Otherwise the layout would format the Fly beforehand but
+ // would not find content; this happend with graphics from the
+ // internet
if (FLY_AS_CHAR == nRndId)
{
- // es muss mindestens das Attribut im TextNode stehen
+ // there must be at least the attribute in a TextNode
SwCntntNode* pCNd = aAnchor.GetCntntAnchor()->nNode.GetNode().GetCntntNode();
OSL_ENSURE( pCNd->IsTxtNode(), "no Text Node at position." );
SwFmtFlyCnt aFmt( pFrmFmt );
@@ -163,10 +163,10 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
void SwUndoFlyBase::DelFly( SwDoc* pDoc )
{
- bDelFmt = sal_True; // im DTOR das Format loeschen
- pFrmFmt->DelFrms(); // Frms vernichten.
+ bDelFmt = sal_True; // delete Format in DTOR
+ pFrmFmt->DelFrms(); // destroy Frms
- // alle Uno-Objecte sollten sich jetzt abmelden
+ // all Uno objects should now log themselves off
{
SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFrmFmt );
pFrmFmt->ModifyNotification( &aMsgHint, &aMsgHint );
@@ -174,7 +174,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
if ( RES_DRAWFRMFMT != pFrmFmt->Which() )
{
- // gibt es ueberhaupt Inhalt, dann sicher diesen
+ // if there is content than save it
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
OSL_ENSURE( rCntnt.GetCntntIdx(), "Fly ohne Inhalt" );
@@ -194,7 +194,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor();
const SwPosition* pPos = rAnchor.GetCntntAnchor();
- // die Positionen im Nodes-Array haben sich verschoben
+ // The positions in Nodes array got shifted.
nRndId = static_cast<sal_uInt16>(rAnchor.GetAnchorId());
if (FLY_AS_CHAR == nRndId)
{
@@ -204,10 +204,10 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
OSL_ENSURE( pTxtNd, "Kein Textnode gefunden" );
SwTxtFlyCnt* const pAttr = static_cast<SwTxtFlyCnt*>(
pTxtNd->GetTxtAttrForCharAt( nCntPos, RES_TXTATR_FLYCNT ) );
- // Attribut steht noch im TextNode, loeschen
+ // attribute is still in TextNode, delete
if( pAttr && pAttr->GetFlyCnt().GetFrmFmt() == pFrmFmt )
{
- // Pointer auf 0, nicht loeschen
+ // Pointer to 0, do not delete
((SwFmtFlyCnt&)pAttr->GetFlyCnt()).SetFlyFmt();
SwIndex aIdx( pPos->nContent );
pTxtNd->EraseText( aIdx, 1 );
@@ -227,10 +227,10 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
nNdPgPos = rAnchor.GetPageNum();
}
- pFrmFmt->ResetFmtAttr( RES_ANCHOR ); // Anchor loeschen
+ pFrmFmt->ResetFmtAttr( RES_ANCHOR ); // delete anchor
- // aus dem Array austragen
+ // delete from array
SwSpzFrmFmts& rFlyFmts = *(SwSpzFrmFmts*)pDoc->GetSpzFrmFmts();
rFlyFmts.Remove( rFlyFmts.GetPos( pFrmFmt ));
}
@@ -263,7 +263,7 @@ SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, sal_uLong nNodeIdx, xub_Str
}
break;
default:
- OSL_FAIL( "Was denn fuer ein FlyFrame?" );
+ OSL_FAIL( "Which FlyFrame?" );
}
}
@@ -275,7 +275,7 @@ void SwUndoInsLayFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc(rContext.GetDoc());
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
- if( rCntnt.GetCntntIdx() ) // kein Inhalt
+ if( rCntnt.GetCntntIdx() ) // no content
{
bool bRemoveIdx = true;
if( mnCrsrSaveIndexPara > 0 )
@@ -310,7 +310,7 @@ void SwUndoInsLayFmt::RedoImpl(::sw::UndoRedoContext & rContext)
void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
{
SwDoc *const pDoc = & rContext.GetDoc();
- // erfrage und setze den Anker neu
+ // get anchor and reset it
SwFmtAnchor aAnchor( pFrmFmt->GetAnchor() );
if ((FLY_AT_PARA == aAnchor.GetAnchorId()) ||
(FLY_AT_CHAR == aAnchor.GetAnchorId()) ||
@@ -342,7 +342,7 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext)
aAnchor.SetPageNum( pDoc->GetCurrentLayout()->GetCurrPage( &rContext.GetRepeatPaM() ));
}
else {
- OSL_FAIL( "was fuer ein Anker ist es denn nun?" );
+ OSL_FAIL( "What kind of anchor is this?" );
}
SwFrmFmt* pFlyFmt = pDoc->CopyLayoutFmt( *pFrmFmt, aAnchor, true, true );
@@ -455,7 +455,7 @@ void SwUndoDelLayFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc(rContext.GetDoc());
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
- if( rCntnt.GetCntntIdx() ) // kein Inhalt
+ if( rCntnt.GetCntntIdx() ) // no content
{
RemoveIdxFromSection(rDoc, rCntnt.GetCntntIdx()->GetIndex());
}
@@ -466,7 +466,7 @@ void SwUndoDelLayFmt::RedoImpl(::sw::UndoRedoContext & rContext)
void SwUndoDelLayFmt::RedoForRollback()
{
const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt();
- if( rCntnt.GetCntntIdx() ) // kein Inhalt
+ if( rCntnt.GetCntntIdx() ) // no content
RemoveIdxFromSection( *pFrmFmt->GetDoc(),
rCntnt.GetCntntIdx()->GetIndex() );
@@ -545,7 +545,7 @@ void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor,
if( !pNd )
{
- // ungueltige Position - setze auf 1. Seite
+ // invalid position - assign first page
rAnchor.SetType( FLY_AT_PAGE );
rAnchor.SetPageNum( 1 );
}
@@ -558,7 +558,7 @@ void SwUndoSetFlyFmt::UndoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
- // ist das neue Format noch vorhanden ??
+ // Is the new Format still existent?
if( USHRT_MAX != rDoc.GetFrmFmts()->GetPos( (const SwFrmFmtPtr)pOldFmt ) )
{
if( bAnchorChgd )
@@ -587,11 +587,10 @@ void SwUndoSetFlyFmt::UndoImpl(::sw::UndoRedoContext & rContext)
const SwFmtAnchor& rOldAnch = pFrmFmt->GetAnchor();
if (FLY_AS_CHAR == rOldAnch.GetAnchorId())
{
- // Bei InCntnt's wird es spannend: Das TxtAttribut muss
- // vernichtet werden. Leider reisst dies neben den Frms
- // auch noch das Format mit in sein Grab. Um dass zu
- // unterbinden loesen wir vorher die Verbindung zwischen
- // Attribut und Format.
+ // With InCntnts it's tricky: the text attribute needs to be
+ // deleted. Unfortunately, this not only destroys the Frms but
+ // also the format. To prevent that, first detach the
+ // connection between attribute and format.
const SwPosition *pPos = rOldAnch.GetCntntAnchor();
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
@@ -604,12 +603,12 @@ void SwUndoSetFlyFmt::UndoImpl(::sw::UndoRedoContext & rContext)
"Wrong TxtFlyCnt-Hint." );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt();
- // Die Verbindung ist geloest, jetzt muss noch das Attribut
- // vernichtet werden.
+ // Connection is now detached, therefore the attribute can be
+ // deleted
pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx, nIdx );
}
- // Anker umsetzen
+ // reposition anchor
SwFmtAnchor aNewAnchor( (RndStdIds) nOldAnchorTyp );
GetAnchor( aNewAnchor, nOldNode, nOldCntnt );
pFrmFmt->SetFmtAttr( aNewAnchor );
@@ -632,7 +631,7 @@ void SwUndoSetFlyFmt::RedoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
- // ist das neue Format noch vorhanden ??
+ // Is the new Format still existent?
if( USHRT_MAX != rDoc.GetFrmFmts()->GetPos( (const SwFrmFmtPtr)pNewFmt ) )
{
@@ -655,11 +654,11 @@ void SwUndoSetFlyFmt::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem )
{
if( pItem && pItem != GetDfltAttr( nWhich ) )
{
- // Sonderbehandlung fuer den Anchor
+ // Special treatment for this anchor
if( RES_ANCHOR == nWhich )
{
- // nur den 1. Ankerwechsel vermerken
- OSL_ENSURE( !bAnchorChgd, "mehrfacher Ankerwechsel nicht erlaubt!" );
+ // only keep the first change
+ OSL_ENSURE( !bAnchorChgd, "multiple changes of an anchor are not allowed!" );
bAnchorChgd = sal_True;
More information about the Libreoffice-commits
mailing list