From 72778119fde55218354ee100481bfad2a1cedf35 Mon Sep 17 00:00:00 2001 From: Alexander Wilms Date: Fri, 3 Aug 2012 10:22:14 +0200 Subject: Translated German comments in starmath (fdo#39468) Change-Id: If3be0db9213c405525f01c92aa4dd039e3aa6aad Reviewed-by: Philipp Riemer --- starmath/source/accessibility.cxx | 6 +- starmath/source/config.cxx | 3 +- starmath/source/dialog.cxx | 134 +++++++++++++++++--------------------- starmath/source/document.cxx | 24 +++---- starmath/source/edit.cxx | 16 ++--- starmath/source/node.cxx | 133 ++++++++++++++++--------------------- 6 files changed, 139 insertions(+), 177 deletions(-) diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index a7b39bcc8b9f..b271773f332c 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -572,12 +572,12 @@ sal_Int32 SAL_CALL SmGraphicAccessible::getIndexAtPoint( const awt::Point& aPoin if (pWin) { const SmNode *pTree = pWin->GetView()->GetDoc()->GetFormulaTree(); - //! kann NULL sein! ZB wenn bereits beim laden des Dokuments (bevor der - //! Parser angeworfen wurde) ins Fenster geklickt wird. + // can be NULL! e.g. if one clicks within the window already during loading of the + // document (before the parser even started) if (!pTree) return nRes; - // get position relativ to formula draw position + // get position relative to formula draw position Point aPos( aPoint.X, aPoint.Y ); aPos = pWin->PixelToLogic( aPos ); aPos -= pWin->GetFormulaDrawPos(); diff --git a/starmath/source/config.cxx b/starmath/source/config.cxx index 533dd8c6a481..15934d699238 100644 --- a/starmath/source/config.cxx +++ b/starmath/source/config.cxx @@ -82,8 +82,7 @@ void SmConfig::ItemSetToConfig(const SfxItemSet &rSet) { SetIgnoreSpacesRight( bVal ); - // (angezeigte) Formeln muessen entsprechen neu formatiert werden. - // Das erreichen wir mit: + // reformat (displayed) formulas accordingly Broadcast(SfxSimpleHint(HINT_FORMATCHANGED)); } } diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 532ed8a75bed..7edd2e163b8b 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -53,12 +53,9 @@ using ::rtl::OUString; -//////////////////////////////////////// -// -// Da der FontStyle besser ueber die Attribute gesetzt/abgefragt wird als ueber -// den StyleName bauen wir uns hier unsere eigene Uebersetzung +// Since it's better to set/query the FontStyle via its attributes rather +// than via the StyleName we create a way to translate // Attribute <-> StyleName -// class SmFontStyles { @@ -135,8 +132,8 @@ const SmFontStyles & GetFontStyles() void SetFontStyle(const XubString &rStyleName, Font &rFont) { - // finden des Index passend zum StyleName fuer den leeren StyleName wird - // 0 (nicht bold nicht italic) angenommen. + // Find index related to StyleName. For an empty StyleName it's assumed to be + // 0 (neither bold nor italic). sal_uInt16 nIndex = 0; if (rStyleName.Len()) { @@ -801,9 +798,8 @@ IMPL_LINK( SmDistanceDialog, CheckBoxClickHdl, CheckBox *, pCheckBox ) void SmDistanceDialog::SetHelpId(MetricField &rField, const rtl::OString& sHelpId) { - //! HelpID's die auf diese Weise explizit gesetzt werden, muessen im - //! util Verzeichnis im File "hidother.src" mit Hilfe von "hidspecial" - //! definiert werden! + // HelpIDs which are explicitly set in this way have to be defined in the + // util directory in the file "hidother.src" with the help of "hidspecial"! const XubString aEmptyText; #if OSL_DEBUG_LEVEL > 1 @@ -862,8 +858,8 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) SmCategoryDesc *pCat; - // merken der (evtl neuen) Einstellungen der aktiven SmCategoryDesc - // bevor zu der neuen gewechselt wird. + // remember the (maybe new) settings of the active SmCategoryDesc + // before switching to the new one if (nActiveCategory != CATEGORY_NONE) { pCat = Categories[nActiveCategory]; @@ -878,16 +874,15 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) aMenuButton.GetPopupMenu()->CheckItem(nActiveCategory + 1, false); } - // aktivieren/deaktivieren der zugehoerigen Controls in Abhaengigkeit von der - // gewaehlten Kategorie. + // activation/deactivation of the associated controls depending on the chosen category bool bActive; for (sal_uInt16 i = 0; i < 4; i++) { FixedText *pFT = (FixedText * const) aWin[i][0]; MetricField *pMF = (MetricField * const) aWin[i][1]; - // Um feststellen welche Controls aktiv sein sollen wird das - // vorhandensein einer zugehoerigen HelpID ueberprueft. + // To determine which Controls should be active, the existence + // of an associated HelpID is checked bActive = aCatMf2Hid[nCategory][i] != 0; pFT->Show(bActive); @@ -895,7 +890,7 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) pMF->Show(bActive); pMF->Enable(bActive); - // setzen von Masseinheit und Anzahl der Nachkommastellen + // set measurement unit and number of decimal places FieldUnit eUnit; sal_uInt16 nDigits; if (nCategory < 9) @@ -909,7 +904,7 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) eUnit = FUNIT_100TH_MM; nDigits = 2; } - pMF->SetUnit(eUnit); //! veraendert den Wert + pMF->SetUnit(eUnit); // changes the value pMF->SetDecimalDigits(nDigits); if (bActive) @@ -924,8 +919,7 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory) SetHelpId(*pMF, aCatMf2Hid[nCategory][i]); } } - // nun noch die CheckBox und das zugehoerige MetricField genau dann aktivieren, - // falls es sich um das Klammer Menu handelt. + // activate the CheckBox and the associated MetricField if we're dealing with the brackets menu bActive = nCategory == 5; aCheckBox1.Show(bActive); aCheckBox1.Enable(bActive); @@ -1041,8 +1035,8 @@ void SmDistanceDialog::ReadFrom(const SmFormat &rFormat) void SmDistanceDialog::WriteTo(SmFormat &rFormat) /*const*/ { - // hmm... koennen die tatsaechlich unterschiedlich sein? - // wenn nicht kann oben naemlich das const stehen! + // TODO can they actually be different? + // if that's not the case 'const' could be used above! SetCategory(nActiveCategory); rFormat.SetDistance( DIS_HORIZONTAL, Categories[0]->GetValue(0) ); @@ -1171,7 +1165,7 @@ void SmShowSymbolSet::Paint(const Rectangle&) { Push(PUSH_MAPMODE); - // MapUnit einstellen fuer die 'nLen' berechnet wurde + // set MapUnit for which 'nLen' has been calculated SetMapMode(MapMode(MAP_PIXEL)); sal_uInt16 v = sal::static_int_cast< sal_uInt16 >((aVScrollBar.GetThumbPos() * nColumns)); @@ -1184,8 +1178,8 @@ void SmShowSymbolSet::Paint(const Rectangle&) Font aFont (aSymbol.GetFace()); aFont.SetAlign(ALIGN_TOP); - // etwas kleinere FontSize nehmen (als nLen) um etwas Luft zu haben - // (hoffentlich auch genug fuer links und rechts!) + // taking a FontSize which is a bit smaller (compared to nLen) in order to have a buffer + // (hopefully enough for left and right, too) aFont.SetSize(Size(0, nLen - (nLen / 3))); SetFont(aFont); // keep text color @@ -1282,7 +1276,7 @@ SmShowSymbolSet::SmShowSymbolSet(Window *pParent, const ResId& rResId) : long nScrollBarWidth = aVScrollBar.GetSizePixel().Width(), nUseableWidth = aOutputSize.Width() - nScrollBarWidth; - // Hoehe von 16pt in Pixeln (passend zu 'aOutputSize') + // Height of 16pt in pixels (matching 'aOutputSize') nLen = (sal_uInt16) LogicToPixel(Size(0, 16), MapMode(MAP_POINT)).Height(); nColumns = sal::static_int_cast< sal_uInt16 >(nUseableWidth / nLen); @@ -1294,7 +1288,7 @@ SmShowSymbolSet::SmShowSymbolSet(Window *pParent, const ResId& rResId) : OSL_ENSURE(nRows > 0, "Sm : no rows"); #endif - // genau passend machen + // make it fit exactly aOutputSize.Width() = nColumns * nLen; aOutputSize.Height() = nRows * nLen; @@ -1397,9 +1391,8 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol) SetText( aText ); } - // 'Invalidate' fuellt den background mit der background-Farbe. - // Falls der NULL pointer uebergeben wurde reicht dies also zum loeschen - // der Anzeige + // 'Invalidate' fills the background with the background color. + // If a NULL pointer has been passed that's already enough to clear the display Invalidate(); } @@ -1407,8 +1400,8 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol) //////////////////////////////////////////////////////////////////////////////// void SmSymbolDialog::FillSymbolSets(bool bDeleteText) - // fuellt die Eintraege der moeglichen 'SymbolsSet's im Dialog mit den - // aktuellen Werten des SymbolSet Managers, selektiert aber keinen. + // populate the entries of possible SymbolsSets in the dialog with + // current values of the SymbolSet manager but selects none of those { aSymbolSets.Clear(); if (bDeleteText) @@ -1453,7 +1446,7 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG pButton ) SmSymDefineDialog *pDialog = new SmSymDefineDialog(this, pFontListDev, rSymbolMgr); - // aktuelles Symbol und SymbolSet am neuen Dialog setzen + // set current symbol and SymbolSet for the new dialog const XubString aSymSetName (aSymbolSets.GetSelectEntry()), aSymName (aSymbolName.GetText()); pDialog->SelectOldSymbolSet(aSymSetName); @@ -1461,20 +1454,19 @@ IMPL_LINK( SmSymbolDialog, EditClickHdl, Button *, EMPTYARG pButton ) pDialog->SelectSymbolSet(aSymSetName); pDialog->SelectSymbol(aSymName); - // altes SymbolSet merken + // remember old SymbolSet XubString aOldSymbolSet (aSymbolSets.GetSelectEntry()); sal_uInt16 nSymPos = GetSelectedSymbol(); - // Dialog an evtl geaenderte Daten des SymbolSet Manager anpassen + // adapt dialog to data of the SymbolSet manager, which might have changed if (pDialog->Execute() == RET_OK && rSymbolMgr.IsModified()) { rSymbolMgr.Save(); FillSymbolSets(); } - // wenn das alte SymbolSet nicht mehr existiert zum ersten gehen - // (soweit eines vorhanden ist) + // if the old SymbolSet doesn't exist anymore, go to the first one SymbolSet (if one exists) if (!SelectSymbolSet(aOldSymbolSet) && aSymbolSets.GetEntryCount() > 0) SelectSymbolSet(aSymbolSets.GetEntry(0)); else @@ -1772,9 +1764,9 @@ void SmSymDefineDialog::FillFonts(bool bDelete) if (bDelete) aFonts.SetNoSelection(); - // alle Fonts der 'FontList' in die Fontliste aufnehmen - // von denen mit gleichen Namen jedoch nur einen (denn der Style wird - // ueber die 'FontStyleBox' gewaehlt und nicht auch noch hier) + // Include all fonts of FontList into the font list. + // If there are duplicates, only include one entry of each font since the style will be + // already selected using the FontStyleBox. if (pFontList) { sal_uInt16 nCount = pFontList->GetFontNameCount(); @@ -1793,7 +1785,7 @@ void SmSymDefineDialog::FillStyles(bool bDeleteText) XubString aText (aFonts.GetSelectEntry()); if (aText.Len() != 0) { - // eigene StyleName's verwenden + // use own StyleNames const SmFontStyles &rStyles = GetFontStyles(); for (sal_uInt16 i = 0; i < rStyles.GetCount(); i++) aStyles.InsertEntry( rStyles.GetStyleName(i) ); @@ -1840,7 +1832,7 @@ IMPL_LINK( SmSymDefineDialog, OldSymbolSetChangeHdl, ComboBox *, EMPTYARG pCombo IMPL_LINK( SmSymDefineDialog, ModifyHdl, ComboBox *, pComboBox ) { - // merken der Cursorposition zum wiederherstellen derselben + // remember cursor position for later restoring of it Selection aSelection (pComboBox->GetSelection()); if (pComboBox == &aSymbols) @@ -1848,13 +1840,13 @@ IMPL_LINK( SmSymDefineDialog, ModifyHdl, ComboBox *, pComboBox ) else if (pComboBox == &aSymbolSets) SelectSymbolSet(aSymbolSets, aSymbolSets.GetText(), false); else if (pComboBox == &aOldSymbols) - // nur Namen aus der Liste erlauben + // allow only names from the list SelectSymbol(aOldSymbols, aOldSymbols.GetText(), true); else if (pComboBox == &aOldSymbolSets) - // nur Namen aus der Liste erlauben + // allow only names from the list SelectSymbolSet(aOldSymbolSets, aOldSymbolSets.GetText(), true); else if (pComboBox == &aStyles) - // nur Namen aus der Liste erlauben (ist hier eh immer der Fall) + // allow only names from the list (that's the case here anyway) SelectStyle(aStyles.GetText(), true); else { @@ -2053,8 +2045,8 @@ void SmSymDefineDialog::UpdateButtons() if (aTmpSymbolName.Len() > 0 && aTmpSymbolSetName.Len() > 0) { - // alle Einstellungen gleich? - //! (Font-, Style- und SymbolSet Name werden nicht case sensitiv verglichen) + // are all settings equal? + //! (Font-, Style- und SymbolSet name comparison is not case sensitive) bool bEqual = pOrigSymbol && aTmpSymbolSetName.EqualsIgnoreCaseAscii(aOldSymbolSetName.GetText()) && aTmpSymbolName.Equals(pOrigSymbol->GetName()) @@ -2064,13 +2056,13 @@ void SmSymDefineDialog::UpdateButtons() GetFontStyles().GetStyleName(pOrigSymbol->GetFace())) && aCharsetDisplay.GetSelectCharacter() == pOrigSymbol->GetCharacter(); - // hinzufuegen nur wenn es noch kein Symbol desgleichen Namens gibt + // only add it if there isn't already a symbol with the same name bAdd = aSymbolMgrCopy.GetSymbolByName(aTmpSymbolName) == NULL; - // loeschen nur wenn alle Einstellungen gleich sind + // only delete it if all settings are equal bDelete = pOrigSymbol != NULL; - // aendern nur falls altes Symbol vorhanden und am neuen etwas anders ist + // only change it if the old symbol exists and the new one is different bChange = pOrigSymbol && !bEqual; } @@ -2219,7 +2211,7 @@ short SmSymDefineDialog::Execute() { short nResult = ModalDialog::Execute(); - // Aenderungen uebernehmen falls Dialog mit OK beendet wurde + // apply changes if dialog was closed by clicking OK if (aSymbolMgrCopy.IsModified() && nResult == RET_OK) rSymbolMgr = aSymbolMgrCopy; @@ -2231,8 +2223,8 @@ void SmSymDefineDialog::SetSymbolSetManager(const SmSymbolManager &rMgr) { aSymbolMgrCopy = rMgr; - // Das modified Flag der Kopie auf false setzen, damit man spaeter damit - // testen kann ob sich was geaendert hat. + // Set the modified flag of the copy to false so that + // we can check later on if anything has been changed aSymbolMgrCopy.SetModified(false); FillSymbolSets(aOldSymbolSets); @@ -2260,11 +2252,11 @@ bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, "Sm : wrong ComboBox"); #endif - // 'Normalisieren' des SymbolNamens (ohne leading und trailing Leerzeichen) + // trim SymbolName (no leading and trailing blanks) XubString aNormName (rSymbolSetName); aNormName = comphelper::string::stripStart(aNormName, ' '); aNormName = comphelper::string::stripEnd(aNormName, ' '); - // und evtl Abweichungen in der Eingabe beseitigen + // and remove possible deviations within the input rComboBox.SetText(aNormName); bool bRet = false; @@ -2280,17 +2272,15 @@ bool SmSymDefineDialog::SelectSymbolSet(ComboBox &rComboBox, bool bIsOld = &rComboBox == &aOldSymbolSets; - // setzen des SymbolSet Namens an der zugehoerigen Darstellung + // setting the SymbolSet name at the associated display FixedText &rFT = bIsOld ? aOldSymbolSetName : aSymbolSetName; rFT.SetText(rComboBox.GetText()); - // setzen der zum SymbolSet gehoerenden Symbol Namen an der zugehoerigen - // Auswahbox + // set the symbol name which belongs to the SymbolSet at the associated combobox ComboBox &rCB = bIsOld ? aOldSymbols : aSymbols; FillSymbols(rCB, false); - // bei Wechsel des SymbolSets fuer das alte Zeichen ein gueltiges - // Symbol bzw keins zur Anzeige bringen + // display a valid respectively no symbol when changing the SymbolSets if (bIsOld) { XubString aTmpOldSymbolName; @@ -2324,7 +2314,7 @@ void SmSymDefineDialog::SetOrigSymbol(const SmSym *pSymbol, aOldSymbolDisplay.SetSymbol( pSymbol ); } else - { // loeschen des angezeigten Symbols + { // delete displayed symbols aOldSymbolDisplay.SetText(rtl::OUString()); aOldSymbolDisplay.Invalidate(); } @@ -2341,9 +2331,9 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, "Sm : wrong ComboBox"); #endif - // 'Normalisieren' des SymbolNamens (ohne Leerzeichen) + // trim SymbolName (no blanks) XubString aNormName(comphelper::string::remove(rSymbolName, ' ')); - // und evtl Abweichungen in der Eingabe beseitigen + // and remove possible deviations within the input rComboBox.SetText(aNormName); bool bRet = false; @@ -2360,19 +2350,18 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, const SmSym *pSymbol = GetSymbol(aSymbols); if (pSymbol) { - // Font und Style entsprechend waehlen + // choose font and style accordingly const Font &rFont = pSymbol->GetFace(); SelectFont(rFont.GetName(), false); SelectStyle(GetFontStyles().GetStyleName(rFont), false); - // da das setzen des Fonts ueber den Style Namen des SymbolsFonts nicht - // so gut klappt (er kann zB leer sein obwohl der Font selbst 'bold' und - // 'italic' ist!). Setzen wir hier den Font wie er zum Symbol gehoert - // zu Fuss. + // Since setting the Font via the Style name of the SymbolFonts doesn't + // work really well (e.g. it can be empty even though the font itself is + // bold or italic) we're manually setting the Font with respect to the Symbol aCharsetDisplay.SetFont(rFont); aSymbolDisplay.SetFont(rFont); - // das zugehoerige Zeichen auswaehlen + // select associated character SelectChar(pSymbol->GetCharacter()); // since SelectChar will also set the unicode point as text in the @@ -2388,7 +2377,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, if (bIsOld) { - // bei Wechsel des alten Symbols nur vorhandene anzeigen sonst keins + // if there's a change of the old symbol, show only the available ones, otherwise show none const SmSym *pOldSymbol = NULL; XubString aTmpOldSymbolSetName; if (nPos != COMBOBOX_ENTRY_NOTFOUND) @@ -2409,7 +2398,7 @@ bool SmSymDefineDialog::SelectSymbol(ComboBox &rComboBox, void SmSymDefineDialog::SetFont(const XubString &rFontName, const XubString &rStyleName) { - // Font (FontInfo) passend zu Namen und Style holen + // get Font (FontInfo) matching name and style FontInfo aFI; if (pFontList) aFI = pFontList->Get(rFontName, WEIGHT_NORMAL, ITALIC_NONE); @@ -2476,8 +2465,7 @@ bool SmSymDefineDialog::SelectStyle(const XubString &rStyleName, bool bApplyFont bool bRet = false; sal_uInt16 nPos = aStyles.GetEntryPos(rStyleName); - // falls der Style nicht zur Auswahl steht nehmen wir den erst moeglichen - // (sofern vorhanden) + // if the style is not available take the first available one (if existent) if (nPos == COMBOBOX_ENTRY_NOTFOUND && aStyles.GetEntryCount() > 0) nPos = 0; diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index a3bac0559435..adc8271f5b90 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -261,8 +261,8 @@ void SmDocShell::ArrangeFormula() if (IsFormulaArranged()) return; - //! Nur f�r die Dauer der Existenz dieses Objekts sind am Drucker die - //! richtigen Einstellungen garantiert. + // Only for the duration of the existence of this object the correct settings + // at the printer are guaranteed! SmPrinterAccess aPrtAcc(*this); OutputDevice* pOutDev = aPrtAcc.GetRefDev(); @@ -273,7 +273,7 @@ void SmDocShell::ArrangeFormula() #endif } - // falls n�tig ein anderes OutputDevice holen f�r das formatiert wird + // if neccessary get another OutputDevice for which we format if (!pOutDev) { SmViewShell *pView = SmGetActiveView(); @@ -431,12 +431,10 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel if (!IsFormulaArranged()) ArrangeFormula(); - //Problem: Was passiert mit dem WYSIWYG? Wir haben waehrend wir inplace aktiv - //sind kein Referenzdevice und sind auch nicht darauf ausgerichtet. Es kann - //also jetzt eine Differenz zwischen der VisArea (spricht die Groesse im Client) - //und der jetzt vorliegenden Groese geben. - //Idee: Die Differenz koennte, zumindest behelfsmaessig, mit SmNod::SetSize - //angepasst werden. + // Problem: What happens to WYSIWYG? While we're active inplace, we don't have a reference + // device and aren't aligned to that either. So now there can be a difference between the + // VisArea (i.e. the size within the client) and the current size. + // Idea: The difference could be adapted with SmNod::SetSize (no long-term solution) rPosition.X() += aFormat.GetDistance( DIS_LEFTSPACE ); rPosition.Y() += aFormat.GetDistance( DIS_TOPSPACE ); @@ -594,11 +592,9 @@ Printer* SmDocShell::GetPrt() if ( SFX_CREATE_MODE_EMBEDDED == GetCreateMode() ) { - //Normalerweise wird der Printer vom Server besorgt. Wenn dieser aber - //keinen liefert (weil etwa noch keine connection da ist), kann es - //dennoch sein, dass wir den Printer kennen, denn dieser wird in - //OnDocumentPrinterChanged vom Server durchgereicht und dann temporaer - //festgehalten. + // Normally the server provides the printer. But if it doesn't provide one (e.g. because + // there is no connection) it still can be the case that we know the printer because it + // has been passed on by the server in OnDocumentPrinterChanged and being kept temporarily. Printer *pPrt = GetDocumentPrinter(); if ( !pPrt && pTmpPrinter ) pPrt = pTmpPrinter; diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index e955d6f14bcd..5091d409aedc 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -432,7 +432,7 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt) SmViewShell *pView = GetView(); if ( pView && !pView->KeyInput(rKEvt) ) { - /* fuert bei F1 (Hilfe) zum Zerstoeren von this! */ + // F1 (help) leads to the destruction of this Flush(); if ( aModifyTimer.IsActive() ) aModifyTimer.Stop(); @@ -440,8 +440,8 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt) } else { - //SFX hat evtl. Slot an der View gecallt und dabei (wg. Hack - //im SFX) den Focus auf die View gesetzt + // SFX has maybe called a slot of the view and thus (because of a hack in SFX) + // set the focus to the view SfxViewShell* pVShell = GetView(); if ( pVShell && pVShell->ISA(SmViewShell) && ((SmViewShell*)pVShell)->GetGraphicWindow().HasFocus() ) @@ -562,7 +562,7 @@ Rectangle SmEditWindow::AdjustScrollBars() void SmEditWindow::SetScrollBarRanges() { - // Extra-Methode, nicht InitScrollBars, da auch fuer EditEngine-Events. + // Extra method, not InitScrollBars, since it's also being used for EditEngine events EditEngine *pEditEngine = GetEditEngine(); if (pVScrollBar && pHScrollBar && pEditEngine && pEditView) { @@ -623,8 +623,8 @@ void SmEditWindow::SetText(const XubString& rText) pEditEngine->SetText(rText); pEditEngine->ClearModifyFlag(); - //! Hier die Timer neu zu starten verhindert, dass die Handler fuer andere - //! (im Augenblick nicht mehr aktive) Math Tasks aufgerufen werden. + // Restarting the timer here, prevents calling the handlers for other (currently inactive) + // math tasks aModifyTimer.Start(); pEditView->SetSelection(eSelection); @@ -712,8 +712,8 @@ void SmEditWindow::InsertCommand(sal_uInt16 nCommand) OSL_ENSURE( pEditView, "EditView missing" ); if (pEditView) { - //Anfang der Selektion merken und hinterher den Cursor daraufsetzen. Nur so - //macht das SelNextMark() Sinn. + // Remember start of the selection and move the cursor there afterwards. + // Only this way the SelNextMark() makes sense... ESelection aSelection = pEditView->GetSelection(); aSelection.nEndPos = aSelection.nStartPos; aSelection.nEndPara = aSelection.nStartPara; diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index be17a9867ead..e8bd3b4f5213 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -901,8 +901,8 @@ void SmLineNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) { SmNode::Prepare(rFormat, rDocShell); - //! wir verwenden hier den 'FNT_VARIABLE' Font, da er vom Ascent und Descent - //! ia besser zum Rest der Formel passt als der 'FNT_MATH' Font. + // Here we use the 'FNT_VARIABLE' font since it's ascent and descent in general fit better + // to the rest of the formula compared to the 'FNT_MATH' font. GetFont() = rFormat.GetFont(FNT_VARIABLE); Flags() |= FLG_FONT; } @@ -1234,18 +1234,17 @@ SmNode * SmBinVerNode::GetLeftMost() /**************************************************************************/ +/// @return value of the determinant formed by the two points double Det(const Point &rHeading1, const Point &rHeading2) - // gibt den Wert der durch die beiden Punkte gebildeten Determinante - // zurueck { return rHeading1.X() * rHeading2.Y() - rHeading1.Y() * rHeading2.X(); } +/// Is true iff the point 'rPoint1' belongs to the straight line through 'rPoint2' +/// and has the direction vector 'rHeading2' bool IsPointInLine(const Point &rPoint1, const Point &rPoint2, const Point &rHeading2) - // ergibt true genau dann, wenn der Punkt 'rPoint1' zu der Gerade gehoert die - // durch den Punkt 'rPoint2' geht und den Richtungsvektor 'rHeading2' hat { OSL_ENSURE(rHeading2 != Point(), "Sm : 0 vector"); @@ -1278,7 +1277,7 @@ sal_uInt16 GetLineIntersectionPoint(Point &rResult, sal_uInt16 nRes = 1; const double eps = 5.0 * DBL_EPSILON; - // sind die Richtumgsvektoren linear abhaengig ? + // are the direction vectors linearly dependent? double fDet = Det(rHeading1, rHeading2); if (fabs(fDet) < eps) { @@ -1287,8 +1286,8 @@ sal_uInt16 GetLineIntersectionPoint(Point &rResult, } else { - // hier achten wir nicht auf Rechengenauigkeit - // (das wuerde aufwendiger und lohnt sich hier kaum) + // here we do not pay attention to the computational accurancy + // (that would be more complicated and is not really worth it in this case) double fLambda = ( (rPoint1.Y() - rPoint2.Y()) * rHeading2.X() - (rPoint1.X() - rPoint2.X()) * rHeading2.Y()) / fDet; @@ -1309,11 +1308,10 @@ SmBinDiagonalNode::SmBinDiagonalNode(const SmToken &rNodeToken) } +/// @return position and size of the diagonal line +/// premise: SmRect of the node defines the limitation(!) consequently it has to be known upfront void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, const Point &rDiagPoint, double fAngleDeg) const - // gibt die Position und Groesse fuer den Diagonalstrich zurueck. - // Vor.: das SmRect des Nodes gibt die Begrenzung vor(!), muss also selbst - // bereits bekannt sein. { const double fPi = 3.1415926535897932384626433; @@ -1327,19 +1325,15 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, aDiagHdg ( (long)(100.0 * cos(fAngleRad)), (long)(-100.0 * sin(fAngleRad)) ); - long nLeft, nRight, nTop, nBottom; // Raender des Rechtecks fuer die - // Diagonale + long nLeft, nRight, nTop, nBottom; // margins of the rectangle for the diagonal Point aPoint; if (IsAscending()) { - // - // obere rechte Ecke bestimmen - // + // determine top right corner GetLineIntersectionPoint(aPoint, Point(nRectLeft, nRectTop), aRightHdg, rDiagPoint, aDiagHdg); - // - // gibt es einen Schnittpunkt mit dem oberen Rand ? + // is there a point of intersection with the top border? if (aPoint.X() <= nRectRight) { nRight = aPoint.X(); @@ -1347,7 +1341,7 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, } else { - // es muss einen Schnittpunkt mit dem rechten Rand geben! + // there has to be a point of intersection with the right border! GetLineIntersectionPoint(aPoint, Point(nRectRight, nRectTop), aDownHdg, rDiagPoint, aDiagHdg); @@ -1356,14 +1350,11 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, nTop = aPoint.Y(); } - // - // untere linke Ecke bestimmen - // + // determine bottom left corner GetLineIntersectionPoint(aPoint, Point(nRectLeft, nRectBottom), aRightHdg, rDiagPoint, aDiagHdg); - // - // gibt es einen Schnittpunkt mit dem unteren Rand ? + // is there a point of intersection with the bottom border? if (aPoint.X() >= nRectLeft) { nLeft = aPoint.X(); @@ -1371,7 +1362,7 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, } else { - // es muss einen Schnittpunkt mit dem linken Rand geben! + // there has to be a point of intersection with the left border! GetLineIntersectionPoint(aPoint, Point(nRectLeft, nRectTop), aDownHdg, rDiagPoint, aDiagHdg); @@ -1382,14 +1373,11 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, } else { - // - // obere linke Ecke bestimmen - // + // determine top left corner GetLineIntersectionPoint(aPoint, Point(nRectLeft, nRectTop), aRightHdg, rDiagPoint, aDiagHdg); - // - // gibt es einen Schnittpunkt mit dem oberen Rand ? + // is there a point of intersection with the top border? if (aPoint.X() >= nRectLeft) { nLeft = aPoint.X(); @@ -1397,7 +1385,7 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, } else { - // es muss einen Schnittpunkt mit dem linken Rand geben! + // there has to be a point of intersection with the left border! GetLineIntersectionPoint(aPoint, Point(nRectLeft, nRectTop), aDownHdg, rDiagPoint, aDiagHdg); @@ -1406,14 +1394,11 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, nTop = aPoint.Y(); } - // - // untere rechte Ecke bestimmen - // + // determine bottom right corner GetLineIntersectionPoint(aPoint, Point(nRectLeft, nRectBottom), aRightHdg, rDiagPoint, aDiagHdg); - // - // gibt es einen Schnittpunkt mit dem unteren Rand ? + // is there a point of intersection with the bottom border? if (aPoint.X() <= nRectRight) { nRight = aPoint.X(); @@ -1421,7 +1406,7 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, } else { - // es muss einen Schnittpunkt mit dem rechten Rand geben! + // there has to be a point of intersection with the right border! GetLineIntersectionPoint(aPoint, Point(nRectRight, nRectTop), aDownHdg, rDiagPoint, aDiagHdg); @@ -1439,9 +1424,8 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, void SmBinDiagonalNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) { - //! die beiden Argumente muessen in den Subnodes vor dem Operator kommen, - //! damit das anklicken im GraphicWindow den FormulaCursor richtig setzt - //! (vgl SmRootNode) + // Both arguments have to get into the SubNodes before the Operator so that clicking + // within the GraphicWindow sets the FormulaCursor correctly (cf. SmRootNode) SmNode *pLeft = GetSubNode(0), *pRight = GetSubNode(1); OSL_ENSURE(pLeft, "Sm : NULL pointer"); @@ -1460,12 +1444,12 @@ void SmBinDiagonalNode::Arrange(const OutputDevice &rDev, const SmFormat &rForma pLeft->Arrange(aTmpDev, rFormat); pRight->Arrange(aTmpDev, rFormat); - // implizit die Weite (incl Rand) des Diagonalstrichs ermitteln + // determine implicitely the values (incl. the margin) of the diagonal line pOper->Arrange(aTmpDev, rFormat); long nDelta = pOper->GetWidth() * 8 / 10; - // TopLeft Position vom rechten Argument ermitteln + // determine TopLeft position from the right argument Point aPos; aPos.X() = pLeft->GetItalicRight() + nDelta + pRight->GetItalicLeftSpace(); if (IsAscending()) @@ -1475,7 +1459,7 @@ void SmBinDiagonalNode::Arrange(const OutputDevice &rDev, const SmFormat &rForma pRight->MoveTo(aPos); - // neue Baseline bestimmen + // determine new baseline long nTmpBaseline = IsAscending() ? (pLeft->GetBottom() + pRight->GetTop()) / 2 : (pLeft->GetTop() + pRight->GetBottom()) / 2; Point aLogCenter ((pLeft->GetItalicRight() + pRight->GetItalicLeft()) / 2, @@ -1485,14 +1469,14 @@ void SmBinDiagonalNode::Arrange(const OutputDevice &rDev, const SmFormat &rForma ExtendBy(*pRight, RCP_NONE); - // Position und Groesse des Diagonalstrich ermitteln + // determine position and size of diagonal line Size aTmpSize; GetOperPosSize(aPos, aTmpSize, aLogCenter, IsAscending() ? 60.0 : -60.0); // font specialist advised to change the width first pOper->AdaptToY(aTmpDev, aTmpSize.Height()); pOper->AdaptToX(aTmpDev, aTmpSize.Width()); - // und diese wirksam machen + // and make it active pOper->Arrange(aTmpDev, rFormat); pOper->MoveTo(aPos); @@ -1728,16 +1712,16 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) long nFaceHeight = GetFont().GetSize().Height(); - // Uebergroesse in % ermitteln + // determine oversize in % sal_uInt16 nPerc = 0; if (!bIsABS && bScale) - { // im Fall von Klammern mit Uebergroesse... + { // in case of oversize braces... sal_uInt16 nIndex = GetScaleMode() == SCALE_HEIGHT ? DIS_BRACKETSIZE : DIS_NORMALBRACKETSIZE; nPerc = rFormat.GetDistance(nIndex); } - // ermitteln der Hoehe fuer die Klammern + // determine the height for the braces long nBraceHeight; if (bScale) { @@ -1749,11 +1733,11 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) else nBraceHeight = nFaceHeight; - // Abstand zum Argument + // distance to the argument nPerc = bIsABS ? 0 : rFormat.GetDistance(DIS_BRACKETSPACE); long nDist = nFaceHeight * nPerc / 100L; - // sofern erwuenscht skalieren der Klammern auf die gewuenschte Groesse + // if wanted, scale the braces to the wanted size if (bScale) { Size aTmpSize (pLeft->GetFont().GetSize()); @@ -1781,7 +1765,7 @@ void SmBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) pLeft ->Arrange(rDev, rFormat); pRight->Arrange(rDev, rFormat); - // damit auch "\(a\) - (a) - left ( a right )" vernuenftig aussieht + // required in order to make "\(a\) - (a) - left ( a right )" look alright RectVerAlign eVerAlign = bScale ? RVA_CENTERY : RVA_BASELINE; Point aPos; @@ -1880,9 +1864,9 @@ void SmVerticalBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFor pBody->Arrange(aTmpDev, rFormat); - // Groesse wie bei Grenzen fuer diesen Teil + // size is the same as for limits for this part pScript->SetSize( Fraction( rFormat.GetRelSize(SIZ_LIMITS), 100 ) ); - // etwas hoehere Klammern als normal + // braces are a bit taller than usually pBrace ->SetSize( Fraction(3, 2) ); long nItalicWidth = pBody->GetItalicWidth(); @@ -1892,7 +1876,7 @@ void SmVerticalBraceNode::Arrange(const OutputDevice &rDev, const SmFormat &rFor pBrace ->Arrange(aTmpDev, rFormat); pScript->Arrange(aTmpDev, rFormat); - // die relativen Position und die Abstaende zueinander bestimmen + // determine the relative position and the distances between each other RectPos eRectPos; long nFontHeight = pBody->GetFont().GetSize().Height(); long nDistBody = nFontHeight * rFormat.GetDistance(DIS_ORNAMENTSIZE), @@ -2000,7 +1984,7 @@ void SmOperNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) void SmAlignNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) - // setzt im ganzen subtree (incl aktuellem node) das alignment + // set alignment within the entire subtree (including current node) { OSL_ENSURE(GetNumSubNodes() > 0, "Sm: missing subnode"); @@ -2039,7 +2023,7 @@ void SmAttributNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) pAttr->AdaptToX(rDev, pBody->GetItalicWidth()); pAttr->Arrange(rDev, rFormat); - // get relative position of attribut + // get relative position of attribute RectVerAlign eVerAlign; long nDist = 0; switch (GetToken().eType) @@ -2263,9 +2247,7 @@ void SmPolyLineNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) long nBorderwidth = GetFont().GetBorderWidth(); - // - // Das Polygon mit den beiden Endpunkten bilden - // + // create polygon using both endpoints OSL_ENSURE(aPoly.GetSize() == 2, "Sm : wrong number of points"); Point aPointA, aPointB; if (GetToken().eType == TWIDESLASH) @@ -2304,8 +2286,8 @@ void SmRootSymbolNode::AdaptToX(const OutputDevice &/*rDev*/, sal_uLong nWidth) void SmRootSymbolNode::AdaptToY(const OutputDevice &rDev, sal_uLong nHeight) { - // etwas extra Laenge damit der horizontale Balken spaeter ueber dem - // Argument positioniert ist + // some additional length so that the horizontal + // bar will be positioned above the argument SmMathSymbolNode::AdaptToY(rDev, nHeight + nHeight / 10L); } @@ -2702,8 +2684,8 @@ void SmMathSymbolNode::AdaptToY(const OutputDevice &rDev, sal_uLong nHeight) GetFont().FreezeBorderWidth(); Size aFntSize (GetFont().GetSize()); - // da wir nur die Hoehe skalieren wollen muesen wir hier ggf die Fontweite - // ermitteln um diese beizubehalten. + // Since we only want to scale the heigth, we might have + // to determine the font width in order to keep it if (aFntSize.Width() == 0) { OutputDevice &rDevNC = (OutputDevice &) rDev; @@ -2903,7 +2885,7 @@ SmSpecialNode::SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, sa SmSpecialNode::SmSpecialNode(const SmToken &rNodeToken) : - SmTextNode(NSPECIAL, rNodeToken, FNT_MATH) //! default Font nicht immer richtig + SmTextNode(NSPECIAL, rNodeToken, FNT_MATH) // default Font isn't always correct! { bIsFromGreekSymbolSet = lcl_IsFromGreekSymbolSet( rNodeToken.aText ); } @@ -2932,11 +2914,9 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell // use same font size as is used for variables GetFont().SetSize( rFormat.GetFont( FNT_VARIABLE ).GetSize() ); - //! eigentlich sollten nur WEIGHT_NORMAL und WEIGHT_BOLD vorkommen... - //! In der sms-Datei gibt es jedoch zB auch 'WEIGHT_ULTRALIGHT' - //! daher vergleichen wir hier mit > statt mit != . - //! (Langfristig sollte die Notwendigkeit fuer 'PrepareAttribut', und damit - //! fuer dieses hier, mal entfallen.) + // Actually only WEIGHT_NORMAL and WEIGHT_BOLD should occur... However, the sms-file also + // contains e.g. 'WEIGHT_ULTRALIGHT'. Consequently, compare here with '>' instead of '!='. + // (In the long term the necessity for 'PrepareAttribut' and thus also for this here should be dropped) // //! see also SmFontStyles::GetStyleName if (IsItalic( GetFont() )) @@ -3067,9 +3047,8 @@ void SmBlankNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell) { SmNode::Prepare(rFormat, rDocShell); - //! hier muss/sollte es lediglich nicht der StarMath Font sein, - //! damit fuer das in Arrange verwendete Zeichen ein "normales" - //! (ungecliptes) Rechteck erzeugt wird. + // Here it need/should not be the StarMath font, so that for the character + // used in Arrange a normal (non-clipped) rectangle is generated GetFont() = rFormat.GetFont(FNT_VARIABLE); Flags() |= FLG_FONT | FLG_BOLD | FLG_ITALIC; @@ -3081,16 +3060,16 @@ void SmBlankNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) SmTmpDevice aTmpDev ((OutputDevice &) rDev, true); aTmpDev.SetFont(GetFont()); - // Abstand von der Fonthoehe abhaengig machen - // (damit er beim skalieren (zB size *2 {a ~ b}) mitwaechst) + // make distance depend on the font heigth + // (so that it increases when scaling (e.g. size *2 {a ~ b}) long nDist = GetFont().GetSize().Height() / 10L, nSpace = nNum * nDist; - // ein SmRect mit Baseline und allem drum und dran besorgen + // get a SmRect with Baseline and all the bells and whistles SmRect::operator = (SmRect(aTmpDev, &rFormat, rtl::OUString(' '), GetFont().GetBorderWidth())); - // und dieses auf die gewuenschte Breite bringen + // and resize it to the requested size SetItalicSpaces(0, 0); SetWidth(nSpace); } -- cgit v1.2.3