sw/inc/hintids.hxx | 1 sw/source/core/txtnode/atrfld.cxx | 33 +++++++++--------------- sw/source/core/txtnode/atrftn.cxx | 49 ++++++++++++++++-------------------- sw/source/core/txtnode/atrref.cxx | 2 - sw/source/core/txtnode/atrtox.cxx | 6 +--- sw/source/core/txtnode/fntcap.cxx | 15 +++++------ sw/source/core/txtnode/ndhints.cxx | 30 +++++++++++----------- sw/source/core/txtnode/swfntcch.cxx | 5 +-- sw/source/core/txtnode/swfont.cxx | 42 +++++++++++++++--------------- sw/source/core/txtnode/txtatr2.cxx | 1 sw/source/core/txtnode/txtedt.cxx | 42 ++++++++++-------------------- 11 files changed, 97 insertions(+), 129 deletions(-)
New commits: commit d83329300a7781af23138347cc939d0977df5635 Author: Michael Stahl <mst...@redhat.com> Date: Sat Mar 4 20:12:52 2017 +0100 sw: translate german comments in atrftn.cxx Change-Id: I004dc0a28df0d5565e5096cf404584e6ea4e2925 diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx index 260adc0..5c8aa1e 100644 --- a/sw/source/core/txtnode/atrftn.cxx +++ b/sw/source/core/txtnode/atrftn.cxx @@ -197,14 +197,13 @@ void SwFormatFootnote::GetFootnoteText( OUString& rStr ) const } } - // returnt den anzuzeigenden String der Fuss-/Endnote +/// return the view string of the foot/endnote OUString SwFormatFootnote::GetViewNumStr( const SwDoc& rDoc, bool bInclStrings ) const { OUString sRet( GetNumStr() ); if( sRet.isEmpty() ) { - // dann ist die Nummer von Interesse, also ueber die Info diese - // besorgen. + // in this case the number is needed, get it via SwDoc's FootnoteInfo bool bMakeNum = true; const SwSectionNode* pSectNd = m_pTextAttr ? SwUpdFootnoteEndNtAtEnd::FindSectNdWithEndAttr( *m_pTextAttr ) @@ -276,9 +275,9 @@ void SwTextFootnote::SetStartNode( const SwNodeIndex *pNewNode, bool bDelNode ) } else if ( m_pStartNode ) { - // Zwei Dinge muessen erledigt werden: - // 1) Die Fussnoten muessen bei ihren Seiten abgemeldet werden - // 2) Die Fussnoten-Sektion in den Inserts muss geloescht werden. + // need to do 2 things: + // 1) unregister footnotes at their pages + // 2) delete the footnote section in the Inserts of the nodes-array SwDoc* pDoc; if ( m_pTextNode ) { @@ -286,39 +285,37 @@ void SwTextFootnote::SetStartNode( const SwNodeIndex *pNewNode, bool bDelNode ) } else { - //JP 27.01.97: der sw3-Reader setzt einen StartNode aber das - // Attribut ist noch nicht im TextNode verankert. - // Wird es geloescht (z.B. bei Datei einfuegen mit - // Footnote in einen Rahmen), muss auch der Inhalt - // geloescht werden + //JP 27.01.97: the sw3-Reader creates a StartNode but the + // attribute isn't anchored in the TextNode yet. + // If it is deleted (e.g. Insert File with footnote + // inside fly frame), the content must also be deleted. pDoc = m_pStartNode->GetNodes().GetDoc(); } - // Wir duerfen die Fussnotennodes nicht loeschen - // und brauchen die Fussnotenframes nicht loeschen, wenn - // wir im ~SwDoc() stehen. + // If called from ~SwDoc(), must not delete the footnote nodes, + // and not necessary to delete the footnote frames. if( !pDoc->IsInDtor() ) { if( bDelNode ) { - // 1) Die Section fuer die Fussnote wird beseitigt - // Es kann sein, dass die Inserts schon geloescht wurden. + // 2) delete the section for the footnote nodes + // it's possible that the Inserts have already been deleted (how???) pDoc->getIDocumentContentOperations().DeleteSection( &m_pStartNode->GetNode() ); } else - // Werden die Nodes nicht geloescht mussen sie bei den Seiten - // abmeldet (Frames loeschen) werden, denn sonst bleiben sie - // stehen (Undo loescht sie nicht!) + // If the nodes are not deleted, their frames must be removed + // from the page (deleted), there is nothing else that deletes + // them (particularly not Undo) DelFrames( nullptr ); } DELETEZ( m_pStartNode ); - // loesche die Fussnote noch aus dem Array am Dokument + // remove the footnote from the SwDoc's array for( size_t n = 0; n < pDoc->GetFootnoteIdxs().size(); ++n ) if( this == pDoc->GetFootnoteIdxs()[n] ) { pDoc->GetFootnoteIdxs().erase( pDoc->GetFootnoteIdxs().begin() + n ); - // gibt noch weitere Fussnoten + // if necessary, update following footnotes if( !pDoc->IsInDtor() && n < pDoc->GetFootnoteIdxs().size() ) { SwNodeIndex aTmp( pDoc->GetFootnoteIdxs()[n]->GetTextNode() ); @@ -349,7 +346,6 @@ void SwTextFootnote::SetNumber( const sal_uInt16 nNewNum, const OUString &sNumSt sal_uLong nEndIdx = m_pStartNode->GetNode().EndOfSectionIndex(); for( ; nSttIdx < nEndIdx; ++nSttIdx ) { - // Es koennen ja auch Grafiken in der Fussnote stehen ... SwNode* pNd; if( ( pNd = rNodes[ nSttIdx ] )->IsTextNode() ) static_cast<SwTextNode*>(pNd)->ModifyNotification( nullptr, &rFootnote ); @@ -357,7 +353,6 @@ void SwTextFootnote::SetNumber( const sal_uInt16 nNewNum, const OUString &sNumSt } } -// Die Fussnoten duplizieren void SwTextFootnote::CopyFootnote( SwTextFootnote & rDest, SwTextNode & rDestNode ) const @@ -401,13 +396,13 @@ void SwTextFootnote::CopyFootnote( } } - // lege eine neue leere TextSection fuer diese Fussnote an +/// create a new nodes-array section for the footnote void SwTextFootnote::MakeNewTextSection( SwNodes& rNodes ) { if ( m_pStartNode ) return; - // Nun verpassen wir dem TextNode noch die Fussnotenvorlage. + // set the footnote style on the SwTextNode SwTextFormatColl *pFormatColl; const SwEndNoteInfo* pInfo; sal_uInt16 nPoolId; @@ -454,8 +449,8 @@ void SwTextFootnote::DelFrames( const SwFrame* pSib ) } } } - //JP 13.05.97: falls das Layout vorm loeschen der Fussnoten entfernt - // wird, sollte man das ueber die Fussnote selbst tun + //JP 13.05.97: if the layout is deleted before the footnotes are deleted, + // try to delete the footnote's frames by another way if ( !bFrameFnd && m_pStartNode ) { SwNodeIndex aIdx( *m_pStartNode ); diff --git a/sw/source/core/txtnode/atrref.cxx b/sw/source/core/txtnode/atrref.cxx index 4bef9ea..dfe4af3 100644 --- a/sw/source/core/txtnode/atrref.cxx +++ b/sw/source/core/txtnode/atrref.cxx @@ -71,7 +71,7 @@ void SwFormatRefMark::InvalidateRefMark() NotifyClients(&item, &item); } -// Attribut fuer Inhalts-/Positions-Referenzen im Text +// attribute for content references in the text SwTextRefMark::SwTextRefMark( SwFormatRefMark& rAttr, sal_Int32 const nStartPos, sal_Int32 const*const pEnd) diff --git a/sw/source/core/txtnode/atrtox.cxx b/sw/source/core/txtnode/atrtox.cxx index 60eeb0f..819a8ac 100644 --- a/sw/source/core/txtnode/atrtox.cxx +++ b/sw/source/core/txtnode/atrtox.cxx @@ -61,8 +61,6 @@ void SwTextTOXMark::CopyTOXMark( SwDoc* pDoc ) const SwTOXType* pType = nullptr; const OUString rNm = rTOX.GetTOXType()->GetTypeName(); - // kein entsprechender Verzeichnistyp vorhanden -> anlegen - // sonst verwenden for(sal_uInt16 i=0; i < nCount; ++i) { const SwTOXType* pSrcType = pDoc->GetTOXType(eType, i); @@ -72,15 +70,15 @@ void SwTextTOXMark::CopyTOXMark( SwDoc* pDoc ) break; } } - // kein entsprechender Typ vorhanden -> neu erzeugen + // if the requested tox type does not exist, create it if(!pType) { pDoc->InsertTOXType( SwTOXType( eType, rNm ) ); pType = pDoc->GetTOXType(eType, 0); } - // Verzeichnistyp umhaengen + // register at target tox type const_cast<SwTOXType*>(pType)->Add( &rTOX ); } commit 942e30d5c102ec1fe65ac1bbe6f20a9f0b6851f5 Author: Michael Stahl <mst...@redhat.com> Date: Sat Mar 4 18:58:26 2017 +0100 sw: remove unused id RES_TXTATR_FLDCHG There is no evidence in git history of creating such a hint. Change-Id: Ie70b523835b2d1ecf34ae175af3e1d85fbaa5fc0 diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 0ce1f28..aef7161 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -299,7 +299,6 @@ RES_MSG_BEGIN = RES_FMT_END, RES_OBJECTDYING = RES_MSG_BEGIN, // 158 RES_FMT_CHG, RES_ATTRSET_CHG, - RES_TXTATR_FLDCHG, RES_INS_TXT, RES_DEL_CHR, RES_DEL_TXT, diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index 27f8570..70a2008 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -251,10 +251,6 @@ void SwFormatField::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { switch( pNew->Which() ) { - case RES_TXTATR_FLDCHG: - // this, this -> just repaint it - pTextNd->ModifyNotification( this, this ); - return; case RES_REFMARKFLD_UPDATE: // update GetRef fields if( RES_GETREFFLD == GetField()->GetTyp()->Which() ) commit 05df5cd894ff31d324beed51b2e31a8c186a3cf6 Author: Michael Stahl <mst...@redhat.com> Date: Sat Mar 4 18:51:28 2017 +0100 sw: translate german comments in atrfld.cxx Change-Id: Ice0e1410e5577ceccb32b252c26aff019ffbd194 diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx index ed8f0db..27f8570 100644 --- a/sw/source/core/txtnode/atrfld.cxx +++ b/sw/source/core/txtnode/atrfld.cxx @@ -118,12 +118,12 @@ SwFormatField::~SwFormatField() SwFieldType* pType = mpField ? mpField->GetTyp() : nullptr; if (pType && pType->Which() == RES_DBFLD) - pType = nullptr; // DB-Feldtypen zerstoeren sich selbst + pType = nullptr; // DB field types destroy themselves Broadcast( SwFormatFieldHint( this, SwFormatFieldHintWhich::REMOVED ) ); delete mpField; - // bei einige FeldTypen muessen wir den FeldTypen noch loeschen + // some fields need to delete their field type if( pType && pType->HasOnlyOneListener() ) { bool bDel = false; @@ -144,7 +144,7 @@ SwFormatField::~SwFormatField() if( bDel ) { - // vorm loeschen erstmal austragen + // unregister before deleting pType->Remove( this ); delete pType; } @@ -252,12 +252,11 @@ void SwFormatField::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) switch( pNew->Which() ) { case RES_TXTATR_FLDCHG: - // "Farbe hat sich geaendert !" - // this, this fuer "nur Painten" + // this, this -> just repaint it pTextNd->ModifyNotification( this, this ); return; case RES_REFMARKFLD_UPDATE: - // GetReferenz-Felder aktualisieren + // update GetRef fields if( RES_GETREFFLD == GetField()->GetTyp()->Which() ) { // #i81002# @@ -265,7 +264,7 @@ void SwFormatField::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) } break; case RES_DOCPOS_UPDATE: - // Je nach DocPos aktualisieren (SwTextFrame::Modify()) + // handled in SwTextFrame::Modify() pTextNd->ModifyNotification( pNew, this ); return; @@ -383,7 +382,6 @@ void SwTextField::ExpandTextField(const bool bForceNotify) const if (aNewExpand == m_aExpand) { - // Bei Seitennummernfeldern const sal_uInt16 nWhich = pField->GetTyp()->Which(); if ( RES_CHAPTERFLD != nWhich && RES_PAGENUMBERFLD != nWhich @@ -423,9 +421,8 @@ void SwTextField::CopyTextField( SwTextField *pDest ) const if( pIDFA != pDestIDFA ) { - // Die Hints stehen in unterschiedlichen Dokumenten, - // der Feldtyp muss im neuen Dokument angemeldet werden. - // Z.B: Kopieren ins ClipBoard. + // different documents, e.g. clipboard: + // register field type in target document SwFieldType* pFieldType; if( nFieldWhich != RES_DBFLD && nFieldWhich != RES_USERFLD @@ -440,7 +437,7 @@ void SwTextField::CopyTextField( SwTextField *pDest ) const pFieldType = pDestIDFA->InsertFieldType( *rDestFormatField.GetField()->GetTyp() ); } - // Sonderbehandlung fuer DDE-Felder + // DDE fields need special treatment if( RES_DDEFLD == nFieldWhich ) { if( rDestFormatField.GetTextField() ) @@ -451,11 +448,11 @@ void SwTextField::CopyTextField( SwTextField *pDest ) const } OSL_ENSURE( pFieldType, "unknown FieldType" ); - pFieldType->Add( &rDestFormatField ); // ummelden + pFieldType->Add( &rDestFormatField ); // register at the field type rDestFormatField.GetField()->ChgTyp( pFieldType ); } - // Expressionfelder Updaten + // update expression fields if( nFieldWhich == RES_SETEXPFLD || nFieldWhich == RES_GETEXPFLD || nFieldWhich == RES_HIDDENTXTFLD ) @@ -463,13 +460,13 @@ void SwTextField::CopyTextField( SwTextField *pDest ) const SwTextField* pField = const_cast<SwTextField*>(this); pDestIDFA->UpdateExpFields( pField, true ); } - // Tabellenfelder auf externe Darstellung + // table fields: external display else if( RES_TABLEFLD == nFieldWhich && static_cast<SwTableField*>(rDestFormatField.GetField())->IsIntrnlName() ) { - // erzeuge aus der internen (fuer CORE) die externe (fuer UI) Formel + // convert internal (core) to external (UI) formula const SwTableNode* pTableNd = m_pTextNode->FindTableNode(); - if( pTableNd ) // steht in einer Tabelle + if( pTableNd ) // in a table? static_cast<SwTableField*>(rDestFormatField.GetField())->PtrToBoxNm( &pTableNd->GetTable() ); } } commit 025889f7081e78626d67fc3083bc268dbf268b39 Author: Michael Stahl <mst...@redhat.com> Date: Fri Mar 3 23:50:13 2017 +0100 sw: translate german comments in fntcap.cxx Change-Id: I14a549e81025bd978efe930812f919d40fd57783 diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index 5586243..8b62ddc 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -303,8 +303,8 @@ void SwDoDrawCapital::DrawSpace( Point &rPos ) void SwSubFont::DrawCapital( SwDrawTextInfo &rInf ) { - // Es wird vorausgesetzt, dass rPos bereits kalkuliert ist! - // hochgezogen in SwFont: const Point aPos( CalcPos(rPos) ); + // Precondition: rInf.GetPos() has already been calculated + rInf.SetDrawSpace( GetUnderline() != LINESTYLE_NONE || GetOverline() != LINESTYLE_NONE || GetStrikeout() != STRIKEOUT_NONE ); @@ -409,7 +409,7 @@ void SwDoDrawStretchCapital::Do() if( rInf.GetLen() ) { - // 4023: Kapitaelchen und Kerning. + // small caps and kerning long nDiff = long(nOrgWidth) - long(nCapWidth); if( nDiff ) { @@ -432,7 +432,7 @@ void SwDoDrawStretchCapital::Do() if ( rInf.GetFrame()->IsVertical() ) rInf.GetFrame()->SwitchHorizontalToVertical( aPos ); - // Optimierung: + // Optimise: if( 1 >= rInf.GetLen() ) GetOut().DrawText( aPos, rInf.GetText(), rInf.GetIdx(), rInf.GetLen() ); @@ -445,8 +445,7 @@ void SwDoDrawStretchCapital::Do() void SwSubFont::DrawStretchCapital( SwDrawTextInfo &rInf ) { - // Es wird vorausgesetzt, dass rPos bereits kalkuliert ist! - // hochgezogen in SwFont: const Point aPos( CalcPos(rPos) ); + // Precondition: rInf.GetPos() has already been calculated if( rInf.GetLen() == COMPLETE_STRING ) rInf.SetLen( rInf.GetText().getLength() ); @@ -516,7 +515,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) else pSpaceFont = pLastFont; - // Wir basteln uns einen Font fuer die Grossbuchstaben: + // Construct a font for the capitals: aFont.SetUnderline( LINESTYLE_NONE ); aFont.SetOverline( LINESTYLE_NONE ); aFont.SetStrikeout( STRIKEOUT_NONE ); @@ -732,7 +731,7 @@ void SwSubFont::DoOnCapitals( SwDoCapitals &rDo ) #endif } - // Aufraeumen: + // clean up: if( pBigFont != pOldLast ) delete pBigFontAccess; commit 9211b3001fca6e22b9ed6034e3cd661a6df3b6f6 Author: Michael Stahl <mst...@redhat.com> Date: Fri Mar 3 23:35:34 2017 +0100 sw: translate german comments in ndhints.cxx Change-Id: Ie33be6872b8b6c5bdd1481205ff2930b40438dff diff --git a/sw/source/core/txtnode/ndhints.cxx b/sw/source/core/txtnode/ndhints.cxx index 01e6f90..9d727a4 100644 --- a/sw/source/core/txtnode/ndhints.cxx +++ b/sw/source/core/txtnode/ndhints.cxx @@ -27,9 +27,8 @@ #include <set> #endif -// Sortierreihenfolge: Start, Ende (umgekehrt!), Which-Wert (umgekehrt!), -// als letztes die Adresse selbst - +/// sort order: Start, End (reverse), Which (reverse), +/// (char style: sort number), at last the pointer static bool lcl_IsLessStart( const SwTextAttr &rHt1, const SwTextAttr &rHt2 ) { if ( rHt1.GetStart() == rHt2.GetStart() ) @@ -62,7 +61,8 @@ static bool lcl_IsLessStart( const SwTextAttr &rHt1, const SwTextAttr &rHt2 ) return ( rHt1.GetStart() < rHt2.GetStart() ); } -// Zuerst nach Ende danach nach Ptr +/// sort order: End (reverse), Start, Which (reverse), +/// (char style: sort number), at last the pointer static bool lcl_IsLessEnd( const SwTextAttr &rHt1, const SwTextAttr &rHt2 ) { const sal_Int32 nHt1 = *rHt1.GetAnyEnd(); @@ -144,7 +144,7 @@ bool SwpHints::Contains( const SwTextAttr *pHt ) const bool SwpHints::Check(bool bPortionsMerged) const { - // 1) gleiche Anzahl in beiden Arrays + // 1) both arrays have same size CHECK_ERR( m_HintsByStart.size() == m_HintsByEnd.size(), "HintsCheck: wrong sizes" ); sal_Int32 nLastStart = 0; @@ -172,49 +172,49 @@ bool SwpHints::Check(bool bPortionsMerged) const for( size_t i = 0; i < Count(); ++i ) { - // --- Start-Kontrolle --- + // --- check Starts --- - // 2a) gueltiger Pointer? vgl. DELETEFF + // 2a) valid pointer? depends on overwriting freed mem with 0xFF const SwTextAttr *pHt = m_HintsByStart[i]; CHECK_ERR( 0xFF != *reinterpret_cast<unsigned char const *>(pHt), "HintsCheck: start ptr was deleted" ); - // 3a) Stimmt die Start-Sortierung? + // 3a) start sort order? sal_Int32 nIdx = pHt->GetStart(); CHECK_ERR( nIdx >= nLastStart, "HintsCheck: starts are unsorted" ); - // 4a) IsLessStart-Konsistenz + // 4a) IsLessStart consistency if( pLastStart ) CHECK_ERR( lcl_IsLessStart( *pLastStart, *pHt ), "HintsCheck: IsLastStart" ); nLastStart = nIdx; pLastStart = pHt; - // --- End-Kontrolle --- + // --- check Ends --- // 2b) gueltiger Pointer? vgl. DELETEFF const SwTextAttr *pHtEnd = m_HintsByEnd[i]; CHECK_ERR( 0xFF != *reinterpret_cast<unsigned char const *>(pHtEnd), "HintsCheck: end ptr was deleted" ); - // 3b) Stimmt die End-Sortierung? + // 3b) end sort order? nIdx = *pHtEnd->GetAnyEnd(); CHECK_ERR( nIdx >= nLastEnd, "HintsCheck: ends are unsorted" ); - // 4b) IsLessEnd-Konsistenz + // 4b) IsLessEnd consistency if( pLastEnd ) CHECK_ERR( lcl_IsLessEnd( *pLastEnd, *pHtEnd ), "HintsCheck: IsLastEnd" ); nLastEnd = nIdx; pLastEnd = pHtEnd; - // --- Ueberkreuzungen --- + // --- cross checks --- - // 5) gleiche Pointer in beiden Arrays + // 5) same pointers in both arrays if (m_HintsByStart.find(const_cast<SwTextAttr*>(pHt)) == m_HintsByStart.end()) nIdx = COMPLETE_STRING; CHECK_ERR( COMPLETE_STRING != nIdx, "HintsCheck: no GetStartOf" ); - // 6) gleiche Pointer in beiden Arrays + // 6) same pointers in both arrays if (m_HintsByEnd.find(const_cast<SwTextAttr*>(pHt)) == m_HintsByEnd.end()) nIdx = COMPLETE_STRING; commit 98fd4a896f62eb81929a7c67de4a55dffdce1b69 Author: Michael Stahl <mst...@redhat.com> Date: Fri Mar 3 23:25:21 2017 +0100 sw: translate german comments in swfont.cxx Change-Id: Ic8944b96bfaa57ef87373e47bdd60ba30d183b39 diff --git a/sw/source/core/txtnode/swfntcch.cxx b/sw/source/core/txtnode/swfntcch.cxx index a3bd774..9e938dc 100644 --- a/sw/source/core/txtnode/swfntcch.cxx +++ b/sw/source/core/txtnode/swfntcch.cxx @@ -22,11 +22,10 @@ #include "fmtcol.hxx" #include "swfont.hxx" -// aus atrstck.cxx +// from atrstck.cxx extern const sal_uInt8 StackPos[]; -// globale Variablen, werden in SwFntCch.Hxx bekanntgegeben -// Der FontCache wird in TextInit.Cxx _TXTINIT erzeugt und in _TXTEXIT geloescht +// FontCache is created in txtinit.cxx TextInit_ and deleted in TextFinit SwFontCache *pSwFontCache = nullptr; SwFontObj::SwFontObj( const void *pOwn, SwViewShell *pSh ) : diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 5644ee3..8f99dea 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -66,7 +66,7 @@ SvStatistics g_SvStat; using namespace ::com::sun::star; -// Hintergrundbrush setzen, z.B. bei Zeichenvorlagen +// set background brush, depending on character formatting void SwFont::SetBackColor( Color* pNewColor ) { m_pBackColor.reset( pNewColor ); @@ -438,32 +438,32 @@ void SwFont::SetVertical( sal_uInt16 nDir, const bool bVertFormat ) /* Escapement: - frEsc: Fraction, Grad des Escapements - Esc = resultierendes Escapement - A1 = Original-Ascent (nOrgAscent) - A2 = verkleinerter Ascent (nEscAscent) - Ax = resultierender Ascent (GetAscent()) - H1 = Original-Hoehe (nOrgHeight) - H2 = verkleinerter Hoehe (nEscHeight) - Hx = resultierender Hoehe (GetHeight()) - Bx = resultierende Baseline fuer die Textausgabe (CalcPos()) - (Vorsicht: Y - A1!) + frEsc: Fraction, ratio of Escapements + Esc = resulting Escapement + A1 = original Ascent (nOrgAscent) + A2 = shrunk Ascent (nEscAscent) + Ax = resulting Ascent (GetAscent()) + H1 = original Height (nOrgHeight) + H2 = shrunk Height (nEscHeight) + Hx = resulting Height (GetHeight()) + Bx = resulting Baseline for Text (CalcPos()) + (Attention: Y - A1!) Escapement: Esc = H1 * frEsc; - Hochstellung: + Superscript: Ax = A2 + Esc; Hx = H2 + Esc; Bx = A1 - Esc; - Tiefstellung: + Subscript: Ax = A1; Hx = A1 + Esc + (H2 - A2); Bx = A1 + Esc; */ -// nEsc ist der Prozentwert +// nEsc ist the percentage sal_uInt16 SwSubFont::CalcEscAscent( const sal_uInt16 nOldAscent ) const { if( DFLT_ESC_AUTO_SUPER != GetEscapement() && @@ -756,7 +756,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, m_aSub[SwFontScript::Latin].SetStyleName( rFont.GetStyleName() ); m_aSub[SwFontScript::Latin].SetPitch( rFont.GetPitch() ); m_aSub[SwFontScript::Latin].SetCharSet( rFont.GetCharSet() ); - m_aSub[SwFontScript::Latin].SvxFont::SetPropr( 100 ); // 100% der FontSize + m_aSub[SwFontScript::Latin].SvxFont::SetPropr( 100 ); // 100% of FontSize Size aTmpSize = m_aSub[SwFontScript::Latin].m_aSize; aTmpSize.Height() = pAttrSet->GetSize().GetHeight(); m_aSub[SwFontScript::Latin].SetSize( aTmpSize ); @@ -772,7 +772,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, m_aSub[SwFontScript::CJK].SetStyleName( rFont.GetStyleName() ); m_aSub[SwFontScript::CJK].SetPitch( rFont.GetPitch() ); m_aSub[SwFontScript::CJK].SetCharSet( rFont.GetCharSet() ); - m_aSub[SwFontScript::CJK].SvxFont::SetPropr( 100 ); // 100% der FontSize + m_aSub[SwFontScript::CJK].SvxFont::SetPropr( 100 ); // 100% of FontSize Size aTmpSize = m_aSub[SwFontScript::CJK].m_aSize; aTmpSize.Height() = pAttrSet->GetCJKSize().GetHeight(); m_aSub[SwFontScript::CJK].SetSize( aTmpSize ); @@ -792,7 +792,7 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, m_aSub[SwFontScript::CTL].SetStyleName( rFont.GetStyleName() ); m_aSub[SwFontScript::CTL].SetPitch( rFont.GetPitch() ); m_aSub[SwFontScript::CTL].SetCharSet( rFont.GetCharSet() ); - m_aSub[SwFontScript::CTL].SvxFont::SetPropr( 100 ); // 100% der FontSize + m_aSub[SwFontScript::CTL].SvxFont::SetPropr( 100 ); // 100% of FontSize Size aTmpSize = m_aSub[SwFontScript::CTL].m_aSize; aTmpSize.Height() = pAttrSet->GetCTLSize().GetHeight(); m_aSub[SwFontScript::CTL].SetSize( aTmpSize ); @@ -1053,8 +1053,8 @@ sal_uInt16 SwSubFont::GetHeight( SwViewShell *pSh, const OutputDevice& rOut ) Size SwSubFont::GetTextSize_( SwDrawTextInfo& rInf ) { - // Robust: Eigentlich sollte der Font bereits eingestellt sein, aber - // sicher ist sicher ... + // Robust: the font is supposed to be set already, but better safe than + // sorry... if ( !pLastFont || pLastFont->GetOwner()!=m_pMagic || !IsSameInstance( rInf.GetpOut()->GetFont() ) ) ChgFnt( rInf.GetShell(), rInf.GetOut() ); @@ -1110,8 +1110,8 @@ Size SwSubFont::GetTextSize_( SwDrawTextInfo& rInf ) } rInf.SetKern( nOldKern ); rInf.SetText(oldText); - // 15142: Ein Wort laenger als eine Zeile, beim Zeilenumbruch - // hochgestellt, muss seine effektive Hoehe melden. + // A word that's longer than one line, with escapement at the line + // break, must report its effective height. if( GetEscapement() ) { const sal_uInt16 nAscent = pLastFont->GetFontAscent( rInf.GetShell(), diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index 244e8cd..cc2082e 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -183,7 +183,6 @@ void SwTextINetFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew } } - // erfrage vom Modify Informationen bool SwTextINetFormat::GetInfo( SfxPoolItem& rInfo ) const { if ( RES_AUTOFMT_DOCNODE != rInfo.Which() || !m_pTextNode || commit 87deb46640a0dc7acf230803a09d52a0366896d4 Author: Michael Stahl <mst...@redhat.com> Date: Fri Mar 3 23:10:20 2017 +0100 sw: translate german comments in txtedt.cxx Change-Id: Id30445a2370946bdad274c90d777f98d06a7b3ac diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index b4d884e..5b5e447 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -99,7 +99,7 @@ struct SwParaIdleData_Impl SwTextNode::WrongState eWrongDirty; ///< online spell checking needed/done? bool bGrammarCheckDirty; bool bSmartTagDirty; - bool bAutoComplDirty; // die ACompl-Liste muss angepasst werden + bool bAutoComplDirty; ///< auto complete list dirty SwParaIdleData_Impl() : pWrong ( nullptr ), @@ -688,12 +688,10 @@ sal_Int32 clipIndexBounds(const OUString &rStr, sal_Int32 nPos) return nPos; } -// Aktuelles Wort zurueckliefern: -// Wir suchen immer von links nach rechts, es wird also das Wort -// vor nPos gesucht. Es sei denn, wir befinden uns am Anfang des -// Absatzes, dann wird das erste Wort zurueckgeliefert. -// Wenn dieses erste Wort nur aus Whitespaces besteht, returnen wir -// einen leeren String. +// Return current word: +// Search from left to right, so find the word before nPos. +// Except if at the start of the paragraph, then return the first word. +// If the first word consists only of whitespace, return an empty string. OUString SwTextNode::GetCurWord( sal_Int32 nPos ) const { assert(nPos <= m_Text.getLength()); // invalid index @@ -961,11 +959,9 @@ bool SwScanner::NextWord() return true; } +// Note: this is a clone of SwTextFrame::AutoSpell_, so keep them in sync when fixing things! bool SwTextNode::Spell(SwSpellArgs* pArgs) { - // Die Aehnlichkeiten zu SwTextFrame::AutoSpell_ sind beabsichtigt ... - // ACHTUNG: Ev. Bugs in beiden Routinen fixen! - // modify string according to redline information and hidden text const OUString aOldText( m_Text ); OUStringBuffer buf(m_Text); @@ -1258,8 +1254,7 @@ bool SwTextNode::Convert( SwConversionArgs &rArgs ) return !rArgs.aConvText.isEmpty(); } -// Die Aehnlichkeiten zu SwTextNode::Spell sind beabsichtigt ... -// ACHTUNG: Ev. Bugs in beiden Routinen fixen! +// Note: this is a clone of SwTextNode::Spell, so keep them in sync when fixing things! SwRect SwTextFrame::AutoSpell_( const SwContentNode* pActNode, sal_Int32 nActPos ) { SwRect aRect; @@ -1268,8 +1263,6 @@ SwRect SwTextFrame::AutoSpell_( const SwContentNode* pActNode, sal_Int32 nActPos if ( bStop ) return aRect; #endif - // Die Aehnlichkeiten zu SwTextNode::Spell sind beabsichtigt ... - // ACHTUNG: Ev. Bugs in beiden Routinen fixen! SwTextNode *pNode = GetTextNode(); if( pNode != pActNode || !nActPos ) nActPos = COMPLETE_STRING; @@ -1572,7 +1565,6 @@ SwRect SwTextFrame::SmartTagScan( SwContentNode* /*pActNode*/, sal_Int32 /*nActP return aRet; } -// Wird vom CollectAutoCmplWords gerufen void SwTextFrame::CollectAutoCmplWrds( SwContentNode* pActNode, sal_Int32 nActPos ) { SwTextNode *pNode = GetTextNode(); @@ -1622,10 +1614,10 @@ void SwTextFrame::CollectAutoCmplWrds( SwContentNode* pActNode, sal_Int32 nActPo pNode->SetAutoCompleteWordDirty( false ); } -/** Findet den TextFrame und sucht dessen CalcHyph */ +/// Find the SwTextFrame and call its Hyphenate bool SwTextNode::Hyphenate( SwInterHyphInfo &rHyphInf ) { - // Abkuerzung: am Absatz ist keine Sprache eingestellt: + // shortcut: paragraph doesn't have a language set: if ( LANGUAGE_NONE == sal_uInt16( GetSwAttrSet().GetLanguage().GetLanguage() ) && USHRT_MAX == GetLang(0, m_Text.getLength())) { @@ -1644,9 +1636,9 @@ bool SwTextNode::Hyphenate( SwInterHyphInfo &rHyphInf ) pFrame = &(pFrame->GetFrameAtOfst( rHyphInf.nStart )); else { - // 4935: Seit der Trennung ueber Sonderbereiche sind Faelle - // moeglich, in denen kein Frame zum Node vorliegt. - // Also keinOSL_ENSURE + // There was a comment here that claimed that the following assertion + // shouldn't exist as it's triggered by "Trennung ueber Sonderbereiche", + // whatever that means. OSL_ENSURE( pFrame, "!SwTextNode::Hyphenate: can't find any frame" ); return false; } @@ -1655,9 +1647,8 @@ bool SwTextNode::Hyphenate( SwInterHyphInfo &rHyphInf ) { if( pFrame->Hyphenate( rHyphInf ) ) { - // Das Layout ist nicht robust gegen "Direktformatierung" - // (7821, 7662, 7408); vgl. layact.cxx, - // SwLayAction::TurboAction_(), if( !pCnt->IsValid() ... + // The layout is not robust wrt. "direct formatting" + // cf. layact.cxx, SwLayAction::TurboAction_(), if( !pCnt->IsValid() ... pFrame->SetCompletePaint(); return true; } commit a242eb3dd1550deb655bfd9c23a013bf01186f0a Author: Michael Stahl <mst...@redhat.com> Date: Fri Mar 3 22:44:32 2017 +0100 sw: remove unused declarations Change-Id: I3da3aa0823c5a37dd207778c6a825da0ab189766 diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 32a036e..b4d884e 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -86,11 +86,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::linguistic2; using namespace ::com::sun::star::smarttags; -// Wir ersparen uns in Hyphenate ein GetFrame() -// Achtung: in edlingu.cxx stehen die Variablen! -extern const SwTextNode *pLinguNode; -extern SwTextFrame *pLinguFrame; - struct SwParaIdleData_Impl { SwWrongList* pWrong; // for spell checking _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits