summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorPhilipp Riemer <ruderphilipp@gmail.com>2013-06-10 21:54:04 +0200
committerPhilipp Riemer <ruderphilipp@gmail.com>2013-06-10 22:00:57 +0200
commit9d055aed9f4b97b5186ea1da67a6d3e92b9839f4 (patch)
tree7573b6d31d1d9de26aab57cb440611992c08fe44 /sw
parent6cc510e0ed5b99b1493dc23b49df7351763f7916 (diff)
fdo#39468: Translate German comments in sw/source/core/fields
Change-Id: I8a0f4749c01010a9d0e9baf23db09e1fa63c1d55
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/fields/cellfml.cxx281
-rw-r--r--sw/source/core/fields/chpfld.cxx19
-rw-r--r--sw/source/core/fields/dbfld.cxx92
-rw-r--r--sw/source/core/fields/ddefld.cxx48
-rw-r--r--sw/source/core/fields/ddetbl.cxx46
-rw-r--r--sw/source/core/fields/docufld.cxx224
-rw-r--r--sw/source/core/fields/expfld.cxx108
-rw-r--r--sw/source/core/fields/fldbas.cxx134
-rw-r--r--sw/source/core/fields/flddat.cxx7
-rw-r--r--sw/source/core/fields/fldlst.cxx59
-rw-r--r--sw/source/core/fields/macrofld.cxx26
-rw-r--r--sw/source/core/fields/reffld.cxx41
-rw-r--r--sw/source/core/fields/scrptfld.cxx18
-rw-r--r--sw/source/core/fields/tblcalc.cxx17
-rw-r--r--sw/source/core/fields/usrfld.cxx31
15 files changed, 429 insertions, 722 deletions
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index 1eb50c940dbe..c89e0c1c943a 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -52,26 +52,22 @@ static String lcl_BoxNmToRel( const SwTable&, const SwTableNode&,
const String& , const String& , bool );
-/*************************************************************************
-|*
-|* double SwTableBox::GetValue() const
-|* gebe den Wert dieser Box zurueck. Der Wert ergibt sich aus dem 1.
-|* TextNode. Beginnt dieser mit einer Zahl/Formel, so berechne diese;
-|* oder mit einem Feld, dann hole den Wert.
-|* Alle anderen Bedingungen returnen einen Fehler (oder 0 ?)
-|*
-|*************************************************************************/
-
+/** Get value of this box.
+ *
+ * The value is comes from the first TextNode. If it starts with a number/
+ * formula then calculate it, if it starts with a field then get the value.
+ * All other conditions return 0 (and an error?).
+ */
double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
{
double nRet = 0;
if( rCalcPara.rCalc.IsCalcError() )
- return nRet; // schon ein Fehler in der Berechnung
+ return nRet; // stop if there is already an error set
- rCalcPara.rCalc.SetCalcError( CALC_SYNTAX ); // default immer Fehler
+ rCalcPara.rCalc.SetCalcError( CALC_SYNTAX ); // default: error
- // keine Content Box ?
+ // no content box?
if( !pSttNd )
return nRet;
@@ -80,28 +76,27 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
rCalcPara.SetLastTblBox( this );
- // wird eine Rekursion erzeugt ?
+ // Does it create a recursion?
SwTableBox* pBox = (SwTableBox*)this;
if( rCalcPara.pBoxStk->find( pBox ) != rCalcPara.pBoxStk->end() )
- return nRet; // steht schon auf dem Stack: FEHLER
+ return nRet; // already on the stack: error
- // bei dieser Box nochmal aufsetzen
+ // re-start with this box
rCalcPara.SetLastTblBox( this );
- rCalcPara.pBoxStk->insert( pBox ); // eintragen
- do { // Middle-Check-Loop, damit aus dieser gesprungen werden kann
- // hier aufgespannt, damit am Ende der Box-Pointer aus dem
- // Stack ausgetragen wird
+ rCalcPara.pBoxStk->insert( pBox ); // add
+ do { // Middle-Check-Loop, so that we can jump from here. Used so that the box pointer
+ // will be removed from stack at the end.
SwDoc* pDoc = GetFrmFmt()->GetDoc();
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == GetFrmFmt()->GetItemState(
RES_BOXATR_FORMULA, sal_False, &pItem ) )
{
- rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // wieder zuruecksetzen
+ rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // reset status
if( !((SwTblBoxFormula*)pItem)->IsValid() )
{
- // dann berechnen
+ // calculate
const SwTable* pTmp = rCalcPara.pTbl;
rCalcPara.pTbl = &pBox->GetSttNd()->FindTableNode()->GetTable();
((SwTblBoxFormula*)pItem)->Calc( rCalcPara, nRet );
@@ -125,7 +120,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
else if( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
RES_BOXATR_VALUE, sal_False, &pItem ) )
{
- rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // wieder zuruecksetzen
+ rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // reset status
nRet = ((SwTblBoxValue*)pItem)->GetValue();
break;
}
@@ -140,8 +135,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
( ' ' == rTxt.GetChar( nSttPos ) || '\t' == rTxt.GetChar( nSttPos ) ) )
++nSttPos;
- // beginnt an erster Position ein "RechenFeld", dann erfrage den Wert
- // von diesem
+ // if there is a calculation field at position 1, get the value of it
sal_Unicode const Char = rTxt.GetChar(nSttPos);
if ( nSttPos < rTxt.Len() &&
( CH_TXTATR_BREAKWORD == Char || CH_TXTATR_INWORD == Char ) )
@@ -152,7 +146,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
if( !pTxtFld )
break;
- rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // wieder zuruecksetzen
+ rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // reset status
const SwField* pFld = pTxtFld->GetFld().GetFld();
switch( pFld->GetTyp()->Which() )
@@ -166,9 +160,9 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
case RES_TABLEFLD:
{
SwTblField* pTblFld = (SwTblField*)pFld;
- if( !pTblFld->IsValid() ) // ist der Wert gueltig ??
+ if( !pTblFld->IsValid() )
{
- // die richtige Tabelle mitgeben!
+ // use the right table!
const SwTable* pTmp = rCalcPara.pTbl;
rCalcPara.pTbl = &pTxtNd->FindTableNode()->GetTable();
pTblFld->CalcField( rCalcPara );
@@ -183,8 +177,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
break;
case RES_JUMPEDITFLD:
- //JP 14.09.98: Bug 56112 - der Platzhalter kann nie einen
- // gueltigen Inhalt haben!
+ //JP 14.09.98: Bug 56112 - placeholder never have the right content!
nRet = 0;
break;
@@ -195,8 +188,8 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
}
else
{
- // Ergebnis ist 0 und kein Fehler!
- rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // wieder zuruecksetzen
+ // result is 0 but no error!
+ rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // reset status
double aNum;
String sTxt( rTxt.Copy( nSttPos ) );
@@ -206,7 +199,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
if( NUMBERFORMAT_TEXT == nFmtIndex )
nFmtIndex = 0;
- // JP 22.04.98: Bug 49659 - Sonderbehandlung fuer Prozent
+ // JP 22.04.98: Bug 49659 - special treatment for percentages
else if( sTxt.Len() &&
NUMBERFORMAT_PERCENT == pNumFmtr->GetType( nFmtIndex ))
{
@@ -220,24 +213,24 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
nRet = aNum;
}
-// ?? sonst ist das ein Fehler
+ // ?? otherwise it is an error
} while( false );
if( !rCalcPara.IsStackOverFlow() )
{
- rCalcPara.pBoxStk->erase( pBox ); // raus aus dem Stack
+ rCalcPara.pBoxStk->erase( pBox ); // remove from stack
rCalcPara.DecStackCnt();
}
- //JP 12.01.99: mit Fehlererkennung, Bug 60794
+ //JP 12.01.99: error detection, Bug 60794
if( DBL_MAX == nRet )
- rCalcPara.rCalc.SetCalcError( CALC_SYNTAX ); // Fehler setzen
+ rCalcPara.rCalc.SetCalcError( CALC_SYNTAX ); // set error
return nRet;
}
-// Struktur, die zum TabelleRechnen benoetigt wird
+// structure needed for calculation of tables
SwTblCalcPara::SwTblCalcPara( SwCalc& rCalculator, const SwTable& rTable )
: pLastTblBox( 0 ), nStackCnt( 0 ), nMaxSize( cMAXSTACKSIZE ),
@@ -253,9 +246,7 @@ SwTblCalcPara::~SwTblCalcPara()
sal_Bool SwTblCalcPara::CalcWithStackOverflow()
{
- // falls ein StackUeberlauf erkannt wurde, sollte mit
- // der letzten Box noch mal aufgesetzt werden. Irgend
- // ein Weg sollte dann
+ // If a stack overflow was detected, redo with last box.
sal_uInt16 nSaveMaxSize = nMaxSize;
nMaxSize = cMAXSTACKSIZE - 5;
@@ -271,9 +262,9 @@ sal_Bool SwTblCalcPara::CalcWithStackOverflow()
pBox->GetValue( *this );
} while( IsStackOverFlow() );
- nMaxSize = cMAXSTACKSIZE - 3; // es muss mind. 1 Stufe tiefer gehen!
+ nMaxSize = cMAXSTACKSIZE - 3; // decrease at least one level
- // falls Rekursionen erkannt wurden
+ // if recursion was detected
nStackCnt = 0;
rCalc.SetCalcError( CALC_NOERR );
pBoxStk->clear();
@@ -306,32 +297,31 @@ void SwTableFormula::_MakeFormula( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
SwTblCalcPara* pCalcPara = (SwTblCalcPara*)pPara;
- if( pCalcPara->rCalc.IsCalcError() ) // ist schon Fehler gesetzt ?
+ if( pCalcPara->rCalc.IsCalcError() ) // istop if there is already an error set
return;
SwTableBox* pSttBox, *pEndBox = 0;
- rFirstBox.Erase(0,1); // Kennung fuer Box loeschen
- // ein Bereich in dieser Klammer ?
+ rFirstBox.Erase(0,1); // erase label of this box
+ // a region in this area?
if( pLastBox )
{
pEndBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->ToInt64()));
- // ist das ueberhaupt ein gueltiger Pointer ??
+ // Is it actually a valid pointer?
if( rTbl.GetTabSortBoxes().find( pEndBox ) == rTbl.GetTabSortBoxes().end() )
pEndBox = 0;
rFirstBox.Erase( 0, pLastBox->Len()+1 );
}
pSttBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(rFirstBox.ToInt64()));
- // ist das ueberhaupt ein gueltiger Pointer ??
+ // Is it actually a valid pointer?
if( rTbl.GetTabSortBoxes().find( pSttBox ) == rTbl.GetTabSortBoxes().end() )
pSttBox = 0;
rNewStr += ' ';
- if( pEndBox && pSttBox ) // Bereich ?
+ if( pEndBox && pSttBox ) // area?
{
- // hole ueber das Layout alle "selectierten" Boxen und berechne
- // deren Werte
+ // get all selected boxes via layout and calculate their values
SwSelBoxes aBoxes;
GetBoxes( *pSttBox, *pEndBox, aBoxes );
@@ -352,10 +342,10 @@ void SwTableFormula::_MakeFormula( const SwTable& rTbl, String& rNewStr,
}
rNewStr += ')';
}
- else if( pSttBox && !pLastBox ) // nur die StartBox ?
+ else if( pSttBox && !pLastBox ) // only the StartBox?
{
- //JP 12.01.99: und keine EndBox in der Formel!
- // Berechne den Wert der Box
+ // JP 12.01.99: and no EndBox in the formula!
+ // calculate the value of the box
if ( pSttBox->getRowSpan() >= 1 )
{
rNewStr += pCalcPara->rCalc.GetStrResult(
@@ -363,20 +353,20 @@ void SwTableFormula::_MakeFormula( const SwTable& rTbl, String& rNewStr,
}
}
else
- pCalcPara->rCalc.SetCalcError( CALC_SYNTAX ); // Fehler setzen
+ pCalcPara->rCalc.SetCalcError( CALC_SYNTAX ); // set error
rNewStr += ' ';
}
void SwTableFormula::RelNmsToBoxNms( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
- // relativen Namen zu Box-Namen (externe Darstellung)
+ // relative name w.r.t. box name (external presentation)
SwNode* pNd = (SwNode*)pPara;
OSL_ENSURE( pNd, "Feld steht in keinem TextNode" );
const SwTableBox *pRelBox, *pBox = (SwTableBox *)rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
- rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
+ rNewStr += rFirstBox.Copy(0,1); // get label for the box
rFirstBox.Erase(0,1);
if( pLastBox )
{
@@ -393,20 +383,20 @@ void SwTableFormula::RelNmsToBoxNms( const SwTable& rTbl, String& rNewStr,
else
rNewStr.AppendAscii("A1");
- // Kennung fuer Box erhalten
+ // get label for the box
rNewStr += rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
- // relativen Namen zu Box-Pointern (interne Darstellung)
+ // relative name w.r.t. box name (internal presentation)
SwNode* pNd = (SwNode*)pPara;
- OSL_ENSURE( pNd, "Feld steht in keinem Node" );
+ OSL_ENSURE( pNd, "Field not placed in any Node" );
const SwTableBox *pRelBox, *pBox = (SwTableBox*)rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
- rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
+ rNewStr += rFirstBox.Copy(0,1); // get label for the box
rFirstBox.Erase(0,1);
if( pLastBox )
{
@@ -423,7 +413,7 @@ void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTbl, String& rNewStr,
else
rNewStr += '0';
- // Kennung fuer Box erhalten
+ // get label for the box
rNewStr += rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
@@ -431,9 +421,9 @@ void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTbl, String& rNewStr,
void SwTableFormula::BoxNmsToRelNm( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
- // Box-Namen (externe Darstellung) zu relativen Namen
+ // box name (external presentation) w.r.t. relative name
SwNode* pNd = (SwNode*)pPara;
- OSL_ENSURE( pNd, "Feld steht in keinem Node" );
+ OSL_ENSURE( pNd, "Field not placed in any Node" );
const SwTableNode* pTblNd = pNd->FindTableNode();
String sRefBoxNm;
@@ -441,11 +431,11 @@ void SwTableFormula::BoxNmsToRelNm( const SwTable& rTbl, String& rNewStr,
{
const SwTableBox *pBox = rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() );
- OSL_ENSURE( pBox, "Feld steht in keiner Tabelle" );
+ OSL_ENSURE( pBox, "Field not placed in any Table" );
sRefBoxNm = pBox->GetName();
}
- rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
+ rNewStr += rFirstBox.Copy(0,1); // get label for the box
rFirstBox.Erase(0,1);
if( pLastBox )
{
@@ -458,7 +448,7 @@ void SwTableFormula::BoxNmsToRelNm( const SwTable& rTbl, String& rNewStr,
rNewStr += lcl_BoxNmToRel( rTbl, *pTblNd, sRefBoxNm, rFirstBox,
eNmType == EXTRNL_NAME );
- // Kennung fuer Box erhalten
+ // get label for the box
rNewStr += rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
@@ -466,16 +456,16 @@ void SwTableFormula::BoxNmsToRelNm( const SwTable& rTbl, String& rNewStr,
void SwTableFormula::PtrToBoxNms( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* ) const
{
- // ein Bereich in dieser Klammer ?
+ // area in these parentheses?
SwTableBox* pBox;
- rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
+ rNewStr += rFirstBox.Copy(0,1); // get label for the box
rFirstBox.Erase(0,1);
if( pLastBox )
{
pBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->ToInt64()));
- // ist das ueberhaupt ein gueltiger Pointer ??
+ // Is it actually a valid pointer?
if( rTbl.GetTabSortBoxes().find( pBox ) != rTbl.GetTabSortBoxes().end() )
rNewStr += pBox->GetName();
else
@@ -485,23 +475,23 @@ void SwTableFormula::PtrToBoxNms( const SwTable& rTbl, String& rNewStr,
}
pBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(rFirstBox.ToInt64()));
- // ist das ueberhaupt ein gueltiger Pointer ??
+ // Is it actually a valid pointer?
if( rTbl.GetTabSortBoxes().find( pBox ) != rTbl.GetTabSortBoxes().end() )
rNewStr += pBox->GetName();
else
rNewStr += '?';
- // Kennung fuer Box erhalten
+ // get label for the box
rNewStr += rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
void SwTableFormula::BoxNmsToPtr( const SwTable& rTbl, String& rNewStr,
String& rFirstBox, String* pLastBox, void* ) const
{
- // ein Bereich in dieser Klammer ?
+ // area in these parentheses?
const SwTableBox* pBox;
- rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
+ rNewStr += rFirstBox.Copy(0,1); // get label for the box
rFirstBox.Erase(0,1);
if( pLastBox )
{
@@ -514,11 +504,11 @@ void SwTableFormula::BoxNmsToPtr( const SwTable& rTbl, String& rNewStr,
pBox = rTbl.GetTblBox( rFirstBox );
rNewStr += OUString::valueOf(static_cast<sal_Int64>((sal_PtrDiff)pBox));
- // Kennung fuer Box erhalten
+ // get label for the box
rNewStr += rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
- // erzeuge die externe (fuer UI) Formel
+/// create external formula (for UI)
void SwTableFormula::PtrToBoxNm( const SwTable* pTbl )
{
const SwNode* pNd = 0;
@@ -543,7 +533,7 @@ void SwTableFormula::PtrToBoxNm( const SwTable* pTbl )
eNmType = EXTRNL_NAME;
}
- // erzeuge die interne (in CORE) Formel
+/// create internal formula (in CORE)
void SwTableFormula::BoxNmToPtr( const SwTable* pTbl )
{
const SwNode* pNd = 0;
@@ -568,7 +558,7 @@ void SwTableFormula::BoxNmToPtr( const SwTable* pTbl )
eNmType = INTRNL_NAME;
}
- // erzeuge die relative (fuers Kopieren) Formel
+/// create relative formula (for copy)
void SwTableFormula::ToRelBoxNm( const SwTable* pTbl )
{
const SwNode* pNd = 0;
@@ -598,8 +588,7 @@ String SwTableFormula::ScanString( FnScanFormel fnFormel, const SwTable& rTbl,
sal_uInt16 nFml = 0, nStt = 0, nEnd = 0, nTrenner;
do {
- // falls der Formel ein Name vorangestellt ist, diese Tabelle
- // benutzen !!
+ // If the formula is preceded by a name, use this table!
const SwTable* pTbl = &rTbl;
nStt = sFormel.Search( '<', nFml );
@@ -615,18 +604,18 @@ String SwTableFormula::ScanString( FnScanFormel fnFormel, const SwTable& rTbl,
}
if( STRING_NOTFOUND == nStt || STRING_NOTFOUND == nEnd )
{
- // den Rest setzen und beenden
+ // set the rest and finish
aStr.Insert( sFormel, nFml, sFormel.Len() - nFml );
break;
}
- aStr.Insert( sFormel, nFml, nStt - nFml ); // Anfang schreiben
+ aStr.Insert( sFormel, nFml, nStt - nFml ); // write beginning
if( fnFormel != 0 )
{
- // ist ein TabellenName vorangestellt ??
- // JP 16.02.99: SplitMergeBoxNm behandeln den Namen selbst
- // JP 22.02.99: der CAST muss fuer den Linux-Compiler sein
- // JP 28.06.99: rel. BoxName have no preceding tablename!
+ // Is a table name preceded?
+ // JP 16.02.99: SplitMergeBoxNm take care of the name themself
+ // JP 22.02.99: Linux compiler needs cast
+ // JP 28.06.99: rel. BoxName has no preceding tablename!
if( fnFormel != (FnScanFormel)&SwTableFormula::_SplitMergeBoxNm &&
1 < sFormel.Len() && cRelKennung != sFormel.GetChar( 1 ) &&
STRING_NOTFOUND != ( nTrenner = sFormel.Search( '.', nStt ))
@@ -634,39 +623,37 @@ String SwTableFormula::ScanString( FnScanFormel fnFormel, const SwTable& rTbl,
{
String sTblNm( sFormel.Copy( nStt, nEnd - nStt ));
- // falls im Namen schon die Punkte enthalten sind,
- // treten diese immer paarig auf!!! (A1.1.1 !!)
+ // If there are dots in the name, than these appear in pairs (e.g. A1.1.1)!
if( (comphelper::string::getTokenCount(sTblNm, '.') - 1) & 1 )
{
sTblNm.Erase( nTrenner - nStt );
- // beim Bauen der Formel ist der TabellenName unerwuenscht
- //JP 22.02.99: der CAST muss fuer den Linux-Compiler sein
+ // when creating a formula the table name is unwanted
if( fnFormel != (FnScanFormel)&SwTableFormula::_MakeFormula )
aStr += sTblNm;
nStt = nTrenner;
- sTblNm.Erase( 0, 1 ); // Trenner loeschen
+ sTblNm.Erase( 0, 1 ); // delete separator
if( sTblNm != rTbl.GetFrmFmt()->GetName() )
{
- // dann suchen wir uns mal unsere Tabelle:
+ // then search for table
const SwTable* pFnd = FindTable(
*rTbl.GetFrmFmt()->GetDoc(),
sTblNm );
if( pFnd )
pTbl = pFnd;
// ??
- OSL_ENSURE( pFnd, "Tabelle nicht gefunden, was nun?" );
+ OSL_ENSURE( pFnd, "No table found. What now?" );
}
}
}
String sBox( sFormel.Copy( nStt, nEnd - nStt + 1 ));
- // ein Bereich in dieser Klammer ?
+ // area in these parentheses?
if( STRING_NOTFOUND != ( nTrenner = sFormel.Search( ':', nStt ))
&& nTrenner < nEnd )
{
- // ohne die Anfangsklammer
+ // without opening parenthesis
String aFirstBox( sFormel.Copy( nStt+1, nTrenner - nStt - 1 ));
(this->*fnFormel)( *pTbl, aStr, sBox, &aFirstBox, pPara );
}
@@ -686,8 +673,7 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const
for( sal_uInt16 nFmtCnt = rTblFmts.size(); nFmtCnt; )
{
SwFrmFmt* pFmt = rTblFmts[ --nFmtCnt ];
- // falls wir von Sw3Writer gerufen werden, dann ist dem
- // FormatNamen eine Nummer anhaengig
+ // if we are called from Sw3Writer, a number is dependent on the format name
SwTableBox* pFBox;
if( COMPARE_EQUAL == rNm.CompareTo( pFmt->GetName(),
pFmt->GetName().Search( 0x0a ) ) &&
@@ -696,7 +682,7 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const String& rNm ) const
pFBox->GetSttNd() &&
pFBox->GetSttNd()->GetNodes().IsDocNodes() )
{
- // eine Tabelle im normalen NodesArr
+ // a table in the normal NodesArr
pRet = pTmpTbl;
break;
}
@@ -708,8 +694,8 @@ static const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox )
{
SwNodeIndex aIdx( *rBox.GetSttNd() );
SwCntntNode* pCNd = aIdx.GetNodes().GoNext( &aIdx );
- OSL_ENSURE( pCNd, "Box hat keinen TextNode" );
- Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !!
+ OSL_ENSURE( pCNd, "Box has no TextNode" );
+ Point aPt; // get the first frame of the layout - table headline
return pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, NULL, sal_False );
}
@@ -734,12 +720,12 @@ static const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
const SwTableBox* pRefBox,
const String& rGetName )
{
- // hole die Line
+ // get line
const SwTableBox* pBox = 0;
String sGetName( rGetName );
- // ist es denn wirklich eine relative Angabe??
- if( cRelKennung == sGetName.GetChar(0) ) // ja, ...
+ // Is it really a relative value?
+ if( cRelKennung == sGetName.GetChar(0) ) // yes
{
if( !pRefBox )
return 0;
@@ -750,7 +736,7 @@ static const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
const SwTableBoxes* pBoxes;
const SwTableLine* pLine;
- // bestimme erst mal die Start-Werte der Box:
+ // determine starting values of the box,...
pBox = (SwTableBox*)pRefBox;
pLine = pBox->GetUpper();
while( pLine->GetUpper() )
@@ -773,7 +759,7 @@ static const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
pLine = (*pLines)[ sal_uInt16(nLineOffset) ];
- // dann suche die Box
+ // ... then serach the box
pBoxes = &pLine->GetTabBoxes();
if( nBoxOffset >= long(pBoxes->size()) )
return 0;
@@ -788,12 +774,12 @@ static const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
nSttLine = SwTable::_GetBoxNum( sGetName );
- // bestimme die Line
+ // determine line
if( !nSttLine || nSttLine > pLines->size() )
break;
pLine = (*pLines)[ nSttLine-1 ];
- // bestimme die Box
+ // determine box
pBoxes = &pLine->GetTabBoxes();
if( nSttBox >= pBoxes->size() )
break;
@@ -803,14 +789,14 @@ static const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
if( pBox )
{
if( !pBox->GetSttNd() )
- // "herunterfallen lassen" bis zur ersten Box
+ // "bubble up" to first box
while( !pBox->GetTabLines().empty() )
pBox = pBox->GetTabLines().front()->GetTabBoxes().front();
}
}
else
{
- // sonst ist es eine absolute externe Darstellung:
+ // otherwise it is an absolute external presentation
pBox = rTbl.GetTblBox( sGetName );
}
return pBox;
@@ -824,15 +810,14 @@ static String lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd,
String sTmp( rGetStr );
if( !bExtrnlNm )
{
- // in die Externe Darstellung umwandeln.
+ // convert into external presentation
SwTableBox* pBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(sTmp.ToInt64()));
if( rTbl.GetTabSortBoxes().find( pBox ) == rTbl.GetTabSortBoxes().end() )
return OUString('?');
sTmp = pBox->GetName();
}
- // sollte die es eine Tabellen uebergreifende Formel sein, dann behalte
- // die externe Darstellung bei:
+ // If the formula is spanning over a table then keep external presentation
if( &rTbl == &rTblNd.GetTable() )
{
long nBox = SwTable::_GetBoxNum( sTmp, sal_True );
@@ -840,7 +825,7 @@ static String lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd,
long nLine = SwTable::_GetBoxNum( sTmp );
nLine -= SwTable::_GetBoxNum( sCpy );
- sCpy = sTmp; //JP 01.11.95: den Rest aus dem BoxNamen anhaengen
+ sCpy = sTmp; //JP 01.11.95: add rest from box name
sTmp = cRelKennung;
sTmp += OUString::number( nBox );
@@ -875,32 +860,31 @@ void SwTableFormula::_GetFmlBoxes( const SwTable& rTbl, String& ,
SwSelBoxes* pBoxes = (SwSelBoxes*)pPara;
SwTableBox* pSttBox, *pEndBox = 0;
- rFirstBox.Erase(0,1); // Kennung fuer Box loeschen
- // ein Bereich in dieser Klammer ?
+ rFirstBox.Erase(0,1); // delete box label
+ // area in these parentheses?
if( pLastBox )
{
pEndBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->ToInt64()));
- // ist das ueberhaupt ein gueltiger Pointer ??
+ // Is it actually a valid pointer?
if( rTbl.GetTabSortBoxes().find( pEndBox ) == rTbl.GetTabSortBoxes().end() )
pEndBox = 0;
rFirstBox.Erase( 0, pLastBox->Len()+1 );
}
pSttBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(rFirstBox.ToInt64()));
- // ist das ueberhaupt ein gueltiger Pointer ??
+ // Is it actually a valid pointer?
if( rTbl.GetTabSortBoxes().find( pSttBox ) == rTbl.GetTabSortBoxes().end() )
pSttBox = 0;
- if( pEndBox && pSttBox ) // Bereich ?
+ if( pEndBox && pSttBox ) // area?
{
- // ueber das Layout alle "selectierten" Boxen und berechne
- // deren Werte
+ // get all selected boxes via layout and calculate their values
SwSelBoxes aBoxes;
GetBoxes( *pSttBox, *pEndBox, aBoxes );
pBoxes->insert( aBoxes );
}
- else if( pSttBox ) // nur die StartBox ?
+ else if( pSttBox ) // only the StartBox?
pBoxes->insert( pSttBox );
}
@@ -908,7 +892,7 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox,
const SwTableBox& rEndBox,
SwSelBoxes& rBoxes ) const
{
- // hole ueber das Layout alle "selektierten" Boxen
+ // get all selected boxes via layout
const SwLayoutFrm *pStt, *pEnd;
const SwFrm* pFrm = lcl_GetBoxFrm( rSttBox );
pStt = pFrm ? pFrm->GetUpper() : 0;
@@ -920,7 +904,7 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox,
const SwTable* pTbl = pStt->FindTabFrm()->GetTable();
- // filter die Kopfzeilen-Boxen heraus:
+ // filter headline boxes
if( pTbl->GetRowsToRepeat() > 0 )
{
do { // middle-check loop
@@ -929,23 +913,23 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox,
pLine = pLine->GetUpper()->GetUpper();
if( pTbl->IsHeadline( *pLine ) )
- break; // Headline mit im Bereich !
+ break; // headline in this area!
- // vielleicht ist ja Start und Ende vertauscht
+ // maybe start and end are swapped
pLine = rEndBox.GetUpper();
while ( pLine->GetUpper() )
pLine = pLine->GetUpper()->GetUpper();
if( pTbl->IsHeadline( *pLine ) )
- break; // Headline mit im Bereich !
+ break; // headline in this area!
const SwTabFrm *pTable = pStt->FindTabFrm();
const SwTabFrm *pEndTable = pEnd->FindTabFrm();
- if( pTable == pEndTable ) // keine gespl. Tabelle
+ if( pTable == pEndTable ) // no split table
break;
- // dann mal die Tabellenkoepfe raus:
+ // then remove table headers
for (size_t n = 0; n < rBoxes.size(); ++n)
{
pLine = rBoxes[n]->GetUpper();
@@ -959,17 +943,17 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox,
}
}
- // sind alle Boxen gueltig, auf die sich die Formel bezieht?
+/// Are all boxes valid that are referenced by the formula?
void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, String& ,
String& rFirstBox, String* pLastBox, void* pPara ) const
{
bool* pBValid = (bool*)pPara;
- if( *pBValid ) // einmal falsch, immer falsch
+ if( *pBValid ) // wrong is wrong
{
SwTableBox* pSttBox = 0, *pEndBox = 0;
rFirstBox.Erase(0,1); // Kennung fuer Box loeschen
- // ein Bereich in dieser Klammer ?
+ // area in this parenthesis?
if( pLastBox )
rFirstBox.Erase( 0, pLastBox->Len()+1 );
@@ -1000,7 +984,7 @@ void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, String& ,
break;
}
- // sind das gueltige Pointer ?
+ // Are these valid pointers?
if( ( pLastBox &&
( !pEndBox || rTbl.GetTabSortBoxes().find( pEndBox ) == rTbl.GetTabSortBoxes().end() ) ) ||
( !pSttBox || rTbl.GetTabSortBoxes().find( pSttBox ) == rTbl.GetTabSortBoxes().end() ) )
@@ -1037,7 +1021,7 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
{
SwTableFmlUpdate& rTblUpd = *(SwTableFmlUpdate*)pPara;
- rNewStr += rFirstBox.Copy(0,1); // Kennung fuer Box erhalten
+ rNewStr += rFirstBox.Copy(0,1); // get label for the box
rFirstBox.Erase(0,1);
String sTblNm;
@@ -1048,12 +1032,11 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
sal_uInt16 nLastBoxLen = pTblNmBox->Len();
sal_uInt16 nTrenner = pTblNmBox->Search( '.' );
if( STRING_NOTFOUND != nTrenner &&
- // falls im Namen schon die Punkte enthalten sind,
- // treten diese immer paarig auf!!! (A1.1.1 !!)
+ // If there are dots in the name, than these appear in pairs (e.g. A1.1.1)!
(comphelper::string::getTokenCount(*pTblNmBox, '.') - 1) & 1 )
{
sTblNm = pTblNmBox->Copy( 0, nTrenner );
- pTblNmBox->Erase( 0, nTrenner + 1);// den Punkt entfernen
+ pTblNmBox->Erase( 0, nTrenner + 1); // remove dot
const SwTable* pFnd = FindTable( *rTbl.GetFrmFmt()->GetDoc(), sTblNm );
if( pFnd )
pTbl = pFnd;
@@ -1064,19 +1047,19 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
{
if( pFnd == rTblUpd.DATA.pDelTbl )
{
- if( rTblUpd.pTbl != &rTbl ) // es ist nicht die akt.
+ if( rTblUpd.pTbl != &rTbl ) // not the current one
(rNewStr += rTblUpd.pTbl->GetFrmFmt()->GetName() )
- += '.'; // den neuen Tabellen Namen setzen
+ += '.'; // set new table name
rTblUpd.bModified = sal_True;
}
else if( pFnd != rTblUpd.pTbl ||
( rTblUpd.pTbl != &rTbl && &rTbl != rTblUpd.DATA.pDelTbl))
- (rNewStr += sTblNm ) += '.'; // den Tabellen Namen behalten
+ (rNewStr += sTblNm ) += '.'; // keep table name
else
rTblUpd.bModified = sal_True;
}
else
- (rNewStr += sTblNm ) += '.'; // den Tabellen Namen behalten
+ (rNewStr += sTblNm ) += '.'; // keep table name
}
}
@@ -1117,12 +1100,12 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
if( TBL_SPLITTBL == rTblUpd.eFlags )
{
- // wo liegen die Boxen, in der "alten" oder in der neuen Tabelle?
+ // Where are the boxes - in the old or in the new table?
bool bInNewTbl = false;
if( pLastBox )
{
- // das ist die "erste" Box in der Selektion. Die bestimmt ob die
- // Formel in der alten oder neuen Tabelle steht.
+ // It is the "first" box in this selection. It determines if the formula is placed in
+ // the new or the old table.
sal_uInt16 nEndLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pEndBox ),
nSttLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pSttBox );
@@ -1130,14 +1113,13 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
((rTblUpd.nSplitLine <= nSttLnPos) ==
(rTblUpd.nSplitLine <= nEndLnPos)) )
{
- // bleiben in der gleichen Tabelle
+ // stay in same table
bInNewTbl = rTblUpd.nSplitLine <= nEndLnPos &&
pTbl == rTblUpd.pTbl;
}
else
{
- // das ist aufjedenfall eine ungueltige Formel, also fuers
- // Undo auf Modified setzen
+ // this is definitely an invalid formula, also mark as modified for Undo
rTblUpd.bModified = sal_True;
if( pEndBox )
bInNewTbl = USHRT_MAX != nEndLnPos &&
@@ -1148,13 +1130,13 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
else
{
sal_uInt16 nSttLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pSttBox );
- // dann landet das Teil in der neuen Tabelle?
+ // Put it in the new table?
bInNewTbl = USHRT_MAX != nSttLnPos &&
rTblUpd.nSplitLine <= nSttLnPos &&
pTbl == rTblUpd.pTbl;
}
- // wenn die Formel selbst in der neuen Tabellen landet
+ // formula goes into new table
if( rTblUpd.bBehindSplitLine )
{
if( !bInNewTbl )
@@ -1180,8 +1162,7 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, String& rNewStr,
+= rFirstBox.GetChar( rFirstBox.Len() - 1 );
}
- // erzeuge die externe Formel, beachte aber das die Formel
- // in einer gesplitteten/gemergten Tabelle landet
+/// Create external formula but remember that the formula is placed in a split/merged table
void SwTableFormula::ToSplitMergeBoxNm( SwTableFmlUpdate& rTblUpd )
{
const SwTable* pTbl;
diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index 955fb71fd1ba..0b974bc78cb6 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -20,19 +20,16 @@
#include <com/sun/star/text/ChapterFormat.hpp>
#include <doc.hxx>
#include <frame.hxx> // SwChapterFieldType::ChangeExpansion()
-#include <pam.hxx> // fuer GetBodyTxtNode
+#include <pam.hxx> // for GetBodyTxtNode
#include <ndtxt.hxx>
#include <chpfld.hxx>
-#include <expfld.hxx> // fuer GetBodyTxtNode
+#include <expfld.hxx> // for GetBodyTxtNode
#include <unofldmid.h>
#include <numrule.hxx>
using namespace ::com::sun::star;
-/*--------------------------------------------------------------------
- Beschreibung: SwChapterFieldType
- --------------------------------------------------------------------*/
-
+// SwChapterFieldType
SwChapterFieldType::SwChapterFieldType()
: SwFieldType( RES_CHAPTERFLD )
@@ -45,11 +42,7 @@ SwFieldType* SwChapterFieldType::Copy() const
return new SwChapterFieldType();
}
-
-/*--------------------------------------------------------------------
- Beschreibung: Kapittelfeld
- --------------------------------------------------------------------*/
-
+// chapter field
SwChapterField::SwChapterField(SwChapterFieldType* pTyp, sal_uInt32 nFmt)
: SwField(pTyp, nFmt), nLevel( 0 )
@@ -94,7 +87,7 @@ void SwChapterField::ChangeExpansion(const SwFrm* pFrm,
const SwCntntNode* pCntntNode,
sal_Bool bSrchNum )
{
- OSL_ENSURE( pFrm, "in welchem Frame stehe ich denn?" );
+ OSL_ENSURE( pFrm, "In which frame am I?" );
SwDoc* pDoc = (SwDoc*)pCntntNode->GetDoc();
const SwTxtNode* pTxtNode = dynamic_cast<const SwTxtNode*>(pCntntNode);
@@ -175,7 +168,7 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
} while( true );
}
- // nur die Nummer besorgen, ohne Pre-/Post-fixstrings
+ // get the number without Pre-/Post-fixstrings
if ( pTxtNd->IsOutline() )
{
diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
index 017ce7152aa9..372bcbd9d7d2 100644
--- a/sw/source/core/fields/dbfld.cxx
+++ b/sw/source/core/fields/dbfld.cxx
@@ -43,10 +43,7 @@
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star;
-/*--------------------------------------------------------------------
- Beschreibung: Datenbanktrenner durch Punkte fuer Anzeige ersetzen
- --------------------------------------------------------------------*/
-
+/// replace database separator by dots for display
static String lcl_DBTrennConv(const String& aContent)
{
String sTmp(aContent);
@@ -57,9 +54,7 @@ static String lcl_DBTrennConv(const String& aContent)
return sTmp;
}
-/*--------------------------------------------------------------------
- Beschreibung: DatenbankFeldTyp
- --------------------------------------------------------------------*/
+// database field type
SwDBFieldType::SwDBFieldType(SwDoc* pDocPtr, const String& rNam, const SwDBData& rDBData ) :
SwValueFieldType( pDocPtr, RES_DBFLD ),
@@ -96,7 +91,7 @@ const OUString& SwDBFieldType::GetName() const
void SwDBFieldType::ReleaseRef()
{
- OSL_ENSURE(nRefCnt > 0, "RefCount kleiner 0!");
+ OSL_ENSURE(nRefCnt > 0, "RefCount < 0!");
if (--nRefCnt <= 0)
{
@@ -153,7 +148,7 @@ bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
SwFmtFld* pFld = aIter.First();
while(pFld)
{
- // Feld im Undo?
+ // field in Undo?
SwTxtFld *pTxtFld = pFld->GetTxtFld();
if(pTxtFld && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() )
{
@@ -174,9 +169,8 @@ bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwDBField
- --------------------------------------------------------------------*/
+
+// database field
SwDBField::SwDBField(SwDBFieldType* pTyp, sal_uLong nFmt)
: SwValueField(pTyp, nFmt),
@@ -295,15 +289,12 @@ SwFieldType* SwDBField::ChgTyp( SwFieldType* pNewType )
return pOld;
}
-/*--------------------------------------------------------------------
- Beschreibung: Aktuellen Field-Value holen und chachen
- --------------------------------------------------------------------*/
-
+/// get current field value and cache it
void SwDBField::Evaluate()
{
SwNewDBMgr* pMgr = GetDoc()->GetNewDBMgr();
- // erstmal loeschen
+ // first delete
bValidValue = false;
double nValue = DBL_MAX;
const SwDBData& aTmpData = GetDBData();
@@ -313,7 +304,7 @@ void SwDBField::Evaluate()
sal_uInt32 nFmt;
- // Passenden Spaltennamen suchen
+ // search corresponding column name
String aColNm( ((SwDBFieldType*)GetTyp())->GetColumnName() );
SvNumberFormatter* pDocFormatter = GetDoc()->GetNumberFormatter();
@@ -348,21 +339,18 @@ void SwDBField::Evaluate()
SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter();
if (nFmt && nFmt != SAL_MAX_UINT32 && !pFormatter->IsTextFormat(nFmt))
- bValidValue = true; // Wegen Bug #60339 nicht mehr bei allen Strings
+ bValidValue = true; // because of bug #60339 not for all strings
}
else
{
- // Bei Strings sal_True wenn Laenge > 0 sonst sal_False
+ // if string length > 0 then true, else false
SetValue(aContent.isEmpty() ? 0 : 1);
}
}
bInitialized = true;
}
-/*--------------------------------------------------------------------
- Beschreibung: Namen erfragen
- --------------------------------------------------------------------*/
-
+/// get name
const OUString& SwDBField::GetPar1() const
{
return ((const SwDBFieldType*)GetTyp())->GetName();
@@ -469,9 +457,7 @@ bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: Basisklasse fuer alle weiteren Datenbankfelder
- --------------------------------------------------------------------*/
+// base class for all further database fields
SwDBNameInfField::SwDBNameInfField(SwFieldType* pTyp, const SwDBData& rDBData, sal_uLong nFmt) :
SwField(pTyp, nFmt),
@@ -579,9 +565,7 @@ void SwDBNameInfField::SetSubType(sal_uInt16 nType)
nSubType = nType;
}
-/*--------------------------------------------------------------------
- Beschreibung: NaechsterDatensatz
- --------------------------------------------------------------------*/
+// next dataset
SwDBNextSetFieldType::SwDBNextSetFieldType()
: SwFieldType( RES_DBNEXTSETFLD )
@@ -595,9 +579,8 @@ SwFieldType* SwDBNextSetFieldType::Copy() const
SwDBNextSetFieldType* pTmp = new SwDBNextSetFieldType();
return pTmp;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwDBSetField
- --------------------------------------------------------------------*/
+
+// SwDBSetField
SwDBNextSetField::SwDBNextSetField(SwDBNextSetFieldType* pTyp,
const String& rCond,
@@ -635,15 +618,13 @@ void SwDBNextSetField::Evaluate(SwDoc* pDoc)
pMgr->ToNextRecord(rData.sDataSource, rData.sCommand);
}
-/*--------------------------------------------------------------------
- Beschreibung: Bedingung
- --------------------------------------------------------------------*/
-
+/// get condition
const OUString& SwDBNextSetField::GetPar1() const
{
return aCond;
}
+/// set condition
void SwDBNextSetField::SetPar1(const OUString& rStr)
{
aCond = rStr;
@@ -677,9 +658,7 @@ bool SwDBNextSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung: Datensatz mit bestimmter ID
- --------------------------------------------------------------------*/
+// dataset with certain ID
SwDBNumSetFieldType::SwDBNumSetFieldType() :
SwFieldType( RES_DBNUMSETFLD )
@@ -694,9 +673,7 @@ SwFieldType* SwDBNumSetFieldType::Copy() const
return pTmp;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwDBSetField
- --------------------------------------------------------------------*/
+// SwDBNumSetField
SwDBNumSetField::SwDBNumSetField(SwDBNumSetFieldType* pTyp,
const String& rCond,
@@ -738,29 +715,25 @@ void SwDBNumSetField::Evaluate(SwDoc* pDoc)
}
}
-/*--------------------------------------------------------------------
- Beschreibung: LogDBName
- --------------------------------------------------------------------*/
-
+/// get LogDBName
const OUString& SwDBNumSetField::GetPar1() const
{
return aCond;
}
+/// set LogDBName
void SwDBNumSetField::SetPar1(const OUString& rStr)
{
aCond = rStr;
}
-/*--------------------------------------------------------------------
- Beschreibung: Bedingung
- --------------------------------------------------------------------*/
-
+/// get condition
OUString SwDBNumSetField::GetPar2() const
{
return aPar2;
}
+/// set condition
void SwDBNumSetField::SetPar2(const OUString& rStr)
{
aPar2 = rStr;
@@ -804,9 +777,7 @@ bool SwDBNumSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwDBNameFieldType
- --------------------------------------------------------------------*/
+// SwDBNameFieldType
SwDBNameFieldType::SwDBNameFieldType(SwDoc* pDocument)
: SwFieldType( RES_DBNAMEFLD )
@@ -833,9 +804,7 @@ SwFieldType* SwDBNameFieldType::Copy() const
//------------------------------------------------------------------------------
-/*--------------------------------------------------------------------
- Beschreibung: Name der angedockten DB
- --------------------------------------------------------------------*/
+// name of the connected database
SwDBNameField::SwDBNameField(SwDBNameFieldType* pTyp, const SwDBData& rDBData, sal_uLong nFmt)
: SwDBNameInfField(pTyp, rDBData, nFmt)
@@ -871,9 +840,8 @@ bool SwDBNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
{
return SwDBNameInfField::PutValue(rAny, nWhichId );
}
-/*--------------------------------------------------------------------
- Beschreibung: SwDBNameFieldType
- --------------------------------------------------------------------*/
+
+// SwDBSetNumberFieldType
SwDBSetNumberFieldType::SwDBSetNumberFieldType()
: SwFieldType( RES_DBSETNUMBERFLD )
@@ -890,9 +858,7 @@ SwFieldType* SwDBSetNumberFieldType::Copy() const
//------------------------------------------------------------------------------
-/*--------------------------------------------------------------------
- Beschreibung: SetNumber der angedockten DB
- --------------------------------------------------------------------*/
+// set-number of the connected database
SwDBSetNumberField::SwDBSetNumberField(SwDBSetNumberFieldType* pTyp,
const SwDBData& rDBData,
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index a6d048ed7206..8c2fdee5798b 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -36,10 +36,6 @@ using namespace ::com::sun::star;
#define DDE_TXT_ENCODING osl_getThreadTextEncoding()
-/*--------------------------------------------------------------------
- Beschreibung: Globale Variablen
- --------------------------------------------------------------------*/
-
class SwIntrnlRefLink : public SwBaseLink
{
SwDDEFieldType& rFldType;
@@ -72,7 +68,7 @@ public:
String sStr( (sal_Char*)aSeq.getConstArray(), static_cast<xub_StrLen>(aSeq.getLength()),
DDE_TXT_ENCODING );
- // CR-LF am Ende entfernen, ist ueberfluessig!
+ // remove not needed CR-LF at the end
xub_StrLen n = sStr.Len();
while( n && 0 == sStr.GetChar( n-1 ) )
--n;
@@ -86,35 +82,34 @@ public:
sStr.Erase( n );
rFldType.SetExpansion( sStr );
- // erst Expansion setzen! (sonst wird das Flag geloescht!)
+ // set Expansion first! (otherwise this flag will be deleted)
rFldType.SetCRLFDelFlag( bDel );
}
break;
- // weitere Formate ...
+ // other formats
default:
return SUCCESS;
}
- OSL_ENSURE( rFldType.GetDoc(), "Kein pDoc" );
+ OSL_ENSURE( rFldType.GetDoc(), "no pDoc" );
- // keine Abhaengigen mehr?
+ // no dependencies left?
if( rFldType.GetDepends() && !rFldType.IsModifyLocked() && !ChkNoDataFlag() )
{
ViewShell* pSh;
SwEditShell* pESh = rFldType.GetDoc()->GetEditShell( &pSh );
- // dann suchen wir uns mal alle Felder. Wird kein gueltiges
- // gefunden, dann Disconnecten wir uns!
+ // Search for fields. If no valid found, disconnect.
SwMsgPoolItem aUpdateDDE( RES_UPDATEDDETBL );
int bCallModify = sal_False;
rFldType.LockModify();
SwClientIter aIter( rFldType ); // TODO
SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
+ if( pLast ) // Could we jump to beginning?
do {
- // eine DDE-Tabelle oder ein DDE-FeldAttribut im Text
+ // a DDE table or a DDE field attribute in the text
if( !pLast->IsA( TYPE( SwFmtFld ) ) ||
((SwFmtFld*)pLast)->GetTxtFld() )
{
@@ -151,7 +146,7 @@ void SwIntrnlRefLink::Closed()
{
if( rFldType.GetDoc() && !rFldType.GetDoc()->IsInDtor() )
{
- // Advise verabschiedet sich, alle Felder in Text umwandeln ?
+ // advise goes, convert all fields into text?
ViewShell* pSh;
SwEditShell* pESh = rFldType.GetDoc()->GetEditShell( &pSh );
if( pESh )
@@ -172,13 +167,13 @@ void SwIntrnlRefLink::Closed()
const SwNode* SwIntrnlRefLink::GetAnchor() const
{
- // hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen
+ // here, any anchor of the normal NodesArray should be sufficient
const SwNode* pNd = 0;
SwClientIter aIter( rFldType ); // TODO
SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
+ if( pLast ) // Could we jump to beginning?
do {
- // eine DDE-Tabelle oder ein DDE-FeldAttribut im Text
+ // a DDE table or a DDE field attribute in the text
if( !pLast->IsA( TYPE( SwFmtFld ) ))
{
SwDepend* pDep = (SwDepend*)pLast;
@@ -199,13 +194,13 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const
sal_Bool SwIntrnlRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd,
xub_StrLen nStt, xub_StrLen nEnd ) const
{
- // hier sollte irgend ein Anchor aus dem normalen Nodes-Array reichen
+ // here, any anchor of the normal NodesArray should be sufficient
SwNodes* pNds = &rFldType.GetDoc()->GetNodes();
SwClientIter aIter( rFldType ); // TODO
SwClient * pLast = aIter.GoStart();
- if( pLast ) // konnte zum Anfang gesprungen werden ??
+ if( pLast ) // Could we jump to beginning?
do {
- // eine DDE-Tabelle oder ein DDE-FeldAttribut im Text
+ // a DDE table or a DDE field attribute in the text
if( !pLast->IsA( TYPE( SwFmtFld ) ))
{
SwDepend* pDep = (SwDepend*)pLast;
@@ -288,7 +283,7 @@ void SwDDEFieldType::SetDoc( SwDoc* pNewDoc )
if( pDoc && refLink.Is() )
{
- OSL_ENSURE( !nRefCnt, "wie kommen die Referenzen rueber?" );
+ OSL_ENSURE( !nRefCnt, "How do we get the references?" );
pDoc->GetLinkManager().Remove( refLink );
}
@@ -406,24 +401,19 @@ SwField* SwDDEField::Copy() const
return new SwDDEField((SwDDEFieldType*)GetTyp());
}
-/*--------------------------------------------------------------------
- Beschreibung: Parameter des Typen erfragen
- Name
- --------------------------------------------------------------------*/
+/// get field type name
const OUString& SwDDEField::GetPar1() const
{
return ((const SwDDEFieldType*)GetTyp())->GetName();
}
-/*--------------------------------------------------------------------
- Beschreibung: Parameter des Typen erfragen
- Commando
- --------------------------------------------------------------------*/
+/// get field type command
OUString SwDDEField::GetPar2() const
{
return ((const SwDDEFieldType*)GetTyp())->GetCmd();
}
+/// set field type command
void SwDDEField::SetPar2(const OUString& rStr)
{
((SwDDEFieldType*)GetTyp())->SetCmd(rStr);
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index 33b0cddf798e..063cced4874b 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -25,7 +25,7 @@
#include <ndtxt.hxx>
#include <swtable.hxx>
#include <swddetbl.hxx>
-#include <ddefld.hxx> // fuer den FieldType
+#include <ddefld.hxx> // for FieldType
#include <ndindex.hxx>
#include <fldupde.hxx>
#include <swtblfmt.hxx>
@@ -33,18 +33,17 @@
TYPEINIT1( SwDDETable, SwTable );
- // Constructor movet alle Lines/Boxen aus der SwTable zu sich.
- // Die SwTable ist danach Leer und muss geloescht werden.
-SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType,
- sal_Bool bUpdate )
+/// Ctor moves all lines/boxes from a SwTable into itself.
+/// Afterwards the SwTable is empty and must be deleted.
+SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType, sal_Bool bUpdate )
: SwTable( rTable ), aDepend( this, pDDEType )
{
- // Kopiere/move die Daten der Tabelle
+ // copy the table data
m_TabSortContentBoxes.insert(rTable.GetTabSortBoxes());
rTable.GetTabSortBoxes().clear();
aLines.insert( aLines.begin(),
- rTable.GetTabLines().begin(), rTable.GetTabLines().end() ); // move die Lines
+ rTable.GetTabLines().begin(), rTable.GetTabLines().end() ); // move lines
rTable.GetTabLines().clear();
if( !aLines.empty() )
@@ -59,7 +58,6 @@ SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType,
pDDEType->IncRefCnt();
// aDepend.UnlockModify();
- // Setzen der Werte in die einzelnen Boxen
// update box content only if update flag is set (false in import)
if (bUpdate)
ChangeContent();
@@ -75,7 +73,7 @@ SwDDETable::~SwDDETable()
GetTabSortBoxes()[0]->GetSttNd()->GetNodes().IsDocNodes() )
pFldTyp->DecRefCnt();
- // sind wir der letzte Abhaengige vom "geloeschten Feld" dann loesche dieses
+ // If it is the last dependant of the "deleted field" than delete it finally
if( pFldTyp->IsDeleted() && pFldTyp->IsLastDepend() )
{
pFldTyp->Remove( &aDepend );
@@ -101,16 +99,16 @@ void SwDDETable::SwClientNotify( const SwModify&, const SfxHint& rHint )
void SwDDETable::ChangeContent()
{
- OSL_ENSURE( GetFrmFmt(), "Kein FrameFormat" );
+ OSL_ENSURE( GetFrmFmt(), "No FrameFormat" );
- // Stehen wir im richtigen NodesArray (Wegen UNDO)
+ // Is this the correct NodesArray? (because of UNDO)
if( aLines.empty() )
return;
- OSL_ENSURE( !GetTabSortBoxes().empty(), "Tabelle ohne Inhalt?" );
+ OSL_ENSURE( !GetTabSortBoxes().empty(), "Table without content?" );
if( !GetTabSortBoxes()[0]->GetSttNd()->GetNodes().IsDocNodes() )
return;
- // zugriff auf den DDEFldType
+ // access to DDEFldType
SwDDEFieldType* pDDEType = (SwDDEFieldType*)aDepend.GetRegisteredIn();
String aExpand = comphelper::string::remove(pDDEType->GetExpansion(), '\r');
@@ -122,10 +120,10 @@ void SwDDETable::ChangeContent()
for( sal_uInt16 i = 0; i < pLine->GetTabBoxes().size(); ++i )
{
SwTableBox* pBox = pLine->GetTabBoxes()[ i ];
- OSL_ENSURE( pBox->GetSttIdx(), "keine InhaltsBox" );
+ OSL_ENSURE( pBox->GetSttIdx(), "no content box" );
SwNodeIndex aNdIdx( *pBox->GetSttNd(), 1 );
SwTxtNode* pTxtNode = aNdIdx.GetNode().GetTxtNode();
- OSL_ENSURE( pTxtNode, "Kein Node" );
+ OSL_ENSURE( pTxtNode, "No Node" );
SwIndex aCntIdx( pTxtNode, 0 );
pTxtNode->EraseText( aCntIdx );
pTxtNode->InsertText( aLine.GetToken( i, '\t' ), aCntIdx );
@@ -150,35 +148,35 @@ SwDDEFieldType* SwDDETable::GetDDEFldType()
sal_Bool SwDDETable::NoDDETable()
{
- // suche den TabellenNode
- OSL_ENSURE( GetFrmFmt(), "Kein FrameFormat" );
+ // search table node
+ OSL_ENSURE( GetFrmFmt(), "No FrameFormat" );
SwDoc* pDoc = GetFrmFmt()->GetDoc();
- // Stehen wir im richtigen NodesArray (Wegen UNDO)
+ // Is this the correct NodesArray? (because of UNDO)
if( aLines.empty() )
return sal_False;
- OSL_ENSURE( !GetTabSortBoxes().empty(), "Tabelle ohne Inhalt?" );
+ OSL_ENSURE( !GetTabSortBoxes().empty(), "Table without content?" );
SwNode* pNd = (SwNode*)GetTabSortBoxes()[0]->GetSttNd();
if( !pNd->GetNodes().IsDocNodes() )
return sal_False;
SwTableNode* pTblNd = pNd->FindTableNode();
- OSL_ENSURE( pTblNd, "wo steht denn die Tabelle ?");
+ OSL_ENSURE( pTblNd, "Where is the table?");
SwTable* pNewTbl = new SwTable( *this );
- // Kopiere/move die Daten der Tabelle
- pNewTbl->GetTabSortBoxes().insert( GetTabSortBoxes() ); // move die Inh. Boxen
+ // copy the table data
+ pNewTbl->GetTabSortBoxes().insert( GetTabSortBoxes() ); // move content boxes
GetTabSortBoxes().clear();
pNewTbl->GetTabLines().insert( pNewTbl->GetTabLines().begin(),
- GetTabLines().begin(), GetTabLines().end() ); // move die Lines
+ GetTabLines().begin(), GetTabLines().end() ); // move lines
GetTabLines().clear();
if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
((SwDDEFieldType*)aDepend.GetRegisteredIn())->DecRefCnt();
- pTblNd->SetNewTable( pNewTbl ); // setze die Tabelle
+ pTblNd->SetNewTable( pNewTbl ); // replace table
return sal_True;
}
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index a7aa86a8e100..c9455cb19bf0 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -100,9 +100,7 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace nsSwDocInfoSubType;
-/*--------------------------------------------------------------------
- Beschreibung: SwPageNumberFieldType
- --------------------------------------------------------------------*/
+// SwPageNumberFieldType
SwPageNumberFieldType::SwPageNumberFieldType()
: SwFieldType( RES_PAGENUMBERFLD ),
@@ -137,10 +135,6 @@ SwFieldType* SwPageNumberFieldType::Copy() const
return pTmp;
}
-/*--------------------------------------------------------------------
- Beschreibung: Verschiedene Expandierung
- --------------------------------------------------------------------*/
-
void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc,
sal_Bool bVirt,
const sal_Int16* pNumFmt )
@@ -151,8 +145,7 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc,
bVirtuell = false;
if( bVirt )
{
- // dann muss das Flag ueberprueft werden, denn das Layout setzt
- // es NIE zurueck
+ // check the flag since the layout NEVER sets it back
const SfxItemPool &rPool = pDoc->GetAttrPool();
const SwFmtPageDesc *pDesc;
sal_uInt32 nMaxItems = rPool.GetItemCount2( RES_PAGEDESC );
@@ -176,9 +169,7 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc,
}
}
-/*--------------------------------------------------------------------
- Beschreibung: SwPageNumberField
- --------------------------------------------------------------------*/
+// SwPageNumberField
SwPageNumberField::SwPageNumberField(SwPageNumberFieldType* pTyp,
sal_uInt16 nSub, sal_uInt32 nFmt, short nOff,
@@ -325,9 +316,7 @@ bool SwPageNumberField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwAuthorFieldType
- --------------------------------------------------------------------*/
+// SwAuthorFieldType
SwAuthorFieldType::SwAuthorFieldType()
: SwFieldType( RES_AUTHORFLD )
@@ -350,9 +339,7 @@ SwFieldType* SwAuthorFieldType::Copy() const
return new SwAuthorFieldType;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwAuthorField
- --------------------------------------------------------------------*/
+// SwAuthorField
SwAuthorField::SwAuthorField(SwAuthorFieldType* pTyp, sal_uInt32 nFmt)
: SwField(pTyp, nFmt)
@@ -427,9 +414,7 @@ bool SwAuthorField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwFileNameFieldType
- --------------------------------------------------------------------*/
+// SwFileNameFieldType
SwFileNameFieldType::SwFileNameFieldType(SwDoc *pDocument)
: SwFieldType( RES_FILENAMEFLD )
@@ -491,9 +476,8 @@ SwFieldType* SwFileNameFieldType::Copy() const
SwFieldType *pTmp = new SwFileNameFieldType(pDoc);
return pTmp;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwFileNameField
- --------------------------------------------------------------------*/
+
+// SwFileNameField
SwFileNameField::SwFileNameField(SwFileNameFieldType* pTyp, sal_uInt32 nFmt)
: SwField(pTyp, nFmt)
@@ -605,9 +589,8 @@ bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwTemplNameFieldType
- --------------------------------------------------------------------*/
+
+// SwTemplNameFieldType
SwTemplNameFieldType::SwTemplNameFieldType(SwDoc *pDocument)
: SwFieldType( RES_TEMPLNAMEFLD )
@@ -669,9 +652,7 @@ SwFieldType* SwTemplNameFieldType::Copy() const
SwFieldType *pTmp = new SwTemplNameFieldType(pDoc);
return pTmp;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwTemplNameField
- --------------------------------------------------------------------*/
+// SwTemplNameField
SwTemplNameField::SwTemplNameField(SwTemplNameFieldType* pTyp, sal_uInt32 nFmt)
: SwField(pTyp, nFmt)
@@ -752,9 +733,8 @@ bool SwTemplNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwDocStatFieldType
- --------------------------------------------------------------------*/
+
+// SwDocStatFieldType
SwDocStatFieldType::SwDocStatFieldType(SwDoc* pDocument)
: SwFieldType( RES_DOCSTATFLD ), nNumberingType( SVX_NUM_ARABIC )
@@ -799,12 +779,11 @@ SwFieldType* SwDocStatFieldType::Copy() const
return pTmp;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwDocStatFieldType
- Aus historischen Gruenden steht in nFormat der
- SubType
- --------------------------------------------------------------------*/
-
+/**
+ * @param pTyp
+ * @param nSub SubType
+ * @param nFmt
+ */
SwDocStatField::SwDocStatField(SwDocStatFieldType* pTyp, sal_uInt16 nSub, sal_uInt32 nFmt)
: SwField(pTyp, nFmt),
nSubType(nSub)
@@ -877,9 +856,7 @@ bool SwDocStatField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return bRet;
}
-/*--------------------------------------------------------------------
- Beschreibung: DokumentinfoFields
- --------------------------------------------------------------------*/
+// Document info field type
SwDocInfoFieldType::SwDocInfoFieldType(SwDoc* pDc)
: SwValueFieldType( pDc, RES_DOCINFOFLD )
@@ -1050,6 +1027,8 @@ String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
return aStr;
}
+// document info field
+
SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const String& rName, sal_uInt32 nFmt) :
SwValueField(pTyp, nFmt), nSubType(nSub)
{
@@ -1305,9 +1284,7 @@ bool SwDocInfoField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwHiddenTxtFieldType by JP
- --------------------------------------------------------------------*/
+// SwHiddenTxtFieldType
SwHiddenTxtFieldType::SwHiddenTxtFieldType( sal_Bool bSetHidden )
: SwFieldType( RES_HIDDENTXTFLD ), bHidden( bSetHidden )
@@ -1324,7 +1301,7 @@ void SwHiddenTxtFieldType::SetHiddenFlag( sal_Bool bSetHidden )
if( bHidden != bSetHidden )
{
bHidden = bSetHidden;
- UpdateFlds(); // alle HiddenText benachrichtigen
+ UpdateFlds(); // notify all HiddenTexts
}
}
@@ -1369,8 +1346,8 @@ SwHiddenTxtField::SwHiddenTxtField( SwHiddenTxtFieldType* pFldType,
String SwHiddenTxtField::Expand() const
{
- // Type: !Hidden -> immer anzeigen
- // Hide -> Werte die Bedingung aus
+ // Type: !Hidden -> show always
+ // Hide -> evaluate condition
if( TYP_CONDTXTFLD == nSubType )
{
@@ -1387,10 +1364,7 @@ String SwHiddenTxtField::Expand() const
return aFALSETxt;
}
-/*--------------------------------------------------------------------
- Beschreibung: Aktuellen Field-Value holen und cachen
- --------------------------------------------------------------------*/
-
+/// get current field value and cache it
void SwHiddenTxtField::Evaluate(SwDoc* pDoc)
{
OSL_ENSURE(pDoc, "Wo ist das Dokument Seniore");
@@ -1407,13 +1381,9 @@ void SwHiddenTxtField::Evaluate(SwDoc* pDoc)
else
sTmpName = aFALSETxt;
-// Datenbankausdruecke muessen sich von
-// einfachem Text unterscheiden. also wird der einfache Text
-// bevorzugt in Anfuehrungszeichen gesetzt.
-// Sind diese vorhanden werden umschliessende entfernt.
-// Wenn nicht, dann wird auf die Tauglichkeit als Datenbankname
-// geprueft. Nur wenn zwei oder mehr Punkte vorhanden sind und kein
-// Anfuehrungszeichen enthalten ist, gehen wir von einer DB aus.
+ // Database expressions need to be differnt from normal text. Therefore, normal text is set
+ // in quotes. If the latter exist they will be removed. If not, check if potential DB name.
+ // Only if there are two or more dots and no quotes, we assume a database.
if(sTmpName.Len() > 1 && sTmpName.GetChar(0) == '\"' &&
sTmpName.GetChar((sTmpName.Len() - 1))== '\"')
{
@@ -1425,7 +1395,7 @@ void SwHiddenTxtField::Evaluate(SwDoc* pDoc)
{
::ReplacePoint(sTmpName);
if(sTmpName.GetChar(0) == '[' && sTmpName.GetChar(sTmpName.Len()-1) == ']')
- { // Eckige Klammern entfernen
+ { // remove brackets
sTmpName.Erase(0, 1);
sTmpName.Erase(sTmpName.Len()-1, 1);
}
@@ -1482,11 +1452,7 @@ SwField* SwHiddenTxtField::Copy() const
return pFld;
}
-
-/*--------------------------------------------------------------------
- Beschreibung: Bedingung setzen
- --------------------------------------------------------------------*/
-
+/// set condition
void SwHiddenTxtField::SetPar1(const OUString& rStr)
{
aCond = rStr;
@@ -1498,10 +1464,7 @@ const OUString& SwHiddenTxtField::GetPar1() const
return aCond;
}
-/*--------------------------------------------------------------------
- Beschreibung: True/False Text
- --------------------------------------------------------------------*/
-
+/// set True/False text
void SwHiddenTxtField::SetPar2(const OUString& rStr)
{
if (nSubType == TYP_CONDTXTFLD)
@@ -1519,6 +1482,7 @@ void SwHiddenTxtField::SetPar2(const OUString& rStr)
aTRUETxt = rStr;
}
+/// get True/False text
OUString SwHiddenTxtField::GetPar2() const
{
String aRet(aTRUETxt);
@@ -1630,9 +1594,7 @@ String SwHiddenTxtField::GetDBName(const String& rName, SwDoc *pDoc)
return sRet;
}
-/*--------------------------------------------------------------------
- Beschreibung: Der Feldtyp fuer Zeilenhoehe 0
- --------------------------------------------------------------------*/
+// field type for line height 0
SwHiddenParaFieldType::SwHiddenParaFieldType()
: SwFieldType( RES_HIDDENPARAFLD )
@@ -1645,9 +1607,7 @@ SwFieldType* SwHiddenParaFieldType::Copy() const
return pTyp;
}
-/*--------------------------------------------------------------------
- Beschreibung: Das Feld Zeilenhoehe 0
- --------------------------------------------------------------------*/
+// field for line height 0
SwHiddenParaField::SwHiddenParaField(SwHiddenParaFieldType* pTyp, const String& rStr)
: SwField(pTyp), aCond(rStr)
@@ -1705,10 +1665,7 @@ bool SwHiddenParaField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: Bedingung setzen
- --------------------------------------------------------------------*/
-
+/// set condition
void SwHiddenParaField::SetPar1(const OUString& rStr)
{
aCond = rStr;
@@ -1719,9 +1676,7 @@ const OUString& SwHiddenParaField::GetPar1() const
return aCond;
}
-/*--------------------------------------------------------------------
- Beschreibung: PostIt
- --------------------------------------------------------------------*/
+// PostIt field type
SwPostItFieldType::SwPostItFieldType(SwDoc *pDoc)
: SwFieldType( RES_POSTITFLD ),mpDoc(pDoc)
@@ -1732,10 +1687,7 @@ SwFieldType* SwPostItFieldType::Copy() const
return new SwPostItFieldType(mpDoc);
}
-
-/*--------------------------------------------------------------------
- Beschreibung: SwPostItFieldType
- --------------------------------------------------------------------*/
+// PostIt field
SwPostItField::SwPostItField( SwPostItFieldType* pT,
const String& rAuthor, const String& rTxt, const String& rInitials, const String& rName, const DateTime& rDateTime )
@@ -1797,29 +1749,26 @@ SwField* SwPostItField::Copy() const
pRet->SetTextObject( new OutlinerParaObject(*mpText) );
return pRet;
}
-/*--------------------------------------------------------------------
- Beschreibung: Author setzen
- --------------------------------------------------------------------*/
+/// set author
void SwPostItField::SetPar1(const OUString& rStr)
{
sAuthor = rStr;
}
+/// get author
const OUString& SwPostItField::GetPar1() const
{
return sAuthor;
}
-/*--------------------------------------------------------------------
- Beschreibung: Text fuers PostIt setzen
- --------------------------------------------------------------------*/
-
+/// set the PostIt's text
void SwPostItField::SetPar2(const OUString& rStr)
{
sTxt = rStr;
}
+/// get the PostIt's text
OUString SwPostItField::GetPar2() const
{
return sTxt;
@@ -1973,9 +1922,8 @@ bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: DokumentinfoFields
- --------------------------------------------------------------------*/
+
+// extended user information field type
SwExtUserFieldType::SwExtUserFieldType()
: SwFieldType( RES_EXTUSERFLD )
@@ -2022,6 +1970,8 @@ String SwExtUserFieldType::Expand(sal_uInt16 nSub, sal_uInt32 ) const
return aRet;
}
+// extended user information field
+
SwExtUserField::SwExtUserField(SwExtUserFieldType* pTyp, sal_uInt16 nSubTyp, sal_uInt32 nFmt) :
SwField(pTyp, nFmt), nType(nSubTyp)
{
@@ -2108,9 +2058,7 @@ bool SwExtUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
//-------------------------------------------------------------------------
-/*--------------------------------------------------------------------
- Beschreibung: Relatives Seitennummern - Feld
- --------------------------------------------------------------------*/
+// field type for relative page numbers
SwRefPageSetFieldType::SwRefPageSetFieldType()
: SwFieldType( RES_REFPAGESETFLD )
@@ -2122,14 +2070,12 @@ SwFieldType* SwRefPageSetFieldType::Copy() const
return new SwRefPageSetFieldType;
}
-// ueberlagert, weil es nichts zum Updaten gibt!
+// overridden since there is nothing to update
void SwRefPageSetFieldType::Modify( const SfxPoolItem*, const SfxPoolItem * )
{
}
-/*--------------------------------------------------------------------
- Beschreibung: Relative Seitennummerierung
- --------------------------------------------------------------------*/
+// field for relative page numbers
SwRefPageSetField::SwRefPageSetField( SwRefPageSetFieldType* pTyp,
short nOff, sal_Bool bFlag )
@@ -2188,9 +2134,8 @@ bool SwRefPageSetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: relatives Seitennummern - Abfrage Feld
- --------------------------------------------------------------------*/
+
+// relative page numbers - query field
SwRefPageGetFieldType::SwRefPageGetFieldType( SwDoc* pDc )
: SwFieldType( RES_REFPAGEGETFLD ), pDoc( pDc ), nNumberingType( SVX_NUM_ARABIC )
@@ -2206,22 +2151,22 @@ SwFieldType* SwRefPageGetFieldType::Copy() const
void SwRefPageGetFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- // Update auf alle GetReferenz-Felder
+ // update all GetReference fields
if( !pNew && !pOld && GetDepends() )
{
- // sammel erstmal alle SetPageRefFelder ein.
+ // first collect all SetPageRefFields
_SetGetExpFlds aTmpLst;
if( MakeSetList( aTmpLst ) )
{
SwIterator<SwFmtFld,SwFieldType> aIter( *this );
for ( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
- // nur die GetRef-Felder Updaten
+ // update only the GetRef fields
if( pFmtFld->GetTxtFld() )
UpdateField( pFmtFld->GetTxtFld(), aTmpLst );
}
}
- // weiter an die Text-Felder, diese "Expandieren" den Text
+ // forward to text fields, they "expand" the text
NotifyClients( pOld, pNew );
}
@@ -2230,13 +2175,13 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
SwIterator<SwFmtFld,SwFieldType> aIter(*pDoc->GetSysFldType( RES_REFPAGESETFLD));
for ( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
- // nur die GetRef-Felder Updaten
+ // update only the GetRef fields
const SwTxtFld* pTFld = pFmtFld->GetTxtFld();
if( pTFld )
{
const SwTxtNode& rTxtNd = pTFld->GetTxtNode();
- // immer den ersten !! (in Tab-Headline, Kopf-/Fuss )
+ // Always the first! (in Tab-Headline, header/footer )
Point aPt;
const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rTxtNd.GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
@@ -2248,13 +2193,13 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
// Check if pFrm is not yet connected to the layout.
!pFrm->FindPageFrm() )
{
- // einen sdbcx::Index fuers bestimmen vom TextNode anlegen
+ // create index for determination of the TextNode
SwNodeIndex aIdx( rTxtNd );
pNew = new _SetGetExpFld( aIdx, pTFld );
}
else
{
- // einen sdbcx::Index fuers bestimmen vom TextNode anlegen
+ // create index for determination of the TextNode
SwPosition aPos( pDoc->GetNodes().GetEndOfPostIts() );
bool const bResult = GetBodyTxtNode( *pDoc, aPos, *pFrm );
OSL_ENSURE(bResult, "where is the Field?");
@@ -2277,7 +2222,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
SwRefPageGetField* pGetFld = (SwRefPageGetField*)pTxtFld->GetFld().GetFld();
pGetFld->SetText( aEmptyStr );
- // dann suche mal das richtige RefPageSet-Field
+ // then search the correct RefPageSet field
SwTxtNode* pTxtNode = (SwTxtNode*)&pTxtFld->GetTxtNode();
if( pTxtNode->StartOfSectionIndex() >
pDoc->GetNodes().GetEndOfExtras().GetIndex() )
@@ -2295,7 +2240,7 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
(SwRefPageSetField*)pRefTxtFld->GetFld().GetFld();
if( pSetFld->IsOn() )
{
- // dann bestimme mal den entsp. Offset
+ // determine the correct offset
Point aPt;
const SwCntntFrm* pFrm = pTxtNode->getLayoutFrm( pTxtNode->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
const SwCntntFrm* pRefFrm = pRefTxtFld->GetTxtNode().getLayoutFrm( pRefTxtFld->GetTxtNode().GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
@@ -2315,13 +2260,11 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
}
}
}
- // dann die Formatierung anstossen
+ // start formatting
((SwFmtFld&)pTxtFld->GetFld()).ModifyNotification( 0, 0 );
}
-/*--------------------------------------------------------------------
- Beschreibung: Relative Seitennummerierung Abfragen
- --------------------------------------------------------------------*/
+// queries for relative page numbering
SwRefPageGetField::SwRefPageGetField( SwRefPageGetFieldType* pTyp,
sal_uInt32 nFmt )
@@ -2345,7 +2288,7 @@ SwField* SwRefPageGetField::Copy() const
void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
const SwTxtFld* pFld )
{
- // nur Felder in Footer, Header, FootNote, Flys
+ // only fields in Footer, Header, FootNote, Flys
SwTxtNode* pTxtNode = (SwTxtNode*)&pFld->GetTxtNode();
SwRefPageGetFieldType* pGetType = (SwRefPageGetFieldType*)GetTyp();
SwDoc* pDoc = pGetType->GetDoc();
@@ -2355,21 +2298,19 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
sTxt.Erase();
- OSL_ENSURE( !pFrm->IsInDocBody(), "Flag ist nicht richtig, Frame steht im DocBody" );
+ OSL_ENSURE( !pFrm->IsInDocBody(), "Flag incorrect, frame is in DocBody" );
- // sammel erstmal alle SetPageRefFelder ein.
+ // collect all SetPageRefFields
_SetGetExpFlds aTmpLst;
if( !pGetType->MakeSetList( aTmpLst ) )
return ;
- // einen sdbcx::Index fuers bestimmen vom TextNode anlegen
+ // create index for determination of the TextNode
SwPosition aPos( SwNodeIndex( pDoc->GetNodes() ) );
pTxtNode = (SwTxtNode*) GetBodyTxtNode( *pDoc, aPos, *pFrm );
- // Wenn kein Layout vorhanden, kommt es in Kopf und Fusszeilen dazu
- // das ChangeExpansion uebers Layout-Formatieren aufgerufen wird
- // aber kein TxtNode vorhanden ist
- //
+ // If no layout exists, ChangeExpansion is called for header and
+ // footer lines via layout formatting without existing TxtNode.
if(!pTxtNode)
return;
@@ -2378,7 +2319,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
_SetGetExpFlds::const_iterator itLast = aTmpLst.lower_bound( &aEndFld );
if( itLast == aTmpLst.begin() )
- return; // es gibt kein entsprechendes Set - Feld vor mir
+ return; // there is no corresponding set-field in front
--itLast;
const SwTxtFld* pRefTxtFld = (*itLast)->GetFld();
@@ -2388,7 +2329,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
const SwCntntFrm* pRefFrm = pRefTxtFld ? pRefTxtFld->GetTxtNode().getLayoutFrm( pFrm->getRootFrm(), &aPt, 0, sal_False ) : 0;
if( pSetFld->IsOn() && pRefFrm )
{
- // dann bestimme mal den entsp. Offset
+ // determine the correct offset
const SwPageFrm* pPgFrm = pFrm->FindPageFrm();
sal_uInt16 nDiff = pPgFrm->GetPhyPageNum() -
pRefFrm->FindPageFrm()->GetPhyPageNum() + 1;
@@ -2445,9 +2386,7 @@ bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: Feld zum Anspringen und Editieren
- --------------------------------------------------------------------*/
+// field type to jump to and edit
SwJumpEditFieldType::SwJumpEditFieldType( SwDoc* pD )
: SwFieldType( RES_JUMPEDITFLD ), pDoc( pD ), aDep( this, 0 )
@@ -2463,9 +2402,9 @@ SwCharFmt* SwJumpEditFieldType::GetCharFmt()
{
SwCharFmt* pFmt = pDoc->GetCharFmtFromPool( RES_POOLCHR_JUMPEDIT );
- // noch nicht registriert ?
+ // not registered yet?
if( !aDep.GetRegisteredIn() )
- pFmt->Add( &aDep ); // anmelden
+ pFmt->Add( &aDep ); // register
return pFmt;
}
@@ -2488,25 +2427,25 @@ SwField* SwJumpEditField::Copy() const
sTxt, sHelp );
}
-// Platzhalter-Text
-
+/// get place holder text
const OUString& SwJumpEditField::GetPar1() const
{
return sTxt;
}
+/// set place holder text
void SwJumpEditField::SetPar1(const OUString& rStr)
{
sTxt = rStr;
}
-// HinweisText
-
+/// get hint text
OUString SwJumpEditField::GetPar2() const
{
return sHelp;
}
+/// set hint text
void SwJumpEditField::SetPar2(const OUString& rStr)
{
sHelp = rStr;
@@ -2576,10 +2515,7 @@ bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return true;
}
-
-/*--------------------------------------------------------------------
- Beschreibung: Combined Character Fieldtype / Field
- --------------------------------------------------------------------*/
+// combined character field type
SwCombinedCharFieldType::SwCombinedCharFieldType()
: SwFieldType( RES_COMBINED_CHARS )
@@ -2591,7 +2527,7 @@ SwFieldType* SwCombinedCharFieldType::Copy() const
return new SwCombinedCharFieldType;
}
-/* --------------------------------------------------------------------*/
+// combined character field
SwCombinedCharField::SwCombinedCharField( SwCombinedCharFieldType* pFTyp,
const String& rChars )
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index eac69cfff189..df352e3b4461 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -102,7 +102,7 @@ static sal_Int32 lcl_APIToSubType(const uno::Any& rAny)
void ReplacePoint( String& rTmpName, bool bWithCommandType )
{
- // replace first and last (if bWithCommandType: last two) dot Ersten und letzten Punkt ersetzen, da in Tabellennamen Punkte erlaubt sind
+ // replace first and last (if bWithCommandType: last two) dot
// since table names may contain dots
xub_StrLen nLen = rTmpName.Len();
@@ -138,7 +138,7 @@ SwTxtNode* GetFirstTxtNode( const SwDoc& rDoc, SwPosition& rPos,
while( 0 != (pCNd = rNodes.GoNext( &rPos.nNode ) ) &&
0 == ( pTxtNode = pCNd->GetTxtNode() ) )
;
- OSL_ENSURE( pTxtNode, "wo ist der 1.TextNode" );
+ OSL_ENSURE( pTxtNode, "Where is the 1.TextNode" );
rPos.nContent.Assign( pTxtNode, 0 );
}
else if ( !pCFrm->IsValid() )
@@ -173,8 +173,7 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos,
if( FLY_AT_FLY == rAnchor.GetAnchorId() )
{
- // und der Fly muss irgendwo angehaengt sein, also
- // den befragen
+ // the fly needs to be attached somewhere, so ask it
pLayout = (SwLayoutFrm*)((SwFlyFrm*)pLayout)->GetAnchorFrm();
continue;
}
@@ -182,7 +181,7 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos,
(FLY_AT_CHAR == rAnchor.GetAnchorId()) ||
(FLY_AS_CHAR == rAnchor.GetAnchorId()))
{
- OSL_ENSURE( rAnchor.GetCntntAnchor(), "keine gueltige Position" );
+ OSL_ENSURE( rAnchor.GetCntntAnchor(), "no valid position" );
rPos = *rAnchor.GetCntntAnchor();
pTxtNode = rPos.nNode.GetNode().GetTxtNode();
if ( FLY_AT_PARA == rAnchor.GetAnchorId() )
@@ -193,8 +192,7 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos,
// ((SwTxtNode*)pTxtNode)->MakeEndIndex( &rPos.nContent );
}
- // noch nicht abbrechen, kann ja auch noch im
- // Header/Footer/Footnote/Fly stehen !!
+ // do not break yet, might be as well in Header/Footer/Footnote/Fly
pLayout = ((SwFlyFrm*)pLayout)->GetAnchorFrm()
? ((SwFlyFrm*)pLayout)->GetAnchorFrm()->GetUpper() : 0;
continue;
@@ -208,7 +206,7 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos,
}
else if( pLayout->IsFtnFrm() )
{
- // hole den Node vom Anker
+ // get the anchor's node
const SwTxtFtn* pFtn = ((SwFtnFrm*)pLayout)->GetAttr();
pTxtNode = &pFtn->GetTxtNode();
rPos.nNode = *pTxtNode;
@@ -253,15 +251,11 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos,
pLayout = pLayout->GetUpper();
continue;
}
- break; // gefunden und beende die Schleife
+ break; // found, so finish loop
}
return pTxtNode;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwSetExpFieldType by JP
- --------------------------------------------------------------------*/
-
SwGetExpFieldType::SwGetExpFieldType(SwDoc* pDc)
: SwValueFieldType( pDc, RES_GETEXPFLD )
{
@@ -276,13 +270,9 @@ void SwGetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* pNew )
{
if( pNew && RES_DOCPOS_UPDATE == pNew->Which() )
NotifyClients( 0, pNew );
- // sonst nichts weiter expandieren
+ // do not expand anything else
}
-/*--------------------------------------------------------------------
- Beschreibung: SwGetExpField by JP
- --------------------------------------------------------------------*/
-
SwGetExpField::SwGetExpField(SwGetExpFieldType* pTyp, const String& rFormel,
sal_uInt16 nSub, sal_uLong nFmt)
: SwFormulaField( pTyp, nFmt, 0.0 ),
@@ -329,23 +319,21 @@ SwField* SwGetExpField::Copy() const
void SwGetExpField::ChangeExpansion( const SwFrm& rFrm, const SwTxtFld& rFld )
{
- if( bIsInBodyTxt ) // nur Felder in Footer, Header, FootNote, Flys
+ if( bIsInBodyTxt ) // only fields in Footer, Header, FootNote, Flys
return;
- OSL_ENSURE( !rFrm.IsInDocBody(), "Flag ist nicht richtig, Frame steht im DocBody" );
+ OSL_ENSURE( !rFrm.IsInDocBody(), "Flag incorrect, frame is in DocBody" );
- // bestimme mal das Dokument (oder geht es noch einfacher?)
+ // determine document (or is there an easier way?)
const SwTxtNode* pTxtNode = &rFld.GetTxtNode();
SwDoc& rDoc = *(SwDoc*)pTxtNode->GetDoc();
- // einen Index fuers bestimmen vom TextNode anlegen
+ // create index for determination of the TextNode
SwPosition aPos( SwNodeIndex( rDoc.GetNodes() ) );
pTxtNode = GetBodyTxtNode( rDoc, aPos, rFrm );
- // Wenn kein Layout vorhanden, kommt es in Kopf und Fusszeilen dazu
- // das ChnageExpansion uebers Layout-Formatieren aufgerufen wird
- // aber kein TxtNode vorhanden ist
- //
+ // If no layout exists, ChangeExpansion is called for header and
+ // footer lines via layout formatting without existing TxtNode.
if(!pTxtNode)
return;
// #i82544#
@@ -368,18 +356,18 @@ void SwGetExpField::ChangeExpansion( const SwFrm& rFrm, const SwTxtFld& rFld )
sal_uInt16 nSize;
rDoc.FldsToExpand( ppHashTbl, nSize, aEndFld );
LookString( ppHashTbl, nSize, GetFormula(), sExpand );
- ::DeleteHashTable( ppHashTbl, nSize ); // HashTabelle loeschen
+ ::DeleteHashTable( ppHashTbl, nSize );
}
else
{
- // fuelle den Calculator mit den Werten
+ // fill calculator with values
SwCalc aCalc( rDoc );
rDoc.FldsToCalc(aCalc, aEndFld);
- // Wert berechnen
+ // calculate value
SetValue(aCalc.Calculate(GetFormula()).GetDouble());
- // Auswertung nach Format
+ // analyse based on format
sExpand = ((SwValueFieldType*)GetTyp())->ExpandValue(
GetValue(), GetFormat(), GetLanguage());
}
@@ -499,7 +487,7 @@ SwSetExpFieldType::SwSetExpFieldType( SwDoc* pDc, const String& rName, sal_uInt1
bDeleted( sal_False )
{
if( ( nsSwGetSetExpType::GSE_SEQ | nsSwGetSetExpType::GSE_STRING ) & nType )
- EnableFormat(sal_False); // Numberformatter nicht einsetzen
+ EnableFormat(sal_False); // do not use Numberformatter
}
SwFieldType* SwSetExpFieldType::Copy() const
@@ -519,7 +507,7 @@ const OUString& SwSetExpFieldType::GetName() const
void SwSetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* )
{
- return; // nicht weiter expandieren
+ return; // do not expand further
}
void SwSetExpFieldType::SetSeqFormat(sal_uLong nFmt)
@@ -548,8 +536,7 @@ extern void InsertSort( std::vector<sal_uInt16>& rArr, sal_uInt16 nIdx, sal_uInt
sal_uInt16 n;
- // dann testmal, ob die Nummer schon vergeben ist oder ob eine neue
- // bestimmt werden muss.
+ // check if number is already used and if a new one needs to be created
SwIterator<SwFmtFld,SwFieldType> aIter( *this );
const SwTxtNode* pNd;
for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
@@ -559,21 +546,21 @@ extern void InsertSort( std::vector<sal_uInt16>& rArr, sal_uInt16 nIdx, sal_uInt
InsertSort( aArr, ((SwSetExpField*)pF->GetFld())->GetSeqNumber() );
- // teste erstmal ob die Nummer schon vorhanden ist:
+ // check first if number already exists
sal_uInt16 nNum = rFld.GetSeqNumber();
if( USHRT_MAX != nNum )
{
for( n = 0; n < aArr.size(); ++n )
if( aArr[ n ] > nNum )
- return nNum; // nicht vorhanden -> also benutzen
+ return nNum; // no -> use it
else if( aArr[ n ] == nNum )
- break; // schon vorhanden -> neue erzeugen
+ break; // yes -> create new
if( n == aArr.size() )
- return nNum; // nicht vorhanden -> also benutzen
+ return nNum; // no -> use it
}
- // alle Nummern entsprechend geflag, also bestimme die richtige Nummer
+ // flagged all numbers, so determine the right number
for( n = 0; n < aArr.size(); ++n )
if( n != aArr[ n ] )
break;
@@ -718,8 +705,7 @@ bool SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, sal_uInt16* pP ) const
& rColl = ::GetAppCollator();
const CharClass& rCC = GetAppCharClass();
- //#59900# Die Sortierung soll die Nummer korrekt einordnen
- //also "10" nach "9" und nicht "10" nach "1"
+ //#59900# Sorting should sort number correctly (e.g. "10" after "9" not after "1")
const String& rTmp2 = rNew.sDlgEntry;
sal_Int32 nFndPos2 = 0;
String sNum2( rTmp2.GetToken( 0, ' ', nFndPos2 ));
@@ -731,8 +717,7 @@ bool SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, sal_uInt16* pP ) const
{
nM = nU + ( nO - nU ) / 2;
- //#59900# Die Sortierung soll die Nummer korrekt einordnen
- //also "10" nach "9" und nicht "10" nach "1"
+ //#59900# Sorting should sort number correctly (e.g. "10" after "9" not after "1")
const String& rTmp1 = maData[nM]->sDlgEntry;
sal_Int32 nFndPos1 = 0;
String sNum1( rTmp1.GetToken( 0, ' ', nFndPos1 ));
@@ -766,17 +751,13 @@ bool SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, sal_uInt16* pP ) const
return false;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwSetExpField by JP
- --------------------------------------------------------------------*/
-
SwSetExpField::SwSetExpField(SwSetExpFieldType* pTyp, const String& rFormel,
sal_uLong nFmt)
: SwFormulaField( pTyp, nFmt, 0.0 ), nSeqNo( USHRT_MAX ),
nSubType(0)
{
SetFormula(rFormel);
- // SubType ignorieren !!!
+ // ignore SubType
bInput = sal_False;
if( IsSequenceFld() )
{
@@ -796,22 +777,19 @@ String SwSetExpField::Expand() const
{
String aStr;
if (nSubType & nsSwExtendedSubType::SUB_CMD)
- { // Der CommandString ist gefragt
+ { // we need the CommandString
aStr = GetTyp()->GetName();
aStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " = " ));
aStr += GetFormula();
}
else if(!(nSubType & nsSwExtendedSubType::SUB_INVISIBLE))
- { // Der Wert ist sichtbar
+ { // value is visible
aStr = sExpand;
}
return aStr;
}
-/*--------------------------------------------------------------------
- @return the field name
- --------------------------------------------------------------------*/
-
+/// @return the field name
String SwSetExpField::GetFieldName() const
{
SwFldTypesEnum const nStrType( (IsSequenceFld())
@@ -938,11 +916,6 @@ xub_StrLen SwGetExpField::GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc
return nRet;
}
-
-/*--------------------------------------------------------------------
- Beschreibung: Parameter setzen
- --------------------------------------------------------------------*/
-
const OUString& SwSetExpField::GetPar1() const
{
return ((const SwSetExpFieldType*)GetTyp())->GetName();
@@ -970,10 +943,6 @@ void SwSetExpField::SetPar2(const OUString& rStr)
}
}
-/*--------------------------------------------------------------------
- Beschreibung: Eingabefeld Type
- ---------------------------------------------------------------------*/
-
SwInputFieldType::SwInputFieldType( SwDoc* pD )
: SwFieldType( RES_INPUTFLD ), pDoc( pD )
{
@@ -985,10 +954,6 @@ SwFieldType* SwInputFieldType::Copy() const
return pType;
}
-/*--------------------------------------------------------------------
- Beschreibung: Eingabefeld
- --------------------------------------------------------------------*/
-
SwInputField::SwInputField(SwInputFieldType* pTyp, const String& rContent,
const String& rPrompt, sal_uInt16 nSub, sal_uLong nFmt) :
SwField(pTyp, nFmt), aContent(rContent), aPText(rPrompt), nSubType(nSub)
@@ -1079,10 +1044,8 @@ bool SwInputField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
}
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: Bedingung setzen
- --------------------------------------------------------------------*/
+/// set condition
void SwInputField::SetPar1(const OUString& rStr)
{
aContent = rStr;
@@ -1093,10 +1056,7 @@ const OUString& SwInputField::GetPar1() const
return aContent;
}
-/*--------------------------------------------------------------------
- Beschreibung: True/False Text
- --------------------------------------------------------------------*/
-
+/// True/False Text
void SwInputField::SetPar2(const OUString& rStr)
{
aPText = rStr;
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index da56d0dd1446..f9467ad42297 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -50,7 +50,7 @@ using namespace nsSwDocInfoSubType;
static sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFmt,
const SvNumberFormatter& rFormatter )
{
- if( nLng == LANGUAGE_NONE ) // wegen Bug #60010
+ if( nLng == LANGUAGE_NONE ) // Bug #60010
nLng = LANGUAGE_SYSTEM;
else if( nLng == ::GetAppLanguage() )
switch( rFormatter.GetIndexTableOffset( nFmt ))
@@ -66,11 +66,9 @@ static sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFmt,
return nLng;
}
-/*--------------------------------------------------------------------
- Beschreibung: Globals
- --------------------------------------------------------------------*/
-// Array der Feldname
+// Globals
+/// field names
std::vector<String>* SwFieldType::pFldNames = 0;
sal_uInt16 aTypeTab[] = {
@@ -80,19 +78,19 @@ std::vector<String>* SwFieldType::pFldNames = 0;
/* RES_DBNAMEFLD */ TYP_DBNAMEFLD,
/* RES_DATEFLD */ TYP_DATEFLD,
/* RES_TIMEFLD */ TYP_TIMEFLD,
- /* RES_PAGENUMBERFLD */ TYP_PAGENUMBERFLD, // dynamisch
+ /* RES_PAGENUMBERFLD */ TYP_PAGENUMBERFLD, // dynamic
/* RES_AUTHORFLD */ TYP_AUTHORFLD,
/* RES_CHAPTERFLD */ TYP_CHAPTERFLD,
/* RES_DOCSTATFLD */ TYP_DOCSTATFLD,
- /* RES_GETEXPFLD */ TYP_GETFLD, // dynamisch
- /* RES_SETEXPFLD */ TYP_SETFLD, // dynamisch
+ /* RES_GETEXPFLD */ TYP_GETFLD, // dynamic
+ /* RES_SETEXPFLD */ TYP_SETFLD, // dynamic
/* RES_GETREFFLD */ TYP_GETREFFLD,
/* RES_HIDDENTXTFLD */ TYP_HIDDENTXTFLD,
/* RES_POSTITFLD */ TYP_POSTITFLD,
/* RES_FIXDATEFLD */ TYP_FIXDATEFLD,
/* RES_FIXTIMEFLD */ TYP_FIXTIMEFLD,
- /* RES_REGFLD */ 0, // alt
- /* RES_VARREGFLD */ 0, // alt
+ /* RES_REGFLD */ 0, // old (no change since 2000)
+ /* RES_VARREGFLD */ 0, // old (no change since 2000)
/* RES_SETREFFLD */ TYP_SETREFFLD,
/* RES_INPUTFLD */ TYP_INPUTFLD,
/* RES_MACROFLD */ TYP_MACROFLD,
@@ -110,7 +108,7 @@ std::vector<String>* SwFieldType::pFldNames = 0;
/* RES_INTERNETFLD */ TYP_INTERNETFLD,
/* RES_JUMPEDITFLD */ TYP_JUMPEDITFLD,
/* RES_SCRIPTFLD */ TYP_SCRIPTFLD,
- /* RES_DATETIMEFLD */ 0, // dynamisch
+ /* RES_DATETIMEFLD */ 0, // dynamic
/* RES_AUTHORITY */ TYP_AUTHORITY,
/* RES_COMBINED_CHARS */ TYP_COMBINED_CHARS,
/* RES_DROPDOWN */ TYP_DROPDOWN
@@ -130,11 +128,7 @@ const String& SwFieldType::GetTypeStr(sal_uInt16 nTypeId)
return aEmptyStr;
}
-/*---------------------------------------------------
- Jedes Feld referenziert einen Feldtypen, der fuer
- jedes Dokument einmalig ist.
- --------------------------------------------------*/
-
+// each field refences a field type that is unique for each document
SwFieldType::SwFieldType( sal_uInt16 nWhichId )
: SwModify(0),
nWhich( nWhichId )
@@ -155,12 +149,8 @@ bool SwFieldType::PutValue( const uno::Any& , sal_uInt16 )
return false;
}
-/*--------------------------------------------------------------------
- Beschreibung: Basisklasse aller Felder
- Felder referenzieren einen Feldtyp
- Felder sind n-mal vorhanden, Feldtypen nur einmal
- --------------------------------------------------------------------*/
-
+// Base class for all fields.
+// A field (multiple can exist) references a field type (can exists only once)
SwField::SwField(SwFieldType* pTyp, sal_uInt32 nFmt, sal_uInt16 nLng) :
nLang(nLng),
bIsAutomaticLanguage(sal_True),
@@ -174,9 +164,7 @@ SwField::~SwField()
{
}
-/*--------------------------------------------------------------------
- Beschreibung: Statt Umweg ueber den Typ
- --------------------------------------------------------------------*/
+// instead of indirectly via the type
#ifdef DBG_UTIL
sal_uInt16 SwField::Which() const
@@ -231,11 +219,7 @@ sal_uInt16 SwField::GetTypeId() const
return nRet;
}
-
-/*--------------------------------------------------------------------
- Beschreibung: liefert den Namen oder den Inhalt
- --------------------------------------------------------------------*/
-
+/// get name or content
String SwField::GetFieldName() const
{
sal_uInt16 nTypeId = GetTypeId();
@@ -253,10 +237,6 @@ String SwField::GetFieldName() const
return sRet;
}
-/*--------------------------------------------------------------------
- Beschreibung: Parameter setzen auslesen
- --------------------------------------------------------------------*/
-
const OUString& SwField::GetPar1() const
{
return aEmptyOUStr;
@@ -319,24 +299,24 @@ bool SwField::PutValue( const uno::Any& rVal, sal_uInt16 nWhichId )
return true;
}
-
-/*--------------------------------------------------------------------
- Beschreibung: neuen Typ setzen
- (wird fuer das Kopieren zwischen Dokumenten benutzt)
- muss immer vom gleichen Typ sein.
- --------------------------------------------------------------------*/
-
+/** Set a new type
+ *
+ * This is needed/used for copying between documents.
+ * Needs to be always of the same type.
+ * @param pNewType The new type.
+ * @return The old type.
+ */
SwFieldType* SwField::ChgTyp( SwFieldType* pNewType )
{
OSL_ENSURE( pNewType && pNewType->Which() == pType->Which(),
- "kein Typ oder ungleiche Typen" );
+ "no or different type" );
SwFieldType* pOld = pType;
pType = pNewType;
return pOld;
}
- // hat das Feld eine Action auf dem ClickHandler ? (z.B. INetFelder,..)
+/// Does the field have an action on a ClickHandler? (E.g. INetFields,...)
sal_Bool SwField::HasClickHdl() const
{
sal_Bool bRet = sal_False;
@@ -416,26 +396,19 @@ SwField * SwField::CopyField() const
return pNew;
}
-/*--------------------------------------------------------------------
- Beschreibung: Numerierung expandieren
- --------------------------------------------------------------------*/
-
+/// expand numbering
String FormatNumber(sal_uInt32 nNum, sal_uInt32 nFormat)
{
if(SVX_NUM_PAGEDESC == nFormat)
return OUString::number( nNum );
SvxNumberType aNumber;
- OSL_ENSURE(nFormat != SVX_NUM_NUMBER_NONE, "Falsches Nummern-Format" );
+ OSL_ENSURE(nFormat != SVX_NUM_NUMBER_NONE, "wrong number format" );
aNumber.SetNumberingType((sal_Int16)nFormat);
return aNumber.GetNumStr(nNum);
}
-/*--------------------------------------------------------------------
- Beschreibung: CTOR SwValueFieldType
- --------------------------------------------------------------------*/
-
SwValueFieldType::SwValueFieldType( SwDoc* pDocPtr, sal_uInt16 nWhichId )
: SwFieldType(nWhichId),
pDoc(pDocPtr),
@@ -450,21 +423,18 @@ SwValueFieldType::SwValueFieldType( const SwValueFieldType& rTyp )
{
}
-/*--------------------------------------------------------------------
- Beschreibung: Wert formatiert als String zurueckgeben
- --------------------------------------------------------------------*/
-
+/// return value formatted as string
String SwValueFieldType::ExpandValue( const double& rVal,
sal_uInt32 nFmt, sal_uInt16 nLng) const
{
- if (rVal >= DBL_MAX) // FehlerString fuer Calculator
+ if (rVal >= DBL_MAX) // error string for calculator
return ViewShell::GetShellRes()->aCalc_Error;
OUString sExpand;
SvNumberFormatter* pFormatter = pDoc->GetNumberFormatter();
Color* pCol = 0;
- // wegen Bug #60010
+ // Bug #60010
sal_uInt16 nFmtLng = ::lcl_GetLanguageOfFormat( nLng, nFmt, *pFormatter );
if( nFmt < SV_COUNTRY_LANGUAGE_OFFSET && LANGUAGE_SYSTEM != nFmtLng )
@@ -481,7 +451,7 @@ String SwValueFieldType::ExpandValue( const double& rVal,
if (nNewFormat == nFmt)
{
- // Warscheinlich benutzerdefiniertes Format
+ // probably user-defined format
OUString sFmt(pEntry->GetFormatstring());
pFormatter->PutandConvertEntry(sFmt, nDummy, nType, nFmt,
@@ -490,7 +460,7 @@ String SwValueFieldType::ExpandValue( const double& rVal,
else
nFmt = nNewFormat;
}
- OSL_ENSURE(pEntry, "Unbekanntes Zahlenformat!");
+ OSL_ENSURE(pEntry, "unknown number format!");
}
if( pFormatter->IsTextFormat( nFmt ) )
@@ -522,19 +492,15 @@ void SwValueFieldType::DoubleToString( String &rValue, const double &rVal,
{
SvNumberFormatter* pFormatter = pDoc->GetNumberFormatter();
- // wegen Bug #60010
- if( nLng == LANGUAGE_NONE ) // wegen Bug #60010
+ // Bug #60010
+ if( nLng == LANGUAGE_NONE )
nLng = LANGUAGE_SYSTEM;
- pFormatter->ChangeIntl( nLng ); // Separator in der richtigen Sprache besorgen
+ pFormatter->ChangeIntl( nLng ); // get separator in the correct language
rValue = ::rtl::math::doubleToUString( rVal, rtl_math_StringFormat_F, 12,
pFormatter->GetDecSep(), true );
}
-/*--------------------------------------------------------------------
- Beschreibung: CTOR SwValueField
- --------------------------------------------------------------------*/
-
SwValueField::SwValueField( SwValueFieldType* pFldType, sal_uInt32 nFmt,
sal_uInt16 nLng, const double fVal )
: SwField(pFldType, nFmt, nLng),
@@ -551,12 +517,14 @@ SwValueField::SwValueField( const SwValueField& rFld )
SwValueField::~SwValueField()
{
}
-/*--------------------------------------------------------------------
- Beschreibung: neuen Typ setzen
- (wird fuer das Kopieren zwischen Dokumenten benutzt)
- muss immer vom gleichen Typ sein.
- --------------------------------------------------------------------*/
+/** Set a new type
+ *
+ * This is needed/used for copying between documents.
+ * Needs to be always of the same type.
+ * @param pNewType The new type.
+ * @return The old type.
+ */
SwFieldType* SwValueField::ChgTyp( SwFieldType* pNewType )
{
SwDoc* pNewDoc = ((SwValueFieldType *)pNewType)->GetDoc();
@@ -574,10 +542,7 @@ SwFieldType* SwValueField::ChgTyp( SwFieldType* pNewType )
return SwField::ChgTyp(pNewType);
}
-/*--------------------------------------------------------------------
- Beschreibung: Format in Office-Sprache ermitteln
- --------------------------------------------------------------------*/
-
+/// get format in office language
sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt32 nFmt)
{
const SvNumberformat* pEntry = pFormatter->GetEntry(nFmt);
@@ -590,7 +555,7 @@ sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt
if (nNewFormat == nFmt)
{
- // Warscheinlich benutzerdefiniertes Format
+ // probably user-defined format
short nType = NUMBERFORMAT_DEFINED;
sal_Int32 nDummy;
@@ -608,17 +573,14 @@ sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt
return nFmt;
}
-/*--------------------------------------------------------------------
- Beschreibung: Sprache im Format anpassen
- --------------------------------------------------------------------*/
-
+/// set language of the format
void SwValueField::SetLanguage( sal_uInt16 nLng )
{
if( IsAutomaticLanguage() &&
((SwValueFieldType *)GetTyp())->UseFormat() &&
GetFormat() != SAL_MAX_UINT32 )
{
- // wegen Bug #60010
+ // Bug #60010
SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter();
sal_uInt16 nFmtLng = ::lcl_GetLanguageOfFormat( nLng, GetFormat(),
*pFormatter );
@@ -636,7 +598,7 @@ void SwValueField::SetLanguage( sal_uInt16 nLng )
if( nNewFormat == GetFormat() )
{
- // Warscheinlich benutzerdefiniertes Format
+ // probably user-defined format
short nType = NUMBERFORMAT_DEFINED;
sal_Int32 nDummy;
OUString sFmt( pEntry->GetFormatstring() );
@@ -647,7 +609,7 @@ void SwValueField::SetLanguage( sal_uInt16 nLng )
}
SetFormat( nNewFormat );
}
- OSL_ENSURE(pEntry, "Unbekanntes Zahlenformat!");
+ OSL_ENSURE(pEntry, "unknown number format!");
}
}
@@ -664,10 +626,6 @@ void SwValueField::SetValue( const double& rVal )
fValue = rVal;
}
-/*--------------------------------------------------------------------
- Beschreibung: SwFormulaField
- --------------------------------------------------------------------*/
-
SwFormulaField::SwFormulaField( SwValueFieldType* pFldType, sal_uInt32 nFmt, const double fVal)
: SwValueField(pFldType, nFmt, LANGUAGE_SYSTEM, fVal)
{
diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx
index 6f9076c6b6fa..fc57a4842238 100644
--- a/sw/source/core/fields/flddat.cxx
+++ b/sw/source/core/fields/flddat.cxx
@@ -27,9 +27,6 @@
#include <unofldmid.h>
using namespace ::com::sun::star;
-/*--------------------------------------------------
- Beschreibung: Datum/Zeit-Typ
- ---------------------------------------------------*/
SwDateTimeFieldType::SwDateTimeFieldType(SwDoc* pInitDoc)
: SwValueFieldType( pInitDoc, RES_DATETIMEFLD )
@@ -41,10 +38,6 @@ SwFieldType* SwDateTimeFieldType::Copy() const
return pTmp;
}
-/*--------------------------------------------------------------------
- Beschreibung: Datum/Zeit-Feld
- --------------------------------------------------------------------*/
-
SwDateTimeField::SwDateTimeField(SwDateTimeFieldType* pInitType, sal_uInt16 nSub, sal_uLong nFmt, sal_uInt16 nLng)
: SwValueField(pInitType, nFmt, nLng, 0.0),
nSubType(nSub),
diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx
index 9e0a70d2d69e..01ea812e45d4 100644
--- a/sw/source/core/fields/fldlst.cxx
+++ b/sw/source/core/fields/fldlst.cxx
@@ -30,22 +30,18 @@
#include "docfld.hxx"
#include "ndtxt.hxx"
-
-/*--------------------------------------------------------------------
- Beschreibung: Sortieren der Input-Eintraege
- --------------------------------------------------------------------*/
+// sort input values
SwInputFieldList::SwInputFieldList( SwEditShell* pShell, sal_Bool bBuildTmpLst )
: pSh(pShell)
{
- // Hier die Liste aller Eingabefelder sortiert erstellen
+ // create sorted list of all input fields
pSrtLst = new _SetGetExpFlds();
const SwFldTypes& rFldTypes = *pSh->GetDoc()->GetFldTypes();
const sal_uInt16 nSize = rFldTypes.size();
- // Alle Typen abklappern
-
+ // iterate over all types
for(sal_uInt16 i=0; i < nSize; ++i)
{
SwFieldType* pFldType = (SwFieldType*)rFldTypes[ i ];
@@ -58,8 +54,7 @@ SwInputFieldList::SwInputFieldList( SwEditShell* pShell, sal_Bool bBuildTmpLst )
{
const SwTxtFld* pTxtFld = pFld->GetTxtFld();
- // nur InputFields und interaktive SetExpFlds bearbeiten
- // and DropDown fields
+ // only process InputFields, interactive SetExpFlds and DropDown fields
if( !pTxtFld || ( RES_SETEXPFLD == nType &&
!((SwSetExpField*)pFld->GetFld())->GetInputFlag()))
continue;
@@ -88,42 +83,33 @@ SwInputFieldList::~SwInputFieldList()
delete pSrtLst;
}
-/*--------------------------------------------------------------------
- Beschreibung: Felder aus der Liste in sortierter Reihenfolge
- --------------------------------------------------------------------*/
-
sal_uInt16 SwInputFieldList::Count() const
{
return pSrtLst->size();
}
-
+// get field from list in sorted order
SwField* SwInputFieldList::GetField(sal_uInt16 nId)
{
const SwTxtFld* pTxtFld = (*pSrtLst)[ nId ]->GetFld();
- OSL_ENSURE( pTxtFld, "kein TextFld" );
+ OSL_ENSURE( pTxtFld, "no TextFld" );
return (SwField*)pTxtFld->GetFld().GetFld();
}
-/*--------------------------------------------------------------------
- Beschreibung: Cursor sichern
- --------------------------------------------------------------------*/
-
+/// save cursor
void SwInputFieldList::PushCrsr()
{
pSh->Push();
pSh->ClearMark();
}
+/// get cursor
void SwInputFieldList::PopCrsr()
{
pSh->Pop(sal_False);
}
-/*--------------------------------------------------------------------
- Beschreibung: Position eines Feldes ansteuern
- --------------------------------------------------------------------*/
-
+/// go to position of a field
void SwInputFieldList::GotoFieldPos(sal_uInt16 nId)
{
pSh->StartAllAction();
@@ -131,16 +117,19 @@ void SwInputFieldList::GotoFieldPos(sal_uInt16 nId)
pSh->EndAllAction();
}
- // vergleiche TmpLst mit akt Feldern. Alle neue kommen in die SortLst
- // damit sie geupdatet werden koennen. Returnt die Anzahl.
- // (Fuer Textbausteine: nur seine Input-Felder aktualisieren)
+/** Compare TmpLst with current fields.
+ *
+ * All new ones are added to SortList so that they can be updated.
+ * For text blocks: update only input fields.
+ *
+ * @return count
+ */
sal_uInt16 SwInputFieldList::BuildSortLst()
{
const SwFldTypes& rFldTypes = *pSh->GetDoc()->GetFldTypes();
sal_uInt16 nSize = rFldTypes.size();
- // Alle Typen abklappern
-
+ // iterate over all types
for( sal_uInt16 i = 0; i < nSize; ++i )
{
SwFieldType* pFldType = (SwFieldType*)rFldTypes[ i ];
@@ -153,7 +142,7 @@ sal_uInt16 SwInputFieldList::BuildSortLst()
{
const SwTxtFld* pTxtFld = pFld->GetTxtFld();
- // nur InputFields und interaktive SetExpFlds bearbeiten
+ // process only InputFields and interactive SetExpFlds
if( !pTxtFld || ( RES_SETEXPFLD == nType &&
!((SwSetExpField*)pFld->GetFld())->GetInputFlag()))
continue;
@@ -161,8 +150,7 @@ sal_uInt16 SwInputFieldList::BuildSortLst()
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
if( rTxtNode.GetNodes().IsDocNodes() )
{
- // nicht in der TempListe vorhanden, also in die SortListe
- // aufnehemen
+ // not in TempList, thus add to SortList
std::set<const SwTxtFld*>::iterator it = aTmpLst.find( pTxtFld );
if( aTmpLst.end() == it )
{
@@ -177,15 +165,12 @@ sal_uInt16 SwInputFieldList::BuildSortLst()
}
}
- // die Pointer werden nicht mehr gebraucht
+ // the pointers are not needed anymore
aTmpLst.clear();
return pSrtLst->size();
}
-/*--------------------------------------------------------------------
- Beschreibung: Alle Felder auerhalb von Selektionen aus Liste entfernen
- --------------------------------------------------------------------*/
-
+/// remove all fields outside of any selections from list
void SwInputFieldList::RemoveUnselectedFlds()
{
_SetGetExpFlds* pNewLst = new _SetGetExpFlds();
@@ -201,7 +186,7 @@ void SwInputFieldList::RemoveUnselectedFlds()
if (aPos >= *PCURCRSR->Start() && aPos < *PCURCRSR->End())
{
- // Feld innerhalb der Selektion
+ // field in selection
pNewLst->insert( (*pSrtLst)[i] );
pSrtLst->erase(i);
}
diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx
index d62f72a56d4d..a4e641a9485e 100644
--- a/sw/source/core/fields/macrofld.cxx
+++ b/sw/source/core/fields/macrofld.cxx
@@ -27,13 +27,8 @@
#include <com/sun/star/uri/XVndSunStarScriptUrl.hpp>
#include <comphelper/processfactory.hxx>
-
using namespace ::com::sun::star;
-/*--------------------------------------------------------------------
- Beschreibung: MacroFeldtypen
- --------------------------------------------------------------------*/
-
SwMacroFieldType::SwMacroFieldType(SwDoc* pDocument)
: SwFieldType( RES_MACROFLD ),
pDoc(pDocument)
@@ -46,9 +41,6 @@ SwFieldType* SwMacroFieldType::Copy() const
return pType;
}
-/*--------------------------------------------------------------------
- Beschreibung: Das Macrofeld selbst
- --------------------------------------------------------------------*/
SwMacroField::SwMacroField(SwMacroFieldType* pInitType,
const String& rLibAndName, const String& rTxt) :
@@ -58,7 +50,7 @@ SwMacroField::SwMacroField(SwMacroFieldType* pInitType,
}
String SwMacroField::Expand() const
-{ // Button malen anstatt von
+{
return aText ;
}
@@ -93,7 +85,7 @@ String SwMacroField::GetLibName() const
return aMacro.copy(0, nPos);
}
- OSL_FAIL("Kein Macroname vorhanden");
+ OSL_FAIL("No MacroName");
return aEmptyStr;
}
@@ -116,7 +108,7 @@ String SwMacroField::GetMacroName() const
}
}
- OSL_FAIL("Kein Macroname vorhanden");
+ OSL_FAIL("No MacroName");
return aEmptyStr;
}
@@ -132,30 +124,26 @@ SvxMacro SwMacroField::GetSvxMacro() const
}
}
-/*--------------------------------------------------------------------
- Beschreibung: LibName und MacroName
- --------------------------------------------------------------------*/
-
+/// LibName and MacroName
void SwMacroField::SetPar1(const OUString& rStr)
{
aMacro = rStr;
bIsScriptURL = isScriptURL(aMacro);
}
+/// Get macro
const OUString& SwMacroField::GetPar1() const
{
return aMacro;
}
-/*--------------------------------------------------------------------
- Beschreibung: Macrotext
- --------------------------------------------------------------------*/
-
+/// set macro text
void SwMacroField::SetPar2(const OUString& rStr)
{
aText = rStr;
}
+/// get macro text
OUString SwMacroField::GetPar2() const
{
return aText;
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 4c668b04ea20..e81c4c859de0 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -72,13 +72,13 @@ static void lcl_GetLayTree( const SwFrm* pFrm, std::vector<const SwFrm*>& rArr )
{
while( pFrm )
{
- if( pFrm->IsBodyFrm() ) // soll uns nicht weiter interessieren
+ if( pFrm->IsBodyFrm() ) // unspectacular
pFrm = pFrm->GetUpper();
else
{
rArr.push_back( pFrm );
- // bei der Seite ist schluss
+ // this is the last page
if( pFrm->IsPageFrm() )
break;
@@ -113,7 +113,7 @@ bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
sal_Bool bVert = sal_False;
sal_Bool bR2L = sal_False;
- // solange bis ein Frame ungleich ist ?
+ // Loop as long as a frame does not equal?
while( nRefCnt && nCnt && aRefArr[ nRefCnt ] == aArr[ nCnt ] )
{
const SwFrm* pTmpFrm = aArr[ nCnt ];
@@ -122,7 +122,7 @@ bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
--nCnt, --nRefCnt;
}
- // sollte einer der Counter ueberlaeufen?
+ // If a counter overflows?
if( aRefArr[ nRefCnt ] == aArr[ nCnt ] )
{
if( nCnt )
@@ -134,14 +134,14 @@ bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
const SwFrm* pRefFrm = aRefArr[ nRefCnt ];
const SwFrm* pFldFrm = aArr[ nCnt ];
- // unterschiedliche Frames, dann ueberpruefe deren Y-/X-Position
+ // different frames, check their Y-/X-position
bool bRefIsLower = false;
if( ( FRM_COLUMN | FRM_CELL ) & pFldFrm->GetType() ||
( FRM_COLUMN | FRM_CELL ) & pRefFrm->GetType() )
{
if( pFldFrm->GetType() == pRefFrm->GetType() )
{
- // hier ist die X-Pos wichtiger!
+ // here, the X-pos is more important
if( bVert )
{
if( bR2L )
@@ -169,7 +169,7 @@ bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
pRefFrm = aRefArr[ nRefCnt - 1 ];
}
- if( pRefFrm ) // als Flag missbrauchen
+ if( pRefFrm ) // misuse as flag
{
if( bVert )
{
@@ -194,11 +194,7 @@ bool IsFrameBehind( const SwTxtNode& rMyNd, sal_uInt16 nMySttPos,
return bRefIsLower;
}
-/*--------------------------------------------------------------------
- Beschreibung: Referenzen holen
- --------------------------------------------------------------------*/
-
-
+/// get references
SwGetRefField::SwGetRefField( SwGetRefFieldType* pFldType,
const String& rSetRef, sal_uInt16 nSubTyp,
sal_uInt16 nSeqenceNo, sal_uLong nFmt )
@@ -579,17 +575,13 @@ SwField* SwGetRefField::Copy() const
return pFld;
}
-/*--------------------------------------------------------------------
- Beschreibung: ReferenzName holen
- --------------------------------------------------------------------*/
-
-
+/// get reference name
const OUString& SwGetRefField::GetPar1() const
{
return sSetRefName;
}
-
+/// set reference name
void SwGetRefField::SetPar1( const OUString& rName )
{
sSetRefName = rName;
@@ -791,13 +783,13 @@ SwFieldType* SwGetRefFieldType::Copy() const
void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- // Update auf alle GetReferenz-Felder
+ // update to all GetReference fields
if( !pNew && !pOld )
{
SwIterator<SwFmtFld,SwFieldType> aIter( *this );
for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() )
{
- // nur die GetRef-Felder Updaten
+ // update only the GetRef fields
//JP 3.4.2001: Task 71231 - we need the correct language
SwGetRefField* pGRef = (SwGetRefField*)pFld->GetFld();
const SwTxtFld* pTFld;
@@ -813,7 +805,7 @@ void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
pGRef->UpdateField( pFld->GetTxtFld() );
}
}
- // weiter an die Text-Felder, diese "Expandieren" den Text
+ // forward to text fields, they "expand" the text
NotifyClients( pOld, pNew );
}
@@ -821,7 +813,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
sal_uInt16 nSubType, sal_uInt16 nSeqNo,
sal_uInt16* pStt, sal_uInt16* pEnd )
{
- OSL_ENSURE( pStt, "warum wird keine StartPos abgefragt?" );
+ OSL_ENSURE( pStt, "Why did noone check the StartPos?" );
SwTxtNode* pTxtNd = 0;
switch( nSubType )
@@ -1091,9 +1083,8 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc )
{
if( &rDestDoc != pDoc )
{
- // dann gibt es im DestDoc RefFelder, also muessen im SourceDoc
- // alle RefFelder auf einduetige Ids in beiden Docs umgestellt
- // werden.
+ // then there are RefFields in the DescDox - so all RefFields in the SourceDoc
+ // need to be converted to have unique IDs for both documents
_RefIdsMap aFntMap( aEmptyStr );
_RefIdsMaps aFldMap;
diff --git a/sw/source/core/fields/scrptfld.cxx b/sw/source/core/fields/scrptfld.cxx
index 8432bad839c0..e1af8944a2ad 100644
--- a/sw/source/core/fields/scrptfld.cxx
+++ b/sw/source/core/fields/scrptfld.cxx
@@ -23,9 +23,6 @@
#include <tools/resid.hxx>
using namespace ::com::sun::star;
-/*--------------------------------------------------------------------
- Beschreibung: ScriptField
- --------------------------------------------------------------------*/
SwScriptFieldType::SwScriptFieldType( SwDoc* pD )
: SwFieldType( RES_SCRIPTFLD ), pDoc( pD )
@@ -36,11 +33,6 @@ SwFieldType* SwScriptFieldType::Copy() const
return new SwScriptFieldType( pDoc );
}
-
-/*--------------------------------------------------------------------
- Beschreibung: SwScriptField
- --------------------------------------------------------------------*/
-
SwScriptField::SwScriptField( SwScriptFieldType* pInitType,
const String& rType, const String& rCode,
sal_Bool bURL )
@@ -63,10 +55,7 @@ SwField* SwScriptField::Copy() const
return new SwScriptField( (SwScriptFieldType*)GetTyp(), sType, sCode, bCodeURL );
}
-/*--------------------------------------------------------------------
- Beschreibung: Type setzen
- --------------------------------------------------------------------*/
-
+/// set type
void SwScriptField::SetPar1( const OUString& rStr )
{
sType = rStr;
@@ -77,10 +66,7 @@ const OUString& SwScriptField::GetPar1() const
return sType;
}
-/*--------------------------------------------------------------------
- Beschreibung: Code setzen
- --------------------------------------------------------------------*/
-
+/// set code
void SwScriptField::SetPar2( const OUString& rStr )
{
sCode = rStr;
diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx
index 8b425e03996b..19cc755573b5 100644
--- a/sw/source/core/fields/tblcalc.cxx
+++ b/sw/source/core/fields/tblcalc.cxx
@@ -21,12 +21,12 @@
#include <switerator.hxx>
#include <cntfrm.hxx>
#include <doc.hxx>
-#include <pam.hxx> // fuer GetBodyTxtNode
+#include <pam.hxx> // for GetBodyTxtNode
#include <ndtxt.hxx>
#include <fmtfld.hxx>
#include <txtfld.hxx>
#include <expfld.hxx>
-#include <docfld.hxx> // fuer _SetGetExpFld
+#include <docfld.hxx> // for _SetGetExpFld
#include <unofldmid.h>
using namespace ::com::sun::star;
@@ -46,14 +46,14 @@ SwFieldType* SwTblFieldType::Copy() const
void SwTblField::CalcField( SwTblCalcPara& rCalcPara )
{
- if( rCalcPara.rCalc.IsCalcError() ) // ist schon Fehler gesetzt ?
+ if( rCalcPara.rCalc.IsCalcError() ) // stop if there is already an error set
return;
- // erzeuge aus den BoxNamen die Pointer
+ // create pointers from box name
BoxNmToPtr( rCalcPara.pTbl );
String sFml( MakeFormula( rCalcPara ));
SetValue( rCalcPara.rCalc.Calculate( sFml ).GetDouble() );
- ChgValid( !rCalcPara.IsStackOverFlow() ); // ist der Wert wieder gueltig?
+ ChgValid( !rCalcPara.IsStackOverFlow() ); // is the value again valid?
}
@@ -87,7 +87,7 @@ String SwTblField::GetFieldName() const
return aStr;
}
-// suche den TextNode, in dem das Feld steht
+/// search TextNode containing this field
const SwNode* SwTblField::GetNodeOfFormula() const
{
if( !GetTyp()->GetDepends() )
@@ -154,11 +154,6 @@ void SwTblField::SetValue( const double& rVal )
sExpand = ((SwValueFieldType*)GetTyp())->ExpandValue(rVal, GetFormat(), GetLanguage());
}
-/*--------------------------------------------------------------------
- Beschreibung: Parameter setzen
- --------------------------------------------------------------------*/
-
-
OUString SwTblField::GetPar2() const
{
return SwTableFormula::GetFormula();
diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx
index df7253b60bcb..969891d5298b 100644
--- a/sw/source/core/fields/usrfld.cxx
+++ b/sw/source/core/fields/usrfld.cxx
@@ -35,9 +35,7 @@
using namespace ::com::sun::star;
-/*--------------------------------------------------------------------
- Beschreibung: Benutzerfelder
- --------------------------------------------------------------------*/
+// Userfields
SwUserField::SwUserField(SwUserFieldType* pTyp, sal_uInt16 nSub, sal_uInt32 nFmt)
: SwValueField(pTyp, nFmt),
@@ -81,19 +79,13 @@ void SwUserField::SetValue( const double& rVal )
((SwUserFieldType*)GetTyp())->SetValue(rVal);
}
-/*--------------------------------------------------------------------
- Beschreibung: Name
- --------------------------------------------------------------------*/
-
+/// Get name
const OUString& SwUserField::GetPar1() const
{
return ((const SwUserFieldType*)GetTyp())->GetName();
}
-/*--------------------------------------------------------------------
- Beschreibung: Content
- --------------------------------------------------------------------*/
-
+/// Get content
OUString SwUserField::GetPar2() const
{
return ((SwUserFieldType*)GetTyp())->GetContent(GetFormat());
@@ -169,10 +161,6 @@ bool SwUserField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
return true;
}
-/*--------------------------------------------------------------------
- Beschreibung: Benutzerfeldtypen
- --------------------------------------------------------------------*/
-
SwUserFieldType::SwUserFieldType( SwDoc* pDocPtr, const String& aNam )
: SwValueFieldType( pDocPtr, RES_USERFLD ),
nValue( 0 ),
@@ -182,7 +170,7 @@ SwUserFieldType::SwUserFieldType( SwDoc* pDocPtr, const String& aNam )
aName = aNam;
if (nType & nsSwGetSetExpType::GSE_STRING)
- EnableFormat(sal_False); // Numberformatter nicht einsetzen
+ EnableFormat(sal_False); // Do not use a Numberformatter
}
String SwUserFieldType::Expand(sal_uInt32 nFmt, sal_uInt16 nSubType, sal_uInt16 nLng)
@@ -194,7 +182,7 @@ String SwUserFieldType::Expand(sal_uInt32 nFmt, sal_uInt16 nSubType, sal_uInt16
aStr = ExpandValue(nValue, nFmt, nLng);
}
else
- EnableFormat(sal_False); // Numberformatter nicht einsetzen
+ EnableFormat(sal_False); // Do not use a Numberformatter
return aStr;
}
@@ -222,7 +210,7 @@ void SwUserFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
ChgValid( sal_False );
NotifyClients( pOld, pNew );
- // und ggfs. am UserFeld haengende InputFelder updaten!
+ // update input fields that might be connected to the user field
GetDoc()->GetSysFldType( RES_INPUTFLD )->UpdateFlds();
}
@@ -324,10 +312,9 @@ bool SwUserFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
rAny >>= fVal;
nValue = fVal;
- // Folgende Zeile ist eigentlich falsch, da die Sprache unbekannt ist
- // (haengt am Feld) und aContent daher auch eigentlich ans Feld gehoeren
- // muesste. Jedes Feld kann eine andere Sprache, aber den gleichen Inhalt
- // haben, nur die Formatierung ist unterschiedlich.
+ // The following line is in fact wrong, since the language is unknown (is part of the
+ // field) and, thus, aContent should also belong to the field. Each field can have a
+ // differnt language, but the same content with just different formatting.
DoubleToString(aContent, nValue, (sal_uInt16)LANGUAGE_SYSTEM);
}
break;