diff --git a/editeng/inc/editeng/acorrcfg.hxx b/editeng/inc/editeng/acorrcfg.hxx index b61c252..f9d6267 100644 --- a/editeng/inc/editeng/acorrcfg.hxx +++ b/editeng/inc/editeng/acorrcfg.hxx @@ -65,7 +65,7 @@ public: void SetModified() {ConfigItem::SetModified();} }; /*-------------------------------------------------------------------- - Beschreibung: Konfiguration fuer Auto Correction + Description: Configuration for Auto Correction --------------------------------------------------------------------*/ class EDITENG_DLLPUBLIC SvxAutoCorrCfg { @@ -77,10 +77,10 @@ class EDITENG_DLLPUBLIC SvxAutoCorrCfg SvxBaseAutoCorrCfg aBaseConfig; SvxSwAutoCorrCfg aSwConfig; - // Flags f"ur Autotext: + // Flags for Autotext: sal_Bool bFileRel; sal_Bool bNetRel; - // Tiphilfe f"ur Autotext w"ahrend der Eingabe + // Help tip for Autotext as you type sal_Bool bAutoTextTip; sal_Bool bAutoTextPreview; sal_Bool bAutoFmtByInput; @@ -100,7 +100,7 @@ public: SvxAutoCorrect* GetAutoCorrect() { return pAutoCorrect; } const SvxAutoCorrect* GetAutoCorrect() const { return pAutoCorrect; } - // der Pointer geht in den Besitz des ConfigItems! + // the pointer is transfered to the possession of the ConfigItems! void SetAutoCorrect( SvxAutoCorrect* ); sal_Bool IsAutoFmtByInput() const { return bAutoFmtByInput; } diff --git a/editeng/inc/editeng/adjitem.hxx b/editeng/inc/editeng/adjitem.hxx index 1e15453..b2d9394 100644 --- a/editeng/inc/editeng/adjitem.hxx +++ b/editeng/inc/editeng/adjitem.hxx @@ -44,8 +44,8 @@ namespace rtl // class SvxAdjustItem --------------------------------------------------- /* -[Beschreibung] -Dieses Item beschreibt die Zeilenausrichtung. +[Description] +This item describes the row orientation. */ #define ADJUST_LASTBLOCK_VERSION ((USHORT)0x0001) @@ -56,7 +56,7 @@ class EDITENG_DLLPUBLIC SvxAdjustItem : public SfxEnumItemInterface BOOL bCenter : 1; BOOL bBlock : 1; - // nur aktiv, wenn bBlock + // only activ when bBlock BOOL bOneBlock : 1; BOOL bLastCenter : 1; BOOL bLastBlock : 1; @@ -68,7 +68,7 @@ public: SvxAdjustItem( const SvxAdjust eAdjst /*= SVX_ADJUST_LEFT*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; diff --git a/editeng/inc/editeng/akrnitem.hxx b/editeng/inc/editeng/akrnitem.hxx index 6bcf6a3..6b3972e 100644 --- a/editeng/inc/editeng/akrnitem.hxx +++ b/editeng/inc/editeng/akrnitem.hxx @@ -42,8 +42,8 @@ namespace rtl // class SvxAutoKernItem ------------------------------------------------- /* - [Beschreibung] - Attribut fuer Pair-Kerning. + [Description] + Attribute for Pair-Kerning. */ class EDITENG_DLLPUBLIC SvxAutoKernItem : public SfxBoolItem @@ -54,7 +54,7 @@ public: SvxAutoKernItem( const BOOL bAutoKern /*= FALSE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; diff --git a/editeng/inc/editeng/blnkitem.hxx b/editeng/inc/editeng/blnkitem.hxx index 304f0f5..6b96d2d 100644 --- a/editeng/inc/editeng/blnkitem.hxx +++ b/editeng/inc/editeng/blnkitem.hxx @@ -43,8 +43,8 @@ namespace rtl // class SvxBlinkItem ------------------------------------------------- /* - [Beschreibung] - Dieses Item beschreibt, ob geblinkt werden soll. + [Description] + This item describes, whether to flash. */ class EDITENG_DLLPUBLIC SvxBlinkItem : public SfxBoolItem @@ -54,7 +54,7 @@ public: SvxBlinkItem( const BOOL bBlink /*= FALSE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; diff --git a/editeng/inc/editeng/bolnitem.hxx b/editeng/inc/editeng/bolnitem.hxx index af1b6a0..c523705 100644 --- a/editeng/inc/editeng/bolnitem.hxx +++ b/editeng/inc/editeng/bolnitem.hxx @@ -41,8 +41,8 @@ /* -[Beschreibung] -Dieses Item transportiert eine SvxBorderLine. +[Description] +This Item transports a SvxBorderLine. */ class SvxBorderLine; diff --git a/editeng/inc/editeng/boxitem.hxx b/editeng/inc/editeng/boxitem.hxx index 35fd036..68f34db 100644 --- a/editeng/inc/editeng/boxitem.hxx +++ b/editeng/inc/editeng/boxitem.hxx @@ -37,10 +37,10 @@ namespace rtl { class OUString; } // class SvxBoxItem ------------------------------------------------------ -/* -[Beschreibung] -Dieses Item beschreibt ein Umrandungsattribut (alle vier Kanten und -Abstand nach innen. +/* [Description] + + This item describes a border attribute + (all four edges and the inward distance) */ #define BOX_LINE_TOP ((USHORT)0) @@ -69,7 +69,7 @@ public: ~SvxBoxItem(); SvxBoxItem &operator=( const SvxBoxItem& rBox ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); @@ -94,7 +94,7 @@ public: const SvxBorderLine* GetLine( USHORT nLine ) const; - //Die Pointer werden kopiert! + //The Pointers are being copied! void SetLine( const SvxBorderLine* pNew, USHORT nLine ); USHORT GetDistance( USHORT nLine ) const; @@ -103,9 +103,8 @@ public: void SetDistance( USHORT nNew, USHORT nLine ); inline void SetDistance( USHORT nNew ); - //Breite der Linien plus Zwischenraum plus Abstand nach innen. - //JP 09.06.99: bIgnoreLine = TRUE -> Distance auch returnen, wenn - // keine Line gesetzt ist + // Line width plus Space plus inward distance + //bIgnoreLine = TRUE -> Also return distance, when no Line is set USHORT CalcLineSpace( USHORT nLine, BOOL bIgnoreLine = FALSE ) const; static com::sun::star::table::BorderLine2 SvxLineToLine( const SvxBorderLine* pLine, sal_Bool bConvert ); static sal_Bool LineToSvxLine(const ::com::sun::star::table::BorderLine& rLine, SvxBorderLine& rSvxLine, sal_Bool bConvert); @@ -119,13 +118,12 @@ inline void SvxBoxItem::SetDistance( USHORT nNew ) // class SvxBoxInfoItem -------------------------------------------------- -/* -[Beschreibung] -Noch ein Item fuer die Umrandung. Dieses Item hat lediglich SS-Funktionalitaet. -Einerseits wird dem allgemeinen Dialog mit diesem Item mitgeteilt, welche -Moeglichkeiten er anbieten soll. -Andererseits werden ueber dieses Attribut ggf. die BorderLines fuer die -horizontalen und vertikalen innerern Linien transportiert. +/* [Description] + + Another item for the border. This item has only limited functionality. + On one hand, the general Dialog is told by the item which options it + should offer. On the other hand, this attribute may be used to + transported the borderline for the inner horizontal and vertical lines. */ #define BOXINFO_LINE_HORI ((USHORT)0) @@ -142,24 +140,24 @@ horizontalen und vertikalen innerern Linien transportiert. class EDITENG_DLLPUBLIC SvxBoxInfoItem : public SfxPoolItem { - SvxBorderLine* pHori; //innere horizontale Linie - SvxBorderLine* pVert; //innere vertikale Linie + SvxBorderLine* pHori; //inner horizontal Line + SvxBorderLine* pVert; //inner vertical Line - bool mbEnableHor; /// true = Enable inner horizonal line. + bool mbEnableHor; /// true = Enable inner horizontal line. bool mbEnableVer; /// true = Enable inner vertical line. /* - z.Z. nur fuer StarWriter: Abstand nach innen von SvxBoxItem. - Wenn der Abstand gewuenscht ist, so muss das Feld fuer den Abstand vom - Dialog freigeschaltet werden. nDefDist ist als Defaultwert anzusehen. - Wenn irgendeine Linie eingeschalt ist oder wird, so muss dieser - Abstand defaultet werden. bMinDist gibt an, ob der Wert durch den - Anwender unterschritten werden darf. Mit nDist wird der aktuelle - Abstand von der App zum Dialog und zurueck transportiert. + Currently only for StarWriter: distance inward from SvxBoxItem. If the + distance is requested, then the field for the distance from the dialog be + activated. nDefDist is regarded as a default value. If any line is + turned on or will be turned on it must this distance be set to default. + bMinDist indicates whether the user can go below this value or not. + With NDIST is the current distance from the app transported back and + forth to the dialogue. */ - BOOL bDist :1; // TRUE, Abstand freischalten. - BOOL bMinDist :1; // TRUE, Abstand darf nicht unterschritten werden. + BOOL bDist :1; // TRUE, Unlock Distance. + BOOL bMinDist :1; // TRUE, Going below minimum Distance is prohibited BYTE nValidFlags; // 0000 0000 // ³³³³ ³³³ÀÄ VALID_TOP @@ -171,7 +169,7 @@ class EDITENG_DLLPUBLIC SvxBoxInfoItem : public SfxPoolItem // ³ÀÄÄÄÄÄÄÄÄ VALID_DIST // ÀÄÄÄÄÄÄÄÄÄ VALID_DISABLE - USHORT nDefDist; // Der Default- bzw. Minimalabstand. + USHORT nDefDist; // The default or minimum distance. public: TYPEINFO(); @@ -181,7 +179,7 @@ public: ~SvxBoxInfoItem(); SvxBoxInfoItem &operator=( const SvxBoxInfoItem &rCpy ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, @@ -199,7 +197,7 @@ public: const SvxBorderLine* GetHori() const { return pHori; } const SvxBorderLine* GetVert() const { return pVert; } - //Die Pointer werden kopiert! + //The Pointers are being copied! void SetLine( const SvxBorderLine* pNew, USHORT nLine ); BOOL IsTable() const { return mbEnableHor && mbEnableVer; } diff --git a/editeng/inc/editeng/brkitem.hxx b/editeng/inc/editeng/brkitem.hxx index 1409f31..244bafc 100644 --- a/editeng/inc/editeng/brkitem.hxx +++ b/editeng/inc/editeng/brkitem.hxx @@ -41,10 +41,10 @@ namespace rtl // class SvxFmtBreakItem ------------------------------------------------- -/* - [Beschreibung] - Dieses Item beschreibt ein Umbruch-Attribut - Automatisch?, Seiten- oder Spaltenumbruch, davor oder danach? +/* [Description] + + This item Describes a wrap-attribute + Automatic?, Page or column break, before or after? */ #define FMTBREAK_NOAUTO ((USHORT)0x0001) @@ -58,7 +58,7 @@ public: inline SvxFmtBreakItem( const SvxFmtBreakItem& rBreak ); inline SvxFmtBreakItem& operator=( const SvxFmtBreakItem& rCpy ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); @@ -75,7 +75,7 @@ public: virtual SfxPoolItem* Create( SvStream&, USHORT ) const; virtual USHORT GetValueCount() const; - // MS VC4.0 kommt durcheinander + // MS VC4.0 messes things up void SetValue( USHORT nNewVal ) {SfxEnumItem::SetValue(nNewVal); } SvxBreak GetBreak() const { return SvxBreak( GetValue() ); } diff --git a/editeng/inc/editeng/bulitem.hxx b/editeng/inc/editeng/bulitem.hxx index ea41ef5..9723404 100644 --- a/editeng/inc/editeng/bulitem.hxx +++ b/editeng/inc/editeng/bulitem.hxx @@ -54,7 +54,7 @@ #define BJ_VCENTER 0x20 // Valid-Bits -// Erstmal nur die Werte, die vom Dialog geaendert werden... +// First, only the values that are changed by the dialogue ... #define VALID_FONTCOLOR 0x0001 #define VALID_FONTNAME 0x0002 #define VALID_SYMBOL 0x0004 @@ -82,7 +82,8 @@ class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem USHORT nScale; sal_Unicode cSymbol; BYTE nJustify; - USHORT nValidMask; // Nur temporaer fuer GetAttribs/SetAttribs, wegen des grossen Bullets + USHORT nValidMask; // Only temporary for GetAttribs / setAttribs, + // because of the large Bullets #ifdef _SVX_BULITEM_CXX void SetDefaultFont_Impl(); diff --git a/editeng/inc/editeng/charhiddenitem.hxx b/editeng/inc/editeng/charhiddenitem.hxx index 0e4ae84..1f7d52e 100644 --- a/editeng/inc/editeng/charhiddenitem.hxx +++ b/editeng/inc/editeng/charhiddenitem.hxx @@ -35,8 +35,8 @@ #include "editeng/editengdllapi.h" // class SvxCharHiddenItem ------------------------------------------------- -/* - [Description] +/* [Description] + This item marks text as hidden */ diff --git a/editeng/inc/editeng/charreliefitem.hxx b/editeng/inc/editeng/charreliefitem.hxx index 376090a..a14f7f9 100644 --- a/editeng/inc/editeng/charreliefitem.hxx +++ b/editeng/inc/editeng/charreliefitem.hxx @@ -40,7 +40,6 @@ This item defines a character relief and has currently the values emboss, relief. - */ class EDITENG_DLLPUBLIC SvxCharReliefItem : public SfxEnumItem diff --git a/editeng/inc/editeng/cmapitem.hxx b/editeng/inc/editeng/cmapitem.hxx index b436b1e..791f7a2 100644 --- a/editeng/inc/editeng/cmapitem.hxx +++ b/editeng/inc/editeng/cmapitem.hxx @@ -42,9 +42,9 @@ namespace rtl // class SvxCaseMapItem -------------------------------------------------- -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt die Schrift-Ausrichtung (Versalien, Kapitaelchen,...). + This item describe the font type (uppercase, small caps ,...). */ class EDITENG_DLLPUBLIC SvxCaseMapItem : public SfxEnumItem @@ -55,7 +55,7 @@ public: SvxCaseMapItem( const SvxCaseMap eMap /*= SVX_CASEMAP_NOT_MAPPED*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + SfxEnumItem + // "pure virtual Methods" from SfxPoolItem + SfxEnumItem virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, diff --git a/editeng/inc/editeng/cntritem.hxx b/editeng/inc/editeng/cntritem.hxx index d1b4bfe..6c539d1 100644 --- a/editeng/inc/editeng/cntritem.hxx +++ b/editeng/inc/editeng/cntritem.hxx @@ -35,9 +35,8 @@ // class SvxContourItem -------------------------------------------------- -/* - [Beschreibung] - Dieses Item beschreibt, ob Konturschrift eingestellt ist. +/* [Description] + This item describes, if contour is employed. */ class EDITENG_DLLPUBLIC SvxContourItem : public SfxBoolItem @@ -48,7 +47,7 @@ public: SvxContourItem( const BOOL bContoured /*= FALSE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; diff --git a/editeng/inc/editeng/colritem.hxx b/editeng/inc/editeng/colritem.hxx index c71829b..24041ba 100644 --- a/editeng/inc/editeng/colritem.hxx +++ b/editeng/inc/editeng/colritem.hxx @@ -42,9 +42,9 @@ namespace rtl // class SvxColorItem ---------------------------------------------------- -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt eine Farbe. + This item describes a color. */ #define VERSION_USEAUTOCOLOR 1 @@ -63,7 +63,7 @@ public: SvxColorItem( const SvxColorItem& rCopy ); ~SvxColorItem(); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); diff --git a/editeng/inc/editeng/crsditem.hxx b/editeng/inc/editeng/crsditem.hxx index 6c832f5..a7264df 100644 --- a/editeng/inc/editeng/crsditem.hxx +++ b/editeng/inc/editeng/crsditem.hxx @@ -42,9 +42,8 @@ namespace rtl // class SvxCrossedOutItem ----------------------------------------------- -/* - [Beschreibung] - Dieses Item beschreibt, ob und wie durchstrichen ist. +/* [Description] + This item describes, whether and how it is striked out. */ class EDITENG_DLLPUBLIC SvxCrossedOutItem : public SfxEnumItem @@ -55,7 +54,7 @@ public: SvxCrossedOutItem( const FontStrikeout eSt /*= STRIKEOUT_NONE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, @@ -69,7 +68,7 @@ public: virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - // MS VC4.0 kommt durcheinander + // MS VC4.0 messes things up void SetValue( USHORT nNewVal ) {SfxEnumItem::SetValue(nNewVal); } diff --git a/editeng/inc/editeng/cscoitem.hxx b/editeng/inc/editeng/cscoitem.hxx index 4ddbfe3..b286f34 100644 --- a/editeng/inc/editeng/cscoitem.hxx +++ b/editeng/inc/editeng/cscoitem.hxx @@ -36,9 +36,9 @@ // class SvxCharSetColorItem --------------------------------------------- -/* [Beschreibung] +/* [Description] - PB: wird nur intern im Reader des Writers benoetigt + Is only needed internally in the reader of Writer. */ class EDITENG_DLLPUBLIC SvxCharSetColorItem : public SvxColorItem @@ -51,7 +51,7 @@ public: SvxCharSetColorItem( const Color& aColor, const rtl_TextEncoding eFrom, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, diff --git a/editeng/inc/editeng/editdata.hxx b/editeng/inc/editeng/editdata.hxx index 6d252b3..7921c3c 100644 --- a/editeng/inc/editeng/editdata.hxx +++ b/editeng/inc/editeng/editdata.hxx @@ -57,7 +57,7 @@ enum EVAnchorMode { #define EE_APPEND 0xFFFF #define EE_INDEX_NOT_FOUND 0xFFFF -// Fehlermeldungen fuer Read/Write-Methode +// Error messages for Read / Write Method #define EE_READWRITE_OK (SVSTREAM_OK) #define EE_READWRITE_WRONGFORMAT (SVSTREAM_ERRBASE_USER+1) #define EE_READWRITE_GENERALERROR (SVSTREAM_ERRBASE_USER+2) @@ -104,9 +104,9 @@ class ImpEditEngine; class EditTextObject; class SfxStyleSheet; -#define RGCHK_NONE 0 // Keine Korrektur der ViusArea beim Scrollen -#define RGCHK_NEG 1 // Keine neg. ViusArea beim Scrollen -#define RGCHK_PAPERSZ1 2 // VisArea muss in Papierbreite,Texthoehe liegen +#define RGCHK_NONE 0 // No correction of ViusArea when scrolling +#define RGCHK_NEG 1 // No negative ViusArea when scrolling +#define RGCHK_PAPERSZ1 2 // VisArea must be within paper width, Text Size struct EPosition { @@ -178,8 +178,8 @@ inline sal_Bool ESelection::IsEqual( const ESelection& rS ) const inline sal_Bool ESelection::IsLess( const ESelection& rS ) const { - // Selektion muss justiert sein. - // => Nur pueffen, ob Ende von 'this' < Start von rS + // The selection must be adjusted. + // => Only check if end of 'this' < Start of rS if ( ( nEndPara < rS.nStartPara ) || ( ( nEndPara == rS.nStartPara ) && ( nEndPos < rS.nStartPos ) && !IsEqual( rS ) ) ) @@ -191,8 +191,8 @@ inline sal_Bool ESelection::IsLess( const ESelection& rS ) const inline sal_Bool ESelection::IsGreater( const ESelection& rS ) const { - // Selektion muss justiert sein. - // => Nur pueffen, ob Ende von 'this' > Start von rS + // The selection must be adjusted. + // => Only check if end of 'this' < Start of rS if ( ( nStartPara > rS.nEndPara ) || ( ( nStartPara == rS.nEndPara ) && ( nStartPos > rS.nEndPos ) && !IsEqual( rS ) ) ) @@ -235,12 +235,12 @@ struct EDITENG_DLLPUBLIC EFieldInfo // ----------------------------------------------------------------------- enum ImportState { - RTFIMP_START, RTFIMP_END, // nur pParser, nPara, nIndex + RTFIMP_START, RTFIMP_END, // only pParser, nPara, nIndex RTFIMP_NEXTTOKEN, RTFIMP_UNKNOWNATTR, // nToken+nTokenValue RTFIMP_SETATTR, // pAttrs RTFIMP_INSERTTEXT, // aText RTFIMP_INSERTPARA, // - - HTMLIMP_START, HTMLIMP_END, // nur pParser, nPara, nIndex + HTMLIMP_START, HTMLIMP_END, // only pParser, nPara, nIndex HTMLIMP_NEXTTOKEN, HTMLIMP_UNKNOWNATTR, // nToken HTMLIMP_SETATTR, // pAttrs HTMLIMP_INSERTTEXT, // aText @@ -293,7 +293,7 @@ struct ParagraphInfos USHORT nFirstLineTextHeight; USHORT nFirstLineMaxAscent; - BOOL bValid; // Bei einer Abfrage waehrend der Formatierung ungueltig! + BOOL bValid; // A query during formatting is not valid! }; struct EECharAttrib diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx index 75750ba..000003d 100644 --- a/editeng/inc/editeng/editeng.hxx +++ b/editeng/inc/editeng/editeng.hxx @@ -25,7 +25,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -// MyEDITENG, wegen exportiertem EditEng +// MyEDITENG, due to exported EditEng #ifndef _MyEDITENG_HXX #define _MyEDITENG_HXX @@ -92,7 +92,7 @@ namespace basegfx { class B2DPolyPolygon; } #include #include "editeng/editengdllapi.h" -#include // wegen typedef TypeId +#include // due to typedef TypeId #include class SvxFieldData; @@ -296,13 +296,13 @@ public: Point GetDocPos( const Point& rPaperPos ) const; BOOL IsTextPos( const Point& rPaperPos, USHORT nBorder = 0 ); - // StartDocPos entspr. VisArea.TopLeft(). + // StartDocPos corrresponds to VisArea.TopLeft(). void Draw( OutputDevice* pOutDev, const Rectangle& rOutRect ); void Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const Point& rStartDocPos ); void Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const Point& rStartDocPos, BOOL bClip ); void Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation = 0 ); -// ULONG: Fehlercode des Streams. +// ULONG: Error code of the stream. ULONG Read( SvStream& rInput, const String& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = NULL ); ULONG Write( SvStream& rOutput, EETextFormat ); @@ -315,7 +315,7 @@ public: void SetImportHdl( const Link& rLink ); Link GetImportHdl() const; - // Flat-Mode: Keine Zeichenformatierung auswerten => Fuer Outliner + // Do not evaluate font formatting => For Outliner BOOL IsFlatMode() const; void SetFlatMode( BOOL bFlat ); @@ -383,7 +383,7 @@ public: USHORT GetBigTextObjectStart() const; BOOL ShouldCreateBigTextObject() const; - // Zum schnellen Vorab-Pruefen ohne View: + // For fast Pre-Test without view: EESpellState HasSpellErrors(); BOOL HasText( const SvxSearchItem& rSearchItem ); @@ -427,7 +427,6 @@ public: virtual void StyleSheetChanged( SfxStyleSheet* pStyle ); virtual void ParagraphHeightChanged( USHORT nPara ); - // #101498# virtual void DrawingText( const Point& rStartPos, const String& rText, USHORT nTextStart, USHORT nTextLen, const sal_Int32* pDXArray, const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft, diff --git a/editeng/inc/editeng/editobj.hxx b/editeng/inc/editeng/editobj.hxx index c995ea2..a4741bf 100644 --- a/editeng/inc/editeng/editobj.hxx +++ b/editeng/inc/editeng/editobj.hxx @@ -64,7 +64,7 @@ public: USHORT Which() const { return nWhich; } - virtual USHORT GetUserType() const; // Fuer OutlinerMode, der kann das aber nicht kompatibel speichern + virtual USHORT GetUserType() const; // For OutlinerMode, it can however not save in compatible format virtual void SetUserType( USHORT n ); virtual ULONG GetObjectSettings() const; @@ -75,7 +75,7 @@ public: virtual USHORT GetScriptType() const; - virtual USHORT GetVersion() const; // Solange der Outliner keine Recordlaenge speichert + virtual USHORT GetVersion() const; // As long as the outliner does not store any record length. virtual EditTextObject* Clone() const = 0; diff --git a/editeng/inc/editeng/editrids.hrc b/editeng/inc/editeng/editrids.hrc index 528e8b1..00901b0 100644 --- a/editeng/inc/editeng/editrids.hrc +++ b/editeng/inc/editeng/editrids.hrc @@ -318,7 +318,7 @@ #define RID_SVXITEMS_SHADOW_BOTTOMLEFT (RID_EDIT_START + 232) #define RID_SVXITEMS_SHADOW_BOTTOMRIGHT (RID_EDIT_START + 233) -// Umrandungslinien +// Border lines #define RID_SINGLE_LINE0 (RID_EDIT_START + 234) #define RID_SINGLE_LINE1 (RID_EDIT_START + 235) #define RID_SINGLE_LINE2 (RID_EDIT_START + 236) @@ -336,7 +336,7 @@ #define RID_DOUBLE_LINE9 (RID_EDIT_START + 248) #define RID_DOUBLE_LINE10 (RID_EDIT_START + 249) -// Metric-Texte +// Metric-Text #define RID_SVXITEMS_METRIC_MM (RID_EDIT_START + 250) #define RID_SVXITEMS_METRIC_CM (RID_EDIT_START + 251) #define RID_SVXITEMS_METRIC_INCH (RID_EDIT_START + 252) diff --git a/editeng/inc/editeng/editstat.hxx b/editeng/inc/editeng/editstat.hxx index 15de80a..2b56c06 100644 --- a/editeng/inc/editeng/editstat.hxx +++ b/editeng/inc/editeng/editstat.hxx @@ -32,43 +32,43 @@ #include #include -#define EE_CNTRL_USECHARATTRIBS 0x00000001 // Verwendung harter ZeichenAttr. -#define EE_CNTRL_USEPARAATTRIBS 0x00000002 // Verwendung von AbsatzAttr. -#define EE_CNTRL_CRSRLEFTPARA 0x00000004 // Cursor ist in einen anderen Absatz gewandert -#define EE_CNTRL_DOIDLEFORMAT 0x00000008 // Idle-Formatierung +#define EE_CNTRL_USECHARATTRIBS 0x00000001 // Use of hard character attributes +#define EE_CNTRL_USEPARAATTRIBS 0x00000002 // Using paragraph attributes. +#define EE_CNTRL_CRSRLEFTPARA 0x00000004 // Cursor is moved to another paragraph +#define EE_CNTRL_DOIDLEFORMAT 0x00000008 // Formatting idle #define EE_CNTRL_PASTESPECIAL 0x00000010 // Allow PasteSpecial -#define EE_CNTRL_AUTOINDENTING 0x00000020 // Automatisches einruecken -#define EE_CNTRL_UNDOATTRIBS 0x00000040 // Undo fuer Attribute.... -#define EE_CNTRL_ONECHARPERLINE 0x00000080 // Ein Zeichen pro Zeile -#define EE_CNTRL_NOCOLORS 0x00000100 // Engine: Keine Farben -#define EE_CNTRL_OUTLINER 0x00000200 // Sonderbehandlung Outliner/Gliederungsmodus -#define EE_CNTRL_OUTLINER2 0x00000400 // Sonderbehandlung Outliner/Seite -#define EE_CNTRL_ALLOWBIGOBJS 0x00000800 // PortionInfo in Textobjekten -#define EE_CNTRL_ONLINESPELLING 0x00001000 // Waehrend des editieren Spelling -#define EE_CNTRL_STRETCHING 0x00002000 // Stretch-Modus -#define EE_CNTRL_MARKFIELDS 0x00004000 // Felder farblich hinterlegen +#define EE_CNTRL_AUTOINDENTING 0x00000020 // Automatic indenting +#define EE_CNTRL_UNDOATTRIBS 0x00000040 // Undo for Attributes.... +#define EE_CNTRL_ONECHARPERLINE 0x00000080 // One character per line +#define EE_CNTRL_NOCOLORS 0x00000100 // Engine: No Color +#define EE_CNTRL_OUTLINER 0x00000200 // Special treatment Outliner/Outline mode +#define EE_CNTRL_OUTLINER2 0x00000400 // Special treatment Outliner/Page +#define EE_CNTRL_ALLOWBIGOBJS 0x00000800 // Portion info in text object +#define EE_CNTRL_ONLINESPELLING 0x00001000 // During the edit Spelling +#define EE_CNTRL_STRETCHING 0x00002000 // Stretch mode +#define EE_CNTRL_MARKFIELDS 0x00004000 // Mark Fields with color #define EE_CNTRL_URLSFXEXECUTE 0x00008000 // !!!OLD!!!: SFX-URL-Execute. -#define EE_CNTRL_RESTOREFONT 0x00010000 // Font im OutDev restaurieren -#define EE_CNTRL_RTFSTYLESHEETS 0x00020000 // Stylesheets bei Import verwenden -//#define EE_CNTRL_NOREDLINES 0x00040000 // Keine RedLines bei OnlineSpellError /* removed #i91949 */ -#define EE_CNTRL_AUTOCORRECT 0x00080000 // AutoKorrektur +#define EE_CNTRL_RESTOREFONT 0x00010000 // Restore Font in OutDev +#define EE_CNTRL_RTFSTYLESHEETS 0x00020000 // Use Stylesheets when imported +//#define EE_CNTRL_NOREDLINES 0x00040000 // No RedLines when OnlineSpellError /* removed #i91949 */ +#define EE_CNTRL_AUTOCORRECT 0x00080000 // AutoCorrect #define EE_CNTRL_AUTOCOMPLETE 0x00100000 // AutoComplete -#define EE_CNTRL_AUTOPAGESIZEX 0x00200000 // Papierbreite an Text anpassen -#define EE_CNTRL_AUTOPAGESIZEY 0x00400000 // Papierhoehe an Text anpassen +#define EE_CNTRL_AUTOPAGESIZEX 0x00200000 // Adjust paper width to Text +#define EE_CNTRL_AUTOPAGESIZEY 0x00400000 // Adjust paper height to Text #define EE_CNTRL_AUTOPAGESIZE (EE_CNTRL_AUTOPAGESIZEX|EE_CNTRL_AUTOPAGESIZEY) -#define EE_CNTRL_TABINDENTING 0x00800000 // Einruecken mit Tab -#define EE_CNTRL_FORMAT100 0x01000000 // Immer nach 100% formatieren -#define EE_CNTRL_ULSPACESUMMATION 0x02000000 // MS Compat: SA und SB aufsummieren, nicht maximalwert -#define EE_CNTRL_ULSPACEFIRSTPARA 0x04000000 // MS Compat: SB auch beim ersten Absatz auswerten - -#define EV_CNTRL_AUTOSCROLL 0x00000001 // Autom. Scrollen horiz. -#define EV_CNTRL_BIGSCROLL 0x00000002 // Weiter Scrollen, als nur zum Cursor -#define EV_CNTRL_ENABLEPASTE 0x00000004 // Paste erlauben -#define EV_CNTRL_SINGLELINEPASTE 0x00000008 // View: Paste in Eingabezeile... -#define EV_CNTRL_OVERWRITE 0x00000010 // Ueberschreibmodus -#define EV_CNTRL_INVONEMORE 0x00000020 // Ein Pixel mehr invalidieren -#define EV_CNTRL_AUTOSIZEX 0x00000040 // Automatisch an Textbreite anpassen -#define EV_CNTRL_AUTOSIZEY 0x00000080 // Automatisch an Texthoehe anpassen +#define EE_CNTRL_TABINDENTING 0x00800000 // Indent with tab +#define EE_CNTRL_FORMAT100 0x01000000 // Always format to 100% +#define EE_CNTRL_ULSPACESUMMATION 0x02000000 // MS Compat: sum SA and SB, not maximum value +#define EE_CNTRL_ULSPACEFIRSTPARA 0x04000000 // MS Compat: evaluate also at the first paragraph + +#define EV_CNTRL_AUTOSCROLL 0x00000001 // Auto scrolling horizontally +#define EV_CNTRL_BIGSCROLL 0x00000002 // Scroll further to the cursor +#define EV_CNTRL_ENABLEPASTE 0x00000004 // Enable Paste +#define EV_CNTRL_SINGLELINEPASTE 0x00000008 // View: Paste in input line ... +#define EV_CNTRL_OVERWRITE 0x00000010 // Overwrite mode +#define EV_CNTRL_INVONEMORE 0x00000020 // Invalidate one pixel more +#define EV_CNTRL_AUTOSIZEX 0x00000040 // Automatically adapt to text width +#define EV_CNTRL_AUTOSIZEY 0x00000080 // Automatically adapt to Text width #define EV_CNTRL_AUTOSIZE (EV_CNTRL_AUTOSIZEX|EV_CNTRL_AUTOSIZEY) #define EE_STAT_HSCROLL 0x00000001 @@ -81,12 +81,12 @@ #define EE_STAT_WRONGWORDCHANGED 0x00000080 // #define EE_STAT_MODIFIED 0x00000100 -// Nur fuer Update: +// Only for Update: #define EE_CNTRL_AUTOCENTER EE_CNTRL_AUTOPAGESIZE #define EE_STAT_GROWY EE_STAT_TEXTHEIGHTCHANGED /* - EE_STAT_CRSRLEFTPARA zur Zeit bei Cursorbewegungen und Return. + EE_STAT_CRSRLEFTPARA at the time cursor movement and the enter. */ inline void SetFlags( ULONG& rBits, const ULONG nMask, bool bOn ) @@ -102,7 +102,7 @@ class EditStatus protected: ULONG nStatusBits; ULONG nControlBits; - USHORT nPrevPara; // fuer EE_STAT_CRSRLEFTPARA + USHORT nPrevPara; // for EE_STAT_CRSRLEFTPARA public: EditStatus() { nStatusBits = 0; nControlBits = 0; nPrevPara = 0xFFFF; } diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx index 39756b5..e709630 100644 --- a/editeng/inc/editeng/editview.hxx +++ b/editeng/inc/editeng/editview.hxx @@ -25,7 +25,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -// MyEDITVIEW, wegen exportiertem EditView +// MyEDITVIEW, due to exported EditView #ifndef _MyEDITVIEW_HXX #define _MyEDITVIEW_HXX @@ -76,7 +76,7 @@ class EDITENG_DLLPUBLIC EditView friend class ImpEditEngine; friend class EditSelFunctionSet; -public: // brauche ich fuer Undo +public: // Needed for Undo ImpEditView* GetImpEditView() const { return pImpEditView; } ImpEditEngine* GetImpEditEngine() const; @@ -126,13 +126,13 @@ public: USHORT GetSelectedScriptType() const; - // Position der VisArea im Ausgabefenster. - // Eine Groessenaenderung betrifft auch die VisArea + // VisArea position of the Output window. + // A size change also affects the VisArea void SetOutputArea( const Rectangle& rRec ); const Rectangle& GetOutputArea() const; - // Dokumentposition. - // Eine Groessenaenderung betrifft auch die VisArea + // Document position. + // A size change also affects the VisArea void SetVisArea( const Rectangle& rRec ); const Rectangle& GetVisArea() const; @@ -166,7 +166,7 @@ public: void Undo(); void Redo(); - // speziell fuer Olli + // especially for Olli USHORT GetParagraph( const Point& rMousePosPixel ); Point GetWindowPosTopLeft( USHORT nParagraph ); void MoveParagraphs( Range aParagraphs, USHORT nNewPos ); @@ -195,7 +195,7 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > GetTransferable(); - // An EditView, damit bei TRUE flackerfreies Update: + // An EditView, so that when TRUE the update will be free from flickering: void SetEditEngineUpdateMode( BOOL bUpdate ); void ForceUpdate(); diff --git a/editeng/inc/editeng/eeitemid.hxx b/editeng/inc/editeng/eeitemid.hxx index 3e28e0e..62b5a52 100644 --- a/editeng/inc/editeng/eeitemid.hxx +++ b/editeng/inc/editeng/eeitemid.hxx @@ -80,7 +80,7 @@ #undef ITEMID_BRUSH #endif -// Zeichenattribute.... +// Character Attributes.... #define ITEMID_FONT EE_CHAR_FONTINFO #define ITEMID_POSTURE EE_CHAR_ITALIC #define ITEMID_WEIGHT EE_CHAR_WEIGHT @@ -105,7 +105,7 @@ #define ITEMID_EMPHASISMARK EE_CHAR_EMPHASISMARK #define ITEMID_CHARRELIEF EE_CHAR_RELIEF -// Absatzattribute +// Paragraph Attributes #define ITEMID_SCRIPTSPACE EE_PARA_ASIANCJKSPACING #define ITEMID_ADJUST EE_PARA_JUST #define ITEMID_LINESPACING EE_PARA_SBL diff --git a/editeng/inc/editeng/emphitem.hxx b/editeng/inc/editeng/emphitem.hxx index 2715f50..826c7c3 100644 --- a/editeng/inc/editeng/emphitem.hxx +++ b/editeng/inc/editeng/emphitem.hxx @@ -42,9 +42,9 @@ namespace rtl // class SvxEmphasisMarkItem ---------------------------------------------- -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt die Font-Betonung. + This item describes the Font emphasis. */ class EDITENG_DLLPUBLIC SvxEmphasisMarkItem : public SfxUInt16Item @@ -55,7 +55,7 @@ public: SvxEmphasisMarkItem( const FontEmphasisMark eVal /*= EMPHASISMARK_NONE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + SfxEnumItem + // "pure virtual Methods" from SfxPoolItem + SfxEnumItem virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, diff --git a/editeng/inc/editeng/escpitem.hxx b/editeng/inc/editeng/escpitem.hxx index f37f763..7c47268 100644 --- a/editeng/inc/editeng/escpitem.hxx +++ b/editeng/inc/editeng/escpitem.hxx @@ -43,14 +43,14 @@ namespace rtl // class SvxEscapementItem ----------------------------------------------- #define DFLT_ESC_SUPER 33 // 1/3 -#define DFLT_ESC_SUB -33 // auch 1/3 fr"uher 8/100 +#define DFLT_ESC_SUB -33 // also 1/3 previously 8/100 #define DFLT_ESC_PROP 58 #define DFLT_ESC_AUTO_SUPER 101 #define DFLT_ESC_AUTO_SUB -101 -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt die Schrift-Position. + This item describes the writing position. */ class EDITENG_DLLPUBLIC SvxEscapementItem : public SfxEnumItemInterface @@ -66,7 +66,7 @@ public: SvxEscapementItem( const short nEsc, const BYTE nProp, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, diff --git a/editeng/inc/editeng/fhgtitem.hxx b/editeng/inc/editeng/fhgtitem.hxx index e4305a6..0496ceb 100644 --- a/editeng/inc/editeng/fhgtitem.hxx +++ b/editeng/inc/editeng/fhgtitem.hxx @@ -41,11 +41,11 @@ namespace rtl // class SvxFontHeightItem ----------------------------------------------- -// Achtung: Twips-Werte +// Warning: twips values -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt die Font-Hoehe. + This item describes the font height */ #define FONTHEIGHT_16_VERSION ((USHORT)0x0001) @@ -62,7 +62,7 @@ public: SvxFontHeightItem( const ULONG nSz /*= 240*/, const USHORT nPropHeight /*= 100*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); diff --git a/editeng/inc/editeng/flditem.hxx b/editeng/inc/editeng/flditem.hxx index 6a680b0..94d47ae 100644 --- a/editeng/inc/editeng/flditem.hxx +++ b/editeng/inc/editeng/flditem.hxx @@ -58,7 +58,7 @@ public: }; /* -[Beschreibung] +[Description] In diesem Item wird ein Feld (SvxFieldData) gespeichert. Das Feld gehoert dem Item. Das Feld selbst wird durch eine Ableitung von SvxFieldData bestimmt. (RTTI) @@ -88,13 +88,13 @@ public: }; // ================================================================= -// Es folgen die Ableitungen von SvxFieldData... +// The following are the derivatives of SvxFieldData ... // ================================================================= #define SVX_DATEFIELD 2 #define SVX_URLFIELD 3 -#define SVX_PAGEFIELD 100 // Ex-Calc-Felder +#define SVX_PAGEFIELD 100 // Ex-Calc Fields #define SVX_PAGESFIELD 101 #define SVX_TIMEFIELD 102 #define SVX_FILEFIELD 103 @@ -106,19 +106,19 @@ public: #define SVX_FOOTERFIELD 109 #define SVX_DATEFIMEFIELD 110 -#define SVX_USERFIELD 200 // Ab hier eigene Felder, nicht im SVX +#define SVX_USERFIELD 200 // From here on own fields, not in the SVX enum SvxDateType { SVXDATETYPE_FIX, SVXDATETYPE_VAR }; -enum SvxDateFormat { SVXDATEFORMAT_APPDEFAULT, // Wie in App eingestellt - SVXDATEFORMAT_SYSTEM, // Wie im System eingestellt +enum SvxDateFormat { SVXDATEFORMAT_APPDEFAULT, // Set as in App + SVXDATEFORMAT_SYSTEM, // Set as in System SVXDATEFORMAT_STDSMALL, SVXDATEFORMAT_STDBIG, SVXDATEFORMAT_A, // 13.02.96 SVXDATEFORMAT_B, // 13.02.1996 SVXDATEFORMAT_C, // 13.Feb 1996 - SVXDATEFORMAT_D, // 13.Februar 1996 - SVXDATEFORMAT_E, // Die, 13.Februar 1996 - SVXDATEFORMAT_F // Dienstag, 13.Februar 1996 + SVXDATEFORMAT_D, // 13.February 1996 + SVXDATEFORMAT_E, // Tue, 13.February 1996 + SVXDATEFORMAT_F // Tuesday, 13.February 1996 }; class EDITENG_DLLPUBLIC SvxDateField : public SvxFieldData @@ -159,18 +159,18 @@ public: }; -enum SvxURLFormat { SVXURLFORMAT_APPDEFAULT, // Wie in App eingestellt - SVXURLFORMAT_URL, // URL darstellen - SVXURLFORMAT_REPR // Repraesentation darstellen +enum SvxURLFormat { SVXURLFORMAT_APPDEFAULT, // Set as in App + SVXURLFORMAT_URL, // Represent URL + SVXURLFORMAT_REPR // Constitute repraesentation }; class EDITENG_DLLPUBLIC SvxURLField : public SvxFieldData { private: SvxURLFormat eFormat; - XubString aURL; // URL-Adresse - XubString aRepresentation; // Was wird dargestellt - XubString aTargetFrame; // In welchem Frame + XubString aURL; // URL-Address + XubString aRepresentation; // What is shown + XubString aTargetFrame; // In what Frame public: SV_DECL_PERSIST1( SvxURLField, SvxFieldData, SVX_URLFIELD ) @@ -247,8 +247,8 @@ public: enum SvxTimeType { SVXTIMETYPE_FIX, SVXTIMETYPE_VAR }; -enum SvxTimeFormat { SVXTIMEFORMAT_APPDEFAULT, // Wie in App eingestellt - SVXTIMEFORMAT_SYSTEM, // Wie im System eingestellt +enum SvxTimeFormat { SVXTIMEFORMAT_APPDEFAULT, // Set as in App + SVXTIMEFORMAT_SYSTEM, // Set as in System SVXTIMEFORMAT_STANDARD, SVXTIMEFORMAT_24_HM, // 13:49 SVXTIMEFORMAT_24_HMS, // 13:49:38 @@ -300,10 +300,10 @@ public: enum SvxFileType { SVXFILETYPE_FIX, SVXFILETYPE_VAR }; -enum SvxFileFormat { SVXFILEFORMAT_NAME_EXT, // Dateiname mit Extension - SVXFILEFORMAT_FULLPATH, // vollst„ndiger Pfad - SVXFILEFORMAT_PATH, // nur Pfad - SVXFILEFORMAT_NAME // nur Dateiname +enum SvxFileFormat { SVXFILEFORMAT_NAME_EXT, // File name with Extension + SVXFILEFORMAT_FULLPATH, // full path + SVXFILEFORMAT_PATH, // only path + SVXFILEFORMAT_NAME // only file name }; @@ -339,10 +339,10 @@ public: enum SvxAuthorType { SVXAUTHORTYPE_FIX, SVXAUTHORTYPE_VAR }; -enum SvxAuthorFormat { SVXAUTHORFORMAT_FULLNAME, // vollst„ndiger Name - SVXAUTHORFORMAT_NAME, // nur Nachname - SVXAUTHORFORMAT_FIRSTNAME, // nur Vorname - SVXAUTHORFORMAT_SHORTNAME // Initialen +enum SvxAuthorFormat { SVXAUTHORFORMAT_FULLNAME, // full name + SVXAUTHORFORMAT_NAME, // Only Last name + SVXAUTHORFORMAT_FIRSTNAME, // Only first name + SVXAUTHORFORMAT_SHORTNAME // Initials }; class EDITENG_DLLPUBLIC SvxAuthorField : public SvxFieldData diff --git a/editeng/inc/editeng/flstitem.hxx b/editeng/inc/editeng/flstitem.hxx index b2d35dd..976a6ae 100644 --- a/editeng/inc/editeng/flstitem.hxx +++ b/editeng/inc/editeng/flstitem.hxx @@ -40,10 +40,10 @@ class FontList; /* - [Beschreibung] + [Description] - Dieses Item dient als Transport-Medium fuer eine FontListe. - Die Fontliste wird nicht kopiert und nicht geloescht! + This item serves as a transport medium for a font list. The font list is + not copied and not deleted! */ class EDITENG_DLLPUBLIC SvxFontListItem : public SfxPoolItem diff --git a/editeng/inc/editeng/fontitem.hxx b/editeng/inc/editeng/fontitem.hxx index c0ac85b..4d0a535 100644 --- a/editeng/inc/editeng/fontitem.hxx +++ b/editeng/inc/editeng/fontitem.hxx @@ -43,9 +43,9 @@ namespace rtl // class SvxFontItem ----------------------------------------------------- -/* - [Beschreibung] - Dieses Item beschreibt einen Font. +/* [Description] + + This item describes a Font. */ class EDITENG_DLLPUBLIC SvxFontItem : public SfxPoolItem @@ -68,7 +68,7 @@ public: const rtl_TextEncoding eFontTextEncoding /*= RTL_TEXTENCODING_DONTKNOW*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; @@ -81,7 +81,7 @@ public: SfxMapUnit ePresMetric, String &rText, const IntlWrapper * = 0 ) const; - // ZugriffsMethoden: + // Access methods: inline String &GetFamilyName() { return aFamilyName; } inline const String &GetFamilyName() const { return aFamilyName; } diff --git a/editeng/inc/editeng/fwdtitem.hxx b/editeng/inc/editeng/fwdtitem.hxx index cbf4a70..296820d 100644 --- a/editeng/inc/editeng/fwdtitem.hxx +++ b/editeng/inc/editeng/fwdtitem.hxx @@ -37,9 +37,9 @@ // class SvxFontWidthItem ----------------------------------------------- -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt die Font-Breite. + This item describes the font width. */ class SvxFontWidthItem : public SfxPoolItem @@ -53,7 +53,7 @@ public: const USHORT nPropWidth /*= 100*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); diff --git a/editeng/inc/editeng/hyznitem.hxx b/editeng/inc/editeng/hyznitem.hxx index f586b18..07bb874 100644 --- a/editeng/inc/editeng/hyznitem.hxx +++ b/editeng/inc/editeng/hyznitem.hxx @@ -41,10 +41,10 @@ namespace rtl // class SvxHyphenZoneItem ----------------------------------------------- -/* -[Beschreibung] -Dieses Item beschreibt ein Silbentrennungsattribut (Automatisch?, Anzahl der -Zeichen am Zeilenende und -anfang). +/* [Description] + + This item describes a hyphenation attribute (automatic?, number of + characters at the end of the line and start). */ class EDITENG_DLLPUBLIC SvxHyphenZoneItem : public SfxPoolItem @@ -63,7 +63,7 @@ public: SvxHyphenZoneItem( const BOOL bHyph /*= FALSE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); diff --git a/editeng/inc/editeng/keepitem.hxx b/editeng/inc/editeng/keepitem.hxx index b98aff4..2d942c6 100644 --- a/editeng/inc/editeng/keepitem.hxx +++ b/editeng/inc/editeng/keepitem.hxx @@ -40,9 +40,9 @@ namespace rtl // class SvxFmtKeepItem ------------------------------------------------ -/* -[Beschreibung] -Dieses Item beschreibt eine logische Variable "Absaetze zusammenhalten?". +/* [Description] + + This item describes a logical variable "keep paragraphs together?". */ class EDITENG_DLLPUBLIC SvxFmtKeepItem : public SfxBoolItem @@ -54,7 +54,7 @@ public: const USHORT _nWhich ); inline SvxFmtKeepItem& operator=( const SvxFmtKeepItem& rSplit ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create( SvStream&, USHORT ) const; virtual SvStream& Store( SvStream& , USHORT nItemVersion ) const; diff --git a/editeng/inc/editeng/kernitem.hxx b/editeng/inc/editeng/kernitem.hxx index d646378..ba958cc 100644 --- a/editeng/inc/editeng/kernitem.hxx +++ b/editeng/inc/editeng/kernitem.hxx @@ -41,12 +41,12 @@ namespace rtl // class SvxKerningItem -------------------------------------------------- -// Achtung: Twips-Werte -// Twips: 0 = kein Kerning +// Note: Twips value +// Twips: 0 = no kerning -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt die Schrift-Laufweite. + This item describes the kerning. */ class EDITENG_DLLPUBLIC SvxKerningItem : public SfxInt16Item @@ -56,7 +56,7 @@ public: SvxKerningItem( const short nKern /*= 0*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; diff --git a/editeng/inc/editeng/langitem.hxx b/editeng/inc/editeng/langitem.hxx index 4d4ddf2..5255e46 100644 --- a/editeng/inc/editeng/langitem.hxx +++ b/editeng/inc/editeng/langitem.hxx @@ -42,9 +42,9 @@ namespace rtl // class SvxLanguageItem ------------------------------------------------- -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt eine Sprache. + This item describes a Language. */ class EDITENG_DLLPUBLIC SvxLanguageItem : public SfxEnumItem @@ -55,7 +55,7 @@ public: SvxLanguageItem( const LanguageType eLang /*= LANGUAGE_GERMAN*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, diff --git a/editeng/inc/editeng/lcolitem.hxx b/editeng/inc/editeng/lcolitem.hxx index 00b116f..17b070d 100644 --- a/editeng/inc/editeng/lcolitem.hxx +++ b/editeng/inc/editeng/lcolitem.hxx @@ -34,7 +34,7 @@ #include /* - * dummy-Item fuer ToolBox-Controller: + * Dummy item for ToolBox controller: * */ diff --git a/editeng/inc/editeng/lrspitem.hxx b/editeng/inc/editeng/lrspitem.hxx index d0e0399..1b5a6c5 100644 --- a/editeng/inc/editeng/lrspitem.hxx +++ b/editeng/inc/editeng/lrspitem.hxx @@ -40,20 +40,19 @@ namespace rtl // class SvxLRSpaceItem -------------------------------------------------- -/* -[Beschreibung] -Linker/Rechter Rand sowie Erstzeileneinzug - -SvxLRSpaceItem bietet zwei Schnittstellen zur Befragung des linken -Randes und des Erstzeileneinzuges an. Die Get-Methoden liefern -die Member zurueck, wie sie das Layout bisher auch erwartete: -Der linke Rand verschiebt sich beim negativem Erstzeileneinzug -nach links. Die SetTxt/GetTxt-Methoden setzen voraus, dass der -linke Rand der 0-Punkt des Erstzeileneinzugs darstellt: - - UI UI LAYOUT UI/TEXT UI/TEXT (Wo?) -SetTxtLeft SetTxtFirst GetLeft GetTxtLeft GetTxtFirst (Was?) - 500 -500 0 500 -500 (Wieviel?) +/* [Description] + + Left/Right margin and first line indent + + SvxLRSpaceItem offers two interfaces for views from the left margin and + first line indent. The get methods return the member, with the layout also + as expected: the left edge shifts to the negative first line indent to the + left. The SetTxt/Gettxt methods assume that the left side represents the + 0 coordinate for the first line indent: + + UI UI LAYOUT UI/TEXT UI/TEXT (Where?) + SetTxtLeft SetTxtFirst GetLeft GetTxtLeft GetTxtFirst (What?) + 500 -500 0 500 -500 (How much?) 500 0 500 500 0 500 +500 500 500 +500 700 -500 200 700 -500 @@ -66,15 +65,15 @@ SetTxtLeft SetTxtFirst GetLeft GetTxtLeft GetTxtFirst (Was?) class EDITENG_DLLPUBLIC SvxLRSpaceItem : public SfxPoolItem { - short nFirstLineOfst; // Erstzeileneinzug _immer_ relativ zu nTxtLeft - long nTxtLeft; // wir spendieren einen USHORT - long nLeftMargin; // nLeft oder der neg. Erstzeileneinzug - long nRightMargin; // der unproblematische rechte Rand + short nFirstLineOfst; // First-line indent _always_ relative to nTxtLeft + long nTxtLeft; // We spend a USHORT + long nLeftMargin; // nLeft or the negative first-line indent + long nRightMargin; // The unproblematic right edge USHORT nPropFirstLineOfst, nPropLeftMargin, nPropRightMargin; - BOOL bAutoFirst : 1; // Automatische Berechnung der Erstzeileneinzugs + BOOL bAutoFirst : 1; // Automatic calculation of the first line indent - void AdjustLeft(); // nLeftMargin und nTxtLeft werden angepasst. + void AdjustLeft(); // nLeftMargin and nTxtLeft are being adjusted. public: TYPEINFO(); @@ -85,7 +84,7 @@ public: const USHORT nId ); inline SvxLRSpaceItem& operator=( const SvxLRSpaceItem &rCpy ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; @@ -103,11 +102,11 @@ public: virtual bool ScaleMetrics( long nMult, long nDiv ); virtual bool HasMetrics() const; - // Die "Layout-Schnittstelle": + // The Layout Interface: inline void SetLeft ( const long nL, const USHORT nProp = 100 ); inline void SetRight( const long nR, const USHORT nProp = 100 ); - // abfragen / direktes setzen der absoluten Werte + // Query/direct setting of the absolute values inline long GetLeft() const { return nLeftMargin; } inline long GetRight() const { return nRightMargin;} inline void SetLeftValue( const long nL ) { nTxtLeft = nLeftMargin = nL; } @@ -115,7 +114,7 @@ public: inline BOOL IsAutoFirst() const { return bAutoFirst; } inline void SetAutoFirst( const BOOL bNew ) { bAutoFirst = bNew; } - // abfragen / setzen der Prozent-Werte + // Query/Setting the percentage values inline void SetPropLeft( const USHORT nProp = 100 ) { nPropLeftMargin = nProp; } inline void SetPropRight( const USHORT nProp = 100 ) @@ -123,7 +122,7 @@ public: inline USHORT GetPropLeft() const { return nPropLeftMargin; } inline USHORT GetPropRight() const { return nPropRightMargin;} - // Die "UI/Text-Schnittstelle": + // The UI/text interface: inline void SetTxtLeft( const long nL, const USHORT nProp = 100 ); inline long GetTxtLeft() const { return nTxtLeft; } diff --git a/editeng/inc/editeng/lspcitem.hxx b/editeng/inc/editeng/lspcitem.hxx index edc631f..a5db017 100644 --- a/editeng/inc/editeng/lspcitem.hxx +++ b/editeng/inc/editeng/lspcitem.hxx @@ -42,9 +42,8 @@ namespace rtl // class SvxLineSpacingItem ---------------------------------------------- -/* -[Beschreibung] -Dieses Item beschreibt den Abstand zwischen den Zeilen. +/* [Description] + This item describes the distance between the lines. */ #define LINE_SPACE_DEFAULT_HEIGHT 200 @@ -61,15 +60,14 @@ class EDITENG_DLLPUBLIC SvxLineSpacingItem : public SfxEnumItemInterface public: TYPEINFO(); - // Der Writer verlaesst sich auf eine Default-Hoehe von 200! - // Eigentlich wuerde ich alle Werte mit 0 initialisieren, aber wer kann - // die Folgen beim Writer absehen ? - // => lieber einen krummen Wert als Default, aber der Programmierer - // sieht, dass dort etwas besonderes passiert. + // The writer relies on a default height of 200! Actually, I would + // initialize all values to 0, but who can ignore the consequences in + // writer? => Rather have a crooked vales as the default, but the + // programmer sees that there's something special happening. SvxLineSpacingItem( USHORT nHeight /*= LINE_SPACE_DEFAULT_HEIGHT*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); @@ -83,8 +81,7 @@ public: virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; - // Methoden zum Abfragen und Aendern - // Interlinespace wird zur Hoehe addiert. + // Methods to query and edit. InterlineSpace is added to the height. inline short GetInterLineSpace() const { return nInterLineSpace; } inline void SetInterLineSpace( const short nSpace ) { @@ -92,7 +89,7 @@ public: eInterLineSpace = SVX_INTER_LINE_SPACE_FIX; } - // Bestimmt absolute oder minimale Zeilenhoehe. + // Determines the absolute or minimum row height. inline USHORT GetLineHeight() const { return nLineHeight; } inline void SetLineHeight( const USHORT nHeight ) { @@ -100,7 +97,7 @@ public: eLineSpace = SVX_LINE_SPACE_MIN; } - // Vergroessert oder verkleinert die Zeilenhoehe. + // To increase or decrease the row height. BYTE GetPropLineSpace() const { return nPropLineSpace; } inline void SetPropLineSpace( const BYTE nProp ) { diff --git a/editeng/inc/editeng/measfld.hxx b/editeng/inc/editeng/measfld.hxx index 174f838..904d8bd 100644 --- a/editeng/inc/editeng/measfld.hxx +++ b/editeng/inc/editeng/measfld.hxx @@ -33,8 +33,8 @@ #ifndef _FLDITEM_HXX #ifndef ITEMID_FIELD -#include /* das include wird wg. EE_FEATURE_FIELD benoetigt */ -#define ITEMID_FIELD EE_FEATURE_FIELD /* wird fuer #include benoetigt */ +#include /* this include is needed due to EE_FEATURE_FIELD */ +#define ITEMID_FIELD EE_FEATURE_FIELD /* is needed for #include */ #endif #include #endif diff --git a/editeng/inc/editeng/nhypitem.hxx b/editeng/inc/editeng/nhypitem.hxx index e515ee4..b5db3ed 100644 --- a/editeng/inc/editeng/nhypitem.hxx +++ b/editeng/inc/editeng/nhypitem.hxx @@ -42,7 +42,7 @@ public: SvxNoHyphenItem( const BOOL bHyphen /*= TRUE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; diff --git a/editeng/inc/editeng/nlbkitem.hxx b/editeng/inc/editeng/nlbkitem.hxx index 4527097..00cb4a5 100644 --- a/editeng/inc/editeng/nlbkitem.hxx +++ b/editeng/inc/editeng/nlbkitem.hxx @@ -43,7 +43,7 @@ public: SvxNoLinebreakItem( const BOOL bBreak /*= TRUE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; diff --git a/editeng/inc/editeng/numdef.hxx b/editeng/inc/editeng/numdef.hxx index 4e5b901..5d997c2 100644 --- a/editeng/inc/editeng/numdef.hxx +++ b/editeng/inc/editeng/numdef.hxx @@ -26,7 +26,7 @@ * ************************************************************************/ -#define SVX_MAX_NUM 10 // max. moegliche Numerierungsebenen -#define SVX_DEF_BULLET (0xF000 + 149)// Charakter fuer Aufzaehlungen +#define SVX_MAX_NUM 10 // max. possible numbering level +#define SVX_DEF_BULLET (0xF000 + 149)// Character for lists /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/inc/editeng/numitem.hxx b/editeng/inc/editeng/numitem.hxx index 7489f37..186ed8b 100644 --- a/editeng/inc/editeng/numitem.hxx +++ b/editeng/inc/editeng/numitem.hxx @@ -57,17 +57,17 @@ namespace com{namespace sun{ namespace star{ // ----------------------------------------------------------------------- //Feature-Flags (only USHORT!) -#define NUM_CONTINUOUS 0x0001 // fortlaufende Numerierung moeglich? -#define NUM_CHAR_TEXT_DISTANCE 0x0002 // Abstand Symbol<->Text? -#define NUM_CHAR_STYLE 0x0004 // Zeichenvorlagen? -#define NUM_BULLET_REL_SIZE 0x0008 // rel. Bulletgroesse? +#define NUM_CONTINUOUS 0x0001 // consecutive numbers possible? +#define NUM_CHAR_TEXT_DISTANCE 0x0002 // Distance Symbol<->Text? +#define NUM_CHAR_STYLE 0x0004 // Character styles? +#define NUM_BULLET_REL_SIZE 0x0008 // relative bullet size? #define NUM_BULLET_COLOR 0x0010 // Bullet color -#define NUM_SYMBOL_ALIGNMENT 0x0040 // alignment soll unter den Optionen angezeigt werden -#define NUM_NO_NUMBERS 0x0080 // Numberierungen sind nicht erlaubt +#define NUM_SYMBOL_ALIGNMENT 0x0040 // alignment to be shown in the options +#define NUM_NO_NUMBERS 0x0080 // Numbering are not allowed #define NUM_ENABLE_LINKED_BMP 0x0100 // linked bitmaps are available #define NUM_ENABLE_EMBEDDED_BMP 0x0200 // embedded bitmaps are available -#define SVX_NO_NUM 200 // Markierung fuer keine Numerierung +#define SVX_NO_NUM 200 // Marker for no numbering #define SVX_NO_NUMLEVEL 0x20 #define LINK_TOKEN 0x80 //indicate linked bitmaps - for use in dialog only @@ -77,7 +77,7 @@ class EDITENG_DLLPUBLIC SvxNumberType static com::sun::star::uno::Reference xFormatter; sal_Int16 nNumType; - sal_Bool bShowSymbol; // Symbol auch anzeigen? + sal_Bool bShowSymbol; // Also show Symbol ? public: SvxNumberType(sal_Int16 nType = com::sun::star::style::NumberingType::ARABIC); @@ -122,12 +122,12 @@ private: SvxAdjust eNumAdjust; - BYTE nInclUpperLevels; //Nummern aus der vorigen Ebenen uebernehmen - USHORT nStart; //Start der Zaehlung + BYTE nInclUpperLevels; // Take over numbers from the previous level. + USHORT nStart; // Start of counting - sal_Unicode cBullet; //Symbol - USHORT nBulletRelSize; //proz. Groesse des Bullets - Color nBulletColor; //Bullet color + sal_Unicode cBullet; // Symbol + USHORT nBulletRelSize; // percentage size of bullets + Color nBulletColor; // Bullet color // mode indicating, if the position and spacing of the list label is // determined by the former attributes (nFirstLineOffset, nAbsLSpace, @@ -140,10 +140,10 @@ private: // LABEL_ALIGNMENT is active. SvxNumPositionAndSpaceMode mePositionAndSpaceMode; - short nFirstLineOffset; //Erstzeileneinzug - short nAbsLSpace; //Abstand Rand<->Nummer - short nLSpace; //relative Einrueckung zum Vorgaenger - short nCharTextDistance; //Abstand Nummer<->Text + short nFirstLineOffset; // First line indent + short nAbsLSpace; // Distance Border<->Number + short nLSpace; // relative to the previous indentation + short nCharTextDistance; // Distance Number<->Text // specifies what follows the list label before the text of the first line // of the list item starts @@ -155,13 +155,13 @@ private: // specifies the indent before the text, e.g. in L2R-layout the left margin long mnIndentAt; - SvxBrushItem* pGraphicBrush; // - sal_Int16 eVertOrient; // vert. Ausrichtung einer Bitmap + SvxBrushItem* pGraphicBrush; + sal_Int16 eVertOrient; // vertical alignment of a bitmap - Size aGraphicSize; // immer! in 1/100 mm - Font* pBulletFont; // Pointer auf den BulletFont + Size aGraphicSize; // Always! in 1/100 mm + Font* pBulletFont; // Pointer to the bullet font - String sCharStyleName; // Zeichenvorlage + String sCharStyleName; // Character Style BitmapEx* pScaledImageCache; // Image scaled to aGraphicSize, only cached for WINDOW/VDEV @@ -248,13 +248,13 @@ enum SvxNumRuleType class EDITENG_DLLPUBLIC SvxNumRule { - USHORT nLevelCount; // Anzahl der unterstuetzten Levels - ULONG nFeatureFlags; // was wird unterstuetzt? - SvxNumRuleType eNumberingType; // was fuer eine Numerierung - BOOL bContinuousNumbering; // fortlaufende Numerierung + USHORT nLevelCount; // Number of supported levels + ULONG nFeatureFlags; // What is supported? + SvxNumRuleType eNumberingType; // Type of numbering + BOOL bContinuousNumbering; // sequential numbering SvxNumberFormat* aFmts[SVX_MAX_NUM]; - BOOL aFmtsSet[SVX_MAX_NUM]; //Flags ueber Gueltigkeit der Ebenen + BOOL aFmtsSet[SVX_MAX_NUM]; // Flags indicating valid levels static sal_Int32 nRefCount; com::sun::star::lang::Locale aLocale; @@ -324,10 +324,10 @@ public: class SvxNodeNum { - USHORT nLevelVal[ SVX_MAX_NUM ]; // Nummern aller Levels - USHORT nSetValue; // vorgegebene Nummer - BYTE nMyLevel; // akt. Level - BOOL bStartNum; // Numerierung neu starten + USHORT nLevelVal[ SVX_MAX_NUM ]; // Numbers of all levels + USHORT nSetValue; // predetermined number + BYTE nMyLevel; // Current Level + BOOL bStartNum; // Restart numbering public: inline SvxNodeNum( BYTE nLevel = SVX_NO_NUM, USHORT nSetVal = USHRT_MAX ); diff --git a/editeng/inc/editeng/opaqitem.hxx b/editeng/inc/editeng/opaqitem.hxx index 1ba3648..204becb 100644 --- a/editeng/inc/editeng/opaqitem.hxx +++ b/editeng/inc/editeng/opaqitem.hxx @@ -42,9 +42,9 @@ namespace rtl // class SvxOpaqueItem --------------------------------------------------- -/* -[Beschreibung] -Dieses Item beschreibt eine logische Variable "Undurchsichtig ja oder nein". +/* [Description] + + This item describes a logical variable "Opaque yes or no." */ class EDITENG_DLLPUBLIC SvxOpaqueItem : public SfxBoolItem @@ -55,7 +55,7 @@ public: SvxOpaqueItem( const USHORT nId , const BOOL bOpa = TRUE ); inline SvxOpaqueItem &operator=( const SvxOpaqueItem &rCpy ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; diff --git a/editeng/inc/editeng/orphitem.hxx b/editeng/inc/editeng/orphitem.hxx index d975116..c6d7b57 100644 --- a/editeng/inc/editeng/orphitem.hxx +++ b/editeng/inc/editeng/orphitem.hxx @@ -41,9 +41,9 @@ namespace rtl // class SvxOrphansItem -------------------------------------------------- -/* -[Beschreibung] -Dieses Item beschreibt die Anzahl der Zeilen fuer die Schusterjungenregelung. +/* [Description] + + This item describes the number of lines for the orphans system. */ class EDITENG_DLLPUBLIC SvxOrphansItem: public SfxByteItem @@ -54,7 +54,7 @@ public: SvxOrphansItem( const BYTE nL /*= 0*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx index bf8cce8..9264eec 100644 --- a/editeng/inc/editeng/outliner.hxx +++ b/editeng/inc/editeng/outliner.hxx @@ -45,7 +45,7 @@ #include -#include // wegen typedef TypeId +#include // due to typedef TypeId #include class OutlinerEditEng; @@ -100,7 +100,7 @@ typedef std::vector SpellPortions; namespace basegfx { class B2DPolyPolygon; } -// nur interner Gebrauch! +// internal use only! #define PARAFLAG_DROPTARGET 0x1000 #define PARAFLAG_DROPTARGET_EMPTY 0x2000 #define PARAFLAG_HOLDDEPTH 0x4000 @@ -218,8 +218,8 @@ private: enum MouseTarget { MouseText = 0, MouseBullet = 1, - MouseHypertext = 2, // ausserhalb OutputArea - MouseOutside = 3, // ausserhalb OutputArea + MouseHypertext = 2, // Outside OutputArea + MouseOutside = 3, // Outside OutputArea MouseDontKnow = 4 }; MouseTarget OLD_ePrevMouseTarget; @@ -284,8 +284,7 @@ public: List* CreateSelectionList(); - // gibt Anzahl selektierter Absaetze zurueck - // MT 07/00: Who needs this? + // Retruns the number of selected paragraphs ULONG Select( Paragraph* pParagraph, BOOL bSelect=TRUE, BOOL bWChilds=TRUE); @@ -294,7 +293,7 @@ public: void SelectRange( ULONG nFirst, USHORT nCount ); void SetAttribs( const SfxItemSet& ); void Indent( short nDiff ); - void AdjustDepth( short nDX ); // Spaeter gegeb Indent ersetzen! + void AdjustDepth( short nDX ); // Later replace with Indent! BOOL AdjustHeight( long nDY ); void AdjustDepth( Paragraph* pPara, short nDX, @@ -415,7 +414,6 @@ public: const Color maOverlineColor; const Color maTextLineColor; - // #101498# BiDi level needs to be transported, too. BYTE mnBiDiLevel; bool mbFilled; @@ -633,7 +631,7 @@ class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster USHORT nOutlinerMode; - BOOL bIsExpanding; // Nur in Expand/Collaps-Hdl gueltig, mal umstellen + BOOL bIsExpanding; // Only valid in Expand/Collaps-Hdl, reset BOOL bFirstParaIsEmpty; BOOL bBlockInsCallback; BOOL bStrippingPortions; @@ -813,9 +811,10 @@ public: virtual long IndentingPagesHdl( OutlinerView* ); void SetIndentingPagesHdl(const Link& rLink){aIndentingPagesHdl=rLink;} Link GetIndentingPagesHdl() const { return aIndentingPagesHdl; } - // nur gueltig in den beiden oberen Handlern + // valid only in the two upper handlers USHORT GetSelPageCount() const { return nDepthChangedHdlPrevDepth; } - // nur gueltig in den beiden oberen Handlern + + // valid only in the two upper handlers ULONG GetFirstSelPage() const { return mnFirstSelPage; } void SetCalcFieldValueHdl(const Link& rLink ) { aCalcFieldValueHdl= rLink; } @@ -883,7 +882,6 @@ public: void StripPortions(); - // #101498# virtual void DrawingText( const Point& rStartPos, const String& rText, USHORT nTextStart, USHORT nTextLen, const sal_Int32* pDXArray, const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft, @@ -927,8 +925,8 @@ public: void RemoveParaFlag( Paragraph* pPara, sal_uInt16 nFlag ); bool HasParaFlag( const Paragraph* pPara, sal_uInt16 nFlag ) const; - // gibt ein Array mit den Bulletbreiten der n Einrueckebenen - // zurueck. Letzter Wert muss -1 sein. Wird vom Outliner geloescht. + // Returns an array containing the widths of the Bullet Indentations + // Last value must be -1. Is deleted by the outliner. Link GetWidthArrReqHdl() const{ return aWidthArrReqHdl; } void SetWidthArrReqHdl(const Link& rLink){aWidthArrReqHdl=rLink; } @@ -944,7 +942,7 @@ public: USHORT GetLineLen( ULONG nParagraph, USHORT nLine ) const; ULONG GetLineHeight( ULONG nParagraph, ULONG nLine = 0 ); - // nFormat muss ein Wert aus dem enum EETextFormat sein (wg.CLOOKS) + // nFormat must be a value from the enum EETextFormat (due to CLOOKS) ULONG Read( SvStream& rInput, const String& rBaseURL, USHORT, SvKeyValueIterator* pHTTPHeaderAttrs = NULL ); SfxUndoManager& GetUndoManager(); @@ -953,7 +951,7 @@ public: void QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ); void QuickInsertLineBreak( const ESelection& rSel ); - // nur fuer EditEngine-Modus + // Only for EditEngine mode void QuickInsertText( const String& rText, const ESelection& rSel ); void QuickDelete( const ESelection& rSel ); void QuickRemoveCharAttribs( USHORT nPara, USHORT nWhich = 0 ); @@ -1027,11 +1025,11 @@ public: USHORT GetOutlinerMode() const { return nOutlinerMode & OUTLINERMODE_USERMASK; } void StartSpelling(EditView& rEditView, sal_Bool bMultipleDoc); - //spell and return a sentence + // spell and return a sentence bool SpellSentence(EditView& rEditView, ::svx::SpellPortions& rToFill, bool bIsGrammarChecking ); // put spell position to start of current sentence void PutSpellingToSentenceStart( EditView& rEditView ); - //applies a changed sentence + // applies a changed sentence void ApplyChangedSentence(EditView& rEditView, const ::svx::SpellPortions& rNewPortions, bool bRecheck ); void EndSpelling(); diff --git a/editeng/inc/editeng/paragraphdata.hxx b/editeng/inc/editeng/paragraphdata.hxx index b869a80..778dbde 100644 --- a/editeng/inc/editeng/paragraphdata.hxx +++ b/editeng/inc/editeng/paragraphdata.hxx @@ -33,10 +33,10 @@ #include ////////////////////////////////////////////////////////////////////////////// -// MT 07/00: Only for internal use, oder some kind like hPara for the few +// Only for internal use, oder some kind like hPara for the few // functions where you need it outside ( eg. moving paragraphs... ) // -// AW: Unfortunately NOT only local (formally in outliner.hxx), but also +// Unfortunately NOT only local (formally in outliner.hxx), but also // used in outlobj.hxx. Moved to own header class ParagraphData diff --git a/editeng/inc/editeng/pbinitem.hxx b/editeng/inc/editeng/pbinitem.hxx index 6f217a1..67518bd 100644 --- a/editeng/inc/editeng/pbinitem.hxx +++ b/editeng/inc/editeng/pbinitem.hxx @@ -39,9 +39,9 @@ // class SvxPaperBinItem ------------------------------------------------- -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt die Auswahl eines Papierschachts des Drucker. + This item describes selecting a paper tray of the printer. */ class EDITENG_DLLPUBLIC SvxPaperBinItem : public SfxByteItem @@ -53,7 +53,7 @@ public: const BYTE nTray = PAPERBIN_PRINTER_SETTINGS ); inline SvxPaperBinItem &operator=( const SvxPaperBinItem &rCpy ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create( SvStream &, USHORT ) const; virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const; diff --git a/editeng/inc/editeng/pgrditem.hxx b/editeng/inc/editeng/pgrditem.hxx index 16877f5..46d2950 100644 --- a/editeng/inc/editeng/pgrditem.hxx +++ b/editeng/inc/editeng/pgrditem.hxx @@ -36,8 +36,8 @@ // class SvxParaGridItem ------------------------------------------------- -/* - [Beschreibung] +/* [Description] + Paragraph snap to grid */ @@ -49,7 +49,7 @@ public: SvxParaGridItem( const BOOL bSnapToGrid /*= TRUE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual USHORT GetVersion( USHORT nFileVersion ) const; diff --git a/editeng/inc/editeng/pmdlitem.hxx b/editeng/inc/editeng/pmdlitem.hxx index a474e28..ec31066 100644 --- a/editeng/inc/editeng/pmdlitem.hxx +++ b/editeng/inc/editeng/pmdlitem.hxx @@ -35,9 +35,9 @@ // class SvxPageModelItem ------------------------------------------------ -/* -[Beschreibung] -Dieses Item enthaelt einen Namen einer Seitenvorlage. +/* [Description] + + This item contains a name of a page template. */ class EDITENG_DLLPUBLIC SvxPageModelItem : public SfxStringItem diff --git a/editeng/inc/editeng/postitem.hxx b/editeng/inc/editeng/postitem.hxx index 2b0e863..2ba5365 100644 --- a/editeng/inc/editeng/postitem.hxx +++ b/editeng/inc/editeng/postitem.hxx @@ -42,9 +42,9 @@ namespace rtl // class SvxPostureItem -------------------------------------------------- -/* - [Beschreibung] - Dieses Item beschreibt die Font-Stellung (Italic) +/* [Description] + + This item describes the font setting (Italic) */ class EDITENG_DLLPUBLIC SvxPostureItem : public SfxEnumItem @@ -55,7 +55,7 @@ public: SvxPostureItem( const FontItalic ePost /*= ITALIC_NONE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + SwEnumItem + // "pure virtual Methods" from SfxPoolItem + SwEnumItem virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, diff --git a/editeng/inc/editeng/prntitem.hxx b/editeng/inc/editeng/prntitem.hxx index d05b935..e0ce99f 100644 --- a/editeng/inc/editeng/prntitem.hxx +++ b/editeng/inc/editeng/prntitem.hxx @@ -38,9 +38,9 @@ // class SvxPrintItem ---------------------------------------------------- -/* -[Beschreibung] -Dieses Item beschreibt eine logische Variable "Drucken ja oder nein". +/* [Description] + + This item describes a logical variable "Print yes or no". */ @@ -52,7 +52,7 @@ public: SvxPrintItem( const USHORT nId , const BOOL bPrt = TRUE ); inline SvxPrintItem &operator=( const SvxPrintItem &rCpy ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; diff --git a/editeng/inc/editeng/protitem.hxx b/editeng/inc/editeng/protitem.hxx index dec9414..95c9c6b 100644 --- a/editeng/inc/editeng/protitem.hxx +++ b/editeng/inc/editeng/protitem.hxx @@ -43,17 +43,16 @@ namespace rtl // class SvxProtectItem -------------------------------------------------- -/* -[Beschreibung] -Dieses Item beschreibt, ob Inhalt, Groesse oder Position geschuetzt werden -sollen. +/* [Description] + + This item describes, if content, size or position should be protected. */ class EDITENG_DLLPUBLIC SvxProtectItem : public SfxPoolItem { - BOOL bCntnt :1; //Inhalt geschuetzt - BOOL bSize :1; //Groesse geschuetzt - BOOL bPos :1; //Position geschuetzt + BOOL bCntnt :1; // Content protected + BOOL bSize :1; // Size protected + BOOL bPos :1; // Position protected public: TYPEINFO(); @@ -61,7 +60,7 @@ public: inline SvxProtectItem( const USHORT nId ); inline SvxProtectItem &operator=( const SvxProtectItem &rCpy ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, diff --git a/editeng/inc/editeng/prszitem.hxx b/editeng/inc/editeng/prszitem.hxx index d0eec00..4effacc 100644 --- a/editeng/inc/editeng/prszitem.hxx +++ b/editeng/inc/editeng/prszitem.hxx @@ -35,9 +35,9 @@ // class SvxPropSizeItem ------------------------------------------------- -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt die relative Schriftgroesse. + This item describes the relative Font Size. */ class EDITENG_DLLPUBLIC SvxPropSizeItem : public SfxUInt16Item @@ -48,7 +48,7 @@ public: SvxPropSizeItem( const USHORT nPercent /*= 100*/, const USHORT nID ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; diff --git a/editeng/inc/editeng/scriptspaceitem.hxx b/editeng/inc/editeng/scriptspaceitem.hxx index a2c9b41..b2eb098 100644 --- a/editeng/inc/editeng/scriptspaceitem.hxx +++ b/editeng/inc/editeng/scriptspaceitem.hxx @@ -37,7 +37,7 @@ /* [Description] - This item describe the scriptype of the selected text and is only + This item describe the script type of the selected text and is only used for the user interface. */ diff --git a/editeng/inc/editeng/scripttypeitem.hxx b/editeng/inc/editeng/scripttypeitem.hxx index 45d93ea..ae29460 100644 --- a/editeng/inc/editeng/scripttypeitem.hxx +++ b/editeng/inc/editeng/scripttypeitem.hxx @@ -38,7 +38,7 @@ /* [Description] - This item describe the scriptype of the selected text and is only + This item describes the script type of the selected text and is only used for the user interface. */ diff --git a/editeng/inc/editeng/shaditem.hxx b/editeng/inc/editeng/shaditem.hxx index 1ecaa39..6477d4c 100644 --- a/editeng/inc/editeng/shaditem.hxx +++ b/editeng/inc/editeng/shaditem.hxx @@ -42,9 +42,9 @@ namespace rtl // class SvxShadowItem --------------------------------------------------- -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt ein Schattenattribut (Farbe, Breite, Lage). + This item describes the shadow attribute (color, width and position). */ #define SHADOW_TOP ((USHORT)0) @@ -66,7 +66,7 @@ public: inline SvxShadowItem& operator=( const SvxShadowItem& rFmtShadow ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); @@ -91,7 +91,7 @@ public: void SetWidth( USHORT nNew ) { nWidth = nNew; } void SetLocation( SvxShadowLocation eNew ) { eLocation = eNew; } - //Breite des Schattens auf der jeweiligen Seite berechnen. + // Calculate width of the shadow on the page. USHORT CalcShadowSpace( USHORT nShadow ) const; virtual USHORT GetValueCount() const; diff --git a/editeng/inc/editeng/shdditem.hxx b/editeng/inc/editeng/shdditem.hxx index ec47d7e..1863ce4 100644 --- a/editeng/inc/editeng/shdditem.hxx +++ b/editeng/inc/editeng/shdditem.hxx @@ -41,9 +41,9 @@ namespace rtl // class SvxShadowedItem ------------------------------------------------- -/* - [Beschreibung] - Dieses Item beschreibt, ob und wie schattiert ist. +/* [Description] + + This item describes, whether and how it is shaded. */ class EDITENG_DLLPUBLIC SvxShadowedItem : public SfxBoolItem @@ -54,7 +54,7 @@ public: SvxShadowedItem( const BOOL bShadowed /*= FALSE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; diff --git a/editeng/inc/editeng/sizeitem.hxx b/editeng/inc/editeng/sizeitem.hxx index a3b7180..3622086 100644 --- a/editeng/inc/editeng/sizeitem.hxx +++ b/editeng/inc/editeng/sizeitem.hxx @@ -36,9 +36,9 @@ // class SvxSizeItem ----------------------------------------------------- -/* -[Beschreibung] -Dieses Item beschreibt eine zweidimensionale Groesse (Size). +/* [Description] + + This item describes a two-dimensional size. */ class EDITENG_DLLPUBLIC SvxSizeItem : public SfxPoolItem @@ -54,7 +54,7 @@ public: inline SvxSizeItem& operator=( const SvxSizeItem &rCpy ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); diff --git a/editeng/inc/editeng/spltitem.hxx b/editeng/inc/editeng/spltitem.hxx index 311f0e1..25cb62a 100644 --- a/editeng/inc/editeng/spltitem.hxx +++ b/editeng/inc/editeng/spltitem.hxx @@ -41,9 +41,9 @@ namespace rtl // class SvxFmtSplitItem ------------------------------------------------- -/* -[Beschreibung] -Dieses Item beschreibt eine logische Variable "Absatz trennen ja oder nein". +/* [Description] + + This item describes a logical variable "split paragraph yes or no". */ class EDITENG_DLLPUBLIC SvxFmtSplitItem : public SfxBoolItem @@ -56,7 +56,7 @@ public: const USHORT nWh ); inline SvxFmtSplitItem& operator=( const SvxFmtSplitItem& rSplit ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create( SvStream&, USHORT ) const; virtual SvStream& Store( SvStream& , USHORT nItemVersion ) const; diff --git a/editeng/inc/editeng/splwrap.hxx b/editeng/inc/editeng/splwrap.hxx index 67d03a7..bc45535 100644 --- a/editeng/inc/editeng/splwrap.hxx +++ b/editeng/inc/editeng/splwrap.hxx @@ -50,7 +50,7 @@ class Window; void EDITENG_DLLPUBLIC SvxPrepareAutoCorrect( String &rOldText, String &rNewText ); /*-------------------------------------------------------------------- - Beschreibung: Der SpellWrapper + Description: The SpellWrapper --------------------------------------------------------------------*/ class EDITENG_DLLPUBLIC SvxSpellWrapper { @@ -66,21 +66,21 @@ private: ::com::sun::star::linguistic2::XSpellChecker1 > xSpell; ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenator > xHyph; - sal_uInt16 nOldLang; // Sprache merken, nur bei Aenderung SetLanguage rufen - sal_Bool bOtherCntnt : 1; // gesetzt => Sonderbereiche zunaechst pruefen - sal_Bool bDialog : 1; // Ist pWin der Svx...Dialog? - sal_Bool bHyphen : 1; // Trennen statt Spellen - sal_Bool bAuto : 1; // Autokorrektur vorhanden? - sal_Bool bReverse : 1; // Rueckwaerts Spellen - sal_Bool bStartDone : 1; // Vorderen Teil bereits korrigiert - sal_Bool bEndDone : 1; // Hinteren Teil bereits korrigiert - sal_Bool bStartChk : 1; // Vorderen Teil pruefen - sal_Bool bRevAllowed : 1; // Niemals rueckwaerts spellen - sal_Bool bAllRight : 1; // falsche Woerter in geignetes Woerterbuch - // aufnehmen und nicht den Dialog starten. - - EDITENG_DLLPRIVATE sal_Bool SpellNext(); // naechsten Bereich anwaehlen - sal_Bool FindSpellError(); // Suche nach Fehlern ( ueber Bereiche hinweg ) + sal_uInt16 nOldLang; // Set Language, only call SetLanguage on changes + sal_Bool bOtherCntnt : 1; // set => Check special sections initially + sal_Bool bDialog : 1; // Is pWin the Svx...Dialog? + sal_Bool bHyphen : 1; // Split instead of spell checking + sal_Bool bAuto : 1; // AutoCorrect available? + sal_Bool bReverse : 1; // Reverse spell check + sal_Bool bStartDone : 1; // Beginning already corrected + sal_Bool bEndDone : 1; // End part already corrected + sal_Bool bStartChk : 1; // Examine the beginning + sal_Bool bRevAllowed : 1; // Reverse spell check prohibited + sal_Bool bAllRight : 1; // Record wrong words in the dedicated + // dictionary and do not start the dialog. + + EDITENG_DLLPRIVATE sal_Bool SpellNext(); // select next area + sal_Bool FindSpellError(); // Check for errors (over areas) public: SvxSpellWrapper( Window* pWn, @@ -106,12 +106,12 @@ public: static void ShowLanguageErrors(); - void SpellDocument(); // Rechtschreibpruefung durchfuehren + void SpellDocument(); // Perform Spell Checking inline sal_Bool IsStartDone(){ return bStartDone; } inline sal_Bool IsEndDone(){ return bEndDone; } inline sal_Bool IsReverse(){ return bReverse; } inline sal_Bool IsDialog(){ return bDialog; } // SvxSpellCheckDialog OnScreen - inline sal_Bool IsHyphen(){ return bHyphen; } // Trennen statt Spellen + inline sal_Bool IsHyphen(){ return bHyphen; } // Split instead of Spell check inline void SetHyphen( const sal_Bool bNew = sal_True ){ bHyphen = bNew; } inline ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > @@ -121,10 +121,10 @@ public: GetXHyphenator() { return xHyph; } inline sal_Bool IsAllRight() { return bAllRight; } inline Window* GetWin() { return pWin; } - // kann evtl entfallen in ONE_LINGU: + // can possibly be omitted in ONE_LINGU: inline void SetOldLang( const sal_uInt16 nNew ){ nOldLang = nNew; } - // kann evtl entfallen in ONE_LINGU: - inline void ChangeLanguage( const sal_uInt16 nNew ) // rufe ggf. SetLanguage + // can possibly be omitted in ONE_LINGU: + inline void ChangeLanguage( const sal_uInt16 nNew ) // call SetLanguage if needed. { if ( nNew != nOldLang ) { SetLanguage( nNew ); nOldLang = nNew; } } inline void EnableAutoCorrect() { bAuto = sal_True; } @@ -135,26 +135,26 @@ protected: void SetLast(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > &xNewLast) { xLast = xNewLast; } - virtual sal_Bool SpellMore(); // weitere Dokumente pruefen? - virtual sal_Bool HasOtherCnt(); // gibt es ueberhaupt Sonderbereiche - virtual void SpellStart( SvxSpellArea eSpell ); // Bereich vorbereiten - virtual sal_Bool SpellContinue(); // Bereich pruefen - // Ergebnis mit GetLast verfuegbar - virtual void ReplaceAll( const String &rNewText, sal_Int16 nLanguage ); // Wort aus Replace-Liste ersetzen - virtual void StartThesaurus( const String &rWord, sal_uInt16 nLang ); // Thesaurus starten + virtual sal_Bool SpellMore(); // examine further documents? + virtual sal_Bool HasOtherCnt(); // Are there any special areas? + virtual void SpellStart( SvxSpellArea eSpell ); // Preparing the area + virtual sal_Bool SpellContinue(); // Check Areas + // Result avaliable through GetLast + virtual void ReplaceAll( const String &rNewText, sal_Int16 nLanguage ); //Replace word from the replace list + virtual void StartThesaurus( const String &rWord, sal_uInt16 nLang ); virtual ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetAllRightDic() const; - virtual void SpellEnd(); // Bereich abschliessen - virtual void ScrollArea(); // ScrollArea einstellen - // Wort ersetzen + virtual void SpellEnd(); // Finish area + virtual void ScrollArea(); // Set ScrollArea + // Replace word virtual void ChangeWord( const String& rNewWord, const sal_uInt16 nLang ); virtual String GetThesWord(); // Wort via Thesaurus ersetzen virtual void ChangeThesWord( const String& rNewWord ); - virtual void SetLanguage( const sal_uInt16 nLang ); // Sprache aendern + virtual void SetLanguage( const sal_uInt16 nLang ); // Change Language virtual void AutoCorrect( const String& rAktStr, const String& rNewStr ); - virtual void InsertHyphen( const sal_uInt16 nPos ); // Hyphen einfuegen + virtual void InsertHyphen( const sal_uInt16 nPos ); // Insert hyphen }; diff --git a/editeng/inc/editeng/svxacorr.hxx b/editeng/inc/editeng/svxacorr.hxx index fe8b7ca..6a245f2 100644 --- a/editeng/inc/editeng/svxacorr.hxx +++ b/editeng/inc/editeng/svxacorr.hxx @@ -50,29 +50,29 @@ class SotStorageRef; class SotStorage; class Window; -// Flags fuer die AutoKorrekt-Flags -const long CptlSttSntnc = 0x00000001; // Gross-Buchstaben am SatzAnfang -const long CptlSttWrd = 0x00000002; // keine 2 Gr.-Buchst. am WordAnfang +// Auto correct flags +const long CptlSttSntnc = 0x00000001; // Capital letters at the beginning of a sentence +const long CptlSttWrd = 0x00000002; // not two Capital letters at the beginning of a word const long AddNonBrkSpace = 0x00000004; // Add non breaking space before :;?! const long ChgOrdinalNumber = 0x00000008; // Ordinal-Number 1st, 2nd,.. const long ChgToEnEmDash = 0x00000010; // - -> Endash/Emdash -const long ChgWeightUnderl = 0x00000020; // * -> Fett, _ -> unterstreichen -const long SetINetAttr = 0x00000040; // INetAttribut setzen -const long Autocorrect = 0x00000080; // Autokorrektur aufrufen -const long ChgQuotes = 0x00000100; // doppelte Quotes ersetzen -const long SaveWordCplSttLst= 0x00000200; // GrB. am SatzAnf. auto. aufnehmen -const long SaveWordWrdSttLst= 0x00000400; // 2 GrB. am WortAnf. auto. aufnehmen -const long IgnoreDoubleSpace= 0x00000800; // 2 Spaces ignorieren -const long ChgSglQuotes = 0x00001000; // einfache Quotes ersetzen +const long ChgWeightUnderl = 0x00000020; // * -> Bold, _ -> Underscore +const long SetINetAttr = 0x00000040; // Set INetAttribut +const long Autocorrect = 0x00000080; // Call AutoCorrect +const long ChgQuotes = 0x00000100; // replace double quotes +const long SaveWordCplSttLst= 0x00000200; // Save Auto correction of Capital letter at beginning of sentence. +const long SaveWordWrdSttLst= 0x00000400; // Save Auto correction of 2 Capital letter at beginning of word. +const long IgnoreDoubleSpace= 0x00000800; // Ignore 2 Spaces +const long ChgSglQuotes = 0x00001000; // Replace simple quotes const long CorrectCapsLock = 0x00002000; // Correct accidental use of cAPS LOCK key -const long ChgWordLstLoad = 0x20000000; // Ersetzungsliste geladen -const long CplSttLstLoad = 0x40000000; // Exceptionlist fuer CplStart geladen -const long WrdSttLstLoad = 0x80000000; // Exceptionlist fuer WordStart geladen +const long ChgWordLstLoad = 0x20000000; // Replacement list loaded +const long CplSttLstLoad = 0x40000000; // Exception list for Capital letters Start loaded +const long WrdSttLstLoad = 0x80000000; // Exception list for Word Start loaded // TODO: handle unicodes > U+FFFF and check users of this class -// nur eine Mappingklasse +// only a mapping class class EDITENG_DLLPUBLIC SvxAutoCorrDoc { public: @@ -88,28 +88,26 @@ public: virtual BOOL SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const String& rURL ) = 0; - // returne den Text eines vorherigen Absatzes. - // Dieser darf nicht leer sein! - // Gibt es diesen nicht oder gibt es davor nur Leere, dann returne 0 - // Das Flag gibt an: - // TRUE: den, vor der normalen Einfuegeposition (TRUE) - // FALSE: den, in den das korrigierte Wort eingfuegt wurde. - // (Muss nicht der gleiche Absatz sein!!!!) + // Return the text of a previous paragraph. This must not be empty! + // If no paragraph exits or just an empty one, then return 0. + // The flag indicates: + // TRUE: before the normal insertion position (TRUE) + // FALSE: in which the corrected word was inserted. + // (Does not to have to be the same paragraph !!!!) virtual const String* GetPrevPara( BOOL bAtNormalPos ) = 0; virtual BOOL ChgAutoCorrWord( xub_StrLen& rSttPos, xub_StrLen nEndPos, SvxAutoCorrect& rACorrect, const String** ppPara ) = 0; - // wird nach dem austauschen der Zeichen von den Funktionen + // Is called after the change of the signs by the functions // - FnCptlSttWrd // - FnCptlSttSntnc - // gerufen. Dann koennen die Worte ggfs. in die Ausnahmelisten - // aufgenommen werden. + // As an option, the words can then be inserted into the exception lists. virtual void SaveCpltSttWord( ULONG nFlag, xub_StrLen nPos, const String& rExceptWord, sal_Unicode cChar ); - // welche Sprache gilt an der Position? + // which language at the position? virtual LanguageType GetLanguage( xub_StrLen nPos, BOOL bPrevPara = FALSE ) const; }; @@ -117,7 +115,7 @@ public: class EDITENG_DLLPUBLIC SvxAutocorrWord { String sShort, sLong; - BOOL bIsTxtOnly; // ist reiner ASCII - Text + BOOL bIsTxtOnly; // Is pure ASCII - Text public: SvxAutocorrWord( const String& rS, const String& rL, BOOL bFlag = TRUE ) : sShort( rS ), sLong( rL ), bIsTxtOnly( bFlag ) @@ -134,11 +132,11 @@ SV_DECL_PTRARR_SORT_DEL_VISIBILITY( SvxAutocorrWordList, SvxAutocorrWordPtr, 10, class EDITENG_DLLPUBLIC SvxAutoCorrectLanguageLists { String sShareAutoCorrFile, sUserAutoCorrFile; - // falls die AutoCorr Datei neuer ist + // If the AutoCorr file is newer Date aModifiedDate; Time aModifiedTime, aLastCheckTime; - LanguageType eLanguage; //LANGUAGE_DONTKNOW fuer alle Sprachen verwenden + LanguageType eLanguage; //LANGUAGE_DONTKNOW use for all languages SvStringsISortDtor* pCplStt_ExcptLst; SvStringsISortDtor* pWrdStt_ExcptLst; SvxAutocorrWordList* pAutocorr_List; @@ -166,35 +164,35 @@ public: LanguageType eLang); ~SvxAutoCorrectLanguageLists(); - // Lade, Setze, Gebe - die Ersetzungsliste + // Load, Set, Get - the replacement list SvxAutocorrWordList* LoadAutocorrWordList(); void SetAutocorrWordList( SvxAutocorrWordList* pList ); const SvxAutocorrWordList* GetAutocorrWordList(); - // Lade, Setze, Gebe - die Ausnahmeliste fuer Grossbuchstabe am - // Satzanfang + // Load, Set, Get - the exception list for Capital letter at the + // beginning of a sentence SvStringsISortDtor* LoadCplSttExceptList(); void SaveCplSttExceptList(); void SetCplSttExceptList( SvStringsISortDtor* pList ); SvStringsISortDtor* GetCplSttExceptList(); BOOL AddToCplSttExceptList(const String& rNew); - // Lade, Setze, Gebe die Ausnahmeliste fuer 2 Grossbuchstaben am - // Wortanfang + // Load, Set, Get the exception list for 2 Capital letters at the + // begining of a word. SvStringsISortDtor* LoadWrdSttExceptList(); void SaveWrdSttExceptList(); void SetWrdSttExceptList( SvStringsISortDtor* pList ); SvStringsISortDtor* GetWrdSttExceptList(); BOOL AddToWrdSttExceptList(const String& rNew); - // Speichern von Wortersetzungen: - // Diese speichern direkt im Storage. Die Wortliste wird - // entsprechend aktualisiert! - // - purer Text + // Save word substitutions: + // Store these directly in the storage. The word list is updated + // accordingly! + // - pure Text BOOL PutText( const String& rShort, const String& rLong ); - // - Text mit Attributierung (kann nur der SWG - SWG-Format!) + // - Text with attribution (only the SWG - SWG format!) BOOL PutText( const String& rShort, SfxObjectShell& ); - // - loesche einen Eintrag + // - Deleting an entry BOOL DeleteText( const String& rShort ); }; @@ -205,9 +203,9 @@ class EDITENG_DLLPUBLIC SvxAutoCorrect String sShareAutoCorrFile, sUserAutoCorrFile; - SvxSwAutoFmtFlags aSwFlags; // StarWriter AutoFormat-Flags + SvxSwAutoFmtFlags aSwFlags; // StarWriter AutoFormat Flags - // alle Sprachen in einer Tabelle + // all languages in a table SvxAutoCorrLanguageTable_Impl* pLangTable; SvxAutoCorrLastFileAskTable_Impl* pLastFileTable; CharClass* pCharClass; @@ -227,16 +225,16 @@ class EDITENG_DLLPUBLIC SvxAutoCorrect void _GetCharClass( LanguageType eLang ); protected: - // - Text mit Attributierung (kann nur der SWG - SWG-Format!) - // rShort ist der Stream-Name - gecryptet! + // - Text with attribution (only the SWG - SWG format!) + // rShort is the stream name - encrypted! virtual BOOL PutText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rStg, const String& rFileName, const String& rShort, SfxObjectShell& , String& ); - // geforderte Sprache in die Tabelle eintragen gfs. nur wenn das file existiert + // required language in the table add if possible only when the file exists BOOL CreateLanguageFile(LanguageType eLang, BOOL bNewFile = TRUE); - // - return den Ersetzungstext (nur fuer SWG-Format, alle anderen - // koennen aus der Wortliste herausgeholt werden!) - // rShort ist der Stream-Name - gecryptet! + // - Return the replacement text (only for SWG format, all others can be + // taken from the word list!) + // rShort is the stream name - encrypted! public: sal_Unicode GetQuote( sal_Unicode cInsChar, BOOL bSttQuote, @@ -250,28 +248,28 @@ public: SvxAutoCorrect( const SvxAutoCorrect& ); virtual ~SvxAutoCorrect(); - // fuehre eine AutoKorrektur aus. - // returnt was ausgefuehrt wurde; entsprechend den obigen Flags + // Execute an AutoCorrect. + // Returns what has been executed, according to the above flags ULONG AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen nPos, sal_Unicode cInsChar, BOOL bInsert, Window* pFrameWin = NULL ); - // return fuer die Autotext Expandierung das vorherige Wort, was dem - // AutoCorrect - Algorythmus entspricht. + // Return for the autotext expansion the previous word, + // AutoCorrect - corresponding algorithm BOOL GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen nPos, String& rWord ) const; - // suche das oder die Worte in der ErsetzungsTabelle. - // rText - ueberpruefe in diesem Text die Worte der Liste - // rStt - die gefundene Startposition - // nEnd - zu ueberpruefende Position - ab dieser Pos nach vorne - // rLang - Input: in welcher Sprache wird gesucht - // Output: in welcher "Sprach-Liste" wurde es gefunden + // Search for or or the words in the replacement table. + // rText - check in this text the words of the list + // rStt - the detected starting position + // nEnd - to check position - as of this item forward + // rLang - Input: in which language is searched + // Output: in which "language list" was it found const SvxAutocorrWord* SearchWordsInList( const String& rTxt, xub_StrLen& rStt, xub_StrLen nEndPos, SvxAutoCorrDoc& rDoc, LanguageType& rLang ); - // erfrage / setze die Zeichen fuer die Quote-Ersetzung + // Query/Set the Character for the Quote substitution sal_Unicode GetStartSingleQuote() const { return cStartSQuote; } sal_Unicode GetEndSingleQuote() const { return cEndSQuote; } sal_Unicode GetStartDoubleQuote() const { return cStartDQuote; } @@ -287,22 +285,22 @@ public: void InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, sal_Unicode cInsChar, BOOL bSttQuote, BOOL bIns ); - // erfrage / setze den Namen der AutoKorrektur-Datei - // defaultet auf "autocorr.dat" + // Query/Set the name of the AutoCorrect file + // the default is "autocorr.dat" String GetAutoCorrFileName( LanguageType eLang = LANGUAGE_SYSTEM, BOOL bNewFile = FALSE, BOOL bTstUserExist = FALSE ) const; void SetUserAutoCorrFileName( const String& rNew ); void SetShareAutoCorrFileName( const String& rNew ); - // erfrage / setze die aktuellen Einstellungen der AutoKorrektur + // Query/Set the current settings of AutoCorrect long GetFlags() const { return nFlags; } inline SvxSwAutoFmtFlags& GetSwFlags() { return aSwFlags;} BOOL IsAutoCorrFlag( long nFlag ) const { return nFlags & nFlag ? TRUE : FALSE; } void SetAutoCorrFlag( long nFlag, BOOL bOn = TRUE ); - // Lade, Setze, Gebe - die Ersetzungsliste + // Load, Set, Get - the replacement list SvxAutocorrWordList* LoadAutocorrWordList( LanguageType eLang = LANGUAGE_SYSTEM ) { return _GetLanguageList( eLang ).LoadAutocorrWordList(); } @@ -310,21 +308,21 @@ public: LanguageType eLang = LANGUAGE_SYSTEM ) { return _GetLanguageList( eLang ).GetAutocorrWordList(); } - // Speichern von Wortersetzungen: - // Diese speichern direkt im Storage. Die Wortliste wird - // entsprechend aktualisiert! - // - purer Text + // Save word substitutions: + // Save these directly in the storage. The word list is updated + // accordingly! + // - pure Text BOOL PutText( const String& rShort, const String& rLong, LanguageType eLang = LANGUAGE_SYSTEM ); - // - Text mit Attributierung (kann nur der SWG - SWG-Format!) + // - Text with attribution (only in the SWG - SWG format!) BOOL PutText( const String& rShort, SfxObjectShell& rShell, LanguageType eLang = LANGUAGE_SYSTEM ) { return _GetLanguageList( eLang ).PutText(rShort, rShell ); } - // - loesche einen Eintrag + // - Delete a entry BOOL DeleteText( const String& rShort, LanguageType eLang = LANGUAGE_SYSTEM); - // Lade, Setze, Gebe - die Ausnahmeliste fuer Grossbuchstabe am - // Satzanfang + // Load, Set, Get - the exception list for capital letters at the + // beginning of a sentence void SaveCplSttExceptList( LanguageType eLang = LANGUAGE_SYSTEM ); SvStringsISortDtor* LoadCplSttExceptList( LanguageType eLang = LANGUAGE_SYSTEM) @@ -333,13 +331,12 @@ public: LanguageType eLang = LANGUAGE_SYSTEM ) { return _GetLanguageList( eLang ).GetCplSttExceptList(); } - // fuegt ein einzelnes Wort hinzu. Die Liste wird sofort - // in die Datei geschrieben! + // Adds a single word. The list will be immediately written to the file! BOOL AddCplSttException( const String& rNew, LanguageType eLang = LANGUAGE_SYSTEM ); - // Lade, Setze, Gebe die Ausnahmeliste fuer 2 Grossbuchstaben am - // Wortanfang + // Load, Set, Get the exception list for 2 Capital letters at the + // beginning of a word. void SaveWrdSttExceptList( LanguageType eLang = LANGUAGE_SYSTEM ); SvStringsISortDtor* LoadWrdSttExceptList( LanguageType eLang = LANGUAGE_SYSTEM ) @@ -347,16 +344,15 @@ public: const SvStringsISortDtor* GetWrdSttExceptList( LanguageType eLang = LANGUAGE_SYSTEM ) { return _GetLanguageList( eLang ).GetWrdSttExceptList(); } - // fuegt ein einzelnes Wort hinzu. Die Liste wird sofort - // in die Datei geschrieben! + // Adds a single word. The list will be immediately written to the file! BOOL AddWrtSttException( const String& rNew, LanguageType eLang = LANGUAGE_SYSTEM); - //ueber die Sprachen nach dem Eintrag suchen + // Search through the Languages for the entry BOOL FindInWrdSttExceptList( LanguageType eLang, const String& sWord ); BOOL FindInCplSttExceptList( LanguageType eLang, const String& sWord, BOOL bAbbreviation = FALSE); - // die einzelnen Methoden fuer die Autokorrektur + // Methods for the auto-correction BOOL FnCptlSttWrd( SvxAutoCorrDoc&, const String&, xub_StrLen nSttPos, xub_StrLen nEndPos, LanguageType eLang = LANGUAGE_SYSTEM ); diff --git a/editeng/inc/editeng/svxenum.hxx b/editeng/inc/editeng/svxenum.hxx index 37f0276..f9305e0 100644 --- a/editeng/inc/editeng/svxenum.hxx +++ b/editeng/inc/editeng/svxenum.hxx @@ -202,23 +202,23 @@ enum SvxSpellArea enum SvxFrameAnchor { - SVX_FLY_AT_CNTNT, //Absatzgebundener Rahmen - SVX_FLY_IN_CNTNT, //Zeichengebundener Rahmen - SVX_FLY_PAGE //Seitengebundener Rahmen + SVX_FLY_AT_CNTNT, // Paragraph-based frame + SVX_FLY_IN_CNTNT, // Character-based frame + SVX_FLY_PAGE // Page-based frame }; enum SvxExtNumType { - SVX_NUM_CHARS_UPPER_LETTER, // zaehlt von a-z, aa - az, ba - bz, ... + SVX_NUM_CHARS_UPPER_LETTER, // Counts from a-z, aa - az, ba - bz, ... SVX_NUM_CHARS_LOWER_LETTER, SVX_NUM_ROMAN_UPPER, SVX_NUM_ROMAN_LOWER, SVX_NUM_ARABIC, SVX_NUM_NUMBER_NONE, - SVX_NUM_CHAR_SPECIAL, //Bullet - SVX_NUM_PAGEDESC, // Numerierung aus der Seitenvorlage + SVX_NUM_CHAR_SPECIAL, // Bullet + SVX_NUM_PAGEDESC, // Numbering from the page template SVX_NUM_BITMAP, - SVX_NUM_CHARS_UPPER_LETTER_N, // zaehlt von a-z, aa-zz, aaa-zzz + SVX_NUM_CHARS_UPPER_LETTER_N, // Counts from a-z, aa-zz, aaa-zzz SVX_NUM_CHARS_LOWER_LETTER_N }; diff --git a/editeng/inc/editeng/svxfont.hxx b/editeng/inc/editeng/svxfont.hxx index c07a0eb..63751d7 100644 --- a/editeng/inc/editeng/svxfont.hxx +++ b/editeng/inc/editeng/svxfont.hxx @@ -45,9 +45,9 @@ class Printer; class EDITENG_DLLPUBLIC SvxFont : public Font { LanguageType eLang; // Language - SvxCaseMap eCaseMap; // Textauszeichnung - short nEsc; // Grad der Hoch-/Tiefstellung - BYTE nPropr; // Grad der Verkleinerung der Fonthoehe + SvxCaseMap eCaseMap; // Text Markup + short nEsc; // Degree of Superscript/Subscript + BYTE nPropr; // Degree of reduction of the font height short nKern; // Kerning in Pt public: @@ -55,7 +55,7 @@ public: SvxFont( const Font &rFont ); SvxFont( const SvxFont &rFont ); - // Methoden fuer die Hoch-/Tiefstellung + // Methods for Superscript/Subscript inline short GetEscapement() const { return nEsc; } inline void SetEscapement( const short nNewEsc ) { nEsc = nNewEsc; } @@ -75,19 +75,18 @@ public: inline void SetLanguage( const LanguageType eNewLan ) { eLang = eNewLan; Font::SetLanguage(eNewLan); } - // Is-Methoden: + // Is-Methods: inline BOOL IsCaseMap() const { return SVX_CASEMAP_NOT_MAPPED != eCaseMap; } inline BOOL IsCapital() const { return SVX_CASEMAP_KAPITAELCHEN == eCaseMap; } inline BOOL IsKern() const { return 0 != nKern; } inline BOOL IsEsc() const { return 0 != nEsc; } - // Versalien, Gemeine etc. beruecksichtigen + // Consider Upper case, Lower case letters etc. String CalcCaseMap( const String &rTxt ) const; -// Der folgende Bereich wird nicht von jedem benoetigt, er kann deshalb -// ausgeklammert werden. +// The following section is not needed by anyone, so it can be excluded. #ifndef REDUCEDSVXFONT - // Kapitaelchenbearbeitung + // Handle upper case letters void DoOnCapitals( SvxDoCapitals &rDo, const USHORT nPartLen = USHRT_MAX ) const; diff --git a/editeng/inc/editeng/svxrtf.hxx b/editeng/inc/editeng/svxrtf.hxx index 5c92d5a..1ed8ef2 100644 --- a/editeng/inc/editeng/svxrtf.hxx +++ b/editeng/inc/editeng/svxrtf.hxx @@ -57,9 +57,9 @@ namespace com { namespace sun { namespace star { } } } -// Mapper-Klassen fuer die verschiedenen Anforderungen an Doc-Positionen -// Swg - NodePosition ist ein SwIndex, der intern veraendert wird -// EditEngine - ULONG auf Liste von Absaetzen +// Mapper-Classes for the various requirements on Document positions +// Swg - NodePosition is a SwIndex, which is used internally +// EditEngine - ULONG to list of paragraphs // ..... class SvxNodeIdx @@ -67,7 +67,7 @@ class SvxNodeIdx public: virtual ~SvxNodeIdx() {} virtual ULONG GetIdx() const = 0; - virtual SvxNodeIdx* Clone() const = 0; // erzeuge von sich eine Kopie + virtual SvxNodeIdx* Clone() const = 0; // Cloning itself }; class SvxPosition @@ -78,8 +78,8 @@ public: virtual ULONG GetNodeIdx() const = 0; virtual xub_StrLen GetCntIdx() const = 0; - virtual SvxPosition* Clone() const = 0; // erzeuge von sich eine Kopie - virtual SvxNodeIdx* MakeNodeIdx() const = 0; // erzeuge vom NodeIndex eine Kopie + virtual SvxPosition* Clone() const = 0; // Cloning itself + virtual SvxNodeIdx* MakeNodeIdx() const = 0; // Cloning NodeIndex }; @@ -91,13 +91,13 @@ typedef SvxRTFItemStackType* SvxRTFItemStackTypePtr; SV_DECL_PTRARR_DEL( SvxRTFItemStackList, SvxRTFItemStackTypePtr, 1, 1 ) SV_DECL_PTRARR_STACK( SvxRTFItemStack, SvxRTFItemStackTypePtr, 0, 1 ) -// einige Hilfsklassen fuer den RTF-Parser +// own helper classes for the RTF Parser struct SvxRTFStyleType { - SfxItemSet aAttrSet; // die Attribute vom Style (+Ableitung!) + SfxItemSet aAttrSet; // the attributes of Style (+ derivate!) String sName; USHORT nBasedOn, nNext; - BOOL bBasedOnIsSet; //$flr #117411# + BOOL bBasedOnIsSet; BYTE nOutlineNo; BOOL bIsCharFmt; @@ -109,17 +109,17 @@ struct SvxRTFStyleType typedef ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString > > PictPropertyNameValuePairs; struct EDITENG_DLLPUBLIC SvxRTFPictureType { - // Format der Bitmap + // Bitmap Format enum RTF_BMPSTYLE { - RTF_BITMAP, // Bitmap, die Planes sind in den Pict.Daten - WIN_METAFILE, // in den Pict.Daten steht ein Window-Metafile - MAC_QUICKDRAW, // in den Pict.Daten steht ein Mac-QuickDraw - OS2_METAFILE, // in den Pict.Daten steht ein OS2-Metafile - RTF_DI_BMP, // Device Independent Bitmap - ENHANCED_MF, // in den Pict.Daten steht ein Enhanced-Metafile - RTF_PNG, // in den Pict.Daten steht ein PNG file - RTF_JPG // in den Pict.Daten steht ein JPG file + RTF_BITMAP, // Meta data: Bitmap + WIN_METAFILE, // Meta data: Window-Metafile + MAC_QUICKDRAW, // Meta data: Mac-QuickDraw + OS2_METAFILE, // Meta data: OS2-Metafile + RTF_DI_BMP, // Meta data: Device Independent Bitmap + ENHANCED_MF, // Meta data: Enhanced-Metafile + RTF_PNG, // Meta data: PNG file + RTF_JPG // Meta data: JPG file } eStyle; enum RTF_BMPMODE @@ -139,13 +139,13 @@ struct EDITENG_DLLPUBLIC SvxRTFPictureType short nCropT, nCropB, nCropL, nCropR; PictPropertyNameValuePairs aPropertyPairs; SvxRTFPictureType() { ResetValues(); } - // alle Werte auf default; wird nach einlesen der Bitmap aufgerufen ! + // Reset all values to default; is called after loading the Bitmap void ResetValues(); }; -// Hier sind die Ids fuer alle Charakter-Attribute, die vom SvxParser -// erkannt und in einem SfxItemSet gesetzt werden koennen. -// Die Ids werden ueber die SlotIds vom POOL richtig gesetzt. +// Here are the IDs for all character attributes, which can be detected by +// SvxParser and can be set in a SfxItemSet. The IDs are set correctly throught +// the SlotIds from POOL. struct RTFPlainAttrMapIds { USHORT nCaseMap, @@ -186,9 +186,9 @@ struct RTFPlainAttrMapIds RTFPlainAttrMapIds( const SfxItemPool& rPool ); }; -// Hier sind die Ids fuer alle Paragraph-Attribute, die vom SvxParser -// erkannt und in einem SfxItemSet gesetzt werden koennen. -// Die Ids werden ueber die SlotIds vom POOL richtig gesetzt. +// Here are the IDs for all paragraph attributes, which can be detected by +// SvxParser and can be set in a SfxItemSet. The IDs are set correctly throught +// the SlotIds from POOL. struct RTFPardAttrMapIds { USHORT nLinespacing, @@ -242,13 +242,13 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser long nVersionNo; int nDfltFont; - BOOL bNewDoc : 1; // FALSE - in ein bestehendes lesen - BOOL bNewGroup : 1; // TRUE - es gab eine oeffnende Klammer - BOOL bIsSetDfltTab : 1; // TRUE - DefTab wurde eingelesen - BOOL bChkStyleAttr : 1; // TRUE - StyleSheets werden ausgewertet - BOOL bCalcValue : 1; // TRUE - Twipwerte an APP anpassen - BOOL bPardTokenRead : 1; // TRUE - Token \pard wurde erkannt - BOOL bReadDocInfo : 1; // TRUE - DocInfo mit einlesen + BOOL bNewDoc : 1; // FALSE - Reading in an existing + BOOL bNewGroup : 1; // TRUE - there was an opening parenthesis + BOOL bIsSetDfltTab : 1; // TRUE - DefTab was loaded + BOOL bChkStyleAttr : 1; // TRUE - StyleSheets are evaluated + BOOL bCalcValue : 1; // TRUE - Twip values adapt to App + BOOL bPardTokenRead : 1; // TRUE - Token \pard was detected + BOOL bReadDocInfo : 1; // TRUE - DocInfo to read BOOL bIsLeftToRightDef : 1; // TRUE - in LeftToRight char run def. // FALSE - in RightToLeft char run def. BOOL bIsInReadStyleTab : 1; // TRUE - in ReadStyleTable @@ -258,15 +258,15 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser void ClearStyleTbl(); void ClearAttrStack(); - SvxRTFItemStackTypePtr _GetAttrSet( int bCopyAttr=FALSE ); // neue ItemStackType anlegen + SvxRTFItemStackTypePtr _GetAttrSet( int bCopyAttr=FALSE ); // Create new ItemStackType:s void _ClearStyleAttr( SvxRTFItemStackType& rStkType ); - // setzt alle Attribute, die unterschiedlich zum aktuellen sind + // Sets all the attributes that are different from the current void SetAttrSet( SfxItemSet& rAttrSet, SvxPosition& rSttPos ); void SetAttrSet( SvxRTFItemStackType &rSet ); void SetDefault( int nToken, int nValue ); - // pard / plain abarbeiten + // Excecute pard / plain void RTFPardPlain( int bPard, SfxItemSet** ppSet ); void BuildWhichTbl(); @@ -292,7 +292,7 @@ protected: String& DelCharAtEnd( String& rStr, const sal_Unicode cDel ); - // wird fuer jedes Token gerufen, das in CallParser erkannt wird + // is called for each token that is recognized in CallParser virtual void NextToken( int nToken ); virtual void ReadBitmapData(); @@ -304,15 +304,15 @@ protected: void ReadAttr( int nToken, SfxItemSet* pSet ); void ReadTabAttr( int nToken, SfxItemSet& rSet ); - // Dokument-Info lesen + // Read Document-Info ::com::sun::star::util::DateTime GetDateTimeStamp( ); String& GetTextToEndGroup( String& rStr ); virtual void ReadInfo( const sal_Char* pChkForVerNo = 0 ); inline SfxItemSet& GetAttrSet(); - // wurde noch kein Text eingefuegt ? (SttPos vom obersten StackEintrag!) + // no text yet inserted? (SttPos from the top stack entry!) int IsAttrSttPos(); - void AttrGroupEnd(); // den akt. Bearbeiten, vom Stack loeschen + void AttrGroupEnd(); // edit the current, delete from stack void SetAllAttrOfStk(); // end all Attr. and set it into doc @@ -321,10 +321,10 @@ protected: virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos, xub_StrLen& rCntPos )=0; virtual void SetAttrInDoc( SvxRTFItemStackType &rSet ); - // fuer Tokens, die im ReadAttr nicht ausgewertet werden + // for Tokens, which are not evaluated in ReadAttr virtual void UnknownAttrToken( int nToken, SfxItemSet* pSet ); - // falls jemand keine Twips haben moechte + // if no-one would like to have any twips virtual void CalcValue(); SvxRTFParser( SfxItemPool& rAttrPool, @@ -347,14 +347,14 @@ protected: int IsReadDocInfo() const { return bReadDocInfo; } void SetReadDocInfo( int bFlag ) { bReadDocInfo = bFlag; } - // erfrage/setze die aktuelle Einfuegeposition + // Query/Set the current insert position SvxPosition& GetInsPos() const { return *pInsPos; } void SetInsPos( const SvxPosition& rNew ); long GetVersionNo() const { return nVersionNo; } - // erfrage/setze die Mapping-Ids fuer die Pard/Plain Attribute - // (Set: es werden sich die Pointer gemerkt, also keine Kopie erzeugt!!! ) + // Query/Set the mapping IDs for the Pard/Plain attributes + //(Set: It is noted in the pointers, which thus does not create a copy) void AddPardAttr( USHORT nWhich ) { aPardMap.Insert( nWhich, aPardMap.Count() ); } void AddPlainAttr( USHORT nWhich ) { aPlainMap.Insert( nWhich, aPlainMap.Count() ); } @@ -365,37 +365,37 @@ protected: const String& GetBaseURL() const { return sBaseURL; } - // lesen die GrafikDaten und fuelle damit die Grafik und die - // die PicDaten. - // Return - TRUE: die Grafik ist gueltig + // Read the graphics data and make up for the graphics and the picture + // meta data. + // Return - TRUE: the graphic is valid BOOL ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ); - // wandel die ASCII-HexCodes in binaere Zeichen um. Werden - // ungueltige Daten gefunden (Zeichen ausser 0-9|a-f|A-F, so - // wird USHRT_MAX returnt, ansonsten die Anzahl der umgewandelten Ze. + // Change the ASCII-HexCodes into binary characters. If invalid data is + // found (strings not 0-9 | a-f | A-F, then USHRT_MAX is returned, + // otherwise the number of the converted character. xub_StrLen HexToBin( String& rToken ); public: - virtual SvParserState CallParser(); // Aufruf des Parsers + virtual SvParserState CallParser(); inline const Color& GetColor( USHORT nId ) const; - const Font& GetFont( USHORT nId ); // aendert den dflt Font + const Font& GetFont( USHORT nId ); // Changes the dflt Font virtual int IsEndPara( SvxNodeIdx* pNd, xub_StrLen nCnt ) const = 0; - // um einen anderen Attribut-Pool setzen zukoennen. Darf nur vorm - // CallParser erfolgen!! Die Maps werden nicht neu erzeugt! + // to det a different attribute pool. May only be done prior to CallParser! + // The maps are not generated anew! void SetAttrPool( SfxItemPool* pNewPool ) { pAttrPool = pNewPool; } - // um andere WhichIds fuer einen anderen Pool zusetzen. + // to set different WhichIds for a different pool. RTFPardAttrMapIds& GetPardMap() { return (RTFPardAttrMapIds&)*aPardMap.GetData(); } RTFPlainAttrMapIds& GetPlainMap() { return (RTFPlainAttrMapIds&)*aPlainMap.GetData(); } - // um diese von aussen z.B. Tabellenzellen zuordnen zu koennen + // to be able to assign them from the outside as for example table cells void ReadBorderAttr( int nToken, SfxItemSet& rSet, int bTableDef=FALSE ); void ReadBackgroundAttr( int nToken, SfxItemSet& rSet, int bTableDef=FALSE ); - // fuers asynchrone lesen aus dem SvStream + // for asynchronous read from the SvStream virtual void Continue( int nToken ); // get RTF default ItemSets. Must be used by pard/plain tokens or in @@ -404,8 +404,8 @@ public: virtual bool UncompressableStackEntry(const SvxRTFItemStackType &rSet) const; }; -// der Stack fuer die Attribute: -// diese Klasse darf nur vom SvxRTFParser benutzt werden! +// The stack for the attributes: +// this class may only be used by SvxRTFParser! class EDITENG_DLLPUBLIC SvxRTFItemStackType { friend class SvxRTFParser; @@ -453,7 +453,7 @@ public: }; -// ----------- Inline Implementierungen -------------- +// ----------- Inline Implementations -------------- inline const Color& SvxRTFParser::GetColor( USHORT nId ) const { diff --git a/editeng/inc/editeng/swafopt.hxx b/editeng/inc/editeng/swafopt.hxx index 8292df4..f22b13f 100644 --- a/editeng/inc/editeng/swafopt.hxx +++ b/editeng/inc/editeng/swafopt.hxx @@ -34,7 +34,7 @@ class SvStringsISortDtor; class SmartTagMgr; -// Klasse fuer Optionen vom Autoformat +// Class of options for AutoFormat struct EDITENG_DLLPUBLIC SvxSwAutoFmtFlags { Font aBulletFont; @@ -80,7 +80,7 @@ struct EDITENG_DLLPUBLIC SvxSwAutoFmtFlags BOOL bAutoCompleteWords : 1; BOOL bAutoCmpltCollectWords : 1; BOOL bAutoCmpltEndless : 1; -// -- under NT hier starts a new long +// -- under NT here starts a new long BOOL bAutoCmpltAppendBlanc : 1; BOOL bAutoCmpltShowAsTip : 1; diff --git a/editeng/inc/editeng/tstpitem.hxx b/editeng/inc/editeng/tstpitem.hxx index 6d80024..568225c 100644 --- a/editeng/inc/editeng/tstpitem.hxx +++ b/editeng/inc/editeng/tstpitem.hxx @@ -39,7 +39,7 @@ #define SVX_TAB_DEFCOUNT 10 #define SVX_TAB_DEFDIST 1134 // 2cm in twips #define SVX_TAB_NOTFOUND USHRT_MAX -#define cDfltDecimalChar (sal_Unicode(0x00)) // aus IntlWrapper besorgen +#define cDfltDecimalChar (sal_Unicode(0x00)) // Get from IntlWrapper #define cDfltFillChar (sal_Unicode(' ')) class EDITENG_DLLPUBLIC SvxTabStop @@ -83,7 +83,7 @@ public: String GetValueString() const; - // das "alte" operator==() + // the "old" operator==() BOOL IsEqual( const SvxTabStop& rTS ) const { return ( nTabPos == rTS.nTabPos && @@ -92,7 +92,7 @@ public: cFill == rTS.cFill ); } - // Fuer das SortedArray: + // For the SortedArray: BOOL operator==( const SvxTabStop& rTS ) const { return nTabPos == rTS.nTabPos; } BOOL operator <( const SvxTabStop& rTS ) const @@ -112,9 +112,9 @@ public: SV_DECL_VARARR_SORT_VISIBILITY( SvxTabStopArr, SvxTabStop, SVX_TAB_DEFCOUNT, 1, EDITENG_DLLPUBLIC ) -/* -[Beschreibung] -Dieses Item beschreibt eine Liste von TabStops. +/* [Description] + + This item describes a list of TabStops. */ class EDITENG_DLLPUBLIC SvxTabStopItem : public SfxPoolItem, private SvxTabStopArr @@ -131,13 +131,13 @@ public: USHORT nWhich ); SvxTabStopItem( const SvxTabStopItem& rTSI ); - // Liefert Index-Position des Tabs zurueck oder TAB_NOTFOUND + // Returns index of the tab or TAB_NOTFOUND USHORT GetPos( const SvxTabStop& rTab ) const; - // Liefert Index-Position des Tabs an nPos zurueck oder TAB_NOTFOUND + // Returns index of the tab at nPos, or TAB_NOTFOUND USHORT GetPos( const long nPos ) const; - // entprivatisiert: + // unprivatized: USHORT Count() const { return SvxTabStopArr::Count(); } BOOL Insert( const SvxTabStop& rTab ); void Insert( const SvxTabStopItem* pTabs, USHORT nStart = 0, @@ -147,14 +147,14 @@ public: void Remove( const USHORT nPos, const USHORT nLen = 1 ) { SvxTabStopArr::Remove( nPos, nLen ); } - // Zuweisungsoperator, Gleichheitsoperator (vorsicht: teuer!) + // Assignment operator, equality operator (caution: expensive!) SvxTabStopItem& operator=( const SvxTabStopItem& rTSI ); // this is already included in SfxPoolItem declaration //int operator!=( const SvxTabStopItem& rTSI ) const // { return !( operator==( rTSI ) ); } - // SortedArrays liefern nur Stackobjekte zurueck! + // SortedArrays returns only Stackobjects! const SvxTabStop& operator[]( const USHORT nPos ) const { DBG_ASSERT( GetStart() && @@ -164,7 +164,7 @@ public: const SvxTabStop* GetStart() const { return SvxTabStopArr::GetData(); } - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); diff --git a/editeng/inc/editeng/twolinesitem.hxx b/editeng/inc/editeng/twolinesitem.hxx index c5f48e5..71c80f8 100644 --- a/editeng/inc/editeng/twolinesitem.hxx +++ b/editeng/inc/editeng/twolinesitem.hxx @@ -51,7 +51,7 @@ public: SvxTwoLinesItem( const SvxTwoLinesItem& rAttr ); virtual ~SvxTwoLinesItem(); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT nVer) const; diff --git a/editeng/inc/editeng/txtrange.hxx b/editeng/inc/editeng/txtrange.hxx index 90b5512..275da1c 100644 --- a/editeng/inc/editeng/txtrange.hxx +++ b/editeng/inc/editeng/txtrange.hxx @@ -55,19 +55,19 @@ class EDITENG_DLLPUBLIC TextRanger { Range *pRangeArr; SvLongsPtr *pCache; - PolyPolygon *mpPolyPolygon; // Flaechenpolygon - PolyPolygon *mpLinePolyPolygon; // Linienpolygon - Rectangle *pBound; // Umfassendes Rechteck + PolyPolygon *mpPolyPolygon; // Surface polygon + PolyPolygon *mpLinePolyPolygon; // Line polygon + Rectangle *pBound; // Comprehensive rectangle USHORT nCacheSize; // Cache-Size USHORT nCacheIdx; // Cache-Index - USHORT nRight; // Abstand Kontur-Text - USHORT nLeft; // Abstand Text-Kontur - USHORT nUpper; // Abstand Kontur-Text - USHORT nLower; // Abstand Text-Kontur - sal_uInt32 nPointCount; // Anzahl der Polygonpunkte - BOOL bSimple : 1; // Nur Aussenkante - BOOL bInner : 1; // TRUE: Objekt beschriften (EditEngine); - // FALSE: Objekt umfliessen (StarWriter); + USHORT nRight; // Distance Contour-Text + USHORT nLeft; // Distance Text-Contour + USHORT nUpper; // Distance Contour-Text + USHORT nLower; // Distance Text-Contour + sal_uInt32 nPointCount; // Number of polygon points + BOOL bSimple : 1; // Just outside edge + BOOL bInner : 1; // TRUE: Objekt inline (EditEngine); + // FALSE: Objekt flow (StarWriter); BOOL bVertical :1; // for vertical writing mode BOOL bFlag3 :1; BOOL bFlag4 :1; diff --git a/editeng/inc/editeng/udlnitem.hxx b/editeng/inc/editeng/udlnitem.hxx index 8f5d13c..ab01ff6 100644 --- a/editeng/inc/editeng/udlnitem.hxx +++ b/editeng/inc/editeng/udlnitem.hxx @@ -54,7 +54,7 @@ public: SvxTextLineItem( const FontUnderline eSt, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, @@ -71,7 +71,7 @@ public: virtual bool PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ); - // MS VC4.0 kommt durcheinander + // MS VC4.0 messes things up void SetValue( USHORT nNewVal ) {SfxEnumItem::SetValue(nNewVal); } virtual int HasBoolValue() const; diff --git a/editeng/inc/editeng/ulspitem.hxx b/editeng/inc/editeng/ulspitem.hxx index 83bc118..6f58c5b 100644 --- a/editeng/inc/editeng/ulspitem.hxx +++ b/editeng/inc/editeng/ulspitem.hxx @@ -40,18 +40,18 @@ namespace rtl // class SvxULSpaceItem -------------------------------------------------- -/* -[Beschreibung] -Dieses Item beschreibt den oberen und unteren Rand einer Seite oder Absatz. +/* [Description] + + This item describes the Upper- and Lower space of a page or paragraph. */ #define ULSPACE_16_VERSION ((USHORT)0x0001) class EDITENG_DLLPUBLIC SvxULSpaceItem : public SfxPoolItem { - USHORT nUpper; //Oberer Rand - USHORT nLower; //Unterer Rand - USHORT nPropUpper, nPropLower; // relativ oder absolut (=100%) + USHORT nUpper; // Upper space + USHORT nLower; // Lower space + USHORT nPropUpper, nPropLower; // relative or absolute (=100%) public: TYPEINFO(); @@ -60,7 +60,7 @@ public: const USHORT nId ); inline SvxULSpaceItem& operator=( const SvxULSpaceItem &rCpy ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual int operator==( const SfxPoolItem& ) const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId = 0 ) const; diff --git a/editeng/inc/editeng/unofield.hxx b/editeng/inc/editeng/unofield.hxx index 5c00449..33f5ae2 100644 --- a/editeng/inc/editeng/unofield.hxx +++ b/editeng/inc/editeng/unofield.hxx @@ -87,7 +87,7 @@ public: SvxUnoTextField( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xAnchor, const ::rtl::OUString& rPresentation, const SvxFieldData* pFieldData ) throw(); virtual ~SvxUnoTextField() throw(); - // Intern + // Internal virtual sal_Int32 GetFieldId( const SvxFieldData* pFieldData ) const throw(); SvxFieldData* CreateFieldData() const throw(); void SetAnchor( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > xAnchor ) { mxAnchor = xAnchor; } diff --git a/editeng/inc/editeng/unofored.hxx b/editeng/inc/editeng/unofored.hxx index b13118c..e615611 100644 --- a/editeng/inc/editeng/unofored.hxx +++ b/editeng/inc/editeng/unofored.hxx @@ -33,7 +33,7 @@ #include #include "editeng/editengdllapi.h" -// SvxEditEngineForwarder - SvxTextForwarder fuer EditEngine +// SvxEditEngineForwarder - SvxTextForwarder for EditEngine class EDITENG_DLLPUBLIC SvxEditEngineForwarder : public SvxTextForwarder { diff --git a/editeng/inc/editeng/unoforou.hxx b/editeng/inc/editeng/unoforou.hxx index 80f053a..65e4016 100644 --- a/editeng/inc/editeng/unoforou.hxx +++ b/editeng/inc/editeng/unoforou.hxx @@ -36,7 +36,7 @@ class Outliner; -// SvxOutlinerForwarder - SvxTextForwarder fuer Outliner +// SvxOutlinerForwarder - SvxTextForwarder for Outliner class EDITENG_DLLPUBLIC SvxOutlinerForwarder : public SvxTextForwarder { diff --git a/editeng/inc/editeng/unoipset.hxx b/editeng/inc/editeng/unoipset.hxx index 5ad230b..685d0aa 100644 --- a/editeng/inc/editeng/unoipset.hxx +++ b/editeng/inc/editeng/unoipset.hxx @@ -55,11 +55,11 @@ public: SvxItemPropertySet( const SfxItemPropertyMapEntry *pMap, SfxItemPool& rPool, sal_Bool bConvertTwips = sal_False ); ~SvxItemPropertySet(); - // Methoden, die direkt mit dem ItemSet arbeiten + // Methods, which work directly with the ItemSet ::com::sun::star::uno::Any getPropertyValue( const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet, bool bSearchInParent, bool bDontConvertNegativeValues ) const; void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& rVal, SfxItemSet& rSet, bool bDontConvertNegativeValues ) const; - // Methoden, die stattdessen Any benutzen + // Methods that use Any instead ::com::sun::star::uno::Any getPropertyValue( const SfxItemPropertySimpleEntry* pMap ) const; void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& rVal ) const; diff --git a/editeng/inc/editeng/unolingu.hxx b/editeng/inc/editeng/unolingu.hxx index e50884e..1989780 100644 --- a/editeng/inc/editeng/unolingu.hxx +++ b/editeng/inc/editeng/unolingu.hxx @@ -193,7 +193,7 @@ public: /////////////////////////////////////////////////////////////////////////// -//TL:TODO: remove those functions or make them inline +//TODO: remove those functions or make them inline EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > SvxGetSpellChecker(); EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< @@ -204,7 +204,7 @@ EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > SvxGetDictionaryList(); EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SvxGetLinguPropertySet(); -//TL:TODO: remove argument or provide SvxGetIgnoreAllList with the same one +//TODO: remove argument or provide SvxGetIgnoreAllList with the same one EDITENG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > SvxGetOrCreatePosDic( ::com::sun::star::uno::Reference< diff --git a/editeng/inc/editeng/unonrule.hxx b/editeng/inc/editeng/unonrule.hxx index f7d0592..9b5e80b 100644 --- a/editeng/inc/editeng/unonrule.hxx +++ b/editeng/inc/editeng/unonrule.hxx @@ -81,7 +81,7 @@ public: virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(com::sun::star::uno::RuntimeException); virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(com::sun::star::uno::RuntimeException); - // intern + // internal com::sun::star::uno::Sequence getNumberingRuleByIndex( sal_Int32 nIndex) const throw(); void setNumberingRuleByIndex( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rProperties, sal_Int32 nIndex) throw( com::sun::star::uno::RuntimeException, com::sun::star::lang::IllegalArgumentException ); diff --git a/editeng/inc/editeng/unoprnms.hxx b/editeng/inc/editeng/unoprnms.hxx index 625ccfa..8adbc60 100644 --- a/editeng/inc/editeng/unoprnms.hxx +++ b/editeng/inc/editeng/unoprnms.hxx @@ -258,7 +258,7 @@ #define UNO_NAME_3D_TEXTUREPOLYGON3D "D3DTexturePolygon3D" #define UNO_NAME_3D_LINEONLY "D3DLineOnly" -// #107245# New 3D properties which are possible for lathe and extrude 3d objects +// New 3D properties which are possible for lathe and extrude 3d objects #define UNO_NAME_3D_SMOOTH_NORMALS "D3DSmoothNormals" #define UNO_NAME_3D_SMOOTH_LIDS "D3DSmoothLids" #define UNO_NAME_3D_CHARACTER_MODE "D3DCharacterMode" @@ -357,7 +357,7 @@ #define UNO_NAME_CUSTOMSHAPE_ADJUSTMENT "CustomShapeAdjustment" -// Die folgenden Properties sind veraltet und koennen irgendwann mal raus +// The following properties are obsolete and can eventually be removed #define UNO_NAME_EDIT_FONT_COLOR "FontColor" #define UNO_NAME_EDIT_FONT_ESCAPEMENT "FontEscapement" #define UNO_NAME_EDIT_FONT_HEIGHT "FontHeight" @@ -370,7 +370,7 @@ #define UNO_NAME_EDIT_FONT_FAMILY "FontFamily" #define UNO_NAME_EDIT_FONT_NAME "FontName" #define UNO_NAME_EDIT_FONT_CHARSET "FontCharset" -// Ende der veralteten Properties +// End of the obsolete properties #endif diff --git a/editeng/inc/editeng/unotext.hxx b/editeng/inc/editeng/unotext.hxx index ebd0576..88f2064 100644 --- a/editeng/inc/editeng/unotext.hxx +++ b/editeng/inc/editeng/unotext.hxx @@ -173,8 +173,8 @@ EDITENG_DLLPUBLIC void GetSelection( struct ESelection& rSel, SvxTextForwarder* EDITENG_DLLPUBLIC void CheckSelection( struct ESelection& rSel, SvxTextForwarder* pForwarder ) throw(); // ==================================================================== -// Diese Klasse implementiert eine SvxEditSource und einen SvxTextForwarder -// und macht ansonsten rein garnichts +// This class implements a SvxEditSource and SvxTextForwarder and does +// nothing otherwise // ==================================================================== class SvxDummyTextSource : public SvxEditSource, public SvxTextForwarder diff --git a/editeng/inc/editeng/wghtitem.hxx b/editeng/inc/editeng/wghtitem.hxx index 8a77027..79884f9 100644 --- a/editeng/inc/editeng/wghtitem.hxx +++ b/editeng/inc/editeng/wghtitem.hxx @@ -42,9 +42,9 @@ namespace rtl // class SvxWeightItem --------------------------------------------------- -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt die Font-Staerke. + This item describes the font weight. */ class EDITENG_DLLPUBLIC SvxWeightItem : public SfxEnumItem @@ -55,7 +55,7 @@ public: SvxWeightItem( const FontWeight eWght /*= WEIGHT_NORMAL*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + SfxEnumItem + // "pure virtual Methods" from SfxPoolItem + SfxEnumItem virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres, SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric, diff --git a/editeng/inc/editeng/widwitem.hxx b/editeng/inc/editeng/widwitem.hxx index f8aaeba..9b0d0e8 100644 --- a/editeng/inc/editeng/widwitem.hxx +++ b/editeng/inc/editeng/widwitem.hxx @@ -41,9 +41,9 @@ namespace rtl // class SvxWidowsItem --------------------------------------------------- -/* -[Beschreibung] -Dieses Item beschreibt die Anzahl der Zeilen fuer die Hurenkinderregelung. +/* [Description] + + This item describes the number of lines for the widows control. */ class EDITENG_DLLPUBLIC SvxWidowsItem: public SfxByteItem @@ -54,7 +54,7 @@ public: SvxWidowsItem( const BYTE nL /*= 0*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create( SvStream &, USHORT ) const; virtual SvStream& Store( SvStream & , USHORT nItemVersion ) const; diff --git a/editeng/inc/editeng/wrlmitem.hxx b/editeng/inc/editeng/wrlmitem.hxx index de29f41..8e7038e 100644 --- a/editeng/inc/editeng/wrlmitem.hxx +++ b/editeng/inc/editeng/wrlmitem.hxx @@ -41,10 +41,10 @@ namespace rtl // class SvxWordLineModeItem --------------------------------------------- -/* [Beschreibung] +/* [Description] - Dieses Item beschreibt, ob Unterstrichen und Durchgestrichen auf - Wortgrenzen beschraenkt ist. + This item describes, whether underlined and strikethrough is limited + to word boundaries. */ class EDITENG_DLLPUBLIC SvxWordLineModeItem : public SfxBoolItem @@ -55,7 +55,7 @@ public: SvxWordLineModeItem( const BOOL bWordLineMode /*= FALSE*/, const USHORT nId ); - // "pure virtual Methoden" vom SfxPoolItem + // "pure virtual Methods" from SfxPoolItem virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Create(SvStream &, USHORT) const; virtual SvStream& Store(SvStream &, USHORT nItemVersion) const; diff --git a/editeng/inc/helpid.hrc b/editeng/inc/helpid.hrc index 7c2f43e..ad64c83 100644 --- a/editeng/inc/helpid.hrc +++ b/editeng/inc/helpid.hrc @@ -71,7 +71,7 @@ #define ACT_SVX_HID_END (HID_EDIT_START+28) #if ACT_SVX_HID_END > HID_EDIT_END -#error Resource-Ueberlauf in #line, #file +#error Resource overflow on #line, #file #endif #endif diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 8f50b34..8fe6ddc 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -99,7 +99,7 @@ void EditCharAttrib::SetFont( SvxFont&, OutputDevice* ) EditCharAttribFont::EditCharAttribFont( const SvxFontItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTINFO || rAttr.Which() == EE_CHAR_FONTINFO_CJK || rAttr.Which() == EE_CHAR_FONTINFO_CTL, "Kein Fontattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTINFO || rAttr.Which() == EE_CHAR_FONTINFO_CJK || rAttr.Which() == EE_CHAR_FONTINFO_CTL, "Not a Font attribute!" ); } void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* ) @@ -118,7 +118,7 @@ void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribItalic::EditCharAttribItalic( const SvxPostureItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_ITALIC || rAttr.Which() == EE_CHAR_ITALIC_CJK || rAttr.Which() == EE_CHAR_ITALIC_CTL, "Kein Italicattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_ITALIC || rAttr.Which() == EE_CHAR_ITALIC_CJK || rAttr.Which() == EE_CHAR_ITALIC_CTL, "Not a Italic attribute!" ); } void EditCharAttribItalic::SetFont( SvxFont& rFont, OutputDevice* ) @@ -132,7 +132,7 @@ void EditCharAttribItalic::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribWeight::EditCharAttribWeight( const SvxWeightItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_WEIGHT || rAttr.Which() == EE_CHAR_WEIGHT_CJK || rAttr.Which() == EE_CHAR_WEIGHT_CTL, "Kein Weightttribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_WEIGHT || rAttr.Which() == EE_CHAR_WEIGHT_CJK || rAttr.Which() == EE_CHAR_WEIGHT_CTL, "Not a Weight attribute!" ); } void EditCharAttribWeight::SetFont( SvxFont& rFont, OutputDevice* ) @@ -146,7 +146,7 @@ void EditCharAttribWeight::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribUnderline::EditCharAttribUnderline( const SvxUnderlineItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_UNDERLINE, "Kein Underlineattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_UNDERLINE, "Not a Underline attribute!" ); } void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) @@ -162,7 +162,7 @@ void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) EditCharAttribOverline::EditCharAttribOverline( const SvxOverlineItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_OVERLINE, "Kein Overlineattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_OVERLINE, "Not a overline attribute!" ); } void EditCharAttribOverline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) @@ -178,12 +178,12 @@ void EditCharAttribOverline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) EditCharAttribFontHeight::EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTHEIGHT || rAttr.Which() == EE_CHAR_FONTHEIGHT_CJK || rAttr.Which() == EE_CHAR_FONTHEIGHT_CTL, "Kein Heightattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTHEIGHT || rAttr.Which() == EE_CHAR_FONTHEIGHT_CJK || rAttr.Which() == EE_CHAR_FONTHEIGHT_CTL, "Not a Height attribute!" ); } void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* ) { - // Prop wird ignoriert + // Property is ignored rFont.SetSize( Size( rFont.GetSize().Width(), ((const SvxFontHeightItem*)GetItem())->GetHeight() ) ); } @@ -193,7 +193,7 @@ void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribFontWidth::EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTWIDTH, "Kein Widthattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTWIDTH, "Not a Width attribute!" ); } void EditCharAttribFontWidth::SetFont( SvxFont& /*rFont*/, OutputDevice* ) @@ -207,7 +207,7 @@ void EditCharAttribFontWidth::SetFont( SvxFont& /*rFont*/, OutputDevice* ) EditCharAttribStrikeout::EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_STRIKEOUT, "Kein Sizeattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_STRIKEOUT, "Not a Size attribute!" ); } void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* ) @@ -221,7 +221,7 @@ void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribColor::EditCharAttribColor( const SvxColorItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_COLOR, "Kein Colorattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_COLOR, "Not a Color attribute!" ); } void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* ) @@ -235,7 +235,7 @@ void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribLanguage::EditCharAttribLanguage( const SvxLanguageItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( ( rAttr.Which() == EE_CHAR_LANGUAGE ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CJK ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CTL ), "Kein Languageattribut!" ); + DBG_ASSERT( ( rAttr.Which() == EE_CHAR_LANGUAGE ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CJK ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CTL ), "Not a Language attribute!" ); } void EditCharAttribLanguage::SetFont( SvxFont& rFont, OutputDevice* ) @@ -249,7 +249,7 @@ void EditCharAttribLanguage::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribShadow::EditCharAttribShadow( const SvxShadowedItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_SHADOW, "Kein Shadowattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_SHADOW, "Not a Shadow attribute!" ); } void EditCharAttribShadow::SetFont( SvxFont& rFont, OutputDevice* ) @@ -263,7 +263,7 @@ void EditCharAttribShadow::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_ESCAPEMENT, "Kein Escapementattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_ESCAPEMENT, "Not a escapement attribute!" ); } #if defined( WIN ) && !defined( WNT ) @@ -294,7 +294,7 @@ void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribOutline::EditCharAttribOutline( const SvxContourItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_OUTLINE, "Kein Outlineattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_OUTLINE, "Not a Outline attribute!" ); } void EditCharAttribOutline::SetFont( SvxFont& rFont, OutputDevice* ) @@ -354,8 +354,7 @@ EditCharAttribField::EditCharAttribField( const EditCharAttribField& rAttr ) : EditCharAttrib( *rAttr.GetItem(), rAttr.GetStart(), rAttr.GetEnd() ), aFieldValue( rAttr.aFieldValue ) { - // Diesen CCTOR nur fuer temporaeres Object verwenden, - // Item wird nicht gepoolt. + // Use this constructor only for temporary Objects, Item is not pooled. pTxtColor = rAttr.pTxtColor ? new Color( *rAttr.pTxtColor ) : 0; pFldColor = rAttr.pFldColor ? new Color( *rAttr.pFldColor ) : 0; } @@ -389,7 +388,7 @@ BOOL EditCharAttribField::operator == ( const EditCharAttribField& rAttr ) const EditCharAttribPairKerning::EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_PAIRKERNING, "Kein PairKerning!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_PAIRKERNING, "Not a Pair Kerning!" ); } void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* ) @@ -403,7 +402,7 @@ void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribKerning::EditCharAttribKerning( const SvxKerningItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_KERNING, "Kein Kerning!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_KERNING, "Not a Kerning!" ); } void EditCharAttribKerning::SetFont( SvxFont& rFont, OutputDevice* ) @@ -417,7 +416,7 @@ void EditCharAttribKerning::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribWordLineMode::EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_WLM, "Kein Kerning!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_WLM, "Not a Kerning!" ); } void EditCharAttribWordLineMode::SetFont( SvxFont& rFont, OutputDevice* ) @@ -431,7 +430,7 @@ void EditCharAttribWordLineMode::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribEmphasisMark::EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, USHORT _nStart, USHORT _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { - DBG_ASSERT( rAttr.Which() == EE_CHAR_EMPHASISMARK, "Kein Emphasisattribut!" ); + DBG_ASSERT( rAttr.Which() == EE_CHAR_EMPHASISMARK, "Not a Emphasis attribute!" ); } void EditCharAttribEmphasisMark::SetFont( SvxFont& rFont, OutputDevice* ) diff --git a/editeng/source/editeng/editattr.hxx b/editeng/source/editeng/editattr.hxx index 27e20f3..fdaee62 100644 --- a/editeng/source/editeng/editattr.hxx +++ b/editeng/source/editeng/editattr.hxx @@ -60,9 +60,9 @@ class SfxVoidItem; #define CH_FEATURE_OLD (BYTE) 0xFF #define CH_FEATURE (sal_Unicode) 0x01 -// DEF_METRIC: Bei meinem Pool sollte immer die DefMetric bei -// GetMetric( nWhich ) ankommen! -// => Zum ermitteln der DefMetrik einfach ein GetMetric( 0 ) +// DEF_METRIC: For my pool, the DefMetric should always appear when +// GetMetric (nWhich)! +// => To determine the DefMetric simply use GetMetric(0) #define DEF_METRIC 0 // ------------------------------------------------------------------------- @@ -81,7 +81,7 @@ protected: virtual ~EditAttrib(); public: - // RemoveFromPool muss immer vorm DTOR Aufruf erfolgen!! + // RemoveFromPool must always be called before the destructor!! void RemoveFromPool( SfxItemPool& rPool ); USHORT Which() const { return pItem->Which(); } @@ -91,8 +91,8 @@ public: // ------------------------------------------------------------------------- // class EditCharAttrib // ------------------------------------------------------------------------- -// bFeature: Attribut darf nicht expandieren/schrumfen, Laenge immer 1 -// bEdge: Attribut expandiert nicht, wenn genau an der Kante expandiert werden soll +// bFeature: Attribute must not expand/shrink, length is always 1 +// bEdge: Attribute will not expand, if you want to expand just on the edge class EditCharAttrib : public EditAttrib { protected: @@ -158,14 +158,14 @@ inline void EditCharAttrib::MoveBackward( USHORT nDiff ) inline void EditCharAttrib::Expand( USHORT nDiff ) { DBG_ASSERT( ( ((long)nEnd + nDiff) <= (long)0xFFFF ), "EditCharAttrib: Expand?!" ); - DBG_ASSERT( !bFeature, "Bitte keine Features expandieren!" ); + DBG_ASSERT( !bFeature, "Please do not expand any features!" ); nEnd = nEnd + nDiff; } inline void EditCharAttrib::Collaps( USHORT nDiff ) { DBG_ASSERT( (long)nEnd - nDiff >= (long)nStart, "EditCharAttrib: Collaps?!" ); - DBG_ASSERT( !bFeature, "Bitte keine Features schrumpfen!" ); + DBG_ASSERT( !bFeature, "Please do not shrink any Features!" ); nEnd = nEnd - nDiff; } diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index 1011ba1..d0cc8a3 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -329,28 +329,28 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) #endif if ( fp == 0 ) { - DBG_ERROR( "Log-File konnte nicht angelegt werden!" ); + DBG_ERROR( "Log file could not be created!" ); return; } const SfxItemPool& rPool = *pEE->GetEmptyItemSet().GetPool(); fprintf( fp, "================================================================================" ); - fprintf( fp, "\n================== Dokument ================================================" ); + fprintf( fp, "\n================== Document ================================================" ); fprintf( fp, "\n================================================================================" ); for ( USHORT nPortion = 0; nPortion < pEE->pImpEditEngine->GetParaPortions(). Count(); nPortion++) { ParaPortion* pPPortion = pEE->pImpEditEngine->GetParaPortions().GetObject(nPortion ); - fprintf( fp, " \nAbsatz %i: Laenge = %i, Invalid = %i\nText = '%s'", nPortion, pPPortion->GetNode()->Len(), pPPortion->IsInvalid(), ByteString( *pPPortion->GetNode(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + fprintf( fp, " \nParagraph %i: Length = %i, Invalid = %i\nText = '%s'", nPortion, pPPortion->GetNode()->Len(), pPPortion->IsInvalid(), ByteString( *pPPortion->GetNode(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); fprintf( fp, "\nVorlage:" ); SfxStyleSheet* pStyle = pPPortion->GetNode()->GetStyleSheet(); if ( pStyle ) fprintf( fp, " %s", ByteString( pStyle->GetName(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); - fprintf( fp, "\nAbsatzattribute:" ); + fprintf( fp, "\nParagraph attribute:" ); DbgOutItemSet( fp, pPPortion->GetNode()->GetContentAttribs().GetItems(), FALSE, FALSE ); - fprintf( fp, "\nZeichenattribute:" ); + fprintf( fp, "\nCharacter attribute:" ); BOOL bZeroAttr = FALSE; USHORT z; for ( z = 0; z < pPPortion->GetNode()->GetCharAttribs().Count(); z++ ) @@ -376,11 +376,11 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\nNULL-Attribute!" ); USHORT nTextPortions = pPPortion->GetTextPortions().Count(); - ByteString aPortionStr("\nTextportions: #"); + ByteString aPortionStr("\nText portions: #"); aPortionStr += ByteString::CreateFromInt32( nTextPortions ); aPortionStr += " \nA"; aPortionStr += ByteString::CreateFromInt32( nPortion ); - aPortionStr += ": Absatzlaenge = "; + aPortionStr += ": Paragraph Length = "; aPortionStr += ByteString::CreateFromInt32( pPPortion->GetNode()->Len() ); aPortionStr += "\nA"; aPortionStr += ByteString::CreateFromInt32( nPortion ); @@ -402,29 +402,29 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) } aPortionStr += "\nA"; aPortionStr += ByteString::CreateFromInt32( nPortion ); - aPortionStr += ": Gesamtlaenge: "; + aPortionStr += ": Total length: "; aPortionStr += ByteString::CreateFromInt32( n ); if ( pPPortion->GetNode()->Len() != n ) - aPortionStr += " => Fehler !!!"; + aPortionStr += " => Error !!!"; fprintf( fp, "%s", aPortionStr.GetBuffer() ); - fprintf( fp, "\n\nZeilen:" ); - // Erstmal die Inhalte... + fprintf( fp, "\n\nLines:" ); + // First the content ... USHORT nLine; for ( nLine = 0; nLine < pPPortion->GetLines().Count(); nLine++ ) { EditLine* pLine = pPPortion->GetLines().GetObject( nLine ); ByteString aLine( *(pPPortion->GetNode()), pLine->GetStart(), pLine->GetEnd() - pLine->GetStart(), RTL_TEXTENCODING_ASCII_US ); - fprintf( fp, "\nZeile %i\t>%s<", nLine, aLine.GetBuffer() ); + fprintf( fp, "\nLine %i\t>%s<", nLine, aLine.GetBuffer() ); } - // dann die internen Daten... + // then the internal data ... for ( nLine = 0; nLine < pPPortion->GetLines().Count(); nLine++ ) { EditLine* pLine = pPPortion->GetLines().GetObject( nLine ); fprintf( fp, "\nZeile %i:\tStart: %i,\tEnd: %i", nLine, pLine->GetStart(), pLine->GetEnd() ); - fprintf( fp, "\t\tPortions: %i - %i.\tHoehe: %i, Ascent=%i", pLine->GetStartPortion(), pLine->GetEndPortion(), pLine->GetHeight(), pLine->GetMaxAscent() ); + fprintf( fp, "\t\tPortions: %i - %i.\tHight: %i, Ascent=%i", pLine->GetStartPortion(), pLine->GetEndPortion(), pLine->GetHeight(), pLine->GetMaxAscent() ); } fprintf( fp, "\n-----------------------------------------------------------------------------" ); @@ -436,12 +436,12 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\n\n ================================================================================" ); fprintf( fp, "\n================== Stylesheets =============================================" ); fprintf( fp, "\n================================================================================" ); - fprintf( fp, "\n#Vorlagen: %lu\n", nStyles ); + fprintf( fp, "\n#Template: %lu\n", nStyles ); SfxStyleSheetIterator aIter( pEE->pImpEditEngine->GetStyleSheetPool(), SFX_STYLE_FAMILY_ALL ); SfxStyleSheetBase* pStyle = aIter.First(); while ( pStyle ) { - fprintf( fp, "\nVorlage: %s", ByteString( pStyle->GetName(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + fprintf( fp, "\nTemplate: %s", ByteString( pStyle->GetName(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); fprintf( fp, "\nParent: %s", ByteString( pStyle->GetParent(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); fprintf( fp, "\nFollow: %s", ByteString( pStyle->GetFollow(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); DbgOutItemSet( fp, pStyle->GetItemSet(), FALSE, FALSE ); @@ -465,23 +465,23 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\nMaxAutoPaperSize: %li x %li", pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() ); fprintf( fp, "\nMinAutoPaperSize: %li x %li", pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() ); fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() ); - fprintf( fp, "\nAnzahl der Views: %i", pEE->GetViewCount() ); + fprintf( fp, "\nNumber of Views: %i", pEE->GetViewCount() ); for ( USHORT nView = 0; nView < pEE->GetViewCount(); nView++ ) { EditView* pV = pEE->GetView( nView ); - DBG_ASSERT( pV, "View nicht gefunden!" ); + DBG_ASSERT( pV, "View not found!" ); fprintf( fp, "\nView %i: Focus=%i", nView, pV->GetWindow()->HasFocus() ); Rectangle aR( pV->GetOutputArea() ); fprintf( fp, "\n OutputArea: nX=%li, nY=%li, dX=%li, dY=%li, MapMode = %i", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() , pV->GetWindow()->GetMapMode().GetMapUnit() ); aR = pV->GetVisArea(); fprintf( fp, "\n VisArea: nX=%li, nY=%li, dX=%li, dY=%li", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() ); ESelection aSel = pV->GetSelection(); - fprintf( fp, "\n Selektion: Start=%u,%u, End=%u,%u", aSel.nStartPara, aSel.nStartPos, aSel.nEndPara, aSel.nEndPos ); + fprintf( fp, "\n Selection: Start=%u,%u, End=%u,%u", aSel.nStartPara, aSel.nStartPos, aSel.nEndPara, aSel.nEndPos ); } if ( pEE->GetActiveView() ) { fprintf( fp, "\n\n ================================================================================" ); - fprintf( fp, "\n================== Aktuelle View ===========================================" ); + fprintf( fp, "\n================== Current View ===========================================" ); fprintf( fp, "\n================================================================================" ); DbgOutItemSet( fp, pEE->GetActiveView()->GetAttribs(), TRUE, FALSE ); } @@ -494,10 +494,10 @@ ByteString EditDbg::GetPortionInfo( ParaPortion* pPPortion ) { USHORT z; - ByteString aDebStr( "Absatzlaenge = " ); + ByteString aDebStr( "Paragraph Length = " ); aDebStr += ByteString::CreateFromInt32( pPPortion->GetNode()->Len() ); - aDebStr += "\nZeichenattribute:"; + aDebStr += "\nCharacter attribute:"; for ( z = 0; z < pPPortion->GetNode()->GetCharAttribs().Count(); z++ ) { EditCharAttrib* pAttr = pPPortion->GetNode()->GetCharAttribs().GetAttribs().GetObject( z ); @@ -509,7 +509,7 @@ ByteString EditDbg::GetPortionInfo( ParaPortion* pPPortion ) aDebStr += ByteString::CreateFromInt32( pAttr->GetEnd() ); } - aDebStr += "\nTextportions:"; + aDebStr += "\nText portions:"; USHORT n = 0; for ( z = 0; z < pPPortion->GetTextPortions().Count(); z++ ) { @@ -522,15 +522,15 @@ ByteString EditDbg::GetPortionInfo( ParaPortion* pPPortion ) aDebStr += ";"; n = n + pPortion->GetLen(); } - aDebStr += "\nGesamtlaenge: "; + aDebStr += "\nTotal length: "; aDebStr += ByteString::CreateFromInt32( n ); - aDebStr += "\nSortiert nach Start:"; + aDebStr += "\nSorted after Start:"; for ( USHORT x = 0; x < pPPortion->GetNode()->GetCharAttribs().Count(); x++ ) { EditCharAttrib* pCurAttrib = pPPortion->GetNode()->GetCharAttribs().GetAttribs().GetObject( x ); aDebStr += "\nStart: "; aDebStr += ByteString::CreateFromInt32( pCurAttrib->GetStart() ); - aDebStr += "\tEnde: "; + aDebStr += "\tEnd: "; aDebStr += ByteString::CreateFromInt32( pCurAttrib->GetEnd() ); } return aDebStr; @@ -561,7 +561,7 @@ void EditDbg::ShowPortionData( ParaPortion* pPortion ) BOOL ParaPortion::DbgCheckTextPortions() { - // pruefen, ob Portionlaenge ok: + // check, if Portion length ok: USHORT nXLen = 0; for ( USHORT nPortion = 0; nPortion < aTextPortionList.Count(); nPortion++ ) nXLen = nXLen + aTextPortionList[nPortion]->GetLen(); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 78b4515..9db56ca 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -161,8 +161,8 @@ BOOL IsScriptItemValid( USHORT nItemId, short nScriptType ) // ------------------------------------------------------------ -// Sollte spaeter zentral nach TOOLS/STRING (Aktuell: 303) -// fuer Grep: WS_TARGET +// Should later be moved to TOOLS/STRING (Current: 303) +// for Grep: WS_TARGET DBG_NAME( EE_TextPortion ); DBG_NAME( EE_EditLine ); @@ -274,7 +274,7 @@ int SAL_CALL CompareStart( const void* pFirst, const void* pSecond ) EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, USHORT nS, USHORT nE ) { - // das neue Attribut im Pool anlegen + // Create a new attribute in the pool const SfxPoolItem& rNew = rPool.Put( rAttr ); EditCharAttrib* pNew = 0; @@ -382,7 +382,7 @@ EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, US break; case EE_CHAR_XMLATTRIBS: { - pNew = new EditCharAttrib( rNew, nS, nE ); // Attrib is only for holding XML information... + pNew = new EditCharAttrib( rNew, nS, nE ); // Attribute is only for holding XML information... } break; case EE_FEATURE_TAB: @@ -402,7 +402,7 @@ EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, US break; default: { - DBG_ERROR( "Ungueltiges Attribut!" ); + DBG_ERROR( "Invalid Attribute!" ); } } return pNew; @@ -417,7 +417,8 @@ EditLine::EditLine() DBG_CTOR( EE_EditLine, 0 ); nStart = nEnd = 0; - nStartPortion = 0; // damit in ungueltiger Zeile ohne Portions von einer gueltigen Zeile mit der Portion Nr0 unterscieden werden kann. + nStartPortion = 0; // to be able to tell the difference between a line + // without Ptorions form one with the Portion number 0 nEndPortion = 0; nHeight = 0; nStartPosX = 0; @@ -514,7 +515,7 @@ Size EditLine::CalcTextSize( ParaPortion& rParaPortion ) USHORT nIndex = GetStart(); - DBG_ASSERT( rParaPortion.GetTextPortions().Count(), "GetTextSize vor CreatePortions !" ); + DBG_ASSERT( rParaPortion.GetTextPortions().Count(), "GetTextSize before CreatePortions !" ); for ( USHORT n = nStartPortion; n <= nEndPortion; n++ ) { @@ -584,7 +585,7 @@ USHORT EditLineList::FindLine( USHORT nChar, BOOL bInclEnd ) } } - DBG_ASSERT( !bInclEnd, "Zeile nicht gefunden: FindLine" ); + DBG_ASSERT( !bInclEnd, "Line not found: FindLine" ); return ( Count() - 1 ); } @@ -619,15 +620,15 @@ EditSelection::EditSelection() EditSelection::EditSelection( const EditPaM& rStartAndAnd ) { - // koennte noch optimiert werden! - // nicht erst Def-CTOR vom PaM rufen! + // could still be optimized! + // do no first call the Def-constructor from PaM! aStartPaM = rStartAndAnd; aEndPaM = rStartAndAnd; } EditSelection::EditSelection( const EditPaM& rStart, const EditPaM& rEnd ) { - // koennte noch optimiert werden! + // could still be optimized! aStartPaM = rStart; aEndPaM = rEnd; } @@ -654,8 +655,8 @@ BOOL EditSelection::IsInvalid() const BOOL EditSelection::Adjust( const ContentList& rNodes ) { - DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index im Wald in Adjust(1)" ); - DBG_ASSERT( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index im Wald in Adjust(2)" ); + DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in Adjust(1)" ); + DBG_ASSERT( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index out of range in Adjust(2)" ); ContentNode* pStartNode = aStartPaM.GetNode(); ContentNode* pEndNode = aEndPaM.GetNode(); @@ -663,8 +664,8 @@ BOOL EditSelection::Adjust( const ContentList& rNodes ) USHORT nStartNode = rNodes.GetPos( pStartNode ); USHORT nEndNode = rNodes.GetPos( pEndNode ); - DBG_ASSERT( nStartNode != USHRT_MAX, "Node im Wald in Adjust(1)" ); - DBG_ASSERT( nEndNode != USHRT_MAX, "Node im Wald in Adjust(2)" ); + DBG_ASSERT( nStartNode != USHRT_MAX, "Node out of range in Adjust(1)" ); + DBG_ASSERT( nEndNode != USHRT_MAX, "Node out of range in Adjust(2)" ); BOOL bSwap = FALSE; if ( nStartNode > nEndNode ) @@ -739,14 +740,12 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP if ( !nNew ) return; - // Da Features anders behandelt werden als normale Zeichenattribute, - // kann sich hier auch die Sortierung der Start-Liste aendern! - // In jedem if..., in dem weiter (n) Moeglichkeiten aufgrund von - // bFeature oder Spezialfall existieren, - // muessen (n-1) Moeglichkeiten mit bResort versehen werden. - // Die wahrscheinlichste Moeglichkeit erhaelt kein bResort, - // so dass nicht neu sortiert wird, wenn sich alle Attribute - // gleich verhalten. + // Since features are treated differently than normal character attributes, + // can also the order of the start list be change! + // In every if ..., in the next (n) opportunities due to bFeature or + // an existing special case, must (n-1) opportunities be provided with + // bResort. The most likely possibility receives no bResort, so that is + // not sorted anew when all attributes are the same. BOOL bResort = FALSE; BOOL bExpandedEmptyAtIndexNull = FALSE; @@ -756,29 +755,30 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP { if ( pAttrib->GetEnd() >= nIndex ) { - // Alle Attribute hinter der Einfuegeposition verschieben... + // Move all attributes behind the insertion point... if ( pAttrib->GetStart() > nIndex ) { pAttrib->MoveForward( nNew ); } - // 0: Leeres Attribut expandieren, wenn an Einfuegestelle + // 0: Expand empty attribute, if at insertion point else if ( pAttrib->IsEmpty() ) { - // Index nicht pruefen, leeres durfte nur dort liegen. - // Wenn spaeter doch Ueberpruefung: - // Spezialfall: Start == 0; AbsLen == 1, nNew = 1 => Expand, weil durch Absatzumbruch! + // Do not check Index, a emty one could only be there + // When later checking it anyhow: + // Special caase: Start == 0; AbsLen == 1, nNew = 1 + // => Expand, because of paragraph break! // Start <= nIndex, End >= nIndex => Start=End=nIndex! // if ( pAttrib->GetStart() == nIndex ) pAttrib->Expand( nNew ); if ( pAttrib->GetStart() == 0 ) bExpandedEmptyAtIndexNull = TRUE; } - // 1: Attribut startet davor, geht bis Index... - else if ( pAttrib->GetEnd() == nIndex ) // Start muss davor liegen + // 1: Attribute starts before, goes to index ... + else if ( pAttrib->GetEnd() == nIndex ) // Start must be before { - // Nur expandieren, wenn kein Feature, - // und wenn nicht in ExcludeListe! - // Sonst geht z.B. ein UL bis zum neuen ULDB, beide expandieren + // Only expand when there is no feature + // and if not in exclude list! + // Otherwise, a UL will go on until a new ULDB, expaning both // if ( !pAttrib->IsFeature() && !rExclList.FindAttrib( pAttrib->Which() ) ) if ( !pAttrib->IsFeature() && !aCharAttribList.FindEmptyAttrib( pAttrib->Which(), nIndex ) ) { @@ -788,13 +788,13 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP else bResort = TRUE; } - // 2: Attribut startet davor, geht hinter Index... + // 2: Attribute starts before, goes past the Index... else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) { - DBG_ASSERT( !pAttrib->IsFeature(), "Grosses Feature?!" ); + DBG_ASSERT( !pAttrib->IsFeature(), "Large Feature?!" ); pAttrib->Expand( nNew ); } - // 3: Attribut startet auf Index... + // 3: Attribute starts on index... else if ( pAttrib->GetStart() == nIndex ) { if ( pAttrib->IsFeature() ) @@ -842,11 +842,11 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP DBG_ASSERT( !pAttrib->IsFeature() || ( pAttrib->GetLen() == 1 ), "Expand: FeaturesLen != 1" ); - DBG_ASSERT( pAttrib->GetStart() <= pAttrib->GetEnd(), "Expand: Attribut verdreht!" ); - DBG_ASSERT( ( pAttrib->GetEnd() <= Len() ), "Expand: Attrib groesser als Absatz!" ); + DBG_ASSERT( pAttrib->GetStart() <= pAttrib->GetEnd(), "Expand: Attribute distorted!" ); + DBG_ASSERT( ( pAttrib->GetEnd() <= Len() ), "Expand: Attribute larger than paragraph!" ); if ( pAttrib->IsEmpty() ) { - DBG_ERROR( "Leeres Attribut nach ExpandAttribs?" ); + DBG_ERROR( "Empty Attribute after ExpandAttribs?" ); bResort = TRUE; aCharAttribList.GetAttribs().Remove( nAttr ); rItemPool.Remove( *pAttrib->GetItem() ); @@ -869,7 +869,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP #endif // !SVX_LIGHT #ifdef EDITDEBUG - DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), TRUE ), "Expand: Start-Liste verdreht" ); + DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), TRUE ), "Expand: Start List distorted" ); #endif } @@ -878,8 +878,8 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r if ( !nDeleted ) return; - // Da Features anders behandelt werden als normale Zeichenattribute, - // kann sich hier auch die Sortierung der Start-Liste aendern! + // Since features are treated differently than normal character attributes, + // can also the order of the start list be change! BOOL bResort = FALSE; BOOL bDelAttr = FALSE; USHORT nEndChanges = nIndex+nDeleted; @@ -891,34 +891,34 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r bDelAttr = FALSE; if ( pAttrib->GetEnd() >= nIndex ) { - // Alles Attribute hinter der Einfuegeposition verschieben... + // Move all Attribute behind the insert point... if ( pAttrib->GetStart() >= nEndChanges ) { pAttrib->MoveBackward( nDeleted ); } - // 1. Innenliegende Attribute loeschen... + // 1. Delete Internal attributes... else if ( ( pAttrib->GetStart() >= nIndex ) && ( pAttrib->GetEnd() <= nEndChanges ) ) { - // Spezialfall: Attrubt deckt genau den Bereich ab - // => als leeres Attribut behalten. + // Special case: Attribute covers the area exactly + // => keep as empty Attribute. if ( !pAttrib->IsFeature() && ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) ) - pAttrib->GetEnd() = nIndex; // leer + pAttrib->GetEnd() = nIndex; // empty else bDelAttr = TRUE; } - // 2. Attribut beginnt davor, endet drinnen oder dahinter... + // 2. Attribute starts earlier, ends inside or behind it ... else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) { DBG_ASSERT( !pAttrib->IsFeature(), "Collapsing Feature!" ); - if ( pAttrib->GetEnd() <= nEndChanges ) // endet drinnen + if ( pAttrib->GetEnd() <= nEndChanges ) // ends inside pAttrib->GetEnd() = nIndex; else - pAttrib->Collaps( nDeleted ); // endet dahinter + pAttrib->Collaps( nDeleted ); // ends behind } - // 3. Attribut beginnt drinnen, endet dahinter... + // 3. Attribute starts inside, ending behind ... else if ( ( pAttrib->GetStart() >= nIndex ) && ( pAttrib->GetEnd() > nEndChanges ) ) { - // Features duerfen nicht expandieren! + // Features not allowed to expand! if ( pAttrib->IsFeature() ) { pAttrib->MoveBackward( nDeleted ); @@ -933,8 +933,8 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r } DBG_ASSERT( !pAttrib->IsFeature() || ( pAttrib->GetLen() == 1 ), "Expand: FeaturesLen != 1" ); - DBG_ASSERT( pAttrib->GetStart() <= pAttrib->GetEnd(), "Collaps: Attribut verdreht!" ); - DBG_ASSERT( ( pAttrib->GetEnd() <= Len()) || bDelAttr, "Collaps: Attrib groesser als Absatz!" ); + DBG_ASSERT( pAttrib->GetStart() <= pAttrib->GetEnd(), "Collaps: Attribut distorted!" ); + DBG_ASSERT( ( pAttrib->GetEnd() <= Len()) || bDelAttr, "Collaps: Attribute larger than paragraph!" ); if ( bDelAttr /* || pAttrib->IsEmpty() */ ) { bResort = TRUE; @@ -959,13 +959,13 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r #endif // !SVX_LIGHT #ifdef EDITDEBUG - DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), TRUE ), "Collaps: Start-Liste verdreht" ); + DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), TRUE ), "Collaps: Start list distorted" ); #endif } void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, BOOL bKeepEndingAttribs ) { - DBG_ASSERT( pPrevNode, "kopieren von Attributen auf einen NULL-Pointer ?" ); + DBG_ASSERT( pPrevNode, "Copy of attributes to a null pointer?" ); xub_StrLen nCut = pPrevNode->Len(); @@ -975,32 +975,31 @@ void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, { if ( pAttrib->GetEnd() < nCut ) { - // bleiben unveraendert.... + // remain unchanged .... ; } else if ( pAttrib->GetEnd() == nCut ) { - // muessen als leeres Attribut kopiert werden. + // must be copied as an empty attributes. if ( bKeepEndingAttribs && !pAttrib->IsFeature() && !aCharAttribList.FindAttrib( pAttrib->GetItem()->Which(), 0 ) ) { EditCharAttrib* pNewAttrib = MakeCharAttrib( rPool, *(pAttrib->GetItem()), 0, 0 ); - DBG_ASSERT( pNewAttrib, "MakeCharAttrib fehlgeschlagen!" ); + DBG_ASSERT( pNewAttrib, "MakeCharAttrib failed!" ); aCharAttribList.InsertAttrib( pNewAttrib ); } } else if ( pAttrib->IsInside( nCut ) || ( !nCut && !pAttrib->GetStart() && !pAttrib->IsFeature() ) ) { - // Wenn ganz vorne gecuttet wird, muss das Attribut erhalten bleiben! - // muessen kopiert und geaendert werden + // If cut is done right at the front then the attribute must be + // kept! Has to be copied and changed. EditCharAttrib* pNewAttrib = MakeCharAttrib( rPool, *(pAttrib->GetItem()), 0, pAttrib->GetEnd()-nCut ); - DBG_ASSERT( pNewAttrib, "MakeCharAttrib fehlgeschlagen!" ); + DBG_ASSERT( pNewAttrib, "MakeCharAttrib failed!" ); aCharAttribList.InsertAttrib( pNewAttrib ); - // stutzen: pAttrib->GetEnd() = nCut; } else { - // alle dahinter verschieben in den neuen Node (this) + // Move all attributes in the current node (this) // pPrevNode->GetCharAttribs().RemoveAttrib( pAttrib ); pPrevNode->GetCharAttribs().GetAttribs().Remove( nAttr ); aCharAttribList.InsertAttrib( pAttrib ); @@ -1017,23 +1016,23 @@ void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, void ContentNode::AppendAttribs( ContentNode* pNextNode ) { - DBG_ASSERT( pNextNode, "kopieren von Attributen von einen NULL-Pointer ?" ); + DBG_ASSERT( pNextNode, "Copy of attributes to a null pointer?" ); USHORT nNewStart = Len(); #ifdef EDITDEBUG - DBG_ASSERT( aCharAttribList.DbgCheckAttribs(), "Attribute VOR AppendAttribs kaputt" ); + DBG_ASSERT( aCharAttribList.DbgCheckAttribs(), "Attribute before AppendAttribs broken" ); #endif USHORT nAttr = 0; EditCharAttrib* pAttrib = GetAttrib( pNextNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttrib ) { - // alle Attribute verschieben in den aktuellen Node (this) + // Move all attributes in the current node (this) BOOL bMelted = FALSE; if ( ( pAttrib->GetStart() == 0 ) && ( !pAttrib->IsFeature() ) ) { - // Evtl koennen Attribute zusammengefasst werden: + // Attributes can possibly be summarized as: USHORT nTmpAttr = 0; EditCharAttrib* pTmpAttrib = GetAttrib( aCharAttribList.GetAttribs(), nTmpAttr ); while ( !bMelted && pTmpAttrib ) @@ -1046,7 +1045,7 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode ) pTmpAttrib->GetEnd() = pTmpAttrib->GetEnd() + pAttrib->GetLen(); pNextNode->GetCharAttribs().GetAttribs().Remove( nAttr ); - // Vom Pool abmelden ?! + // Unsubscribe from the pool?! delete pAttrib; bMelted = TRUE; } @@ -1065,22 +1064,22 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode ) } pAttrib = GetAttrib( pNextNode->GetCharAttribs().GetAttribs(), nAttr ); } - // Fuer die Attribute, die nur ruebergewandert sind: + // For the Attributes that just moved over: pNextNode->GetCharAttribs().Clear(); #ifdef EDITDEBUG - DBG_ASSERT( aCharAttribList.DbgCheckAttribs(), "Attribute NACH AppendAttribs kaputt" ); + DBG_ASSERT( aCharAttribList.DbgCheckAttribs(), "Attribute after AppendAttribs broken" ); #endif } void ContentNode::CreateDefFont() { - // Erst alle Informationen aus dem Style verwenden... + // First use the information from the style ... SfxStyleSheet* pS = aContentAttribs.GetStyleSheet(); if ( pS ) CreateFont( GetCharAttribs().GetDefFont(), pS->GetItemSet() ); - // ... dann die harte Absatzformatierung rueberbuegeln... + // ... then iron out the hard paragraph formatting... CreateFont( GetCharAttribs().GetDefFont(), GetContentAttribs().GetItems(), pS == NULL ); } @@ -1089,9 +1088,10 @@ void ContentNode::SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyl { aContentAttribs.SetStyleSheet( pS ); - // Erst alle Informationen aus dem Style verwenden... + + // First use the information from the style ... GetCharAttribs().GetDefFont() = rFontFromStyle; - // ... dann die harte Absatzformatierung rueberbuegeln... + // ... then iron out the hard paragraph formatting... CreateFont( GetCharAttribs().GetDefFont(), GetContentAttribs().GetItems(), pS == NULL ); } @@ -1113,7 +1113,7 @@ void ContentNode::DestroyWrongList() void ContentNode::CreateWrongList() { - DBG_ASSERT( !pWrongList, "WrongList existiert schon!" ); + DBG_ASSERT( !pWrongList, "WrongList already exist!" ); #ifndef SVX_LIGHT pWrongList = new WrongList; #endif @@ -1121,7 +1121,7 @@ void ContentNode::CreateWrongList() void ContentNode::SetWrongList( WrongList* p ) { - DBG_ASSERT( !pWrongList, "WrongList existiert schon!" ); + DBG_ASSERT( !pWrongList, "WrongList already exist!" ); pWrongList = p; } @@ -1154,7 +1154,7 @@ SvxTabStop ContentAttribs::FindTabStop( long nCurPos, USHORT nDefTab ) return rTab; } - // DefTab ermitteln... + // Determine DefTab ... SvxTabStop aTabStop; long x = nCurPos / nDefTab + 1; aTabStop.GetTabPos() = nDefTab * x; @@ -1165,15 +1165,16 @@ void ContentAttribs::SetStyleSheet( SfxStyleSheet* pS ) { BOOL bStyleChanged = ( pStyle != pS ); pStyle = pS; - // #104799# Only when other style sheet, not when current style sheet modified + // Only when other style sheet, not when current style sheet modified if ( pStyle && bStyleChanged ) { - // Gezielt die Attribute aus der Absatzformatierung entfernen, die im Style - // spezifiziert sind, damit die Attribute des Styles wirken koennen. + // Selectively remove the attributes from the paragraph formatting + // which are specified in the style, so that the attributes of the + // style can have an affect. const SfxItemSet& rStyleAttribs = pStyle->GetItemSet(); for ( USHORT nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) { - // #99635# Don't change bullet on/off + // Don't change bullet on/off if ( ( nWhich != EE_PARA_BULLETSTATE ) && ( rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON ) ) aAttribSet.ClearItem( nWhich ); } @@ -1182,7 +1183,7 @@ void ContentAttribs::SetStyleSheet( SfxStyleSheet* pS ) const SfxPoolItem& ContentAttribs::GetItem( USHORT nWhich ) { - // Harte Absatzattribute haben Vorrang! + // Hard paragraph attributes take precedence! SfxItemSet* pTakeFrom = &aAttribSet; if ( pStyle && ( aAttribSet.GetItemState( nWhich, FALSE ) != SFX_ITEM_ON ) ) pTakeFrom = &pStyle->GetItemSet(); @@ -1353,12 +1354,12 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_RELIEF ) == SFX_ITEM_ON ) ) rFont.SetRelief( (FontRelief)((const SvxCharReliefItem&)rSet.Get( EE_CHAR_RELIEF )).GetValue() ); - // Ob ich jetzt den ganzen Font vergleiche, oder vor jeder Aenderung - // pruefe, ob der Wert sich aendert, bleibt sich relativ gleich. - // So ggf ein MakeUniqFont im Font mehr, dafuer bei Aenderung schnellerer - // Abbruch der Abfrage, oder ich musste noch jedesmal ein bChanged pflegen. + // If comparing the entire font, or if checking before each alteration + // whether the value changes, remains relatively the same thing. + // So possible one MakeUniqFont more in the font, but as a result a quicker + // abortion of the query, or one must each time check bChanged. if ( rFont == aPrevFont ) - rFont = aPrevFont; // => Gleicher ImpPointer fuer IsSameInstance + rFont = aPrevFont; // => The same ImpPointer for IsSameInstance } void EditDoc::CreateDefFont( BOOL bUseStyles ) @@ -1405,7 +1406,7 @@ XubString EditDoc::GetText( LineEnd eEnd ) const nLen += nNodes * nSepSize; if ( nLen > 0xFFFb / sizeof(xub_Unicode) ) { - DBG_ERROR( "Text zu gross fuer String" ); + DBG_ERROR( "Text to large for String" ); return XubString(); } xub_Unicode* pStr = new xub_Unicode[nLen+1]; @@ -1438,7 +1439,7 @@ XubString EditDoc::GetParaAsString( ContentNode* pNode, USHORT nStartPos, USHORT if ( nEndPos > pNode->Len() ) nEndPos = pNode->Len(); - DBG_ASSERT( nStartPos <= nEndPos, "Start und Ende vertauscht?" ); + DBG_ASSERT( nStartPos <= nEndPos, "Start and End reversed?" ); USHORT nIndex = nStartPos; XubString aStr; @@ -1449,9 +1450,9 @@ XubString EditDoc::GetParaAsString( ContentNode* pNode, USHORT nStartPos, USHORT if ( pNextFeature && ( pNextFeature->GetStart() < nEnd ) ) nEnd = pNextFeature->GetStart(); else - pNextFeature = 0; // Feature interessiert unten nicht + pNextFeature = 0; // Feature does not interest the below - DBG_ASSERT( nEnd >= nIndex, "Ende vorm Index?" ); + DBG_ASSERT( nEnd >= nIndex, "End in front of the index?" ); //!! beware of sub string length of -1 which is also defined as STRING_LEN and //!! thus would result in adding the whole sub string up to the end of the node !! if (nEnd > nIndex) @@ -1468,7 +1469,7 @@ XubString EditDoc::GetParaAsString( ContentNode* pNode, USHORT nStartPos, USHORT case EE_FEATURE_FIELD: if ( bResolveFields ) aStr += ((EditCharAttribField*)pNextFeature)->GetFieldValue(); break; - default: DBG_ERROR( "Was fuer ein Feature ?" ); + default: DBG_ERROR( "What feature?" ); } pNextFeature = pNode->GetCharAttribs().FindFeature( ++nEnd ); } @@ -1528,7 +1529,7 @@ void EditDoc::SetModified( BOOL b ) EditPaM EditDoc::RemoveText() { - // Das alte ItemSetmerken, damit z.B. im Chart Font behalten bleibt + // Keep the old ItemSet, to keep the chart Font. ContentNode* pPrevFirstNode = GetObject(0); SfxStyleSheet* pPrevStyle = pPrevFirstNode->GetStyleSheet(); SfxItemSet aPrevSet( pPrevFirstNode->GetContentAttribs().GetItems() ); @@ -1551,9 +1552,9 @@ EditPaM EditDoc::RemoveText() void EditDoc::InsertText( const EditPaM& rPaM, xub_Unicode c ) { - DBG_ASSERT( c != 0x0A, "EditDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" ); - DBG_ASSERT( c != 0x0D, "EditDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" ); - DBG_ASSERT( c != '\t', "EditDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" ); + DBG_ASSERT( c != 0x0A, "EditDoc::InsertText: Newlines prohibited in paragraph!" ); + DBG_ASSERT( c != 0x0D, "EditDoc::InsertText: Newlines prohibited in paragraph!" ); + DBG_ASSERT( c != '\t', "EditDoc::InsertText: Newlines prohibited in paragraph!" ); rPaM.GetNode()->Insert( c, rPaM.GetIndex() ); rPaM.GetNode()->ExpandAttribs( rPaM.GetIndex(), 1, GetItemPool() ); @@ -1563,9 +1564,9 @@ void EditDoc::InsertText( const EditPaM& rPaM, xub_Unicode c ) EditPaM EditDoc::InsertText( EditPaM aPaM, const XubString& rStr ) { - DBG_ASSERT( rStr.Search( 0x0A ) == STRING_NOTFOUND, "EditDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" ); - DBG_ASSERT( rStr.Search( 0x0D ) == STRING_NOTFOUND, "EditDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" ); - DBG_ASSERT( rStr.Search( '\t' ) == STRING_NOTFOUND, "EditDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" ); + DBG_ASSERT( rStr.Search( 0x0A ) == STRING_NOTFOUND, "EditDoc::InsertText: Newlines prohibited in paragraph!" ); + DBG_ASSERT( rStr.Search( 0x0D ) == STRING_NOTFOUND, "EditDoc::InsertText: Newlines prohibited in paragraph!" ); + DBG_ASSERT( rStr.Search( '\t' ) == STRING_NOTFOUND, "EditDoc::InsertText: Newlines prohibited in paragraph!" ); DBG_ASSERT( aPaM.GetNode(), "Blinder PaM in EditDoc::InsertText1" ); aPaM.GetNode()->Insert( rStr, aPaM.GetIndex() ); @@ -1591,10 +1592,10 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ) // for a new paragraph we like to have the bullet/numbering visible by default aContentAttribs.GetItems().Put( SfxBoolItem( EE_PARA_BULLETSTATE, TRUE), EE_PARA_BULLETSTATE ); - // ContenNode-CTOR kopiert auch die Absatzattribute + // ContenNode constructor copies also the paragraph attributes ContentNode* pNode = new ContentNode( aStr, aContentAttribs ); - // Den Default-Font kopieren + // Copy the Default Font pNode->GetCharAttribs().GetDefFont() = aPaM.GetNode()->GetCharAttribs().GetDefFont(); SfxStyleSheet* pStyle = aPaM.GetNode()->GetStyleSheet(); if ( pStyle ) @@ -1607,7 +1608,7 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ) } } - // Zeichenattribute muessen ggf. kopiert bzw gestutzt werden: + // Character attributes may need to be copied or trimmed: pNode->CopyAndCutAttribs( aPaM.GetNode(), GetItemPool(), bKeepEndingAttribs ); Insert( pNode, nPos+1 ); @@ -1626,9 +1627,9 @@ EditPaM EditDoc::InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem ) aPaM.GetNode()->Insert( CH_FEATURE, aPaM.GetIndex() ); aPaM.GetNode()->ExpandAttribs( aPaM.GetIndex(), 1, GetItemPool() ); - // Fuer das Feature ein Feature-Attribut anlegen... + // Create a feature-attribute for the feature... EditCharAttrib* pAttrib = MakeCharAttrib( GetItemPool(), rItem, aPaM.GetIndex(), aPaM.GetIndex()+1 ); - DBG_ASSERT( pAttrib, "Warum kann ich kein Feature anlegen ?" ); + DBG_ASSERT( pAttrib, "Why can not the feature be created?" ); aPaM.GetNode()->GetCharAttribs().InsertAttrib( pAttrib ); SetModified( TRUE ); @@ -1641,12 +1642,12 @@ EditPaM EditDoc::ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight ) { const EditPaM aPaM( pLeft, pLeft->Len() ); - // Erst die Attribute, da sonst nLen nicht stimmt! + // First the attributes, otherwise nLen will not be correct! pLeft->AppendAttribs( pRight ); - // Dann den Text... + // then the Text... *pLeft += *pRight; - // der rechte verschwindet. + // the one to the right disappears. RemoveItemsFromPool( pRight ); USHORT nRight = GetPos( pRight ); Remove( nRight ); @@ -1659,7 +1660,7 @@ EditPaM EditDoc::ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight ) EditPaM EditDoc::RemoveChars( EditPaM aPaM, USHORT nChars ) { - // Evtl. Features entfernen! + // Maybe remove Features! aPaM.GetNode()->Erase( aPaM.GetIndex(), nChars ); aPaM.GetNode()->CollapsAttribs( aPaM.GetIndex(), nChars, GetItemPool() ); @@ -1670,16 +1671,16 @@ EditPaM EditDoc::RemoveChars( EditPaM aPaM, USHORT nChars ) void EditDoc::InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) { - DBG_ASSERT( pNode, "Wohin mit dem Attribut?" ); - DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" ); + DBG_ASSERT( pNode, "What to do with the attribute?" ); + DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribute to large!" ); - // fuer Optimierung: - // dieses endet am Anfang der Selektion => kann erweitert werden + // for Optimization: + // This ends at the beginning of the selection => can be expanded EditCharAttrib* pEndingAttrib = 0; - // dieses startet am Ende der Selektion => kann erweitert werden + // This starts at the end of the selection => can be expanded EditCharAttrib* pStartingAttrib = 0; - DBG_ASSERT( nStart <= nEnd, "Kleiner Rechenfehler in InsertAttribInSelection" ); + DBG_ASSERT( nStart <= nEnd, "Small miscalculations in InsertAttribInSelection" ); RemoveAttribs( pNode, nStart, nEnd, pStartingAttrib, pEndingAttrib, rPoolItem.Which() ); @@ -1687,7 +1688,7 @@ void EditDoc::InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT ( *(pStartingAttrib->GetItem()) == rPoolItem ) && ( *(pEndingAttrib->GetItem()) == rPoolItem ) ) { - // wird ein groesses Attribut. + // Will become a large Attribute. pEndingAttrib->GetEnd() = pStartingAttrib->GetEnd(); GetItemPool().Remove( *(pStartingAttrib->GetItem()) ); pNode->GetCharAttribs().GetAttribs().Remove( pNode->GetCharAttribs().GetAttribs().GetPos( pStartingAttrib ) ); @@ -1715,65 +1716,62 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, USH BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, USHORT nWhich ) { - DBG_ASSERT( pNode, "Wohin mit dem Attribut?" ); - DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" ); - // dieses endet am Anfang der Selektion => kann erweitert werden + DBG_ASSERT( pNode, "What to do with the attribute?" ); + DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribute to large!" ); + + // This ends at the beginning of the selection => can be expanded rpEnding = 0; - // dieses startet am Ende der Selektion => kann erweitert werden + // This starts at the end of the selection => can be expanded rpStarting = 0; BOOL bChanged = FALSE; - DBG_ASSERT( nStart <= nEnd, "Kleiner Rechenfehler in InsertAttribInSelection" ); + DBG_ASSERT( nStart <= nEnd, "Small miscalculations in InsertAttribInSelection" ); - // ueber die Attribute iterieren... + // iterate over the attributes ... USHORT nAttr = 0; EditCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttr ) { BOOL bRemoveAttrib = FALSE; - // MT 11.9.97: - // Ich denke dass in dieser Methode generell keine Features geloescht - // werden sollen. - // => Dann koennen die Feature-Abfragen weiter unten entfallen USHORT nAttrWhich = pAttr->Which(); if ( ( nAttrWhich < EE_FEATURE_START ) && ( !nWhich || ( nAttrWhich == nWhich ) ) ) { - // Attribut beginnt in Selection + // Attribute starts in Selection if ( ( pAttr->GetStart() >= nStart ) && ( pAttr->GetStart() <= nEnd ) ) { bChanged = TRUE; if ( pAttr->GetEnd() > nEnd ) { - pAttr->GetStart() = nEnd; // dann faengt es dahinter an + pAttr->GetStart() = nEnd; // then it starts after this rpStarting = pAttr; if ( nWhich ) - break; // es kann kein weiteres Attrib hier liegen + break; // There can be no further attributes here } else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { - // Feature nur loeschen, wenn genau an der Stelle + // Delete feature only if on the exact spot bRemoveAttrib = TRUE; } } - // Attribut endet in Selection + // Attribute ends in Selection else if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetEnd() <= nEnd ) ) { bChanged = TRUE; if ( ( pAttr->GetStart() < nStart ) && !pAttr->IsFeature() ) { - pAttr->GetEnd() = nStart; // dann hoert es hier auf + pAttr->GetEnd() = nStart; // then it ends here rpEnding = pAttr; } else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { - // Feature nur loeschen, wenn genau an der Stelle + // Delete feature only if on the exact spot bRemoveAttrib = TRUE; } } - // Attribut ueberlappt die Selektion + // Attribute overlaps the selection else if ( ( pAttr->GetStart() <= nStart ) && ( pAttr->GetEnd() >= nEnd ) ) { bChanged = TRUE; @@ -1782,29 +1780,29 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi pAttr->GetStart() = nEnd; rpStarting = pAttr; if ( nWhich ) - break; // es kann weitere Attribute geben! + break; // There can be further attributes! } else if ( pAttr->GetEnd() == nEnd ) { pAttr->GetEnd() = nStart; rpEnding = pAttr; if ( nWhich ) - break; // es kann weitere Attribute geben! + break; // There can be further attributes! } - else // Attribut muss gesplittet werden... + else // Attribute must be split ... { USHORT nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; rpEnding = pAttr; InsertAttrib( *pAttr->GetItem(), pNode, nEnd, nOldEnd ); if ( nWhich ) - break; // es kann weitere Attribute geben! + break; // There can be further attributes! } } } if ( bRemoveAttrib ) { - DBG_ASSERT( ( pAttr != rpStarting ) && ( pAttr != rpEnding ), "Loeschen und behalten des gleichen Attributs ?" ); + DBG_ASSERT( ( pAttr != rpStarting ) && ( pAttr != rpEnding ), "Delete and retain the same attribute?" ); DBG_ASSERT( !pAttr->IsFeature(), "RemoveAttribs: Remove a feature?!" ); pNode->GetCharAttribs().GetAttribs().Remove(nAttr); GetItemPool().Remove( *pAttr->GetItem() ); @@ -1828,11 +1826,10 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi void EditDoc::InsertAttrib( const SfxPoolItem& rPoolItem, ContentNode* pNode, USHORT nStart, USHORT nEnd ) { - // Diese Methode prueft nicht mehr, ob ein entspr. Attribut - // schon an der Stelle existiert! - + // This method no longer checks whether a corresponding attribute already + // exists at this place! EditCharAttrib* pAttrib = MakeCharAttrib( GetItemPool(), rPoolItem, nStart, nEnd ); - DBG_ASSERT( pAttrib, "MakeCharAttrib fehlgeschlagen!" ); + DBG_ASSERT( pAttrib, "MakeCharAttrib failed!" ); pNode->GetCharAttribs().InsertAttrib( pAttrib ); SetModified( TRUE ); @@ -1846,23 +1843,23 @@ void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, cons } else { - // Pruefen, ob schon ein neues Attribut mit der WhichId an der Stelle: + // Check whether already a new attribute with WhichId exists at this place: EditCharAttrib* pAttr = pNode->GetCharAttribs().FindEmptyAttrib( rPoolItem.Which(), nStart ); if ( pAttr ) { - // Attribut entfernen.... + // Remove attribute.... pNode->GetCharAttribs().GetAttribs().Remove( pNode->GetCharAttribs().GetAttribs().GetPos( pAttr ) ); } - // pruefen, ob ein 'gleiches' Attribut an der Stelle liegt. + // check whether 'the same' attribute exist at this place. pAttr = pNode->GetCharAttribs().FindAttrib( rPoolItem.Which(), nStart ); if ( pAttr ) { - if ( pAttr->IsInside( nStart ) ) // splitten + if ( pAttr->IsInside( nStart ) ) // split { // ??????????????????????????????? - // eigentlich noch pruefen, ob wirklich splittet, oder return ! + // check again if really splitting, or return ! // ??????????????????????????????? USHORT nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; @@ -1871,8 +1868,8 @@ void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, cons } else if ( pAttr->GetEnd() == nStart ) { - DBG_ASSERT( !pAttr->IsEmpty(), "Doch noch ein leeres Attribut?" ); - // pruefen, ob genau das gleiche Attribut + DBG_ASSERT( !pAttr->IsEmpty(), "Still an empty attribute?" ); + // Check if exactly the same attribute if ( *(pAttr->GetItem()) == rPoolItem ) return; } @@ -1885,35 +1882,35 @@ void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, cons void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ) { - DBG_ASSERT( pNode, "Wo soll ich suchen ?" ); - DBG_ASSERT( nStartPos <= nEndPos, "Ungueltiger Bereich!" ); + DBG_ASSERT( pNode, "Where to search?" ); + DBG_ASSERT( nStartPos <= nEndPos, "Invalid region!" ); USHORT nAttr = 0; EditCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); - // keine Selection... + // No Selection... if ( nStartPos == nEndPos ) { while ( pAttr && ( pAttr->GetStart() <= nEndPos) ) { const SfxPoolItem* pItem = 0; - // Attribut liegt dadrueber... + // Attribute is about... if ( ( pAttr->GetStart() < nStartPos ) && ( pAttr->GetEnd() > nStartPos ) ) pItem = pAttr->GetItem(); - // Attribut endet hier, ist nicht leer + // Attribute ending here is not empty else if ( ( pAttr->GetStart() < nStartPos ) && ( pAttr->GetEnd() == nStartPos ) ) { if ( !pNode->GetCharAttribs().FindEmptyAttrib( pAttr->GetItem()->Which(), nStartPos ) ) pItem = pAttr->GetItem(); } - // Attribut endet hier, ist leer + // Attribute ending here is empty else if ( ( pAttr->GetStart() == nStartPos ) && ( pAttr->GetEnd() == nStartPos ) ) { pItem = pAttr->GetItem(); } - // Attribut beginnt hier + // Attribute starts here else if ( ( pAttr->GetStart() == nStartPos ) && ( pAttr->GetEnd() > nStartPos ) ) { - if ( nStartPos == 0 ) // Sonderfall + if ( nStartPos == 0 ) // special case pItem = pAttr->GetItem(); } @@ -1937,40 +1934,33 @@ void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); } } - else // Selektion + else // Selection { while ( pAttr && ( pAttr->GetStart() < nEndPos) ) { const SfxPoolItem* pItem = 0; - // Attribut liegt dadrueber... + // Attribut is about... if ( ( pAttr->GetStart() <= nStartPos ) && ( pAttr->GetEnd() >= nEndPos ) ) pItem = pAttr->GetItem(); - // Attribut startet mitten drin... + // Attribute starts right in the middle ... else if ( pAttr->GetStart() >= nStartPos ) { // !!! pItem = pAttr->GetItem(); - // einfach nur pItem reicht nicht, da ich z.B. bei Shadow - // niemals ein ungleiches Item finden wuerde, da ein solche - // seine Anwesenheit durch Abwesenheit repraesentiert! - // if ( ... ) - // Es muesste geprueft werden, on genau das gleiche Attribut - // an der Bruchstelle aufsetzt, was recht aufwendig ist. - // Da ich beim Einfuegen von Attributen aber etwas optimiere - // tritt der Fall nicht so schnell auf... - // Also aus Geschwindigkeitsgruenden: + // PItem is simply not enough, since one for example in case + // of Shadow, would never find an unequal item, since such a + // item represents its presence by absence! + // If (...) + // It needs to be examined on exactly the same attribute at the + // breaki point, which is quite expensive. + // Since optimazation is done when inserting the attributes + // this case does not appear so fast ... + // So based on the need for speed: rCurSet.InvalidateItem( pAttr->GetItem()->Which() ); } - // Attribut endet mitten drin... + // Attribute ends in the middle of it ... else if ( pAttr->GetEnd() > nStartPos ) { - // pItem = pAttr->GetItem(); - // s.o. - /* Ist falsch, wenn das gleiche Attribut sofort wieder - eingestellt wird! - => Sollte am besten nicht vorkommen, also gleich beim - Setzen von Attributen richtig machen! - */ rCurSet.InvalidateItem( pAttr->GetItem()->Which() ); } @@ -2025,18 +2015,16 @@ CharAttribList::~CharAttribList() void CharAttribList::InsertAttrib( EditCharAttrib* pAttrib ) { // !!!!!!!!!!!!!!!!!!!!!!!!!!!!! -// optimieren: binaere Suche ? ! +// optimize: binary search? ! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // MT: 26.11.98 - // Vielleicht aber auch einfach nur rueckwaerts iterieren: - // Der haeufigste und kritischste Fall: Attribute kommen bereits - // sortiert an (InsertBinTextObject!) - // Hier waere auch binaere Suche nicht optimal. - // => Wuerde einiges bringen! + // Maybe just simply iterate backwards: + // The most common and critical case: Attributes are already sorted + // (InsertBinTextObject!) binary search would not be optimal here. + // => Would bring something! const USHORT nCount = Count(); - const USHORT nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt. + const USHORT nStart = pAttrib->GetStart(); // may be better for Comp.Opt. if ( pAttrib->IsEmpty() ) bHasEmptyAttribs = TRUE; @@ -2099,8 +2087,8 @@ void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool ) EditCharAttrib* CharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) { - // Rueckwaerts, falls eins dort endet, das naechste startet. - // => Das startende gilt... + // Backwards, if one ends where the next starts. + // => The starting one is the valid one ... USHORT nAttr = aAttribs.Count()-1; EditCharAttrib* pAttr = GetAttrib( aAttribs, nAttr ); while ( pAttr ) @@ -2151,8 +2139,8 @@ BOOL CharAttribList::HasAttrib( USHORT nStartPos, USHORT nEndPos ) const BOOL CharAttribList::HasBoundingAttrib( USHORT nBound ) { - // Rueckwaerts, falls eins dort endet, das naechste startet. - // => Das startende gilt... + // Backwards, if one ends where the next starts. + // => The starting one is the valid one ... USHORT nAttr = aAttribs.Count()-1; EditCharAttrib* pAttr = GetAttrib( aAttribs, nAttr ); while ( pAttr && ( pAttr->GetEnd() >= nBound ) ) @@ -2186,14 +2174,14 @@ EditCharAttrib* CharAttribList::FindFeature( USHORT nPos ) const USHORT nAttr = 0; EditCharAttrib* pNextAttrib = GetAttrib( aAttribs, nAttr ); - // erstmal zur gewuenschten Position... + // first to the desired position ... while ( pNextAttrib && ( pNextAttrib->GetStart() < nPos ) ) { nAttr++; pNextAttrib = GetAttrib( aAttribs, nAttr ); } - // jetzt das Feature suchen... + // Now search for the Feature... while ( pNextAttrib && !pNextAttrib->IsFeature() ) { nAttr++; @@ -2230,7 +2218,7 @@ BOOL CharAttribList::DbgCheckAttribs() if ( pAttr->GetStart() > pAttr->GetEnd() ) { bOK = FALSE; - DBG_ERROR( "Attr verdreht" ); + DBG_ERROR( "Attribute is distorted" ); } else if ( pAttr->IsFeature() && ( pAttr->GetLen() != 1 ) ) { @@ -2269,7 +2257,7 @@ ULONG SvxFontTable::GetId( const SvxFontItem& rFontItem ) return GetCurKey(); pItem = Next(); } - DBG_WARNING( "Font nicht gefunden: GetId()" ); + DBG_WARNING( "Font not found: GetId()" ); return 0; } @@ -2290,7 +2278,7 @@ size_t SvxColorList::GetId( const SvxColorItem& rColorItem ) for ( size_t i = 0, n = aColorList.size(); i < n; ++i ) if ( *aColorList[ i ] == rColorItem ) return i; - DBG_WARNING( "Color nicht gefunden: GetId()" ); + DBG_WARNING( "Color not found: GetId()" ); return 0; } @@ -2335,11 +2323,11 @@ EditEngineItemPool::~EditEngineItemPool() SvStream& EditEngineItemPool::Store( SvStream& rStream ) const { - // Bei einem 3.1-Export muess ein Hack eingebaut werden, da BUG im - // SfxItemSet::Load, aber nicht nachtraeglich in 3.1 fixbar. + // for a 3.1 export a hack has to be installed, as in there is a BUG in + // SfxItemSet::Load, but not subsequently after 3.1. - // Der eingestellte Range muss nach Store erhalten bleiben, weil dann - // erst die ItemSets gespeichert werden... + // The selected range must be kept after Store, because itemsets are not + // stored until then... long nVersion = rStream.GetVersion(); BOOL b31Format = ( nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 ) ) diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index de2d99a..8f9ab61 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -204,7 +204,7 @@ private: public: ContentAttribs( SfxItemPool& rItemPool ); ContentAttribs( const ContentAttribs& ); - ~ContentAttribs(); // erst bei umfangreicheren Tabs + ~ContentAttribs(); // only for larger Tabs SvxTabStop FindTabStop( long nCurPos, USHORT nDefTab ); SfxItemSet& GetItems() { return aAttribSet; } @@ -222,7 +222,7 @@ class CharAttribList { private: CharAttribArray aAttribs; - SvxFont aDefFont; // schneller, als jedesmal vom Pool! + SvxFont aDefFont; // faster than ever from the pool! BOOL bHasEmptyAttribs; CharAttribList( const CharAttribList& ) {;} @@ -465,16 +465,16 @@ private: CharPosArray aPositions; long nTxtWidth; USHORT nStartPosX; - USHORT nStart; // koennte durch nStartPortion ersetzt werden - USHORT nEnd; // koennte durch nEndPortion ersetzt werden + USHORT nStart; // could be replaced by nStartPortion + USHORT nEnd; // could be replaced by nEndPortion USHORT nStartPortion; USHORT nEndPortion; - USHORT nHeight; // Gesamthoehe der Zeile - USHORT nTxtHeight; // Reine Texthoehe - USHORT nCrsrHeight; // Bei Konturfluss hohe Zeilen => Cursor zu groá. + USHORT nHeight; // Total height of the line + USHORT nTxtHeight; // Pure Text height + USHORT nCrsrHeight; // For contour flow high lines => cursor is large. USHORT nMaxAscent; BOOL bHangingPunctuation; - BOOL bInvalid; // fuer geschickte Formatierung + BOOL bInvalid; // for skillful formatting public: EditLine(); @@ -567,7 +567,7 @@ public: // ------------------------------------------------------------------------- class ParaPortion { - friend class ImpEditEngine; // zum Einstellen der Hoehe + friend class ImpEditEngine; // to adjust the height private: EditLineList aLineList; TextPortionList aTextPortionList; @@ -578,13 +578,13 @@ private: WritingDirectionInfos aWritingDirectionInfos; USHORT nInvalidPosStart; - USHORT nFirstLineOffset; // Fuer Writer-LineSpacing-Interpretation + USHORT nFirstLineOffset; // For Writer-LineSpacing-Interpretation USHORT nBulletX; short nInvalidDiff; BOOL bInvalid : 1; - BOOL bSimple : 1; // nur lineares Tippen - BOOL bVisible : 1; // MT 05/00: Gehoert an den Node!!! + BOOL bSimple : 1; // only linear Tap + BOOL bVisible : 1; // Belongs to the node! BOOL bForceRepaint : 1; ParaPortion( const ParaPortion& ); @@ -650,7 +650,7 @@ public: USHORT GetPos( const ParaPortionPtr &rPtr ) const; - // temporaer: + // temporary: void DbgCheck( EditDoc& rDoc ); }; @@ -664,7 +664,8 @@ private: EditPaM aEndPaM; public: - EditSelection(); // kein CCTOR und DTOR, geht autom. richtig! + EditSelection(); // No constructor and destructor + // are automtically excecuted correctly! EditSelection( const EditPaM& rStartAndAnd ); EditSelection( const EditPaM& rStart, const EditPaM& rEnd ); @@ -717,7 +718,7 @@ private: SfxItemPool* pItemPool; Link aModifyHdl; - SvxFont aDefFont; //schneller, als jedesmal vom Pool! + SvxFont aDefFont; //faster than ever from the pool!! USHORT nDefTab; BOOL bIsVertical; BOOL bIsFixedCellHeight; diff --git a/editeng/source/editeng/editdoc2.cxx b/editeng/source/editeng/editdoc2.cxx index 71077d0..fd89554 100644 --- a/editeng/source/editeng/editdoc2.cxx +++ b/editeng/source/editeng/editdoc2.cxx @@ -63,7 +63,7 @@ #include #include -#include // Fuer AppWindow... +#include // For AppWindow... DBG_NAME( EE_ParaPortion ) @@ -116,7 +116,7 @@ void TextPortionList::DeleteFromPortion( USHORT nDelFrom ) USHORT TextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOOL bPreferStartingPortion ) { - // Bei nCharPos an Portion-Grenze wird die linke Portion gefunden + // When nCharPos at portion limit, the left portion is found USHORT nTmpPos = 0; for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) { @@ -132,7 +132,7 @@ USHORT TextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOO } } } - DBG_ERROR( "FindPortion: Nicht gefunden!" ); + DBG_ERROR( "FindPortion: Not found!" ); return ( Count() - 1 ); } @@ -217,13 +217,13 @@ void ParaPortion::MarkInvalid( USHORT nStart, short nDiff ) } else { - // Einfaches hintereinander tippen + // Simple tap in succession if ( ( nDiff > 0 ) && ( nInvalidDiff > 0 ) && ( ( nInvalidPosStart+nInvalidDiff ) == nStart ) ) { nInvalidDiff = nInvalidDiff + nDiff; } - // Einfaches hintereinander loeschen + // Simple delete in succession else if ( ( nDiff < 0 ) && ( nInvalidDiff < 0 ) && ( nInvalidPosStart == nStart ) ) { nInvalidPosStart = nInvalidPosStart + nDiff; @@ -266,8 +266,8 @@ void ParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /* nEnd */ ) USHORT ParaPortion::GetLineNumber( USHORT nIndex ) { - DBG_ASSERTWARNING( aLineList.Count(), "Leere ParaPortion in GetLine!" ); - DBG_ASSERT( bVisible, "Wozu GetLine() bei einem unsichtbaren Absatz?" ); + DBG_ASSERTWARNING( aLineList.Count(), "Empty ParaPortion in GetLine!" ); + DBG_ASSERT( bVisible, "Why GetLine() on an invisible paragraph?" ); for ( USHORT nLine = 0; nLine < aLineList.Count(); nLine++ ) { @@ -275,8 +275,8 @@ USHORT ParaPortion::GetLineNumber( USHORT nIndex ) return nLine; } - // Dann sollte es am Ende der letzten Zeile sein! - DBG_ASSERT( nIndex == aLineList[ aLineList.Count() - 1 ]->GetEnd(), "Index voll daneben!" ); + // Then it should be at the end of the last line! + DBG_ASSERT( nIndex == aLineList[ aLineList.Count() - 1 ]->GetEnd(), "Index dead wrong!" ); return (aLineList.Count()-1); } @@ -288,19 +288,19 @@ void ParaPortion::SetVisible( BOOL bMakeVisible ) void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ) { USHORT nLines = aLineList.Count(); - DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" ); + DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Empty Portion?" ); if ( nLastFormattedLine < ( nLines - 1 ) ) { const EditLine* pLastFormatted = aLineList[ nLastFormattedLine ]; const EditLine* pUnformatted = aLineList[ nLastFormattedLine+1 ]; short nPortionDiff = pUnformatted->GetStartPortion() - pLastFormatted->GetEndPortion(); short nTextDiff = pUnformatted->GetStart() - pLastFormatted->GetEnd(); - nTextDiff++; // LastFormatted->GetEnd() war incl. => 1 zuviel abgezogen! + nTextDiff++; // LastFormatted->GetEnd() was included => 1 deducted too much! - // Die erste unformatierte muss genau eine Portion hinter der letzten der - // formatierten beginnen: - // Wenn in der geaenderten Zeile eine Portion gesplittet wurde, - // kann nLastEnd > nNextStart sein! + // The first unformatted must begin exactly one Portion behind the last + // of the formatted: + // If the modified line was split into one portion, can + // nLastEnd > nNextStart! int nPDiff = -( nPortionDiff-1 ); int nTDiff = -( nTextDiff-1 ); if ( nPDiff || nTDiff ) @@ -323,7 +323,7 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin } } } - DBG_ASSERT( aLineList[ aLineList.Count()-1 ]->GetEnd() == pNode->Len(), "CorrectLines: Ende stimmt nicht!" ); + DBG_ASSERT( aLineList[ aLineList.Count()-1 ]->GetEnd() == pNode->Len(), "CorrectLines: The end is not right!" ); } // Shared reverse lookup acceleration pieces ... @@ -401,7 +401,7 @@ long ParaPortionList::GetYOffset( ParaPortion* pPPortion ) return nHeight; nHeight += pTmpPortion->GetHeight(); } - DBG_ERROR( "GetYOffset: Portion nicht gefunden" ); + DBG_ERROR( "GetYOffset: Portion not found" ); return nHeight; } @@ -410,11 +410,11 @@ USHORT ParaPortionList::FindParagraph( long nYOffset ) long nY = 0; for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) { - nY += GetObject(nPortion)->GetHeight(); // sollte auch bei !bVisible richtig sein! + nY += GetObject(nPortion)->GetHeight(); // should also be correct even in bVisible! if ( nY > nYOffset ) return nPortion; } - return 0xFFFF; // solte mal ueber EE_PARA_NOT_FOUND erreicht werden! + return 0xFFFF; // Should be reachable through EE_PARA_NOT_FOUND! } void ParaPortionList::DbgCheck( EditDoc& @@ -424,12 +424,12 @@ void ParaPortionList::DbgCheck( EditDoc& ) { #ifdef DBG_UTIL - DBG_ASSERT( Count() == rDoc.Count(), "ParaPortionList::DbgCheck() - Count() ungleich!" ); + DBG_ASSERT( Count() == rDoc.Count(), "ParaPortionList::DbgCheck() - Count() unequal!" ); for ( USHORT i = 0; i < Count(); i++ ) { - DBG_ASSERT( SaveGetObject(i), "ParaPortionList::DbgCheck() - Null-Pointer in Liste!" ); - DBG_ASSERT( GetObject(i)->GetNode(), "ParaPortionList::DbgCheck() - Null-Pointer in Liste(2)!" ); - DBG_ASSERT( GetObject(i)->GetNode() == rDoc.GetObject(i), "ParaPortionList::DbgCheck() - Eintraege kreuzen sich!" ); + DBG_ASSERT( SaveGetObject(i), "ParaPortionList::DbgCheck() - Null-Pointer in List!" ); + DBG_ASSERT( GetObject(i)->GetNode(), "ParaPortionList::DbgCheck() - Null-Pointer in List(2)!" ); + DBG_ASSERT( GetObject(i)->GetNode() == rDoc.GetObject(i), "ParaPortionList::DbgCheck() - Entries intersect!" ); } #endif } @@ -449,17 +449,17 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit { case EE_PARA_LRSPACE: { - DBG_ASSERT( rPoolItem.IsA( TYPE( SvxLRSpaceItem ) ), "ConvertItem: Ungueltiges Item!" ); + DBG_ASSERT( rPoolItem.IsA( TYPE( SvxLRSpaceItem ) ), "ConvertItem: invalid Item!" ); SvxLRSpaceItem& rItem = (SvxLRSpaceItem&)rPoolItem; rItem.SetTxtFirstLineOfst( sal::static_int_cast< short >( OutputDevice::LogicToLogic( rItem.GetTxtFirstLineOfst(), eSourceUnit, eDestUnit ) ) ); rItem.SetTxtLeft( OutputDevice::LogicToLogic( rItem.GetTxtLeft(), eSourceUnit, eDestUnit ) ); -// rItem.SetLeft( OutputDevice::LogicToLogic( rItem.GetLeft(), eSourceUnit, eDestUnit ) ); // #96298# SetLeft manipulates nTxtLeft! +// rItem.SetLeft( OutputDevice::LogicToLogic( rItem.GetLeft(), eSourceUnit, eDestUnit ) ); rItem.SetRight( OutputDevice::LogicToLogic( rItem.GetRight(), eSourceUnit, eDestUnit ) ); } break; case EE_PARA_ULSPACE: { - DBG_ASSERT( rPoolItem.IsA( TYPE( SvxULSpaceItem ) ), "ConvertItem: Ungueltiges Item!" ); + DBG_ASSERT( rPoolItem.IsA( TYPE( SvxULSpaceItem ) ), "ConvertItem: Invalid Item!" ); SvxULSpaceItem& rItem = (SvxULSpaceItem&)rPoolItem; rItem.SetUpper( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetUpper(), eSourceUnit, eDestUnit ) ) ); rItem.SetLower( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetLower(), eSourceUnit, eDestUnit ) ) ); @@ -467,16 +467,16 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit break; case EE_PARA_SBL: { - DBG_ASSERT( rPoolItem.IsA( TYPE( SvxLineSpacingItem ) ), "ConvertItem: Ungueltiges Item!" ); + DBG_ASSERT( rPoolItem.IsA( TYPE( SvxLineSpacingItem ) ), "ConvertItem: Invalid Item!" ); SvxLineSpacingItem& rItem = (SvxLineSpacingItem&)rPoolItem; - // #96298# SetLineHeight changes also eLineSpace! + // SetLineHeight changes also eLineSpace! if ( rItem.GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) rItem.SetLineHeight( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetLineHeight(), eSourceUnit, eDestUnit ) ) ); } break; case EE_PARA_TABS: { - DBG_ASSERT( rPoolItem.IsA( TYPE( SvxTabStopItem ) ), "ConvertItem: Ungueltiges Item!" ); + DBG_ASSERT( rPoolItem.IsA( TYPE( SvxTabStopItem ) ), "ConvertItem: Invalid Item!" ); SvxTabStopItem& rItem = (SvxTabStopItem&)rPoolItem; SvxTabStopItem aNewItem( EE_PARA_TABS ); for ( USHORT i = 0; i < rItem.Count(); i++ ) @@ -492,7 +492,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit case EE_CHAR_FONTHEIGHT_CJK: case EE_CHAR_FONTHEIGHT_CTL: { - DBG_ASSERT( rPoolItem.IsA( TYPE( SvxFontHeightItem ) ), "ConvertItem: Ungueltiges Item!" ); + DBG_ASSERT( rPoolItem.IsA( TYPE( SvxFontHeightItem ) ), "ConvertItem: Invalid Item!" ); SvxFontHeightItem& rItem = (SvxFontHeightItem&)rPoolItem; rItem.SetHeight( OutputDevice::LogicToLogic( rItem.GetHeight(), eSourceUnit, eDestUnit ) ); } @@ -507,7 +507,7 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map for ( USHORT nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) { - // Wenn moeglich ueber SlotID gehen... + // If possible go through SlotID ... USHORT nSourceWhich = nWhich; USHORT nSlot = pDestPool->GetTrueSlotId( nWhich ); @@ -537,8 +537,6 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map } else { - // MT 3.3.99: Waere so eigentlich richtig, aber schon seit Jahren nicht so... -// rDest.ClearItem( nWhich ); } } } diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 3b9b25e..7fb6f72 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -95,7 +95,7 @@ #endif #include -// Spaeter -> TOOLS\STRING.H (fuer Grep: WS_TARGET) +// later -> TOOLS\STRING.H (for Grep: WS_TARGET) using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -113,7 +113,7 @@ SV_IMPL_VARARR( EECharAttribArray, EECharAttrib ); static SfxItemPool* pGlobalPool=0; - // ---------------------------------------------------------------------- +// ---------------------------------------------------------------------- // EditEngine // ---------------------------------------------------------------------- EditEngine::EditEngine( SfxItemPool* pItemPool ) @@ -155,7 +155,7 @@ SfxUndoManager& EditEngine::GetUndoManager() void EditEngine::UndoActionStart( sal_uInt16 nId ) { DBG_CHKTHIS( EditEngine, 0 ); - DBG_ASSERT( !pImpEditEngine->IsInUndo(), "Aufruf von UndoActionStart im Undomodus!" ); + DBG_ASSERT( !pImpEditEngine->IsInUndo(), "Calling UndoActionStart in Undomode!" ); if ( !pImpEditEngine->IsInUndo() ) pImpEditEngine->UndoActionStart( nId ); } @@ -163,7 +163,7 @@ void EditEngine::UndoActionStart( sal_uInt16 nId ) void EditEngine::UndoActionEnd( sal_uInt16 nId ) { DBG_CHKTHIS( EditEngine, 0 ); - DBG_ASSERT( !pImpEditEngine->IsInUndo(), "Aufruf von UndoActionEnd im Undomodus!" ); + DBG_ASSERT( !pImpEditEngine->IsInUndo(), "Calling UndoActionStart in Undomode!" ); if ( !pImpEditEngine->IsInUndo() ) pImpEditEngine->UndoActionEnd( nId ); } @@ -254,8 +254,8 @@ void EditEngine::Draw( OutputDevice* pOutDev, const Rectangle& rOutRect ) void EditEngine::Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation ) { DBG_CHKTHIS( EditEngine, 0 ); - // Mit 2 Punkten erzeugen, da bei Positivem Punkt, LONGMAX als Size - // Bottom und Right im Bereich > LONGMAX landen. + // Create with 2 points, as with positive points it will end up with + // LONGMAX as Size, Bottom and Right in the range > LONGMAX. Rectangle aBigRec( -0x3FFFFFFF, -0x3FFFFFFF, 0x3FFFFFFF, 0x3FFFFFFF ); if( pOutDev->GetConnectMetaFile() ) pOutDev->Push(); @@ -284,8 +284,8 @@ void EditEngine::Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const P EditDbg::ShowEditEngineData( this, sal_False ); #endif - // Auf Pixelgrenze ausrichten, damit genau das gleiche - // wie bei Paint(). + // Align to the pixel boundary, so that it becomes exactly the same + // as Paint (). Rectangle aOutRect( pOutDev->LogicToPixel( rOutRect ) ); aOutRect = pOutDev->PixelToLogic( aOutRect ); @@ -321,12 +321,12 @@ void EditEngine::Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const P } #endif - // Wenn es eine gab => Schnittmenge ! - // Bei der Metafileaufzeichnung Push/Pop verwenden. + // If one existed => intersection! + // Use Push/pop for creating the Meta file if ( bMetafile ) pOutDev->Push(); - // Immer die Intersect-Methode, weil beim Metafile ein Muss! + // Always use the Intersect method, it is a must for Metafile! if ( bClip ) { // Clip only if neccesary... @@ -338,8 +338,8 @@ void EditEngine::Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const P } else { - // Einige Druckertreiber bereiten Probleme, wenn Buchstaben die - // ClipRegion streifen, deshalb lieber ein Pixel mehr... + // Some printer drivers cause problems if characters graze the + // ClipRegion, therefore rather add a pixel more ... Rectangle aClipRect( aOutRect ); if ( pOutDev->GetOutDevType() == OUTDEV_PRINTER ) { @@ -388,7 +388,7 @@ EditView* EditEngine::RemoveView( EditView* pView ) pView->HideCursor(); EditView* pRemoved = 0; sal_uInt16 nPos = pImpEditEngine->GetEditViews().GetPos( pView ); - DBG_ASSERT( nPos != USHRT_MAX, "RemoveView mit ungueltigem Index" ); + DBG_ASSERT( nPos != USHRT_MAX, "RemoveView with invalid index" ); if ( nPos != USHRT_MAX ) { pRemoved = pImpEditEngine->GetEditViews().GetObject( nPos ); @@ -489,16 +489,10 @@ void EditEngine::SetPaperSize( const Size& rNewSize ) if ( bAutoPageSize || pImpEditEngine->IsFormatted() ) { - // Aendern der Breite hat bei AutoPageSize keine Wirkung, da durch - // Textbreite bestimmt. - // Optimierung erst nach Vobis-Auslieferung aktivieren... -// if ( !bAutoPageSize ) + // Changing the width has no effect for AutoPageSize, as this is + // determined by the text width. + // Optimization first after Vobis delivery was enabled ... pImpEditEngine->FormatFullDoc(); -// else -// { -// pImpEditEngine->FormatDoc(); // PageSize, falls Aenderung -// pImpEditEngine->CheckAutoPageSize(); // Falls nichts formatiert wurde -// } pImpEditEngine->UpdateViews( pImpEditEngine->GetActiveView() ); @@ -730,7 +724,7 @@ USHORT EditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const sal_uInt32 EditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine ) { DBG_CHKTHIS( EditEngine, 0 ); - // Falls jemand mit einer leeren Engine ein GetLineHeight() macht. + // If someone calls GetLineHeight() with an empty Engine. if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatDoc(); return pImpEditEngine->GetLineHeight( nParagraph, nLine ); @@ -826,7 +820,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie { DBG_CHKTHIS( EditEngine, 0 ); DBG_CHKOBJ( pEditView, EditView, 0 ); - DBG_ASSERT( pEditView, "Keine View - keine Kekse !" ); + DBG_ASSERT( pEditView, "no View - no cookie !" ); sal_Bool bDone = sal_True; @@ -866,7 +860,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie } // break; - default: // wird dann evtl. unten bearbeitet. + default: // is then possible edited below. eFunc = KEYFUNC_DONTKNOW; } } @@ -1153,7 +1147,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie { xub_Unicode nCharCode = rKeyEvent.GetCharCode(); pEditView->pImpEditView->DrawSelection(); - // Autokorrektur ? + // Autocorrection? SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get()->GetAutoCorrect(); if ( ( pImpEditEngine->GetStatus().DoAutoCorrect() ) && ( SvxAutoCorrect::IsAutoCorrectChar( nCharCode ) || @@ -1169,7 +1163,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie // AutoComplete ??? if ( pImpEditEngine->GetStatus().DoAutoComplete() && ( nCharCode != ' ' ) ) { - // Aber nur wenn Wort-Ende... + // Only at end of word... sal_uInt16 nIndex = aCurSel.Max().GetIndex(); if ( ( nIndex >= aCurSel.Max().GetNode()->Len() ) || ( pImpEditEngine->aWordDelimiters.Search( aCurSel.Max().GetNode()->GetChar( nIndex ) ) != STRING_NOTFOUND ) ) @@ -1266,7 +1260,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie if ( bModified ) { DBG_ASSERT( !bReadOnly, "ReadOnly but modified???" ); - // Idle-Formatter nur, wenn AnyInput. + // Idle-Formatter only when AnyInput. if ( bAllowIdle && pImpEditEngine->GetStatus().UseIdleFormatter() && Application::AnyInput( INPUT_KEYBOARD) ) pImpEditEngine->IdleFormatAndUpdate( pEditView ); @@ -1466,8 +1460,8 @@ EditTextObject* EditEngine::CreateTextObject( sal_uInt16 nPara, sal_uInt16 nPara ContentNode* pStartNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); ContentNode* pEndNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara+nParas-1 ); - DBG_ASSERT( pStartNode, "Start-Absatz existiert nicht: CreateTextObject" ); - DBG_ASSERT( pEndNode, "End-Absatz existiert nicht: CreateTextObject" ); + DBG_ASSERT( pStartNode, "Start-Paragraph does not exist: CreateTextObject" ); + DBG_ASSERT( pEndNode, "End-Paragraph does not exist: CreateTextObject" ); if ( pStartNode && pEndNode ) { @@ -1482,16 +1476,16 @@ EditTextObject* EditEngine::CreateTextObject( sal_uInt16 nPara, sal_uInt16 nPara void EditEngine::RemoveParagraph( sal_uInt16 nPara ) { DBG_CHKTHIS( EditEngine, 0 ); - DBG_ASSERT( pImpEditEngine->GetEditDoc().Count() > 1, "Der erste Absatz darf nicht geloescht werden!" ); + DBG_ASSERT( pImpEditEngine->GetEditDoc().Count() > 1, "The first paragraph should not be deleted!" ); if( pImpEditEngine->GetEditDoc().Count() <= 1 ) return; ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); ParaPortion* pPortion = pImpEditEngine->GetParaPortions().SaveGetObject( nPara ); - DBG_ASSERT( pPortion && pNode, "Absatz nicht gefunden: RemoveParagraph" ); + DBG_ASSERT( pPortion && pNode, "Paragraph not found: RemoveParagraph" ); if ( pNode && pPortion ) { - // Keine Undokappselung noetig. + // No Undo encapsulation needed. pImpEditEngine->ImpRemoveParagraph( nPara ); pImpEditEngine->InvalidateFromParagraph( nPara ); pImpEditEngine->UpdateSelections(); @@ -1503,7 +1497,7 @@ sal_uInt16 EditEngine::GetTextLen( sal_uInt16 nPara ) const { DBG_CHKTHIS( EditEngine, 0 ); ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); - DBG_ASSERT( pNode, "Absatz nicht gefunden: GetTextLen" ); + DBG_ASSERT( pNode, "Paragraph not found: GetTextLen" ); if ( pNode ) return pNode->Len(); return 0; @@ -1567,16 +1561,16 @@ void EditEngine::InsertParagraph( sal_uInt16 nPara, const EditTextObject& rTxtOb DBG_CHKTHIS( EditEngine, 0 ); if ( nPara > GetParagraphCount() ) { - DBG_ASSERTWARNING( nPara == USHRT_MAX, "AbsatzNr zu Gro???, aber nicht LIST_APPEND! " ); + DBG_ASSERTWARNING( nPara == USHRT_MAX, "Paragraph number to large, but not LIST_APPEND!" ); nPara = GetParagraphCount(); } pImpEditEngine->UndoActionStart( EDITUNDO_INSERT ); - // Keine Undoklammerung noetig. + // No Undo componding needed. EditPaM aPaM( pImpEditEngine->InsertParagraph( nPara ) ); - // Bei einem InsertParagraph von aussen sollen keine Harten - // Attribute uebernommen werden ! + // When InsertParagraph from the outside, no hard attributes + // should be taken over! pImpEditEngine->RemoveCharAttribs( nPara ); pImpEditEngine->InsertText( rTxtObj, EditSelection( aPaM, aPaM ) ); @@ -1590,14 +1584,14 @@ void EditEngine::InsertParagraph( sal_uInt16 nPara, const XubString& rTxt ) DBG_CHKTHIS( EditEngine, 0 ); if ( nPara > GetParagraphCount() ) { - DBG_ASSERTWARNING( nPara == USHRT_MAX, "AbsatzNr zu Gro???, aber nicht LIST_APPEND! " ); + DBG_ASSERTWARNING( nPara == USHRT_MAX, "Paragraph number to large, but not LIST_APPEND!" ); nPara = GetParagraphCount(); } pImpEditEngine->UndoActionStart( EDITUNDO_INSERT ); EditPaM aPaM( pImpEditEngine->InsertParagraph( nPara ) ); - // Bei einem InsertParagraph von aussen sollen keine Harten - // Attribute uebernommen werden ! + // When InsertParagraph from the outside, no hard attributes + // should be taken over! pImpEditEngine->RemoveCharAttribs( nPara ); pImpEditEngine->UndoActionEnd( EDITUNDO_INSERT ); pImpEditEngine->ImpInsertText( EditSelection( aPaM, aPaM ), rTxt ); @@ -1635,7 +1629,6 @@ void EditEngine::SetText( sal_uInt16 nPara, const XubString& rTxt ) void EditEngine::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) { DBG_CHKTHIS( EditEngine, 0 ); - // Keine Undoklammerung noetig. pImpEditEngine->SetParaAttribs( nPara, rSet ); pImpEditEngine->FormatAndUpdate(); } @@ -1689,7 +1682,6 @@ void EditEngine::RemoveAttribs( const ESelection& rSelection, sal_Bool bRemovePa pImpEditEngine->FormatAndUpdate(); } -// MT: Can be removed after 6.x? Font EditEngine::GetStandardFont( sal_uInt16 nPara ) { DBG_CHKTHIS( EditEngine, 0 ); @@ -1758,7 +1750,7 @@ void EditEngine::SetControlWord( sal_uInt32 nWord ) sal_uInt32 nChanges = nPrev ^ nWord; if ( pImpEditEngine->IsFormatted() ) { - // ggf. neu formatieren: + // possibly reformat: if ( ( nChanges & EE_CNTRL_USECHARATTRIBS ) || ( nChanges & EE_CNTRL_USEPARAATTRIBS ) || ( nChanges & EE_CNTRL_ONECHARPERLINE ) || @@ -1786,7 +1778,7 @@ void EditEngine::SetControlWord( sal_uInt32 nWord ) pImpEditEngine->StopOnlineSpellTimer(); if ( bSpellingChanged && ( nWord & EE_CNTRL_ONLINESPELLING ) ) { - // WrongListen anlegen, Timer starten... + // Create WrongList, start timer... sal_uInt16 nNodes = pImpEditEngine->GetEditDoc().Count(); for ( sal_uInt16 n = 0; n < nNodes; n++ ) { @@ -1805,8 +1797,8 @@ void EditEngine::SetControlWord( sal_uInt32 nWord ) ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( n ); ParaPortion* pPortion = pImpEditEngine->GetParaPortions().GetObject( n ); sal_Bool bWrongs = ( bSpellingChanged || ( nWord & EE_CNTRL_ONLINESPELLING ) ) ? pNode->GetWrongList()->HasWrongs() : sal_False; - if ( bSpellingChanged ) // Also aus - pNode->DestroyWrongList(); // => vorm Paint weghaun. + if ( bSpellingChanged ) + pNode->DestroyWrongList(); if ( bWrongs ) { pImpEditEngine->aInvalidRec.Left() = 0; @@ -1860,17 +1852,18 @@ Point EditEngine::GetDocPosTopLeft( sal_uInt16 nParagraph ) { DBG_CHKTHIS( EditEngine, 0 ); ParaPortion* pPPortion = pImpEditEngine->GetParaPortions().SaveGetObject( nParagraph ); - DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetWindowPosTopLeft" ); + DBG_ASSERT( pPPortion, "Paragraph not found: GetWindowPosTopLeft" ); Point aPoint; if ( pPPortion ) { - // Falls jemand mit einer leeren Engine ein GetLineHeight() macht. + + // If someone calls GetLineHeight() whith an empty Engine. DBG_ASSERT( pImpEditEngine->IsFormatted() || !pImpEditEngine->IsFormatting(), "GetDocPosTopLeft: Doc not formatted - unable to format!" ); if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatAndUpdate(); if ( pPPortion->GetLines().Count() ) { - // So richtiger, falls grosses Bullet. + // Correct it if large Bullet. EditLine* pFirstLine = pPPortion->GetLines()[0]; aPoint.X() = pFirstLine->GetStartPosX(); } @@ -1913,7 +1906,7 @@ sal_Bool EditEngine::IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder ) pImpEditEngine->FormatDoc(); sal_Bool bTextPos = sal_False; - // #90780# take unrotated positions for calculation here + // take unrotated positions for calculation here Point aDocPos = GetDocPos( rPaperPos ); if ( ( aDocPos.Y() > 0 ) && ( aDocPos.Y() < (long)pImpEditEngine->GetTextHeight() ) ) @@ -2028,7 +2021,7 @@ void EditEngine::QuickFormatDoc( sal_Bool bFull ) else pImpEditEngine->FormatDoc(); - // #111072# Don't pass active view, maybe selection is not updated yet... + // Don't pass active view, maybe selection is not updated yet... pImpEditEngine->UpdateViews( NULL ); } @@ -2079,7 +2072,7 @@ XubString EditEngine::GetWordDelimiters() const void EditEngine::SetGroupChars( const XubString& rChars ) { DBG_CHKTHIS( EditEngine, 0 ); - DBG_ASSERT( ( rChars.Len() % 2 ) == 0, "SetGroupChars: Ungerade Anzahl!" ); + DBG_ASSERT( ( rChars.Len() % 2 ) == 0, "SetGroupChars: Odd number!" ); pImpEditEngine->aGroupChars = rChars; } @@ -2352,7 +2345,7 @@ void EditEngine::RemoveFields( sal_Bool bKeepFieldText, TypeId aType ) const SvxFieldData* pFldData = ((const SvxFieldItem*)pAttr->GetItem())->GetField(); if ( pFldData && ( !aType || ( pFldData->IsA( aType ) ) ) ) { - DBG_ASSERT( pAttr->GetItem()->ISA( SvxFieldItem ), "Kein FeldItem..." ); + DBG_ASSERT( pAttr->GetItem()->ISA( SvxFieldItem ), "no field item..." ); EditSelection aSel( EditPaM( pNode, pAttr->GetStart() ), EditPaM( pNode, pAttr->GetEnd() ) ); String aFieldText = ((EditCharAttribField*)pAttr)->GetFieldValue(); pImpEditEngine->ImpInsertText( aSel, aFieldText ); @@ -2411,7 +2404,7 @@ Rectangle EditEngine::GetCharacterBounds( const EPosition& rPos ) const Rectangle aBounds; ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( rPos.nPara ); - // #109151# Check against index, not paragraph + // Check against index, not paragraph if ( pNode && ( rPos.nIndex < pNode->Len() ) ) { aBounds = pImpEditEngine->PaMtoEditCursor( EditPaM( pNode, rPos.nIndex ), GETCRSR_TXTONLY ); @@ -2426,7 +2419,7 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_uInt16 nPara ) { DBG_CHKTHIS( EditEngine, 0 ); - // Funktioniert nur, wenn nicht bereits in der Formatierung... + // This only works if not already in the format ... if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatDoc(); @@ -2461,7 +2454,7 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_uInt16 nPara ) } // ===================================================================== -// ====================== Virtuelle Methoden ======================= +// ====================== Virtual Methods ======================== // ===================================================================== void EditEngine::DrawingText( const Point&, const XubString&, USHORT, USHORT, const sal_Int32*, const SvxFont&, sal_uInt16, sal_uInt16, BYTE, @@ -2519,7 +2512,7 @@ void EditEngine::ParagraphConnected( USHORT /*nLeftParagraph*/, USHORT /*nRightP sal_Bool EditEngine::FormattingParagraph( sal_uInt16 ) { - // return sal_True, wenn die Attribute geaendert wurden... + // return sal_True, if the Attribute was changed ... DBG_CHKTHIS( EditEngine, 0 ); return sal_False; } @@ -2621,8 +2614,8 @@ void EditEngine::FieldSelected( const SvxFieldItem&, sal_uInt16, sal_uInt16 ) DBG_CHKTHIS( EditEngine, 0 ); } - // ===================================================================== -// ====================== Statische Methoden ======================= +// ===================================================================== +// ====================== Static Methods ======================= // ===================================================================== SfxItemPool* EditEngine::CreatePool( sal_Bool bPersistentRefCounts ) { @@ -2739,7 +2732,7 @@ sal_Bool EditEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent ) case KEYFUNC_CUT: case KEYFUNC_PASTE: bDoesChange = sal_True; break; - default: // wird dann evtl. unten bearbeitet. + default: // is then possibly edited below. eFunc = KEYFUNC_DONTKNOW; } } @@ -2777,94 +2770,10 @@ sal_Bool EditEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent ) return sal_False; } -// Mal in den Outliner schieben... +// should be moved to the Outliner... void EditEngine::ImportBulletItem( SvxNumBulletItem& /*rNumBullet*/, sal_uInt16 /*nLevel*/, const SvxBulletItem* /*pOldBullet*/, const SvxLRSpaceItem* /*pOldLRSpace*/ ) { -/* TL_NFLR - if ( pOldBullet || pOldLRSpace ) - { - // Numberformat dynamisch, weil Zuweisungsoperator nicht implementiert. - - // Altes NumBulletItem nur uebernehmen, wenn kein altes BulletItem - const SvxNumberFormat* pFmt = ( !pOldBullet && ( rNumBullet.GetNumRule()->GetLevelCount() > nLevel ) ) ? - rNumBullet.GetNumRule()->Get( nLevel ) : NULL; - SvxNumberFormat* pNumberFormat = pFmt - ? new SvxNumberFormat( *pFmt ) - : new SvxNumberFormat( SVX_NUM_NUMBER_NONE ); - if ( pOldBullet ) - { - // Style - SvxExtNumType eNumType; - switch( pOldBullet->GetStyle() ) - { - case BS_BMP: eNumType = SVX_NUM_BITMAP; break; - case BS_BULLET: eNumType = SVX_NUM_CHAR_SPECIAL; break; - case BS_ROMAN_BIG: eNumType = SVX_NUM_ROMAN_UPPER; break; - case BS_ROMAN_SMALL: eNumType = SVX_NUM_ROMAN_LOWER; break; - case BS_ABC_BIG: eNumType = SVX_NUM_CHARS_UPPER_LETTER; break; - case BS_ABC_SMALL: eNumType = SVX_NUM_CHARS_LOWER_LETTER; break; - case BS_123: eNumType = SVX_NUM_ARABIC; break; - default: eNumType = SVX_NUM_NUMBER_NONE; break; - } - pNumberFormat->SetNumberingType( - sal::static_int_cast< sal_Int16 >( eNumType ) ); - - // Justification - SvxAdjust eAdjust; - switch( pOldBullet->GetJustification() & (BJ_HRIGHT|BJ_HCENTER|BJ_HLEFT) ) - { - case BJ_HRIGHT: eAdjust = SVX_ADJUST_RIGHT; break; - case BJ_HCENTER: eAdjust = SVX_ADJUST_CENTER; break; - default: eAdjust = SVX_ADJUST_LEFT; break; - } - pNumberFormat->SetNumAdjust(eAdjust); - - // Prefix/Suffix - pNumberFormat->SetPrefix( pOldBullet->GetPrevText() ); - pNumberFormat->SetSuffix( pOldBullet->GetFollowText() ); - - //Font - if ( eNumType != SVX_NUM_BITMAP ) - { - Font aTmpFont = pOldBullet->GetFont(); - pNumberFormat->SetBulletFont( &aTmpFont ); - } - - // Color - pNumberFormat->SetBulletColor( pOldBullet->GetFont().GetColor() ); - - // Start - pNumberFormat->SetStart( pOldBullet->GetStart() ); - - // Scale - pNumberFormat->SetBulletRelSize( pOldBullet->GetScale() ); - - // Bullet/Bitmap - if( eNumType == SVX_NUM_CHAR_SPECIAL ) - { - pNumberFormat->SetBulletChar( pOldBullet->GetSymbol() ); - } - else if( eNumType == SVX_NUM_BITMAP ) - { - SvxBrushItem aBItem( Graphic( pOldBullet->GetBitmap() ), GPOS_NONE, SID_ATTR_BRUSH ); - pNumberFormat->SetGraphicBrush( &aBItem ); - } - } - - // Einzug und Erstzeileneinzug -//TL_NFLR if ( pOldLRSpace ) -//TL_NFLR { -//TL_NFLR short nLSpace = (short)pOldLRSpace->GetTxtLeft(); -//TL_NFLR pNumberFormat->SetLSpace( nLSpace ); -//TL_NFLR pNumberFormat->SetAbsLSpace( nLSpace ); -//TL_NFLR pNumberFormat->SetFirstLineOffset( pOldLRSpace->GetTxtFirstLineOfst() ); -//TL_NFLR } - - rNumBullet.GetNumRule()->SetLevel( nLevel, *pNumberFormat ); - delete pNumberFormat; - } -*/ } BOOL EditEngine::HasValidData( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rTransferable ) diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index f433f60..247b82d 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -142,7 +142,7 @@ BOOL lcl_CreateBulletItem( const SvxNumBulletItem& rNumBullet, USHORT nLevel, Sv XEditAttribute* MakeXEditAttribute( SfxItemPool& rPool, const SfxPoolItem& rItem, USHORT nStart, USHORT nEnd ) { - // das neue Attribut im Pool anlegen + // Create thw new attribute in the pool const SfxPoolItem& rNew = rPool.Put( rItem ); XEditAttribute* pNew = new XEditAttribute( rNew, nStart, nEnd ); @@ -169,7 +169,7 @@ XEditAttribute::XEditAttribute( const SfxPoolItem& rAttr, USHORT nS, USHORT nE ) XEditAttribute::~XEditAttribute() { DBG_DTOR( XEditAttribute, 0 ); - pItem = 0; // Gehoert dem Pool. + pItem = 0; // belongs to the Pool. } XEditAttribute* XEditAttributeList::FindAttrib( USHORT _nWhich, USHORT nChar ) const @@ -187,28 +187,22 @@ ContentInfo::ContentInfo( SfxItemPool& rPool ) : aParaAttribs( rPool, EE_PARA_ST { eFamily = SFX_STYLE_FAMILY_PARA; pWrongs = NULL; -/* cl removed because not needed anymore since binfilter - pTempLoadStoreInfos = NULL; -*/ } -// Richtiger CopyCTOR unsinning, weil ich mit einem anderen Pool arbeiten muss! +// the real Copy constructor is nonsens, since I have to work with another Pool! ContentInfo::ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse ) : aParaAttribs( rPoolToUse, EE_PARA_START, EE_CHAR_END ) { pWrongs = NULL; -/* cl removed because not needed anymore since binfilter - pTempLoadStoreInfos = NULL; -*/ + if ( rCopyFrom.GetWrongList() ) pWrongs = rCopyFrom.GetWrongList()->Clone(); - // So sollten die Items im richtigen Pool landen! + // this should ensure that the Items end up in the correct Pool! aParaAttribs.Set( rCopyFrom.GetParaAttribs() ); aText = rCopyFrom.GetText(); aStyle = rCopyFrom.GetStyle(); eFamily = rCopyFrom.GetFamily(); - // Attribute kopieren... for ( USHORT n = 0; n < rCopyFrom.GetAttribs().Count(); n++ ) { XEditAttribute* pAttr = rCopyFrom.GetAttribs().GetObject( n ); @@ -216,7 +210,6 @@ ContentInfo::ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse aAttribs.Insert( pMyAttr, aAttribs.Count() ); } - // Wrongs pWrongs = NULL; #ifndef SVX_LIGHT if ( rCopyFrom.GetWrongList() ) @@ -229,7 +222,6 @@ ContentInfo::~ContentInfo() for ( USHORT nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) { XEditAttribute* pAttr = aAttribs.GetObject(nAttr); - // Item aus Pool entfernen! aParaAttribs.GetPool()->Remove( *pAttr->GetItem() ); delete pAttr; } @@ -239,20 +231,6 @@ ContentInfo::~ContentInfo() #endif } -/* cl removed because not needed anymore since binfilter -void ContentInfo::CreateLoadStoreTempInfos() -{ - delete pTempLoadStoreInfos; - pTempLoadStoreInfos = new LoadStoreTempInfos; -} - -void ContentInfo::DestroyLoadStoreTempInfos() -{ - delete pTempLoadStoreInfos; - pTempLoadStoreInfos = NULL; -} -*/ - // #i102062# bool ContentInfo::isWrongListEqual(const ContentInfo& rCompare) const { @@ -309,172 +287,172 @@ EditTextObject::~EditTextObject() USHORT EditTextObject::GetParagraphCount() const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return 0; } XubString EditTextObject::GetText( USHORT /* nParagraph */ ) const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return XubString(); } void EditTextObject::Insert( const EditTextObject& /* rObj */, USHORT /* nPara */) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } EditTextObject* EditTextObject::CreateTextObject( USHORT /*nPara*/, USHORT /*nParas*/ ) const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return 0; } void EditTextObject::RemoveParagraph( USHORT /*nPara*/ ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } BOOL EditTextObject::HasPortionInfo() const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return FALSE; } void EditTextObject::ClearPortionInfo() { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } BOOL EditTextObject::HasOnlineSpellErrors() const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return FALSE; } BOOL EditTextObject::HasCharAttribs( USHORT ) const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return FALSE; } void EditTextObject::GetCharAttribs( USHORT /*nPara*/, EECharAttribArray& /*rLst*/ ) const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } void EditTextObject::MergeParaAttribs( const SfxItemSet& /*rAttribs*/, USHORT /*nStart*/, USHORT /*nEnd*/ ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } BOOL EditTextObject::IsFieldObject() const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return FALSE; } const SvxFieldItem* EditTextObject::GetField() const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return 0; } BOOL EditTextObject::HasField( TypeId /*aType*/ ) const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return FALSE; } SfxItemSet EditTextObject::GetParaAttribs( USHORT /*nPara*/ ) const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return SfxItemSet( *(SfxItemPool*)NULL ); } void EditTextObject::SetParaAttribs( USHORT /*nPara*/, const SfxItemSet& /*rAttribs*/ ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } BOOL EditTextObject::RemoveCharAttribs( USHORT /*nWhich*/ ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return FALSE; } BOOL EditTextObject::RemoveParaAttribs( USHORT /*nWhich*/ ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return FALSE; } BOOL EditTextObject::HasStyleSheet( const XubString& /*rName*/, SfxStyleFamily /*eFamily*/ ) const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return FALSE; } void EditTextObject::GetStyleSheet( USHORT /*nPara*/, XubString& /*rName*/, SfxStyleFamily& /*eFamily*/ ) const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } void EditTextObject::SetStyleSheet( USHORT /*nPara*/, const XubString& /*rName*/, const SfxStyleFamily& /*eFamily*/ ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } BOOL EditTextObject::ChangeStyleSheets( const XubString&, SfxStyleFamily, const XubString&, SfxStyleFamily ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return FALSE; } void EditTextObject::ChangeStyleSheetName( SfxStyleFamily /*eFamily*/, const XubString& /*rOldName*/, const XubString& /*rNewName*/ ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } USHORT EditTextObject::GetUserType() const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return 0; } void EditTextObject::SetUserType( USHORT ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } ULONG EditTextObject::GetObjectSettings() const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return 0; } void EditTextObject::SetObjectSettings( ULONG ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); } BOOL EditTextObject::IsVertical() const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return FALSE; } void EditTextObject::SetVertical( BOOL bVertical ) { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); ((BinTextObject*)this)->SetVertical( bVertical ); } USHORT EditTextObject::GetScriptType() const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return ((const BinTextObject*)this)->GetScriptType(); } @@ -484,7 +462,6 @@ BOOL EditTextObject::Store( SvStream& rOStream ) const if ( rOStream.GetError() ) return FALSE; - // Vorspann: sal_Size nStartPos = rOStream.Tell(); rOStream << (USHORT)Which(); @@ -492,10 +469,8 @@ BOOL EditTextObject::Store( SvStream& rOStream ) const sal_uInt32 nStructSz = 0; rOStream << nStructSz; - // Eigene Daten: StoreData( rOStream ); - // Nachspann: sal_Size nEndPos = rOStream.Tell(); nStructSz = nEndPos - nStartPos - sizeof( nWhich ) - sizeof( nStructSz ); rOStream.Seek( nStartPos + sizeof( nWhich ) ); @@ -509,14 +484,14 @@ EditTextObject* EditTextObject::Create( SvStream& rIStream, SfxItemPool* pGlobal { ULONG nStartPos = rIStream.Tell(); - // Ertmal sehen, was fuer ein Object... + // First check what type of Object... USHORT nWhich; rIStream >> nWhich; sal_uInt32 nStructSz; rIStream >> nStructSz; - DBG_ASSERT( ( nWhich == 0x22 /*EE_FORMAT_BIN300*/ ) || ( nWhich == EE_FORMAT_BIN ), "CreateTextObject: Unbekanntes Objekt!" ); + DBG_ASSERT( ( nWhich == 0x22 /*EE_FORMAT_BIN300*/ ) || ( nWhich == EE_FORMAT_BIN ), "CreateTextObject: Unknown Object!" ); if ( rIStream.GetError() ) return NULL; @@ -532,12 +507,12 @@ EditTextObject* EditTextObject::Create( SvStream& rIStream, SfxItemPool* pGlobal break; default: { - // Wenn ich das Format nicht kenne, ueberlese ich den Inhalt: + // If I do not know the format, I overwrite the contents: rIStream.SetError( EE_READWRITE_WRONGFORMAT ); } } - // Sicherstellen, dass der Stream an der richtigen Stelle hinterlassen wird. + // Make sure that the stream is left at the correct place. sal_Size nFullSz = sizeof( nWhich ) + sizeof( nStructSz ) + nStructSz; rIStream.Seek( nStartPos + nFullSz ); return pTxtObj; @@ -559,17 +534,17 @@ void EditTextObject::Skip( SvStream& rIStream ) void EditTextObject::StoreData( SvStream& ) const { - DBG_ERROR( "StoreData: Basisklasse!" ); + DBG_ERROR( "StoreData: Base class!" ); } void EditTextObject::CreateData( SvStream& ) { - DBG_ERROR( "CreateData: Basisklasse!" ); + DBG_ERROR( "CreateData: Base class!" ); } USHORT EditTextObject::GetVersion() const { - DBG_ERROR( "V-Methode direkt vom EditTextObject!" ); + DBG_ERROR( "Virtual method direct from EditTextObject!" ); return 0; } @@ -683,7 +658,7 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : nObjSettings = r.nObjSettings; bVertical = r.bVertical; nScriptType = r.nScriptType; - pPortionInfo = NULL; // PortionInfo nicht kopieren + pPortionInfo = NULL; // Do not copy PortionInfo bStoreUnicodeStrings = FALSE; if ( !r.bOwnerOfPool ) @@ -730,9 +705,6 @@ BinTextObject::~BinTextObject() DeleteContents(); if ( bOwnerOfPool ) { - // Nicht mehr, wegen 1xDefItems. - // siehe auch ~EditDoc(). -// pPool->ReleaseDefaults( TRUE /* bDelete */ ); SfxItemPool::Free(pPool); } } @@ -823,7 +795,7 @@ USHORT BinTextObject::GetParagraphCount() const XubString BinTextObject::GetText( USHORT nPara ) const { - DBG_ASSERT( nPara < aContents.Count(), "BinTextObject::GetText: Absatz existiert nicht!" ); + DBG_ASSERT( nPara < aContents.Count(), "BinTextObject::GetText: Paragraph does not exist!" ); if ( nPara < aContents.Count() ) { ContentInfo* pC = aContents[ nPara ]; @@ -834,7 +806,7 @@ XubString BinTextObject::GetText( USHORT nPara ) const void BinTextObject::Insert( const EditTextObject& rObj, USHORT nDestPara ) { - DBG_ASSERT( rObj.Which() == EE_FORMAT_BIN, "UTO: Unbekanntes Textobjekt" ); + DBG_ASSERT( rObj.Which() == EE_FORMAT_BIN, "UTO: unknown Textobjekt" ); const BinTextObject& rBinObj = (const BinTextObject&)rObj; @@ -856,7 +828,7 @@ EditTextObject* BinTextObject::CreateTextObject( USHORT nPara, USHORT nParas ) c if ( ( nPara >= aContents.Count() ) || !nParas ) return NULL; - // Pool nur teilen, wenn von aussen eingestellter Pool. + // Only split the Pool, when a the Pool is set externally. BinTextObject* pObj = new BinTextObject( bOwnerOfPool ? 0 : pPool ); if ( bOwnerOfPool && pPool ) pObj->GetPool()->SetDefaultMetric( pPool->GetMetric( DEF_METRIC ) ); @@ -877,7 +849,7 @@ EditTextObject* BinTextObject::CreateTextObject( USHORT nPara, USHORT nParas ) c void BinTextObject::RemoveParagraph( USHORT nPara ) { - DBG_ASSERT( nPara < aContents.Count(), "BinTextObject::GetText: Absatz existiert nicht!" ); + DBG_ASSERT( nPara < aContents.Count(), "BinTextObject::GetText: Paragraph does not exist!" ); if ( nPara < aContents.Count() ) { ContentInfo* pC = aContents[ nPara ]; @@ -1175,25 +1147,24 @@ void BinTextObject::StoreData( SvStream& rOStream ) const rOStream << bOwnerOfPool; - // Erst den Pool speichern, spaeter nur noch Surregate + // First store the pool, later only the Surregate if ( bOwnerOfPool ) { GetPool()->SetFileFormatVersion( SOFFICE_FILEFORMAT_50 ); GetPool()->Store( rOStream ); } - // Aktuelle Zeichensatz speichern... - // #90477# GetSOStoreTextEncoding: Bug in 5.2, when default char set is multi byte text encoding + // Store Current text encoding ... rtl_TextEncoding eEncoding = GetSOStoreTextEncoding( gsl_getSystemTextEncoding(), (USHORT) rOStream.GetVersion() ); rOStream << (USHORT) eEncoding; - // Die Anzahl der Absaetze... + // The number of paragraphs ... USHORT nParagraphs = GetContents().Count(); rOStream << nParagraphs; char cFeatureConverted = ByteString( CH_FEATURE, eEncoding ).GetChar(0); - // Die einzelnen Absaetze... + // The individual paragraphs ... for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); @@ -1229,7 +1200,7 @@ void BinTextObject::StoreData( SvStream& rOStream ) const aText.Insert( aNew, pAttr->GetStart() ); } - // #88414# Convert StarSymbol back to StarBats + // Convert StarSymbol back to StarBats FontToSubsFontConverter hConv = CreateFontToSubsFontConverter( rFontItem.GetFamilyName(), FONTTOSUBSFONT_EXPORT | FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ); if ( hConv ) { @@ -1248,7 +1219,7 @@ void BinTextObject::StoreData( SvStream& rOStream ) const } } - // #88414# Convert StarSymbol back to StarBats + // Convert StarSymbol back to StarBats // StarSymbol as paragraph attribute or in StyleSheet? FontToSubsFontConverter hConv = NULL; @@ -1256,13 +1227,6 @@ void BinTextObject::StoreData( SvStream& rOStream ) const { hConv = CreateFontToSubsFontConverter( ((const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO )).GetFamilyName(), FONTTOSUBSFONT_EXPORT | FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ); } -/* cl removed because not needed anymore since binfilter - - else if ( pC->GetStyle().Len() && pC->GetLoadStoreTempInfos() ) - { - hConv = pC->GetLoadStoreTempInfos()->hOldSymbolConv_Store; - } -*/ if ( hConv ) { for ( USHORT nChar = 0; nChar < pC->GetText().Len(); nChar++ ) @@ -1285,19 +1249,19 @@ void BinTextObject::StoreData( SvStream& rOStream ) const aText.SearchAndReplaceAll( cFeatureConverted, CH_FEATURE_OLD ); rOStream.WriteByteString( aText ); - // StyleName und Family... + // StyleName and Family... rOStream.WriteByteString( ByteString( pC->GetStyle(), eEncoding ) ); rOStream << (USHORT)pC->GetFamily(); - // Absatzattribute... + // Paragraph attributes ... pC->GetParaAttribs().Store( rOStream ); - // Die Anzahl der Attribute... + // The number of attributes ... USHORT nAttribs = pC->GetAttribs().Count(); rOStream << nAttribs; - // Und die einzelnen Attribute - // Items als Surregate => immer 8 Byte pro Attrib + // And the individual attributes + // Items as Surregate => always 8 bytes per Attribute // Which = 2; Surregat = 2; Start = 2; End = 2; for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) { @@ -1310,17 +1274,12 @@ void BinTextObject::StoreData( SvStream& rOStream ) const } } - // Ab 400: rOStream << nMetric; - // Ab 600 rOStream << nUserType; rOStream << nObjSettings; - // Ab 601 rOStream << bVertical; - - // Ab 602 rOStream << nScriptType; rOStream << bStoreUnicodeStrings; @@ -1333,7 +1292,7 @@ void BinTextObject::StoreData( SvStream& rOStream ) const rOStream << nL; rOStream.Write( pC->GetText().GetBuffer(), nL*sizeof(sal_Unicode) ); - // #91575# StyleSheetName must be Unicode too! + // StyleSheetName must be Unicode too! // Copy/Paste from EA3 to BETA or from BETA to EA3 not possible, not needed... // If needed, change nL back to ULONG and increase version... nL = pC->GetStyle().Len(); @@ -1347,63 +1306,61 @@ void BinTextObject::CreateData( SvStream& rIStream ) { rIStream >> nVersion; - // Das Textobject wurde erstmal mit der aktuellen Einstellung - // von pTextObjectPool erzeugt. + // The text object was first created with the current setting of + // pTextObjectPool. BOOL bOwnerOfCurrent = bOwnerOfPool; rIStream >> bOwnerOfPool; if ( bOwnerOfCurrent && !bOwnerOfPool ) { - // Es wurde ein globaler Pool verwendet, mir jetzt nicht uebergeben, - // aber ich brauche ihn! - DBG_ERROR( "Man gebe mir den globalen TextObjectPool!" ); + // A global Pool was used, but not handed over to me, but I need it! + DBG_ERROR( "Give me the global TextObjectPool!" ); return; } else if ( !bOwnerOfCurrent && bOwnerOfPool ) { - // Es soll ein globaler Pool verwendet werden, aber dieses - // Textobject hat einen eigenen. + // A global Pool should be used, but this Textobject has its own. pPool = EditEngine::CreatePool(); } if ( bOwnerOfPool ) GetPool()->Load( rIStream ); - // CharSet, in dem gespeichert wurde: + // CharSet, in which it was saved: USHORT nCharSet; rIStream >> nCharSet; rtl_TextEncoding eSrcEncoding = GetSOLoadTextEncoding( (rtl_TextEncoding)nCharSet, (USHORT)rIStream.GetVersion() ); - // Die Anzahl der Absaetze... + // The number of paragraphs ... USHORT nParagraphs; rIStream >> nParagraphs; - // Die einzelnen Absaetze... + // The individual paragraphs ... for ( ULONG nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = CreateAndInsertContent(); - // Der Text... + // The Text... ByteString aByteString; rIStream.ReadByteString( aByteString ); pC->GetText() = String( aByteString, eSrcEncoding ); - // StyleName und Family... + // StyleName and Family... rIStream.ReadByteString( pC->GetStyle(), eSrcEncoding ); USHORT nStyleFamily; rIStream >> nStyleFamily; pC->GetFamily() = (SfxStyleFamily)nStyleFamily; - // Absatzattribute... + // Paragraph attributes ... pC->GetParaAttribs().Load( rIStream ); - // Die Anzahl der Attribute... + // The number of attributes ... USHORT nAttribs; rIStream >> nAttribs; - // Und die einzelnen Attribute - // Items als Surregate => immer 8 Byte pro Attrib + // And the individual attributes + // Items as Surregate => always 8 bytes per Attributes // Which = 2; Surregat = 2; Start = 2; End = 2; USHORT nAttr; for ( nAttr = 0; nAttr < nAttribs; nAttr++ ) @@ -1468,7 +1425,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) pC->GetText().Insert( aNew, pAttr->GetStart() ); } - // #88414# Convert StarMath and StarBats to StarSymbol + // Convert StarMath and StarBats to StarSymbol FontToSubsFontConverter hConv = CreateFontToSubsFontConverter( rFontItem.GetFamilyName(), FONTTOSUBSFONT_IMPORT | FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ); if ( hConv ) { @@ -1495,7 +1452,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) } - // #88414# Convert StarMath and StarBats to StarSymbol + // Convert StarMath and StarBats to StarSymbol // Maybe old symbol font as paragraph attribute? if ( pC->GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SFX_ITEM_ON ) { @@ -1524,15 +1481,15 @@ void BinTextObject::CreateData( SvStream& rIStream ) } } - // Ab 400 auch die DefMetric: + // From 400 also the DefMetric: if ( nVersion >= 400 ) { USHORT nTmpMetric; rIStream >> nTmpMetric; if ( nVersion >= 401 ) { - // In der 400 gab es noch einen Bug bei Textobjekten mit eigenem - // Pool, deshalb erst ab 401 auswerten. + // In the 400 there was a bug in text objects with the own Pool, + // therefore evaluate only from 401 nMetric = nTmpMetric; if ( bOwnerOfPool && pPool && ( nMetric != 0xFFFF ) ) pPool->SetDefaultMetric( (SfxMapUnit)nMetric ); @@ -1585,8 +1542,8 @@ void BinTextObject::CreateData( SvStream& rIStream ) } - // Ab 500 werden die Tabs anders interpretiert: TabPos + LI, vorher nur TabPos. - // Wirkt nur wenn auch Tab-Positionen eingestellt wurden, nicht beim DefTab. + // from 500 the tabs are interpreted differently: TabPos + LI, previously only TabPos. + // Works only if tab positions are set, not when DefTab. if ( nVersion < 500 ) { for ( USHORT n = 0; n < aContents.Count(); n++ ) @@ -1663,39 +1620,39 @@ bool BinTextObject::isWrongListEqual(const BinTextObject& rCompare) const void BinTextObject::CreateData300( SvStream& rIStream ) { - // Fuer Aufwaertskompatibilitaet. + // For forward compatibility. - // Erst den Pool laden... - // Ist in der 300 immer gespeichert worden! + // First load the Pool... + // Is always saved in the 300! GetPool()->Load( rIStream ); - // Die Anzahl der Absaetze... + // The number of paragraphs ... sal_uInt32 nParagraphs; rIStream >> nParagraphs; - // Die einzelnen Absaetze... + // The individual paragraphs... for ( ULONG nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = CreateAndInsertContent(); - // Der Text... + // The Text... rIStream.ReadByteString( pC->GetText() ); - // StyleName und Family... + // StyleName and Family... rIStream.ReadByteString( pC->GetStyle() ); USHORT nStyleFamily; rIStream >> nStyleFamily; pC->GetFamily() = (SfxStyleFamily)nStyleFamily; - // Absatzattribute... + // Paragraph attributes ... pC->GetParaAttribs().Load( rIStream ); - // Die Anzahl der Attribute... + // The number of attributes ... sal_uInt32 nAttribs; rIStream >> nAttribs; - // Und die einzelnen Attribute - // Items als Surregate => immer 8 Byte pro Attrib + // And the individual attributes + // Items as Surregate => always 8 bytes per Attribute // Which = 2; Surregat = 2; Start = 2; End = 2; for ( ULONG nAttr = 0; nAttr < nAttribs; nAttr++ ) { @@ -1715,7 +1672,7 @@ void BinTextObject::CreateData300( SvStream& rIStream ) } } - // Prueffen, ob ein Zeichensatz gespeichert wurde + // Check whether a font was saved USHORT nCharSetMarker; rIStream >> nCharSetMarker; if ( nCharSetMarker == CHARSETMARKER ) diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index 74fa0b4..859cbe6 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -39,8 +39,8 @@ class SfxStyleSheetPool; class XEditAttribute { - friend class ContentInfo; // fuer DTOR - friend class BinTextObject; // fuer DTOR + friend class ContentInfo; // for destructor + friend class BinTextObject; // for destructor private: const SfxPoolItem* pItem; @@ -161,10 +161,6 @@ private: SfxItemSet aParaAttribs; WrongList* pWrongs; -/* cl removed because not needed anymore since binfilter - LoadStoreTempInfos* pTempLoadStoreInfos; -*/ - ContentInfo( SfxItemPool& rPool ); ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse ); @@ -194,8 +190,6 @@ public: typedef ContentInfo* ContentInfoPtr; SV_DECL_PTRARR( ContentInfoList, ContentInfoPtr, 1, 4 ) -// MT 05/00: Sollte mal direkt EditTextObjekt werden => keine virtuellen Methoden mehr. - class BinTextObject : public EditTextObject, public SfxItemPoolUser { using EditTextObject::operator==; @@ -242,7 +236,7 @@ public: USHORT GetScriptType() const; void SetScriptType( USHORT nType ); - USHORT GetVersion() const; // Solange der Outliner keine Recordlaenge speichert + USHORT GetVersion() const; // As long as the outliner does not store any record length ContentInfo* CreateAndInsertContent(); XEditAttribute* CreateAttrib( const SfxPoolItem& rItem, USHORT nStart, USHORT nEnd ); @@ -296,13 +290,6 @@ public: BOOL IsOwnerOfPool() const { return bOwnerOfPool; } void StoreUnicodeStrings( BOOL b ) { bStoreUnicodeStrings = b; } - -/* cl removed because not needed anymore since binfilter - void PrepareStore( SfxStyleSheetPool* pStyleSheetPool ); - void FinishStore(); - void FinishLoad( SfxStyleSheetPool* pStyleSheetPool ); -*/ - bool operator==( const BinTextObject& rCompare ) const; // #i102062# diff --git a/editeng/source/editeng/editsel.cxx b/editeng/source/editeng/editsel.cxx index fa68068..494e54b 100644 --- a/editeng/source/editeng/editsel.cxx +++ b/editeng/source/editeng/editsel.cxx @@ -51,7 +51,7 @@ void EditSelFunctionSet::CreateAnchor() void EditSelFunctionSet::DestroyAnchor() { - // Nur bei Mehrfachselektion + // Only with multiple selection } BOOL EditSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOOL ) @@ -73,13 +73,13 @@ BOOL EditSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel ) void EditSelFunctionSet::DeselectAtPoint( const Point& ) { // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -// ! Implementieren, wenn Mehrfachselektion moeglich ! +// ! Implement when multiple selection is possible ! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } void EditSelFunctionSet::BeginDrag() { - // Nur bei Mehrfachselektion + // Only with multiple selection } @@ -94,8 +94,6 @@ void EditSelFunctionSet::DeselectAll() // ---------------------------------------------------------------------- EditSelectionEngine::EditSelectionEngine() : SelectionEngine( (Window*)0 ) { - // Wegen Bug OV: (1994) - // 1995: RangeSelection lassen, SingleSelection nur fuer ListBoxen geeignet! SetSelectionMode( RANGE_SELECTION ); EnableDrag( TRUE ); } diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index e928126..2c6e4a8 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -38,8 +38,8 @@ DBG_NAME( EditUndo ) -#define MAX_UNDOS 100 // ab dieser Menge darf geloescht werden.... -#define MIN_UNDOS 50 // soviel muss stehen bleiben... +#define MAX_UNDOS 100 // From this quantity it may be deleted .... +#define MIN_UNDOS 50 // so much has to be left ... #define NO_UNDO 0xFFFF #define GROUP_NOTFOUND 0xFFFF @@ -88,20 +88,20 @@ BOOL EditUndoManager::Undo( USHORT nCount ) pImpEE->SetActiveView( pImpEE->GetEditViews().GetObject(0) ); else { - DBG_ERROR( "Undo in Engine ohne View nicht moeglich!" ); + DBG_ERROR("Undo in engine is not possible without a View! "); return FALSE; } } - pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // alte Selektion entfernen + pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // Remove the old selection pImpEE->SetUndoMode( TRUE ); BOOL bDone = SfxUndoManager::Undo( nCount ); pImpEE->SetUndoMode( FALSE ); EditSelection aNewSel( pImpEE->GetActiveView()->GetImpEditView()->GetEditSelection() ); - DBG_ASSERT( !aNewSel.IsInvalid(), "Ungueltige Selektion nach Undo()" ); - DBG_ASSERT( !aNewSel.DbgIsBuggy( pImpEE->GetEditDoc() ), "Kaputte Selektion nach Undo()" ); + DBG_ASSERT( !aNewSel.IsInvalid(), "Invalid selection after Undo () "); + DBG_ASSERT( !aNewSel.DbgIsBuggy( pImpEE->GetEditDoc() ), "Broken selection afte Undo () "); aNewSel.Min() = aNewSel.Max(); pImpEE->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel ); @@ -128,15 +128,15 @@ BOOL EditUndoManager::Redo( USHORT nCount ) } } - pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // alte Selektion entfernen + pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // Remove the old selection pImpEE->SetUndoMode( TRUE ); BOOL bDone = SfxUndoManager::Redo( nCount ); pImpEE->SetUndoMode( FALSE ); EditSelection aNewSel( pImpEE->GetActiveView()->GetImpEditView()->GetEditSelection() ); - DBG_ASSERT( !aNewSel.IsInvalid(), "Ungueltige Selektion nach Undo()" ); - DBG_ASSERT( !aNewSel.DbgIsBuggy( pImpEE->GetEditDoc() ), "Kaputte Selektion nach Redo()" ); + DBG_ASSERT( !aNewSel.IsInvalid(), "Invalid selection after Undo () "); + DBG_ASSERT( !aNewSel.DbgIsBuggy( pImpEE->GetEditDoc() ), "Broken selection afte Undo () "); aNewSel.Min() = aNewSel.Max(); pImpEE->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel ); @@ -201,28 +201,28 @@ EditUndoDelContent::~EditUndoDelContent() void EditUndoDelContent::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); GetImpEditEngine()->InsertContent( pContentNode, nNode ); - bDelObject = FALSE; // gehoert wieder der Engine + bDelObject = FALSE; // belongs to the Engine again EditSelection aSel( EditPaM( pContentNode, 0 ), EditPaM( pContentNode, pContentNode->Len() ) ); GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aSel ); } void EditUndoDelContent::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); ImpEditEngine* _pImpEE = GetImpEditEngine(); - // pNode stimmt nicht mehr, falls zwischendurch Undos, in denen - // Absaetze verschmolzen sind. + // pNode is no longer correct, if the paragraphs where merged + // in between Undos pContentNode = _pImpEE->GetEditDoc().SaveGetObject( nNode ); DBG_ASSERT( pContentNode, "EditUndoDelContent::Redo(): Node?!" ); delete _pImpEE->GetParaPortions()[nNode]; _pImpEE->GetParaPortions().Remove( nNode ); - // Node nicht loeschen, haengt im Undo! + // Do not delete node, depends on the undo! _pImpEE->GetEditDoc().Remove( nNode ); if( _pImpEE->IsCallParaInsertedOrDeleted() ) _pImpEE->GetEditEnginePtr()->ParagraphDeleted( nNode ); @@ -237,7 +237,7 @@ void EditUndoDelContent::Redo() DBG_ASSERT( pN && ( pN != pContentNode ), "?! RemoveContent !? " ); EditPaM aPaM( pN, pN->Len() ); - bDelObject = TRUE; // gehoert wieder dem Undo + bDelObject = TRUE; // belongs to the Engine again _pImpEE->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); } @@ -275,11 +275,10 @@ EditUndoConnectParas::~EditUndoConnectParas() void EditUndoConnectParas::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); - // Bei SplitContent darf noch kein ParagraphInserted gerufen werden, - // weil der Outliner sich auf die Attribute verlaesst um die Tiefe - // des Absatzes zu initialisieren + // For SplitContent ParagraphInserted can not be called yet because the + // Outliner relies on the attributes to initialize the depth BOOL bCall = GetImpEditEngine()->IsCallParaInsertedOrDeleted(); GetImpEditEngine()->SetCallParaInsertedOrDeleted( FALSE ); @@ -305,7 +304,7 @@ void EditUndoConnectParas::Undo() void EditUndoConnectParas::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Np Active View!" ); EditPaM aPaM = GetImpEditEngine()->ConnectContents( nNode, bBackward ); GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); @@ -327,14 +326,14 @@ EditUndoSplitPara::~EditUndoSplitPara() void EditUndoSplitPara::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); EditPaM aPaM = GetImpEditEngine()->ConnectContents( nNode, FALSE ); GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); } void EditUndoSplitPara::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); EditPaM aPaM = GetImpEditEngine()->SplitContent( nNode, nSepPos ); GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); } @@ -350,7 +349,7 @@ EditUndoInsertChars::EditUndoInsertChars( ImpEditEngine* _pImpEE, const EPaM& rE void EditUndoInsertChars::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); EditPaM aPaM( GetImpEditEngine()->CreateEditPaM( aEPaM ) ); EditSelection aSel( aPaM, aPaM ); aSel.Max().GetIndex() = aSel.Max().GetIndex() + aText.Len(); @@ -407,7 +406,7 @@ void EditUndoRemoveChars::Undo() void EditUndoRemoveChars::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); EditPaM aPaM( GetImpEditEngine()->CreateEditPaM( aEPaM ) ); EditSelection aSel( aPaM, aPaM ); aSel.Max().GetIndex() = aSel.Max().GetIndex() + aText.Len(); @@ -422,7 +421,7 @@ EditUndoInsertFeature::EditUndoInsertFeature( ImpEditEngine* _pImpEE, const EPaM : EditUndo( EDITUNDO_INSERTFEATURE, _pImpEE ), aEPaM( rEPaM ) { pFeature = rFeature.Clone(); - DBG_ASSERT( pFeature, "Feature konnte nicht dupliziert werden: EditUndoInsertFeature" ); + DBG_ASSERT( pFeature, "Feature could not be duplicated: EditUndoInsertFeature" ); } EditUndoInsertFeature::~EditUndoInsertFeature() @@ -432,19 +431,19 @@ EditUndoInsertFeature::~EditUndoInsertFeature() void EditUndoInsertFeature::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); EditPaM aPaM( GetImpEditEngine()->CreateEditPaM( aEPaM ) ); EditSelection aSel( aPaM, aPaM ); - // Attribute werden dort implizit vom Dokument korrigiert... + // Attributes are then corrected implicitly by the document ... aSel.Max().GetIndex()++; GetImpEditEngine()->ImpDeleteSelection( aSel ); - aSel.Max().GetIndex()--; // Fuer Selektion + aSel.Max().GetIndex()--; // For Selection GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aSel ); } void EditUndoInsertFeature::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); EditPaM aPaM( GetImpEditEngine()->CreateEditPaM( aEPaM ) ); EditSelection aSel( aPaM, aPaM ); GetImpEditEngine()->ImpInsertFeature( aSel, *pFeature ); @@ -471,7 +470,7 @@ EditUndoMoveParagraphs::~EditUndoMoveParagraphs() void EditUndoMoveParagraphs::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); Range aTmpRange( nParagraphs ); long nTmpDest = aTmpRange.Min(); @@ -494,7 +493,7 @@ void EditUndoMoveParagraphs::Undo() void EditUndoMoveParagraphs::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); EditSelection aNewSel( GetImpEditEngine()->MoveParagraphs( nParagraphs, nDest, 0 ) ); GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel ); } @@ -520,7 +519,7 @@ EditUndoSetStyleSheet::~EditUndoSetStyleSheet() void EditUndoSetStyleSheet::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); GetImpEditEngine()->SetStyleSheet( nPara, (SfxStyleSheet*)GetImpEditEngine()->GetStyleSheetPool()->Find( aPrevName, ePrevFamily ) ); GetImpEditEngine()->SetParaAttribs( nPara, aPrevParaAttribs ); lcl_DoSetSelection( GetImpEditEngine()->GetActiveView(), nPara ); @@ -528,7 +527,7 @@ void EditUndoSetStyleSheet::Undo() void EditUndoSetStyleSheet::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); GetImpEditEngine()->SetStyleSheet( nPara, (SfxStyleSheet*)GetImpEditEngine()->GetStyleSheetPool()->Find( aNewName, eNewFamily ) ); lcl_DoSetSelection( GetImpEditEngine()->GetActiveView(), nPara ); } @@ -550,14 +549,14 @@ EditUndoSetParaAttribs::~EditUndoSetParaAttribs() void EditUndoSetParaAttribs::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); GetImpEditEngine()->SetParaAttribs( nPara, aPrevItems ); lcl_DoSetSelection( GetImpEditEngine()->GetActiveView(), nPara ); } void EditUndoSetParaAttribs::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); GetImpEditEngine()->SetParaAttribs( nPara, aNewItems ); lcl_DoSetSelection( GetImpEditEngine()->GetActiveView(), nPara ); } @@ -570,11 +569,9 @@ EditUndoSetAttribs::EditUndoSetAttribs( ImpEditEngine* _pImpEE, const ESelection aESel( rESel ), aNewAttribs( rNewItems ) { - // Wenn das EditUndoSetAttribs eigentlich ein RemoveAttribs ist, koennte - // man das eigentlich an einem leeren ItemSet erkennen, aber dann muesste - // an einigen Stellen abgefangen werden, das ggf. ein SetAttribs mit einem - // leeren ItemSet gemacht wird. - // => Ich habe lieber diesen Member spendiert... + // When EditUndoSetAttribs actually is a RemoveAttribs this could be + // /recognize by the empty itemset, but then it would have to be caught in + // its own place, which possible a setAttribs does with an empty itemset. bSetIsRemove = FALSE; bRemoveParaAttribs = FALSE; nRemoveWhich = 0; @@ -583,7 +580,7 @@ EditUndoSetAttribs::EditUndoSetAttribs( ImpEditEngine* _pImpEE, const ESelection EditUndoSetAttribs::~EditUndoSetAttribs() { - // Items aus Pool holen... + // Get Items from Pool... SfxItemPool* pPool = aNewAttribs.GetPool(); USHORT nContents = aPrevAttribs.Count(); for ( USHORT n = 0; n < nContents; n++ ) @@ -603,7 +600,7 @@ EditUndoSetAttribs::~EditUndoSetAttribs() void EditUndoSetAttribs::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); ImpEditEngine* _pImpEE = GetImpEditEngine(); BOOL bFields = FALSE; for ( USHORT nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ ) @@ -611,11 +608,11 @@ void EditUndoSetAttribs::Undo() ContentAttribsInfo* pInf = aPrevAttribs[ (USHORT)(nPara-aESel.nStartPara) ]; DBG_ASSERT( pInf, "Undo (SetAttribs): pInf = NULL!" ); - // erstmal die Absatzattribute... + // first the paragraph attributes ... _pImpEE->SetParaAttribs( nPara, pInf->GetPrevParaAttribs() ); - // Dann die Zeichenattribute... - // Alle Attribute inkl. Features entfernen, werden wieder neu eingestellt. + // Then the character attributes ... + // Remove all attributes including features, are later re-established. _pImpEE->RemoveCharAttribs( nPara, 0, TRUE ); DBG_ASSERT( _pImpEE->GetEditDoc().SaveGetObject( nPara ), "Undo (SetAttribs): pNode = NULL!" ); ContentNode* pNode = _pImpEE->GetEditDoc().GetObject( nPara ); @@ -623,7 +620,7 @@ void EditUndoSetAttribs::Undo() { EditCharAttrib* pX = pInf->GetPrevCharAttribs()[nAttr]; DBG_ASSERT( pX, "Redo (SetAttribs): pX = NULL!" ); - // wird autom. 'eingepoolt'. + // is automatically "poolsized" _pImpEE->GetEditDoc().InsertAttrib( pNode, pX->GetStart(), pX->GetEnd(), *pX->GetItem() ); if ( pX->Which() == EE_FEATURE_FIELD ) bFields = TRUE; @@ -636,7 +633,7 @@ void EditUndoSetAttribs::Undo() void EditUndoSetAttribs::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); ImpEditEngine* _pImpEE = GetImpEditEngine(); EditSelection aSel( _pImpEE->CreateSel( aESel ) ); @@ -672,7 +669,7 @@ EditUndoTransliteration::~EditUndoTransliteration() void EditUndoTransliteration::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); ImpEditEngine* _pImpEE = GetImpEditEngine(); @@ -712,7 +709,7 @@ void EditUndoTransliteration::Undo() void EditUndoTransliteration::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); ImpEditEngine* _pImpEE = GetImpEditEngine(); EditSelection aSel( _pImpEE->CreateSel( aOldESel ) ); @@ -734,7 +731,7 @@ EditUndoMarkSelection::~EditUndoMarkSelection() void EditUndoMarkSelection::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" ); + DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); if ( GetImpEditEngine()->GetActiveView() ) { if ( GetImpEditEngine()->IsFormatted() ) @@ -746,7 +743,7 @@ void EditUndoMarkSelection::Undo() void EditUndoMarkSelection::Redo() { - // Fuer Redo unwichtig, weil am Anfang der Undo-Klammerung + // For redo unimportant, because at the beginning of the undo parentheses } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/editeng/editundo.hxx b/editeng/source/editeng/editundo.hxx index 7c230eb..9c78f22 100644 --- a/editeng/source/editeng/editundo.hxx +++ b/editeng/source/editeng/editundo.hxx @@ -50,8 +50,8 @@ class EditUndoDelContent : public EditUndo private: BOOL bDelObject; USHORT nNode; - ContentNode* pContentNode; // Zeigt auf das gueltige, - // nicht zerstoerte Objekt! + ContentNode* pContentNode; // Points to the valid, + // undestroyed object! public: TYPEINFO(); @@ -73,7 +73,7 @@ private: SfxItemSet aLeftParaAttribs; SfxItemSet aRightParaAttribs; - // 2 Pointer waeren schoener, aber dann muesste es ein SfxListener sein. + // 2 Pointers would be nicer but then it would have to be a SfxListener. String aLeftStyleName; String aRightStyleName; SfxStyleFamily eLeftStyleFamily; diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 6b3dbdd..e3b6892 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -233,8 +233,8 @@ void EditView::SetSelection( const ESelection& rESel ) DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); - // Falls jemand gerade ein leeres Attribut hinterlassen hat, - // und dann der Outliner die Selektion manipulitert: + // If someone has just left an empty attribute, and then the outliner + // manipulates the selection: if ( !pImpEditView->GetEditSelection().HasRange() ) { ContentNode* pNode = pImpEditView->GetEditSelection().Max().GetNode(); @@ -242,10 +242,10 @@ void EditView::SetSelection( const ESelection& rESel ) } EditSelection aNewSelection( PIMPEE->ConvertSelection( rESel.nStartPara, rESel.nStartPos, rESel.nEndPara, rESel.nEndPos ) ); - // Wenn nach einem KeyInput die Selection manipuliert wird: + // If the selection is manipulated after a KeyInput: PIMPEE->CheckIdleFormatter(); - // Selektion darf nicht bei einem unsichtbaren Absatz Starten/Enden: + // Selection may not start/end at an invisible paragraph: ParaPortion* pPortion = PIMPEE->FindParaPortion( aNewSelection.Min().GetNode() ); if ( !pPortion->IsVisible() ) { @@ -261,7 +261,7 @@ void EditView::SetSelection( const ESelection& rESel ) aNewSelection.Max() = EditPaM( pNode, pNode->Len() ); } - pImpEditView->DrawSelection(); // alte Selektion 'weg-zeichnen' + pImpEditView->DrawSelection(); pImpEditView->SetEditSelection( aNewSelection ); pImpEditView->DrawSelection(); sal_Bool bGotoCursor = pImpEditView->DoAutoScroll(); @@ -354,7 +354,7 @@ void EditView::SetOutputArea( const Rectangle& rRec ) DBG_CHKTHIS( EditView, 0 ); pImpEditView->SetOutputArea( rRec ); - // Rest nur hier, wenn API-Aufruf: + // the rest here only if it is an API call: pImpEditView->CalcAnchorPoint(); if ( PIMPEE->GetStatus().AutoPageSize() ) pImpEditView->RecalcOutputArea(); @@ -414,7 +414,7 @@ void EditView::InsertText( const XubString& rStr, sal_Bool bSelect ) if ( bSelect ) { - DBG_ASSERT( !aPaM1.DbgIsBuggy( pImpEE->GetEditDoc() ), "Insert: PaM kaputt" ); + DBG_ASSERT( !aPaM1.DbgIsBuggy( pImpEE->GetEditDoc() ), "Insert: PaM broken" ); pImpEditView->SetEditSelection( EditSelection( aPaM1, aPaM2 ) ); } else @@ -463,13 +463,9 @@ void EditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor ) DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); -// Draw vertraegt die Assertion nicht, spaeter mal aktivieren -// DBG_ASSERT( pImpEditView->pEditEngine->HasView( this ), "ShowCursor - View nicht angemeldet!" ); -// DBG_ASSERT( !GetWindow()->IsInPaint(), "ShowCursor - Why in Paint ?!" ); - if ( pImpEditView->pEditEngine->HasView( this ) ) { - // Das ControlWord hat mehr Gewicht: + // The control word is more important: if ( !pImpEditView->DoAutoScroll() ) bGotoCursor = sal_False; pImpEditView->ShowCursor( bGotoCursor, bForceVisCursor ); @@ -500,9 +496,8 @@ void EditView::SetAttribs( const SfxItemSet& rSet ) { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); - DBG_ASSERT( !pImpEditView->aEditSelection.IsInvalid(), "Blinde Selection in ...." ); + DBG_ASSERT( !pImpEditView->aEditSelection.IsInvalid(), "Blind Selection in ...." ); - // Kein Undo-Kappseln noetig... pImpEditView->DrawSelection(); PIMPEE->SetAttribs( pImpEditView->GetEditSelection(), rSet, ATTRSPECIAL_WHOLEWORD ); PIMPEE->FormatAndUpdate( this ); @@ -512,9 +507,8 @@ void EditView::SetParaAttribs( const SfxItemSet& rSet, sal_uInt16 nPara ) { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); - // Kein Undo-Kappseln noetig... PIMPEE->SetParaAttribs( nPara, rSet ); - // Beim Aendern von Absatzattributen muss immer formatiert werden... + // When you change paragraph attributes you must always format... PIMPEE->FormatAndUpdate( this ); } @@ -566,7 +560,7 @@ SfxItemSet EditView::GetAttribs() { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); - DBG_ASSERT( !pImpEditView->aEditSelection.IsInvalid(), "Blinde Selection in ...." ); + DBG_ASSERT( !pImpEditView->aEditSelection.IsInvalid(), "Blind Selection in ...." ); return PIMPEE->GetAttribs( pImpEditView->GetEditSelection() ); } @@ -787,7 +781,7 @@ void EditView::InsertText( const EditTextObject& rTextObject ) EditSelection aTextSel( PIMPEE->InsertText( rTextObject, pImpEditView->GetEditSelection() ) ); PIMPEE->UndoActionEnd( EDITUNDO_INSERT ); - aTextSel.Min() = aTextSel.Max(); // Selektion nicht behalten. + aTextSel.Min() = aTextSel.Max(); // Selection not retained. pImpEditView->SetEditSelection( aTextSel ); PIMPEE->FormatAndUpdate( this ); } @@ -802,7 +796,7 @@ void EditView::InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::d EditSelection aTextSel( PIMPEE->InsertText( xDataObj, rBaseURL, pImpEditView->GetEditSelection().Max(), bUseSpecial ) ); PIMPEE->UndoActionEnd( EDITUNDO_INSERT ); - aTextSel.Min() = aTextSel.Max(); // Selektion nicht behalten. + aTextSel.Min() = aTextSel.Max(); // Selection not retained. pImpEditView->SetEditSelection( aTextSel ); PIMPEE->FormatAndUpdate( this ); } @@ -864,7 +858,7 @@ SfxStyleSheet* EditView::GetStyleSheet() const { SfxStyleSheet* pTmpStyle = PIMPEE->GetStyleSheet( n ); if ( ( n != nStartPara ) && ( pStyle != pTmpStyle ) ) - return NULL; // Nicht eindeutig. + return NULL; // Not unique. pStyle = pTmpStyle; } return pStyle; @@ -901,7 +895,7 @@ void EditView::TransliterateText( sal_Int32 nTransliterationMode ) EditSelection aNewSel = PIMPEE->TransliterateText( pImpEditView->GetEditSelection(), nTransliterationMode ); if ( aNewSel != aOldSel ) { - pImpEditView->DrawSelection(); // alte Selektion 'weg-zeichnen' + pImpEditView->DrawSelection(); pImpEditView->SetEditSelection( aNewSel ); pImpEditView->DrawSelection(); } @@ -933,7 +927,6 @@ void EditView::CompleteAutoCorrect( Window* pFrameWin ) pImpEditView->DrawSelection(); EditSelection aSel = pImpEditView->GetEditSelection(); aSel = PIMPEE->EndOfWord( aSel.Max() ); - // MT 06/00: Why pass EditSelection to AutoCorrect, not EditPaM?! aSel = PIMPEE->AutoCorrect( aSel, 0, !IsInsertMode(), pFrameWin ); pImpEditView->SetEditSelection( aSel ); if ( PIMPEE->IsModified() ) @@ -1054,7 +1047,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) EditPaM aPaM2( aPaM ); aPaM2.GetIndex()++; - // Gibt es Replace-Vorschlaege? + // Are there any replace suggestions? String aSelected( GetSelected() ); // // restrict the maximal number of suggestions displayed @@ -1072,7 +1065,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) rVal.Name = OUString(RTL_CONSTASCII_USTRINGPARAM( UPN_MAX_NUMBER_OF_SUGGESTIONS )); rVal.Value <<= (INT16) 7; // - // Gibt es Replace-Vorschlaege? + // Are there any replace suggestions? Reference< XSpellAlternatives > xSpellAlt = xSpeller->spell( aSelected, PIMPEE->GetLanguage( aPaM2 ), aPropVals ); @@ -1142,7 +1135,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) aPopupMenu.InsertSeparator( nWords ); } else - aPopupMenu.RemoveItem( MN_AUTOCORR ); // Loeschen? + aPopupMenu.RemoveItem( MN_AUTOCORR ); // delete? SvtLinguConfig aCfg; @@ -1249,12 +1242,12 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) { if ( !pCallBack ) { - // Cursor vor das Wort setzen... + // Set Cursor before word... EditPaM aCursor = pImpEditView->GetEditSelection().Min(); - pImpEditView->DrawSelection(); // alte Selektion 'weg-zeichnen' + pImpEditView->DrawSelection(); pImpEditView->SetEditSelection( EditSelection( aCursor, aCursor ) ); pImpEditView->DrawSelection(); - // Stuerzt ab, wenn keine SfxApp + // Crashes when no SfxApp PIMPEE->Spell( this, sal_False ); } else @@ -1374,7 +1367,8 @@ const SvxFieldItem* EditView::GetFieldAtSelection() const { EditSelection aSel( pImpEditView->GetEditSelection() ); aSel.Adjust( pImpEditView->pEditEngine->pImpEditEngine->GetEditDoc() ); - // Nur wenn Cursor vor Feld, keine Selektion, oder nur Feld selektiert + // Only when cursor is in font of field, no selection, + // or only selecting field if ( ( aSel.Min().GetNode() == aSel.Max().GetNode() ) && ( ( aSel.Max().GetIndex() == aSel.Min().GetIndex() ) || ( aSel.Max().GetIndex() == aSel.Min().GetIndex()+1 ) ) ) @@ -1388,7 +1382,7 @@ const SvxFieldItem* EditView::GetFieldAtSelection() const if ( pAttr->GetStart() == nXPos ) if ( pAttr->Which() == EE_FEATURE_FIELD ) { - DBG_ASSERT( pAttr->GetItem()->ISA( SvxFieldItem ), "Kein FeldItem..." ); + DBG_ASSERT( pAttr->GetItem()->ISA( SvxFieldItem ), "No FeldItem..." ); return (const SvxFieldItem*)pAttr->GetItem(); } } @@ -1426,7 +1420,7 @@ XubString EditView::GetWordUnderMousePointer( Rectangle& rWordRect ) const Rectangle aBottomRightRec( pImpEE->PaMtoEditCursor( aWordSel.Max() ) ); #if OSL_DEBUG_LEVEL > 1 - DBG_ASSERT( aTopLeftRec.Top() == aBottomRightRec.Top(), "Top() in einer Zeile unterschiedlich?" ); + DBG_ASSERT( aTopLeftRec.Top() == aBottomRightRec.Top(), "Top () is different in one line?"); #endif Point aPnt1( pImpEditView->GetWindowPos( aTopLeftRec.TopLeft() ) ); diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index 5a6fccd..1afc8ea 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -57,8 +57,8 @@ EditSpellWrapper::EditSpellWrapper( Window* _pWin, sal_Bool bIsStart, sal_Bool bIsAllRight, EditView* pView ) : SvxSpellWrapper( _pWin, xChecker, bIsStart, bIsAllRight ) { - DBG_ASSERT( pView, "Es muss eine View uebergeben werden!" ); - // IgnoreList behalten, ReplaceList loeschen... + DBG_ASSERT( pView, "One view has to be abandoned!" ); + // Keep IgnoreList, delete ReplaceList... if (SvxGetChangeAllList().is()) SvxGetChangeAllList()->clear(); pEditView = pView; @@ -71,9 +71,9 @@ void EditSpellWrapper::SpellStart( SvxSpellArea eArea ) if ( eArea == SVX_SPELL_BODY_START ) { - // Wird gerufen, wenn - // a) Spell-Forwad ist am Ende angekomment und soll von vorne beginnen - // IsEndDone() liefert auch sal_True, wenn Rueckwaerts-Spelling am Ende gestartet wird! + // Is called when + // a) Spell-Forward has arrived at the end and should restart at the top + // IsEndDone() returns also sal_True, when backward-spelling is started at the end! if ( IsEndDone() ) { pSpellInfo->bSpellToEnd = sal_False; @@ -90,9 +90,9 @@ void EditSpellWrapper::SpellStart( SvxSpellArea eArea ) } else if ( eArea == SVX_SPELL_BODY_END ) { - // Wird gerufen, wenn - // a) Spell-Forwad wird gestartet - // IsStartDone() liefert auch sal_True, wenn Vorwaerts-Spelling am Anfang gestartet wird! + // Is called when + // a) Spell-Forward is launched + // IsStartDone() return also sal_True, when forward-spelling is started at the beginning! if ( !IsStartDone() ) { pSpellInfo->bSpellToEnd = sal_True; @@ -109,7 +109,7 @@ void EditSpellWrapper::SpellStart( SvxSpellArea eArea ) } else if ( eArea == SVX_SPELL_BODY ) { - ; // Wird ueber SpellNextDocument von App gehandelt + ; // Is handled by the App through SpellNextDocument // pSpellInfo->bSpellToEnd = sal_True; // pSpellInfo->aSpellTo = pImpEE->CreateEPaM( pImpEE->GetEditDoc().GetEndPaM() ); @@ -147,8 +147,8 @@ sal_Bool EditSpellWrapper::SpellMore() bMore = pImpEE->GetEditEnginePtr()->SpellNextDocument(); if ( bMore ) { - // Der Text wurde in diese Engine getreten, bei Rueckwaerts - // muss die Selektion hinten sein. + // The text has been entered into the engine, when backwords then + // it must be behind the selection. Reference< XPropertySet > xProp( SvxGetLinguPropertySet() ); pEditView->GetImpEditView()->SetEditSelection( pImpEE->GetEditDoc().GetStartPaM() ); @@ -159,15 +159,15 @@ sal_Bool EditSpellWrapper::SpellMore() void EditSpellWrapper::ScrollArea() { - // Keine weitere Aktion noetig... - // Es sei denn, der Bereich soll in die Mitte gescrollt werden, - // und nicht irgendwo stehen. + // No further action needed ... + // Except for, that the area is to be scrolled in the center, and not stand + // still anywhere. } void EditSpellWrapper::ReplaceAll( const String &rNewText, sal_Int16 ) { - // Wird gerufen, wenn Wort in ReplaceList des SpellCheckers + // Is called when the word is in ReplaceList of the spell checker pEditView->InsertText( rNewText ); CheckSpellTo(); } @@ -175,11 +175,11 @@ void EditSpellWrapper::ReplaceAll( const String &rNewText, void EditSpellWrapper::ChangeWord( const String& rNewWord, const sal_uInt16 ) { - // Wird gerufen, wenn Wort Button Change - // bzw. intern von mir bei ChangeAll + // Will be called when Word Button Change + // or internally by me ChangeAll - // Wenn Punkt hinterm Wort, wird dieser nicht mitgegeben. - // Falls '"' => PreStripped. + // If there is a dot Punkt after the word, this dot will be stripped away. + // If '"' => PreStripped. String aNewWord( rNewWord ); pEditView->InsertText( aNewWord ); CheckSpellTo(); @@ -203,8 +203,8 @@ void EditSpellWrapper::CheckSpellTo() EPaM aEPaM = pImpEE->CreateEPaM( aPaM ); if ( aEPaM.nPara == pSpellInfo->aSpellTo.nPara ) { - // prueffen, ob SpellToEnd noch gueltiger Index, falls in dem Absatz - // ersetzt wurde. + // Check if SpellToEnd still has a valid Index, if replace has been + // performed in the paragraph. if ( pSpellInfo->aSpellTo.nIndex > aPaM.GetNode()->Len() ) pSpellInfo->aSpellTo.nIndex = aPaM.GetNode()->Len(); } @@ -255,35 +255,35 @@ void WrongList::TextInserted( sal_uInt16 nPos, sal_uInt16 nNew, sal_Bool bPosIsS sal_Bool bRefIsValid = sal_True; if ( rWrong.nEnd >= nPos ) { - // Alle Wrongs hinter der Einfuegeposition verschieben... + // Move all Wrongs after the insert position... if ( rWrong.nStart > nPos ) { rWrong.nStart = rWrong.nStart + nNew; rWrong.nEnd = rWrong.nEnd + nNew; } - // 1: Startet davor, geht bis nPos... + // 1: Starts before and goes until nPos... else if ( rWrong.nEnd == nPos ) { - // Sollte bei einem Blank unterbunden werden! + // Should be halted at a blank! if ( !bPosIsSep ) rWrong.nEnd = rWrong.nEnd + nNew; } - // 2: Startet davor, geht hinter Pos... + // 2: Starts before and goes until after nPos... else if ( ( rWrong.nStart < nPos ) && ( rWrong.nEnd > nPos ) ) { rWrong.nEnd = rWrong.nEnd + nNew; - // Bei einem Trenner das Wrong entfernen und neu pruefen + // When a separator remove and re-examine the Wrong if ( bPosIsSep ) { - // Wrong aufteilen... + // Split Wrong... WrongRange aNewWrong( rWrong.nStart, nPos ); rWrong.nStart = nPos+1; Insert( aNewWrong, n ); - bRefIsValid = sal_False; // Referenz nach Insert nicht mehr gueltig, der andere wurde davor an dessen Position eingefuegt - n++; // Diesen nicht nochmal... + bRefIsValid = sal_False; // Reference no longer valid after Insert, the other was inserted in front of this position + n++; // This not again ... } } - // 3: Attribut startet auf Pos... + // 3: Attribute starts at position .. else if ( rWrong.nStart == nPos ) { rWrong.nEnd = rWrong.nEnd + nNew; @@ -296,7 +296,7 @@ void WrongList::TextInserted( sal_uInt16 nPos, sal_uInt16 nNew, sal_Bool bPosIsS (void)bRefIsValid; } - DBG_ASSERT( !DbgIsBuggy(), "InsertWrong: WrongList kaputt!" ); + DBG_ASSERT( !DbgIsBuggy(), "InsertWrong: WrongList broken!" ); } void WrongList::TextDeleted( sal_uInt16 nPos, sal_uInt16 nDeleted ) @@ -327,26 +327,26 @@ void WrongList::TextDeleted( sal_uInt16 nPos, sal_uInt16 nDeleted ) sal_Bool bDelWrong = sal_False; if ( rWrong.nEnd >= nPos ) { - // Alles Wrongs hinter der Einfuegeposition verschieben... + // Move all Wrongs after the insert position... if ( rWrong.nStart >= nEndChanges ) { rWrong.nStart = rWrong.nStart - nDeleted; rWrong.nEnd = rWrong.nEnd - nDeleted; } - // 1. Innenliegende Wrongs loeschen... + // 1. Delete Internal Wrongs ... else if ( ( rWrong.nStart >= nPos ) && ( rWrong.nEnd <= nEndChanges ) ) { bDelWrong = sal_True; } - // 2. Wrong beginnt davor, endet drinnen oder dahinter... + // 2. Wrong begins before, ends inside or behind it ... else if ( ( rWrong.nStart <= nPos ) && ( rWrong.nEnd > nPos ) ) { - if ( rWrong.nEnd <= nEndChanges ) // endet drinnen + if ( rWrong.nEnd <= nEndChanges ) // ends inside rWrong.nEnd = nPos; else - rWrong.nEnd = rWrong.nEnd - nDeleted; // endet dahinter + rWrong.nEnd = rWrong.nEnd - nDeleted; // ends after } - // 3. Wrong beginnt drinnen, endet dahinter... + // 3. Wrong begins inside, ending after ... else if ( ( rWrong.nStart >= nPos ) && ( rWrong.nEnd > nEndChanges ) ) { rWrong.nStart = nEndChanges; @@ -363,14 +363,14 @@ void WrongList::TextDeleted( sal_uInt16 nPos, sal_uInt16 nDeleted ) } } - DBG_ASSERT( !DbgIsBuggy(), "InsertWrong: WrongList kaputt!" ); + DBG_ASSERT( !DbgIsBuggy(), "InsertWrong: WrongList broken!" ); } sal_Bool WrongList::NextWrong( sal_uInt16& rnStart, sal_uInt16& rnEnd ) const { /* - rnStart enthaelt die Startposition, wird ggf. auf Wrong-Start korrigiert - rnEnd braucht nicht inizialisiert sein. + rnStart get the start position, is possibly adjusted wrt. Wrong start + rnEnd does not have to be initialized. */ for ( sal_uInt16 n = 0; n < Count(); n++ ) { @@ -419,7 +419,7 @@ void WrongList::ClearWrongs( sal_uInt16 nStart, sal_uInt16 nEnd, WrongRange& rWrong = GetObject( n ); if ( ( rWrong.nEnd > nStart ) && ( rWrong.nStart < nEnd ) ) { - if ( rWrong.nEnd > nEnd ) // // Laeuft raus + if ( rWrong.nEnd > // Runs out { rWrong.nStart = nEnd; // Blanks? @@ -438,7 +438,7 @@ void WrongList::ClearWrongs( sal_uInt16 nStart, sal_uInt16 nEnd, } } - DBG_ASSERT( !DbgIsBuggy(), "InsertWrong: WrongList kaputt!" ); + DBG_ASSERT( !DbgIsBuggy(), "InsertWrong: WrongList broken!" ); } void WrongList::InsertWrong( sal_uInt16 nStart, sal_uInt16 nEnd, @@ -453,11 +453,10 @@ void WrongList::InsertWrong( sal_uInt16 nStart, sal_uInt16 nEnd, nPos = n; if ( bClearRange ) { - // Es kann eigentlich nur Passieren, dass der Wrong genau - // hier beginnt und weiter rauslauft, aber nicht, dass hier - // mehrere im Bereich liegen... - // Genau im Bereich darf keiner liegen, sonst darf diese Methode - // garnicht erst gerufen werden! + // It can really only happen that the Wrong starts exactly here + // and runs along, but not that there are several ranges ... + // Exactly in the range is no one allowed to be, otherwise this + // Method can not be called! DBG_ASSERT( ( ( rWrong.nStart == nStart ) && ( rWrong.nEnd > nEnd ) ) || ( rWrong.nStart > nEnd ), "InsertWrong: RangeMismatch!" ); if ( ( rWrong.nStart == nStart ) && ( rWrong.nEnd > nEnd ) ) @@ -468,7 +467,7 @@ void WrongList::InsertWrong( sal_uInt16 nStart, sal_uInt16 nEnd, } Insert( WrongRange( nStart, nEnd ), nPos ); - DBG_ASSERT( !DbgIsBuggy(), "InsertWrong: WrongList kaputt!" ); + DBG_ASSERT( !DbgIsBuggy(), "InsertWrong: WrongList broken!" ); } void WrongList::MarkWrongsInvalid() @@ -518,7 +517,7 @@ bool WrongList::operator==(const WrongList& rCompare) const #ifdef DBG_UTIL sal_Bool WrongList::DbgIsBuggy() const { - // Pruefen, ob sich Bereiche ueberlappen + // Check if the ranges overlap. sal_Bool bError = sal_False; for ( sal_uInt16 _nA = 0; !bError && ( _nA < Count() ); _nA++ ) { @@ -526,11 +525,11 @@ sal_Bool WrongList::DbgIsBuggy() const for ( sal_uInt16 nB = _nA+1; !bError && ( nB < Count() ); nB++ ) { WrongRange& rNextWrong = GetObject( nB ); - // 1) Start davor, End hinterm anderen Start + // 1) Start before, End after the second Start if ( ( rWrong.nStart <= rNextWrong.nStart ) - && ( rWrong.nEnd >= rNextWrong.nStart ) ) + && ( rWrong.nEnd >= rNextWrong. nStart ) ) bError = sal_True; - // 2) Start hinter anderen Start, aber noch vorm anderen End + // 2) Start after the second Start, but still before the second End else if ( ( rWrong.nStart >= rNextWrong.nStart) && ( rWrong.nStart <= rNextWrong.nEnd ) ) bError = sal_True; @@ -563,7 +562,7 @@ sal_Bool EdtAutoCorrDoc::Delete( sal_uInt16 nStt, sal_uInt16 nEnd ) { EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) ); pImpEE->ImpDeleteSelection( aSel ); - DBG_ASSERT( nCursor >= nEnd, "Cursor mitten im Geschehen ?!" ); + DBG_ASSERT( nCursor >= nEnd, "Cursor in the heart of the action?!" ); nCursor -= ( nEnd-nStt ); bAllowUndoAction = sal_False; return sal_True; @@ -573,7 +572,7 @@ sal_Bool EdtAutoCorrDoc::Insert( sal_uInt16 nPos, const String& rTxt ) { EditSelection aSel = EditPaM( pCurNode, nPos ); pImpEE->ImpInsertText( aSel, rTxt ); - DBG_ASSERT( nCursor >= nPos, "Cursor mitten im Geschehen ?!" ); + DBG_ASSERT( nCursor >= nPos, "Cursor in the heart of the action?!" ); nCursor = nCursor + rTxt.Len(); if ( bAllowUndoAction && ( rTxt.Len() == 1 ) ) @@ -585,7 +584,7 @@ sal_Bool EdtAutoCorrDoc::Insert( sal_uInt16 nPos, const String& rTxt ) sal_Bool EdtAutoCorrDoc::Replace( sal_uInt16 nPos, const String& rTxt ) { - // Eigentlich ein Replace einfuehren => Entspr. UNDO + // Actually a Replace introduce => corresponds to UNDO sal_uInt16 nEnd = nPos+rTxt.Len(); if ( nEnd > pCurNode->Len() ) nEnd = pCurNode->Len(); @@ -634,11 +633,11 @@ sal_Bool EdtAutoCorrDoc::SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_Bool EdtAutoCorrDoc::SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const String& rURL ) { - // Aus dem Text ein Feldbefehl machen... + / Turn the Text into a command field ... EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) ); String aText = pImpEE->GetSelected( aSel ); aSel = pImpEE->ImpDeleteSelection( aSel ); - DBG_ASSERT( nCursor >= nEnd, "Cursor mitten im Geschehen ?!" ); + DBG_ASSERT( nCursor >= nEnd, "Cursor in the heart of the action ?!" ); nCursor -= ( nEnd-nStt ); SvxFieldItem aField( SvxURLField( rURL, aText, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD ); @@ -665,7 +664,7 @@ sal_Bool EdtAutoCorrDoc::HasSymbolChars( sal_uInt16 nStt, sal_uInt16 nEnd ) if ( ( pAttr->Which() == nScriptFontInfoItemId ) && ( ((SvxFontItem*)pAttr->GetItem())->GetCharSet() == RTL_TEXTENCODING_SYMBOL ) ) { - // Pruefen, ob das Attribt im Bereich liegt... + // check if the Attribtuteis within range... if ( pAttr->GetEnd() >= nStt ) return sal_True; } @@ -675,21 +674,21 @@ sal_Bool EdtAutoCorrDoc::HasSymbolChars( sal_uInt16 nStt, sal_uInt16 nEnd ) const String* EdtAutoCorrDoc::GetPrevPara( sal_Bool ) { - // Vorherigen Absatz zurueck geben, damit ermittel werden kann, - // ob es sich beim aktuellen Wort um einen Satzanfang handelt. + // Return previous paragraph, so that it can be determined, + // whether the current word is at the beginning of a sentence. - bAllowUndoAction = sal_False; // Jetzt nicht mehr... + bAllowUndoAction = sal_False; // Not anymore ... ContentList& rNodes = pImpEE->GetEditDoc(); sal_uInt16 nPos = rNodes.GetPos( pCurNode ); - // Sonderbehandlung: Bullet => Absatzanfang => einfach NULL returnen... + // Special case: Bullet => Paragraph start => simply return NULL... const SfxBoolItem& rBulletState = (const SfxBoolItem&) pImpEE->GetParaAttrib( nPos, EE_PARA_BULLETSTATE ); sal_Bool bBullet = rBulletState.GetValue() ? sal_True : sal_False; if ( !bBullet && ( pImpEE->aStatus.GetControlWord() & EE_CNTRL_OUTLINER ) ) { - // Der Outliner hat im Gliederungsmodus auf Ebene 0 immer ein Bullet. + // The Outliner has still a Bullet at Level 0. const SfxInt16Item& rLevel = (const SfxInt16Item&) pImpEE->GetParaAttrib( nPos, EE_PARA_OUTLLEVEL ); if ( rLevel.GetValue() == 0 ) @@ -713,10 +712,9 @@ sal_Bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_uInt16& rSttPos, sal_uInt16 nEndPos, SvxAutoCorrect& rACorrect, const String** ppPara ) { - // Absatz-Anfang oder ein Blank gefunden, suche nach dem Wort - // Kuerzel im Auto - - bAllowUndoAction = sal_False; // Jetzt nicht mehr... + // Paragraph-start or a blank found, search for the word + // shortcut in Auto + bAllowUndoAction = sal_False; // Not anymore ... String aShort( pCurNode->Copy( rSttPos, nEndPos - rSttPos ) ); sal_Bool bRet = sal_False; @@ -728,11 +726,11 @@ sal_Bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_uInt16& rSttPos, const SvxAutocorrWord* pFnd = rACorrect.SearchWordsInList( *pCurNode, rSttPos, nEndPos, *this, eLang ); if( pFnd && pFnd->IsTextOnly() ) { - // dann mal ersetzen + // then replace EditSelection aSel( EditPaM( pCurNode, rSttPos ), EditPaM( pCurNode, nEndPos ) ); aSel = pImpEE->ImpDeleteSelection( aSel ); - DBG_ASSERT( nCursor >= nEndPos, "Cursor mitten im Geschehen ?!" ); + DBG_ASSERT( nCursor >= nEndPos, "Cursor in the heart of the action?!" ); nCursor -= ( nEndPos-rSttPos ); pImpEE->ImpInsertText( aSel, pFnd->GetLong() ); nCursor = nCursor + pFnd->GetLong().Len(); diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx index 992a94f..207a34e 100644 --- a/editeng/source/editeng/edtspell.hxx +++ b/editeng/source/editeng/edtspell.hxx @@ -53,7 +53,7 @@ private: protected: virtual void SpellStart( SvxSpellArea eArea ); - virtual BOOL SpellContinue(); // Bereich pruefen + virtual BOOL SpellContinue(); // Check area virtual void ReplaceAll( const String &rNewText, INT16 nLanguage ); virtual void SpellEnd(); virtual BOOL SpellMore(); @@ -102,7 +102,7 @@ public: USHORT Count() const { return WrongRanges::Count(); } - // Wenn man weiss was man tut: + // When one knos what to do: WrongRange& GetObject( USHORT n ) const { return WrongRanges::GetObject( n ); } void InsertWrong( const WrongRange& rWrong, USHORT nPos ); @@ -134,7 +134,7 @@ inline void WrongList::InsertWrong( const WrongRange& rWrong, USHORT nPos ) { WrongRanges::Insert( rWrong, nPos ); #ifdef DBG_UTIL - DBG_ASSERT( !DbgIsBuggy(), "Insert: WrongList kaputt!" ); + DBG_ASSERT( !DbgIsBuggy(), "Insert: WrongList broken!" ); #endif } diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index 50a776a..3c40d00 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -93,7 +93,7 @@ SvParserState EditHTMLParser::CallParser( ImpEditEngine* pImpEE, const EditPaM& SvParserState _eState = SVPAR_NOTSTARTED; if ( pImpEditEngine ) { - // Umbrechmimik vom RTF-Import einbauen? + // Build in wrap mimic in RTF import? aCurSel = EditSelection( rPaM, rPaM ); if ( pImpEditEngine->aImportHdl.IsSet() ) @@ -210,7 +210,7 @@ void EditHTMLParser::NextToken( int nToken ) } else { - // Nur bis HTML mit 319 geschrieben ?! + // Only written until HTML with 319? if ( IsReadPRE() ) { USHORT nTabPos = aText.Search( '\t', 0 ); @@ -301,14 +301,14 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_TABLE_ON: nInTable++; break; - case HTML_TABLE_OFF: DBG_ASSERT( nInTable, "Nicht in Table, aber TABLE_OFF?" ); + case HTML_TABLE_OFF: DBG_ASSERT( nInTable, "Not in Table, but TABLE_OFF?" ); nInTable--; break; case HTML_TABLEHEADER_ON: case HTML_TABLEDATA_ON: nInCell++; - // fallthru + // fall through case HTML_BLOCKQUOTE_ON: case HTML_BLOCKQUOTE_OFF: case HTML_BLOCKQUOTE30_ON: @@ -333,7 +333,7 @@ void EditHTMLParser::NextToken( int nToken ) if ( nInCell ) nInCell--; } - // fallthru + // fall through case HTML_LISTHEADER_OFF: case HTML_LI_OFF: case HTML_DD_OFF: @@ -343,7 +343,7 @@ void EditHTMLParser::NextToken( int nToken ) break; case HTML_TABLEROW_ON: - case HTML_TABLEROW_OFF: // Nur nach einem CELL ein RETURN, fuer Calc + case HTML_TABLEROW_OFF: // A RETURN only after a CELL, for Calc case HTML_COL_ON: case HTML_COLGROUP_ON: @@ -354,9 +354,6 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_FONT_OFF: // ... break; - - // #58335# kein SkipGroup on/off auf inline markup etc. - case HTML_TITLE_ON: bInTitle = TRUE; break; @@ -391,7 +388,7 @@ void EditHTMLParser::NextToken( int nToken ) // HTML 2.0 case HTML_ADDRESS_ON: case HTML_ADDRESS_OFF: -// case HTML_BLOCKQUOTE_ON: //! extra Behandlung +// case HTML_BLOCKQUOTE_ON: //! special handling // case HTML_BLOCKQUOTE_OFF: case HTML_CITIATION_ON: case HTML_CITIATION_OFF: @@ -418,7 +415,7 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_ACRONYM_OFF: case HTML_AUTHOR_ON: case HTML_AUTHOR_OFF: -// case HTML_BLOCKQUOTE30_ON: //! extra Behandlung +// case HTML_BLOCKQUOTE30_ON: //! special handling // case HTML_BLOCKQUOTE30_OFF: case HTML_DELETEDTEXT_ON: case HTML_DELETEDTEXT_OFF: @@ -461,20 +458,20 @@ void EditHTMLParser::NextToken( int nToken ) // misc case HTML_DIRLIST_ON: case HTML_DIRLIST_OFF: - case HTML_FOOTNOTE_ON: //! landen so im Text + case HTML_FOOTNOTE_ON: //! land so im Text case HTML_FOOTNOTE_OFF: case HTML_MENULIST_ON: case HTML_MENULIST_OFF: -// case HTML_PLAINTEXT_ON: //! extra Behandlung +// case HTML_PLAINTEXT_ON: //! special handling // case HTML_PLAINTEXT_OFF: -// case HTML_PREFORMTXT_ON: //! extra Behandlung +// case HTML_PREFORMTXT_ON: //! special handling // case HTML_PREFORMTXT_OFF: case HTML_SPAN_ON: case HTML_SPAN_OFF: // obsolete -// case HTML_XMP_ON: //! extra Behandlung +// case HTML_XMP_ON: //! special handling // case HTML_XMP_OFF: -// case HTML_LISTING_ON: //! extra Behandlung +// case HTML_LISTING_ON: //! special handling // case HTML_LISTING_OFF: // Netscape case HTML_BLINK_ON: @@ -488,7 +485,7 @@ void EditHTMLParser::NextToken( int nToken ) // Internet Explorer case HTML_MARQUEE_ON: case HTML_MARQUEE_OFF: -// case HTML_PLAINTEXT2_ON: //! extra Behandlung +// case HTML_PLAINTEXT2_ON: //! special handling // case HTML_PLAINTEXT2_OFF: break; @@ -502,7 +499,7 @@ void EditHTMLParser::NextToken( int nToken ) } else if ( !(nToken & 1) ) { - DBG_ASSERT( !( nToken & 1 ), "Kein Start-Token ?!" ); + DBG_ASSERT( !( nToken & 1 ), "No Start-Token ?!" ); SkipGroup( nToken + 1 ); } } @@ -534,9 +531,9 @@ void EditHTMLParser::ImpInsertParaBreak() void EditHTMLParser::ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSel ) { - // pSel, wenn Zeichenattribute, sonst Absatzattribute fuer den - // aktuellen Absatz. - DBG_ASSERT( pSel || ( aCurSel.Min().GetNode() == aCurSel.Max().GetNode() ), "ImpInsertAttribs: Selektion?" ); + // pSel, when character attributes, otherwise paragraph attributes for + // the current paragraph. + DBG_ASSERT( pSel || ( aCurSel.Min().GetNode() == aCurSel.Max().GetNode() ), "ImpInsertAttribs: Selection?" ); EditPaM aStartPaM( pSel ? pSel->Min() : aCurSel.Min() ); EditPaM aEndPaM( pSel ? pSel->Max() : aCurSel.Max() ); @@ -558,46 +555,23 @@ void EditHTMLParser::ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSe ContentNode* pSN = aStartPaM.GetNode(); USHORT nStartNode = pImpEditEngine->GetEditDoc().GetPos( pSN ); - // Wenn ein Attribut von 0 bis aktuelle Absatzlaenge geht, - // soll es ein Absatz-Attribut sein! + // If an attribute goes from 0 to current Paragraph length, + // then it should be a paragraph attribute! - // Achtung: Selektion kann ueber mehrere Absaetze gehen. - // Alle vollstaendigen Absaetze sind Absatzattribute... + // Note: Selection can reach over several Paragraphs. + // All complete paragraphs are paragraph attributes ... - // HTML eigentlich nicht: + // not really HTML: #ifdef DBG_UTIL ContentNode* pEN = aEndPaM.GetNode(); USHORT nEndNode = pImpEditEngine->GetEditDoc().GetPos( pEN ); - DBG_ASSERT( nStartNode == nEndNode, "ImpSetAttribs: Mehrere Absaetze?" ); + DBG_ASSERT( nStartNode == nEndNode, "ImpSetAttribs: Several paragraphs?" ); #endif -/* - for ( USHORT z = nStartNode+1; z < nEndNode; z++ ) - { - DBG_ASSERT( pImpEditEngine->GetEditDoc().SaveGetObject( z ), "Node existiert noch nicht(RTF)" ); - pImpEditEngine->SetParaAttribs( z, rSet.GetAttrSet() ); - } - - if ( aStartPaM.GetNode() != aEndPaM.GetNode() ) - { - // Den Rest des StartNodes... - if ( aStartPaM.GetIndex() == 0 ) - pImpEditEngine->SetParaAttribs( nStartNode, rSet.GetAttrSet() ); - else - pImpEditEngine->SetAttribs( EditSelection( aStartPaM, EditPaM( aStartPaM.GetNode(), aStartPaM.GetNode()->Len() ) ), rSet.GetAttrSet() ); - - // Den Anfang des EndNodes.... - if ( aEndPaM.GetIndex() == aEndPaM.GetNode()->Len() ) - pImpEditEngine->SetParaAttribs( nEndNode, rSet.GetAttrSet() ); - else - pImpEditEngine->SetAttribs( EditSelection( EditPaM( aEndPaM.GetNode(), 0 ), aEndPaM ), rSet.GetAttrSet() ); - } - else -*/ { if ( ( aStartPaM.GetIndex() == 0 ) && ( aEndPaM.GetIndex() == aEndPaM.GetNode()->Len() ) ) { - // Muesse gemergt werden: + // Has to be merged: SfxItemSet aItems( pImpEditEngine->GetParaAttribs( nStartNode ) ); aItems.Put( rItems ); pImpEditEngine->SetParaAttribs( nStartNode, aItems ); @@ -610,24 +584,15 @@ void EditHTMLParser::ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSe void EditHTMLParser::ImpSetStyleSheet( USHORT nHLevel ) { /* - nHLevel: 0: Ausschalten + nHLevel: 0: Turn offAusschalten 1-6: Heading STYLE_PRE: Preformatted */ - -// if ( pImpEditEngine->GetStatus().DoImportRTFStyleSheets() ) -// { -// SvxRTFStyleType* pS = GetStyleTbl().Get( rSet.StyleNo() ); -// DBG_ASSERT( pS, "Vorlage in RTF nicht definiert!" ); -// if ( pS ) -// pImpEditEngine->SetStyleSheet( EditSelection( aStartPaM, aEndPaM ), pS->sName, SFX_STYLE_FAMILY_ALL ); -// } -// else { - // Harte Attribute erzeugen... - // Reicht fuer Calc, bei StyleSheets muesste noch geklaert werden, - // dass diese auch in der App liegen sollten, damit sie beim - // fuettern in eine andere Engine auch noch da sind... + // Create hard attributes ... + // Enough for Calc, would have to be clarified with StyleSheets + // that they should also be in the app so that when they are feed + // in a different engine still are here ... USHORT nNode = pImpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() ); // SfxItemSet aItems( pImpEditEngine->GetEmptyItemSet() ); @@ -647,7 +612,7 @@ void EditHTMLParser::ImpSetStyleSheet( USHORT nHLevel ) aItems.ClearItem( EE_CHAR_FONTINFO_CTL ); aItems.ClearItem( EE_CHAR_WEIGHT_CTL ); - // Fett in den ersten 3 Headings + // Bold in the first 3 Headings if ( ( nHLevel >= 1 ) && ( nHLevel <= 3 ) ) { SvxWeightItem aWeightItem( WEIGHT_BOLD, EE_CHAR_WEIGHT ); @@ -660,7 +625,7 @@ void EditHTMLParser::ImpSetStyleSheet( USHORT nHLevel ) aItems.Put( aWeightItem ); } - // Fonthoehe und Abstaende, wenn LogicToLogic moeglich: + // Font hight and margins, when LogicToLogic is possible: MapUnit eUnit = pImpEditEngine->GetRefMapMode().GetMapUnit(); if ( ( eUnit != MAP_PIXEL ) && ( eUnit != MAP_SYSFONT ) && ( eUnit != MAP_APPFONT ) && ( eUnit != MAP_RELATIVE ) ) @@ -686,7 +651,7 @@ void EditHTMLParser::ImpSetStyleSheet( USHORT nHLevel ) SvxFontHeightItem aHeightItemCTL( nPoints, 100, EE_CHAR_FONTHEIGHT_CTL ); aItems.Put( aHeightItemCTL ); - // Absatzabstaende, wenn Heading: + // Paragraph margins, when Heading: if ( !nHLevel || ((nHLevel >= 1) && (nHLevel <= 6)) ) { SvxULSpaceItem aULSpaceItem( EE_PARA_ULSPACE ); @@ -696,7 +661,7 @@ void EditHTMLParser::ImpSetStyleSheet( USHORT nHLevel ) } } - // Bei Pre einen proportionalen Font waehlen + // Choose a proportional Font for Pre if ( nHLevel == STYLE_PRE ) { Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_FIXED, LANGUAGE_SYSTEM, 0 ); @@ -730,7 +695,7 @@ void EditHTMLParser::ImpInsertText( const String& rText ) void EditHTMLParser::SkipGroup( int nEndToken ) { - // #69109# groups in cells are closed upon leaving the cell, because those + // groups in cells are closed upon leaving the cell, because those // ******* web authors don't know their job // for example:
lacks a closing
BYTE nCellLevel = nInCell; @@ -792,18 +757,14 @@ void EditHTMLParser::EndPara( BOOL ) BOOL bHasText = HasTextInCurrentPara(); if ( bHasText ) ImpInsertParaBreak(); - // Nur, wenn ohne Absatzabstaende gearbeitet wird... -// if ( !nInTable && bReal && (nNumberingLevel<=1) && (nBulletLevel<=1) ) -// ImpInsertParaBreak(); } bInPara = FALSE; } BOOL EditHTMLParser::ThrowAwayBlank() { - // Ein Blank muss weggeschmissen werden, wenn der neue Text mit einem - // Blank beginnt und der aktuelle Absatz leer ist oder mit einem - // Blank endet... + // A blank must be thrown away if the new text begins with a Blank and + // if the current paragraph is empty or ends with a Blank... ContentNode* pNode = aCurSel.Max().GetNode(); if ( pNode->Len() && ( pNode->GetChar( pNode->Len()-1 ) != ' ' ) ) return FALSE; @@ -817,7 +778,7 @@ BOOL EditHTMLParser::HasTextInCurrentPara() void EditHTMLParser::AnchorStart() { - // Anker im Anker ignoriern + // ignore anchor in anchor if ( !pCurAnchor ) { const HTMLOptions* _pOptions = GetOptions(); @@ -856,7 +817,7 @@ void EditHTMLParser::AnchorEnd() { if ( pCurAnchor ) { - // Als URL-Feld einfuegen... + // Insert as URL-Field... SvxFieldItem aFld( SvxURLField( pCurAnchor->aHRef, pCurAnchor->aText, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD ); aCurSel = pImpEditEngine->InsertField( aCurSel, aFld ); bFieldsInserted = TRUE; @@ -881,7 +842,7 @@ void EditHTMLParser::HeadingStart( int nToken ) USHORT nId = sal::static_int_cast< USHORT >( 1 + ( ( nToken - HTML_HEAD1_ON ) / 2 ) ); - DBG_ASSERT( (nId >= 1) && (nId <= 9), "HeadingStart: ID kann nicht stimmen!" ); + DBG_ASSERT( (nId >= 1) && (nId <= 9), "HeadingStart: ID can not be correct!" ); ImpSetStyleSheet( nId ); } diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx index 75dcfda..ab4d428 100644 --- a/editeng/source/editeng/eehtml.hxx +++ b/editeng/source/editeng/eehtml.hxx @@ -54,7 +54,7 @@ private: AnchorInfo* pCurAnchor; BOOL bInPara; - BOOL bWasInPara; // bInPara vor HeadingStart merken, weil sonst hinterher weg + BOOL bWasInPara; // Remember bInPara before HeadingStart, because afterwards it will be gone. BOOL bFieldsInserted; BYTE nInTable; BYTE nInCell; diff --git a/editeng/source/editeng/eeobj.cxx b/editeng/source/editeng/eeobj.cxx index 34d5959..c5220a6 100644 --- a/editeng/source/editeng/eeobj.cxx +++ b/editeng/source/editeng/eeobj.cxx @@ -69,7 +69,7 @@ uno::Any EditDataObject::getTransferData( const datatransfer::DataFlavor& rFlavo } else if ( ( nT == SOT_FORMATSTR_ID_EDITENGINE ) || ( nT == SOT_FORMAT_RTF ) ) { - // MT 01/2002: No RTF on demand any more: + // No RTF on demand any more: // 1) Was not working, because I had to flush() the clipboard immediately anyway // 2) Don't have the old pool defaults and the StyleSheetPool here. diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index 1f0f470..c874362 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -96,8 +96,8 @@ GlobalEditData::GlobalEditData() GlobalEditData::~GlobalEditData() { - // DefItems zerstoeren... - // Oder einfach stehen lassen, da sowieso App-Ende?! + // Destroy DefItems... + // Or simply keep them, since at end of excecution?! if ( ppDefItems ) SfxItemPool::ReleaseDefaults( ppDefItems, EDITITEMCOUNT, TRUE ); delete pStdRefDevice; @@ -174,7 +174,7 @@ SfxPoolItem** GlobalEditData::GetDefItems() ppDefItems[50] = new SvxCharSetColorItem( Color( COL_RED ), RTL_TEXTENCODING_DONTKNOW, EE_FEATURE_NOTCONV ); ppDefItems[51] = new SvxFieldItem( SvxFieldData(), EE_FEATURE_FIELD ); - DBG_ASSERT( EDITITEMCOUNT == 52, "ITEMCOUNT geaendert, DefItems nicht angepasst!" ); + DBG_ASSERT( EDITITEMCOUNT == 52, "ITEMCOUNT changed, DefItems not adapted!" ); // Init DefFonts: GetDefaultFonts( *(SvxFontItem*)ppDefItems[EE_CHAR_FONTINFO - EE_ITEMS_START], diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 3b8d109..60856bc 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -44,16 +44,16 @@ #include -// alle Werte auf default; wird nach einlesen der Bitmap aufgerufen ! +// Set all values to defaultt; is called after loading the bitmap! void SvxRTFPictureType::ResetValues() -{ // setze alle Werte RTF-Defaults +{ // Set all values RTF-Defaults eStyle = RTF_BITMAP; nMode = HEX_MODE; nType = nGoalWidth = nGoalHeight = 0; nWidth = nHeight = nWidthBytes = 0; uPicLen = 0; nBitsPerPixel = nPlanes = 1; - nScalX = nScalY = 100; // Skalierung in Prozent + nScalX = nScalY = 100; // Scale in percent nCropT = nCropB = nCropL = nCropR = 0; aPropertyPairs.clear(); } @@ -87,11 +87,10 @@ EditRTFParser::EditRTFParser( SvStream& rIn, EditSelection aSel, SfxItemPool& rA SetInsPos( EditPosition( pImpEditEngine, &aCurSel ) ); - // Umwandeln der Twips-Werte... + // Convert the twips values ... SetCalcValue( TRUE ); SetChkStyleAttr( pImpEE->GetStatus().DoImportRTFStyleSheets() ); - SetNewDoc( FALSE ); // damit die Pool-Defaults nicht - // ueberschrieben werden... + SetNewDoc( FALSE ); // So that the Pool-Defaults are not overwritten... aEditMapMode = MapMode( pImpEE->GetRefDevice()->GetMapMode().GetMapUnit() ); } @@ -101,21 +100,21 @@ EditRTFParser::~EditRTFParser() SvParserState EditRTFParser::CallParser() { - DBG_ASSERT( !aCurSel.HasRange(), "Selection bei CallParser!" ); - // Den Teil, in den importiert wird, vom Rest abtrennen. - // Diese Mimik sollte fuer alle Imports verwendet werden. - // aStart1PaM: Letzte Position vor dem importierten Inhalt - // aEnd1PaM: Erste Position nach dem importierten Inhalt - // aStart2PaM: Erste Position des importierten Inhaltes - // aEnd2PaM: Letzte Position des importierten Inhaltes + DBG_ASSERT( !aCurSel.HasRange(), "Selection for CallParser!" ); + // Separate the part that is imported from the rest. + // This expression should be used for all imports. + // aStart1PaM: Last position before the imported content + // aEnd1PaM: First position after the imported content + // aStart2PaM: First position of the imported content + // aEnd2PaM: Last position of the imported content EditPaM aStart1PaM( aCurSel.Min().GetNode(), aCurSel.Min().GetIndex() ); aCurSel = pImpEditEngine->ImpInsertParaBreak( aCurSel ); EditPaM aStart2PaM = aCurSel.Min(); - // Sinnvoll oder nicht?: + // Useful or not? aStart2PaM.GetNode()->GetContentAttribs().GetItems().ClearItem(); AddRTFDefaultValues( aStart2PaM, aStart2PaM ); EditPaM aEnd1PaM( pImpEditEngine->ImpInsertParaBreak( aCurSel.Max() ) ); - // aCurCel zeigt jetzt auf den Zwischenraum + // aCurCel now points to the gap if ( pImpEditEngine->aImportHdl.IsSet() ) { @@ -136,7 +135,7 @@ SvParserState EditRTFParser::CallParser() ContentNode* pCurNode = aCurSel.Max().GetNode(); USHORT nPara = pImpEditEngine->GetEditDoc().GetPos( pCurNode ); ContentNode* pPrevNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara-1 ); - DBG_ASSERT( pPrevNode, "Ungueltiges RTF-Dokument ?!" ); + DBG_ASSERT( pPrevNode, "Invalid RTF-Document?!" ); EditSelection aSel; aSel.Min() = EditPaM( pPrevNode, pPrevNode->Len() ); aSel.Max() = EditPaM( pCurNode, 0 ); @@ -145,9 +144,9 @@ SvParserState EditRTFParser::CallParser() EditPaM aEnd2PaM( aCurSel.Max() ); //AddRTFDefaultValues( aStart2PaM, aEnd2PaM ); BOOL bOnlyOnePara = ( aEnd2PaM.GetNode() == aStart2PaM.GetNode() ); - // Den Brocken wieder einfuegen... - // Problem: Absatzattribute duerfen ggf. nicht uebernommen werden - // => Zeichenattribute machen. + // Paste the chunk again ... + // Problem: Paragraph attributes may not possibly be taken over + // => Do Character attributes. BOOL bSpecialBackward = aStart1PaM.GetNode()->Len() ? FALSE : TRUE; if ( bOnlyOnePara || aStart1PaM.GetNode()->Len() ) @@ -155,7 +154,7 @@ SvParserState EditRTFParser::CallParser() aCurSel.Min() = pImpEditEngine->ImpConnectParagraphs( aStart1PaM.GetNode(), aStart2PaM.GetNode(), bSpecialBackward ); bSpecialBackward = aEnd1PaM.GetNode()->Len() ? TRUE : FALSE; - // wenn bOnlyOnePara, dann ist der Node beim Connect verschwunden. + // when bOnlyOnePara, then the node is gone on Connect. if ( !bOnlyOnePara && aEnd1PaM.GetNode()->Len() ) pImpEditEngine->ParaAttribsToCharAttribs( aEnd2PaM.GetNode() ); aCurSel.Max() = pImpEditEngine->ImpConnectParagraphs( @@ -167,7 +166,7 @@ SvParserState EditRTFParser::CallParser() void EditRTFParser::AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& rEnd ) { - // Problem: DefFont und DefFontHeight + // Problem: DefFont and DefFontHeight Size aSz( 12, 0 ); MapMode aPntMode( MAP_POINT ); MapMode _aEditMapMode( pImpEditEngine->GetRefDevice()->GetMapMode().GetMapUnit() ); @@ -182,7 +181,7 @@ void EditRTFParser::AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& r for ( USHORT nPara = nStartPara; nPara <= nEndPara; nPara++ ) { ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); - DBG_ASSERT( pNode, "AddRTFDefaultValues - Kein Absatz ?!" ); + DBG_ASSERT( pNode, "AddRTFDefaultValues - No paragraph?!" ); if ( !pNode->GetContentAttribs().HasItem( EE_CHAR_FONTINFO ) ) pNode->GetContentAttribs().GetItems().Put( aFontItem ); if ( !pNode->GetContentAttribs().HasItem( EE_CHAR_FONTHEIGHT ) ) @@ -244,8 +243,8 @@ void EditRTFParser::NextToken( int nToken ) void EditRTFParser::UnknownAttrToken( int nToken, SfxItemSet* ) { - // fuer Tokens, die im ReadAttr nicht ausgewertet werden - // Eigentlich nur fuer Calc (RTFTokenHdl), damit RTF_INTBL + // for Tokens which are not evaluated in ReadAttr + // Actually, only for Calc (RTFTokenHdl), so that RTF_INTBL if ( pImpEditEngine->aImportHdl.IsSet() ) { ImportInfo aImportInfo( RTFIMP_UNKNOWNATTR, this, pImpEditEngine->CreateESel( aCurSel ) ); @@ -290,14 +289,13 @@ void EditRTFParser::MovePos( int bForward ) void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos, USHORT& rCntPos ) { - // Gewollt ist: von der aktuellen Einfuegeposition den vorherigen - // Absatz bestimmen und von dem das Ende setzen. - // Dadurch wird "\pard" immer auf den richtigen Absatz - // angewendet. + // The Intention is to: determine the current insert position of the + // previous paragraph and set the end from this. + // This "\pard" always apply on the right paragraph. ContentNode* pN = aCurSel.Max().GetNode(); USHORT nCurPara = pImpEditEngine->GetEditDoc().GetPos( pN ); - DBG_ASSERT( nCurPara != 0, "Absatz gleich 0: SetEnfPrevPara" ); + DBG_ASSERT( nCurPara != 0, "Paragraph equal to 0: SetEnfPrevPara" ); if ( nCurPara ) nCurPara--; ContentNode* pPrevNode = pImpEditEngine->GetEditDoc().SaveGetObject( nCurPara ); @@ -319,7 +317,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) EditPaM aStartPaM( pSttNode, rSet.GetSttCnt() ); EditPaM aEndPaM( pEndNode, rSet.GetEndCnt() ); - // ggf. noch das Escapemant-Item umbiegen: + // If possible adjust the Escapemant-Item: const SfxPoolItem* pItem; // #i66167# adapt font heights to destination MapUnit if necessary @@ -349,7 +347,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) if( ( DFLT_ESC_AUTO_SUPER != nEsc ) && ( DFLT_ESC_AUTO_SUB != nEsc ) ) { - nEsc *= 10; //HalPoints => Twips wurde in RTFITEM.CXX unterschlagen! + nEsc *= 10; //HalPoints => Twips was embezzled in RTFITEM.CXX! SvxFont aFont; pImpEditEngine->SeekCursor( aStartPaM.GetNode(), aStartPaM.GetIndex()+1, aFont ); nEsc = nEsc * 100 / aFont.GetSize().Height(); @@ -376,7 +374,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) if ( rSet.StyleNo() && pImpEditEngine->GetStyleSheetPool() && pImpEditEngine->GetStatus().DoImportRTFStyleSheets() ) { SvxRTFStyleType* pS = GetStyleTbl().Get( rSet.StyleNo() ); - DBG_ASSERT( pS, "Vorlage in RTF nicht definiert!" ); + DBG_ASSERT( pS, "Template not defined in RTF!" ); if ( pS ) { pImpEditEngine->SetStyleSheet( EditSelection( aStartPaM, aEndPaM ), (SfxStyleSheet*)pImpEditEngine->GetStyleSheetPool()->Find( pS->sName, SFX_STYLE_FAMILY_ALL ) ); @@ -384,26 +382,26 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) } } - // Wenn ein Attribut von 0 bis aktuelle Absatzlaenge geht, - // soll es ein Absatz-Attribut sein! + // When an Attribute goes from 0 to the current paragraph length, + // it should be a paragraph attribute! - // Achtung: Selektion kann ueber mehrere Absaetze gehen. - // Alle vollstaendigen Absaetze sind Absatzattribute... + // Note: Selection can reach over several paragraphs. + // All Complete paragraphs are paragraph attributes ... for ( USHORT z = nStartNode+1; z < nEndNode; z++ ) { - DBG_ASSERT( pImpEditEngine->GetEditDoc().SaveGetObject( z ), "Node existiert noch nicht(RTF)" ); + DBG_ASSERT( pImpEditEngine->GetEditDoc().SaveGetObject( z ), "Node does not exist yet(RTF)" ); pImpEditEngine->SetParaAttribs( z, rSet.GetAttrSet() ); } if ( aStartPaM.GetNode() != aEndPaM.GetNode() ) { - // Den Rest des StartNodes... + // The rest dof the StartNodes... if ( aStartPaM.GetIndex() == 0 ) pImpEditEngine->SetParaAttribs( nStartNode, rSet.GetAttrSet() ); else pImpEditEngine->SetAttribs( EditSelection( aStartPaM, EditPaM( aStartPaM.GetNode(), aStartPaM.GetNode()->Len() ) ), rSet.GetAttrSet() ); - // Den Anfang des EndNodes.... + // the beginning of the EndNodes.... if ( aEndPaM.GetIndex() == aEndPaM.GetNode()->Len() ) pImpEditEngine->SetParaAttribs( nEndNode, rSet.GetAttrSet() ); else @@ -413,7 +411,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) { if ( ( aStartPaM.GetIndex() == 0 ) && ( aEndPaM.GetIndex() == aEndPaM.GetNode()->Len() ) ) { - // #96298# When settings char attribs as para attribs, we must merge with existing attribs, not overwrite the ItemSet! + // When settings char attribs as para attribs, we must merge with existing attribs, not overwrite the ItemSet! SfxItemSet aAttrs = pImpEditEngine->GetParaAttribs( nStartNode ); aAttrs.Put( rSet.GetAttrSet() ); pImpEditEngine->SetParaAttribs( nStartNode, aAttrs ); @@ -446,8 +444,7 @@ SvxRTFStyleType* EditRTFParser::FindStyleSheet( const XubString& rName ) SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) { - // Prueffen, ob so eine Vorlage existiert.... - // dann wird sie auch nicht geaendert! + // Check if a template exists, then it will not be changed! SfxStyleSheet* pStyle = (SfxStyleSheet*)pImpEditEngine->GetStyleSheetPool()->Find( pRTFStyle->sName, SFX_STYLE_FAMILY_ALL ); if ( pStyle ) return pStyle; @@ -463,21 +460,21 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) pStyle = (SfxStyleSheet*) &pImpEditEngine->GetStyleSheetPool()->Make( aName, SFX_STYLE_FAMILY_PARA ); - // 1) Items konvertieren und uebernehmen... + // 1) convert and take over Items ... ConvertAndPutItems( pStyle->GetItemSet(), pRTFStyle->aAttrSet ); - // 2) Solange Parent nicht im Pool, auch diesen kreieren... + // 2) As long as Parent is not in the pool, also create this ... if ( aParent.Len() && ( aParent != aName ) ) { SfxStyleSheet* pS = (SfxStyleSheet*)pImpEditEngine->GetStyleSheetPool()->Find( aParent, SFX_STYLE_FAMILY_ALL ); if ( !pS ) { - // Wenn nirgendwo gefunden, aus RTF erzeugen... + // If not found anywhere, create from RTF ... SvxRTFStyleType* _pRTFStyle = FindStyleSheet( aParent ); if ( _pRTFStyle ) pS = CreateStyleSheet( _pRTFStyle ); } - // 2b) ItemSet mit Parent verknuepfen... + // 2b) Link Itemset with Parent ... if ( pS ) pStyle->GetItemSet().SetParent( &pS->GetItemSet() ); } @@ -486,7 +483,7 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle ) void EditRTFParser::CreateStyleSheets() { - // der SvxRTFParser hat jetzt die Vorlagen erzeugt... + // the SvxRTFParser haa now created the template... if ( pImpEditEngine->GetStyleSheetPool() && pImpEditEngine->GetStatus().DoImportRTFStyleSheets() ) { SvxRTFStyleType* pRTFStyle = GetStyleTbl().First(); @@ -509,8 +506,8 @@ void EditRTFParser::CalcValue() void EditRTFParser::ReadField() { - // Aus SwRTFParser::ReadField() - int _nOpenBrakets = 1; // die erste wurde schon vorher erkannt + // From SwRTFParser::ReadField() + int _nOpenBrakets = 1; // the first was already detected earlier BOOL bFldInst = FALSE; BOOL bFldRslt = FALSE; String aFldInst; @@ -574,12 +571,12 @@ void EditRTFParser::ReadField() } } - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + SkipToken( -1 ); // the closing brace is evaluated "above" } void EditRTFParser::SkipGroup() { - int _nOpenBrakets = 1; // die erste wurde schon vorher erkannt + int _nOpenBrakets = 1; // the first was already detected earlier while( _nOpenBrakets && IsParserWorking() ) { @@ -599,7 +596,7 @@ void EditRTFParser::SkipGroup() } } - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + SkipToken( -1 ); // the closing brace is evaluated "above" } ULONG EditNodeIdx::GetIdx() const diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx index 9656c9e..73c58a6 100644 --- a/editeng/source/editeng/eertfpar.hxx +++ b/editeng/source/editeng/eertfpar.hxx @@ -62,10 +62,10 @@ public: virtual ULONG GetNodeIdx() const; virtual USHORT GetCntIdx() const; - // erzeuge von sich selbst eine Kopie + // clone virtual SvxPosition* Clone() const; - // erzeuge vom NodeIndex eine Kopie + // clone NodeIndex virtual SvxNodeIdx* MakeNodeIdx() const; }; diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index bfb199d..31637af 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -59,7 +59,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::linguistic2; -#define SCRLRANGE 20 // 1/20 der Breite/Hoehe scrollen, wenn im QueryDrop +#define SCRLRANGE 20 // Scroll 1/20 of the width/height, when in QueryDrop inline void lcl_AllignToPixel( Point& rPoint, OutputDevice* pOutDev, short nDiffX, short nDiffY ) { @@ -123,7 +123,7 @@ void ImpEditView::SetBackgroundColor( const Color& rColor ) void ImpEditView::SetEditSelection( const EditSelection& rEditSelection ) { - // #100856# set state before notification + // set state before notification aEditSelection = rEditSelection; if ( pEditEngine->pImpEditEngine->GetNotifyHdl().IsSet() ) @@ -141,14 +141,13 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion ) if ( GetSelectionMode() == EE_SELMODE_HIDDEN ) return; - // Vor dem Zeichnen der Selektion muss sichergestellt werden, - // das der Fensterinhalt komplett gueltig ist! - // Muss hier stehen, damit auf jeden Fall weg wenn lerr, nicht spaeter - // zwei Paint-Events! - // 19.10: Muss sogar vor Abfrage von bUpdate, falls nach Invalidate - // noch Paints in der Queue, aber jemand schaltet den UpdateMode um! + // It must be ensured before rendering the selection, that the contents of + // the window is completely valid! Must be here so that in any case if + // empty, then later on two-Paint Events! Must be done even before the + // query from bUpdate, if after Invalidate paints still in the queue, + // but someone switches the update mode! - // pRegion: Wenn nicht NULL, dann nur Region berechnen. + // pRegion: When not NULL, then only calculate Region. PolyPolygon* pPolyPoly = NULL; if ( pRegion ) pPolyPoly = new PolyPolygon; @@ -166,8 +165,8 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion ) if ( !aTmpSel.HasRange() ) return; - // aTmpOutArea: Falls OutputArea > Papierbreite und - // Text > Papierbreite ( uebergrosse Felder ) + // aTmpOutArea: if OutputArea > Paper width and + // Text > Paper width ( over large fields ) Rectangle aTmpOutArea( aOutArea ); if ( aTmpOutArea.GetWidth() > pEditEngine->pImpEditEngine->GetPaperSize().Width() ) aTmpOutArea.Right() = aTmpOutArea.Left() + pEditEngine->pImpEditEngine->GetPaperSize().Width(); @@ -187,8 +186,8 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion ) for ( sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++ ) { ParaPortion* pTmpPortion = pEditEngine->pImpEditEngine->GetParaPortions().SaveGetObject( nPara ); - DBG_ASSERT( pTmpPortion, "Portion in Selektion nicht gefunden!" ); - DBG_ASSERT( !pTmpPortion->IsInvalid(), "Portion in Selektion nicht formatiert!" ); + DBG_ASSERT( pTmpPortion, "Portion in Selection not found!" ); + DBG_ASSERT( !pTmpPortion->IsInvalid(), "Portion in Selection not formatted!" ); if ( !pTmpPortion->IsVisible() || pTmpPortion->IsInvalid() ) continue; @@ -209,7 +208,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion ) for ( sal_uInt16 nLine = nStartLine; nLine <= nEndLine; nLine++ ) { EditLine* pLine = pTmpPortion->GetLines().GetObject( nLine ); - DBG_ASSERT( pLine, "Zeile nicht gefunden: DrawSelection()" ); + DBG_ASSERT( pLine, "Line not found: DrawSelection()" ); BOOL bPartOfLine = FALSE; sal_uInt16 nStartIndex = pLine->GetStart(); @@ -225,7 +224,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion ) bPartOfLine = TRUE; } - // Kann passieren, wenn am Anfang einer umgebrochenen Zeile. + // Can happen if at the beginning of a wrapped line. if ( nEndIndex < nStartIndex ) nEndIndex = nStartIndex; @@ -236,7 +235,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion ) aTopLeft.Y() += nParaStart; aBottomRight.Y() += nParaStart; - // Nur Painten, wenn im sichtbaren Bereich... + // Only paint if in the visible range ... if ( aTopLeft.Y() > GetVisDocBottom() ) break; @@ -346,7 +345,7 @@ Rectangle ImpEditView::GetVisDocArea() const Point ImpEditView::GetDocPos( const Point& rWindowPos ) const { - // Fensterposition => Dokumentposition + // Window Position => Position Document Point aPoint; if ( !pEditEngine->pImpEditEngine->IsVertical() ) @@ -365,7 +364,7 @@ Point ImpEditView::GetDocPos( const Point& rWindowPos ) const Point ImpEditView::GetWindowPos( const Point& rDocPos ) const { - // Dokumentposition => Fensterposition + // Document position => window position Point aPoint; if ( !pEditEngine->pImpEditEngine->IsVertical() ) @@ -384,7 +383,7 @@ Point ImpEditView::GetWindowPos( const Point& rDocPos ) const Rectangle ImpEditView::GetWindowPos( const Rectangle& rDocRect ) const { - // Dokumentposition => Fensterposition + // Document position => window position Point aPos( GetWindowPos( rDocRect.TopLeft() ) ); Size aSz = rDocRect.GetSize(); Rectangle aRect; @@ -412,15 +411,15 @@ void ImpEditView::SetSelectionMode( EESelectionMode eNewMode ) { if ( eSelectionMode != eNewMode ) { - DrawSelection(); // 'Wegmalen' ... + DrawSelection(); eSelectionMode = eNewMode; - DrawSelection(); // und neu zeichnen. + DrawSelection(); // redraw } } void ImpEditView::SetOutputArea( const Rectangle& rRec ) { - // sollte besser auf Pixel allignt sein! + // should be better be aligned on pixels! Rectangle aNewRec( pOutWin->LogicToPixel( rRec ) ); aNewRec = pOutWin->PixelToLogic( aNewRec ); aOutArea = aNewRec; @@ -439,7 +438,7 @@ void ImpEditView::ResetOutputArea( const Rectangle& rRec ) { Rectangle aCurArea( aOutArea ); SetOutputArea( rRec ); - // Umliegende Bereiche invalidieren, wenn UpdateMode der Engine auf sal_True + // Invalidate surrounding areas if in update mode of the engine on sal_True if ( !aCurArea.IsEmpty() && pEditEngine->pImpEditEngine->GetUpdateMode() ) { long nMore = 0; @@ -578,7 +577,7 @@ void ImpEditView::SetAnchorMode( EVAnchorMode eMode ) void ImpEditView::CalcAnchorPoint() { - // GetHeight() und GetWidth() -1, da Rectangle-Berechnung nicht erwuenscht. + // GetHeight() and GetWidth() -1, because rectangle calculation not prefered. // X: switch ( eAnchorMode ) @@ -635,7 +634,7 @@ void ImpEditView::CalcAnchorPoint() void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, USHORT nShowCursorFlags ) { - // Kein ShowCursor bei einer leeren View... + // No ShowCursor in an empty View ... if ( ( aOutArea.Left() >= aOutArea.Right() ) && ( aOutArea.Top() >= aOutArea.Bottom() ) ) return; @@ -643,8 +642,8 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US if ( !pEditEngine->pImpEditEngine->IsFormatted() ) pEditEngine->pImpEditEngine->FormatDoc(); - // Aus irgendwelchen Gruenden lande ich waehrend der Formatierung hier, - // wenn sich der Outiner im Paint initialisiert, weil kein SetPool(); + // For some reasons I end up here during the formatting, if the Outliner + // is initialized in Paint, because no SetPool(); if ( pEditEngine->pImpEditEngine->IsFormatting() ) return; if ( pEditEngine->pImpEditEngine->GetUpdateMode() == sal_False ) @@ -707,56 +706,56 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US } if ( bGotoCursor ) // && (!pEditEngine->pImpEditEngine->GetStatus().AutoPageSize() ) ) { - // pruefen, ob scrollen notwendig... - // wenn scrollen, dann Update() und Scroll() ! + // check if scrolling is necessary... + // if scrolling, then update () and Scroll ()! long nDocDiffX = 0; long nDocDiffY = 0; Rectangle aTmpVisArea( GetVisDocArea() ); - // aTmpOutArea: Falls OutputArea > Papierbreite und - // Text > Papierbreite ( uebergrosse Felder ) + // aTmpOutArea: if OutputArea > Paper width and + // Text > Paper width ( over large fields ) long nMaxTextWidth = !IsVertical() ? pEditEngine->pImpEditEngine->GetPaperSize().Width() : pEditEngine->pImpEditEngine->GetPaperSize().Height(); if ( aTmpVisArea.GetWidth() > nMaxTextWidth ) aTmpVisArea.Right() = aTmpVisArea.Left() + nMaxTextWidth; if ( aEditCursor.Bottom() > aTmpVisArea.Bottom() ) - { // hochscrollen, hier positiv + { // Scroll up, here positive nDocDiffY = aEditCursor.Bottom() - aTmpVisArea.Bottom(); } else if ( aEditCursor.Top() < aTmpVisArea.Top() ) - { // runterscrollen, negativ + { // Scroll down, here negative nDocDiffY = aEditCursor.Top() - aTmpVisArea.Top(); } if ( aEditCursor.Right() > aTmpVisArea.Right() ) { - // linksscrollen, positiv + // Scroll left, positiv nDocDiffX = aEditCursor.Right() - aTmpVisArea.Right(); - // Darfs ein bischen mehr sein? + // Can it be a little more? if ( aEditCursor.Right() < ( nMaxTextWidth - GetScrollDiffX() ) ) nDocDiffX += GetScrollDiffX(); else { long n = nMaxTextWidth - aEditCursor.Right(); - // Bei einem MapMode != RefMapMode kann der EditCursor auch mal ueber - // die Papierbreite Wandern! + // If MapMode != RefMapMode then the EditCursor can go beyond + // the paper width! nDocDiffX += ( n > 0 ? n : -n ); } } else if ( aEditCursor.Left() < aTmpVisArea.Left() ) - { // rechtsscrollen - // negativ: + { + // Scroll right, negative: nDocDiffX = aEditCursor.Left() - aTmpVisArea.Left(); - // Darfs ein bischen mehr sein? + // Can it be a little more? if ( aEditCursor.Left() > ( - (long)GetScrollDiffX() ) ) nDocDiffX -= GetScrollDiffX(); else nDocDiffX -= aEditCursor.Left(); } - if ( aPaM.GetIndex() == 0 ) // braucht Olli fuer den Outliner + if ( aPaM.GetIndex() == 0 ) // Olli needed for the Outliner { - // Aber sicherstellen, dass dadurch der Cursor nicht den - // sichtbaren bereich verlaesst! + // But make sure that the cursor is not leaving visible area + // because of this! if ( aEditCursor.Left() < aTmpVisArea.GetWidth() ) { nDocDiffX = -aTmpVisArea.Left(); @@ -768,7 +767,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US long nDiffX = !IsVertical() ? nDocDiffX : -nDocDiffY; long nDiffY = !IsVertical() ? nDocDiffY : nDocDiffX; - // Negativ: Zum Anfang bzw. linken Rand + // Negative: Back to the top or left edge if ( ( Abs( nDiffY ) > pEditEngine->pImpEditEngine->nOnePixelInRef ) && DoBigScroll() ) { long nH = aOutArea.GetHeight() / 4; @@ -802,7 +801,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US } } - // Cursor evtl. etwas stutzen... + // Cursor may trim a little ... if ( ( aEditCursor.Bottom() > GetVisDocTop() ) && ( aEditCursor.Top() < GetVisDocBottom() ) ) { @@ -866,9 +865,6 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US if ( bForceVisCursor ) GetCursor()->Show(); - - // #102936# Call SetInputContext every time, otherwise we may have the wrong font - // if ( !pEditEngine->pImpEditEngine->mpIMEInfos ) { SvxFont aFont; pEditEngine->pImpEditEngine->SeekCursor( aPaM.GetNode(), aPaM.GetIndex()+1, aFont ); @@ -887,7 +883,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) { - DBG_ASSERT( pEditEngine->pImpEditEngine->IsFormatted(), "Scroll: Nicht formatiert!" ); + DBG_ASSERT( pEditEngine->pImpEditEngine->IsFormatted(), "Scroll: Not formatted!" ); if ( !ndX && !ndY ) return Range( 0, 0 ); @@ -895,7 +891,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) Rectangle aR( aOutArea ); aR = pOutWin->LogicToPixel( aR ); aR = pOutWin->PixelToLogic( aR ); - DBG_ASSERTWARNING( aR == aOutArea, "OutArea vor Scroll nicht aligned" ); + DBG_ASSERTWARNING( aR == aOutArea, "OutArea before Scroll not aligned" ); #endif Rectangle aNewVisArea( GetVisDocArea() ); @@ -914,9 +910,9 @@ Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) } if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Bottom() > (long)pEditEngine->pImpEditEngine->GetTextHeight() ) ) { - // GetTextHeight noch optimieren! - long nDiff = pEditEngine->pImpEditEngine->GetTextHeight() - aNewVisArea.Bottom(); // negativ - aNewVisArea.Move( 0, nDiff ); // koennte im neg. Bereich landen... + // GetTextHeight still optimizing! + long nDiff = pEditEngine->pImpEditEngine->GetTextHeight() - aNewVisArea.Bottom(); // negative + aNewVisArea.Move( 0, nDiff ); // could end up in the negative area... } if ( ( aNewVisArea.Top() < 0 ) && ( nRangeCheck != RGCHK_NONE ) ) aNewVisArea.Move( 0, -aNewVisArea.Top() ); @@ -934,13 +930,13 @@ Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) } if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Right() > (long)pEditEngine->pImpEditEngine->CalcTextWidth( FALSE ) ) ) { - long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( FALSE ) - aNewVisArea.Right(); // negativ - aNewVisArea.Move( nDiff, 0 ); // koennte im neg. Bereich landen... + long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( FALSE ) - aNewVisArea.Right(); // negative + aNewVisArea.Move( nDiff, 0 ); // could end up in the negative area... } if ( ( aNewVisArea.Left() < 0 ) && ( nRangeCheck != RGCHK_NONE ) ) aNewVisArea.Move( -aNewVisArea.Left(), 0 ); - // Die Differenz muss auf Pixel alignt sein (wegen Scroll!) + // The difference must be alignt on pixel (due to scroll!) long nDiffX = !IsVertical() ? ( GetVisDocLeft() - aNewVisArea.Left() ) : -( GetVisDocTop() - aNewVisArea.Top() ); long nDiffY = !IsVertical() ? ( GetVisDocTop() - aNewVisArea.Top() ) : ( GetVisDocLeft() - aNewVisArea.Left() ); @@ -964,7 +960,8 @@ Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) aVisDocStartPos.Move( -nRealDiffY, nRealDiffX ); // Das Move um den allignten Wert ergibt nicht unbedingt ein // alligntes Rechteck... - // MT 11/00: Align VisArea??? + // Aligned value of the move does not necessarily result in aligned + // rectangle ... aVisDocStartPos = pOutWin->LogicToPixel( aVisDocStartPos ); aVisDocStartPos = pOutWin->PixelToLogic( aVisDocStartPos ); Rectangle aRec( aOutArea ); @@ -1071,7 +1068,7 @@ sal_Bool ImpEditView::MouseButtonUp( const MouseEvent& rMouseEvent ) sal_Bool ImpEditView::MouseButtonDown( const MouseEvent& rMouseEvent ) { - pEditEngine->pImpEditEngine->CheckIdleFormatter(); // Falls schnelles Tippen und MouseButtonDown + pEditEngine->pImpEditEngine->CheckIdleFormatter(); // If fast typing and mouse button downs if ( pEditEngine->pImpEditEngine->aStatus.NotifyCursorMovements() ) pEditEngine->pImpEditEngine->aStatus.GetPrevParagraph() = pEditEngine->pImpEditEngine->GetEditDoc().GetPos( GetEditSelection().Max().GetNode() ); nTravelXPos = TRAVEL_X_DONTKNOW; @@ -1088,7 +1085,7 @@ sal_Bool ImpEditView::MouseMove( const MouseEvent& rMouseEvent ) void ImpEditView::Command( const CommandEvent& rCEvt ) { - pEditEngine->pImpEditEngine->CheckIdleFormatter(); // Falls schnelles Tippen und MouseButtonDown + pEditEngine->pImpEditEngine->CheckIdleFormatter(); // If fast typing and mouse button down pEditEngine->pImpEditEngine->Command( rCEvt, GetEditViewPtr() ); } @@ -1112,7 +1109,7 @@ sal_Bool ImpEditView::IsWrongSpelledWord( const EditPaM& rPaM, sal_Bool bMarkIfW bIsWrong = rPaM.GetNode()->GetWrongList()->HasWrong( aSel.Min().GetIndex(), aSel.Max().GetIndex() ); if ( bIsWrong && bMarkIfWrong ) { - DrawSelection(); // alte Selektion 'weg-zeichnen' + DrawSelection(); SetEditSelection( aSel ); DrawSelection(); } @@ -1136,8 +1133,8 @@ String ImpEditView::SpellIgnoreOrAddWord( sal_Bool bAdd ) else { aWord = pEditEngine->pImpEditEngine->GetSelected( GetEditSelection() ); - // Und deselektieren - DrawSelection(); // alte Selektion 'weg-zeichnen' + // And deselect + DrawSelection(); SetEditSelection( EditSelection( aPaM, aPaM ) ); DrawSelection(); } @@ -1194,7 +1191,7 @@ const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_uInt16* pPara, if ( aPaM.GetIndex() == aPaM.GetNode()->Len() ) { - // Sonst immer, wenn Feld ganz am Schluss und Mouse unter Text + // Otherwise, whenever the Field at the very end and mouse under the text return 0; } @@ -1206,7 +1203,7 @@ const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_uInt16* pPara, if ( pAttr->GetStart() == nXPos ) if ( pAttr->Which() == EE_FEATURE_FIELD ) { - DBG_ASSERT( pAttr->GetItem()->ISA( SvxFieldItem ), "Kein FeldItem..." ); + DBG_ASSERT( pAttr->GetItem()->ISA( SvxFieldItem ), "No FieldItem..." ); if ( pPara ) *pPara = pEditEngine->pImpEditEngine->GetEditDoc().GetPos( aPaM.GetNode() ); if ( pPos ) @@ -1405,7 +1402,7 @@ BOOL ImpEditView::IsSelectionAtPoint( const Point& rPosPixel ) Point aMousePos( rPosPixel ); - // Logische Einheiten... + // Logical units ... aMousePos = GetWindow()->PixelToLogic( aMousePos ); if ( ( !GetOutputArea().IsInside( aMousePos ) ) && !pEditEngine->pImpEditEngine->IsInSelectionMode() ) @@ -1424,7 +1421,7 @@ BOOL ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) Point aMousePos( rPointPixel ); - // Logische Einheiten... + // Logical units ... aMousePos = GetWindow()->PixelToLogic( aMousePos ); if ( ( !GetOutputArea().IsInside( aMousePos ) ) && !pEditEngine->pImpEditEngine->IsInSelectionMode() ) @@ -1434,15 +1431,13 @@ BOOL ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) Point aDocPos( GetDocPos( aMousePos ) ); - // Kann optimiert werden: Erst innerhalb eines Absatzes die Zeilen - // fuer den PaM durchwuehlen, dann nochmal mit dem PaM fuer das Rect, - // obwohl die Zeile schon bekannt ist.... - // Das muss doch nicht sein ! - + // Can be optimized: first go through the lines within a paragraph for PAM, + // then again wiht the PaM for the Rect, even though the line is already + // known .... This must not be, though! EditPaM aPaM = pEditEngine->pImpEditEngine->GetPaM( aDocPos ); BOOL bGotoCursor = DoAutoScroll(); - // aTmpNewSel: Diff zwischen alt und neu, nicht die neue Selektion + // aTmpNewSel: Diff between old and new, not the new selection EditSelection aTmpNewSel( GetEditSelection().Max(), aPaM ); // #i27299# @@ -1493,9 +1488,9 @@ void ImpEditView::ShowDDCursor( const Rectangle& rRect ) Color aOldFillColor = GetWindow()->GetFillColor(); GetWindow()->SetFillColor( Color(4210752) ); // GRAY BRUSH_50, OLDSV, change to DDCursor! - // Hintergrund sichern... + // Save background ... Rectangle aSaveRec( GetWindow()->LogicToPixel( rRect ) ); - // lieber etwas mehr sichern... + // prefer to save some more ... aSaveRec.Right() += 1; aSaveRec.Bottom() += 1; @@ -1514,7 +1509,7 @@ void ImpEditView::ShowDDCursor( const Rectangle& rRect ) if ( ( aCurSzPx.Width() < aNewSzPx.Width() ) ||( aCurSzPx.Height() < aNewSzPx.Height() ) ) { sal_Bool bDone = pDragAndDropInfo->pBackground->SetOutputSizePixel( aNewSzPx ); - DBG_ASSERT( bDone, "Virtuelles Device kaputt?" ); + DBG_ASSERT( bDone, "Virtual Device broken?" ); } #endif @@ -1524,7 +1519,7 @@ void ImpEditView::ShowDDCursor( const Rectangle& rRect ) aSaveRec.TopLeft(), aSaveRec.GetSize(), *GetWindow() ); pDragAndDropInfo->aCurSavedCursor = aSaveRec; - // Cursor malen... + // Draw Cursor... GetWindow()->DrawRect( rRect ); pDragAndDropInfo->bVisCursor = sal_True; @@ -1598,7 +1593,7 @@ void ImpEditView::dragGestureRecognized( const ::com::sun::star::datatransfer::d pDragAndDropInfo->bStarterOfDD = sal_True; - // Sensibler Bereich, wo gescrollt werden soll. + // Sensitive area to be scrolled. Size aSz( 5, 0 ); aSz = GetWindow()->PixelToLogic( aSz ); pDragAndDropInfo->nSensibleRange = (sal_uInt16) aSz.Width(); @@ -1610,7 +1605,7 @@ void ImpEditView::dragGestureRecognized( const ::com::sun::star::datatransfer::d sal_Int8 nActions = bReadOnly ? datatransfer::dnd::DNDConstants::ACTION_COPY : datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE; rDGE.DragSource->startDrag( rDGE, nActions, 0 /*cursor*/, 0 /*image*/, xData, mxDnDListener ); - // Falls Drag&Move in einer Engine, muessen Copy&Del geklammert sein! + // If Drag&Move in an Engine, thenCopy&Del has to be optional! GetCursor()->Hide(); } @@ -1629,7 +1624,7 @@ void ImpEditView::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSo { if ( pDragAndDropInfo->bStarterOfDD && pDragAndDropInfo->bDroppedInMe ) { - // DropPos: Wohin wurde gedroppt, unabhaengig von laenge. + // DropPos: Where was it dropped, irrespective of length. ESelection aDropPos( pDragAndDropInfo->aDropSel.nStartPara, pDragAndDropInfo->aDropSel.nStartPos, pDragAndDropInfo->aDropSel.nStartPara, pDragAndDropInfo->aDropSel.nStartPos ); ESelection aToBeDelSel = pDragAndDropInfo->aBeginDragSel; ESelection aNewSel( pDragAndDropInfo->aDropSel.nEndPara, pDragAndDropInfo->aDropSel.nEndPos, @@ -1638,11 +1633,11 @@ void ImpEditView::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSo sal_uInt16 nParaDiff = pDragAndDropInfo->aBeginDragSel.nEndPara - pDragAndDropInfo->aBeginDragSel.nStartPara; if ( bBeforeSelection ) { - // aToBeDelSel anpassen. - DBG_ASSERT( pDragAndDropInfo->aBeginDragSel.nStartPara >= pDragAndDropInfo->aDropSel.nStartPara, "Doch nicht davor?" ); + // Adjust aToBeDelSel. + DBG_ASSERT( pDragAndDropInfo->aBeginDragSel.nStartPara >= pDragAndDropInfo->aDropSel.nStartPara, "But not before? "); aToBeDelSel.nStartPara = aToBeDelSel.nStartPara + nParaDiff; aToBeDelSel.nEndPara = aToBeDelSel.nEndPara + nParaDiff; - // Zeichen korrigieren? + // To correct the character? if ( aToBeDelSel.nStartPara == pDragAndDropInfo->aDropSel.nEndPara ) { sal_uInt16 nMoreChars; @@ -1659,12 +1654,12 @@ void ImpEditView::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSo } else { - // aToBeDelSel ist ok, aber Selektion der View - // muss angepasst werden, wenn davor geloescht wird! - DBG_ASSERT( pDragAndDropInfo->aBeginDragSel.nStartPara <= pDragAndDropInfo->aDropSel.nStartPara, "Doch nicht davor?" ); + // aToBeDelSel is ok, but the selection of the View + // has to be adapted, if it was deleted before! + DBG_ASSERT( pDragAndDropInfo->aBeginDragSel.nStartPara <= pDragAndDropInfo->aDropSel.nStartPara, "But not before? "); aNewSel.nStartPara = aNewSel.nStartPara - nParaDiff; aNewSel.nEndPara = aNewSel.nEndPara - nParaDiff; - // Zeichen korrigieren? + // To correct the character? if ( pDragAndDropInfo->aBeginDragSel.nEndPara == pDragAndDropInfo->aDropSel.nStartPara ) { sal_uInt16 nLessChars; @@ -1680,7 +1675,7 @@ void ImpEditView::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSo DrawSelection(); EditSelection aDelSel( pEditEngine->pImpEditEngine->CreateSel( aToBeDelSel ) ); - DBG_ASSERT( !aDelSel.DbgIsBuggy( pEditEngine->pImpEditEngine->aEditDoc ), "ToBeDel ist buggy!" ); + DBG_ASSERT( !aDelSel.DbgIsBuggy( pEditEngine->pImpEditEngine->aEditDoc ), "ToBeDel is buggy!" ); pEditEngine->pImpEditEngine->ImpDeleteSelection( aDelSel ); if ( !bBeforeSelection ) { @@ -1692,7 +1687,7 @@ void ImpEditView::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSo } else { - // andere EditEngine... + // other EditEngine ... if ( pEditEngine->pImpEditEngine->ImplHasText() ) // #88630# SC ist removing the content when switching the task DeleteSelected(); } @@ -1739,7 +1734,7 @@ void ImpEditView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDro if ( xDataObj.is() ) { bChanges = TRUE; - // Selektion wegmalen... + // remove Selection ... DrawSelection(); EditPaM aPaM( pDragAndDropInfo->aDropDest ); @@ -1757,7 +1752,7 @@ void ImpEditView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDro pEditEngine->pImpEditEngine->FormatAndUpdate( pEditEngine->pImpEditEngine->GetActiveView() ); if ( pDragAndDropInfo->bStarterOfDD ) { - // Nur dann setzen, wenn in gleicher Engine! + // Only set if the same engine! pDragAndDropInfo->aDropSel.nStartPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); pDragAndDropInfo->aDropSel.nStartPos = aPaM.GetIndex(); pDragAndDropInfo->aDropSel.nEndPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aNewSel.Max().GetNode() ); @@ -1833,9 +1828,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge if ( GetOutputArea().IsInside( aMousePos ) && !bReadOnly ) { -// sal_Int8 nSupportedActions = bReadOnly ? datatransfer::dnd::DNDConstants::ACTION_COPY : datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE; - - if ( pDragAndDropInfo && pDragAndDropInfo->bHasValidData /* && ( nSupportedActions & rDTDE.DropAction ) MT: Default = 0x80 ?! */ ) + if ( pDragAndDropInfo && pDragAndDropInfo->bHasValidData ) { bAccept = sal_True; @@ -1844,7 +1837,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge { long nScrollX = 0; long nScrollY = 0; - // pruefen, ob im sensitiven Bereich + // Chech if in the sensitive area if ( ( (aMousePos.X()-pDragAndDropInfo->nSensibleRange) < GetOutputArea().Left() ) && ( ( aMousePos.X() + pDragAndDropInfo->nSensibleRange ) > GetOutputArea().Left() ) ) nScrollX = GetOutputArea().GetWidth() / SCRLRANGE; else if ( ( (aMousePos.X()+pDragAndDropInfo->nSensibleRange) > GetOutputArea().Right() ) && ( ( aMousePos.X() - pDragAndDropInfo->nSensibleRange ) < GetOutputArea().Right() ) ) @@ -1888,7 +1881,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge } else if ( HasSelection() ) { - // es darf nicht in eine Selektion gedroppt werden + // it must not be dropped into a selection EPaM aP = pEditEngine->pImpEditEngine->CreateEPaM( aPaM ); ESelection aDestSel( aP.nPara, aP.nIndex, aP.nPara, aP.nIndex); ESelection aCurSel = pEditEngine->pImpEditEngine->CreateESel( GetEditSelection() ); diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 9193e19..5bed250 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -335,7 +335,7 @@ public: BOOL IsBulletArea( const Point& rPos, sal_uInt16* pPara ); -// Fuer die SelectionEngine... +// For the Selection Engine... void CreateAnchor(); void DeselectAll(); sal_Bool SetCursorAtPoint( const Point& rPointPixel ); @@ -376,7 +376,7 @@ public: const SvxFieldItem* GetField( const Point& rPos, sal_uInt16* pPara, sal_uInt16* pPos ) const; void DeleteSelected(); - // Ggf. mehr als OutputArea invalidieren, fuer den DrawingEngine-Textrahmen... + // If possible invalidate more than OutputArea, for the DrawingEngine text frame void SetInvalidateMore( sal_uInt16 nPixel ) { nInvMore = nPixel; } sal_uInt16 GetInvalidateMore() const { return (sal_uInt16)nInvMore; } }; @@ -390,8 +390,8 @@ SV_DECL_PTRARR( EditViews, EditViewPtr, 0, 1 ) class ImpEditEngine : public SfxListener { - // Die Undos muessen direkt manipulieren ( private-Methoden ), - // damit keine neues Undos eingefuegt werden! + // The Undos have to manipulate directly ( private-Methods ), + // do that no new Undo is inserted! friend class EditUndoInsertChars; friend class EditUndoRemoveChars; friend class EditUndoDelContent; @@ -402,26 +402,26 @@ class ImpEditEngine : public SfxListener friend class EditView; friend class ImpEditView; - friend class EditEngine; // Fuer Zugriff auf Imp-Methoden - friend class EditRTFParser; // Fuer Zugriff auf Imp-Methoden - friend class EditHTMLParser; // Fuer Zugriff auf Imp-Methoden - friend class EdtAutoCorrDoc; // Fuer Zugriff auf Imp-Methoden - friend class EditDbg; // DebugRoutinen + friend class EditEngine; // For access to Imp-Methods + friend class EditRTFParser; // For access to Imp-Methods + friend class EditHTMLParser; // For access to Imp-Methods + friend class EdtAutoCorrDoc; // For access to Imp-Methods + friend class EditDbg; // Debug Routines private: // ================================================================ - // Daten... + // Data ... // ================================================================ - // Dokument-Spezifische Daten... - ParaPortionList aParaPortionList; // Formatierung + // Document Specific data ... + ParaPortionList aParaPortionList; // Formatting Size aPaperSize; // Layout Size aMinAutoPaperSize; // Layout ? Size aMaxAutoPaperSize; // Layout ? - EditDoc aEditDoc; // Dokumenteninhalt + EditDoc aEditDoc; // Document content - // Engine-Spezifische Daten.... + // Engine Specific data ... EditEngine* pEditEngine; EditViews aEditViews; EditView* pActiveView; @@ -496,7 +496,7 @@ private: sal_Bool bImpConvertFirstCall; // specifies if ImpConvert is called the very first time after Convert was called sal_Bool bFirstWordCapitalization; // specifies if auto-correction should capitalize the first word or not - // Fuer Formatierung / Update.... + // For Formatting / Update .... DeletedNodesList aDeletedNodes; Rectangle aInvalidRec; sal_uInt32 nCurTextHeight; @@ -506,8 +506,8 @@ private: Timer aOnlineSpellTimer; - // Wenn an einer Stelle erkannt wird, dass der StatusHdl gerufen werden - // muss, dies aber nicht sofort geschehen darf (kritischer Abschnitt): + // If it is detected at one point that the StatusHdl has to be called, but + // this should not happen immediately (critical section): Timer aStatusTimer; Link aStatusHdlLink; Link aNotifyHdl; @@ -524,7 +524,7 @@ private: // ================================================================ - // Methoden... + // Methods... // ================================================================ void CursorMoved( ContentNode* pPrevNode ); @@ -532,7 +532,7 @@ private: void TextModified(); void CalcHeight( ParaPortion* pPortion ); - // ggf. lieber inline, aber so einiges... + // may prefer in-line, but so few ... void InsertUndo( EditUndo* pUndo, sal_Bool bTryMerge = sal_False ); void ResetUndoManager(); sal_Bool HasUndoManager() const { return pUndoManager ? sal_True : sal_False; } @@ -844,7 +844,7 @@ public: void IndentBlock( EditView* pView, sal_Bool bRight ); -// Fuer Undo/Redo +// For Undo/Redo sal_Bool Undo( EditView* pView ); sal_Bool Redo( EditView* pView ); sal_Bool Repeat( EditView* pView ); @@ -1048,8 +1048,8 @@ inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM ) inline EditPaM ImpEditEngine::CreateEditPaM( const EPaM& rEPaM ) { - DBG_ASSERT( rEPaM.nPara < aEditDoc.Count(), "CreateEditPaM: Ungueltiger Absatz" ); - DBG_ASSERT( aEditDoc[ rEPaM.nPara ]->Len() >= rEPaM.nIndex, "CreateEditPaM: Ungueltiger Index" ); + DBG_ASSERT( rEPaM.nPara < aEditDoc.Count(), "CreateEditPaM: invalid paragraph" ); + DBG_ASSERT( aEditDoc[ rEPaM.nPara ]->Len() >= rEPaM.nIndex, "CreateEditPaM: invalid Index" ); return EditPaM( aEditDoc[ rEPaM.nPara], rEPaM.nIndex ); } @@ -1067,14 +1067,14 @@ inline ESelection ImpEditEngine::CreateESel( const EditSelection& rSel ) inline EditSelection ImpEditEngine::CreateSel( const ESelection& rSel ) { - DBG_ASSERT( rSel.nStartPara < aEditDoc.Count(), "CreateSel: Ungueltiger Start-Absatz" ); - DBG_ASSERT( rSel.nEndPara < aEditDoc.Count(), "CreateSel: Ungueltiger End-Absatz" ); + DBG_ASSERT( rSel.nStartPara < aEditDoc.Count(), "CreateSel: invalid start paragraph" ); + DBG_ASSERT( rSel.nEndPara < aEditDoc.Count(), "CreateSel: invalid end paragraph" ); EditSelection aSel; aSel.Min().SetNode( aEditDoc[ rSel.nStartPara ] ); aSel.Min().SetIndex( rSel.nStartPos ); aSel.Max().SetNode( aEditDoc[ rSel.nEndPara ] ); aSel.Max().SetIndex( rSel.nEndPos ); - DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "CreateSel: Fehlerhafte Selektion!" ); + DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "CreateSel: incorrect selection!" ); return aSel; } diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index d610c68..3fce7a3 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -80,18 +80,6 @@ using namespace ::com::sun::star; USHORT lcl_CalcExtraSpace( ParaPortion*, const SvxLineSpacingItem& rLSItem ) { USHORT nExtra = 0; - /* if ( ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) - && ( rLSItem.GetPropLineSpace() != 100 ) ) - { - // ULONG nH = pPortion->GetNode()->GetCharAttribs().GetDefFont().GetSize().Height(); - ULONG nH = pPortion->GetLines().GetObject( 0 )->GetHeight(); - long n = nH * rLSItem.GetPropLineSpace(); - n /= 100; - n -= nH; // nur den Abstand - if ( n > 0 ) - nExtra = (USHORT)n; - } - else */ if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) { nExtra = rLSItem.GetInterLineSpace(); @@ -177,7 +165,7 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : pRefDev = EE_DLL()->GetGlobalData()->GetStdRefDevice(); - // Ab hier wird schon auf Daten zugegriffen! + // Access data already from here on! SetRefDevice( pRefDev ); InitDoc( FALSE ); @@ -194,9 +182,9 @@ ImpEditEngine::~ImpEditEngine() aOnlineSpellTimer.Stop(); aIdleFormatter.Stop(); - // das Zerstoeren von Vorlagen kann sonst unnoetiges Formatieren ausloesen, - // wenn eine Parent-Vorlage zerstoert wird. - // Und das nach dem Zerstoeren der Daten! + // Destroying templates may otherwise cause unnecessary formatting, + // when a parent template is destroyed. + // And this after the destruction of the data! bDowning = TRUE; SetUpdateMode( FALSE ); @@ -237,7 +225,7 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode ) if ( GetRefDevice()->GetMapMode() == rMapMode ) return; - // Wenn RefDev == GlobalRefDev => eigenes anlegen! + // When RefDev == GlobalRefDev => create own! if ( !bOwnerOfRefDev && ( pRefDev == EE_DLL()->GetGlobalData()->GetStdRefDevice() ) ) { pRefDev = new VirtualDevice; @@ -309,19 +297,19 @@ XubString ImpEditEngine::GetSelected( const EditSelection& rSel, const LineEnd e USHORT nStartNode = aEditDoc.GetPos( pStartNode ); USHORT nEndNode = aEditDoc.GetPos( pEndNode ); - DBG_ASSERT( nStartNode <= nEndNode, "Selektion nicht sortiert ?" ); + DBG_ASSERT( nStartNode <= nEndNode, "Selection not sorted ?" ); - // ueber die Absaetze iterieren... + // iterate over the paragraphs ... for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) { - DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node nicht gefunden: GetSelected" ); + DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node not found: GetSelected" ); ContentNode* pNode = aEditDoc.GetObject( nNode ); xub_StrLen nStartPos = 0; xub_StrLen nEndPos = pNode->Len(); if ( nNode == nStartNode ) nStartPos = aSel.Min().GetIndex(); - if ( nNode == nEndNode ) // kann auch == nStart sein! + if ( nNode == nEndNode ) // can also be == nStart! nEndPos = aSel.Max().GetIndex(); aText += aEditDoc.GetParaAsString( pNode, nStartPos, nEndPos ); @@ -340,13 +328,13 @@ BOOL ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) SetAutoCompleteText( String(), TRUE ); GetSelEngine().SelMouseButtonDown( rMEvt ); - // Sonderbehandlungen + // Special treatment EditSelection aCurSel( pView->pImpEditView->GetEditSelection() ); if ( !rMEvt.IsShift() ) { if ( rMEvt.GetClicks() == 2 ) { - // damit die SelectionEngine weiss, dass Anker. + // So that the SelectionEngine knows about the anchor. aSelEngine.CursorPosChanging( TRUE, FALSE ); EditSelection aNewSelection( SelectWord( aCurSel ) ); @@ -357,7 +345,7 @@ BOOL ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) } else if ( rMEvt.GetClicks() == 3 ) { - // damit die SelectionEngine weiss, dass Anker. + // So that the SelectionEngine knows about the anchor. aSelEngine.CursorPosChanging( TRUE, FALSE ); EditSelection aNewSelection( aCurSel ); @@ -381,9 +369,8 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) const CommandVoiceData* pData = rCEvt.GetVoiceData(); if ( pData->GetType() == VOICECOMMANDTYPE_DICTATION ) { - // Funktionen auf KeyEvents umbiegen, wenn keine entsprechende - // Methode an EditView/EditEngine, damit Undo konsistent bleibt. - + // Turn functions into KeyEvent if no corresponding method to + // EditView/EditEngine so that Undo remains consistent. SfxPoolItem* pNewAttr = NULL; switch ( pData->GetCommand() ) @@ -536,7 +523,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) } else if ( rCEvt.GetCommand() == COMMAND_EXTTEXTINPUT ) { - DBG_ASSERT( mpIMEInfos, "COMMAND_EXTTEXTINPUT => Kein Start ?" ); + DBG_ASSERT( mpIMEInfos, "COMMAND_EXTTEXTINPUT => No Start ?" ); if( mpIMEInfos ) { const CommandExtTextInputData* pData = rCEvt.GetExtTextInputData(); @@ -679,7 +666,7 @@ BOOL ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) GetSelEngine().SetCurView( pView ); GetSelEngine().SelMouseButtonUp( rMEvt ); bInSelection = FALSE; - // Sonderbehandlungen + // Special treatments EditSelection aCurSel( pView->pImpEditView->GetEditSelection() ); if ( !aCurSel.HasRange() ) { @@ -699,9 +686,7 @@ BOOL ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) BOOL ImpEditEngine::MouseMove( const MouseEvent& rMEvt, EditView* pView ) { - // MouseMove wird sofort nach ShowQuickHelp() gerufen! -// if ( GetAutoCompleteText().Len() ) -// SetAutoCompleteText( String(), TRUE ); + // MouseMove is called directly after ShowQuickHelp()! GetSelEngine().SetCurView( pView ); GetSelEngine().SelMouseMove( rMEvt ); return TRUE; @@ -753,10 +738,10 @@ EditPaM ImpEditEngine::RemoveText() void ImpEditEngine::SetText( const XubString& rText ) { - // RemoveText loescht die Undo-Liste! + // RemoveText deletes the undo list! EditPaM aStartPaM = RemoveText(); BOOL bUndoCurrentlyEnabled = IsUndoEnabled(); - // Der von Hand reingesteckte Text kann nicht vom Anwender rueckgaengig gemacht werden. + // The text inserted manually can not be made reversable by the user EnableUndo( FALSE ); EditSelection aEmptySel( aStartPaM, aStartPaM ); @@ -769,8 +754,8 @@ void ImpEditEngine::SetText( const XubString& rText ) EditView* pView = aEditViews[nView]; DBG_CHKOBJ( pView, EditView, 0 ); pView->pImpEditView->SetEditSelection( EditSelection( aPaM, aPaM ) ); - // Wenn kein Text, dann auch Kein Format&Update - // => Der Text bleibt stehen. + // If no text then also no Format&Update + // => The text remains. if ( !rText.Len() && GetUpdateMode() ) { Rectangle aTmpRec( pView->GetOutputArea().TopLeft(), @@ -779,11 +764,11 @@ void ImpEditEngine::SetText( const XubString& rText ) pView->GetWindow()->Invalidate( aTmpRec ); } } - if( !rText.Len() ) // sonst muss spaeter noch invalidiert werden, !bFormatted reicht. + if( !rText.Len() ) // otherwise it must be invalidated later, !bFormatted is enough. nCurTextHeight = 0; EnableUndo( bUndoCurrentlyEnabled ); #ifndef SVX_LIGHT - DBG_ASSERT( !HasUndoManager() || !GetUndoManager().GetUndoActionCount(), "Undo nach SetText?" ); + DBG_ASSERT( !HasUndoManager() || !GetUndoManager().GetUndoActionCount(), "Undo after SetText?" ); #endif } @@ -806,7 +791,7 @@ const SfxItemSet& ImpEditEngine::GetEmptyItemSet() // ---------------------------------------------------------------------- void ImpEditEngine::CursorMoved( ContentNode* pPrevNode ) { - // Leere Attribute loeschen, aber nur, wenn Absatz nicht leer! + // Delete empty attributes, but only if paragraph is not empty! if ( pPrevNode->GetCharAttribs().HasEmptyAttribs() && pPrevNode->Len() ) pPrevNode->GetCharAttribs().DeleteEmptyAttribs( aEditDoc.GetItemPool() ); } @@ -826,7 +811,7 @@ void ImpEditEngine::TextModified() void ImpEditEngine::ParaAttribsChanged( ContentNode* pNode ) { - DBG_ASSERT( pNode, "ParaAttribsChanged: Welcher?" ); + DBG_ASSERT( pNode, "ParaAttribsChanged: Which one?" ); aEditDoc.SetModified( TRUE ); bFormatted = FALSE; @@ -839,18 +824,18 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode* pNode ) pEditEngine->ParaAttribsChanged( nPara ); ParaPortion* pNextPortion = GetParaPortions().SaveGetObject( nPara+1 ); - // => wird sowieso noch formatiert, wenn Invalid. + // => is formatted again anyway, if Invalid. if ( pNextPortion && !pNextPortion->IsInvalid() ) CalcHeight( pNextPortion ); } // ---------------------------------------------------------------------- -// Cursorbewegungen +// Cursor movements // ---------------------------------------------------------------------- EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pEditView ) { - // Eigentlich nur bei Up/Down noetig, aber was solls. + // Actually, only necessary for up/down, but whatever. CheckIdleFormatter(); EditPaM aPaM( pEditView->pImpEditView->GetEditSelection().Max() ); @@ -876,13 +861,6 @@ EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pE aPaM = CursorVisualLeftRight( pEditView, aPaM, rKeyEvent.GetKeyCode().IsMod2() ? i18n::CharacterIteratorMode::SKIPCHARACTER : i18n::CharacterIteratorMode::SKIPCELL, rKeyEvent.GetKeyCode().GetCode() == KEY_LEFT ); nCode = 0; // skip switch statement } - /* - else if ( !bCtrl && ( ( nCode == KEY_HOME ) || ( nCode == KEY_END ) ) ) - { - aPaM = CursorVisualStartEnd( pEditView, aPaM, nCode == KEY_HOME ); - nCode = 0; // skip switch statement - } - */ } bool bKeyModifySelection = aTranslatedKeyEvent.GetKeyCode().IsShift(); @@ -1010,14 +988,14 @@ EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pE else aStatus.GetStatusWord() = aStatus.GetStatusWord() | EE_STAT_CRSRMOVEFAIL; - // Bewirkt evtl. ein CreateAnchor oder Deselection all + // May cause, an CreateAnchor or deselection all aSelEngine.SetCurView( pEditView ); aSelEngine.CursorPosChanging( bKeyModifySelection, aTranslatedKeyEvent.GetKeyCode().IsMod1() ); EditPaM aOldEnd( pEditView->pImpEditView->GetEditSelection().Max() ); pEditView->pImpEditView->GetEditSelection().Max() = aPaM; if ( bKeyModifySelection ) { - // Dann wird die Selektion erweitert... + // Then the selection is expanded ... EditSelection aTmpNewSel( aOldEnd, aPaM ); pEditView->pImpEditView->DrawSelection( aTmpNewSel ); } @@ -1043,7 +1021,6 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& if ( !bEmptyLine ) { String aLine( *aPaM.GetNode(), pLine->GetStart(), pLine->GetEnd() - pLine->GetStart() ); -// USHORT nPosInLine = aPaM.GetIndex() - pLine->GetStart(); const sal_Unicode* pLineString = aLine.GetBuffer(); @@ -1064,7 +1041,6 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTmp, TRUE ); TextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion ); USHORT nRTLLevel = pTextPortion->GetRightToLeft(); -// BOOL bParaRTL = IsRightToLeft( nPara ); BOOL bPortionRTL = nRTLLevel%2 ? TRUE : FALSE; if ( bStart ) @@ -1096,7 +1072,6 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM EditLine* pLine = pParaPortion->GetLines().GetObject( nLine ); BOOL bEmptyLine = pLine->GetStart() == pLine->GetEnd(); -// USHORT nCurrentCursorFlags = pEditView->pImpEditView->nExtraCursorFlags; pEditView->pImpEditView->nExtraCursorFlags = 0; BOOL bParaRTL = IsRightToLeft( nPara ); @@ -1222,8 +1197,6 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM { if ( bWasBehind || bRTLPortion || bBeforePortion ) nVisPos++; -// if ( bWasBehind && bRTLPortion ) -// nVisPos++; } bGotoEndOfPrevLine = nVisPos < 0; @@ -1233,22 +1206,11 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM { USHORT nLogPos = (USHORT)ubidi_getLogicalIndex( pBidi, nVisPos, &nError ); -/* - if ( nLogPos == aPaM.GetIndex() ) - { - if ( bVisualToLeft ) - bGotoEndOfPrevLine = TRUE; - else - bGotoStartOfNextLine = TRUE; - } - else -*/ { aPaM.GetIndex() = pLine->GetStart() + nLogPos; // RTL portion, stay visually on the left side. USHORT _nPortionStart; - // USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nPortionStart, !bRTLPortion ); USHORT _nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), _nPortionStart, TRUE ); TextPortion* _pTextPortion = pParaPortion->GetTextPortions().GetObject( _nTextPortion ); if ( bVisualToLeft && !bRTLPortion && ( _pTextPortion->GetRightToLeft() % 2 ) ) @@ -1332,10 +1294,10 @@ EditPaM ImpEditEngine::CursorRight( const EditPaM& rPaM, USHORT nCharacterIterat EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView* pView ) { - DBG_ASSERT( pView, "Keine View - Keine Cursorbewegung!" ); + DBG_ASSERT( pView, "No View - No Cursor Movement!" ); ParaPortion* pPPortion = FindParaPortion( rPaM.GetNode() ); - DBG_ASSERT( pPPortion, "Keine passende Portion gefunden: CursorUp" ); + DBG_ASSERT( pPPortion, "No matching portion found: CursorUp "); USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex() ); EditLine* pLine = pPPortion->GetLines().GetObject( nLine ); @@ -1349,23 +1311,24 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView* pView ) nX = pView->pImpEditView->nTravelXPos; EditPaM aNewPaM( rPaM ); - if ( nLine ) // gleicher Absatz + if ( nLine ) // same paragraph { EditLine* pPrevLine = pPPortion->GetLines().GetObject(nLine-1); aNewPaM.SetIndex( GetChar( pPPortion, pPrevLine, nX ) ); - // Wenn davor eine autom.Umgebrochene Zeile, und ich muss genau an das - // Ende dieser Zeile, landet der Cursor in der aktuellen Zeile am Anfang - // Siehe Problem: Letztes Zeichen einer autom.umgebr. Zeile = Cursor + // If a previous automatically wrapped line, and one has to be exactly + // at the end of this line, the cursor lands on the current line at the + // beginning. See Problem: Last character of an automatically wrapped + // Row = cursor if ( aNewPaM.GetIndex() && ( aNewPaM.GetIndex() == pLine->GetStart() ) ) aNewPaM = CursorLeft( aNewPaM ); } - else // vorheriger Absatz + else // previous paragraph { ParaPortion* pPrevPortion = GetPrevVisPortion( pPPortion ); if ( pPrevPortion ) { pLine = pPrevPortion->GetLines().GetObject( pPrevPortion->GetLines().Count()-1 ); - DBG_ASSERT( pLine, "Zeile davor nicht gefunden: CursorUp" ); + DBG_ASSERT( pLine, "Line in front not found: CursorUp" ); aNewPaM.SetNode( pPrevPortion->GetNode() ); aNewPaM.SetIndex( GetChar( pPrevPortion, pLine, nX+nOnePixelInRef ) ); } @@ -1376,10 +1339,10 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView* pView ) EditPaM ImpEditEngine::CursorDown( const EditPaM& rPaM, EditView* pView ) { - DBG_ASSERT( pView, "Keine View - Keine Cursorbewegung!" ); + DBG_ASSERT( pView, "No View - No Cursor Movement!" ); ParaPortion* pPPortion = FindParaPortion( rPaM.GetNode() ); - DBG_ASSERT( pPPortion, "Keine passende Portion gefunden: CursorDown" ); + DBG_ASSERT( pPPortion, "No matching portion found: CursorDown" ); USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex() ); long nX; @@ -1397,20 +1360,20 @@ EditPaM ImpEditEngine::CursorDown( const EditPaM& rPaM, EditView* pView ) { EditLine* pNextLine = pPPortion->GetLines().GetObject(nLine+1); aNewPaM.SetIndex( GetChar( pPPortion, pNextLine, nX ) ); - // Sonderbehandlung siehe CursorUp... + // Special treatment, see CursorUp ... if ( ( aNewPaM.GetIndex() == pNextLine->GetEnd() ) && ( aNewPaM.GetIndex() > pNextLine->GetStart() ) && ( aNewPaM.GetIndex() < pPPortion->GetNode()->Len() ) ) aNewPaM = CursorLeft( aNewPaM ); } - else // naechster Absatz + else // next paragraph { ParaPortion* pNextPortion = GetNextVisPortion( pPPortion ); if ( pNextPortion ) { EditLine* pLine = pNextPortion->GetLines().GetObject(0); - DBG_ASSERT( pLine, "Zeile davor nicht gefunden: CursorUp" ); + DBG_ASSERT( pLine, "Line in front not found: CursorUp" ); aNewPaM.SetNode( pNextPortion->GetNode() ); - // Nie ganz ans Ende wenn mehrere Zeilen, da dann eine - // Zeile darunter der Cursor angezeigt wird. + // Never at the very end when several lines, because then a line + // below the cursor appears. aNewPaM.SetIndex( GetChar( pNextPortion, pLine, nX+nOnePixelInRef ) ); if ( ( aNewPaM.GetIndex() == pLine->GetEnd() ) && ( aNewPaM.GetIndex() > pLine->GetStart() ) && ( pNextPortion->GetLines().Count() > 1 ) ) aNewPaM = CursorLeft( aNewPaM ); @@ -1423,10 +1386,10 @@ EditPaM ImpEditEngine::CursorDown( const EditPaM& rPaM, EditView* pView ) EditPaM ImpEditEngine::CursorStartOfLine( const EditPaM& rPaM ) { ParaPortion* pCurPortion = FindParaPortion( rPaM.GetNode() ); - DBG_ASSERT( pCurPortion, "Keine Portion fuer den PaM ?" ); + DBG_ASSERT( pCurPortion, "No Portion for the PaM ?" ); USHORT nLine = pCurPortion->GetLineNumber( rPaM.GetIndex() ); EditLine* pLine = pCurPortion->GetLines().GetObject(nLine); - DBG_ASSERT( pLine, "Aktuelle Zeile nicht gefunden ?!" ); + DBG_ASSERT( pLine, "Current line not found ?!" ); EditPaM aNewPaM( rPaM ); aNewPaM.SetIndex( pLine->GetStart() ); @@ -1436,28 +1399,27 @@ EditPaM ImpEditEngine::CursorStartOfLine( const EditPaM& rPaM ) EditPaM ImpEditEngine::CursorEndOfLine( const EditPaM& rPaM ) { ParaPortion* pCurPortion = FindParaPortion( rPaM.GetNode() ); - DBG_ASSERT( pCurPortion, "Keine Portion fuer den PaM ?" ); + DBG_ASSERT( pCurPortion, "No Portion for the PaM ?" ); USHORT nLine = pCurPortion->GetLineNumber( rPaM.GetIndex() ); EditLine* pLine = pCurPortion->GetLines().GetObject(nLine); - DBG_ASSERT( pLine, "Aktuelle Zeile nicht gefunden ?!" ); + DBG_ASSERT( pLine, "Current line not found ?!" ); EditPaM aNewPaM( rPaM ); aNewPaM.SetIndex( pLine->GetEnd() ); if ( pLine->GetEnd() > pLine->GetStart() ) { -// xub_Unicode cLastChar = aNewPaM.GetNode()->GetChar( aNewPaM.GetIndex()-1 ); if ( aNewPaM.GetNode()->IsFeature( aNewPaM.GetIndex() - 1 ) ) { - // Bei einem weichen Umbruch muss ich davor stehen! + // When a soft break, be in front of it! EditCharAttrib* pNextFeature = aNewPaM.GetNode()->GetCharAttribs().FindFeature( aNewPaM.GetIndex()-1 ); if ( pNextFeature && ( pNextFeature->GetItem()->Which() == EE_FEATURE_LINEBR ) ) aNewPaM = CursorLeft( aNewPaM ); } else if ( ( aNewPaM.GetNode()->GetChar( aNewPaM.GetIndex() - 1 ) == ' ' ) && ( aNewPaM.GetIndex() != aNewPaM.GetNode()->Len() ) ) { - // Bei einem Blank in einer autom. umgebrochenen Zeile macht es Sinn, - // davor zu stehen, da der Anwender hinter das Wort will. - // Wenn diese geaendert wird, Sonderbehandlung fuer Pos1 nach End! + // For a Blank in an auto wrapped line, it makes sense, to stand + // in front of it, since the user wants to be after the word. + // If this is changed, special treatment for Pos1 to End! aNewPaM = CursorLeft( aNewPaM ); } } @@ -1486,7 +1448,7 @@ EditPaM ImpEditEngine::CursorEndOfDoc() { ContentNode* pLastNode = aEditDoc.SaveGetObject( aEditDoc.Count()-1 ); ParaPortion* pLastPortion = GetParaPortions().SaveGetObject( aEditDoc.Count()-1 ); - DBG_ASSERT( pLastNode && pLastPortion, "CursorEndOfDoc: Node oder Portion nicht gefunden" ); + DBG_ASSERT( pLastNode && pLastPortion, "CursorEndOfDoc: Node or Portion not found" ); if ( !pLastPortion->IsVisible() ) { @@ -1533,7 +1495,7 @@ EditPaM ImpEditEngine::WordLeft( const EditPaM& rPaM, sal_Int16 nWordType ) EditPaM aNewPaM( rPaM ); if ( nCurrentPos == 0 ) { - // Vorheriger Absatz... + // Previous paragraph... USHORT nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() ); ContentNode* pPrevNode = aEditDoc.SaveGetObject( --nCurPara ); if ( pPrevNode ) @@ -1581,7 +1543,7 @@ EditPaM ImpEditEngine::WordRight( const EditPaM& rPaM, sal_Int16 nWordType ) // not 'else', maybe the index reached nMax now... if ( aNewPaM.GetIndex() >= nMax ) { - // Naechster Absatz... + // Next paragraph ... USHORT nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() ); ContentNode* pNextNode = aEditDoc.SaveGetObject( ++nCurPara ); if ( pNextNode ) @@ -1723,8 +1685,6 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara ) ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; rTypes.Remove( 0, rTypes.Count() ); -// pParaPortion->aExtraCharInfos.Remove( 0, pParaPortion->aExtraCharInfos.Count() ); - ContentNode* pNode = pParaPortion->GetNode(); if ( pNode->Len() ) { @@ -2091,7 +2051,6 @@ BOOL ImpEditEngine::HasDifferentRTLLevels( const ContentNode* pNode ) BYTE ImpEditEngine::GetRightToLeft( USHORT nPara, USHORT nPos, USHORT* pStart, USHORT* pEnd ) { -// BYTE nRightToLeft = IsRightToLeft( nPara ) ? 1 : 0; BYTE nRightToLeft = 0; ContentNode* pNode = aEditDoc.SaveGetObject( nPara ); @@ -2101,7 +2060,6 @@ BYTE ImpEditEngine::GetRightToLeft( USHORT nPara, USHORT nPos, USHORT* pStart, U if ( !pParaPortion->aWritingDirectionInfos.Count() ) InitWritingDirections( nPara ); -// BYTE nType = 0; WritingDirectionInfos& rDirInfos = pParaPortion->aWritingDirectionInfos; for ( USHORT n = 0; n < rDirInfos.Count(); n++ ) { @@ -2154,7 +2112,7 @@ SvxCellVerJustify ImpEditEngine::GetVerJustification( USHORT nPara ) const // ---------------------------------------------------------------------- -// Textaenderung +// Text changes // ---------------------------------------------------------------------- void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, USHORT nChars, EditUndoRemoveChars* pCurUndo ) @@ -2163,11 +2121,10 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, USHORT nChars, EditUndo { XubString aStr( rPaM.GetNode()->Copy( rPaM.GetIndex(), nChars ) ); - // Pruefen, ob Attribute geloescht oder geaendert werden: + // Check whether attributes are deleted or changed: USHORT nStart = rPaM.GetIndex(); USHORT nEnd = nStart + nChars; CharAttribArray& rAttribs = rPaM.GetNode()->GetCharAttribs().GetAttribs(); -// USHORT nAttrs = rAttribs.Count(); for ( USHORT nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = rAttribs[nAttr]; @@ -2198,8 +2155,8 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew { aOldPositions.Justify(); BOOL bValidAction = ( (long)nNewPos < aOldPositions.Min() ) || ( (long)nNewPos > aOldPositions.Max() ); - DBG_ASSERT( bValidAction, "Move in sich selbst ?" ); - DBG_ASSERT( aOldPositions.Max() <= (long)GetParaPortions().Count(), "Voll drueber weg: MoveParagraphs" ); + DBG_ASSERT( bValidAction, "Move in itself?" ); + DBG_ASSERT( aOldPositions.Max() <= (long)GetParaPortions().Count(), "totally over it: MoveParagraphs" ); EditSelection aSelection; @@ -2250,14 +2207,14 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew if ( IsUndoEnabled() && !IsInUndo()) InsertUndo( new EditUndoMoveParagraphs( this, aOldPositions, nNewPos ) ); - // Position nicht aus dem Auge verlieren! + // do not lose sight of the Position ! ParaPortion* pDestPortion = GetParaPortions().SaveGetObject( nNewPos ); ParaPortionList aTmpPortionList; USHORT i; for ( i = (USHORT)aOldPositions.Min(); i <= (USHORT)aOldPositions.Max(); i++ ) { - // Immer aOldPositions.Min(), da Remove(). + // always aOldPositions.Min(), since Remove(). ParaPortion* pTmpPortion = GetParaPortions().GetObject( (USHORT)aOldPositions.Min() ); GetParaPortions().Remove( (USHORT)aOldPositions.Min() ); aEditDoc.Remove( (USHORT)aOldPositions.Min() ); @@ -2265,7 +2222,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew } USHORT nRealNewPos = pDestPortion ? GetParaPortions().GetPos( pDestPortion ) : GetParaPortions().Count(); - DBG_ASSERT( nRealNewPos != USHRT_MAX, "ImpMoveParagraphs: Ungueltige Position!" ); + DBG_ASSERT( nRealNewPos != USHRT_MAX, "ImpMoveParagraphs: Invalid Position!" ); for ( i = 0; i < (USHORT)aTmpPortionList.Count(); i++ ) { @@ -2305,7 +2262,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew if ( pRecalc4 ) CalcHeight( pRecalc4 ); - aTmpPortionList.Remove( 0, aTmpPortionList.Count() ); // wichtig ! + aTmpPortionList.Remove( 0, aTmpPortionList.Count() ); // important ! #ifdef EDITDEBUG GetParaPortions().DbgCheck(aEditDoc); @@ -2316,9 +2273,9 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, BOOL bBackward ) { - DBG_ASSERT( pLeft != pRight, "Den gleichen Absatz zusammenfuegen ?" ); - DBG_ASSERT( aEditDoc.GetPos( pLeft ) != USHRT_MAX, "Einzufuegenden Node nicht gefunden(1)" ); - DBG_ASSERT( aEditDoc.GetPos( pRight ) != USHRT_MAX, "Einzufuegenden Node nicht gefunden(2)" ); + DBG_ASSERT( pLeft != pRight, "Join together the same paragraph ?" ); + DBG_ASSERT( aEditDoc.GetPos( pLeft ) != USHRT_MAX, "Inserted node not found (1)" ); + DBG_ASSERT( aEditDoc.GetPos( pRight ) != USHRT_MAX, "Inserted node not found (2)" ); USHORT nParagraphTobeDeleted = aEditDoc.GetPos( pRight ); DeletedNodeInfo* pInf = new DeletedNodeInfo( (ULONG)pRight, nParagraphTobeDeleted ); @@ -2345,11 +2302,11 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR ParaAttribsChanged( pLeft ); - // Erstmal Portions suchen, da pRight nach ConnectParagraphs weg. + // First search for Portions since pRight is gone after ConnectParagraphs. ParaPortion* pLeftPortion = FindParaPortion( pLeft ); ParaPortion* pRightPortion = FindParaPortion( pRight ); - DBG_ASSERT( pLeftPortion, "Blinde Portion in ImpConnectParagraphs(1)" ); - DBG_ASSERT( pRightPortion, "Blinde Portion in ImpConnectParagraphs(2)" ); + DBG_ASSERT( pLeftPortion, "Blind Portion in ImpConnectParagraphs(1)" ); + DBG_ASSERT( pRightPortion, "Blind Portion in ImpConnectParagraphs(2)" ); DBG_ASSERT( nParagraphTobeDeleted == GetParaPortions().GetPos( pRightPortion ), "NodePos != PortionPos?" ); #ifndef SVX_LIGHT @@ -2357,14 +2314,14 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR { xub_StrLen nEnd = pLeft->Len(); xub_StrLen nInv = nEnd ? nEnd-1 : nEnd; - pLeft->GetWrongList()->ClearWrongs( nInv, 0xFFFF, pLeft ); // Evtl. einen wegnehmen + pLeft->GetWrongList()->ClearWrongs( nInv, 0xFFFF, pLeft ); // Possibly remove one pLeft->GetWrongList()->MarkInvalid( nInv, nEnd+1 ); - // Falschgeschriebene Woerter ruebernehmen: + // Take over misspelled words USHORT nRWrongs = pRight->GetWrongList()->Count(); for ( USHORT nW = 0; nW < nRWrongs; nW++ ) { WrongRange aWrong = pRight->GetWrongList()->GetObject( nW ); - if ( aWrong.nStart != 0 ) // Nicht ein anschliessender + if ( aWrong.nStart != 0 ) // Not a subsequent { aWrong.nStart = aWrong.nStart + nEnd; aWrong.nEnd = aWrong.nEnd + nEnd; @@ -2383,13 +2340,12 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR pLeftPortion->MarkSelectionInvalid( aPaM.GetIndex(), pLeft->Len() ); - // der rechte Node wird von EditDoc::ConnectParagraphs() geloescht. - + // the right node is deleted by EditDoc:ConnectParagraphs(). if ( GetTextRanger() ) { - // Durch das zusammenfuegen wird der linke zwar neu formatiert, aber - // wenn sich dessen Hoehe nicht aendert bekommt die Formatierung die - // Aenderung der Gesaamthoehe des Textes zu spaet mit... + // By joining together the two, the left is although reformatted, + // however if its height does not change then the formatting receives + // the change of the total text hight too late... for ( USHORT n = nParagraphTobeDeleted; n < GetParaPortions().Count(); n++ ) { ParaPortion* pPP = GetParaPortions().GetObject( n ); @@ -2405,9 +2361,9 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, BYTE nMode, BYTE nDelMode ) { - DBG_ASSERT( !EditSelection( rSel ).DbgIsBuggy( aEditDoc ), "Index im Wald in DeleteLeftOrRight" ); + DBG_ASSERT( !EditSelection( rSel ).DbgIsBuggy( aEditDoc ), "Index out of range in DeleteLeftOrRight" ); - if ( rSel.HasRange() ) // dann nur Sel. loeschen + if ( rSel.HasRange() ) // only then Delete Selection return ImpDeleteSelection( rSel ); const EditPaM aCurPos( rSel.Max() ); @@ -2430,7 +2386,7 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, BYTE nMode, aDelStart.SetIndex( 0 ); if ( aDelStart == aCurPos ) { - // kompletter Absatz davor + // Complete paragraph previous ContentNode* pPrev = GetPrevVisNode( aCurPos.GetNode() ); if ( pPrev ) aDelStart = EditPaM( pPrev, 0 ); @@ -2466,7 +2422,7 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, BYTE nMode, aDelEnd.SetIndex( aCurPos.GetNode()->Len() ); if ( aDelEnd == aCurPos ) { - // kompletter Absatz dahinter + // Complete paragraph next ContentNode* pNext = GetNextVisNode( aCurPos.GetNode() ); if ( pNext ) aDelEnd = EditPaM( pNext, pNext->Len() ); @@ -2474,12 +2430,12 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, BYTE nMode, } } - // Bei DELMODE_RESTOFCONTENT reicht bei verschiedenen Nodes - // kein ConnectParagraphs. + // ConnectParagraphs not enoguh for different Nodes when + // DELMODE_RESTOFCONTENT. if ( ( nDelMode == DELMODE_RESTOFCONTENT ) || ( aDelStart.GetNode() == aDelEnd.GetNode() ) ) return ImpDeleteSelection( EditSelection( aDelStart, aDelEnd ) ); - // Jetzt entscheiden, ob noch Selektion loeschen (RESTOFCONTENTS) + // Decide now if to delete selection (RESTOFCONTENTS) BOOL bSpecialBackward = ( ( nMode == DEL_LEFT ) && ( nDelMode == DELMODE_SIMPLE ) ) ? TRUE : FALSE; if ( aStatus.IsAnyOutliner() ) @@ -2497,11 +2453,11 @@ EditPaM ImpEditEngine::ImpDeleteSelection( EditSelection aSel ) EditPaM aStartPaM( aSel.Min() ); EditPaM aEndPaM( aSel.Max() ); - CursorMoved( aStartPaM.GetNode() ); // nur damit neu eingestellte Attribute verschwinden... - CursorMoved( aEndPaM.GetNode() ); // nur damit neu eingestellte Attribute verschwinden... + CursorMoved( aStartPaM.GetNode() ); // only so that newly set Attributes dissapear... + CursorMoved( aEndPaM.GetNode() ); // only so that newly set Attributes dissapear... - DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index im Wald in ImpDeleteSelection" ); - DBG_ASSERT( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index im Wald in ImpDeleteSelection" ); + DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in ImpDeleteSelection" ); + DBG_ASSERT( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index out of range in ImpDeleteSelection" ); USHORT nStartNode = aEditDoc.GetPos( aStartPaM.GetNode() ); USHORT nEndNode = aEditDoc.GetPos( aEndPaM.GetNode() ); @@ -2509,31 +2465,31 @@ EditPaM ImpEditEngine::ImpDeleteSelection( EditSelection aSel ) DBG_ASSERT( nEndNode != USHRT_MAX, "Start > End ?!" ); DBG_ASSERT( nStartNode <= nEndNode, "Start > End ?!" ); - // Alle Nodes dazwischen entfernen.... + // Remove all nodes in between .... for ( ULONG z = nStartNode+1; z < nEndNode; z++ ) { - // Immer nStartNode+1, wegen Remove()! + // Always nStartNode+1, due to Remove()! ImpRemoveParagraph( nStartNode+1 ); } if ( aStartPaM.GetNode() != aEndPaM.GetNode() ) { - // Den Rest des StartNodes... + // The Rest of the StartNodes... USHORT nChars; nChars = aStartPaM.GetNode()->Len() - aStartPaM.GetIndex(); ImpRemoveChars( aStartPaM, nChars ); ParaPortion* pPortion = FindParaPortion( aStartPaM.GetNode() ); - DBG_ASSERT( pPortion, "Blinde Portion in ImpDeleteSelection(3)" ); + DBG_ASSERT( pPortion, "Blind Portion in ImpDeleteSelection(3)" ); pPortion->MarkSelectionInvalid( aStartPaM.GetIndex(), aStartPaM.GetNode()->Len() ); - // Den Anfang des EndNodes.... + // The beginning of the EndNodes.... nChars = aEndPaM.GetIndex(); aEndPaM.SetIndex( 0 ); ImpRemoveChars( aEndPaM, nChars ); pPortion = FindParaPortion( aEndPaM.GetNode() ); - DBG_ASSERT( pPortion, "Blinde Portion in ImpDeleteSelection(4)" ); + DBG_ASSERT( pPortion, "Blind Portion in ImpDeleteSelection(4)" ); pPortion->MarkSelectionInvalid( 0, aEndPaM.GetNode()->Len() ); - // Zusammenfuegen.... + // Join together.... aStartPaM = ImpConnectParagraphs( aStartPaM.GetNode(), aEndPaM.GetNode() ); } else @@ -2542,7 +2498,7 @@ EditPaM ImpEditEngine::ImpDeleteSelection( EditSelection aSel ) nChars = aEndPaM.GetIndex() - aStartPaM.GetIndex(); ImpRemoveChars( aStartPaM, nChars ); ParaPortion* pPortion = FindParaPortion( aStartPaM.GetNode() ); - DBG_ASSERT( pPortion, "Blinde Portion in ImpDeleteSelection(5)" ); + DBG_ASSERT( pPortion, "Blind Portion in ImpDeleteSelection(5)" ); pPortion->MarkInvalid( aEndPaM.GetIndex(), aStartPaM.GetIndex() - aEndPaM.GetIndex() ); } @@ -2557,13 +2513,13 @@ void ImpEditEngine::ImpRemoveParagraph( USHORT nPara ) ContentNode* pNextNode = aEditDoc.SaveGetObject( nPara+1 ); ParaPortion* pPortion = GetParaPortions().SaveGetObject( nPara ); - DBG_ASSERT( pNode, "Blinder Node in ImpRemoveParagraph" ); - DBG_ASSERT( pPortion, "Blinde Portion in ImpRemoveParagraph(2)" ); + DBG_ASSERT( pNode, "Blind Node in ImpRemoveParagraph" ); + DBG_ASSERT( pPortion, "Blind Portion in ImpRemoveParagraph(2)" ); DeletedNodeInfo* pInf = new DeletedNodeInfo( (ULONG)pNode, nPara ); aDeletedNodes.Insert( pInf, aDeletedNodes.Count() ); - // Der Node wird vom Undo verwaltet und ggf. zerstoert! + // The node is managed by the undo and possibly destroyed! /* delete */ aEditDoc.Remove( nPara ); GetParaPortions().Remove( nPara ); delete pPortion; @@ -2573,9 +2529,9 @@ void ImpEditEngine::ImpRemoveParagraph( USHORT nPara ) GetEditEnginePtr()->ParagraphDeleted( nPara ); } - // Im folgenden muss ggf. Extra-Space neu ermittelt werden. - // Bei ParaAttribsChanged wird leider der Absatz neu formatiert, - // aber diese Methode sollte nicht Zeitkritsch sein! + // Extra-Space may be determined again in the following. For + // ParaAttribsChanged the paragraph is unfortunately formatted again, + // however this method should not be time critical! if ( pNextNode ) ParaAttribsChanged( pNextNode ); @@ -2658,8 +2614,8 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, xub_Unicode c, EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, xub_Unicode c, BOOL bOverwrite, sal_Bool bIsUserInput ) { - DBG_ASSERT( c != '\t', "Tab bei InsertText ?" ); - DBG_ASSERT( c != '\n', "Zeilenumbruch bei InsertText ?" ); + DBG_ASSERT( c != '\t', "Tab for InsertText ?" ); + DBG_ASSERT( c != '\n', "Word wrapping for InsertText ")?; EditPaM aPaM( rCurSel.Min() ); @@ -2677,10 +2633,10 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, } else if ( bDoOverwrite ) { - // Wenn Selektion, dann nicht auch noch ein Zeichen ueberschreiben! + // If selected, then do not also overwrite a character! EditSelection aTmpSel( aPaM ); aTmpSel.Max().GetIndex()++; - DBG_ASSERT( !aTmpSel.DbgIsBuggy( aEditDoc ), "Overwrite: Fehlerhafte Selektion!" ); + DBG_ASSERT( !aTmpSel.DbgIsBuggy( aEditDoc ), "Overwrite: Wrong selection! "); ImpDeleteSelection( aTmpSel ); } @@ -2747,9 +2703,9 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, aEditDoc.InsertText( (const EditPaM&)aPaM, c ); ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() ); - DBG_ASSERT( pPortion, "Blinde Portion in InsertText" ); + DBG_ASSERT( pPortion, "Blind Portion in InsertText" ); pPortion->MarkInvalid( aPaM.GetIndex(), 1 ); - aPaM.GetIndex()++; // macht EditDoc-Methode nicht mehr + aPaM.GetIndex()++; // does not do EditDoc-Method anymore } TextModified(); @@ -2770,7 +2726,7 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS else aPaM = aCurSel.Max(); - EditPaM aCurPaM( aPaM ); // fuers Invalidieren + EditPaM aCurPaM( aPaM ); // for the Invalidate // get word boundaries in order to clear possible WrongList entries // and invalidate all the necessary text (everything after and including the @@ -2781,18 +2737,18 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS aText.ConvertLineEnd( LINEEND_LF ); SfxVoidItem aTabItem( EE_FEATURE_TAB ); - // Konvertiert nach LineSep = \n - // Token mit LINE_SEP abfragen, - // da der MAC-Compiler aus \n etwas anderes macht! + // Converts to linesep = \n + // Token LINE_SEP query, + // since the MAC-Compiler makes something else from \n ! USHORT nStart = 0; while ( nStart < aText.Len() ) { USHORT nEnd = aText.Search( LINE_SEP, nStart ); if ( nEnd == STRING_NOTFOUND ) - nEnd = aText.Len(); // nicht dereferenzieren! + nEnd = aText.Len(); // not dereference! - // Start == End => Leerzeile + // Start == End => empty line if ( nEnd > nStart ) { XubString aLine( aText, nStart, nEnd-nStart ); @@ -2800,8 +2756,8 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS if ( nChars > MAXCHARSINPARA ) { USHORT nMaxNewChars = MAXCHARSINPARA-aPaM.GetNode()->Len(); - nEnd -= ( aLine.Len() - nMaxNewChars ); // Dann landen die Zeichen im naechsten Absatz. - aLine.Erase( nMaxNewChars ); // Del Rest... + nEnd -= ( aLine.Len() - nMaxNewChars ); // Then the characters end up in the next paragraph. + aLine.Erase( nMaxNewChars ); // Delete the Rest... } #ifndef SVX_LIGHT if ( IsUndoEnabled() && !IsInUndo() ) @@ -2817,20 +2773,19 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS { USHORT nEnd2 = aLine.Search( '\t', nStart2 ); if ( nEnd2 == STRING_NOTFOUND ) - nEnd2 = aLine.Len(); // nicht dereferenzieren! + nEnd2 = aLine.Len(); // not dereference! if ( nEnd2 > nStart2 ) aPaM = aEditDoc.InsertText( aPaM, XubString( aLine, nStart2, nEnd2-nStart2 ) ); if ( nEnd2 < aLine.Len() ) { - // aPaM = ImpInsertFeature( EditSelection( aPaM, aPaM ), ); aPaM = aEditDoc.InsertFeature( aPaM, aTabItem ); } nStart2 = nEnd2+1; } } ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() ); - DBG_ASSERT( pPortion, "Blinde Portion in InsertText" ); + DBG_ASSERT( pPortion, "Blind Portion in InsertText" ); // now remove the Wrongs (red spell check marks) from both words... WrongList *pWrongs = aCurPaM.GetNode()->GetWrongList(); @@ -2853,9 +2808,9 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS EditPaM ImpEditEngine::ImpFastInsertText( EditPaM aPaM, const XubString& rStr ) { - DBG_ASSERT( rStr.Search( 0x0A ) == STRING_NOTFOUND, "FastInsertText: Zeilentrenner nicht erlaubt!" ); - DBG_ASSERT( rStr.Search( 0x0D ) == STRING_NOTFOUND, "FastInsertText: Zeilentrenner nicht erlaubt!" ); - DBG_ASSERT( rStr.Search( '\t' ) == STRING_NOTFOUND, "FastInsertText: Features nicht erlaubt!" ); + DBG_ASSERT( rStr.Search( 0x0A ) == STRING_NOTFOUND, "FastInsertText: Newline not allowed! "); + DBG_ASSERT( rStr.Search( 0x0D ) == STRING_NOTFOUND, "FastInsertText: Newline not allowed! "); + DBG_ASSERT( rStr.Search( '\t' ) == STRING_NOTFOUND, "FastInsertText: Newline not allowed! "); if ( ( aPaM.GetNode()->Len() + rStr.Len() ) < MAXCHARSINPARA ) { @@ -2893,7 +2848,7 @@ EditPaM ImpEditEngine::ImpInsertFeature( EditSelection aCurSel, const SfxPoolIte aPaM = aEditDoc.InsertFeature( aPaM, rItem ); ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() ); - DBG_ASSERT( pPortion, "Blinde Portion in InsertFeature" ); + DBG_ASSERT( pPortion, "Blind Portion in InsertFeature" ); pPortion->MarkInvalid( aPaM.GetIndex()-1, 1 ); TextModified(); @@ -2934,12 +2889,13 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, BOOL bKeepEnding aPaM.GetNode()->CreateWrongList(); WrongList* pLWrongs = rPaM.GetNode()->GetWrongList(); WrongList* pRWrongs = aPaM.GetNode()->GetWrongList(); - // Falschgeschriebene Woerter ruebernehmen: + // take over misspelled words: USHORT nLWrongs = pLWrongs->Count(); for ( USHORT nW = 0; nW < nLWrongs; nW++ ) { WrongRange& rWrong = pLWrongs->GetObject( nW ); - // Nur wenn wirklich dahinter, ein ueberlappendes wird beim Spell korrigiert + // Correct only if really a word gets overlapped in the process of + // Spell checking if ( rWrong.nStart > nEnd ) { pRWrongs->InsertWrong( rWrong, pRWrongs->Count() ); @@ -2955,18 +2911,18 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, BOOL bKeepEnding pLWrongs->MarkInvalid( nInv, nEnd ); else pLWrongs->SetValid(); - pRWrongs->SetValid(); // sonst 0 - 0xFFFF - pRWrongs->MarkInvalid( 0, 1 ); // Nur das erste Wort testen + pRWrongs->SetValid(); // otherwise 0 - 0xFFFF + pRWrongs->MarkInvalid( 0, 1 ); // Only test the first word } #endif // !SVX_LIGHT ParaPortion* pPortion = FindParaPortion( rPaM.GetNode() ); - DBG_ASSERT( pPortion, "Blinde Portion in ImpInsertParaBreak" ); + DBG_ASSERT( pPortion, "Blind Portion in ImpInsertParaBreak" ); pPortion->MarkInvalid( rPaM.GetIndex(), 0 ); - // Optimieren: Nicht unnoetig viele GetPos auf die Listen ansetzen! - // Hier z.B. bei Undo, aber auch in allen anderen Methoden. + // Optimization: Do not place unnecessarily many getPos to Listen! + // Here, as in undo, but also in all other methods. USHORT nPos = GetParaPortions().GetPos( pPortion ); ParaPortion* pNewPortion = new ParaPortion( aPaM.GetNode() ); GetParaPortions().Insert( pNewPortion, nPos + 1 ); @@ -2974,7 +2930,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, BOOL bKeepEnding if ( IsCallParaInsertedOrDeleted() ) GetEditEnginePtr()->ParagraphInserted( nPos+1 ); - CursorMoved( rPaM.GetNode() ); // falls leeres Attribut entstanden. + CursorMoved( rPaM.GetNode() ); // if empty Attributes have emerged. TextModified(); return aPaM; } @@ -2986,7 +2942,7 @@ EditPaM ImpEditEngine::ImpFastInsertParagraph( USHORT nPara ) { if ( nPara ) { - DBG_ASSERT( aEditDoc.SaveGetObject( nPara-1 ), "FastInsertParagraph: Prev existiert nicht" ); + DBG_ASSERT( aEditDoc.SaveGetObject( nPara-1 ), "FastInsertParagraph: Prev does not exist" ); InsertUndo( new EditUndoSplitPara( this, nPara-1, aEditDoc.GetObject( nPara-1 )->Len() ) ); } else @@ -2995,7 +2951,7 @@ EditPaM ImpEditEngine::ImpFastInsertParagraph( USHORT nPara ) #endif ContentNode* pNode = new ContentNode( aEditDoc.GetItemPool() ); - // Falls FlatMode, wird spaeter kein Font eingestellt: + // If flat mode, then later no Font is set: pNode->GetCharAttribs().GetDefFont() = aEditDoc.GetDefFont(); #ifndef SVX_LIGHT @@ -3019,7 +2975,7 @@ EditPaM ImpEditEngine::InsertParaBreak( EditSelection aCurSel ) if ( aStatus.DoAutoIndenting() ) { USHORT nPara = aEditDoc.GetPos( aPaM.GetNode() ); - DBG_ASSERT( nPara > 0, "AutoIndenting: Fehler!" ); + DBG_ASSERT( nPara > 0, "AutoIndenting: Error!" ); XubString aPrevParaText( GetEditDoc().GetParaAsString( nPara-1 ) ); USHORT n = 0; while ( ( n < aPrevParaText.Len() ) && @@ -3056,9 +3012,8 @@ BOOL ImpEditEngine::UpdateFields() { BOOL bChangesInPara = FALSE; ContentNode* pNode = GetEditDoc().GetObject( nPara ); - DBG_ASSERT( pNode, "NULL-Pointer im Doc" ); + DBG_ASSERT( pNode, "NULL-Pointer in Doc" ); CharAttribArray& rAttribs = pNode->GetCharAttribs().GetAttribs(); -// USHORT nAttrs = rAttribs.Count(); for ( USHORT nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = rAttribs[nAttr]; @@ -3086,9 +3041,9 @@ BOOL ImpEditEngine::UpdateFields() } if ( bChangesInPara ) { - // ggf. etwas genauer invalidieren. + // If possible be more precise when invalidate. ParaPortion* pPortion = GetParaPortions().GetObject( nPara ); - DBG_ASSERT( pPortion, "NULL-Pointer im Doc" ); + DBG_ASSERT( pPortion, "NULL-Pointer in Doc" ); pPortion->MarkSelectionInvalid( 0, pNode->Len() ); } } @@ -3102,11 +3057,11 @@ EditPaM ImpEditEngine::InsertLineBreak( EditSelection aCurSel ) } // ---------------------------------------------------------------------- -// Hilfsfunktionen +// Helper functions // ---------------------------------------------------------------------- Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, USHORT nFlags ) { - DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: PaMtoEditCursor" ); + DBG_ASSERT( GetUpdateMode(), "Must not be reached when Update=FALSE: PaMtoEditCursor" ); Rectangle aEditCursor; long nY = 0; @@ -3114,7 +3069,7 @@ Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, USHORT nFlags ) { ParaPortion* pPortion = GetParaPortions().GetObject(nPortion); ContentNode* pNode = pPortion->GetNode(); - DBG_ASSERT( pNode, "Ungueltiger Node in Portion!" ); + DBG_ASSERT( pNode, "Invalid Node in Portion!" ); if ( pNode != aPaM.GetNode() ) { nY += pPortion->GetHeight(); @@ -3127,13 +3082,13 @@ Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, USHORT nFlags ) return aEditCursor; } } - DBG_ERROR( "Portion nicht gefunden!" ); + DBG_ERROR( "Portion not found!" ); return aEditCursor; } EditPaM ImpEditEngine::GetPaM( Point aDocPos, BOOL bSmart ) { - DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: GetPaM" ); + DBG_ASSERT( GetUpdateMode(), "Must not be reached when Update=FALSE: GetPaM" ); long nY = 0; long nTmpHeight; @@ -3142,30 +3097,30 @@ EditPaM ImpEditEngine::GetPaM( Point aDocPos, BOOL bSmart ) for ( nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) { ParaPortion* pPortion = GetParaPortions().GetObject(nPortion); - nTmpHeight = pPortion->GetHeight(); // sollte auch bei !bVisible richtig sein! + nTmpHeight = pPortion->GetHeight(); // should also be correct for !bVisible! nY += nTmpHeight; if ( nY > aDocPos.Y() ) { nY -= nTmpHeight; aDocPos.Y() -= nY; - // unsichtbare Portions ueberspringen: + // Skip invisible Portions: while ( pPortion && !pPortion->IsVisible() ) { nPortion++; pPortion = GetParaPortions().SaveGetObject( nPortion ); } - DBG_ASSERT( pPortion, "Keinen sichtbaren Absatz gefunden: GetPaM" ); + DBG_ASSERT( pPortion, "No visible paragraph found: GetPaM" ); aPaM = GetPaM( pPortion, aDocPos, bSmart ); return aPaM; } } - // Dann den letzten sichtbaren Suchen: + // Then search for the last visible: nPortion = GetParaPortions().Count()-1; while ( nPortion && !GetParaPortions()[nPortion]->IsVisible() ) nPortion--; - DBG_ASSERT( GetParaPortions()[nPortion]->IsVisible(), "Keinen sichtbaren Absatz gefunden: GetPaM" ); + DBG_ASSERT( GetParaPortions()[nPortion]->IsVisible(), "No visible paragraph found: GetPaM" ); aPaM.SetNode( GetParaPortions()[nPortion]->GetNode() ); aPaM.SetIndex( GetParaPortions()[nPortion]->GetNode()->Len() ); return aPaM; @@ -3173,15 +3128,15 @@ EditPaM ImpEditEngine::GetPaM( Point aDocPos, BOOL bSmart ) sal_uInt32 ImpEditEngine::GetTextHeight() const { - DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" ); - DBG_ASSERT( IsFormatted() || IsFormatting(), "GetTextHeight: Nicht formatiert" ); + DBG_ASSERT( GetUpdateMode(), "Should not be used for Update=FALSE: GetTextHeight" ); + DBG_ASSERT( IsFormatted() || IsFormatting(), "GetTextHeight: Not formatted" ); return nCurTextHeight; } sal_uInt32 ImpEditEngine::CalcTextWidth( BOOL bIgnoreExtraSpace ) { - // Wenn noch nicht formatiert und nicht gerade dabei. - // Wird in der Formatierung bei AutoPageSize gerufen. + // If still not formatted and not in the process. + // Will be brought in the formatting for AutoPageSize. if ( !IsFormatted() && !IsFormatting() ) FormatDoc(); @@ -3191,11 +3146,9 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( BOOL bIgnoreExtraSpace ) long nCurWidth = 0; // -------------------------------------------------- - // Ueber alle Absaetze... + // Over all the paragraphs ... // -------------------------------------------------- USHORT nParas = GetParaPortions().Count(); -// USHORT nBiggestPara = 0; -// USHORT nBiggestLine = 0; for ( USHORT nPara = 0; nPara < nParas; nPara++ ) { ParaPortion* pPortion = GetParaPortions().GetObject( nPara ); @@ -3205,18 +3158,18 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( BOOL bIgnoreExtraSpace ) sal_Int32 nSpaceBeforeAndMinLabelWidth = GetSpaceBeforeAndMinLabelWidth( pPortion->GetNode() ); // -------------------------------------------------- - // Ueber die Zeilen des Absatzes... + // On the lines of the paragraph ... // -------------------------------------------------- ULONG nLines = pPortion->GetLines().Count(); for ( USHORT nLine = 0; nLine < nLines; nLine++ ) { pLine = pPortion->GetLines().GetObject( nLine ); - DBG_ASSERT( pLine, "NULL-Pointer im Zeileniterator in CalcWidth" ); + DBG_ASSERT( pLine, "NULL-Pointer in the line iterator in CalcWidth" ); // nCurWidth = pLine->GetStartPosX(); - // Bei Center oder Right haengt die breite von der - // Papierbreite ab, hier nicht erwuenscht. - // Am besten generell nicht auf StartPosX verlassen, - // es muss auch die rechte Einrueckung beruecksichtigt werden! + // For Center- or Right- alignment it depends on the paper + // width, here not prefered. I general, it is best not leave it + // to StartPosX, also the right indents have to be taken into + // account! nCurWidth = GetXValue( rLRItem.GetTxtLeft() + nSpaceBeforeAndMinLabelWidth ); if ( nLine == 0 ) { @@ -3241,7 +3194,7 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( BOOL bIgnoreExtraSpace ) if ( nMaxWidth < 0 ) nMaxWidth = 0; - nMaxWidth++; // Ein breiter, da in CreateLines bei >= umgebrochen wird. + nMaxWidth++; // widen it, because in CreateLines for >= is wrapped. return (sal_uInt32)nMaxWidth; } @@ -3257,7 +3210,7 @@ sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, SvxAdjust eJustification = GetJustification( nPara ); - // Berechnung der Breite ohne die Indents... + // Calculation of the width without the Indents ... sal_uInt32 nWidth = 0; USHORT nPos = pLine->GetStart(); for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) @@ -3299,7 +3252,7 @@ sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, sal_uInt32 ImpEditEngine::CalcTextHeight() { - DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: CalcTextHeight" ); + DBG_ASSERT( GetUpdateMode(), "Should not be used when Update=FALSE: CalcTextHeight" ); sal_uInt32 nY = 0; for ( USHORT nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) nY += GetParaPortions()[nPortion]->GetHeight(); @@ -3310,7 +3263,7 @@ USHORT ImpEditEngine::GetLineCount( USHORT nParagraph ) const { DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" ); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); - DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineCount" ); + DBG_ASSERT( pPPortion, "Paragraph not found: GetLineCount" ); if ( pPPortion ) return pPPortion->GetLines().Count(); @@ -3321,11 +3274,11 @@ xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const { DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineLen: Out of range" ); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); - DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineLen" ); + DBG_ASSERT( pPPortion, "Paragraph not found: GetLineLen" ); if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) ) { EditLine* pLine = pPPortion->GetLines().GetObject( nLine ); - DBG_ASSERT( pLine, "Zeile nicht gefunden: GetLineHeight" ); + DBG_ASSERT( pLine, "Line not found: GetLineHeight" ); return pLine->GetLen(); } @@ -3336,12 +3289,12 @@ void ImpEditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEn { DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" ); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); - DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineBoundaries" ); + DBG_ASSERT( pPPortion, "Paragraph not found: GetLineBoundaries" ); rStart = rEnd = 0xFFFF; // default values in case of error if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) ) { EditLine* pLine = pPPortion->GetLines().GetObject( nLine ); - DBG_ASSERT( pLine, "Zeile nicht gefunden: GetLineBoundaries" ); + DBG_ASSERT( pLine, "Line not found: GetLineBoundaries" ); rStart = pLine->GetStart(); rEnd = pLine->GetEnd(); } @@ -3378,11 +3331,11 @@ USHORT ImpEditEngine::GetLineHeight( USHORT nParagraph, USHORT nLine ) { DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" ); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); - DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetLineHeight" ); + DBG_ASSERT( pPPortion, "Paragraph not found: GetLineHeight" ); if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) ) { EditLine* pLine = pPPortion->GetLines().GetObject( nLine ); - DBG_ASSERT( pLine, "Zeile nicht gefunden: GetLineHeight" ); + DBG_ASSERT( pLine, "Paragraph not found: GetLineHeight" ); return pLine->GetHeight(); } @@ -3394,7 +3347,7 @@ sal_uInt32 ImpEditEngine::GetParaHeight( USHORT nParagraph ) sal_uInt32 nHeight = 0; ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); - DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetParaHeight" ); + DBG_ASSERT( pPPortion, "Paragraph not found: GetParaHeight" ); if ( pPPortion ) nHeight = pPPortion->GetHeight(); @@ -3406,8 +3359,8 @@ void ImpEditEngine::UpdateSelections() { USHORT nInvNodes = aDeletedNodes.Count(); - // Pruefen, ob eine der Selektionen auf einem geloeschten Node steht... - // Wenn der Node gueltig ist, muss noch der Index geprueft werden! + // Check whether one of the selections is at a deleted node... + // If the node is valid, the index has yet to be examined! for ( USHORT nView = 0; nView < aEditViews.Count(); nView++ ) { EditView* pView = aEditViews.GetObject(nView); @@ -3420,39 +3373,39 @@ void ImpEditEngine::UpdateSelections() if ( ( ( ULONG )(aCurSel.Min().GetNode()) == pInf->GetInvalidAdress() ) || ( ( ULONG )(aCurSel.Max().GetNode()) == pInf->GetInvalidAdress() ) ) { - // ParaPortions verwenden, da jetzt auch versteckte - // Absaetze beruecksichtigt werden muessen! + // Use ParaPortions, as now also hidden paragraphs have to be + // taken into account! USHORT nPara = pInf->GetPosition(); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nPara ); - if ( !pPPortion ) // letzter Absatz + if ( !pPPortion ) // Last paragraph { nPara = GetParaPortions().Count()-1; pPPortion = GetParaPortions().GetObject( nPara ); } - DBG_ASSERT( pPPortion, "Leeres Document in UpdateSelections ?" ); - // Nicht aus einem verstecktem Absatz landen: + DBG_ASSERT( pPPortion, "Empty Document in UpdateSelections ?" ); + // Do not end up from a hidden paragraph: USHORT nCurPara = nPara; USHORT nLastPara = GetParaPortions().Count()-1; while ( nPara <= nLastPara && !GetParaPortions()[nPara]->IsVisible() ) nPara++; - if ( nPara > nLastPara ) // dann eben rueckwaerts... + if ( nPara > nLastPara ) // then also backwards ... { nPara = nCurPara; while ( nPara && !GetParaPortions()[nPara]->IsVisible() ) nPara--; } - DBG_ASSERT( GetParaPortions()[nPara]->IsVisible(), "Keinen sichtbaren Absatz gefunden: UpdateSelections" ); + DBG_ASSERT( GetParaPortions()[nPara]->IsVisible(), "No visible paragraph found: UpdateSelections" ); ParaPortion* pParaPortion = GetParaPortions()[nPara]; EditSelection aTmpSelection( EditPaM( pParaPortion->GetNode(), 0 ) ); pView->pImpEditView->SetEditSelection( aTmpSelection ); bChanged=TRUE; - break; // for-Schleife + break; // for loop } } if ( !bChanged ) { - // Index prueffen, falls Node geschrumpft. + // Check Index if node shrunk. if ( aCurSel.Min().GetIndex() > aCurSel.Min().GetNode()->Len() ) { aCurSel.Min().GetIndex() = aCurSel.Min().GetNode()->Len(); @@ -3466,7 +3419,7 @@ void ImpEditEngine::UpdateSelections() } } - // Loeschen... + // Delete ... for ( USHORT n = 0; n < nInvNodes; n++ ) { DeletedNodeInfo* pInf = aDeletedNodes.GetObject( n ); @@ -3533,9 +3486,9 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) USHORT nNode = aEditDoc.GetPos( pNode ); if ( ( nMatchChar % 2 ) == 0 ) { - // Vorwaerts suchen... + // Search forward... xub_Unicode nSC = aGroupChars.GetChar( nMatchChar ); - DBG_ASSERT( aGroupChars.Len() > (nMatchChar+1), "Ungueltige Gruppe von MatchChars!" ); + DBG_ASSERT( aGroupChars.Len() > (nMatchChar+1), "Invalid group of MatchChars!" ); xub_Unicode nEC = aGroupChars.GetChar( nMatchChar+1 ); USHORT nCur = aTmpSel.Min().GetIndex()+1; @@ -3563,7 +3516,7 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) nCur = 0; } } - if ( nLevel == 0 ) // gefunden + if ( nLevel == 0 ) // found { aMatchSel.Min() = aTmpSel.Min(); aMatchSel.Max() = EditPaM( pNode, nCur+1 ); @@ -3571,7 +3524,7 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) } else { - // Rueckwaerts suchen... + // Search backwards... xub_Unicode nEC = aGroupChars.GetChar( nMatchChar ); xub_Unicode nSC = aGroupChars.GetChar( nMatchChar-1 ); @@ -3601,14 +3554,14 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) { pNode = nNode ? aEditDoc.GetObject( --nNode ) : 0; if ( pNode ) - nCur = pNode->Len()-1; // egal ob negativ, weil if Len() + nCur = pNode->Len()-1; // no matter if negative, because if Len () } } - if ( nLevel == 0 ) // gefunden + if ( nLevel == 0 ) // found { aMatchSel.Min() = aTmpSel.Min(); - aMatchSel.Min().GetIndex()++; // hinter das Zeichen + aMatchSel.Min().GetIndex()++; // after the character aMatchSel.Max() = EditPaM( pNode, nCur ); } } @@ -3620,7 +3573,7 @@ void ImpEditEngine::StopSelectionMode() { if ( ( IsInSelectionMode() || aSelEngine.IsInSelection() ) && pActiveView ) { - pActiveView->pImpEditView->DrawSelection(); // Wegzeichnen... + pActiveView->pImpEditView->DrawSelection(); EditSelection aSel( pActiveView->pImpEditView->GetEditSelection() ); aSel.Min() = aSel.Max(); pActiveView->pImpEditView->SetEditSelection( aSel ); @@ -3633,18 +3586,11 @@ void ImpEditEngine::StopSelectionMode() void ImpEditEngine::SetActiveView( EditView* pView ) { // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // Eigentlich waere jetzt ein bHasVisSel und HideSelection notwendig !!! + // Actually, now bHasVisSel and HideSelection would be necessary !!! if ( pView == pActiveView ) - return; - - if ( pActiveView && pActiveView->HasSelection() ) - pActiveView->pImpEditView->DrawSelection(); // Wegzeichnen... - - pActiveView = pView; - if ( pActiveView && pActiveView->HasSelection() ) - pActiveView->pImpEditView->DrawSelection(); // Wegzeichnen... + pActiveView->pImpEditView->DrawSelection(); // NN: Quick fix for #78668#: // When editing of a cell in Calc is ended, the edit engine is not deleted, @@ -3672,7 +3618,7 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable( xDataObj = pDataObj; XubString aText( GetSelected( aSelection ) ); - aText.ConvertLineEnd(); // Systemspezifisch + aText.ConvertLineEnd(); // System specific pDataObj->GetString() = aText; SvxFontItem::EnableStoreUnicodeNames( TRUE ); @@ -3743,21 +3689,6 @@ EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransfer if ( !bDone ) { - // Bookmark - /* - String aURL = ...; - String aTxt = ...; - // Feld nur einfuegen, wenn Factory vorhanden. - if ( ITEMDATA() && ITEMDATA()->GetClassManager().Get( SVX_URLFIELD ) ) - { - SvxFieldItem aField( SvxURLField( aURL, aTxt, SVXURLFORMAT_URL ), EE_FEATURE_FIELD ); - aNewSelection = InsertField( aPaM, aField ); - UpdateFields(); - } - else - aNewSelection = ImpInsertText( aPaM, aURL ); - } - */ } if ( !bDone ) { @@ -3822,7 +3753,7 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) USHORT nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; - // erst von vorne... + // only from the top ... USHORT nFirstInvalid = 0xFFFF; USHORT nLine; for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) @@ -3833,17 +3764,17 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) nFirstInvalid = nLine; break; } - if ( nLine && !aStatus.IsOutliner() ) // nicht die erste Zeile + if ( nLine && !aStatus.IsOutliner() ) // not the first line aRange.Min() += nSBL; aRange.Min() += pL->GetHeight(); } - DBG_ASSERT( nFirstInvalid != 0xFFFF, "Keine ungueltige Zeile gefunden in GetInvalidYOffset(1)" ); + DBG_ASSERT( nFirstInvalid != 0xFFFF, "No invalid line found in GetInvalidYOffset(1)" ); - // Abgleichen und weiter... + // Syndicate and more ... aRange.Max() = aRange.Min(); aRange.Max() += pPortion->GetFirstLineOffset(); - if ( nFirstInvalid != 0 ) // Nur wenn nicht die erste Zeile ungueltig + if ( nFirstInvalid != 0 ) // Only if the first line is invalid aRange.Min() = aRange.Max(); USHORT nLastInvalid = pPortion->GetLines().Count()-1; @@ -3861,7 +3792,6 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) aRange.Max() += pL->GetHeight(); } - // MT 07/00 SBL kann jetzt kleiner 100% sein => ggf. die Zeile davor neu ausgeben. if( ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) && rLSItem.GetPropLineSpace() && ( rLSItem.GetPropLineSpace() < 100 ) ) { @@ -3880,8 +3810,8 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, BOOL bSmart ) { - DBG_ASSERT( pPortion->IsVisible(), "Wozu GetPaM() bei einem unsichtbaren Absatz?" ); - DBG_ASSERT( IsFormatted(), "GetPaM: Nicht formatiert" ); + DBG_ASSERT( pPortion->IsVisible(), "Why GetPaM() for an invisible paragraph?" ); + DBG_ASSERT( IsFormatted(), "GetPaM: Not formatted" ); USHORT nCurIndex = 0; EditPaM aPaM; @@ -3893,7 +3823,7 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, BOOL bSmart long nY = pPortion->GetFirstLineOffset(); - DBG_ASSERT( pPortion->GetLines().Count(), "Leere ParaPortion in GetPaM!" ); + DBG_ASSERT( pPortion->GetLines().Count(), "Empty ParaPortion in GetPaM!" ); EditLine* pLine = 0; for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) @@ -3902,26 +3832,26 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, BOOL bSmart nY += pTmpLine->GetHeight(); if ( !aStatus.IsOutliner() ) nY += nSBL; - if ( nY > aDocPos.Y() ) // das war 'se + if ( nY > aDocPos.Y() ) { pLine = pTmpLine; - break; // richtige Y-Position intressiert nicht + break; // correct Y-position is not of interest } nCurIndex = nCurIndex + pTmpLine->GetLen(); } - if ( !pLine ) // darf nur im Bereich von SA passieren! + if ( !pLine ) // may happen only in the range of SA! { #ifdef DBG_UTIL const SvxULSpaceItem& rULSpace =(const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); - DBG_ASSERT( nY+GetYValue( rULSpace.GetLower() ) >= aDocPos.Y() , "Index in keiner Zeile, GetPaM ?" ); + DBG_ASSERT( nY+GetYValue( rULSpace.GetLower() ) >= aDocPos.Y() , "Index in no line, GetPaM ?" ); #endif aPaM.SetIndex( pPortion->GetNode()->Len() ); return aPaM; } - // Wenn Zeile gefunden, nur noch X-Position => Index + // If no line found, only just X-Position => Index nCurIndex = GetChar( pPortion, pLine, aDocPos.X(), bSmart ); aPaM.SetIndex( nCurIndex ); @@ -3936,7 +3866,7 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, BOOL bSmart USHORT ImpEditEngine::GetChar( ParaPortion* pParaPortion, EditLine* pLine, long nXPos, BOOL bSmart ) { - DBG_ASSERT( pLine, "Keine Zeile erhalten: GetChar" ); + DBG_ASSERT( pLine, "No line received: GetChar" ); USHORT nChar = 0xFFFF; USHORT nCurIndex = pLine->GetStart(); @@ -3982,12 +3912,12 @@ USHORT ImpEditEngine::GetChar( ParaPortion* pParaPortion, EditLine* pLine, long long nTmpPosMax = pLine->GetCharPosArray().GetObject( nTmpCurIndex+x ); if ( nTmpPosMax > nXInPortion ) { - // pruefen, ob dieser oder der davor... + // Check whether this or the previous... long nTmpPosMin = x ? pLine->GetCharPosArray().GetObject( nTmpCurIndex+x-1 ) : 0; long nDiffLeft = nXInPortion - nTmpPosMin; long nDiffRight = nTmpPosMax - nXInPortion; - DBG_ASSERT( nDiffLeft >= 0, "DiffLeft negativ" ); - DBG_ASSERT( nDiffRight >= 0, "DiffRight negativ" ); + DBG_ASSERT( nDiffLeft >= 0, "DiffLeft negative" ); + DBG_ASSERT( nDiffRight >= 0, "DiffRight negative" ); nOffset = ( bSmart && ( nDiffRight < nDiffLeft ) ) ? x+1 : x; // I18N: If there are character position with the length of 0, // they belong to the same character, we can not use this position as an index. @@ -4002,9 +3932,9 @@ USHORT ImpEditEngine::GetChar( ParaPortion* pParaPortion, EditLine* pLine, long } } - // Bei Verwendung des CharPosArray duerfte es keine Ungenauigkeiten geben! - // Vielleicht bei Kerning ? - // 0xFFF passiert z.B. bei Outline-Font, wenn ganz hinten. + // There should not be any inaccuracies when using the + // CharPosArray! Maybe for kerning? + // 0xFFF happens for example for Outline-Font when at the very end. if ( nOffset == 0xFFFF ) nOffset = nMax; @@ -4077,7 +4007,6 @@ long ImpEditEngine::GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLin case PORTIONKIND_TEXT: case PORTIONKIND_HYPHENATOR: case PORTIONKIND_TAB: -// case PORTIONKIND_EXTRASPACE: { nX += pPortion->GetSize().Width(); } @@ -4118,7 +4047,7 @@ long ImpEditEngine::GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLin } else if ( bR2LPara && !pDestPortion->IsRightToLeft() ) { - // Portions behind must be ermoved, visual behind this portion + // Portions behind must be removed, visual behind this portion sal_uInt16 nTmpPortion = nTextPortion+1; while ( nTmpPortion <= pLine->GetEndPortion() ) { @@ -4156,8 +4085,8 @@ long ImpEditEngine::GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLin long ImpEditEngine::GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT nIndex, BOOL bPreferPortionStart ) { - DBG_ASSERT( pLine, "Keine Zeile erhalten: GetXPos" ); - DBG_ASSERT( ( nIndex >= pLine->GetStart() ) && ( nIndex <= pLine->GetEnd() ) , "GetXPos muss richtig gerufen werden!" ); + DBG_ASSERT( pLine, "No line received: GetXPos" ); + DBG_ASSERT( ( nIndex >= pLine->GetStart() ) && ( nIndex <= pLine->GetEnd() ) , "GetXPos has to be called properly!" ); BOOL bDoPreferPortionStart = bPreferPortionStart; // Assure that the portion belongs to this line: @@ -4194,8 +4123,6 @@ long ImpEditEngine::GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT TextPortion* pNextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion+1 ); if ( pNextPortion->GetKind() != PORTIONKIND_TAB ) { - // DBG_ASSERT( !bPreferPortionStart, "GetXPos - How can we this tab portion here???" ); - // #109879# We loop if nIndex == pLine->GetEnd, because bPreferPortionStart will be reset if ( !bPreferPortionStart ) nX = GetXPos( pParaPortion, pLine, nIndex, TRUE ); else if ( !IsRightToLeft( GetEditDoc().GetPos( pParaPortion->GetNode() ) ) ) @@ -4293,7 +4220,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) if ( pPortion->IsVisible() ) { - DBG_ASSERT( pPortion->GetLines().Count(), "Absatz ohne Zeilen in ParaPortion::CalcHeight" ); + DBG_ASSERT( pPortion->GetLines().Count(), "Paragraph with no lines in ParaPortion::CalcHeight" ); for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) pPortion->nHeight += pPortion->GetLines().GetObject( nLine )->GetHeight(); @@ -4321,7 +4248,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) if ( ( nPortion != (GetParaPortions().Count()-1) ) ) { - pPortion->nHeight += GetYValue( rULItem.GetLower() ); // nicht in letzter + pPortion->nHeight += GetYValue( rULItem.GetLower() ); // not in the last } @@ -4331,48 +4258,47 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) const SvxULSpaceItem& rPrevULItem = (const SvxULSpaceItem&)pPrev->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); const SvxLineSpacingItem& rPrevLSItem = (const SvxLineSpacingItem&)pPrev->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); - // Verhalten WinWord6/Writer3: - // Bei einem proportionalen Zeilenabstand wird auch der Absatzabstand - // manipuliert. - // Nur Writer3: Nicht aufaddieren, sondern Mindestabstand. + // In realation between WinWord6/Writer3: + // With a proportional line spacing the paragraph spacing is + // also manipulated. + // Only Writer3: Do not add up, but minimum distance. - // Pruefen, ob Abstand durch LineSpacing > Upper: + // check if distance by LineSpacing > Upper: USHORT nExtraSpace = GetYValue( lcl_CalcExtraSpace( pPortion, rLSItem ) ); if ( nExtraSpace > pPortion->nFirstLineOffset ) { - // Absatz wird 'groesser': + // Paragraph becomes 'bigger': pPortion->nHeight += ( nExtraSpace - pPortion->nFirstLineOffset ); pPortion->nFirstLineOffset = nExtraSpace; } - // nFirstLineOffset jetzt f(pNode) => jetzt f(pNode, pPrev) ermitteln: + // Determine nFirstLineOffset now f(pNode) => now f(pNode, pPrev): USHORT nPrevLower = GetYValue( rPrevULItem.GetLower() ); - // Dieser PrevLower steckt noch in der Hoehe der PrevPortion... + // This PrevLower is still in the height of PrevPortion ... if ( nPrevLower > pPortion->nFirstLineOffset ) { - // Absatz wird 'kleiner': + // Paragraph is 'small': pPortion->nHeight -= pPortion->nFirstLineOffset; pPortion->nFirstLineOffset = 0; } else if ( nPrevLower ) { - // Absatz wird 'etwas kleiner': + // Paragraph becomes 'somewhat smaller': pPortion->nHeight -= nPrevLower; pPortion->nFirstLineOffset = pPortion->nFirstLineOffset - nPrevLower; } - - // Finde ich zwar nicht so gut, aber Writer3-Feature: - // Pruefen, ob Abstand durch LineSpacing > Lower: - // Dieser Wert steckt nicht in der Hoehe der PrevPortion. + // I find it not so good, but Writer3 feature: + // Check if distance by LineSpacing > Lower: this value is not + // stuck in the height of PrevPortion. if ( !pPrev->IsInvalid() ) { nExtraSpace = GetYValue( lcl_CalcExtraSpace( pPrev, rPrevLSItem ) ); if ( nExtraSpace > nPrevLower ) { USHORT nMoreLower = nExtraSpace - nPrevLower; - // Absatz wird 'groesser', 'waechst' nach unten: + // Paragraph becomes 'bigger', 'grows' downwards: if ( nMoreLower > pPortion->nFirstLineOffset ) { pPortion->nHeight += ( nMoreLower - pPortion->nFirstLineOffset ); @@ -4387,14 +4313,14 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, USHORT nIndex, USHORT nFlags ) { - DBG_ASSERT( pPortion->IsVisible(), "Wozu GetEditCursor() bei einem unsichtbaren Absatz?" ); - DBG_ASSERT( IsFormatted() || GetTextRanger(), "GetEditCursor: Nicht formatiert" ); + DBG_ASSERT( pPortion->IsVisible(), "Why GetEditCursor() for an invisible paragraph?" ); + DBG_ASSERT( IsFormatted() || GetTextRanger(), "GetEditCursor: Not formatted" ); /* - GETCRSR_ENDOFLINE: Wenn hinter dem letzten Zeichen einer umgebrochenen Zeile, - am Ende der Zeile bleiben, nicht am Anfang der naechsten. - Zweck: - END => wirklich hinter das letzte Zeichen - - Selektion.... + GETCRSR_ENDOFLINE: If after the last character of a wrapped line, remaining + at the end of the line, not the beginning of the next one. + Purpose: - END => really after the last character + - Selection.... */ long nY = pPortion->GetFirstLineOffset(); @@ -4404,7 +4330,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, USHORT nIndex, US ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; USHORT nCurIndex = 0; - DBG_ASSERT( pPortion->GetLines().Count(), "Leere ParaPortion in GetEditCursor!" ); + DBG_ASSERT( pPortion->GetLines().Count(), "Empty ParaPortion in GetEditCursor!" ); EditLine* pLine = 0; BOOL bEOL = ( nFlags & GETCRSR_ENDOFLINE ) ? TRUE : FALSE; for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) @@ -4423,8 +4349,8 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, USHORT nIndex, US } if ( !pLine ) { - // Cursor am Ende des Absatzes. - DBG_ASSERT( nIndex == nCurIndex, "Index voll daneben in GetEditCursor!" ); + // Cursor at the End of the paragraph. + DBG_ASSERT( nIndex == nCurIndex, "Index dead wrong in GetEditCursor!" ); pLine = pPortion->GetLines().GetObject( pPortion->GetLines().Count()-1 ); nY -= pLine->GetHeight(); @@ -4439,7 +4365,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, USHORT nIndex, US nY += pLine->GetHeight(); aEditCursor.Bottom() = nY-1; - // innerhalb der Zeile suchen... + // Search within the line... long nX; if ( ( nIndex == pLine->GetStart() ) && ( nFlags & GETCRSR_STARTOFLINE ) ) @@ -4476,13 +4402,13 @@ void ImpEditEngine::SetValidPaperSize( const Size& rNewSz ) long nMinHeight = aStatus.AutoPageHeight() ? aMinAutoPaperSize.Height() : 0; long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : 0x7FFFFFFF; - // Minimale/Maximale Breite: + // Minimum/Maximum width: if ( aPaperSize.Width() < nMinWidth ) aPaperSize.Width() = nMinWidth; else if ( aPaperSize.Width() > nMaxWidth ) aPaperSize.Width() = nMaxWidth; - // Minimale/Maximale Hoehe: + // Minimum/Maximum height: if ( aPaperSize.Height() < nMinHeight ) aPaperSize.Height() = nMinHeight; else if ( aPaperSize.Height() > nMaxHeight ) @@ -4494,7 +4420,7 @@ void ImpEditEngine::IndentBlock( EditView* pEditView, BOOL bRight ) ESelection aESel( CreateESel( pEditView->pImpEditView->GetEditSelection() ) ); aESel.Adjust(); - // Nur wenn mehrere selektierte Absaetze... + // Only if more selected Paragraphs ... if ( aESel.nEndPara > aESel.nStartPara ) { ESelection aNewSel = aESel; @@ -4503,7 +4429,7 @@ void ImpEditEngine::IndentBlock( EditView* pEditView, BOOL bRight ) if ( aESel.nEndPos == 0 ) { - aESel.nEndPara--; // dann diesen Absatz nicht... + aESel.nEndPara--; // then not this paragraph ... aNewSel.nEndPos = 0; } @@ -4517,13 +4443,13 @@ void ImpEditEngine::IndentBlock( EditView* pEditView, BOOL bRight ) ContentNode* pNode = GetEditDoc().GetObject( nPara ); if ( bRight ) { - // Tabs hinzufuegen + // Insert Tabs EditPaM aPaM( pNode, 0 ); InsertTab( aPaM ); } else { - // Tabs entfernen + // Remove Tabs EditCharAttrib* pFeature = pNode->GetCharAttribs().FindFeature( 0 ); if ( pFeature && ( pFeature->GetStart() == 0 ) && ( pFeature->GetItem()->Which() == EE_FEATURE_TAB ) ) @@ -4589,17 +4515,6 @@ BOOL ImpEditEngine::DoVisualCursorTraveling( const ContentNode* ) { // Don't check if it's necessary, because we also need it when leaving the paragraph return IsVisualCursorTravelingEnabled(); -/* - BOOL bDoVisualCursorTraveling = FALSE; - - if ( IsVisualCursorTravelingEnabled() && pNode->Len() ) - { - // Only necessary when RTL text in LTR para or LTR text in RTL para - bDoVisualCursorTraveling = HasDifferentRTLLevels( pNode ); - } - - return bDoVisualCursorTraveling; -*/ } diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 6b770b9..83c27c9 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -173,7 +173,7 @@ void lcl_DrawRedLines( BOOL bIsRightToLeft ) { #ifndef SVX_LIGHT - // Aber nur, wenn Font nicht zu klein... + // But only if font is not too small ... long nHght = pOutDev->LogicToPixel( Size( 0, nFontHeight ) ).Height(); if( WRONG_SHOW_MIN < nHght ) { @@ -192,7 +192,7 @@ void lcl_DrawRedLines( if ( nStart >= nMaxEnd ) break; - if ( nStart < nIndex ) // Wurde korrigiert + if ( nStart < nIndex ) // Corrected nStart = nIndex; if ( nEnd > nMaxEnd ) nEnd = nMaxEnd; @@ -293,7 +293,7 @@ void ImpEditEngine::UpdateViews( EditView* pCurView ) if ( !GetUpdateMode() || IsFormatting() || aInvalidRec.IsEmpty() ) return; - DBG_ASSERT( IsFormatted(), "UpdateViews: Doc nicht formatiert!" ); + DBG_ASSERT( IsFormatted(), "UpdateViews: Do not format Doc!" ); for ( sal_uInt16 nView = 0; nView < aEditViews.Count(); nView++ ) { @@ -307,7 +307,7 @@ void ImpEditEngine::UpdateViews( EditView* pCurView ) if ( !aClipRec.IsEmpty() ) { - // in Fensterkoordinaten umwandeln.... + // convert to window coordinates .... aClipRec = pView->pImpEditView->GetWindowPos( aClipRec ); if ( ( pView == pCurView ) ) @@ -360,7 +360,7 @@ IMPL_LINK_INLINE_END( ImpEditEngine, IdleFormatHdl, Timer *, EMPTYARG ) void ImpEditEngine::CheckIdleFormatter() { aIdleFormatter.ForceTimeout(); - // Falls kein Idle, aber trotzdem nicht formatiert: + // If not idle, but still not formatted: if ( !IsFormatted() ) FormatDoc(); } @@ -381,7 +381,7 @@ void ImpEditEngine::FormatDoc() bIsFormatting = sal_True; - // Dann kann ich auch den Spell-Timer starten... + // Then I can also start the spell-timer ... if ( GetStatus().DoOnlineSpelling() ) StartOnlineSpellTimer(); @@ -390,10 +390,10 @@ void ImpEditEngine::FormatDoc() Font aOldFont( GetRefDevice()->GetFont() ); - // Hier schon, damit nicht jedesmal in CreateLines... + // Here already, so that not always lines are created... sal_Bool bMapChanged = ImpCheckRefMapMode(); - aInvalidRec = Rectangle(); // leermachen + aInvalidRec = Rectangle(); // make empty for ( sal_uInt16 nPara = 0; nPara < GetParaPortions().Count(); nPara++ ) { ParaPortion* pParaPortion = GetParaPortions().GetObject( nPara ); @@ -408,17 +408,13 @@ void ImpEditEngine::FormatDoc() pParaPortion->MarkSelectionInvalid( 0, pParaPortion->GetNode()->Len() ); } } - // bei MustRepaint() sollte keine Formatierung noetig sein! - // 23.1.95: Evtl. ist sie durch eine andere Aktion aber doch - // ungueltig geworden! -// if ( pParaPortion->MustRepaint() || CreateLines( nPara ) ) + // No formatting should be necessary for MustRepaint()! if ( ( pParaPortion->MustRepaint() && !pParaPortion->IsInvalid() ) || CreateLines( nPara, nY ) ) { if ( !bGrow && GetTextRanger() ) { - // Bei einer Aenderung der Hoehe muss alles weiter unten - // neu formatiert werden... + // For a change in height must all below be reformatted ... for ( sal_uInt16 n = nPara+1; n < GetParaPortions().Count(); n++ ) { ParaPortion* pPP = GetParaPortions().GetObject( n ); @@ -432,10 +428,10 @@ void ImpEditEngine::FormatDoc() pParaPortion->SetMustRepaint( sal_False ); } - // InvalidRec nur einmal setzen... + // InvalidRec set only once... if ( aInvalidRec.IsEmpty() ) { - // Bei Paperwidth 0 (AutoPageSize) bleibt es sonst Empty()... + // For Paperwidth 0 (AutoPageSize) it would otherwise be Empty()... long nWidth = Max( (long)1, ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) ); Range aInvRange( GetInvalidYOffsets( pParaPortion ) ); aInvalidRec = Rectangle( Point( 0, nY+aInvRange.Min() ), @@ -453,9 +449,8 @@ void ImpEditEngine::FormatDoc() nY += pParaPortion->GetHeight(); } - // Man kann auch durch UpdateMode An=>AUS=>AN in die Formatierung gelangen... - // Optimierung erst nach Vobis-Auslieferung aktivieren... -// if ( !aInvalidRec.IsEmpty() ) + // One can also get into the formatting through UpdateMode ON=>OFF=>ON... + // enable optimization firdt after Vobis delivery ... { sal_uInt32 nNewHeight = CalcTextHeight(); long nDiff = nNewHeight - nCurTextHeight; @@ -467,7 +462,7 @@ void ImpEditEngine::FormatDoc() if ( aInvalidRec.IsEmpty() ) { aInvalidRec.Top() = 0; - // Left und Right werden nicht ausgewertet, aber wegen IsEmpty gesetzt. + // Left and Right are not evaluated, are however set due to IsEmpty. aInvalidRec.Left() = 0; aInvalidRec.Right() = !IsVertical() ? aPaperSize.Width() : aPaperSize.Height(); } @@ -505,7 +500,7 @@ void ImpEditEngine::FormatDoc() if ( bMapChanged ) GetRefDevice()->Pop(); - CallStatusHdl(); // Falls Modified... + CallStatusHdl(); // If Modified... LeaveBlockNotifications(); } @@ -543,27 +538,26 @@ void ImpEditEngine::CheckAutoPageSize() if ( GetStatus().AutoPageHeight() ) aPaperSize.Height() = (long) !IsVertical() ? GetTextHeight() : CalcTextWidth( TRUE ); - SetValidPaperSize( aPaperSize ); //Min, Max beruecksichtigen + SetValidPaperSize( aPaperSize ); // consider Min, Max if ( aPaperSize != aPrevPaperSize ) { if ( ( !IsVertical() && ( aPaperSize.Width() != aPrevPaperSize.Width() ) ) || ( IsVertical() && ( aPaperSize.Height() != aPrevPaperSize.Height() ) ) ) { - // Falls davor zentriert/rechts oder Tabs... + // If previous centered / right or tabs ... aStatus.GetStatusWord() |= !IsVertical() ? EE_STAT_TEXTWIDTHCHANGED : EE_STAT_TEXTHEIGHTCHANGED; for ( sal_uInt16 nPara = 0; nPara < GetParaPortions().Count(); nPara++ ) { - // Es brauchen nur Absaetze neu formatiert werden, - // die nicht linksbuendig sind. - // Die Hoehe kann sich hier nicht mehr aendern. + // Only paragraphs who are not aligned to the left need to be + // reformatted, The height can not be changed here. ParaPortion* pParaPortion = GetParaPortions().GetObject( nPara ); ContentNode* pNode = pParaPortion->GetNode(); SvxAdjust eJustification = GetJustification( nPara ); if ( eJustification != SVX_ADJUST_LEFT ) { pParaPortion->MarkSelectionInvalid( 0, pNode->Len() ); - CreateLines( nPara, 0 ); // 0: Bei AutoPageSize kein TextRange! + CreateLines( nPara, 0 ); // 0: For AutoPageSize no TextRange! } } } @@ -600,20 +594,20 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) { ParaPortion* pParaPortion = GetParaPortions().GetObject( nPara ); - // sal_Bool: Aenderung der Hoehe des Absatzes Ja/Nein - sal_True/sal_False - DBG_ASSERT( pParaPortion->GetNode(), "Portion ohne Node in CreateLines" ); - DBG_ASSERT( pParaPortion->IsVisible(), "Unsichtbare Absaetze nicht formatieren!" ); - DBG_ASSERT( pParaPortion->IsInvalid(), "CreateLines: Portion nicht invalid!" ); + // sal_Bool: Changes in the height of paragraph Yes / No - sal_True/sal_False + DBG_ASSERT( pParaPortion->GetNode(), "Portion without Node in CreateLines" ); + DBG_ASSERT( pParaPortion->IsVisible(), "Invisible paragraph not formatted!" ); + DBG_ASSERT( pParaPortion->IsInvalid(), "CreateLines: Portion not invalid!" ); BOOL bProcessingEmptyLine = ( pParaPortion->GetNode()->Len() == 0 ); BOOL bEmptyNodeWithPolygon = ( pParaPortion->GetNode()->Len() == 0 ) && GetTextRanger(); // --------------------------------------------------------------- - // Schnelle Sonderbehandlung fuer leere Absaetze... + // Fast special treatment for empty paragraphs ... // --------------------------------------------------------------- if ( ( pParaPortion->GetNode()->Len() == 0 ) && !GetTextRanger() ) { - // schnelle Sonderbehandlung... + // fast special treatment ... if ( pParaPortion->GetTextPortions().Count() ) pParaPortion->GetTextPortions().Reset(); if ( pParaPortion->GetLines().Count() ) @@ -623,10 +617,10 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } // --------------------------------------------------------------- - // Initialisierung...... + // Initialization ...... // --------------------------------------------------------------- - // Immer fuer 100% formatieren: + // Always format for 100%: sal_Bool bMapChanged = ImpCheckRefMapMode(); if ( pParaPortion->GetLines().Count() == 0 ) @@ -636,7 +630,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } // --------------------------------------------------------------- - // Absatzattribute holen...... + // Get Paragraph attributes ...... // --------------------------------------------------------------- ContentNode* const pNode = pParaPortion->GetNode(); @@ -651,32 +645,15 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&) pNode->GetContentAttribs().GetItem( EE_PARA_SBL ); const BOOL bScriptSpace = ((const SvxScriptSpaceItem&) pNode->GetContentAttribs().GetItem( EE_PARA_ASIANCJKSPACING )).GetValue(); -// const sal_uInt16 nInvalidEnd = ( pParaPortion->GetInvalidDiff() > 0 ) -// ? pParaPortion->GetInvalidPosStart() + pParaPortion->GetInvalidDiff() -// : pNode->Len(); - const short nInvalidDiff = pParaPortion->GetInvalidDiff(); - const sal_uInt16 nInvalidStart = pParaPortion->GetInvalidPosStart(); - const sal_uInt16 nInvalidEnd = nInvalidStart + Abs( nInvalidDiff ); - - sal_Bool bQuickFormat = sal_False; - if ( !bEmptyNodeWithPolygon && !HasScriptType( nPara, i18n::ScriptType::COMPLEX ) ) - { - if ( ( pParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff > 0 ) && - ( pNode->Search( CH_FEATURE, nInvalidStart ) > nInvalidEnd ) ) - { - bQuickFormat = sal_True; - } - else if ( ( pParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) ) - { - // pruefen, ob loeschen ueber Portiongrenzen erfolgte... - sal_uInt16 nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!! - sal_uInt16 nEnd = nStart - nInvalidDiff; // neg. + // check if delete over the portion boundaries wss done ... + sal_uInt16 nStart = nInvalidStart; // DOUBLE !!!!!!!!!!!!!!! + sal_uInt16 nEnd = nStart - nInvalidDiff; // negative bQuickFormat = sal_True; sal_uInt16 nPos = 0; sal_uInt16 nPortions = pParaPortion->GetTextPortions().Count(); for ( sal_uInt16 nTP = 0; nTP < nPortions; nTP++ ) { - // Es darf kein Start/Ende im geloeschten Bereich liegen. + // There must be no start / end are in the deleted area. TextPortion* const pTP = pParaPortion->GetTextPortions()[ nTP ]; nPos = nPos + pTP->GetLen(); if ( ( nPos > nStart ) && ( nPos < nEnd ) ) @@ -707,33 +684,33 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } else if ( bQuickFormat ) { - // schnellere Methode: + // faster Method: RecalcTextPortion( pParaPortion, nInvalidStart, nInvalidDiff ); } - else // nRealInvalidStart kann vor InvalidStart liegen, weil Portions geloescht.... + else // nRealInvalidStart can be before InvalidStart, since Portions were deleted.... { CreateTextPortions( pParaPortion, nRealInvalidStart ); } // --------------------------------------------------------------- - // Zeile mit InvalidPos suchen, eine Zeile davor beginnen... - // Zeilen flaggen => nicht removen ! + // Search for line with InvalidPos, start one line before + // Flag the line => do not remove it ! // --------------------------------------------------------------- sal_uInt16 nLine = pParaPortion->GetLines().Count()-1; for ( sal_uInt16 nL = 0; nL <= nLine; nL++ ) { EditLine* pLine = pParaPortion->GetLines().GetObject( nL ); - if ( pLine->GetEnd() > nRealInvalidStart ) // nicht nInvalidStart! + if ( pLine->GetEnd() > nRealInvalidStart ) // not nInvalidStart! { nLine = nL; break; } pLine->SetValid(); } - // Eine Zeile davor beginnen... - // Wenn ganz hinten getippt wird, kann sich die Zeile davor nicht aendern. + // Begin one line before... + // If it is typed at the end, can the line in front can not change. if ( nLine && ( !pParaPortion->IsSimpleInvalid() || ( nInvalidEnd < pNode->Len() ) || ( nInvalidDiff <= 0 ) ) ) nLine--; @@ -747,11 +724,11 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( aBulletArea.Right() > 0 ) pParaPortion->SetBulletX( (sal_uInt16) GetXValue( aBulletArea.Right() ) ); else - pParaPortion->SetBulletX( 0 ); // Falls Bullet falsch eingestellt. + pParaPortion->SetBulletX( 0 ); // if Bullet is set incorrectly } // --------------------------------------------------------------- - // Ab hier alle Zeilen durchformatieren... + // Reformat all lines from here ... // --------------------------------------------------------------- sal_uInt16 nDelFromLine = 0xFFFF; sal_Bool bLineBreak = sal_False; @@ -763,7 +740,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) sal_Bool bCalcCharPositions = sal_True; sal_Int32* pBuf = new sal_Int32[ pNode->Len() ]; - sal_Bool bSameLineAgain = sal_False; // Fuer TextRanger, wenn sich die Hoehe aendert. + sal_Bool bSameLineAgain = sal_False; // For TextRanger, if the height changes. TabInfo aCurrentTab; BOOL bForceOneRun = bEmptyNodeWithPolygon; @@ -786,8 +763,6 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( !nLine && ( pParaPortion->GetBulletX() > nStartX ) ) { -// TL_NFLR nStartX += nFI; // Vielleicht reicht der LI? -// TL_NFLR if ( pParaPortion->GetBulletX() > nStartX ) nStartX = pParaPortion->GetBulletX(); } } @@ -801,20 +776,20 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) nMaxLineWidth -= GetXValue( rLRItem.GetRight() ); nMaxLineWidth -= nStartX; - // Wenn PaperSize == long_max, kann ich keinen neg. Erstzeileneinzug - // abziehen (Overflow) + // When PaperSize == long_max, one can not take away any negative + // first line indent. (Overflow) if ( ( nMaxLineWidth < 0 ) && ( nStartX < 0 ) ) nMaxLineWidth = ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) - GetXValue( rLRItem.GetRight() ); - // Wenn jetzt noch kleiner 0, kann es nur der rechte Rand sein. + // If still less than 0, it may be just the right edge. if ( nMaxLineWidth <= 0 ) nMaxLineWidth = 1; - // Problem: Da eine Zeile _vor_ der ungueltigen Position mit der - // Formatierung begonnen wird, werden hier leider auch die Positionen - // neu bestimmt... - // Loesungsansatz: - // Die Zeile davor kann nur groesser werden, nicht kleiner + // Problem: + // Since a line _before_ the invalid position is started with the + // formatting, the positions has unfortunately to be redefined ... + // Solution: + // The line before can only be bigger, not smaller // => ... if ( bCalcCharPositions ) pLine->GetCharPosArray().Remove( 0, pLine->GetCharPosArray().Count() ); @@ -823,7 +798,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) sal_uInt16 nTmpPortion = pLine->GetStartPortion(); long nTmpWidth = 0; long nXWidth = nMaxLineWidth; - if ( nXWidth <= nTmpWidth ) // while muss 1x durchlaufen werden + if ( nXWidth <= nTmpWidth ) // while has to be looped once nXWidth = nTmpWidth+1; SvLongsPtr pTextRanges = 0; @@ -845,7 +820,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) nTextLineHeight = ImplCalculateFontIndependentLineSpacing( aTmpFont.GetHeight() ); else nTextLineHeight = aTmpFont.GetPhysTxtSize( GetRefDevice(), String() ).Height(); - // Metriken koennen groesser sein + // Metrics can be greater FormatterFontMetric aTempFormatterMetrics; RecalcFormatterFontMetrics( aTempFormatterMetrics, aTmpFont ); sal_uInt16 nLineHeight = aTempFormatterMetrics.GetHeight(); @@ -869,30 +844,11 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) pTextRanges = GetTextRanger()->GetTextRanges( Range( nYOff, nYOff + nYDiff ) ); DBG_ASSERT( pTextRanges, "GetTextRanges?!" ); long nMaxRangeWidth = 0; - // Den breitesten Bereich verwenden... - // Der breiteste Bereich koennte etwas verwirren, also - // generell den ersten. Am besten mal richtig mit Luecken. -// for ( sal_uInt16 n = 0; n < pTextRanges->Count(); ) - if ( pTextRanges->Count() ) - { - sal_uInt16 n = 0; - long nA = pTextRanges->GetObject( n++ ); - long nB = pTextRanges->GetObject( n++ ); - DBG_ASSERT( nA <= nB, "TextRange verdreht?" ); - long nW = nB - nA; - if ( nW > nMaxRangeWidth ) - { - nMaxRangeWidth = nW; - nTextXOffset = nA; - } - } - nXWidth = nMaxRangeWidth; - if ( nXWidth ) - nMaxLineWidth = nXWidth - nStartX - GetXValue( rLRItem.GetRight() ); - else - { - // Weiter unten im Polygon versuchen. - // Unterhalb des Polygons die Paperbreite verwenden. + // Use the widest range ... + // The widest range could be a bit confusing, so normally it + // is the first one. The best times to correct gaps. + // Try further down in the polygon. + // Below the polygon use the Paper Width. nTextExtraYOffset += Max( (long)(nTextLineHeight / 10), (long)1 ); if ( ( nTextY + nTextExtraYOffset ) > GetTextRanger()->GetBoundRect().Bottom() ) { @@ -904,7 +860,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } } - // Portion suchen, die nicht mehr in Zeile passt.... + // search for Portion that no longer fits in line .... TextPortion* pPortion = 0; sal_Bool bBrokenLine = sal_False; bLineBreak = sal_False; @@ -915,8 +871,8 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) pPortion = pParaPortion->GetTextPortions().GetObject( nTmpPortion ); if ( pPortion->GetKind() == PORTIONKIND_HYPHENATOR ) { - // Portion wegschmeissen, ggf. die davor korrigieren, wenn - // die Hyph-Portion ein Zeichen geschluckt hat... + // Throw away a Portion, if necessary correct the one before, + // if the Hyph portion has swallowed a sign ... pParaPortion->GetTextPortions().Remove( nTmpPortion ); if ( nTmpPortion && pPortion->GetLen() ) { @@ -929,11 +885,11 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) pPrev->GetSize().Width() = (-1); } delete pPortion; - DBG_ASSERT( nTmpPortion < pParaPortion->GetTextPortions().Count(), "Keine Portion mehr da!" ); + DBG_ASSERT( nTmpPortion < pParaPortion->GetTextPortions().Count(), "No more Portions left!" ); pPortion = pParaPortion->GetTextPortions().GetObject( nTmpPortion ); } DBG_ASSERT( pPortion->GetKind() != PORTIONKIND_HYPHENATOR, "CreateLines: Hyphenator-Portion!" ); - DBG_ASSERT( pPortion->GetLen() || bProcessingEmptyLine, "Leere Portion in CreateLines ?!" ); + DBG_ASSERT( pPortion->GetLen() || bProcessingEmptyLine, "Empty Portion in CreateLines ?!" ); (void)bProcessingEmptyLine; if ( pNextFeature && ( pNextFeature->GetStart() == nTmpPos ) ) { @@ -944,10 +900,9 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) { long nOldTmpWidth = nTmpWidth; - // Tab-Pos suchen... + // Search for Tab-Pos... long nCurPos = nTmpWidth+nStartX; -// nCurPos -= rLRItem.GetTxtLeft(); // Tabs relativ zu LI - // Skalierung rausrechnen + // Calculate scaleing if ( aStatus.DoStretch() && ( nStretchX != 100 ) ) nCurPos = nCurPos*100/nStretchX; @@ -969,7 +924,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_CENTER ) || ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_DECIMAL ) ) { - // Bei LEFT/DEFAULT wird dieses Tab nicht mehr betrachtet. + // With LEFT / DEFAULT this tab is no longer seen. aCurrentTab.bValid = TRUE; aCurrentTab.nStartPosX = nTmpWidth; aCurrentTab.nCharPos = nTmpPos; @@ -980,21 +935,19 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) pPortion->SetExtraValue( aCurrentTab.aTabStop.GetFill() ); pPortion->GetSize().Width() = aCurrentTab.nTabPos - (nTmpWidth+nStartX); - // #90520# Height needed... SeekCursor( pNode, nTmpPos+1, aTmpFont ); pPortion->GetSize().Height() = aTmpFont.QuickGetTextSize( GetRefDevice(), String(), 0, 0, NULL ).Height(); - DBG_ASSERT( pPortion->GetSize().Width() >= 0, "Tab falsch berechnet!" ); + DBG_ASSERT( pPortion->GetSize().Width() >= 0, "Tab incorrectly calculated!" ); nTmpWidth = aCurrentTab.nTabPos-nStartX; - // Wenn dies das erste Token in der Zeile ist, - // und nTmpWidth > aPaperSize.Width, habe ich eine - // Endlos-Schleife! + // If this is the first token on the line, + // and nTmpWidth > aPaperSize.Width, => infinite loop! if ( ( nTmpWidth >= nXWidth ) && ( nTmpPortion == pLine->GetStartPortion() ) ) { - // Aber was jetzt ? - // Tab passend machen + // What now? + // Tab, make them fit pPortion->GetSize().Width() = nXWidth-nOldTmpWidth; nTmpWidth = nXWidth-1; bEOL = sal_True; @@ -1017,8 +970,6 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) break; case EE_FEATURE_FIELD: { -// long nCurWidth = nTmpWidth; - SeekCursor( pNode, nTmpPos+1, aTmpFont ); sal_Unicode cChar = 0; // later: NBS? aTmpFont.SetPhysFont( GetRefDevice() ); ImplInitDigitMode( GetRefDevice(), 0, 0, 0, aTmpFont.GetLanguage() ); @@ -1027,16 +978,15 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( bCalcCharPositions || !pPortion->HasValidSize() ) { pPortion->GetSize() = aTmpFont.QuickGetTextSize( GetRefDevice(), aFieldValue, 0, aFieldValue.Len(), 0 ); - // Damit kein Scrollen bei ueberlangen Feldern + // So no scrolling over long fields if ( pPortion->GetSize().Width() > nXWidth ) pPortion->GetSize().Width() = nXWidth; } nTmpWidth += pPortion->GetSize().Width(); pLine->GetCharPosArray().Insert( pPortion->GetSize().Width(), nTmpPos-pLine->GetStart() ); pPortion->GetKind() = cChar ? PORTIONKIND_TEXT : PORTIONKIND_FIELD; - // Wenn dies das erste Token in der Zeile ist, - // und nTmpWidth > aPaperSize.Width, habe ich eine - // Endlos-Schleife! + // If this is the first token on the line, + // and nTmpWidth > aPaperSize.Width, => infinite loop! if ( ( nTmpWidth >= nXWidth ) && ( nTmpPortion == pLine->GetStartPortion() ) ) { nTmpWidth = nXWidth-1; @@ -1048,7 +998,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) bCompressedChars = FALSE; } break; - default: DBG_ERROR( "Was fuer ein Feature ?" ); + default: DBG_ERROR( "What feature?" ); } pNextFeature = pNode->GetCharAttribs().FindFeature( pNextFeature->GetStart() + 1 ); } @@ -1073,8 +1023,8 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( bCalcCharPositions ) { sal_uInt16 nLen = pPortion->GetLen(); - // Es wird am Anfang generell das Array geplaettet - // => Immer einfach schnelles insert. + // The array is generally flattened at the beginning + // => Always simply quick inserts. sal_uInt16 nPos = nTmpPos - pLine->GetStart(); pLine->GetCharPosArray().Insert( pBuf, nLen, nPos ); } @@ -1118,56 +1068,11 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) long nW = nWidthAfterTab; // Length before tab position if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_RIGHT ) { -// nW = nWidthAfterTab; - } - else if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_CENTER ) - { - nW = nWidthAfterTab/2; - } - else if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_DECIMAL ) - { -// nW = nWidthAfterTab; - String aText = GetSelected( EditSelection( EditPaM( pParaPortion->GetNode(), nTmpPos ), - EditPaM( pParaPortion->GetNode(), nTmpPos + pPortion->GetLen() ) ) ); - USHORT nDecPos = aText.Search( aCurrentTab.aTabStop.GetDecimal() ); - if ( nDecPos != STRING_NOTFOUND ) - { - nW -= pParaPortion->GetTextPortions().GetObject( nTmpPortion )->GetSize().Width(); - nW += aTmpFont.QuickGetTextSize( GetRefDevice(), *pParaPortion->GetNode(), nTmpPos, nDecPos, NULL ).Width(); - aCurrentTab.bValid = FALSE; - } - } - else - { - DBG_ERROR( "CreateLines: Tab not handled!" ); - } - long nMaxW = aCurrentTab.nTabPos - aCurrentTab.nStartPosX - nStartX; - if ( nW >= nMaxW ) - { - nW = nMaxW; - aCurrentTab.bValid = FALSE; - } - TextPortion* pTabPortion = pParaPortion->GetTextPortions().GetObject( aCurrentTab.nTabPortion ); - pTabPortion->GetSize().Width() = aCurrentTab.nTabPos - aCurrentTab.nStartPosX - nW - nStartX; - nTmpWidth = aCurrentTab.nStartPosX + pTabPortion->GetSize().Width() + nWidthAfterTab; - } - - nTmpPos = nTmpPos + pPortion->GetLen(); - nPortionEnd = nTmpPos; - nTmpPortion++; - if ( aStatus.OneCharPerLine() ) - bEOL = sal_True; - } - - DBG_ASSERT( pPortion, "no portion!?" ); - - aCurrentTab.bValid = FALSE; - - // das war evtl. eine Portion zu weit: + // this was possibly a portion to far: sal_Bool bFixedEnd = sal_False; if ( aStatus.OneCharPerLine() ) { - // Zustand vor Portion: ( bis auf nTmpWidth ) + // State before Portion (up to nTmpWidth): nPortionEnd = nTmpPos; nTmpPos -= pPortion ? pPortion->GetLen() : 0; nPortionStart = nTmpPos; @@ -1176,14 +1081,14 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) bEOL = sal_True; bEOC = sal_False; - // Und jetzt genau ein Zeichen: + // And now just one character: nTmpPos++; nTmpPortion++; nPortionEnd = nTmpPortion; - // Eine Nicht-Feature-Portion muss gebrochen werden + // one Non-Feature-Portion has to be wrapped if ( pPortion->GetLen() > 1 ) { - DBG_ASSERT( pPortion && (pPortion->GetKind() == PORTIONKIND_TEXT), "Len>1, aber keine TextPortion?" ); + DBG_ASSERT( pPortion && (pPortion->GetKind() == PORTIONKIND_TEXT), "Len>1, but no TextPortion?" ); nTmpWidth -= pPortion ? pPortion->GetSize().Width() : 0; sal_uInt16 nP = SplitTextPortion( pParaPortion, nTmpPos, pLine ); TextPortion* p = pParaPortion->GetTextPortions().GetObject( nP ); @@ -1216,8 +1121,8 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) break; default: { - // Ein Feature wird nicht umgebrochen: - DBG_ASSERT( ( pPortion->GetKind() == PORTIONKIND_LINEBREAK ), "Was fuer ein Feature ?" ); + // A feature does not wrap: + DBG_ASSERT( ( pPortion->GetKind() == PORTIONKIND_LINEBREAK ), "What Feature ?" ); bEOL = sal_True; bFixedEnd = sal_True; } @@ -1228,7 +1133,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) bEOL = sal_True; bEOC = sal_True; pLine->SetEnd( nPortionEnd ); - DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "Keine TextPortions?" ); + DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "No TextPortions?" ); pLine->SetEndPortion( (sal_uInt16)pParaPortion->GetTextPortions().Count() - 1 ); } @@ -1246,11 +1151,11 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) { pLine->SetEnd( nPortionStart+1 ); pLine->SetEndPortion( nTmpPortion-1 ); - bEOC = sal_False; // wurde oben gesetzt, vielleich mal die if's umstellen? + bEOC = sal_False; // was set above, maybe reset the if's? } else if ( !bEOL ) { - DBG_ASSERT( pPortion && ((nPortionEnd-nPortionStart) == pPortion->GetLen()), "Doch eine andere Portion?!" ); + DBG_ASSERT( pPortion && ((nPortionEnd-nPortionStart) == pPortion->GetLen()), "However, another portion?!" ); long nRemainingWidth = nMaxLineWidth - nTmpWidth; sal_Bool bCanHyphenate = ( aTmpFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL ); if ( bCompressedChars && pPortion && ( pPortion->GetLen() > 1 ) && pPortion->GetExtraInfos() && pPortion->GetExtraInfos()->bCompressed ) @@ -1264,11 +1169,10 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } // ------------------------------------------------------------------ - // Zeile fertig => justieren + // Line finished => adjust // ------------------------------------------------------------------ - // CalcTextSize sollte besser durch ein kontinuierliches - // Registrieren ersetzt werden ! + // CalcTextSize should be replsced through a continuous registering! Size aTextSize = pLine->CalcTextSize( *pParaPortion ); if ( aTextSize.Height() == 0 ) @@ -1284,10 +1188,9 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) pLine->SetHeight( (sal_uInt16)aTextSize.Height() ); } - // Die Fontmetriken koennen nicht kontinuierlich berechnet werden, - // wenn der Font sowieso eingestellt ist, weil ggf. ein grosser Font - // erst nach dem Umbrechen ploetzlich in der naechsten Zeile landet - // => Font-Metriken zu gross. + // The font metrics can not be calculated continuously, if the font is + // set anyway, because if large font only after wrapping suddenly end + // up in the next line => Font metrics too big. FormatterFontMetric aFormatterMetrics; sal_uInt16 nTPos = pLine->GetStart(); for ( sal_uInt16 nP = pLine->GetStartPortion(); nP <= pLine->GetEndPortion(); nP++ ) @@ -1311,7 +1214,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) bSameLineAgain = sal_False; if ( GetTextRanger() && ( pLine->GetHeight() > nTextLineHeight ) ) { - // Nochmal mit der anderen Groesse aufsetzen! + // put down with the other size! bSameLineAgain = sal_True; } @@ -1324,7 +1227,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) sal_uInt16 nTxtHeight = pLine->GetHeight(); if ( nTxtHeight < nMinHeight ) { - // Der Ascent muss um die Differenz angepasst werden: + // The Ascent to be adjusted for the difference: long nDiff = nMinHeight - nTxtHeight; pLine->SetMaxAscent( (sal_uInt16)(pLine->GetMaxAscent() + nDiff) ); pLine->SetHeight( nMinHeight, nTxtHeight ); @@ -1332,7 +1235,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } else if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) { - if ( nPara || IsFixedCellHeight() || pLine->GetStartPortion() ) // Nicht die aller erste Zeile + if ( nPara || IsFixedCellHeight() || pLine->GetStartPortion() ) // Not the very first line { // #100508# There are documents with PropLineSpace 0, why? // (cmc: re above question :-) such documents can be seen by importing a .ppt @@ -1342,7 +1245,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) sal_Int32 nH = nTxtHeight; nH *= rLSItem.GetPropLineSpace(); nH /= 100; - // Der Ascent muss um die Differenz angepasst werden: + // The Ascent to be adjusted for the difference: long nDiff = pLine->GetHeight() - nH; if ( nDiff > pLine->GetMaxAscent() ) nDiff = pLine->GetMaxAscent(); @@ -1353,27 +1256,13 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } } - - // #80582# - Bullet should not influence line height -// if ( !nLine ) -// { -// long nBulletHeight = aBulletArea.GetHeight(); -// if ( nBulletHeight > (long)pLine->GetHeight() ) -// { -// long nDiff = nBulletHeight - (long)pLine->GetHeight(); -// // nDiff auf oben und unten verteilen. -// pLine->SetMaxAscent( (sal_uInt16)(pLine->GetMaxAscent() + nDiff/2) ); -// pLine->SetHeight( (sal_uInt16)nBulletHeight ); -// } -// } - if ( ( !IsVertical() && aStatus.AutoPageWidth() ) || ( IsVertical() && aStatus.AutoPageHeight() ) ) { - // Wenn die Zeile in die aktuelle Papierbreite passt, muss - // diese Breite fuer die Ausrichting verwendet werden. - // Wenn sie nicht passt oder sie die Papierbreite aendert, - // wird bei Justification != LEFT sowieso noch mal formatiert. + // If the row fits within the current paper width, then this width + // has to be used for the Alignment. If it does not fit or if it + // will change the paper width, it will anyway be formatted for + // Justification! = LEFT anyway formatted again. long nMaxLineWidthFix = ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) - GetXValue( rLRItem.GetRight() ) - nStartX; if ( aTextSize.Width() < nMaxLineWidthFix ) @@ -1408,7 +1297,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) case SVX_ADJUST_CENTER: { long n = ( nMaxLineWidth - aTextSize.Width() ) / 2; - n += nStartX; // Einrueckung bleibt erhalten. + n += nStartX; // Indentation is kept. if ( n > 0 ) pLine->SetStartPosX( (sal_uInt16)n ); else @@ -1418,11 +1307,10 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) break; case SVX_ADJUST_RIGHT: { - // Bei automatisch umgebrochenen Zeilen, die ein Blank - // am Ende enthalten, darf das Blank nicht ausgegeben werden! - + // For automatically wrapped lines, which has a blank at the end + // the blank must not be displayed! long n = nMaxLineWidth - aTextSize.Width(); - n += nStartX; // Einrueckung bleibt erhalten. + n += nStartX; // Indentation is kept. if ( n > 0 ) pLine->SetStartPosX( (sal_uInt16)n ); else @@ -1446,12 +1334,12 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } // ----------------------------------------------------------------- - // pruefen, ob die Zeile neu ausgegeben werden muss... + // Check whether the line must be re-issued ... // ----------------------------------------------------------------- pLine->SetInvalid(); - // Wenn eine Portion umgebrochen wurde sind ggf. viel zu viele Positionen - // im CharPosArray: + // If a portion was wrapped there may be far too many positions in + // CharPosArray: if ( bCalcCharPositions ) { sal_uInt16 nLen = pLine->GetLen(); @@ -1471,14 +1359,13 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } } - // Fuer kleiner 0 noch ueberlegen! + // for 0 or less still superiour! if ( pParaPortion->IsSimpleInvalid() /* && ( nInvalidDiff > 0 ) */ ) { - // Aenderung durch einfache Textaenderung... - // Formatierung nicht abbrechen, da Portions evtl. wieder - // gesplittet werden muessen! - // Wenn irgendwann mal abbrechbar, dann fogende Zeilen Validieren! - // Aber ggf. als Valid markieren, damit weniger Ausgabe... + // Change through simple Text changes ... + // Do mot cancel formatting since Portions possibly have to be split + // again! If at some point broken off, then validate the following + // line! But if necessary, mark as valid, so there is less output... if ( pLine->GetEnd() < nInvalidStart ) { if ( *pLine == aSaveLine ) @@ -1508,10 +1395,9 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } else if ( bCalcCharPositions && bQuickFormat && ( nEnd > nInvalidEnd) ) { - // Wenn die ungueltige Zeile so endet, dass die naechste an - // der 'gleichen' Textstelle wie vorher beginnt, also nicht - // anders umgebrochen wird, brauche ich dort auch nicht die - // textbreiten neu bestimmen: + // If the invalid line ends so that the next begins on the + // 'same' passage as before, i.e. not wrapped differently, + // then the text width does not have to be determined anew: if ( nEnd == ( aSaveLine.GetEnd() + nInvalidDiff ) ) { bCalcCharPositions = sal_False; @@ -1525,12 +1411,12 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( !bSameLineAgain ) { - nIndex = pLine->GetEnd(); // naechste Zeile Start = letzte Zeile Ende - // weil nEnd hinter das letzte Zeichen zeigt! + nIndex = pLine->GetEnd(); // next line start = last line end + // as nEnd points to the last charecter! sal_uInt16 nEndPortion = pLine->GetEndPortion(); - // Naechste Zeile oder ggf. neue Zeile.... + // Next line or maybe a new line.... pLine = 0; if ( nLine < pParaPortion->GetLines().Count()-1 ) pLine = pParaPortion->GetLines().GetObject( ++nLine ); @@ -1567,12 +1453,12 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) pLine->SetEndPortion( nEndPortion+1 ); } } - } // while ( Index < Len ) + } if ( nDelFromLine != 0xFFFF ) pParaPortion->GetLines().DeleteFromLine( nDelFromLine ); - DBG_ASSERT( pParaPortion->GetLines().Count(), "Keine Zeile nach CreateLines!" ); + DBG_ASSERT( pParaPortion->GetLines().Count(), "No line after CreateLines!" ); if ( bLineBreak == sal_True ) CreateAndInsertEmptyLine( pParaPortion, nStartPosY ); @@ -1616,7 +1502,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn if ( aBulletArea.Right() > 0 ) pParaPortion->SetBulletX( (sal_uInt16) GetXValue( aBulletArea.Right() ) ); else - pParaPortion->SetBulletX( 0 ); // Falls Bullet falsch eingestellt. + pParaPortion->SetBulletX( 0 ); // If Bullet set incorrectly. if ( pParaPortion->GetBulletX() > nStartX ) { nStartX = (short)GetXValue( rLRItem.GetTxtLeft() + rLRItem.GetTxtFirstLineOfst() + nSpaceBeforeAndMinLabelWidth ); @@ -1669,7 +1555,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn sal_uInt16 nTxtHeight = pTmpLine->GetHeight(); if ( nTxtHeight < nMinHeight ) { - // Der Ascent muss um die Differenz angepasst werden: + // The Ascent to be adjusted for the difference:s long nDiff = nMinHeight - nTxtHeight; pTmpLine->SetMaxAscent( (sal_uInt16)(pTmpLine->GetMaxAscent() + nDiff) ); pTmpLine->SetHeight( nMinHeight, nTxtHeight ); @@ -1678,7 +1564,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn else if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) { USHORT nPara = GetParaPortions().GetPos( pParaPortion ); - if ( nPara || IsFixedCellHeight() || pTmpLine->GetStartPortion() ) // Nicht die aller erste Zeile + if ( nPara || IsFixedCellHeight() || pTmpLine->GetStartPortion() ) // Not the very first line { // #100508# There are documents with PropLineSpace 0, why? // (cmc: re above question :-) such documents can be seen by importing a .ppt @@ -1688,7 +1574,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn sal_Int32 nH = nTxtHeight; nH *= rLSItem.GetPropLineSpace(); nH /= 100; - // Der Ascent muss um die Differenz angepasst werden: + // The Ascent to be adjusted for the difference: long nDiff = pTmpLine->GetHeight() - nH; if ( nDiff > pTmpLine->GetMaxAscent() ) nDiff = pTmpLine->GetMaxAscent(); @@ -1705,18 +1591,18 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn if ( nMinHeight > (long)pTmpLine->GetHeight() ) { long nDiff = nMinHeight - (long)pTmpLine->GetHeight(); - // nDiff auf oben und unten verteilen. + // nDiff distribute upwards and downwards pTmpLine->SetMaxAscent( (sal_uInt16)(pTmpLine->GetMaxAscent() + nDiff/2) ); pTmpLine->SetHeight( (sal_uInt16)nMinHeight ); } } else { - // -2: Die neue ist bereits eingefuegt. + // -2: The new one is already inserted. #ifdef DBG_UTIL EditLine* pLastLine = pParaPortion->GetLines().GetObject( pParaPortion->GetLines().Count()-2 ); - DBG_ASSERT( pLastLine, "Weicher Umbruch, keine Zeile ?!" ); - DBG_ASSERT( pLastLine->GetEnd() == pParaPortion->GetNode()->Len(), "Doch anders?" ); + DBG_ASSERT( pLastLine, "soft wrap no line?!" ); + DBG_ASSERT( pLastLine->GetEnd() == pParaPortion->GetNode()->Len(), "diffrent anyway?" ); #endif // pTmpLine->SetStart( pLastLine->GetEnd() ); // pTmpLine->SetEnd( pLastLine->GetEnd() ); @@ -1731,12 +1617,9 @@ sal_Bool ImpEditEngine::FinishCreateLines( ParaPortion* pParaPortion ) // CalcCharPositions( pParaPortion ); pParaPortion->SetValid(); long nOldHeight = pParaPortion->GetHeight(); -// sal_uInt16 nPos = GetParaPortions().GetPos( pParaPortion ); -// DBG_ASSERT( nPos != USHRT_MAX, "FinishCreateLines: Portion nicht in Liste!" ); -// ParaPortion* pPrev = nPos ? GetParaPortions().GetObject( nPos-1 ) : 0; CalcHeight( pParaPortion ); - DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "FinishCreateLines: Keine Text-Portion?" ); + DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "FinishCreateLines: No Text-Portion?" ); sal_Bool bRet = ( pParaPortion->GetHeight() != nOldHeight ); return bRet; } @@ -1815,7 +1698,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te nBreakPos = nMaxBreakPos; // BUG in I18N - the japanese dot is in the next line! - // !!! Testen!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // !!! Test!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if ( (nBreakPos + ( aUserOptions.allowPunctuationOutsideMargin ? 0 : 1 ) ) <= nMaxBreakPos ) { sal_Unicode cFirstInNextLine = ( (nBreakPos+1) < pNode->Len() ) ? pNode->GetChar( nBreakPos ) : 0; @@ -1827,17 +1710,14 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te pLine->SetHangingPunctuation( bHangingPunctuation ); #ifndef SVX_LIGHT - // Egal ob Trenner oder nicht: Das Wort nach dem Trenner durch - // die Silbentrennung jagen... - // nMaxBreakPos ist das letzte Zeichen was in die Zeile passt, - // nBreakPos ist der Wort-Anfang - // Ein Problem gibt es, wenn das Dok so schmal ist, dass ein Wort - // auf mehr als Zwei Zeilen gebrochen wird... + // Whether a separator or not, push the word after the separator through + // hyphenation ... NMaxBreakPos is the last character that fits into + // the line, nBreakPos is the beginning of the word. + // There is a problem if the Doc is so narrow that a word is broken + // into more than two lines ... if ( !bHangingPunctuation && bCanHyphenate && GetHyphenator().is() ) { i18n::Boundary aBoundary = _xBI->getWordBoundary( *pNode, nBreakPos, GetLocale( EditPaM( pNode, nBreakPos ) ), ::com::sun::star::i18n::WordType::DICTIONARY_WORD, sal_True ); -// sal_uInt16 nWordStart = nBreakPos; -// sal_uInt16 nBreakPos_OLD = nBreakPos; sal_uInt16 nWordStart = nBreakPos; sal_uInt16 nWordEnd = (USHORT) aBoundary.endPos; DBG_ASSERT( nWordEnd > nWordStart, "ImpBreakLine: Start >= End?" ); @@ -1846,9 +1726,8 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te if ( ( nWordEnd >= nMaxBreakPos ) && ( nWordLen > 3 ) ) { // #104415# May happen, because getLineBreak may differ from getWordBoudary with DICTIONARY_WORD - // DBG_ASSERT( nWordEnd >= nMaxBreakPos, "Hyph: Break?" ); String aWord( *pNode, nWordStart, nWordLen ); - sal_uInt16 nMinTrail = nWordEnd-nMaxBreakPos+1; //+1: Vor dem angeknacksten Buchstaben + sal_uInt16 nMinTrail = nWordEnd-nMaxBreakPos+1; //+1: Before the crack in most letters Reference< XHyphenatedWord > xHyphWord; if (xHyphenator.is()) xHyphWord = xHyphenator->hyphenate( aWord, aLocale, aWord.Len() - nMinTrail, Sequence< PropertyValue >() ); @@ -1868,27 +1747,25 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te { String aAlt( xHyphWord->getHyphenatedWord() ); - // Wir gehen von zwei Faellen aus, die nun - // vorliegen koennen: - // 1) packen wird zu pak-ken - // 2) Schiffahrt wird zu Schiff-fahrt - // In Fall 1 muss ein Zeichen ersetzt werden, - // in Fall 2 wird ein Zeichen hinzugefuegt. - // Die Identifikation wird erschwert durch Worte wie - // "Schiffahrtsbrennesseln", da der Hyphenator alle - // Position des Wortes auftrennt und "Schifffahrtsbrennnesseln" - // ermittelt. Wir koennen also eigentlich nicht unmittelbar vom - // Index des AlternativWord auf aWord schliessen. - - // Das ganze geraffel wird durch eine Funktion am - // Hyphenator vereinfacht werden, sobald AMA sie einbaut... + // We expect the two cases, which might exist now: + // 1) packen becomes pak-ken + // 2) Shiffahrt becomes shiff-fahrt + // In case 1, a character has to be replaced + // in case 2 is a character added. + // The identification is complicated by long + // compound words because the Hyphenator separates + // all position of the word. We can thus actually + // not directly connect the index of the alternative + // word to aWord. The whole issue will be simplified + // through a function in the Hyphenator as soon as + // AMA builds this in... sal_uInt16 nAltStart = _nWordLen - 1; sal_uInt16 nTxtStart = nAltStart - (aAlt.Len() - aWord.Len()); sal_uInt16 nTxtEnd = nTxtStart; sal_uInt16 nAltEnd = nAltStart; - // Die Bereiche zwischen den nStart und nEnd ist - // die Differenz zwischen Alternativ- und OriginalString. + // The regions between the nStart and nEnd is the + // difference between alternative and original string. while( nTxtEnd < aWord.Len() && nAltEnd < aAlt.Len() && aWord.GetChar(nTxtEnd) != aAlt.GetChar(nAltEnd) ) { @@ -1896,7 +1773,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te ++nAltEnd; } - // Wenn ein Zeichen hinzugekommen ist, dann bemerken wir es jetzt: + // If a character is added, then we notice it now: if( nAltEnd > nTxtEnd && nAltStart == nAltEnd && aWord.GetChar( nTxtEnd ) == aAlt.GetChar(nAltEnd) ) { @@ -1905,7 +1782,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te ++nTxtEnd; } - DBG_ASSERT( ( nAltEnd - nAltStart ) == 1, "Alternate: Falsche Annahme!" ); + DBG_ASSERT( ( nAltEnd - nAltStart ) == 1, "Alternate: Wrong assumption!" ); if ( nTxtEnd > nTxtStart ) cAlternateReplChar = aAlt.GetChar( nAltStart ); @@ -1926,22 +1803,22 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te if ( nBreakPos <= pLine->GetStart() ) { - // keine Trenner in Zeile => abhacken ! + // No separator in line => Chop! nBreakPos = nMaxBreakPos; - // MT: I18N nextCharacters !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // I18N nextCharacters ! if ( nBreakPos <= pLine->GetStart() ) - nBreakPos = pLine->GetStart() + 1; // Sonst Endlosschleife! + nBreakPos = pLine->GetStart() + 1; // Otherwise infinite loop! } } - // die angeknackste Portion ist die End-Portion + // the battered portion is the end portion pLine->SetEnd( nBreakPos ); sal_uInt16 nEndPortion = SplitTextPortion( pParaPortion, nBreakPos, pLine ); if ( !bCompressBlank && !bHangingPunctuation ) { - // #96187# When justification is not SVX_ADJUST_LEFT, it's important to compress + // When justification is not SVX_ADJUST_LEFT, it's important to compress // the trailing space even if there is enough room for the space... // Don't check for SVX_ADJUST_LEFT, doesn't matter to compress in this case too... DBG_ASSERT( nBreakPos > pLine->GetStart(), "ImpBreakLines - BreakPos not expected!" ); @@ -1952,15 +1829,15 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te if ( bCompressBlank || bHangingPunctuation ) { TextPortion* pTP = pParaPortion->GetTextPortions().GetObject( nEndPortion ); - DBG_ASSERT( pTP->GetKind() == PORTIONKIND_TEXT, "BlankRubber: Keine TextPortion!" ); - DBG_ASSERT( nBreakPos > pLine->GetStart(), "SplitTextPortion am Anfang der Zeile?" ); + DBG_ASSERT( pTP->GetKind() == PORTIONKIND_TEXT, "BlankRubber: No TextPortion!" ); + DBG_ASSERT( nBreakPos > pLine->GetStart(), "SplitTextPortion at the beginning of the line?" ); sal_uInt16 nPosInArray = nBreakPos - 1 - pLine->GetStart(); pTP->GetSize().Width() = ( nPosInArray && ( pTP->GetLen() > 1 ) ) ? pLine->GetCharPosArray()[ nPosInArray-1 ] : 0; pLine->GetCharPosArray()[ nPosInArray ] = pTP->GetSize().Width(); } else if ( bHyphenated ) { - // Eine Portion fuer den Trenner einbauen... + // A portion for installing the separator ... TextPortion* pHyphPortion = new TextPortion( 0 ); pHyphPortion->GetKind() = PORTIONKIND_HYPHENATOR; String aHyphText( CH_HYPH ); @@ -1971,7 +1848,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te pPrev->SetLen( pPrev->GetLen() - 1 ); pHyphPortion->SetLen( 1 ); pHyphPortion->SetExtraValue( cAlternateReplChar ); - // Breite der Portion davor korrigieren: + // Correct width of the portion above: pPrev->GetSize().Width() = pLine->GetCharPosArray()[ nBreakPos-1 - pLine->GetStart() - 1 ]; } @@ -1981,7 +1858,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te aHyphText.Insert( cAlternateExtraChar, 0 ); } - // Breite der Hyph-Portion ermitteln: + // Determine the width if the Hyph-Portion: SvxFont aFont; SeekCursor( pParaPortion->GetNode(), nBreakPos, aFont ); aFont.SetPhysFont( GetRefDevice() ); @@ -1995,13 +1872,13 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, long nRemainingSpace ) { - DBG_ASSERT( nRemainingSpace > 0, "AdjustBlocks: Etwas zuwenig..." ); - DBG_ASSERT( pLine, "AdjustBlocks: Zeile ?!" ); + DBG_ASSERT( nRemainingSpace > 0, "AdjustBlocks: Somewhat too little..." ); + DBG_ASSERT( pLine, "AdjustBlocks: Line ?!" ); if ( ( nRemainingSpace < 0 ) || pLine->IsEmpty() ) return ; const USHORT nFirstChar = pLine->GetStart(); - const USHORT nLastChar = pLine->GetEnd() -1; // Last zeigt dahinter + const USHORT nLastChar = pLine->GetEnd() -1; // Last points to pervious ContentNode* pNode = pParaPortion->GetNode(); DBG_ASSERT( nLastChar < pNode->Len(), "AdjustBlocks: Out of range!" ); @@ -2047,9 +1924,9 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, if ( !aPositions.Count() ) return; - // Wenn das letzte Zeichen ein Blank ist, will ich es nicht haben! - // Die Breite muss auf die Blocker davor verteilt werden... - // Aber nicht, wenn es das einzige ist + // If the last character is a blank, it is rejected! + // The width must be distributed to the blockers in front... + // But not if it is the only one. if ( ( pNode->GetChar( nLastChar ) == ' ' ) && ( aPositions.Count() > 1 ) && ( MsLangId::getPrimaryLanguage( GetLanguage( EditPaM( pNode, nLastChar ) ) ) != LANGUAGE_ARABIC_PRIMARY_ONLY ) ) { aPositions.Remove( aPositions.Count()-1, 1 ); @@ -2060,12 +1937,12 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, long nBlankWidth = nRealWidth; if ( nLastChar > nPortionStart ) nBlankWidth -= pLine->GetCharPosArray()[nLastChar-nFirstChar-1]; - // Evtl. ist das Blank schon in ImpBreakLine abgezogen worden: + // Possibly the blank is already deducted in ImpBreakLine: if ( nRealWidth == pLastPortion->GetSize().Width() ) { - // Beim letzten Zeichen muss die Portion hinter dem Blank aufhoeren - // => Korrektur vereinfachen: - DBG_ASSERT( ( nPortionStart + pLastPortion->GetLen() ) == ( nLastChar+1 ), "Blank doch nicht am Portion-Ende?!" ); + // For the last character the portion must stop behind the blank + // => Simplify correction: + DBG_ASSERT( ( nPortionStart + pLastPortion->GetLen() ) == ( nLastChar+1 ), "Blank actually not at the end portion!?"); pLastPortion->GetSize().Width() -= nBlankWidth; nRemainingSpace += nBlankWidth; } @@ -2076,11 +1953,11 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, const long nMore4Everyone = nRemainingSpace / nGaps; long nSomeExtraSpace = nRemainingSpace - nMore4Everyone*nGaps; - DBG_ASSERT( nSomeExtraSpace < (long)nGaps, "AdjustBlocks: ExtraSpace zu gross" ); + DBG_ASSERT( nSomeExtraSpace < (long)nGaps, "AdjustBlocks: ExtraSpace to large" ); DBG_ASSERT( nSomeExtraSpace >= 0, "AdjustBlocks: ExtraSpace < 0 " ); - // Die Positionen im Array und die Portion-Breiten korrigieren: - // Letztes Zeichen wird schon nicht mehr beachtet... + // Correct the positions in the Array and the portion widths: + // Last character is already not considered ... for ( USHORT n = 0; n < aPositions.Count(); n++ ) { USHORT nChar = aPositions[n]; @@ -2091,7 +1968,7 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, TextPortion* pLastPortion = pParaPortion->GetTextPortions()[ nPortion ]; USHORT nPortionEnd = nPortionStart + pLastPortion->GetLen(); - // Die Breite der Portion: + // The width of the portion: pLastPortion->GetSize().Width() += nMore4Everyone; if ( nSomeExtraSpace ) pLastPortion->GetSize().Width()++; @@ -2234,10 +2111,9 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, USHORT nStart, USHORT n sal_uInt16 ImpEditEngine::SplitTextPortion( ParaPortion* pPortion, sal_uInt16 nPos, EditLine* pCurLine ) { - DBG_ASSERT( pPortion, "SplitTextPortion: Welche ?" ); + DBG_ASSERT( pPortion, "SplitTextPortion: Which ?" ); - // Die Portion bei nPos wird geplittet, wenn bei nPos nicht - // sowieso ein Wechsel ist + // The portion at nPos is split, if ther is not a transition at nPos anyway if ( nPos == 0 ) return 0; @@ -2251,12 +2127,8 @@ sal_uInt16 ImpEditEngine::SplitTextPortion( ParaPortion* pPortion, sal_uInt16 nP nTmpPos = nTmpPos + pTP->GetLen(); if ( nTmpPos >= nPos ) { - if ( nTmpPos == nPos ) // dann braucht nichts geteilt werden + if ( nTmpPos == nPos ) // then nothing needs to be split { - // Skip Portions with ExtraSpace -// while ( ( (nSplitPortion+1) < nPortions ) && (pPortion->GetTextPortions().GetObject(nSplitPortion+1)->GetKind() == PORTIONKIND_EXTRASPACE ) ) -// nSplitPortion++; - return nSplitPortion; } pTextPortion = pTP; @@ -2264,18 +2136,18 @@ sal_uInt16 ImpEditEngine::SplitTextPortion( ParaPortion* pPortion, sal_uInt16 nP } } - DBG_ASSERT( pTextPortion, "Position ausserhalb des Bereichs!" ); - DBG_ASSERT( pTextPortion->GetKind() == PORTIONKIND_TEXT, "SplitTextPortion: Keine TextPortion!" ); + DBG_ASSERT( pTextPortion, "Position outside the area!" ); + DBG_ASSERT( pTextPortion->GetKind() == PORTIONKIND_TEXT, "SplitTextPortion: No TextPortion!" ); sal_uInt16 nOverlapp = nTmpPos - nPos; pTextPortion->GetLen() = pTextPortion->GetLen() - nOverlapp; TextPortion* pNewPortion = new TextPortion( nOverlapp ); pPortion->GetTextPortions().Insert( pNewPortion, nSplitPortion+1 ); - // Groessen setzen: + // Set sizes if ( pCurLine ) { - // Kein neues GetTextSize, sondern Werte aus Array verwenden: - DBG_ASSERT( nPos > pCurLine->GetStart(), "SplitTextPortion am Anfang der Zeile?" ); + // No new GetTextSize, instead use values from the Array: + DBG_ASSERT( nPos > pCurLine->GetStart(), "SplitTextPortion at the beginning of the line?" ); pTextPortion->GetSize().Width() = pCurLine->GetCharPosArray()[ nPos-pCurLine->GetStart()-1 ]; if ( pTextPortion->GetExtraInfos() && pTextPortion->GetExtraInfos()->bCompressed ) @@ -2302,7 +2174,7 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* pParaPortion, sal_uInt16& r { sal_uInt16 nStartPos = rStart; ContentNode* pNode = pParaPortion->GetNode(); - DBG_ASSERT( pNode->Len(), "CreateTextPortions sollte nicht fuer leere Absaetze verwendet werden!" ); + DBG_ASSERT( pNode->Len(), "CreateTextPortions should not be used for empty paragraphs!" ); SortedPositions aPositions; aPositions.Insert( (sal_uInt32) 0 ); @@ -2311,8 +2183,8 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* pParaPortion, sal_uInt16& r EditCharAttrib* pAttrib = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttrib ) { - // Start und Ende in das Array eintragen... - // Die InsertMethode laesst keine doppelten Werte zu.... + // Insert Start and Ende in the Array... + // The InsertMethode does not allow for duplicate values.... aPositions.Insert( pAttrib->GetStart() ); aPositions.Insert( pAttrib->GetEnd() ); nAttr++; @@ -2345,9 +2217,9 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* pParaPortion, sal_uInt16& r aPositions.Insert( mpIMEInfos->aPos.GetIndex() + mpIMEInfos->nLen ); } - // Ab ... loeschen: - // Leider muss die Anzahl der TextPortions mit aPositions.Count() - // nicht uebereinstimmen, da evtl. Zeilenumbrueche... + // From ... Delete: + // Unfortunately, the number of text portions does not have to match with + // aPositions.Count(), since there possible are line breaks... sal_uInt16 nPortionStart = 0; sal_uInt16 nInvPortion = 0; sal_uInt16 nP; @@ -2363,18 +2235,18 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* pParaPortion, sal_uInt16& r break; } } - DBG_ASSERT( nP < pParaPortion->GetTextPortions().Count() || !pParaPortion->GetTextPortions().Count(), "Nichts zum loeschen: CreateTextPortions" ); + DBG_ASSERT( nP < pParaPortion->GetTextPortions().Count() || !pParaPortion->GetTextPortions().Count(), "Nothing to delete: CreateTextPortions" ); if ( nInvPortion && ( nPortionStart+pParaPortion->GetTextPortions().GetObject(nInvPortion)->GetLen() > nStartPos ) ) { - // lieber eine davor... - // Aber nur wenn es mitten in der Portion war, sonst ist es evtl. - // die einzige in der Zeile davor ! + // prefer one in front ... + // But only if it was in the middle of the portion of, otherwise it is + // possibly the only one in the row in front! nInvPortion--; nPortionStart = nPortionStart - pParaPortion->GetTextPortions().GetObject(nInvPortion)->GetLen(); } pParaPortion->GetTextPortions().DeleteFromPortion( nInvPortion ); - // Eine Portion kann auch durch einen Zeilenumbruch entstanden sein: + // A portion may also have been formed by a line break: aPositions.Insert( nPortionStart ); sal_uInt16 nInvPos; @@ -2390,35 +2262,34 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* pParaPortion, sal_uInt16& r pParaPortion->GetTextPortions().Insert( pNew, pParaPortion->GetTextPortions().Count()); } - DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "Keine Portions?!" ); + DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "No Portions?!" ); #ifdef EDITDEBUG - DBG_ASSERT( pParaPortion->DbgCheckTextPortions(), "Portions kaputt?" ); + DBG_ASSERT( pParaPortion->DbgCheckTextPortions(), "Portion is broken?" ); #endif } void ImpEditEngine::RecalcTextPortion( ParaPortion* pParaPortion, sal_uInt16 nStartPos, short nNewChars ) { - DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "Keine Portions!" ); - DBG_ASSERT( nNewChars, "RecalcTextPortion mit Diff == 0" ); + DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "No Portions!" ); + DBG_ASSERT( nNewChars, "RecalcTextPortion with Diff == 0" ); ContentNode* const pNode = pParaPortion->GetNode(); if ( nNewChars > 0 ) { - // Wenn an nStartPos ein Attribut beginnt/endet, faengt eine neue Portion - // an, ansonsten wird die Portion an nStartPos erweitert. - + // If an Attribute begins/ends at a nStartPos, then a new portion starts + // otherwise the portion is extended at nStartPos. if ( pNode->GetCharAttribs().HasBoundingAttrib( nStartPos ) || IsScriptChange( EditPaM( pNode, nStartPos ) ) ) { sal_uInt16 nNewPortionPos = 0; if ( nStartPos ) nNewPortionPos = SplitTextPortion( pParaPortion, nStartPos ) + 1; - // Eine leere Portion kann hier stehen, wenn der Absatz leer war, - // oder eine Zeile durch einen harten Zeilenumbruch entstanden ist. + // A blank portion may be here, when the paragraph was empty, + // or if a line was created through a hard line break. if ( ( nNewPortionPos < pParaPortion->GetTextPortions().Count() ) && !pParaPortion->GetTextPortions()[nNewPortionPos]->GetLen() ) { - DBG_ASSERT( pParaPortion->GetTextPortions()[nNewPortionPos]->GetKind() == PORTIONKIND_TEXT, "Leere Portion war keine TextPortion!" ); + DBG_ASSERT( pParaPortion->GetTextPortions()[nNewPortionPos]->GetKind() == PORTIONKIND_TEXT, "the empty portion was no TextPortion!" ); USHORT & r = pParaPortion->GetTextPortions()[nNewPortionPos]->GetLen(); r = r + nNewChars; @@ -2435,19 +2306,20 @@ void ImpEditEngine::RecalcTextPortion( ParaPortion* pParaPortion, sal_uInt16 nSt const sal_uInt16 nTP = pParaPortion->GetTextPortions(). FindPortion( nStartPos, nPortionStart ); TextPortion* const pTP = pParaPortion->GetTextPortions()[ nTP ]; - DBG_ASSERT( pTP, "RecalcTextPortion: Portion nicht gefunden" ); + DBG_ASSERT( pTP, "RecalcTextPortion: Portion not found" ); pTP->GetLen() = pTP->GetLen() + nNewChars; pTP->GetSize().Width() = (-1); } } else { - // Portion schrumpfen oder ggf. entfernen. - // Vor Aufruf dieser Methode muss sichergestellt sein, dass - // keine Portions in dem geloeschten Bereich lagen! + // Shrink or remove portion if necessary. + // Before calling this method it must be ensured that no portions were + // in the deleted area! - // Es darf keine reinragende oder im Bereich startende Portion geben, - // also muss nStartPos <= nPos <= nStartPos - nNewChars(neg.) sein + // There can be no purely outstanding portions or portions starting in + // the area, so it must be: + // nStartPos <= nPos <= nStartPos - nNewChars(neg.) sal_uInt16 nPortion = 0; sal_uInt16 nPos = 0; sal_uInt16 nEnd = nStartPos-nNewChars; @@ -2458,16 +2330,16 @@ void ImpEditEngine::RecalcTextPortion( ParaPortion* pParaPortion, sal_uInt16 nSt pTP = pParaPortion->GetTextPortions()[ nPortion ]; if ( ( nPos+pTP->GetLen() ) > nStartPos ) { - DBG_ASSERT( nPos <= nStartPos, "Start falsch!" ); - DBG_ASSERT( nPos+pTP->GetLen() >= nEnd, "End falsch!" ); + DBG_ASSERT( nPos <= nStartPos, "Wrong Start!" ); + DBG_ASSERT( nPos+pTP->GetLen() >= nEnd, "Wrong End!" ); break; } nPos = nPos + pTP->GetLen(); } - DBG_ASSERT( pTP, "RecalcTextPortion: Portion nicht gefunden" ); + DBG_ASSERT( pTP, "RecalcTextPortion: Portion not found" ); if ( ( nPos == nStartPos ) && ( (nPos+pTP->GetLen()) == nEnd ) ) { - // Portion entfernen; + // Remove portion; BYTE nType = pTP->GetKind(); pParaPortion->GetTextPortions().Remove( nPortion ); delete pTP; @@ -2476,7 +2348,7 @@ void ImpEditEngine::RecalcTextPortion( ParaPortion* pParaPortion, sal_uInt16 nSt TextPortion* pNext = pParaPortion->GetTextPortions()[ nPortion ]; if ( pNext && !pNext->GetLen() ) { - // Dummy-Portion entfernen + // Remove dummy portion pParaPortion->GetTextPortions().Remove( nPortion ); delete pNext; } @@ -2484,18 +2356,18 @@ void ImpEditEngine::RecalcTextPortion( ParaPortion* pParaPortion, sal_uInt16 nSt } else { - DBG_ASSERT( pTP->GetLen() > (-nNewChars), "Portion zu klein zum schrumpfen!" ); + DBG_ASSERT( pTP->GetLen() > (-nNewChars), "Portion too small to shrink! "); pTP->GetLen() = pTP->GetLen() + nNewChars; } - // ganz am Schluss darf keine HYPHENATOR-Portion stehen bleiben... - DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "RecalcTextPortions: Keine mehr da!" ); + // No HYPHENATOR portion is allowed to get stuck right at the end... + DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "RecalcTextPortions: No longer there! "); sal_uInt16 nLastPortion = pParaPortion->GetTextPortions().Count() - 1; pTP = pParaPortion->GetTextPortions().GetObject( nLastPortion ); if ( pTP->GetKind() == PORTIONKIND_HYPHENATOR ) { - // Portion wegschmeissen, ggf. die davor korrigieren, wenn - // die Hyph-Portion ein Zeichen geschluckt hat... + // Discard portion if possible, correct the ones before, + // when the Hyphenator portion has swallowed one character... pParaPortion->GetTextPortions().Remove( nLastPortion ); if ( nLastPortion && pTP->GetLen() ) { @@ -2508,7 +2380,7 @@ void ImpEditEngine::RecalcTextPortion( ParaPortion* pParaPortion, sal_uInt16 nSt } } #ifdef EDITDEBUG - DBG_ASSERT( pParaPortion->DbgCheckTextPortions(), "Portions kaputt?" ); + DBG_ASSERT( pParaPortion->DbgCheckTextPortions(), "Portions are broken?" ); #endif } @@ -2563,9 +2435,9 @@ void ImpEditEngine::SetFixedCellHeight( BOOL bUseFixedCellHeight ) void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rFont, OutputDevice* pOut, sal_uInt16 nIgnoreWhich ) { - // Es war mal geplant, SeekCursor( nStartPos, nEndPos, ... ), damit nur - // ab der StartPosition neu gesucht wird. - // Problem: Es mussten zwei Listen beruecksichtigt/gefuehrt werden: + // It was planned, SeekCursor( nStartPos, nEndPos, ... ), so that it would + // only be searched anew at the StartPosition. + // Problem: There would be two Listen to consider/handle: // OrderedByStart,OrderedByEnd. if ( nPos > pNode->Len() ) @@ -2618,17 +2490,15 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rF EditCharAttrib* pAttrib = GetAttrib( rAttribs, nAttr ); while ( pAttrib && ( pAttrib->GetStart() <= nPos ) ) { - // Beim Seeken nicht die Attr beruecksichtigen, die dort beginnen! - // Leere Attribute werden beruecksichtigt( verwendet), da diese - // gerade eingestellt wurden. - // 12.4.95: Doch keine Leeren Attribute verwenden: - // - Wenn gerade eingestellt und leer => keine Auswirkung auf Font - // In einem leeren Absatz eingestellte Zeichen werden sofort wirksam. + // when seeking, ignore attributes which start there! Empty attributes + // are considered (used as these are just set. But do not use empty + // attributes: When just set and empty => no effect on font + // In a blank paragraph, set characters take effect immediately. if ( ( pAttrib->Which() != nIgnoreWhich ) && ( ( ( pAttrib->GetStart() < nPos ) && ( pAttrib->GetEnd() >= nPos ) ) || ( !pNode->Len() ) ) ) { - DBG_ASSERT( ( pAttrib->Which() >= EE_CHAR_START ) && ( pAttrib->Which() <= EE_FEATURE_END ), "Unglueltiges Attribut in Seek() " ); + DBG_ASSERT( ( pAttrib->Which() >= EE_CHAR_START ) && ( pAttrib->Which() <= EE_FEATURE_END ), "Invalid Attribute in Seek() " ); if ( IsScriptItemValid( pAttrib->Which(), nScriptType ) ) { pAttrib->SetFont( rFont, pOut ); @@ -2659,20 +2529,18 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rF if ( aStatus.DoNotUseColors() ) { - // Hack fuer DL,weil JOE staendig die Pooldefaults verbiegt! - // const SvxColorItem& rColorItem = (const SvxColorItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_COLOR ); rFont.SetColor( /* rColorItem.GetValue() */ COL_BLACK ); } if ( aStatus.DoStretch() || ( nRelWidth != 100 ) ) { - // Fuer das aktuelle Ausgabegeraet, weil es sonst bei einem - // Drucker als RefDev auf dem Bildschirm #?!@' aussieht! + // For the current Output device, because otherwise it looks on + // a printer as RefDev does on the screen! OutputDevice* pDev = pOut ? pOut : GetRefDevice(); rFont.SetPhysFont( pDev ); FontMetric aMetric( pDev->GetFontMetric() ); - // Fuer die Hoehe nicht die Metriken nehmen, da das bei - // Hoch-/Tiefgestellt schief geht. + // For the height do not consider the metrics, because it will go + // wrong at Superscript/Subscript. Size aRealSz( aMetric.GetSize().Width(), rFont.GetSize().Height() ); if ( aStatus.DoStretch() ) { @@ -2693,23 +2561,22 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rF aRealSz.Width() *= nStretchX; aRealSz.Width() /= 100; - // Auch das Kerning: (long wegen Zwischenergebnis) + // Also the Kerning: (long to handle Interim results) long nKerning = rFont.GetFixKerning(); /* - Die Ueberlegung war: Wenn neg. Kerning, aber StretchX = 200 - => Nicht das Kerning verdoppelt, also die Buchstaben weiter - zusammenziehen + The consideration was: When negative Kerning, but StretchX = 200 + => Do not double the Kerning, so pull the letters closer together --------------------------- Kern StretchX =>Kern --------------------------- >0 <100 < (Proportional) <0 <100 < (Proportional) >0 >100 > (Proportional) - <0 >100 < (Der Betrag, also Antiprop) + <0 >100 < (The amount eg. Disproportional) */ if ( ( nKerning < 0 ) && ( nStretchX > 100 ) ) { - // Antiproportional + // Disproportional nKerning *= 100; nKerning /= nStretchX; } @@ -2729,7 +2596,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rF aRealSz.Width() /= 100; } rFont.SetSize( aRealSz ); - // Font wird nicht restauriert... + // Font is not restored ... } if ( ( ( rFont.GetColor() == COL_AUTO ) || ( IsForceAutoColor() ) ) && pOut ) @@ -2786,9 +2653,9 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rF void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics, SvxFont& rFont ) { - // Fuer Zeilenhoehe bei Hoch/Tief erstmal ohne Propr! + // Line heights at high / low first without Propr! sal_uInt16 nPropr = rFont.GetPropr(); - DBG_ASSERT( ( nPropr == 100 ) || rFont.GetEscapement(), "Propr ohne Escape?!" ); + DBG_ASSERT( ( nPropr == 100 ) || rFont.GetEscapement(), "Propr without Escape?!" ); if ( nPropr != 100 ) { rFont.SetPropr( 100 ); @@ -2805,52 +2672,35 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics if ( IsFixedCellHeight() ) { -/* creating correct proportional ascent and descent values lead to problems if different fonts are used - in the same portion, it results in a bigger linespacing. - sal_Int32 f = nAscent + nDescent; - if ( f ) - { - sal_Int32 nHeight = ImplCalculateFontIndependentLineSpacing( rFont.GetHeight() ); - nAscent = (sal_Int16)(( nHeight * nAscent ) / f ); - nDescent = (sal_Int16)(nHeight - nAscent); - } -*/ nAscent = sal::static_int_cast< sal_uInt16 >( rFont.GetHeight() ); nDescent= sal::static_int_cast< sal_uInt16 >( ImplCalculateFontIndependentLineSpacing( rFont.GetHeight() ) - nAscent ); } else { sal_uInt16 nIntLeading = ( aMetric.GetIntLeading() > 0 ) ? (sal_uInt16)aMetric.GetIntLeading() : 0; - // Fonts ohne Leading bereiten Probleme + // Fonts without leading cause problems if ( ( nIntLeading == 0 ) && ( pRefDev->GetOutDevType() == OUTDEV_PRINTER ) ) { - // Da schaun wir mal, was fuer eine Leading ich auf dem - // Bildschirm erhalte + // Lets see what Leading one gets on the screen VirtualDevice* pVDev = GetVirtualDevice( pRefDev->GetMapMode(), pRefDev->GetDrawMode() ); rFont.SetPhysFont( pVDev ); aMetric = pVDev->GetFontMetric(); - // Damit sich die Leading nicht wieder rausrechnet, - // wenn die ganze Zeile den Font hat, nTmpLeading. - - // 4/96: Kommt bei HP Laserjet 4V auch nicht hin - // => Werte komplett vom Bildschirm holen. - // sal_uInt16 nTmpLeading = (sal_uInt16)aMetric.GetLeading(); - // nAscent += nTmpLeading; + // This is so that the Leading does not count itself out again, + // if the whole line has the font nTmpLeading. nAscent = (sal_uInt16)aMetric.GetAscent(); nDescent = (sal_uInt16)aMetric.GetDescent(); - // nLeading = (sal_uInt16)aMetric.GetLeading(); } } if ( nAscent > rCurMetrics.nMaxAscent ) rCurMetrics.nMaxAscent = nAscent; if ( nDescent > rCurMetrics.nMaxDescent ) rCurMetrics.nMaxDescent= nDescent; - // Sonderbehandlung Hoch/Tief: + // Special treatment of high/low: if ( rFont.GetEscapement() ) { - // Jetzt unter Beruecksichtigung von Escape/Propr - // Ascent oder Descent ggf vergroessern + // Now in consideration from Escape/Propr + // Ascent or Descent possibly enlarge short nDiff = (short)(rFont.GetSize().Height()*rFont.GetEscapement()/100L); if ( rFont.GetEscapement() > 0 ) { @@ -2858,7 +2708,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics if ( nAscent > rCurMetrics.nMaxAscent ) rCurMetrics.nMaxAscent = nAscent; } - else // muss < 0 sein + else // has to be < 0 { nDescent = (sal_uInt16) (((long)nDescent)*nPropr/100 - nDiff); if ( nDescent > rCurMetrics.nMaxDescent ) @@ -2881,15 +2731,15 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta EditLine* pLine; Point aTmpPos; Point aRedLineTmpPos; - DBG_ASSERT( GetParaPortions().Count(), "Keine ParaPortion?!" ); + DBG_ASSERT( GetParaPortions().Count(), "No ParaPortion?!" ); SvxFont aTmpFont( GetParaPortions()[0]->GetNode()->GetCharAttribs().GetDefFont() ); Font aOldFont( pOutDev->GetFont() ); vcl::PDFExtOutDevData* pPDFExtOutDevData = PTR_CAST( vcl::PDFExtOutDevData, pOutDev->GetExtOutDevData() ); - // Bei gedrehtem Text wird aStartPos als TopLeft angesehen, da andere - // Informationen fehlen, und sowieso das ganze Object ungescrollt - // dargestellt wird. - // Das Rechteck ist unendlich gross. + // In the case of rotated text is aStartPos considered TopLeft because + // other information is missing, and since the whole object is shown anyway + // un-scrolled. + // The rectangle is infinite. Point aOrigin( aStartPos ); double nCos = 0.0, nSin = 0.0; if ( nOrientation ) @@ -2904,22 +2754,17 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta GDIMetaFile* pMtf = pOutDev->GetConnectMetaFile(); const bool bMetafileValid( pMtf != NULL ); - // Fuer OnlineSpelling: -// EditPaM aCursorPos; -// if( GetStatus().DoOnlineSpelling() && pActiveView ) -// aCurPos = pActiveView->pImpEditView->GetEditSelections().Max(); - long nVertLineSpacing = CalcVertLineSpacing(aStartPos); // -------------------------------------------------- - // Ueber alle Absaetze... + // Over all the paragraphs ... // -------------------------------------------------- for ( sal_uInt16 n = 0; n < GetParaPortions().Count(); n++ ) { ParaPortion* pPortion = GetParaPortions().GetObject( n ); DBG_ASSERT( pPortion, "NULL-Pointer in TokenList in Paint" ); - // falls beim Tippen Idle-Formatierung, asynchrones Paint. - // Unsichtbare Portions koennen ungueltig sein. + // if when typing idle formatting, asynchronous Paint. + // Invisible Portions may be invalid. if ( pPortion->IsVisible() && pPortion->IsInvalid() ) return; @@ -2934,7 +2779,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta { // -------------------------------------------------- - // Ueber die Zeilen des Absatzes... + // On the lines of the paragraph ... // -------------------------------------------------- sal_uInt16 nLines = pPortion->GetLines().Count(); sal_uInt16 nLastLine = nLines-1; @@ -2952,7 +2797,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ ) { pLine = pPortion->GetLines().GetObject(nLine); - DBG_ASSERT( pLine, "NULL-Pointer im Zeileniterator in UpdateViews" ); + DBG_ASSERT( pLine, "NULL-Pointer in the line iterator in UpdateViews" ); aTmpPos = aStartPos; if ( !IsVertical() ) { @@ -2980,46 +2825,33 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta // does, too. No change for not-layouting (painting). if(0 == nLine) // && !bStripOnly) { - // VERT??? GetEditEnginePtr()->PaintingFirstLine( n, aParaStart, aTmpPos.Y(), aOrigin, nOrientation, pOutDev ); } // -------------------------------------------------- - // Ueber die Portions der Zeile... + // Over the Portions of the line ... // -------------------------------------------------- nIndex = pLine->GetStart(); for ( sal_uInt16 y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ ) { - DBG_ASSERT( pPortion->GetTextPortions().Count(), "Zeile ohne Textportion im Paint!" ); + DBG_ASSERT( pPortion->GetTextPortions().Count(), "Line without'''' Textportion in Paint!" ); TextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( y ); - DBG_ASSERT( pTextPortion, "NULL-Pointer im Portioniterator in UpdateViews" ); + DBG_ASSERT( pTextPortion, "NULL-Pointer in Portion iterator in UpdateViews" ); long nPortionXOffset = GetPortionXOffset( pPortion, pLine, y ); if ( !IsVertical() ) { aTmpPos.X() = aStartPos.X() + nPortionXOffset; if ( aTmpPos.X() > aClipRec.Right() ) - break; // Keine weitere Ausgabe in Zeile noetig + break; // No further output in line necessary } else { aTmpPos.Y() = aStartPos.Y() + nPortionXOffset; if ( aTmpPos.Y() > aClipRec.Bottom() ) - break; // Keine weitere Ausgabe in Zeile noetig + break; // No further output in line necessary } - // R2L replaces with obove... - // New position after processing R2L text... -// R2L if ( nR2LWidth && !pTextPortion->GetRightToLeft() ) -// R2L { -// R2L if ( !IsVertical() ) -// R2L aTmpPos.X() += nR2LWidth; -// R2L else -// R2L aTmpPos.Y() += nR2LWidth; -// R2L -// R2L nR2LWidth = 0; -// R2L } - switch ( pTextPortion->GetKind() ) { case PORTIONKIND_TEXT: @@ -3170,8 +3002,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta else if ( pTextPortion->GetKind() == PORTIONKIND_FIELD ) { EditCharAttrib* pAttr = pPortion->GetNode()->GetCharAttribs().FindFeature( nIndex ); - DBG_ASSERT( pAttr, "Feld nicht gefunden" ); - DBG_ASSERT( pAttr && pAttr->GetItem()->ISA( SvxFieldItem ), "Feld vom falschen Typ!" ); + DBG_ASSERT( pAttr, "Field not found"); + DBG_ASSERT( pAttr && pAttr->GetItem()->ISA( SvxFieldItem ), "Field of the wrong type! "); aText = ((EditCharAttribField*)pAttr)->GetFieldValue(); nTextStart = 0; nTextLen = aText.Len(); @@ -3224,24 +3056,6 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta if (pTextPortion->IsRightToLeft()) aRedLineTmpPos.X() += pTextPortion->GetSize().Width(); -//L2R if ( pTextPortion->GetRightToLeft() ) -//L2R { -//L2R sal_uInt16 nNextPortion = y+1; -//L2R while ( nNextPortion <= pLine->GetEndPortion() ) -//L2R { -//L2R TextPortion* pNextTextPortion = pPortion->GetTextPortions().GetObject( nNextPortion ); -//L2R if ( pNextTextPortion->GetRightToLeft() ) -//L2R { -//L2R if ( !IsVertical() ) -//L2R aOutPos.X() += pNextTextPortion->GetSize().Width(); -//L2R else -//L2R aOutPos.Y() += pNextTextPortion->GetSize().Width(); -//L2R } -//L2R else -//L2R break; -//L2R nNextPortion++; -//L2R } -//L2R } if ( bStripOnly ) { EEngineData::WrongSpellVector aWrongSpellVector; @@ -3340,7 +3154,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta short nEsc = aTmpFont.GetEscapement(); if ( nOrientation ) { - // Bei Hoch/Tief selbst Hand anlegen: + // In case of high/low self-evident: if ( aTmpFont.GetEscapement() ) { long nDiff = aTmpFont.GetSize().Height() * aTmpFont.GetEscapement() / 100L; @@ -3357,23 +3171,25 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta aTmpFont.SetPhysFont( pOutDev ); } - // nur ausgeben, was im sichtbaren Bereich beginnt: - // Wichtig, weil Bug bei einigen Grafikkarten bei transparentem Font, Ausgabe bei neg. + + // Take only what begins in the visible range: + // Important, because of a bug in some graphic cards + // when transparent font, output when negative if ( nOrientation || ( !IsVertical() && ( ( aTmpPos.X() + nTxtWidth ) >= nFirstVisXPos ) ) || ( IsVertical() && ( ( aTmpPos.Y() + nTxtWidth ) >= nFirstVisYPos ) ) ) { if ( nEsc && ( ( aTmpFont.GetUnderline() != UNDERLINE_NONE ) ) ) { - // Das Hoch/Tief ohne Underline malen, das Underline - // auf der BaseLine der Original-Fonthoehe ausgeben... - - // Aber nur, wenn davor auch Unterstrichen! + // Paint the high/low without underline, + // Display the Underline on the + // base line of the original font height ... + // But only if there was an underscores before! sal_Bool bSpecialUnderline = sal_False; EditCharAttrib* pPrev = pPortion->GetNode()->GetCharAttribs().FindAttrib( EE_CHAR_ESCAPEMENT, nIndex ); if ( pPrev ) { SvxFont aDummy; - // Unterstreichung davor? + // Underscore in front? if ( pPrev->GetStart() ) { SeekCursor( pPortion->GetNode(), pPrev->GetStart(), aDummy ); @@ -3499,24 +3315,6 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta if ( pTmpDXArray ) delete[] pTmpDXArray; -// R2L if ( !pTextPortion->GetRightToLeft() ) -// R2L { -// R2L if ( !IsVertical() ) -// R2L aTmpPos.X() += nTxtWidth; -// R2L else -// R2L aTmpPos.Y() += nTxtWidth; -// R2L } -// R2L else -// R2L { -// R2L nR2LWidth += nTxtWidth; -// R2L } - - if ( pTextPortion->GetKind() == PORTIONKIND_FIELD ) - { - EditCharAttrib* pAttr = pPortion->GetNode()->GetCharAttribs().FindFeature( nIndex ); - DBG_ASSERT( pAttr, "Feld nicht gefunden" ); - DBG_ASSERT( pAttr && pAttr->GetItem()->ISA( SvxFieldItem ), "Feld vom falschen Typ!" ); - // add a meta file comment if we record to a metafile if( bMetafileValid ) { @@ -3534,23 +3332,9 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta } break; -// case PORTIONKIND_EXTRASPACE: - case PORTIONKIND_TAB: - { - if ( pTextPortion->GetExtraValue() && ( pTextPortion->GetExtraValue() != ' ' ) ) - { - SeekCursor( pPortion->GetNode(), nIndex+1, aTmpFont, pOutDev ); - aTmpFont.SetTransparent( sal_False ); - aTmpFont.SetEscapement( 0 ); - aTmpFont.SetPhysFont( pOutDev ); - long nCharWidth = aTmpFont.QuickGetTextSize( pOutDev, pTextPortion->GetExtraValue(), 0, 1, NULL ).Width(); - long nChars = 2; - if( nCharWidth ) - nChars = pTextPortion->GetSize().Width() / nCharWidth; - if ( nChars < 2 ) - nChars = 2; // wird durch DrawStretchText gestaucht. + nChars = 2; // is compressed by DrawStretchText. else if ( nChars == 2 ) - nChars = 3; // sieht besser aus + nChars = 3; // looks better String aText; aText.Fill( (USHORT)nChars, pTextPortion->GetExtraValue() ); @@ -3590,7 +3374,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta aStartPos.X() -= nSBL; } - // keine sichtbaren Aktionen mehr? + // no more visible actions? if ( !IsVertical() && ( aStartPos.Y() >= aClipRec.Bottom() ) ) break; else if ( IsVertical() && ( aStartPos.X() <= aClipRec.Left() ) ) @@ -3618,7 +3402,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta if ( pPDFExtOutDevData ) pPDFExtOutDevData->EndStructureElement(); - // keine sichtbaren Aktionen mehr? + // no more visible actions? if ( !IsVertical() && ( aStartPos.Y() > aClipRec.Bottom() ) ) break; if ( IsVertical() && ( aStartPos.X() < aClipRec.Left() ) ) @@ -3630,13 +3414,13 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool bUseVirtDev ) { - DBG_ASSERT( pView, "Keine View - Kein Paint!" ); + DBG_ASSERT( pView, "No View - No Paint!" ); DBG_CHKOBJ( GetEditEnginePtr(), EditEngine, 0 ); if ( !GetUpdateMode() || IsInUndo() ) return; - // Schnittmenge aus Paintbereich und OutputArea. + // Intersection of paint area and output area. Rectangle aClipRec( pView->GetOutputArea() ); aClipRec.Intersection( rRec ); @@ -3657,7 +3441,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b aClipRecPixel.Bottom() += 1; } - // Wenn aClipRecPixel > XXXX, dann invalidieren ?! + // If aClipRecPixel > XXXX, then invalidate?! VirtualDevice* pVDev = GetVirtualDevice( pOutWin->GetMapMode(), pOutWin->GetDrawMode() ); pVDev->SetDigitLanguage( GetRefDevice()->GetDigitLanguage() ); @@ -3699,8 +3483,8 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b } else { - // Das VirtDev kann bei einem Resize sehr gross werden => - // irgendwann mal kleiner machen! + // The VirtDev can become very big during a Resize => + // eventually make it smaller! if ( ( aOutSz.Height() > ( aClipRecPixel.GetHeight() + RESDIFF ) ) || ( aOutSz.Width() > ( aClipRecPixel.GetWidth() + RESDIFF ) ) ) { @@ -3711,15 +3495,15 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b pVDev->Erase(); } } - DBG_ASSERT( bVDevValid, "VDef konnte nicht vergroessert werden!" ); + DBG_ASSERT( bVDevValid, "VDef could not be enlarged!" ); if ( !bVDevValid ) { Paint( pView, rRec, sal_False /* ohne VDev */ ); return; } - // PaintRect fuer VDev nicht mit alignter Groesse, - // da sonst die Zeile darunter auch ausgegeben werden muss: + // PaintRect for VDev not with aligner size, + // Otherwise, the line below must also be printed out: Rectangle aTmpRec( Point( 0, 0 ), aClipRec.GetSize() ); aClipRec = pOutWin->PixelToLogic( aClipRecPixel ); @@ -3747,12 +3531,9 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b if ( GetTextRanger() ) { // Some problems here with push/pop, why?! -// pOutWin->Push( PUSH_CLIPREGION|PUSH_MAPMODE ); - bClipRegion = pOutWin->IsClipRegion(); - aOldRegion = pOutWin->GetClipRegion(); - // Wie bekomme ich das Polygon an die richtige Stelle???? - // Das Polygon bezieht sich auf die View, nicht auf das Window - // => Origin umsetzen... + // How do I get the polygon to the right place?? + // The polygon is based on the view, not the Window + // => reset origin... aOldMapMode = pOutWin->GetMapMode(); Point aOrigin = aOldMapMode.GetOrigin(); Point aViewPos = pView->GetOutputArea().TopLeft(); @@ -3769,36 +3550,10 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b if ( GetTextRanger() ) { -// pOutWin->Pop(); - if ( bClipRegion ) - pOutWin->SetClipRegion( aOldRegion ); - else - pOutWin->SetClipRegion(); - pOutWin->SetMapMode( aOldMapMode ); - } - - - pView->DrawSelection(); - } - else - { - Point aStartPos; - if ( !IsVertical() ) - { - aStartPos = pView->GetOutputArea().TopLeft(); - aStartPos.X() -= pView->GetVisDocLeft(); - aStartPos.Y() -= pView->GetVisDocTop(); - } - else - { - aStartPos = pView->GetOutputArea().TopRight(); - aStartPos.X() += pView->GetVisDocTop(); - aStartPos.Y() -= pView->GetVisDocLeft(); - } - - // Wenn Doc-Breite < OutputArea,Width, nicht umgebrochene Felder, - // stehen die Felder sonst �ber, wenn > Zeile. - // ( Oben nicht, da dort bereits Doc-Breite von Formatierung mit drin ) + // If Doc-width < Output Area,Width then not wrapped fields, + // the fields usually protrude if > line. + // (Not at the top, since there the Doc-width from formatting is already + // there) if ( !IsVertical() && ( pView->GetOutputArea().GetWidth() > GetPaperSize().Width() ) ) { long nMaxX = pView->GetOutputArea().Left() + GetPaperSize().Width(); @@ -3826,8 +3581,8 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b void ImpEditEngine::InsertContent( ContentNode* pNode, sal_uInt16 nPos ) { - DBG_ASSERT( pNode, "NULL-Poointer in InsertContent! " ); - DBG_ASSERT( IsInUndo(), "InsertContent nur fuer Undo()!" ); + DBG_ASSERT( pNode, "NULL-Pointer in InsertContent! " ); + DBG_ASSERT( IsInUndo(), "InsertContent only for Undo()!" ); ParaPortion* pNew = new ParaPortion( pNode ); GetParaPortions().Insert( pNew, nPos ); aEditDoc.Insert( pNode, nPos ); @@ -3838,9 +3593,9 @@ void ImpEditEngine::InsertContent( ContentNode* pNode, sal_uInt16 nPos ) EditPaM ImpEditEngine::SplitContent( sal_uInt16 nNode, sal_uInt16 nSepPos ) { ContentNode* pNode = aEditDoc.SaveGetObject( nNode ); - DBG_ASSERT( pNode, "Ungueltiger Node in SplitContent" ); - DBG_ASSERT( IsInUndo(), "SplitContent nur fuer Undo()!" ); - DBG_ASSERT( nSepPos <= pNode->Len(), "Index im Wald: SplitContent" ); + DBG_ASSERT( pNode, "Invalid Node in SplitContent" ); + DBG_ASSERT( IsInUndo(), "SplitContent only for Undo()!" ); + DBG_ASSERT( nSepPos <= pNode->Len(), "Index out of range: SplitContent" ); EditPaM aPaM( pNode, nSepPos ); return ImpInsertParaBreak( aPaM ); } @@ -3849,9 +3604,9 @@ EditPaM ImpEditEngine::ConnectContents( sal_uInt16 nLeftNode, sal_Bool bBackward { ContentNode* pLeftNode = aEditDoc.SaveGetObject( nLeftNode ); ContentNode* pRightNode = aEditDoc.SaveGetObject( nLeftNode+1 ); - DBG_ASSERT( pLeftNode, "Ungueltiger linker Node in ConnectContents" ); - DBG_ASSERT( pRightNode, "Ungueltiger rechter Node in ConnectContents" ); - DBG_ASSERT( IsInUndo(), "ConnectContent nur fuer Undo()!" ); + DBG_ASSERT( pLeftNode, "Invalid left node in ConnectContents "); + DBG_ASSERT( pRightNode, "Invalid right node in ConnectContents "); + DBG_ASSERT( IsInUndo(), "ConnectContent only for Undo()!" ); return ImpConnectParagraphs( pLeftNode, pRightNode, bBackward ); } @@ -3859,23 +3614,12 @@ void ImpEditEngine::SetUpdateMode( sal_Bool bUp, EditView* pCurView, sal_Bool bF { sal_Bool bChanged = ( GetUpdateMode() != bUp ); - // Beim Umschalten von sal_True auf sal_False waren alle Selektionen sichtbar, - // => Wegmalen - // Umgekehrt waren alle unsichtbar => malen - -// DrawAllSelections(); sieht im Outliner schlecht aus ! -// EditView* pView = aEditViewList.First(); -// while ( pView ) -// { -// DBG_CHKOBJ( pView, EditView, 0 ); -// pView->pImpEditView->DrawSelection(); -// pView = aEditViewList.Next(); -// } - - // Wenn !bFormatted, also z.B. nach SetText, braucht bei UpdateMode sal_True - // nicht sofort formatiert werden, weil warscheinlich noch Text kommt. - // Spaetestens bei einem Paint / CalcTextWidth wird formatiert. - + // When switching from sal_True to sal_False, all selections were visible, + // => paint over + // the other hand, were all invisible => paint + // If !bFormatted, eg for example after SetText, then sal_True does not ä + // format immediately for update mode, probably because more text is coming. + // At Latest it is formatted at a Paint/CalcTextWidth. bUpdate = bUp; if ( bUpdate && ( bChanged || bForceUpdate ) ) FormatAndUpdate( pCurView ); @@ -3884,32 +3628,21 @@ void ImpEditEngine::SetUpdateMode( sal_Bool bUp, EditView* pCurView, sal_Bool bF void ImpEditEngine::ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow ) { ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); - DBG_ASSERT( pPPortion, "ShowParagraph: Absatz existiert nicht!" ); + DBG_ASSERT( pPPortion, "ShowParagraph: Paragraph does not exist! "); if ( pPPortion && ( pPPortion->IsVisible() != bShow ) ) { pPPortion->SetVisible( bShow ); if ( !bShow ) { - // Als deleted kenzeichnen, damit keine Selektion auf diesem - // Absatz beginnt oder endet... + // Mark as deleted, so that no selection will end or begin at + // this paragraph... DeletedNodeInfo* pDelInfo = new DeletedNodeInfo( (sal_uIntPtr)pPPortion->GetNode(), nParagraph ); aDeletedNodes.Insert( pDelInfo, aDeletedNodes.Count() ); UpdateSelections(); - // Dann kriege ich den unteren Bereich nicht invalidiert, - // wenn UpdateMode = sal_False! - // Wenn doch, dann vor SetVisible auf sal_False merken! -// nCurTextHeight -= pPPortion->GetHeight(); - } - - if ( bShow && ( pPPortion->IsInvalid() || !pPPortion->nHeight ) ) - { - if ( !GetTextRanger() ) - { - if ( pPPortion->IsInvalid() ) - { - Font aOldFont( GetRefDevice()->GetFont() ); - CreateLines( nParagraph, 0 ); // 0: Kein TextRanger + // The region below will not be invalidated if UpdateMode = sal_False! + // If anyway, then set SetVisible to sal_False! + CreateLines( nParagraph, 0 ); // 0: No TextRanger if ( aStatus.DoRestoreFont() ) GetRefDevice()->SetFont( aOldFont ); } @@ -3938,7 +3671,7 @@ void ImpEditEngine::ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow ) sal_Bool ImpEditEngine::IsParagraphVisible( sal_uInt16 nParagraph ) { ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); - DBG_ASSERT( pPPortion, "IsParagraphVisible: Absatz existiert nicht!" ); + DBG_ASSERT( pPPortion, "IsParagraphVisible: Paragraph does not exist! "); if ( pPPortion ) return pPPortion->IsVisible(); return sal_False; @@ -3946,7 +3679,7 @@ sal_Bool ImpEditEngine::IsParagraphVisible( sal_uInt16 nParagraph ) EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNewPos, EditView* pCurView ) { - DBG_ASSERT( GetParaPortions().Count() != 0, "Keine Absaetze gefunden: MoveParagraphs" ); + DBG_ASSERT( GetParaPortions().Count() != 0, "No paragraphs found: MoveParagraphs" ); if ( GetParaPortions().Count() == 0 ) return EditSelection(); aOldPositions.Justify(); @@ -3956,20 +3689,20 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNe if ( nNewPos >= GetParaPortions().Count() ) nNewPos = GetParaPortions().Count() - 1; - // Dort, wo der Absatz eingefuegt wurde, muss richtig gepainted werden: - // Dort, wo der Absatz entfernt wurde, muss richtig gepainted werden: - // ( Und dazwischen entsprechend auch...) + // Where the paragraph was inserted it has to be properly redrawn: + // Where the paragraph was removed it has to be properly redrawn: + // ( and correspondingly in between as well...) if ( pCurView && ( GetUpdateMode() == sal_True ) ) { - // in diesem Fall kann ich direkt neu malen, ohne die - // Portions zu Invalidieren. + // in this case one can redraw directly whithout invalidating the + // Portions sal_uInt16 nFirstPortion = Min( (sal_uInt16)aOldPositions.Min(), nNewPos ); sal_uInt16 nLastPortion = Max( (sal_uInt16)aOldPositions.Max(), nNewPos ); ParaPortion* pUpperPortion = GetParaPortions().SaveGetObject( nFirstPortion ); ParaPortion* pLowerPortion = GetParaPortions().SaveGetObject( nLastPortion ); - aInvalidRec = Rectangle(); // leermachen + aInvalidRec = Rectangle(); // make empty aInvalidRec.Left() = 0; aInvalidRec.Right() = aPaperSize.Width(); aInvalidRec.Top() = GetParaPortions().GetYOffset( pUpperPortion ); @@ -3979,7 +3712,7 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNe } else { - // aber der oberen ungueltigen Position neu painten... + // but redraw at the upper invalid position sal_uInt16 nFirstInvPara = Min( (sal_uInt16)aOldPositions.Min(), nNewPos ); InvalidateFromParagraph( nFirstInvPara ); } @@ -3988,9 +3721,8 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_uInt16 nNe void ImpEditEngine::InvalidateFromParagraph( sal_uInt16 nFirstInvPara ) { - // Es werden nicht die folgenden Absaetze invalidiert, - // da ResetHeight() => Groessenanderung => alles folgende wird - // sowieso neu ausgegeben. + // The following paragraphs are not invalidated, since ResetHeight() + // => size change => all the following are re-issued anyway. ParaPortion* pTmpPortion; if ( nFirstInvPara != 0 ) { @@ -4016,19 +3748,19 @@ void ImpEditEngine::CallStatusHdl() { if ( aStatusHdlLink.IsSet() && aStatus.GetStatusWord() ) { - // Der Status muss vor Call zurueckgesetzt werden, - // da im Hdl evtl. weitere Fags gesetzt werden... + // The Status has to be reset before the Call, + // since other Flags might be set in the handler... EditStatus aTmpStatus( aStatus ); aStatus.Clear(); aStatusHdlLink.Call( &aTmpStatus ); - aStatusTimer.Stop(); // Falls von Hand gerufen... + aStatusTimer.Stop(); // If created by hand ... } } ContentNode* ImpEditEngine::GetPrevVisNode( ContentNode* pCurNode ) { ParaPortion* pPortion = FindParaPortion( pCurNode ); - DBG_ASSERT( pPortion, "GetPrevVisibleNode: Keine passende Portion!" ); + DBG_ASSERT( pPortion, "GetPrevVisibleNode: No matching portion!" ); pPortion = GetPrevVisPortion( pPortion ); if ( pPortion ) return pPortion->GetNode(); @@ -4038,7 +3770,7 @@ ContentNode* ImpEditEngine::GetPrevVisNode( ContentNode* pCurNode ) ContentNode* ImpEditEngine::GetNextVisNode( ContentNode* pCurNode ) { ParaPortion* pPortion = FindParaPortion( pCurNode ); - DBG_ASSERT( pPortion, "GetNextVisibleNode: Keine passende Portion!" ); + DBG_ASSERT( pPortion, "GetNextVisibleNode: No matching portion!" ); pPortion = GetNextVisPortion( pPortion ); if ( pPortion ) return pPortion->GetNode(); @@ -4048,7 +3780,7 @@ ContentNode* ImpEditEngine::GetNextVisNode( ContentNode* pCurNode ) ParaPortion* ImpEditEngine::GetPrevVisPortion( ParaPortion* pCurPortion ) { sal_uInt16 nPara = GetParaPortions().GetPos( pCurPortion ); - DBG_ASSERT( nPara < GetParaPortions().Count() , "Portion nicht gefunden: GetPrevVisPortion" ); + DBG_ASSERT( nPara < GetParaPortions().Count() , "Portion not found: GetPrevVisPortion" ); ParaPortion* pPortion = nPara ? GetParaPortions()[--nPara] : 0; while ( pPortion && !pPortion->IsVisible() ) pPortion = nPara ? GetParaPortions()[--nPara] : 0; @@ -4059,7 +3791,7 @@ ParaPortion* ImpEditEngine::GetPrevVisPortion( ParaPortion* pCurPortion ) ParaPortion* ImpEditEngine::GetNextVisPortion( ParaPortion* pCurPortion ) { sal_uInt16 nPara = GetParaPortions().GetPos( pCurPortion ); - DBG_ASSERT( nPara < GetParaPortions().Count() , "Portion nicht gefunden: GetPrevVisNode" ); + DBG_ASSERT( nPara < GetParaPortions().Count() , "Portion not found: GetPrevVisNode" ); ParaPortion* pPortion = GetParaPortions().SaveGetObject( ++nPara ); while ( pPortion && !pPortion->IsVisible() ) pPortion = GetParaPortions().SaveGetObject( ++nPara ); @@ -4123,7 +3855,7 @@ EditPaM ImpEditEngine::InsertParagraph( sal_uInt16 nPara ) ContentNode* pNode = GetEditDoc().SaveGetObject( nPara-1 ); if ( !pNode ) pNode = GetEditDoc().SaveGetObject( GetEditDoc().Count() - 1 ); - DBG_ASSERT( pNode, "Kein einziger Absatz in InsertParagraph ?" ); + DBG_ASSERT( pNode, "Not a single paragraph in InsertParagraph ?" ); aPaM = EditPaM( pNode, pNode->Len() ); } else @@ -4139,7 +3871,7 @@ EditSelection* ImpEditEngine::SelectParagraph( sal_uInt16 nPara ) { EditSelection* pSel = 0; ContentNode* pNode = GetEditDoc().SaveGetObject( nPara ); - DBG_ASSERTWARNING( pNode, "Absatz existiert nicht: SelectParagraph" ); + DBG_ASSERTWARNING( pNode, "Paragraph does not exist: SelectParagraph" ); if ( pNode ) pSel = new EditSelection( EditPaM( pNode, 0 ), EditPaM( pNode, pNode->Len() ) ); @@ -4214,9 +3946,9 @@ void ImpEditEngine::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ) if ( nX != 100 ) { - // Fontbreite + // Font width SvxCharScaleWidthItem* pNewWidth = (SvxCharScaleWidthItem*) pNode->GetContentAttribs().GetItem( EE_CHAR_FONTWIDTH ).Clone(); - sal_uInt32 nProp = pNewWidth->GetValue(); // sal_uInt32, kann temporaer gross werden + sal_uInt32 nProp = pNewWidth->GetValue(); // sal_uInt32, can get big temporary nProp *= nX; nProp /= 100; pNewWidth->SetValue( (sal_uInt16)nProp ); @@ -4235,8 +3967,8 @@ void ImpEditEngine::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ) } else if ( nKerning < 0 ) { - // Bei Negativen Werten: - // Bei Stretching > 100 muessen die Werte kleiner werden und umgekehrt. + // For Negative values: + // For Stretching > 100 the values must be smaller and vice versa nKerning *= 100; nKerning /= nX; } @@ -4249,7 +3981,7 @@ void ImpEditEngine::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ) if ( nY != 100 ) { - // Fonthoehe + // Font height for ( int nItem = 0; nItem < 3; nItem++ ) { USHORT nItemId = EE_CHAR_FONTHEIGHT; @@ -4269,7 +4001,7 @@ void ImpEditEngine::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ) delete pNewHeight; } - // Absatzabstaende + // Paragraph spacing const SvxULSpaceItem& rULSpaceItem = (const SvxULSpaceItem&)pNode->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); SvxULSpaceItem* pNewUL = (SvxULSpaceItem*)rULSpaceItem.Clone(); @@ -4289,8 +4021,8 @@ void ImpEditEngine::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ) SetParaAttribs( nPara, aTmpSet ); - // harte Attribute: - sal_uInt16 nLastEnd = 0; // damit nach entfernen und neu nicht nochmal + // hard Attribute: + sal_uInt16 nLastEnd = 0; // so not again after removing them and new CharAttribArray& rAttribs = pNode->GetCharAttribs().GetAttribs(); sal_uInt16 nAttribs = rAttribs.Count(); for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) @@ -4329,8 +4061,8 @@ void ImpEditEngine::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ) } else if ( nKerning < 0 ) { - // Bei Negativen Werten: - // Bei Stretching > 100 muessen die Werte kleiner werden und umgekehrt. + // For Negative values: + // For Stretching > 100 the values must be smaller and vice versa. nKerning *= 100; nKerning /= nX; } @@ -4568,7 +4300,6 @@ BOOL ImpEditEngine::ImplCalcAsianCompression( ContentNode* pNode, TextPortion* p DBG_ASSERT( pTextPortion->GetLen(), "ImplCalcAsianCompression - Empty Portion?" ); // Percent is 1/100 Percent... - if ( n100thPercentFromMax == 10000 ) pTextPortion->SetExtraInfos( NULL ); @@ -4597,7 +4328,6 @@ BOOL ImpEditEngine::ImplCalcAsianCompression( ContentNode* pNode, TextPortion* p } pTextPortion->GetExtraInfos()->nMaxCompression100thPercent = n100thPercentFromMax; pTextPortion->GetExtraInfos()->nAsianCompressionTypes |= nType; -// pTextPortion->GetExtraInfos()->nCompressedChars++; long nOldCharWidth; if ( (n+1) < nPortionLen ) @@ -4696,7 +4426,6 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* { BOOL bFoundCompressedPortion = FALSE; long nCompressed = 0; -// long nCompressWeight = 0; TextPortionList aCompressedPortions; USHORT nPortion = pLine->GetEndPortion(); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 93f9225..95956d3 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -118,10 +118,10 @@ EditPaM ImpEditEngine::Read( SvStream& rInput, const String& rBaseURL, EETextFor aPaM = ReadBin( rInput, aSel ); else { - DBG_ERROR( "Read: Unbekanntes Format" ); + DBG_ERROR( "Read: Unknown Format" ); } - FormatFullDoc(); // reicht vielleicht auch ein einfaches Format? + FormatFullDoc(); // perhaps a simple format is enough? SetUpdateMode( _bUpdate ); return aPaM; @@ -174,18 +174,15 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel ) if ( aSel.HasRange() ) aSel = ImpDeleteSelection( aSel ); -// sal_Bool bCharsBeforeInsertPos = ( aSel.Min().GetIndex() ) ? sal_True : sal_False; -// sal_Bool bCharsBehindInsertPos = ( aSel.Min().GetIndex() < aSel.Min().GetNode()->Len() ) ? sal_True : sal_False; - - // Der SvRTF-Parser erwartet, dass das Which-Mapping am uebergebenen Pool, - // nicht an einem Secondary haengt. + // The SvRTF parser expects the Which-mapping passed on in the pool, not + // dependant on a secondary. SfxItemPool* pPool = &aEditDoc.GetItemPool(); while ( pPool->GetSecondaryPool() && !pPool->GetName().EqualsAscii( "EditEngineItemPool" ) ) { pPool = pPool->GetSecondaryPool(); } - DBG_ASSERT( pPool && pPool->GetName().EqualsAscii( "EditEngineItemPool" ), "ReadRTF: Kein EditEnginePool!" ); + DBG_ASSERT( pPool && pPool->GetName().EqualsAscii( "EditEngineItemPool" ), "ReadRTF: no EditEnginePool!" ); EditRTFParserRef xPrsr = new EditRTFParser( rInput, aSel, *pPool, this ); SvParserState eState = xPrsr->CallParser(); @@ -207,9 +204,6 @@ EditPaM ImpEditEngine::ReadHTML( SvStream& rInput, const String& rBaseURL, EditS if ( aSel.HasRange() ) aSel = ImpDeleteSelection( aSel ); -// sal_Bool bCharsBeforeInsertPos = ( aSel.Min().GetIndex() ) ? sal_True : sal_False; -// sal_Bool bCharsBehindInsertPos = ( aSel.Min().GetIndex() < aSel.Min().GetNode()->Len() ) ? sal_True : sal_False; - EditHTMLParserRef xPrsr = new EditHTMLParser( rInput, rBaseURL, pHTTPHeaderAttrs ); SvParserState eState = xPrsr->CallParser( this, aSel.Max() ); if ( ( eState != SVPAR_ACCEPTED ) && ( !rInput.GetError() ) ) @@ -225,7 +219,7 @@ EditPaM ImpEditEngine::ReadHTML( SvStream& rInput, const String& rBaseURL, EditS EditPaM ImpEditEngine::ReadBin( SvStream& rInput, EditSelection aSel ) { - // Einfach ein temporaeres TextObject missbrauchen... + // Simply abuse a temporary text object ... EditTextObject* pObj = EditTextObject::Create( rInput, NULL ); EditPaM aLastPaM = aSel.Max(); @@ -256,7 +250,7 @@ void ImpEditEngine::Write( SvStream& rOutput, EETextFormat eFormat, EditSelectio WriteBin( rOutput, aSel ); else { - DBG_ERROR( "Write: Unbekanntes Format" ); + DBG_ERROR( "Write: Unknown Format" ); } } } @@ -278,11 +272,11 @@ sal_uInt32 ImpEditEngine::WriteText( SvStream& rOutput, EditSelection aSel ) nEndNode = aEditDoc.Count()-1; } - // ueber die Absaetze iterieren... + // iterate over the paragraphs ... for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); - DBG_ASSERT( pNode, "Node nicht gefunden: Search&Replace" ); + DBG_ASSERT( pNode, "Node not founden: Search&Replace" ); sal_uInt16 nStartPos = 0; sal_uInt16 nEndPos = pNode->Len(); @@ -290,7 +284,7 @@ sal_uInt32 ImpEditEngine::WriteText( SvStream& rOutput, EditSelection aSel ) { if ( nNode == nStartNode ) nStartPos = aSel.Min().GetIndex(); - if ( nNode == nEndNode ) // kann auch == nStart sein! + if ( nNode == nEndNode ) // can also be == nStart! nEndPos = aSel.Max().GetIndex(); } XubString aTmpStr = aEditDoc.GetParaAsString( pNode, nStartPos, nEndPos ); @@ -318,7 +312,7 @@ void lcl_FindValidAttribs( ItemList& rLst, ContentNode* pNode, sal_uInt16 nIndex EditCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttr && ( pAttr->GetStart() <= nIndex ) ) { - // Start wird in While ueberprueft... + // Start is checked in while ... if ( pAttr->GetEnd() > nIndex ) { if ( IsScriptItemValid( pAttr->GetItem()->Which(), nScriptType ) ) @@ -365,7 +359,7 @@ static sal_uInt16 getStylePos( const SfxStyles& rStyles, SfxStyleSheet* pSheet ) sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) { #ifndef SVX_LIGHT - DBG_ASSERT( GetUpdateMode(), "WriteRTF bei UpdateMode = sal_False!" ); + DBG_ASSERT( GetUpdateMode(), "WriteRTF for UpdateMode = sal_False!" ); CheckIdleFormatter(); if ( !IsFormatted() ) FormatDoc(); @@ -376,7 +370,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); - // RTF-Vorspann... + // RTF header ... rOutput << '{' ; rOutput << OOO_STRING_SVTOOLS_RTF_RTF; @@ -384,9 +378,9 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) rOutput << OOO_STRING_SVTOOLS_RTF_ANSI; rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252; - // Fonttabelle erzeugen und rausschreiben... + // Generate and write out Font table ... SvxFontTable aFontTable; - // DefaultFont muss ganz vorne stehen, damit DEF-Font im RTF + // default font must be up front, so DEF font in RTF aFontTable.Insert( 0, new SvxFontItem( (const SvxFontItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO ) ) ); aFontTable.Insert( 1, new SvxFontItem( (const SvxFontItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CJK ) ) ); aFontTable.Insert( 2, new SvxFontItem( (const SvxFontItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CTL ) ) ); @@ -466,7 +460,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) rOutput << '}'; rOutput << endl; - // ColorList rausschreiben... + // Write out ColorList ... SvxColorList aColorList; sal_uInt16 i = 0; SvxColorItem* pColorItem = (SvxColorItem*)aEditDoc.GetItemPool().GetItem( EE_CHAR_COLOR, i ); @@ -515,7 +509,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) sal_uInt16 nNumber = (sal_uInt16) (nStyle + 1); rOutput.WriteNumber( nNumber ); - // Attribute, auch aus Parent! + // Attribute, alos from Parent! for ( sal_uInt16 nParAttr = EE_PARA_START; nParAttr <= EE_CHAR_END; nParAttr++ ) { if ( pStyle->GetItemSet().GetItemState( nParAttr ) == SFX_ITEM_ON ) @@ -525,27 +519,27 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) } } - // Parent...(nur wenn noetig) + // Parent ... (only if necessary) if ( pStyle->GetParent().Len() && ( pStyle->GetParent() != pStyle->GetName() ) ) { SfxStyleSheet* pParent = (SfxStyleSheet*)GetStyleSheetPool()->Find( pStyle->GetParent(), pStyle->GetFamily() ); - DBG_ASSERT( pParent, "Parent nicht gefunden!" ); + DBG_ASSERT( pParent, "Parent not found!" ); rOutput << OOO_STRING_SVTOOLS_RTF_SBASEDON; nNumber = (sal_uInt16) getStylePos( GetStyleSheetPool()->GetStyles(), pParent ) + 1; rOutput.WriteNumber( nNumber ); } - // Folgevorlage...(immer) + // Next Style ... (more) SfxStyleSheet* pNext = pStyle; if ( pStyle->GetFollow().Len() && ( pStyle->GetFollow() != pStyle->GetName() ) ) pNext = (SfxStyleSheet*)GetStyleSheetPool()->Find( pStyle->GetFollow(), pStyle->GetFamily() ); - DBG_ASSERT( pNext, "Naechsten nicht gefunden!" ); + DBG_ASSERT( pNext, "Next ot found!" ); rOutput << OOO_STRING_SVTOOLS_RTF_SNEXT; nNumber = (sal_uInt16) getStylePos( GetStyleSheetPool()->GetStyles(), pNext ) + 1; rOutput.WriteNumber( nNumber ); - // Namen der Vorlage... + // Name of the template ... rOutput << " " << ByteString( pStyle->GetName(), eDestEnc ).GetBuffer(); rOutput << ";}"; } @@ -554,7 +548,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) } } - // Die Pool-Defaults vorweg schreiben... + // Write the pool defaults in advance ... rOutput << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << "\\EditEnginePoolDefaults"; for ( sal_uInt16 nPoolDefItem = EE_PARA_START; nPoolDefItem <= EE_CHAR_END; nPoolDefItem++) { @@ -563,13 +557,6 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) } rOutput << '}' << endl; - // Def-Hoehe vorweg, da sonst 12Pt - // Doch nicht, onst in jedem Absatz hart! - // SfxItemSet aTmpSet( GetEmptyItemSet() ); - // const SvxFontHeightItem& rDefFontHeight = (const SvxFontHeightItem&)aTmpSet.Get( EE_CHAR_FONTHEIGHT ); - // WriteItemAsRTF( rDefFontHeight, rOutput, aFontTable, aColorList ); - // rOutput << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << "\\EditEnginePoolDefaultHeight}" << endl; - // DefTab: MapMode aTwpMode( MAP_TWIP ); sal_uInt16 nDefTabTwps = (sal_uInt16) GetRefDevice()->LogicToLogic( @@ -579,26 +566,26 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) rOutput.WriteNumber( nDefTabTwps ); rOutput << endl; - // ueber die Absaetze iterieren... + // iterate over the paragraphs ... rOutput << '{' << endl; for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.SaveGetObject( nNode ); - DBG_ASSERT( pNode, "Node nicht gefunden: Search&Replace" ); + DBG_ASSERT( pNode, "Node not found: Search&Replace" ); - // Die Absatzattribute vorweg... + // The paragraph attributes in advance ... sal_Bool bAttr = sal_False; - // Vorlage ? + // Template? if ( pNode->GetStyleSheet() ) { - // Nummer der Vorlage + // Number of template rOutput << OOO_STRING_SVTOOLS_RTF_S; sal_uInt16 nNumber = (sal_uInt16) getStylePos( GetStyleSheetPool()->GetStyles(), pNode->GetStyleSheet() ) + 1; rOutput.WriteNumber( nNumber ); - // Alle Attribute - // Attribute, auch aus Parent! + // All Attribute + // Attribute, also from Parent! for ( sal_uInt16 nParAttr = EE_PARA_START; nParAttr <= EE_CHAR_END; nParAttr++ ) { if ( pNode->GetStyleSheet()->GetItemSet().GetItemState( nParAttr ) == SFX_ITEM_ON ) @@ -612,8 +599,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) for ( sal_uInt16 nParAttr = EE_PARA_START; nParAttr <= EE_CHAR_END; nParAttr++ ) { -// const SfxPoolItem& rItem = pNode->GetContentAttribs().GetItem( nParAttr ); - // Jetzt, wo StyleSheet-Verarbeitung, nur noch harte Absatzattribute! + // Now where stylesheet processing, only hard paragraph attributes! if ( pNode->GetContentAttribs().GetItems().GetItemState( nParAttr ) == SFX_ITEM_ON ) { const SfxPoolItem& rItem = pNode->GetContentAttribs().GetItems().Get( nParAttr ); @@ -626,7 +612,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) ItemList aAttribItems; ParaPortion* pParaPortion = FindParaPortion( pNode ); - DBG_ASSERT( pParaPortion, "Portion nicht gefunden: WriteRTF" ); + DBG_ASSERT( pParaPortion, "Portion not found: WriteRTF" ); sal_uInt16 nIndex = 0; sal_uInt16 nStartPos = 0; @@ -646,8 +632,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) lcl_FindValidAttribs( aAttribItems, pNode, nStartPos, GetScriptType( EditPaM( pNode, 0 ) ) ); if ( aAttribItems.Count() ) { - // Diese Attribute duerfen nicht fuer den gesamten - // Absatz gelten: + // These attributes may not apply to the entire paragraph: rOutput << '{'; WriteItemListAsRTF( aAttribItems, rOutput, nNode, nStartPos, aFontTable, aColorList ); bFinishPortion = sal_True; @@ -655,15 +640,14 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) aAttribItems.Clear(); } } - if ( nNode == nEndNode ) // kann auch == nStart sein! + if ( nNode == nEndNode ) // can also be == nStart! { nEndPos = aSel.Max().GetIndex(); nEndPortion = pParaPortion->GetTextPortions().FindPortion( nEndPos, nPortionStart ); } EditCharAttrib* pNextFeature = pNode->GetCharAttribs().FindFeature( nIndex ); - // Bei 0 anfangen, damit der Index richtig ist... - + // start at 0, so the index is right ... for ( sal_uInt16 n = 0; n <= nEndPortion; n++ ) { TextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject(n); @@ -691,7 +675,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) aAttribItems.Insert( &aAttribs.Get( GetScriptItemId( EE_CHAR_ITALIC, nScriptType ) ) ); aAttribItems.Insert( &aAttribs.Get( GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ) ) ); } - // #96298# Insert hard attribs AFTER CJK attribs... + // Insert hard attribs AFTER CJK attribs... lcl_FindValidAttribs( aAttribItems, pNode, nIndex, nScriptType ); rOutput << '{'; @@ -721,8 +705,8 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) rOutput << OOO_STRING_SVTOOLS_RTF_PAR << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_PLAIN;; rOutput << endl; } - // RTF-Nachspann... - rOutput << "}}"; // 1xKlammerung Absaetze, 1x Klammerung RTF-Dokument + // RTF-trailer ... + rOutput << "}}"; // 1xparentheses paragraphs, 1xparentheses RTF document rOutput.Flush(); #if defined (EDITDEBUG) && !defined( UNX ) @@ -770,8 +754,6 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_PARA_OUTLLRSPACE: case EE_PARA_LRSPACE: { -// const ContentNode *pNode = aEditDoc.GetObject( nPara ); - rOutput << OOO_STRING_SVTOOLS_RTF_FI; short nTxtFirst = ((const SvxLRSpaceItem&)rItem).GetTxtFirstLineOfst(); nTxtFirst = (short)LogicToTwips( nTxtFirst ); @@ -805,8 +787,8 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, char cMult = '0'; if ( ((const SvxLineSpacingItem&)rItem).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) { - // Woher kriege ich jetzt den Wert? - // Der SwRTF-Parser geht von einem 240er Font aus! + // From where do I get the value now? + // The SwRTF parser is based on a 240 Font! nVal = ((const SvxLineSpacingItem&)rItem).GetPropLineSpace(); nVal *= 240; nVal /= 100; @@ -883,8 +865,8 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, break; case EE_CHAR_UNDERLINE: { - // muesste bei WordLineMode ggf. ulw werden, - // aber die Information fehlt hier + // Must underlined if in WordLineMode, but the information is + // missing here FontUnderline e = ((const SvxUnderlineItem&)rItem).GetLineStyle(); switch ( e ) { @@ -1004,14 +986,14 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, MapMode aPntMode( MAP_POINT ); long nFontHeight = GetRefDevice()->LogicToLogic( aFont.GetSize(), &GetRefMapMode(), &aPntMode ).Height(); - nFontHeight *=2; // HalfPoints + nFontHeight *=2; // HalfP oints sal_uInt16 nProp = ((const SvxEscapementItem&)rItem).GetProp(); - sal_uInt16 nProp100 = nProp*100; // Fuer SWG-Token Prop in 100tel Prozent. + sal_uInt16 nProp100 = nProp*100; // For SWG-Token Prop in 100th percent. short nEsc = ((const SvxEscapementItem&)rItem).GetEsc(); if ( nEsc == DFLT_ESC_AUTO_SUPER ) { nEsc = 100 - nProp; - nProp100++; // Eine 1 hinten bedeutet 'automatisch'. + nProp100++; // A 1 afterwards means 'automatic'. } else if ( nEsc == DFLT_ESC_AUTO_SUB ) { @@ -1072,17 +1054,16 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP ( aSel.Max().GetIndex() < aSel.Max().GetNode()->Len() ) ) ? sal_False : sal_True; - // Vorlagen werden nicht gespeichert! - // ( Nur Name und Familie, Vorlage selbst muss in App stehen! ) - + // Templates are not saved! + // (Only the name and family, template itself must be in App!) pTxtObj->SetScriptType( GetScriptType( aSel ) ); - // ueber die Absaetze iterieren... + // iterate over the paragraphs ... sal_uInt16 nNode; for ( nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.SaveGetObject( nNode ); - DBG_ASSERT( pNode, "Node nicht gefunden: Search&Replace" ); + DBG_ASSERT( pNode, "Node not found: Search&Replace" ); if ( bOnlyFullParagraphs ) { @@ -1103,30 +1084,30 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP ContentInfo* pC = pTxtObj->CreateAndInsertContent(); - // Die Absatzattribute... + // The paragraph attributes ... pC->GetParaAttribs().Set( pNode->GetContentAttribs().GetItems() ); - // Das StyleSheet... + // The StyleSheet... if ( pNode->GetStyleSheet() ) { pC->GetStyle() = pNode->GetStyleSheet()->GetName(); pC->GetFamily() = pNode->GetStyleSheet()->GetFamily(); } - // Der Text... + // The Text... pC->GetText() = pNode->Copy( nStartPos, nEndPos-nStartPos ); - // und die Attribute... + // and the Attribute... sal_uInt16 nAttr = 0; EditCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttr ) { - // In einem leeren Absatz die Attribute behalten! + // In a blank paragraph keep the attributes! if ( bEmptyPara || ( ( pAttr->GetEnd() > nStartPos ) && ( pAttr->GetStart() < nEndPos ) ) ) { XEditAttribute* pX = pTxtObj->CreateAttrib( *pAttr->GetItem(), pAttr->GetStart(), pAttr->GetEnd() ); - // Evtl. korrigieren... + // Possibly Correct ... if ( ( nNode == nStartNode ) && ( nStartPos != 0 ) ) { pX->GetStart() = ( pX->GetStart() > nStartPos ) ? pX->GetStart()-nStartPos : 0; @@ -1138,7 +1119,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP if ( pX->GetEnd() > (nEndPos-nStartPos) ) pX->GetEnd() = nEndPos-nStartPos; } - DBG_ASSERT( pX->GetEnd() <= (nEndPos-nStartPos), "CreateBinTextObject: Attribut zu lang!" ); + DBG_ASSERT( pX->GetEnd() <= (nEndPos-nStartPos), "CreateBinTextObject: Attribute too long!" ); if ( !pX->GetLen() && !bEmptyPara ) pTxtObj->DestroyAttrib( pX ); else @@ -1149,15 +1130,15 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP } #ifndef SVX_LIGHT - // ggf. Online-Spelling + // If possible online spelling if ( bAllowBigObjects && bOnlyFullParagraphs && pNode->GetWrongList() ) pC->SetWrongList( pNode->GetWrongList()->Clone() ); #endif // !SVX_LIGHT } - // Bei grossen Textobjekten die PortionInfos merken: - // Schwelle rauf setzen, wenn Olli die Absaetze nicht mehr zerhackt! + // Remember the portions info in case of large text objects: + // sleeper set up when Olli paragraphs not hacked! if ( bAllowBigObjects && bOnlyFullParagraphs && IsFormatted() && GetUpdateMode() && ( nTextPortions >= nBigObjectStart ) ) { XParaPortionList* pXList = new XParaPortionList( GetRefDevice(), aPaperSize.Width(), nStretchX, nStretchY ); @@ -1171,7 +1152,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP pX->nHeight = pParaPortion->GetHeight(); pX->nFirstLineOffset = pParaPortion->GetFirstLineOffset(); - // Die TextPortions + // The TextPortions sal_uInt16 nCount = pParaPortion->GetTextPortions().Count(); sal_uInt16 n; for ( n = 0; n < nCount; n++ ) @@ -1181,7 +1162,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP pX->aTextPortions.Insert( pNew, pX->aTextPortions.Count() ); } - // Die Zeilen + // The lines nCount = pParaPortion->GetLines().Count(); for ( n = 0; n < nCount; n++ ) { @@ -1205,7 +1186,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP void ImpEditEngine::SetText( const EditTextObject& rTextObject ) { - // Da Setzen eines TextObject ist nicht Undo-faehig! + // Since setting a text object is not undo-able! ResetUndoManager(); sal_Bool _bUpdate = GetUpdateMode(); sal_Bool _bUndo = IsUndoEnabled(); @@ -1220,7 +1201,7 @@ void ImpEditEngine::SetText( const EditTextObject& rTextObject ) SetVertical( rTextObject.IsVertical() ); #ifndef SVX_LIGHT - DBG_ASSERT( !HasUndoManager() || !GetUndoManager().GetUndoActionCount(), "Woher kommt das Undo in SetText ?!" ); + DBG_ASSERT( !HasUndoManager() || !GetUndoManager().GetUndoActionCount(), "From where comes the Undo in SetText ?!" ); #endif SetUpdateMode( _bUpdate ); EnableUndo( _bUndo ); @@ -1235,19 +1216,15 @@ EditSelection ImpEditEngine::InsertText( const EditTextObject& rTextObject, Edit EditSelection aNewSel = InsertBinTextObject( (BinTextObject&)rTextObject, aSel.Max() ); LeaveBlockNotifications(); return aNewSel; - - // MT 05/00: InsertBinTextObject direkt hier machen... } EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, EditPaM aPaM ) { - // Optimieren: - // Kein GetPos undFindParaportion, sondern Index berechnen! + // Optimize: No getPos undFindParaportion, instead calculate index! EditSelection aSel( aPaM, aPaM ); - DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selektion kaput!(1)" ); + DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selection broken!(1)" ); sal_Bool bUsePortionInfo = sal_False; -// sal_Bool bFields = sal_False; XParaPortionList* pPortionInfo = rTextObject.GetPortionInfo(); if ( pPortionInfo && ( (long)pPortionInfo->GetPaperWidth() == aPaperSize.Width() ) @@ -1283,10 +1260,10 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed aPaM = ImpFastInsertText( aPaM, pC->GetText() ); ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() ); - DBG_ASSERT( pPortion, "Blinde Portion in FastInsertText" ); + DBG_ASSERT( pPortion, "Blind Portion in FastInsertText" ); pPortion->MarkInvalid( nStartPos, pC->GetText().Len() ); - // Zeicheattribute... + // Character attributes ... sal_Bool bAllreadyHasAttribs = aPaM.GetNode()->GetCharAttribs().Count() ? sal_True : sal_False; sal_uInt16 nNewAttribs = pC->GetAttribs().Count(); if ( nNewAttribs ) @@ -1295,15 +1272,16 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed for ( sal_uInt16 nAttr = 0; nAttr < nNewAttribs; nAttr++ ) { XEditAttribute* pX = pC->GetAttribs().GetObject( nAttr ); - // Kann passieren wenn Absaetze >16K entstehen, dann wird einfach umgebrochen. + // Can happen when paragraphs > 16K, it is simply wrapped. if ( pX->GetEnd() <= aPaM.GetNode()->Len() ) { if ( !bAllreadyHasAttribs || pX->IsFeature() ) { - // Normale Attribute gehen dann schneller... - // Features duerfen nicht ueber EditDoc::InsertAttrib - // eingefuegt werden, sie sind bei FastInsertText schon im TextFluss - DBG_ASSERT( pX->GetEnd() <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribut zu gross!" ); + // Normal attributes then go faster ... + // Features shall not be inserted through + // EditDoc:: InsertAttrib, using FastInsertText they are + // already in the flow + DBG_ASSERT( pX->GetEnd() <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribute too large!" ); EditCharAttrib* pAttr; if ( !bConvertItems ) pAttr = MakeCharAttrib( aEditDoc.GetItemPool(), *(pX->GetItem()), pX->GetStart()+nStartPos, pX->GetEnd()+nStartPos ); @@ -1314,15 +1292,15 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed pAttr = MakeCharAttrib( aEditDoc.GetItemPool(), *pNew, pX->GetStart()+nStartPos, pX->GetEnd()+nStartPos ); delete pNew; } - DBG_ASSERT( pAttr->GetEnd() <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribut passt nicht! (1)" ); + DBG_ASSERT( pAttr->GetEnd() <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribute does not fit! (1)" ); aPaM.GetNode()->GetCharAttribs().InsertAttrib( pAttr ); if ( pAttr->Which() == EE_FEATURE_FIELD ) bUpdateFields = TRUE; } else { - DBG_ASSERT( pX->GetEnd()+nStartPos <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribut passt nicht! (2)" ); - // Tabs und andere Features koennen nicht ueber InsertAttrib eingefuegt werden: + DBG_ASSERT( pX->GetEnd()+nStartPos <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribute does not fit! (2)" ); + // Tabs and other Features can not be inserted through InsertAttrib: aEditDoc.InsertAttrib( aPaM.GetNode(), pX->GetStart()+nStartPos, pX->GetEnd()+nStartPos, *pX->GetItem() ); } } @@ -1330,22 +1308,19 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed if ( bUpdateFields ) UpdateFields(); - // Sonst QuickFormat => Keine Attribute! + // Otherwise, quick format => no attributes! pPortion->MarkSelectionInvalid( nStartPos, pC->GetText().Len() ); } - DBG_ASSERT( CheckOrderedList( aPaM.GetNode()->GetCharAttribs().GetAttribs(), sal_True ), "InsertBinTextObject: Start-Liste verdreht" ); + DBG_ASSERT( CheckOrderedList( aPaM.GetNode()->GetCharAttribs().GetAttribs(), sal_True ), "InsertBinTextObject: Start-Liste distorted" ); sal_Bool bParaAttribs = sal_False; if ( bNewContent || ( ( n > 0 ) && ( n < (nContents-1) ) ) ) { bParaAttribs = sal_False; - // #101512# Don't overwrite level/style from existing paragraph in OutlineView - // MT 10/2002: Removed because of #103874#, handled in Outliner::EndPasteOrDropHdl now. -// if ( !aStatus.IsOutliner() || n ) { - // nur dann Style und ParaAttribs, wenn neuer Absatz, oder - // komplett inneliegender... + // only style and ParaAttribs when new paragraph, or + // completely internal ... bParaAttribs = pC->GetParaAttribs().Count() ? sal_True : sal_False; if ( GetStyleSheetPool() && pC->GetStyle().Len() ) { @@ -1371,9 +1346,9 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed pParaPortion->nHeight = pXP->nHeight; pParaPortion->nFirstLineOffset = pXP->nFirstLineOffset; pParaPortion->bForceRepaint = sal_True; - pParaPortion->SetValid(); // Nicht formatieren + pParaPortion->SetValid(); // Do not format - // Die TextPortions + // The Text Portions pParaPortion->GetTextPortions().Reset(); sal_uInt16 nCount = pXP->aTextPortions.Count(); for ( sal_uInt16 _n = 0; _n < nCount; _n++ ) @@ -1383,14 +1358,14 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed pParaPortion->GetTextPortions().Insert( pNew, _n ); } - // Die Zeilen + // The lines pParaPortion->GetLines().Reset(); nCount = pXP->aLines.Count(); for ( sal_uInt16 m = 0; m < nCount; m++ ) { EditLine* pLine = pXP->aLines[m]; EditLine* pNew = pLine->Clone(); - pNew->SetInvalid(); // neu Painten! + pNew->SetInvalid(); // Paint again! pParaPortion->GetLines().Insert( pNew, m ); } #ifdef DBG_UTIL @@ -1404,7 +1379,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed #endif } } - if ( !bParaAttribs ) // DefFont wird bei FastInsertParagraph nicht berechnet + if ( !bParaAttribs ) // DefFont is not calculated for FastInsertParagraph { aPaM.GetNode()->GetCharAttribs().GetDefFont() = aEditDoc.GetDefFont(); if ( aStatus.UseCharAttribs() ) @@ -1419,7 +1394,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed } #endif // !SVX_LIGHT - // Zeilenumbruch, wenn weitere folgen... + // Wrap when followed by other ... if ( n < ( nContents-1) ) { if ( bNewContent ) @@ -1430,7 +1405,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed } aSel.Max() = aPaM; - DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selektion kaput!(1)" ); + DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selection broken!(1)" ); return aSel; } @@ -1473,8 +1448,6 @@ SpellInfo * ImpEditEngine::CreateSpellInfo( const EditSelection &rSel, bool bMul pSpellInfo->bMultipleDoc = bMultipleDocs; EditSelection aSentenceSel( SelectSentence( rSel ) ); -// pSpellInfo->aSpellStart = CreateEPaM( aSentenceSel.Min() ); -// pSpellInfo->aSpellTo = CreateEPaM( rSel.HasRange()? aSentenceSel.Max() : aSentenceSel.Min() ); // always spell draw objects completely, startting at the top. // (spelling in only a selection or not starting with the top requires // further changes elsewehe to work properly) @@ -1490,14 +1463,14 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, sal_Bool bMultipleDoc ) return EE_SPELL_NOSPELLER; #else - DBG_ASSERTWARNING( xSpeller.is(), "Kein Speller gesetzt!" ); + DBG_ASSERTWARNING( xSpeller.is(), "No Spell checker set!" ); if ( !xSpeller.is() ) return EE_SPELL_NOSPELLER; aOnlineSpellTimer.Stop(); - // Bei MultipleDoc immer von vorne/hinten... + // In MultipleDoc always from the front / rear ... if ( bMultipleDoc ) { pEditView->pImpEditView->SetEditSelection( aEditDoc.GetStartPaM() ); @@ -1508,7 +1481,7 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, sal_Bool bMultipleDoc ) sal_Bool bIsStart = sal_False; if ( bMultipleDoc ) - bIsStart = sal_True; // Immer von Vorne bzw. von hinten... + bIsStart = sal_True; // Accessible from the front or from behind ... else if ( ( CreateEPaM( aEditDoc.GetStartPaM() ) == pSpellInfo->aSpellStart ) ) bIsStart = sal_True; @@ -1583,13 +1556,12 @@ void ImpEditEngine::Convert( EditView* pEditView, #ifdef SVX_LIGHT #else - // Bei MultipleDoc immer von vorne/hinten... + // In MultipleDoc always from the front / rear ... if ( bMultipleDoc ) pEditView->pImpEditView->SetEditSelection( aEditDoc.GetStartPaM() ); - // + // initialize pConvInfo - // EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); aCurSel.Adjust( aEditDoc ); pConvInfo = new ConvInfo; @@ -1621,7 +1593,7 @@ void ImpEditEngine::Convert( EditView* pEditView, sal_Bool bIsStart = sal_False; if ( bMultipleDoc ) - bIsStart = sal_True; // Immer von Vorne bzw. von hinten... + bIsStart = sal_True; // Accessible from the front or from behind ... else if ( CreateEPaM( aEditDoc.GetStartPaM() ) == pConvInfo->aConvStart ) bIsStart = sal_True; @@ -1743,18 +1715,6 @@ void ImpEditEngine::ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtL pConvInfo->aConvContinue.nIndex >= pConvInfo->aConvTo.nIndex) break; -/* - // Bekannter (wahrscheinlicher) Bug: Wenn SpellToCurrent, muss - // Current bei jeder Ersetzung korrigiert werden, sonst passt - // das Ende evtl. nicht mehr genau... - if ( pConvInfo->bConvToEnd || pConvInfo->bMultipleDoc ) - { - if ( aCurSel.Max().GetNode() == pLastNode && - aCurSel.Max().GetIndex() >= pLastNode->Len() ) - break; - } -*/ - USHORT nAttribStart = USHRT_MAX; USHORT nAttribEnd = USHRT_MAX; USHORT nCurPos = USHRT_MAX; @@ -1894,7 +1854,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView ) return Reference< XSpellAlternatives >(); #else - DBG_ASSERT( xSpeller.is(), "Kein Speller gesetzt!" ); + DBG_ASSERT( xSpeller.is(), "No spell checker set!" ); ContentNode* pLastNode = aEditDoc.SaveGetObject( (aEditDoc.Count()-1) ); EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); @@ -1905,10 +1865,9 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView ) Sequence< PropertyValue > aEmptySeq; while (!xSpellAlt.is()) { - - // Bekannter (wahrscheinlicher) Bug: Wenn SpellToCurrent, muss - // Current bei jeder Ersetzung korrigiert werden, sonst passt - // das Ende evtl. nicht mehr genau... + // Known (most likely) bug: If SpellToCurrent, the current has to be + // corrected at each replacement, otherwise it may not fit exactly in + // the end ... if ( pSpellInfo->bSpellToEnd || pSpellInfo->bMultipleDoc ) { if ( aCurSel.Max().GetNode() == pLastNode ) @@ -1927,8 +1886,8 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView ) aCurSel = SelectWord( aCurSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD ); aWord = GetSelected( aCurSel ); - // Wenn Punkt dahinter, muss dieser mit uebergeben werden ! - // Falls Abkuerzung... + // If afterwards a dot, this must be handed over! + // If an abbreviation ... if ( aWord.Len() && ( aCurSel.Max().GetIndex() < aCurSel.Max().GetNode()->Len() ) ) { sal_Unicode cNext = aCurSel.Max().GetNode()->GetChar( aCurSel.Max().GetIndex() ); @@ -1993,8 +1952,8 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpFindNextError(EditSelection& r aCurSel = SelectWord( aCurSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD ); aWord = GetSelected( aCurSel ); - // Wenn Punkt dahinter, muss dieser mit uebergeben werden ! - // Falls Abkuerzung... + // If afterwards a dot, this must be handed over! + // If an abbreviation ... if ( aWord.Len() && ( aCurSel.Max().GetIndex() < aCurSel.Max().GetNode()->Len() ) ) { sal_Unicode cNext = aCurSel.Max().GetNode()->GetChar( aCurSel.Max().GetIndex() ); @@ -2030,7 +1989,7 @@ bool ImpEditEngine::SpellSentence(EditView& rEditView, if(!pSpellInfo) pSpellInfo = CreateSpellInfo( aCurSel, true ); pSpellInfo->aCurSentenceStart = aCurSel.Min(); - DBG_ASSERT( xSpeller.is(), "Kein Speller gesetzt!" ); + DBG_ASSERT( xSpeller.is(), "No spell checker set!" ); pSpellInfo->aLastSpellPortions.clear(); pSpellInfo->aLastSpellContentSelections.clear(); rToFill.clear(); @@ -2226,8 +2185,6 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, } USHORT nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); -// LanguageType eTextLanguage = GetLanguage( aCurrentOldPosition->Min() ); - USHORT nLangWhichId = EE_CHAR_LANGUAGE; switch(nScriptType) { @@ -2329,15 +2286,14 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel { #ifndef SVX_LIGHT /* - Er wird ueber alle Absaetze iteriert, nur Absaetze mit invalidierter - WrongList werden geprueft... - - Es werden alle Woerter im invalidierten Bereich geprueft. - Ist ein Wort falsch, aber noch nicht in der WrongList, oder umgekehrt, - wird der Bereich des Wortes invalidiert - ( kein Invalidate, sondern wenn nur Uebergaenge von richtig=>falsch, - einfaches Paint, bei Uebergaengen von falsch=>richtig mit VDev - ueberplaetten ) + It will iterate over all the paragraphs, paragraphs with only + invalidated wrong list will be checked ... + + All the words are checked in the invalidated region. Is a word wrong, + but not in the wrong list, or vice versa, the range of the word will be + invalidated + (no Invalidate, but if only transitions wrong from right =>, simple Paint, + even out properly with VDev on transitions from wrong => right) */ if ( !xSpeller.is() ) @@ -2367,9 +2323,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel sal_uInt16 nInvStart = pWrongList->GetInvalidStart(); sal_uInt16 nInvEnd = pWrongList->GetInvalidEnd(); - sal_uInt16 nWrongs = 0; // Auch im Absatz mal die Kontrolle abgeben... -// sal_Bool bStop = sal_False; - + sal_uInt16 nWrongs = 0; // Lose control also in the paragraphs sal_uInt16 nPaintFrom = 0xFFFF, nPaintTo = 0; sal_Bool bSimpleRepaint = sal_True; @@ -2381,12 +2335,12 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel { if ( ( aSel.Min().GetIndex() > nInvEnd ) || ( ( aSel.Max().GetNode() == pLastNode ) && ( aSel.Max().GetIndex() >= pLastNode->Len() ) ) ) - break; // Dokument- oder Ungueltigkeitsbereich-Ende + break; // Document end or end of invalid region aSel = SelectWord( aSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD ); String aWord( GetSelected( aSel ) ); - // Wenn Punkt dahinter, muss dieser mit uebergeben werden ! - // Falls Abkuerzung... + // If afterwards a dot, this must be handed over! + // If an abbreviation ... sal_Bool bDottAdded = sal_False; if ( aSel.Max().GetIndex() < aSel.Max().GetNode()->Len() ) { @@ -2407,19 +2361,13 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel sal_uInt16 nWEnd= aSel.Max().GetIndex(); if ( !xSpeller->isValid( aWord, GetLanguage( EditPaM( aSel.Min().GetNode(), nWStart+1 ) ), aEmptySeq ) ) { - // Pruefen, ob schon richtig markiert... + // Check if already marked correctly... nWrongs++; - // Nur bei SimpleRepaint stoppen, sonst zu oft VDev - // if ( ( nWrongs > 8 ) && bSimpleRepaint ) - // { - // bStop = sal_True; - // pWrongList->MarkInvalid( aSel.Max().GetIndex(), nInvEnd ); - // } sal_uInt16 nXEnd = bDottAdded ? nWEnd -1 : nWEnd; if ( !pWrongList->HasWrong( nWStart, nXEnd ) ) { - // Wort als falsch markieren... - // Aber nur, wenn nicht an Cursor-Position... + // Mark Word as wrong... + // But only when not at Cursor-Position... sal_Bool bCursorPos = sal_False; if ( aCursorPos.GetNode() == pNode ) { @@ -2428,16 +2376,17 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel } if ( bCursorPos ) { - // Dann weiter als ungueltig markieren... + // Then continue to mark as invalid ... pWrongList->GetInvalidStart() = nWStart; pWrongList->GetInvalidEnd() = nWEnd; bRestartTimer = sal_True; } else { - // Es kann sein, dass die Wrongs in der Liste nicht - // genau ueber Woerter aufgespannt sind, weil die - // WordDelimiters beim Expandieren nicht ausgewrtet werden. + // It may be that the Wrongs in the list ar not + // spanning exactly over words because the + // WordDelimiters during expansion are not + // evaluated. pWrongList->InsertWrong( nWStart, nXEnd, sal_True ); bChanged = sal_True; } @@ -2445,7 +2394,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel } else { - // Pruefen, ob nicht als als falsch markiert.... + // Check if not marked as wrong if ( pWrongList->HasAnyWrong( nWStart, nWEnd ) ) { pWrongList->ClearWrongs( nWStart, nWEnd, pNode ); @@ -2466,14 +2415,14 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel if ( bChanged && ( aSel.Min().GetNode() == pNode ) && ( ( aSel.Min().GetIndex()-aLastEnd.GetIndex() > 1 ) ) ) { - // Wenn zwei Worte durch mehr Zeichen als ein Blank getrennt - // sind, kann es passieren, dass beim Aufsplitten eines Wrongs - // der Start den zweiten Wortes vor dem tatsaechlich Wort liegt + // If two words are separated by more than one blank, it + // can happen that when splitting a Wrongs the start of + // the second word is before the actually word pWrongList->ClearWrongs( aLastEnd.GetIndex(), aSel.Min().GetIndex(), pNode ); } } - // Invalidieren? + // Invalidate? if ( ( nPaintFrom != 0xFFFF ) ) { aStatus.GetStatusWord() |= EE_STAT_WRONGWORDCHANGED; @@ -2481,22 +2430,21 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel if ( aEditViews.Count() ) { - // Bei SimpleRepaint wuerde ein uebermalen ohne VDev reichen, - // aber dann muesste ich ueber alle Views, Intersecten, - // Clippen, ... - // Lohnt wahrscheinlich nicht. + // For SimpleRepaint one was painted over a range without + // reaching VDEV, but then one would have to intersect, c + // clipping, ... over all views. Probably not worthwhile. EditPaM aStartPaM( pNode, nPaintFrom ); EditPaM aEndPaM( pNode, nPaintTo ); Rectangle aStartCursor( PaMtoEditCursor( aStartPaM ) ); Rectangle aEndCursor( PaMtoEditCursor( aEndPaM ) ); - DBG_ASSERT( aInvalidRec.IsEmpty(), "InvalidRect gesetzt!" ); + DBG_ASSERT( aInvalidRec.IsEmpty(), "InvalidRect set!" ); aInvalidRec.Left() = 0; aInvalidRec.Right() = GetPaperSize().Width(); aInvalidRec.Top() = aStartCursor.Top(); aInvalidRec.Bottom() = aEndCursor.Bottom(); if ( pActiveView && pActiveView->HasSelection() ) { - // Dann darf nicht ueber VDev ausgegeben werden + // Then no output through VDev. UpdateViews( NULL ); } else if ( bSimpleRepaint ) @@ -2508,9 +2456,9 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel aClipRec.Intersection( pView->GetVisArea() ); if ( !aClipRec.IsEmpty() ) { - // in Fensterkoordinaten umwandeln.... + // convert to window coordinates .... aClipRec.SetPos( pView->pImpEditView->GetWindowPos( aClipRec.TopLeft() ) ); - // Wenn Selektion, dann VDev... + // If selected, then VDev ... Paint( pView->pImpEditView, aClipRec, pView->HasSelection() ); } } @@ -2522,7 +2470,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel aInvalidRec = Rectangle(); } } - // Nach zwei korrigierten Nodes die Kontrolle abgeben... + // After two corrected nodes give up the control ... nInvalids++; if ( bInteruptable && ( nInvalids >= 2 ) ) { @@ -2542,7 +2490,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel EESpellState ImpEditEngine::HasSpellErrors() { - DBG_ASSERT( xSpeller.is(), "Kein Speller gesetzt!" ); + DBG_ASSERT( xSpeller.is(), "No spell checker set!" ); #ifndef SVX_LIGHT ContentNode* pLastNode = aEditDoc.SaveGetObject( aEditDoc.Count() - 1 ); @@ -2590,7 +2538,7 @@ EESpellState ImpEditEngine::StartThesaurus( EditView* pEditView ) AbstractThesaurusDialog* pDlg = pFact->CreateThesaurusDialog( pEditView->GetWindow(), xThes, aWord, GetLanguage( aCurSel.Max() ) ); if ( pDlg->Execute() == RET_OK ) { - // Wort ersetzen... + // Replace Word... pEditView->pImpEditView->DrawSelection(); pEditView->pImpEditView->SetEditSelection( aCurSel ); pEditView->pImpEditView->DrawSelection(); @@ -2612,7 +2560,7 @@ sal_uInt16 ImpEditEngine::StartSearchAndReplace( EditView* pEditView, const SvxS #ifndef SVX_LIGHT EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); - // FIND_ALL ohne Mehrfachselektion nicht moeglich. + // FIND_ALL is not possible without multiple selection. if ( ( rSearchItem.GetCommand() == SVX_SEARCHCMD_FIND ) || ( rSearchItem.GetCommand() == SVX_SEARCHCMD_FIND_ALL ) ) { @@ -2621,8 +2569,8 @@ sal_uInt16 ImpEditEngine::StartSearchAndReplace( EditView* pEditView, const SvxS } else if ( rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE ) { - // Das Wort ist selektiert, wenn der Anwender die Selektion - // nicht zwischendurch manipuliert: + // The word is selected if the user not altered the selection + // in between: if ( aCurSel.HasRange() ) { pEditView->InsertText( rSearchItem.GetReplaceString() ); @@ -2634,7 +2582,7 @@ sal_uInt16 ImpEditEngine::StartSearchAndReplace( EditView* pEditView, const SvxS } else if ( rSearchItem.GetCommand() == SVX_SEARCHCMD_REPLACE_ALL ) { - // Der Writer ersetzt alle, vorn Anfang bis Ende... + // The Writer replaces all front beginning to end ... SvxSearchItem aTmpItem( rSearchItem ); aTmpItem.SetBackward( sal_False ); @@ -2681,7 +2629,7 @@ BOOL ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEditVie EditSelection aFoundSel; BOOL bFound = ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel ); - if ( bFound && ( aFoundSel == aSel ) ) // Bei Rueckwaetssuche + if ( bFound && ( aFoundSel == aSel ) ) // For backwards-search { aStartPaM = aSel.Min(); bFound = ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel ); @@ -2690,7 +2638,7 @@ BOOL ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEditVie pEditView->pImpEditView->DrawSelection(); if ( bFound ) { - // Erstmal das Min einstellen, damit das ganze Wort in den sichtbaren Bereich kommt. + // First, set the minimum, so the whole word is in the visible range. pEditView->pImpEditView->SetEditSelection( aFoundSel.Min() ); pEditView->ShowCursor( TRUE, FALSE ); pEditView->pImpEditView->SetEditSelection( aFoundSel ); @@ -2725,12 +2673,12 @@ sal_Bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem, utl::TextSearch aSearcher( aSearchOptions ); - // ueber die Absaetze iterieren... + // iterate over the paragraphs ... for ( sal_uInt16 nNode = nStartNode; bBack ? ( nNode >= nEndNode ) : ( nNode <= nEndNode) ; bBack ? nNode-- : nNode++ ) { - // Bei rueckwaertsuche, wenn nEndNode = 0: + // For backwards-search if nEndNode = 0: if ( nNode >= 0xFFFF ) return sal_False; @@ -2753,7 +2701,7 @@ sal_Bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem, nEndPos = rSearchSelection.Max().GetIndex(); } - // Suchen... + // Searching ... XubString aParaStr( GetEditDoc().GetParaAsString( pNode ) ); bool bFound = false; if ( bBack ) @@ -2844,7 +2792,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, xub_StrLen nEndPos = pNode->Len(); if ( nNode == nStartNode ) nStartPos = aSel.Min().GetIndex(); - if ( nNode == nEndNode ) // kann auch == nStart sein! + if ( nNode == nEndNode ) // can also be == nStart! nEndPos = aSel.Max().GetIndex(); USHORT nCurrentStart = nStartPos; @@ -3110,7 +3058,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, std::max< USHORT >( rData.nStart + rData.nLen, rData.nStart + rData.aNewText.Len() ) ); } - } // if (aChanges.size() > 0) + } } #ifndef SVX_LIGHT diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 8709b19..7877678 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -44,13 +44,7 @@ void ImpEditEngine::SetStyleSheetPool( SfxStyleSheetPool* pSPool ) { if ( pStylePool != pSPool ) { -// if ( pStylePool ) -// EndListening( *pStylePool, TRUE ); - pStylePool = pSPool; - -// if ( pStylePool ) -// StartListening( *pStylePool, TRUE ); } } @@ -152,7 +146,7 @@ void ImpEditEngine::RemoveStyleFromParagraphs( SfxStyleSheet* pStyle ) void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { - // Damit nicht beim Destruieren unnoetig formatiert wird: + // So that not a lot of unnecessary formatting is done when destructing: if ( !bDowning ) { DBG_CHKOBJ( GetEditEnginePtr(), EditEngine, 0 ); @@ -163,7 +157,7 @@ void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if ( rHint.ISA( SfxStyleSheetHint ) ) { const SfxStyleSheetHint& rH = (const SfxStyleSheetHint&) rHint; - DBG_ASSERT( rH.GetStyleSheet()->ISA( SfxStyleSheet ), "Kein SfxStyleSheet!" ); + DBG_ASSERT( rH.GetStyleSheet()->ISA( SfxStyleSheet ), "No SfxStyleSheet!" ); pStyle = (SfxStyleSheet*) rH.GetStyleSheet(); nId = rH.GetHint(); } @@ -185,17 +179,6 @@ void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) ( nId == SFX_STYLESHEET_MODIFIED ) ) { UpdateParagraphsWithStyleSheet( pStyle ); - - // Alle Absaetze mit EditStyles, die das geaenderte Style - // irgendwie als Parent haben, muessen formatiert werden. - // ULONG nStyles = pMyStylePool->GetStyles().Count(); - // for ( ULONG nStyle = 0; nStyle < nStyles; nStyle++ ) - // { - // EditStyleSheet* pES = (EditStyleSheet*)pMyStylePool->GetStyles().GetObject( nStyle ); - // DBG_ASSERT( pES, "NULL-Pointer im StyleSheetPool!" ); - // if ( pES->IsUsed() && pES->HasStyleAsAnyParent( *pStyle ) ) - // UpdateParagraphsWithStyleSheet( pES ); - // } } } } @@ -203,7 +186,7 @@ void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const SfxItemSet& rSet ) { - DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "CreateAttribUndo: Fehlerhafte Selektion" ); + DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "CreateAttribUndo: Incorrect selection "); aSel.Adjust( aEditDoc ); ESelection aESel( CreateESel( aSel ) ); @@ -230,7 +213,7 @@ EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const S for ( USHORT nPara = nStartNode; nPara <= nEndNode; nPara++ ) { ContentNode* pNode = aEditDoc.GetObject( nPara ); - DBG_ASSERT( aEditDoc.SaveGetObject( nPara ), "Node nicht gefunden: CreateAttribUndo" ); + DBG_ASSERT( aEditDoc.SaveGetObject( nPara ), "Node not found: CreateAttribUndo" ); ContentAttribsInfo* pInf = new ContentAttribsInfo( pNode->GetContentAttribs().GetItems() ); pUndo->GetContentInfos().Insert( pInf, pUndo->GetContentInfos().Count() ); @@ -278,7 +261,7 @@ void ImpEditEngine::UndoActionEnd( USHORT ) void ImpEditEngine::InsertUndo( EditUndo* pUndo, BOOL bTryMerge ) { - DBG_ASSERT( !IsInUndo(), "InsertUndo im Undomodus!" ); + DBG_ASSERT( !IsInUndo(), "InsertUndo in Undomodus!" ); if ( pUndoMarkSelection ) { EditUndoMarkSelection* pU = new EditUndoMarkSelection( this, *pUndoMarkSelection ); @@ -299,7 +282,7 @@ void ImpEditEngine::ResetUndoManager() void ImpEditEngine::EnableUndo( BOOL bEnable ) { - // Beim Umschalten des Modus Liste loeschen: + // When switching the mode Delete list: if ( bEnable != IsUndoEnabled() ) ResetUndoManager(); @@ -332,7 +315,7 @@ BOOL ImpEditEngine::Repeat( EditView* /* pView */ ) { if ( HasUndoManager() && GetUndoManager().GetRepeatActionCount() ) { - DBG_WARNING( "Repeat nicht implementiert!" ); + DBG_WARNING( "Repeat not implemented!" ); return TRUE; } return FALSE; @@ -344,42 +327,35 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) aSel.Adjust( aEditDoc ); -#if OSL_DEBUG_LEVEL > 1 -// if ( ( aSel.Min().GetNode() == aSel.Max().GetNode() ) && ( bOnlyHardAttrib == EditEngineAttribs_All ) ) -// return GetAttribs( aEditDoc.GetPos( aSel.Min().GetNode() ), aSel.Min().GetIndex(), aSel.Max().GetIndex(), GETATTRIBS_ALL ); -#endif - - SfxItemSet aCurSet( GetEmptyItemSet() ); USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); - // ueber die Absaetze iterieren... + // iterate over the paragraphs ... for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); - DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node nicht gefunden: GetAttrib" ); + DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node not found: GetAttrib" ); xub_StrLen nStartPos = 0; xub_StrLen nEndPos = pNode->Len(); if ( nNode == nStartNode ) nStartPos = aSel.Min().GetIndex(); - if ( nNode == nEndNode ) // kann auch == nStart sein! + if ( nNode == nEndNode ) // Can also be == nStart! nEndPos = aSel.Max().GetIndex(); - // Problem: Vorlagen.... - // => Andersrum: - // 1) Harte Zeichenattribute, wie gehabt... - // 2) Nur wenn OFF, Style and Absatzattr. pruefen... + // Problem: Templates .... + // => Other way: + // 1) Hard character attributes, as usual ... + // 2) Examine Style and paragraph attributes only when OFF ... - // Erst die ganz harte Formatierung... + // First the very hard formatting ... aEditDoc.FindAttribs( pNode, nStartPos, nEndPos, aCurSet ); if( bOnlyHardAttrib != EditEngineAttribs_OnlyHard ) { - // Und dann Absatzformatierung und Vorlage... - // SfxStyleSheet* pStyle = pNode->GetStyleSheet(); + // and then paragraph formatting and template... for ( USHORT nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++) { if ( aCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) @@ -409,13 +385,12 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) // pItem can only be NULL when bOnlyHardAttrib... if ( !pItem || ( *pItem != aCurSet.Get( nWhich ) ) ) { - // Problem: Wenn Absatzvorlage mit z.B. Font, - // aber Font hart und anders und komplett in Selektion - // Falsch, wenn invalidiert.... - // => Lieber nicht invalidieren, UMSTELLEN! - // Besser waere, Absatzweise ein ItemSet zu fuellen - // und dieses mit dem gesmten vergleichen. - // aCurSet.InvalidateItem( nWhich ); + // Problem: When Paragraph style with for example font, + // but the Font is hard and completely different, + // wrong in selection if invalidated.... + // => better not invalidate, instead CHANGE! + // It would be better to fill each paragraph with + // a itemset and compare this in large. if ( nWhich <= EE_PARA_END ) aCurSet.InvalidateItem( nWhich ); } @@ -424,7 +399,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) } } - // Leere Slots mit Defaults fuellen... + // fill empty slots with defaults ... if ( bOnlyHardAttrib == EditEngineAttribs_All ) { for ( USHORT nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++ ) @@ -441,7 +416,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) SfxItemSet ImpEditEngine::GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, sal_uInt8 nFlags ) const { - // MT: #94002# Optimized function with less Puts(), which cause unnecessary cloning from default items. + // Optimized function with less Puts(), which cause unnecessary cloning from default items. // If this works, change GetAttribs( EditSelection ) to use this for each paragraph and merge the results! DBG_CHKOBJ( GetEditEnginePtr(), EditEngine, 0 ); @@ -534,8 +509,8 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE { aSel.Adjust( aEditDoc ); - // Wenn keine Selektion => die Attribute aufs Wort anwenden. - // ( Der RTF-Perser sollte die Methode eigentlich nie ohne Range rufen ) + // When no selection => use the Attribute on the word. + // ( the RTF-parser should actually never call the Method whithout a Range ) if ( ( nSpecial == ATTRSPECIAL_WHOLEWORD ) && !aSel.HasRange() ) aSel = SelectWord( aSel, ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, FALSE ); @@ -557,7 +532,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE ( rSet.GetItemState( EE_CHAR_LANGUAGE_CTL ) == SFX_ITEM_ON ); } - // ueber die Absaetze iterieren... + // iterate over the paragraphs ... for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) { BOOL bParaAttribFound = FALSE; @@ -566,22 +541,22 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE ContentNode* pNode = aEditDoc.GetObject( nNode ); ParaPortion* pPortion = GetParaPortions().GetObject( nNode ); - DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node nicht gefunden: SetAttribs" ); - DBG_ASSERT( GetParaPortions().GetObject( nNode ), "Portion nicht gefunden: SetAttribs" ); + DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node not founden: SetAttribs" ); + DBG_ASSERT( GetParaPortions().GetObject( nNode ), "Portion not found: SetAttribs" ); xub_StrLen nStartPos = 0; xub_StrLen nEndPos = pNode->Len(); if ( nNode == nStartNode ) nStartPos = aSel.Min().GetIndex(); - if ( nNode == nEndNode ) // kann auch == nStart sein! + if ( nNode == nEndNode ) // can also be == nStart! nEndPos = aSel.Max().GetIndex(); - // ueber die Items iterieren... + // Iterate over the Items... #ifdef EDITDEBUG // FILE* fp = fopen( "d:\\debug.log", "a" ); // if ( fp ) // { -// fprintf( fp, "\n \n=> Zeichen-Attribute: Absatz %i, %i-%i\n", nNode, nStartPos, nEndPos ); +// fprintf( fp, "\n\n=> Character-Attribute: Paragraph %i, %i-%i\n", nNode, nStartPos, nEndPos ); // DbgOutItemSet( fp, rSet, TRUE, FALSE ); // fclose( fp ); // } @@ -650,7 +625,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, BOOL bRemoveParaAttri if ( IsUndoEnabled() && !IsInUndo() && aStatus.DoUndoAttribs() ) { - // Eventuel spezielles Undo, oder ItemSet* + // Possibly a special Undo, or itemset* EditUndoSetAttribs* pUndo = CreateAttribUndo( aSel, GetEmptyItemSet() ); pUndo->SetRemoveAttribs( TRUE ); pUndo->SetRemoveParaAttribs( bRemoveParaAttribs ); @@ -658,33 +633,33 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, BOOL bRemoveParaAttri InsertUndo( pUndo ); } - // ueber die Absaetze iterieren... + // iterate over the paragraphs ... for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); ParaPortion* pPortion = GetParaPortions().GetObject( nNode ); - DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node nicht gefunden: SetAttribs" ); - DBG_ASSERT( GetParaPortions().SaveGetObject( nNode ), "Portion nicht gefunden: SetAttribs" ); + DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node not found: SetAttribs" ); + DBG_ASSERT( GetParaPortions().SaveGetObject( nNode ), "Portion not found: SetAttribs" ); xub_StrLen nStartPos = 0; xub_StrLen nEndPos = pNode->Len(); if ( nNode == nStartNode ) nStartPos = aSel.Min().GetIndex(); - if ( nNode == nEndNode ) // kann auch == nStart sein! + if ( nNode == nEndNode ) // can also be == nStart! nEndPos = aSel.Max().GetIndex(); - // Optimieren: Wenn ganzer Absatz, dann RemoveCharAttribs( nPara )?! + // Optimize: If whole paragraph, then RemoveCharAttribs (nPara)? BOOL bChanged = aEditDoc.RemoveAttribs( pNode, nStartPos, nEndPos, nWhich ); if ( bRemoveParaAttribs ) { - SetParaAttribs( nNode, *_pEmptyItemSet ); // Invalidiert + SetParaAttribs( nNode, *_pEmptyItemSet ); // Invalidated } else { - // Bei 'Format-Standard' sollen auch die Zeichenattribute verschwinden, - // die von der DrawingEngine als Absatzattribute eingestellt wurden. - // Diese koennen sowieso nicht vom Anwender eingestellt worden sein. + // For 'Format-Standard' also the character attributes should + // disappear, which were set as paragraph attributes by the + // DrawingEngine. These could not have been set by the user anyway. // #106871# Not when nWhich // Would have been better to offer a separate method for format/standard... @@ -712,8 +687,8 @@ void ImpEditEngine::RemoveCharAttribs( USHORT nPara, USHORT nWhich, BOOL bRemove ContentNode* pNode = aEditDoc.SaveGetObject( nPara ); ParaPortion* pPortion = GetParaPortions().SaveGetObject( nPara ); - DBG_ASSERT( pNode, "Node nicht gefunden: RemoveCharAttribs" ); - DBG_ASSERT( pPortion, "Portion nicht gefunden: RemoveCharAttribs" ); + DBG_ASSERT( pNode, "Node not found: RemoveCharAttribs" ); + DBG_ASSERT( pPortion, "Portion not found: RemoveCharAttribs" ); if ( !pNode ) return; @@ -747,7 +722,7 @@ void ImpEditEngine::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) // FILE* fp = fopen( "d:\\debug.log", "a" ); // if ( fp ) // { -// fprintf( fp, "\n \n=> Absatz-Attribute: Absatz %i\n", nPara ); +// fprintf( fp, "\n\n=> Paragraph-Attribute: Paragraph %i\n", nPara ); // DbgOutItemSet( fp, rSet, TRUE, FALSE ); // fclose( fp ); // } @@ -779,14 +754,14 @@ void ImpEditEngine::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) const SfxItemSet& ImpEditEngine::GetParaAttribs( USHORT nPara ) const { ContentNode* pNode = aEditDoc.GetObject( nPara ); - DBG_ASSERT( pNode, "Node nicht gefunden: GetParaAttribs" ); + DBG_ASSERT( pNode, "Node not found: GetParaAttribs" ); return pNode->GetContentAttribs().GetItems(); } BOOL ImpEditEngine::HasParaAttrib( USHORT nPara, USHORT nWhich ) const { ContentNode* pNode = aEditDoc.GetObject( nPara ); - DBG_ASSERT( pNode, "Node nicht gefunden: HasParaAttrib" ); + DBG_ASSERT( pNode, "Node not found: HasParaAttrib" ); return pNode->GetContentAttribs().HasItem( nWhich ); } @@ -794,7 +769,7 @@ BOOL ImpEditEngine::HasParaAttrib( USHORT nPara, USHORT nWhich ) const const SfxPoolItem& ImpEditEngine::GetParaAttrib( USHORT nPara, USHORT nWhich ) const { ContentNode* pNode = aEditDoc.GetObject( nPara ); - DBG_ASSERT( pNode, "Node nicht gefunden: GetParaAttrib" ); + DBG_ASSERT( pNode, "Node not found: GetParaAttrib" ); return pNode->GetContentAttribs().GetItem( nWhich ); } @@ -827,7 +802,7 @@ void ImpEditEngine::ParaAttribsToCharAttribs( ContentNode* pNode ) if ( pNode->GetContentAttribs().HasItem( nWhich ) ) { const SfxPoolItem& rItem = pNode->GetContentAttribs().GetItem( nWhich ); - // Die Luecken auffuellen: + // Fill the gap: USHORT nLastEnd = 0; EditCharAttrib* pAttr = pNode->GetCharAttribs().FindNextAttrib( nWhich, nLastEnd ); while ( pAttr ) @@ -839,13 +814,13 @@ void ImpEditEngine::ParaAttribsToCharAttribs( ContentNode* pNode ) pAttr = nLastEnd ? pNode->GetCharAttribs().FindNextAttrib( nWhich, nLastEnd ) : NULL; } - // Und den Rest: + // And the Rest: if ( nLastEnd < nEndPos ) aEditDoc.InsertAttrib( pNode, nLastEnd, nEndPos, rItem ); } } bFormatted = FALSE; - // Portion braucht hier nicht invalidiert werden, geschieht woanders. + // Portion does not need to be invalidated here, happens elsewhere. } IdleFormattter::IdleFormattter() diff --git a/editeng/source/editeng/makefile.mk b/editeng/source/editeng/makefile.mk index e0c0076..6a623d0 100644 --- a/editeng/source/editeng/makefile.mk +++ b/editeng/source/editeng/makefile.mk @@ -37,7 +37,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/makefile.pmk -# --- Allgemein ---------------------------------------------------------- +# --- General ---------------------------------------------------------- .IF "$(editdebug)" != "" || "$(EDITDEBUG)" != "" CDEFS+=-DEDITDEBUG diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index b37e767..4615b1b 100644 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -101,7 +101,7 @@ sal_Bool TextConvWrapper::ConvNext_impl() if ( bStartDone && bEndDone ) { - if ( ConvMore_impl() ) // ein weiteres Dokument pruefen? + if ( ConvMore_impl() ) // examine another document? { bStartDone = sal_True; bEndDone = sal_False; @@ -112,12 +112,11 @@ sal_Bool TextConvWrapper::ConvNext_impl() } - //ResMgr* pMgr = DIALOG_MGR(); sal_Bool bGoOn = sal_False; if ( bStartDone && bEndDone ) { - if ( ConvMore_impl() ) // ein weiteres Dokument pruefen? + if ( ConvMore_impl() ) // examine another document? { bStartDone = sal_True; bEndDone = sal_False; @@ -127,32 +126,12 @@ sal_Bool TextConvWrapper::ConvNext_impl() } else { - // Ein BODY_Bereich erledigt, Frage nach dem anderen BODY_Bereich -/* - pWin->LeaveWait(); - - sal_uInt16 nResId = bReverse ? RID_SVXQB_BW_CONTINUE : RID_SVXQB_CONTINUE; - QueryBox aBox( pWin, ResId( nResId, pMgr ) ); - if ( aBox.Execute() != RET_YES ) - { - // Verzicht auf den anderen Bereich, ggf. Frage nach Sonderbereich - pWin->EnterWait(); - bStartDone = bEndDone = sal_True; - return ConvNext_impl(); - } - else - { -*/ if (!aConvSel.HasRange()) { bStartChk = !bStartDone; ConvStart_impl( bStartChk ? SVX_SPELL_BODY_START : SVX_SPELL_BODY_END ); bGoOn = sal_True; } -/* - } - pWin->EnterWait(); -*/ } return bGoOn; } @@ -162,8 +141,6 @@ sal_Bool TextConvWrapper::FindConvText_impl() { // modified version of SvxSpellWrapper::FindSpellError - //ShowLanguageErrors(); - sal_Bool bFound = sal_False; pWin->EnterWait(); @@ -199,7 +176,7 @@ sal_Bool TextConvWrapper::ConvMore_impl() bMore = pImpEE->GetEditEnginePtr()->ConvertNextDocument(); if ( bMore ) { - // Der Text wurde in diese Engine getreten... + // The text has been entered in this engine ... pEditView->GetImpEditView()->SetEditSelection( pImpEE->GetEditDoc().GetStartPaM() ); } @@ -217,8 +194,7 @@ void TextConvWrapper::ConvStart_impl( SvxSpellArea eArea ) if ( eArea == SVX_SPELL_BODY_START ) { - // Wird gerufen, wenn Spell-Forwad am Ende angekomment ist - // und soll von vorne beginnen + // Is called when Spell-forward has reached the end, and to start over if ( bEndDone ) { pConvInfo->bConvToEnd = sal_False; @@ -236,7 +212,7 @@ void TextConvWrapper::ConvStart_impl( SvxSpellArea eArea ) } else if ( eArea == SVX_SPELL_BODY_END ) { - // Wird gerufen, wenn Spell-Forwad gestartet wird + // Is called when Spell-forward starts pConvInfo->bConvToEnd = sal_True; if (aConvSel.HasRange()) { @@ -258,7 +234,6 @@ void TextConvWrapper::ConvStart_impl( SvxSpellArea eArea ) pConvInfo->aConvContinue = pConvInfo->aConvStart; pConvInfo->aConvTo = pImpEE->CreateEPaM( pImpEE->GetEditDoc().GetEndPaM() ); - // pSpellInfo->bSpellToEnd = sal_True; } else { @@ -439,7 +414,6 @@ void TextConvWrapper::ReplaceUnit( ESelection aNewSel( aOldSel ); aNewSel.nStartPos = sal::static_int_cast< xub_StrLen >( aNewSel.nStartPos - aNewTxt.getLength()); -// DBG_ASSERT( aOldSel.nEndPos >= 0, "error while building selection" ); if (pNewUnitLanguage) { diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index f14d985..f58f4b4 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -38,7 +38,6 @@ #include #include -// #90477# #include #define BULITEM_VERSION ((USHORT)2) @@ -56,7 +55,6 @@ void SvxBulletItem::StoreFont( SvStream& rStream, const Font& rFont ) rStream << rFont.GetColor(); nTemp = (USHORT)rFont.GetFamily(); rStream << nTemp; - // #90477# nTemp = (USHORT)GetStoreCharSet( rFont.GetCharSet(), rStream.GetVersion() ); nTemp = (USHORT)GetSOStoreTextEncoding((rtl_TextEncoding)rFont.GetCharSet(), (sal_uInt16)rStream.GetVersion()); rStream << nTemp; @@ -85,7 +83,6 @@ Font SvxBulletItem::CreateFont( SvStream& rStream, USHORT nVer ) USHORT nTemp; rStream >> nTemp; aFont.SetFamily((FontFamily)nTemp); - // #90477# rStream >> nTemp; nTemp = (sal_uInt16)GetSOLoadTextEncoding((rtl_TextEncoding)nTemp, (sal_uInt16)rStream.GetVersion()); aFont.SetCharSet((rtl_TextEncoding)nTemp); @@ -189,18 +186,16 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, USHORT _nWhich ) : aFont = CreateFont( rStrm, BULITEM_VERSION ); else { - // Sicheres Laden mit Test auf leere Bitmap + // Safe Load with Test on empty Bitmap Bitmap aBmp; const UINT32 nOldPos = rStrm.Tell(); - // #69345# Errorcode beim Bitmap lesen ignorieren, - // siehe Kommentar #67581# in SvxBulletItem::Store() + // Ignore Errorcode when reading Bitmap, + // see comment in SvxBulletItem::Store() BOOL bOldError = rStrm.GetError() ? TRUE : FALSE; rStrm >> aBmp; if ( !bOldError && rStrm.GetError() ) { rStrm.ResetError(); - // #71493# Keine Warnung: Das BulletItem interessiert seit 5.0 im Dateiformat nicht mehr. - // rStrm.SetError(ERRCODE_CLASS_READ | ERRCODE_SVX_BULLETITEM_NOBULLET | ERRCODE_WARNING_MASK); } if( aBmp.IsEmpty() ) @@ -338,8 +333,8 @@ int SvxBulletItem::operator==( const SfxPoolItem& rItem ) const { DBG_ASSERT(rItem.ISA(SvxBulletItem),"operator==Types not matching"); const SvxBulletItem& rBullet = (const SvxBulletItem&)rItem; - // ValidMask mitvergleichen, da sonst kein Putten in ein AttrSet moeglich, - // wenn sich das Item nur in der ValidMask von einem existierenden unterscheidet. + // Compare with ValidMask, otherwise no put possible in a AttrSet if the + // item differs only in terms of the ValidMask from an existing one. if( nValidMask != rBullet.nValidMask || nStyle != rBullet.nStyle || nScale != rBullet.nScale || @@ -374,7 +369,7 @@ int SvxBulletItem::operator==( const SfxPoolItem& rItem ) const SvStream& SvxBulletItem::Store( SvStream& rStrm, USHORT /*nItemVersion*/ ) const { - // Korrektur bei leerer Bitmap + // Correction for empty bitmap if( ( nStyle == BS_BMP ) && ( !pGraphicObject || ( GRAPHIC_NONE == pGraphicObject->GetType() ) || ( GRAPHIC_DEFAULT == pGraphicObject->GetType() ) ) ) { @@ -395,7 +390,7 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, USHORT /*nItemVersion*/ ) const { ULONG _nStart = rStrm.Tell(); - // Kleine Vorab-Schaetzung der Groesse... + // Small preliminary estimate of the size ... USHORT nFac = ( rStrm.GetCompressMode() != COMPRESSMODE_NONE ) ? 3 : 1; const Bitmap aBmp( pGraphicObject->GetGraphic().GetBitmap() ); ULONG nBytes = aBmp.GetSizeBytes(); @@ -403,15 +398,14 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, USHORT /*nItemVersion*/ ) const rStrm << aBmp; ULONG nEnd = rStrm.Tell(); - // #67581# Item darf mit Overhead nicht mehr als 64K schreiben, - // sonst platzt der SfxMultiRecord - // Dann lieber auf die Bitmap verzichten, ist nur fuer Outliner - // und auch nur fuer <= 5.0 wichtig. - // Beim Einlesen merkt der Stream-Operator der Bitmap, dass dort keine steht. - // Hiermit funktioniert jetzt der Fall das die grosse Bitmap aus einem anderen - // Fileformat entstanden ist, welches keine 64K belegt, aber wenn eine - // Bitmap > 64K verwendet wird, hat das SvxNumBulletItem beim Laden ein Problem, - // stuerzt aber nicht ab. + // Item can not write with an overhead more than 64K or SfxMultiRecord + // will crash. Then prefer to forego on the bitmap, it is only + // important for the outliner and only for <= 5.0. + // When reading, the stream-operator makes note of the bitmap and the + // fact that there is none. This is now the case how it works with + // large bitmap created from another file format, which do not occupy a + // 64K chunk, but if a bitmap > 64K is used, the SvxNumBulletItem will + // have problem loading it, but does not crash. if ( (nEnd-_nStart) > 0xFF00 ) rStrm.Seek( _nStart ); diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index 0aa8a49..9b7be3c 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -39,7 +39,6 @@ #include -// #90477# #include #define FRAME_MARKER (sal_uInt32)0x21981357 @@ -74,9 +73,9 @@ SvxFieldData* SvxFieldData::Clone() const int SvxFieldData::operator==( const SvxFieldData& rFld ) const { - DBG_ASSERT( Type() == rFld.Type(), "==: Verschiedene Typen" ); + DBG_ASSERT( Type() == rFld.Type(), "==: Different Types" ); (void)rFld; - return TRUE; // Basicklasse immer gleich. + return TRUE; // Basic class is always the same. } // ----------------------------------------------------------------------- @@ -107,7 +106,7 @@ MetaAction* SvxFieldData::createEndComment() const SvxFieldItem::SvxFieldItem( SvxFieldData* pFld, const USHORT nId ) : SfxPoolItem( nId ) { - pField = pFld; // gehoert direkt dem Item + pField = pFld; // belongs directly to the item } // ----------------------------------------------------------------------- @@ -152,7 +151,7 @@ SfxPoolItem* SvxFieldItem::Create( SvStream& rStrm, USHORT ) const aPStrm.SetError( SVSTREAM_GENERALERROR ); if ( aPStrm.GetError() == ERRCODE_IO_NOFACTORY ) - aPStrm.ResetError(); // Eigentlich einen Code, dass nicht alle Attr gelesen wurden... + aPStrm.ResetError(); // Actually a code for that not all were read Attr ... return new SvxFieldItem( pData, Which() ); } @@ -161,14 +160,14 @@ SfxPoolItem* SvxFieldItem::Create( SvStream& rStrm, USHORT ) const SvStream& SvxFieldItem::Store( SvStream& rStrm, USHORT /*nItemVersion*/ ) const { - DBG_ASSERT( pField, "SvxFieldItem::Store: Feld?!" ); + DBG_ASSERT( pField, "SvxFieldItem::Store: Field?!" ); SvPersistStream aPStrm( GetClassManager(), &rStrm ); - // Das ResetError in der obigen Create-Methode gab es in 3.1 noch nicht, - // deshalb duerfen beim 3.x-Export neuere Items nicht gespeichert werden! + // The reset error in the above Create method did not exist in 3.1, + // therefore newer items can not be saved for 3.x-exports! if ( ( rStrm.GetVersion() <= SOFFICE_FILEFORMAT_31 ) && pField && pField->GetClassId() == 50 /* SdrMeasureField */ ) { - // SvxFieldData reicht nicht, weil auch nicht am ClassMgr angemeldet + // SvxFieldData not enough, because not registered on ClassMgr. SvxURLField aDummyData; aPStrm << &aDummyData; } @@ -196,7 +195,7 @@ int SvxFieldItem::operator==( const SfxPoolItem& rItem ) const } // ================================================================= -// Es folgen die Ableitungen von SvxFieldData... +// The following are the derivatives of SvxFieldData ... // ================================================================= SV_IMPL_PERSIST1( SvxDateField, SvxFieldData ); @@ -277,12 +276,12 @@ String SvxDateField::GetFormatted( Date& aDate, SvxDateFormat eFormat, SvNumberF { if ( eFormat == SVXDATEFORMAT_SYSTEM ) { - DBG_ERROR( "SVXDATEFORMAT_SYSTEM nicht implementiert!" ); + DBG_ERROR( "SVXDATEFORMAT_SYSTEM not implemented!" ); eFormat = SVXDATEFORMAT_STDSMALL; } else if ( eFormat == SVXDATEFORMAT_APPDEFAULT ) { - DBG_ERROR( "SVXDATEFORMAT_APPDEFAULT: Woher nehmen?" ); + DBG_ERROR( "SVXDATEFORMAT_APPDEFAULT: take them from where? "); eFormat = SVXDATEFORMAT_STDSMALL; } @@ -311,15 +310,15 @@ String SvxDateField::GetFormatted( Date& aDate, SvxDateFormat eFormat, SvNumberF nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYS_DMMMYYYY, eLang ); break; case SVXDATEFORMAT_D: - // 13. Februar 1996 + // 13. February 1996 nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYS_DMMMMYYYY, eLang ); break; case SVXDATEFORMAT_E: - // Die, 13. Februar 1996 + // The, 13. February 1996 nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYS_NNDMMMMYYYY, eLang ); break; case SVXDATEFORMAT_F: - // Dienstag, 13. Februar 1996 + // Tuesday, 13. February 1996 nFormatKey = rFormatter.GetFormatIndex( NF_DATE_SYS_NNNNDMMMMYYYY, eLang ); break; default: @@ -394,7 +393,7 @@ void SvxURLField::Load( SvPersistStream & rStm ) // read to a temp string first, read text encoding and // convert later to stay compatible to fileformat ByteString aTempString; - rtl_TextEncoding aTempEncoding = RTL_TEXTENCODING_MS_1252; // #101493# Init for old documents + rtl_TextEncoding aTempEncoding = RTL_TEXTENCODING_MS_1252; // Init for old documents rStm.ReadByteString(aTempString); rStm >> nFrameMarker; @@ -423,7 +422,7 @@ void SvxURLField::Load( SvPersistStream & rStm ) eFormat= (SvxURLFormat)nFormat; - // Relatives Speichern => Beim laden absolut machen. + // Relative save => make it absolute for loading DBG_ERROR("No BaseURL!"); // TODO/MBA: no BaseURL aURL = INetURLObject::GetAbsURL( String(), aTmpURL ); @@ -433,7 +432,7 @@ void SvxURLField::Load( SvPersistStream & rStm ) void SvxURLField::Save( SvPersistStream & rStm ) { - // Relatives Speichern der URL + // Relative save of the URL DBG_ERROR("No BaseURL!"); // TODO/MBA: no BaseURL String aTmpURL = INetURLObject::GetRelURL( String(), aURL ); @@ -467,14 +466,14 @@ MetaAction* SvxURLField::createBeginComment() const } // ================================================================= -// Die Felder, die aus Calc ausgebaut wurden: +// The fields that were removed from Calc: // ================================================================= SV_IMPL_PERSIST1( SvxPageField, SvxFieldData ); SvxFieldData* SvxPageField::Clone() const { - return new SvxPageField; // leer + return new SvxPageField; // empty } int SvxPageField::operator==( const SvxFieldData& rCmp ) const @@ -500,7 +499,7 @@ SV_IMPL_PERSIST1( SvxPagesField, SvxFieldData ); SvxFieldData* SvxPagesField::Clone() const { - return new SvxPagesField; // leer + return new SvxPagesField; // empty } int SvxPagesField::operator==( const SvxFieldData& rCmp ) const @@ -520,7 +519,7 @@ SV_IMPL_PERSIST1( SvxTimeField, SvxFieldData ); SvxFieldData* SvxTimeField::Clone() const { - return new SvxTimeField; // leer + return new SvxTimeField; // empty } int SvxTimeField::operator==( const SvxFieldData& rCmp ) const @@ -545,7 +544,7 @@ SV_IMPL_PERSIST1( SvxFileField, SvxFieldData ); SvxFieldData* SvxFileField::Clone() const { - return new SvxFileField; // leer + return new SvxFileField; // empty } int SvxFileField::operator==( const SvxFieldData& rCmp ) const @@ -565,7 +564,7 @@ SV_IMPL_PERSIST1( SvxTableField, SvxFieldData ); SvxFieldData* SvxTableField::Clone() const { - return new SvxTableField; // leer + return new SvxTableField; // empty } int SvxTableField::operator==( const SvxFieldData& rCmp ) const @@ -1013,7 +1012,7 @@ SV_IMPL_PERSIST1( SvxHeaderField, SvxFieldData ); SvxFieldData* SvxHeaderField::Clone() const { - return new SvxHeaderField; // leer + return new SvxHeaderField; // empty } int SvxHeaderField::operator==( const SvxFieldData& rCmp ) const @@ -1035,7 +1034,7 @@ SV_IMPL_PERSIST1( SvxFooterField, SvxFieldData ); SvxFieldData* SvxFooterField::Clone() const { - return new SvxFooterField; // leer + return new SvxFooterField; // empty } int SvxFooterField::operator==( const SvxFieldData& rCmp ) const @@ -1057,7 +1056,7 @@ SV_IMPL_PERSIST1( SvxDateTimeField, SvxFieldData ); SvxFieldData* SvxDateTimeField::Clone() const { - return new SvxDateTimeField; // leer + return new SvxDateTimeField; // empty } int SvxDateTimeField::operator==( const SvxFieldData& rCmp ) const diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 8faf443..c11df0e 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -97,7 +97,7 @@ using namespace ::rtl; using namespace ::com::sun::star; -// Konvertierung fuer UNO +// Conversion for UNO #define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) #define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L)) #define TWIP_TO_MM100_UNSIGNED(TWIP) ((((TWIP)*127L+36L)/72L)) @@ -438,7 +438,7 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { - // jetzt alles signed + // now all signed case MID_L_MARGIN: rVal <<= (sal_Int32)(bConvert ? TWIP_TO_MM100(nLeftMargin) : nLeftMargin); break; @@ -535,7 +535,7 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) // ----------------------------------------------------------------------- -// nLeftMargin und nTxtLeft anpassen. +// Adapt nLeftMargin and nTxtLeft. void SvxLRSpaceItem::AdjustLeft() { @@ -650,15 +650,14 @@ SfxItemPresentation SvxLRSpaceItem::GetPresentation // ----------------------------------------------------------------------- -// MT: BulletFI: Vor 501 wurde im Outliner das Bullet nicht auf der Position des -// FI positioniert, deshalb muss in aelteren Dokumenten der FI auf 0 stehen. - +// BulletFI: Before 501 in the Outliner the bullet was not on the position of +// the FI, so in older documents one must set FI to 0. #define BULLETLR_MARKER 0x599401FE SvStream& SvxLRSpaceItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const { short nSaveFI = nFirstLineOfst; - ((SvxLRSpaceItem*)this)->SetTxtFirstLineOfst( 0 ); // nLeftMargin wird mitmanipuliert, siehe Create() + ((SvxLRSpaceItem*)this)->SetTxtFirstLineOfst( 0 ); // nLeftMargin is manipulated together with this, see Create() sal_uInt16 nMargin = 0; if( nLeftMargin > 0 ) @@ -686,8 +685,8 @@ SvStream& SvxLRSpaceItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) con nAutoFirst |= 0x80; rStrm << nAutoFirst; - // Ab 6.0 keine Magicnumber schreiben... - DBG_ASSERT( rStrm.GetVersion() <= SOFFICE_FILEFORMAT_50, "MT: Fileformat SvxLRSpaceItem aendern!" ); + // From 6.0 onwards, do not write Magic numbers... + DBG_ASSERT( rStrm.GetVersion() <= SOFFICE_FILEFORMAT_50, "Change File format SvxLRSpaceItem!" ); rStrm << (sal_uInt32) BULLETLR_MARKER; rStrm << nSaveFI; @@ -723,7 +722,7 @@ SfxPoolItem* SvxLRSpaceItem::Create( SvStream& rStrm, sal_uInt16 nVersion ) cons { rStrm >> firstline; if ( firstline < 0 ) - left = left + static_cast(firstline); // s.u.: txtleft = ... + left = left + static_cast(firstline); // see below: txtleft = ... } else rStrm.Seek( nPos ); @@ -831,7 +830,7 @@ bool SvxULSpaceItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { - // jetzt alles signed + // now all signed case 0: { ::com::sun::star::frame::status::UpperLowerMarginScale aUpperLowerMarginScale; @@ -1168,7 +1167,6 @@ int SvxProtectItem::operator==( const SfxPoolItem& rAttr ) const bool SvxProtectItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Bool bValue; switch(nMemberId) @@ -1177,7 +1175,7 @@ bool SvxProtectItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const case MID_PROTECT_SIZE : bValue = bSize; break; case MID_PROTECT_POSITION: bValue = bPos; break; default: - DBG_ERROR("falsche MemberId"); + DBG_ERROR("Wrong MemberId"); return false; } @@ -1187,7 +1185,6 @@ bool SvxProtectItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxProtectItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Bool bVal( Any2Bool(rVal) ); switch(nMemberId) @@ -1196,7 +1193,7 @@ bool SvxProtectItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) case MID_PROTECT_SIZE : bSize = bVal; break; case MID_PROTECT_POSITION: bPos = bVal; break; default: - DBG_ERROR("falsche MemberId"); + DBG_ERROR("Wrong MemberId"); return false; } return true; @@ -1640,7 +1637,7 @@ XubString SvxBorderLine::GetValueString( SfxMapUnit eSrcUnit, } else if ( DEF_LINE_WIDTH_1 == nDistance ) { - // doppelte Linie, kleiner Abstand + // double line, small gap if ( DEF_LINE_WIDTH_0 == nOutWidth && DEF_LINE_WIDTH_0 == nInWidth ) nResId = RID_DOUBLE_LINE0; else if ( DEF_LINE_WIDTH_1 == nOutWidth && @@ -1652,7 +1649,7 @@ XubString SvxBorderLine::GetValueString( SfxMapUnit eSrcUnit, } else if ( DEF_LINE_WIDTH_2 == nDistance ) { - // doppelte Linie, gro\ser Abstand + // double line, large gap if ( DEF_LINE_WIDTH_0 == nOutWidth && DEF_LINE_WIDTH_0 == nInWidth ) nResId = RID_DOUBLE_LINE1; else if ( DEF_LINE_WIDTH_2 == nOutWidth && @@ -2681,39 +2678,6 @@ SfxItemPresentation SvxBoxInfoItem::GetPresentation XubString& rText, const IntlWrapper * ) const { -#ifndef SVX_LIGHT -/*!!! - ResMgr* pMgr = DIALOG_MGR(); - if ( pHori ) - { - rText += pHori->GetValueString(); - rText += cpDelim; - } - if ( pVert ) - { - rText += pVert->GetValueString(); - rText += cpDelim; - } - if ( bTable ) - rText += String( ResId( RID_SVXITEMS_BOXINF_TABLE_TRUE, pMgr ) ); - else - rText += String( ResId( RID_SVXITEMS_BOXINF_TABLE_FALSE, pMgr ) ); - rText += cpDelim; - if ( bDist ) - rText += String( ResId( RID_SVXITEMS_BOXINF_DIST_TRUE, pMgr ) ); - else - rText += String( ResId( RID_SVXITEMS_BOXINF_DIST_FALSE, pMgr ) ); - rText += cpDelim; - if ( bMinDist ) - rText += String( ResId( RID_SVXITEMS_BOXINF_MDIST_TRUE, pMgr ) ); - else - rText += String( ResId( RID_SVXITEMS_BOXINF_MDIST_FALSE, pMgr ) ); - rText += cpDelim; - rText += nDefDist; - return SFX_ITEM_PRESENTATION_NAMELESS; -*/ - rText.Erase(); -#endif // !SVX_LIGHT return SFX_ITEM_PRESENTATION_NONE; } @@ -2808,7 +2772,7 @@ SfxPoolItem* SvxBoxInfoItem::Create( SvStream& rStrm, sal_uInt16 ) const void SvxBoxInfoItem::ResetFlags() { - nValidFlags = 0x7F; // alles g"ultig au/ser Disable + nValidFlags = 0x7F; // all valid except Disable } bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const @@ -2879,8 +2843,6 @@ bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); -// sal_uInt16 nLine = BOX_LINE_TOP; -// sal_Bool bDistMember = sal_False; nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet; switch(nMemberId) @@ -3136,7 +3098,7 @@ sal_uInt16 SvxFmtBreakItem::GetVersion( sal_uInt16 nFFVer ) const DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || SOFFICE_FILEFORMAT_50==nFFVer, - "SvxFmtBreakItem: Gibt es ein neues Fileformat?" ); + "SvxFmtBreakItem: Is there a new file format? "); return SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer ? 0 : FMTBREAK_NOAUTO; } @@ -3706,7 +3668,6 @@ inline sal_Int8 lcl_TransparencyToPercent(sal_Int32 nTrans) bool SvxBrushItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId) { @@ -3768,7 +3729,6 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxBrushItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId) { @@ -4042,9 +4002,9 @@ SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ ) } // ----------------------------------------------------------------------- -// const wegcasten, da const als logisches const zu verstehen ist -// wenn GetGraphic() gerufen wird, soll sich das Item darum kuemmern, -// eine gelinkte Grafik zu holen. +// cast away const, since const is to be understood as a logical const +// if GetGraphic() is called, the item should take care of getting a linked +// graphic. // ----------------------------------------------------------------------- void SvxBrushItem::PurgeGraphic() const @@ -4065,26 +4025,11 @@ void SvxBrushItem::PurgeMedium() const const GraphicObject* SvxBrushItem::GetGraphicObject() const { if ( bLoadAgain && pStrLink && !pImpl->pGraphicObject ) - // wenn Grafik schon geladen, als Cache benutzen + // when graphics already loaded, use as a cache { - //JP 29.6.2001: only with "valid" names - empty names now allowed + // only with "valid" names - empty names now allowed if( pStrLink->Len() ) { - // currently we don't have asynchronous processing -/* if( pImpl->aDoneLink.IsSet() ) - { - // Auf besonderen Wunsch des Writers wird der synchrone und der - // asynchrone Fall was die Benachrichtigung angeht unterschiedlich - // behandelt. Der Callback erfolgt nur bei asynchronem Eintreffen - // der Daten - - Link aTmp = pImpl->aDoneLink; - pImpl->aDoneLink = Link(); - pImpl->xMedium->DownLoad( - STATIC_LINK( this, SvxBrushItem, DoneHdl_Impl ) ); - pImpl->aDoneLink = aTmp; - } */ - pImpl->pStream = utl::UcbStreamHelper::CreateStream( *pStrLink, STREAM_STD_READ ); if( pImpl->pStream && !pImpl->pStream->GetError() ) { @@ -4110,9 +4055,6 @@ const GraphicObject* SvxBrushItem::GetGraphicObject() const { const_cast < SvxBrushItem*> (this)->bLoadAgain = sal_False; } - - // currently we don't have asynchronous processing -// pThis->pImpl->aDoneLink.Call( pThis ); } } @@ -4143,7 +4085,7 @@ void SvxBrushItem::SetGraphicPos( SvxGraphicPosition eNew ) { if ( !pImpl->pGraphicObject && !pStrLink ) { - pImpl->pGraphicObject = new GraphicObject; // dummy anlegen + pImpl->pGraphicObject = new GraphicObject; // Creating a dummy } } } @@ -4162,7 +4104,7 @@ void SvxBrushItem::SetGraphic( const Graphic& rNew ) ApplyGraphicTransparency_Impl(); if ( GPOS_NONE == eGraphicPos ) - eGraphicPos = GPOS_MM; // None waere Brush, also Default: Mitte + eGraphicPos = GPOS_MM; // None would be brush, then Default: middle } else { @@ -4184,7 +4126,7 @@ void SvxBrushItem::SetGraphicObject( const GraphicObject& rNewObj ) ApplyGraphicTransparency_Impl(); if ( GPOS_NONE == eGraphicPos ) - eGraphicPos = GPOS_MM; // None waere Brush, also Default: Mitte + eGraphicPos = GPOS_MM; // None would be brush, then Default: middle } else { @@ -4228,7 +4170,7 @@ void SvxBrushItem::SetGraphicFilter( const String& rNew ) SvxGraphicPosition SvxBrushItem::WallpaperStyle2GraphicPos( WallpaperStyle eStyle ) { SvxGraphicPosition eResult; - // der Switch ist nicht der schnellste, dafuer aber am sichersten + // The switch is not the fastest, but the safest switch( eStyle ) { case WALLPAPER_NULL: eResult = GPOS_NONE; break; @@ -4303,7 +4245,6 @@ CntWallpaperItem* SvxBrushItem::CreateCntWallpaperItem() const { DBG_ERRORFILE( "Don't know what to do with a graphic" ); } -// pItem->SetGraphic( *pImpl->pGraphic, bLink ); return pItem; } diff --git a/editeng/source/items/itemtype.cxx b/editeng/source/items/itemtype.cxx index 6a8ee03..1c290d3 100644 --- a/editeng/source/items/itemtype.cxx +++ b/editeng/source/items/itemtype.cxx @@ -124,7 +124,6 @@ XubString GetMetricText( long nVal, SfxMapUnit eSrcUnit, SfxMapUnit eDestUnit, c nRet %= nDiff; if( 4 == nDigits ) { -// DBG_ASSERT(pIntl, "no IntlWrapper* set") if(pIntl) sRet += pIntl->getLocaleData()->getNumDecimalSep(); else diff --git a/editeng/source/items/justifyitem.cxx b/editeng/source/items/justifyitem.cxx index e6dc9db..559ce8c 100644 --- a/editeng/source/items/justifyitem.cxx +++ b/editeng/source/items/justifyitem.cxx @@ -212,7 +212,7 @@ SfxPoolItem* SvxHorJustifyItem::Create( SvStream& rStream, USHORT ) const USHORT SvxHorJustifyItem::GetValueCount() const { - return SVX_HOR_JUSTIFY_REPEAT + 1; // letzter Enum-Wert + 1 + return SVX_HOR_JUSTIFY_REPEAT + 1; // Last Enum value + 1 } // class SvxVerJustifyItem ----------------------------------------------- @@ -365,7 +365,7 @@ SfxPoolItem* SvxVerJustifyItem::Create( SvStream& rStream, USHORT ) const USHORT SvxVerJustifyItem::GetValueCount() const { - return SVX_VER_JUSTIFY_BOTTOM + 1; // letzter Enum-Wert + 1 + return SVX_VER_JUSTIFY_BOTTOM + 1; // Last Enum value + 1 } @@ -470,7 +470,7 @@ SfxPoolItem* SvxJustifyMethodItem::Create( SvStream& rStream, USHORT ) const USHORT SvxJustifyMethodItem::GetValueCount() const { - return SVX_JUSTIFY_METHOD_DISTRIBUTE + 1; // letzter Enum-Wert + 1 + return SVX_JUSTIFY_METHOD_DISTRIBUTE + 1; // Last Enum value + 1 } SvxJustifyMethodItem& SvxJustifyMethodItem::operator=(const SvxJustifyMethodItem& r) diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 9489f6a..529b5a4 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -54,8 +54,8 @@ #define MM100_TO_TWIP(MM100) ((MM100*72L+63L)/127L) -#define DEF_WRITER_LSPACE 500 //Standardeinrueckung -#define DEF_DRAW_LSPACE 800 //Standardeinrueckung +#define DEF_WRITER_LSPACE 500 //Standard Indentation +#define DEF_DRAW_LSPACE 800 //Standard Indentation #define NUMITEM_VERSION_01 0x01 #define NUMITEM_VERSION_02 0x02 @@ -133,7 +133,7 @@ String SvxNumberType::GetNumStr( ULONG nNo, const Locale& rLocale ) const break; default: { - //#95525# '0' allowed for ARABIC numberings + // '0' allowed for ARABIC numberings if(NumberingType::ARABIC == nNumType && 0 == nNo ) aTmpStr = '0'; else @@ -334,7 +334,7 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC { rStream << (USHORT)1; - // #75113# in SD or SI force bullet itself to be stored, + // in SD or SI force bullet itself to be stored, // for that purpose throw away link when link and graphic // are present, so Brush save is forced if(pGraphicBrush->GetGraphicLink() && pGraphicBrush->GetGraphic()) @@ -579,7 +579,7 @@ long SvxNumberFormat::GetIndentAt() const IMPL_STATIC_LINK( SvxNumberFormat, GraphicArrived, void *, EMPTYARG ) { - // ggfs. die GrfSize setzen: + // if necessary, set the GrfSize: if( !pThis->aGraphicSize.Width() || !pThis->aGraphicSize.Height() ) { const Graphic* pGrf = pThis->pGraphicBrush->GetGraphic(); @@ -614,12 +614,12 @@ Size SvxNumberFormat::GetGraphicSizeMM100(const Graphic* pGraphic) String SvxNumberFormat::CreateRomanString( ULONG nNo, BOOL bUpper ) { - nNo %= 4000; // mehr kann nicht dargestellt werden + nNo %= 4000; // more can not be displayed // i, ii, iii, iv, v, vi, vii, vii, viii, ix // (Dummy),1000,500,100,50,10,5,1 const char *cRomanArr = bUpper - ? "MDCLXVI--" // +2 Dummy-Eintraege !! - : "mdclxvi--"; // +2 Dummy-Eintraege !! + ? "MDCLXVI--" // +2 Dummy entries! + : "mdclxvi--"; // +2 Dummy entries! String sRet; USHORT nMask = 1000; @@ -652,7 +652,7 @@ String SvxNumberFormat::CreateRomanString( ULONG nNo, BOOL bUpper ) break; } - nMask /= 10; // zur naechsten Dekade + nMask /= 10; // for the next decade cRomanArr += 2; } return sRet; @@ -660,7 +660,7 @@ String SvxNumberFormat::CreateRomanString( ULONG nNo, BOOL bUpper ) #ifdef OLD_NUMBER_FORMATTING void SvxNumberFormat::GetCharStr( ULONG nNo, String& rStr ) const { - DBG_ASSERT( nNo, "0 ist eine ungueltige Nummer !!" ); + DBG_ASSERT( nNo, "0 is an invalid number !!"); const ULONG coDiff = 'Z' - 'A' +1; char cAdd = (SVX_NUM_CHARS_UPPER_LETTER == eNumType ? 'A' : 'a') - 1; @@ -679,7 +679,7 @@ void SvxNumberFormat::GetCharStr( ULONG nNo, String& rStr ) const void SvxNumberFormat::GetCharStrN( ULONG nNo, String& rStr ) const { - DBG_ASSERT( nNo, "0 ist eine ungueltige Nummer !!" ); + DBG_ASSERT( nNo, "0 is an invalid number !!"); const ULONG coDiff = 'Z' - 'A' +1; char cChar = (char)(--nNo % coDiff); @@ -719,7 +719,7 @@ SvxNumRule::SvxNumRule( ULONG nFeatures, if(i < nLevels) { aFmts[i] = new SvxNumberFormat(SVX_NUM_CHARS_UPPER_LETTER); - //daran wird zwischen writer und draw unterschieden + // It is a distinction between writer and draw if(nFeatures & NUM_CONTINUOUS) { if ( eDefaultNumberFormatPositionAndSpaceMode == @@ -900,7 +900,7 @@ int SvxNumRule::operator==( const SvxNumRule& rCopy) const const SvxNumberFormat* SvxNumRule::Get(USHORT nLevel)const { - DBG_ASSERT(nLevel < SVX_MAX_NUM, "falsches Level" ); + DBG_ASSERT(nLevel < SVX_MAX_NUM, "Wrong Level" ); if( nLevel < SVX_MAX_NUM ) return aFmtsSet[nLevel] ? aFmts[nLevel] : 0; else @@ -915,7 +915,7 @@ const SvxNumberFormat& SvxNumRule::GetLevel(USHORT nLevel)const pStdOutlineNumFmt = new SvxNumberFormat(SVX_NUM_NUMBER_NONE); } - DBG_ASSERT(nLevel < SVX_MAX_NUM, "falsches Level" ); + DBG_ASSERT(nLevel < SVX_MAX_NUM, "Wrong Level" ); return ( ( nLevel < SVX_MAX_NUM ) && aFmts[nLevel] ) ? *aFmts[nLevel] : eNumberingType == SVX_RULETYPE_NUMBERING ? @@ -925,7 +925,7 @@ const SvxNumberFormat& SvxNumRule::GetLevel(USHORT nLevel)const void SvxNumRule::SetLevel( USHORT i, const SvxNumberFormat& rNumFmt, BOOL bIsValid ) { - DBG_ASSERT(i < SVX_MAX_NUM, "falsches Level" ); + DBG_ASSERT(i < SVX_MAX_NUM, "Wrong Level" ); if( (i < SVX_MAX_NUM) && (!aFmtsSet[i] || !(rNumFmt == *Get( i ))) ) { @@ -937,7 +937,7 @@ void SvxNumRule::SetLevel( USHORT i, const SvxNumberFormat& rNumFmt, BOOL bIsVal void SvxNumRule::SetLevel(USHORT nLevel, const SvxNumberFormat* pFmt) { - DBG_ASSERT(nLevel < SVX_MAX_NUM, "falsches Level" ); + DBG_ASSERT(nLevel < SVX_MAX_NUM, "Wrong Level" ); if( nLevel < SVX_MAX_NUM ) { @@ -963,7 +963,7 @@ String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, BOOL bInclStrings ) c BYTE i = rNum.GetLevel(); if( !IsContinuousNumbering() && - 1 < rMyNFmt.GetIncludeUpperLevels() ) // nur der eigene Level ? + 1 < rMyNFmt.GetIncludeUpperLevels() ) // only on own level? { BYTE n = rMyNFmt.GetIncludeUpperLevels(); if( 1 < n ) @@ -980,9 +980,6 @@ String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, BOOL bInclStrings ) c const SvxNumberFormat& rNFmt = GetLevel( i ); if( SVX_NUM_NUMBER_NONE == rNFmt.GetNumberingType() ) { - // Soll aus 1.1.1 --> 2. NoNum --> 1..1 oder 1.1 ?? - // if( i != rNum.nMyLevel ) - // aStr += aDotStr; continue; } @@ -995,7 +992,7 @@ String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, BOOL bInclStrings ) c bDot = sal_False; } else - aStr += sal_Unicode('0'); // alle 0-Level sind eine 0 + aStr += sal_Unicode('0'); // all 0-levels are a 0 if( i != rNum.GetLevel() && bDot) aStr += sal_Unicode('.'); } diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx index 280bd76..e899af4 100644 --- a/editeng/source/items/paperinf.cxx +++ b/editeng/source/items/paperinf.cxx @@ -40,7 +40,7 @@ #include /*-------------------------------------------------------------------- - Beschreibung: Ist der Printer gueltig + Description: Is the printer valid --------------------------------------------------------------------*/ inline BOOL IsValidPrinter( const Printer* pPtr ) @@ -58,10 +58,9 @@ Size SvxPaperInfo::GetPaperSize( Paper ePaper, MapUnit eUnit ) } /*------------------------------------------------------------------------ - Beschreibung: Papiergroesse der Druckers liefern, aligned auf - die eigenen Groessen. - Falls kein Printer im System eingestellt ist, - wird DIN A4 Portrait als Defaultpapiergroesse geliefert. + Description: Return the paper size of the printer, aligned to our + own sizes. If no Printer is set in the system, A4 portrait + will be delivered as the default paper size. ------------------------------------------------------------------------*/ //Is this method may be confused about the units it returns ? @@ -76,8 +75,8 @@ Size SvxPaperInfo::GetPaperSize( const Printer* pPrinter ) if ( ePaper == PAPER_USER ) { - // Orientation nicht beruecksichtigen, da durch SV bereits - // die richtigen Masze eingestellt worden sind. + // Orientation not take into account, as the right size has + // been already set by SV Size aPaperSize = pPrinter->GetPaperSize(); const Size aInvalidSize; @@ -94,7 +93,7 @@ Size SvxPaperInfo::GetPaperSize( const Printer* pPrinter ) const Orientation eOrient = pPrinter->GetOrientation(); Size aSize( GetPaperSize( ePaper ) ); - // bei Landscape die Seiten tauschen, ist bei SV schon geschehen + // for Landscape exchange the pages, has already been done by SV if ( eOrient == ORIENTATION_LANDSCAPE ) Swap( aSize ); return aSize; @@ -130,8 +129,7 @@ Size SvxPaperInfo::GetDefaultPaperSize( MapUnit eUnit ) } /*------------------------------------------------------------------------ - Beschreibung: String Repr"asentation f"ur die SV-Defines f"ur - Papiergroessen. + Description: String representation for the SV-defines of paper size ------------------------------------------------------------------------*/ String SvxPaperInfo::GetName( Paper ePaper ) diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 0d33ed7..009c49f 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -124,15 +124,14 @@ int SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const const SvxLineSpacingItem& rLineSpace = (const SvxLineSpacingItem&)rAttr; return ( - // Gleiche Linespacing Rule? + // Same Linespacing Rule? (eLineSpace == rLineSpace.eLineSpace) - // Bei maximalem und minimalem Linespacing muss das Mass - // uebereinstimmen. + // For maximum and minimum Linespacing be the size must coincide. && (eLineSpace == SVX_LINE_SPACE_AUTO || nLineHeight == rLineSpace.nLineHeight) - // Gleiche Interlinespacing Rule? + // Same Linespacing Rule? && ( eInterLineSpace == rLineSpace.eInterLineSpace ) - // Entweder proportional oder draufaddieren eingestellt. + // Either set proportional or additive. && (( eInterLineSpace == SVX_INTER_LINE_SPACE_OFF) || (eInterLineSpace == SVX_INTER_LINE_SPACE_PROP && nPropLineSpace == rLineSpace.nPropLineSpace) @@ -141,11 +140,10 @@ int SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const 1 : 0; } -/* wer weiss noch, wieso das LineSpacingItem so - kompliziert ist? Fuer UNO koennen wir das nicht - gebrauchen. Da gibt es nur zwei Werte: - - ein sal_uInt16 fuer den Modus - - ein sal_uInt32 fuer alle Werte (Abstand, Hoehe, rel. Angaben) +/* Who does still know why the LineSpacingItem is so complicated? + We can not use it for UNO since there are only two values: + - ein sal_uInt16 for the mode + - ein sal_uInt32 for all values (distance, height, rel. detail) */ bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { @@ -323,14 +321,14 @@ sal_uInt16 SvxLineSpacingItem::GetValueCount() const XubString SvxLineSpacingItem::GetValueTextByPos( sal_uInt16 nPos ) const { - //! Strings demnaechst aus Resource laden + //! load strings from resource XubString aText; switch ( nPos ) { - case SVX_LINESPACE_USER : aText.AppendAscii( "Benutzer" ); break; - case SVX_LINESPACE_ONE_LINE : aText.AppendAscii( "Einzeilig" ); break; - case SVX_LINESPACE_ONE_POINT_FIVE_LINES : aText.AppendAscii( "1,5zeilig" ); break; - case SVX_LINESPACE_TWO_LINES : aText.AppendAscii( "Zweizeilig" ); break; + case SVX_LINESPACE_USER : aText.AppendAscii( "User" ); break; + case SVX_LINESPACE_ONE_LINE : aText.AppendAscii( "One line" ); break; + case SVX_LINESPACE_ONE_POINT_FIVE_LINES : aText.AppendAscii( "1.5 line" ); break; + case SVX_LINESPACE_TWO_LINES : aText.AppendAscii( "Two lines" ); break; } return aText; } @@ -386,7 +384,6 @@ int SvxAdjustItem::operator==( const SfxPoolItem& rAttr ) const bool SvxAdjustItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -405,7 +402,6 @@ bool SvxAdjustItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxAdjustItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -702,7 +698,6 @@ SvxHyphenZoneItem::SvxHyphenZoneItem( const sal_Bool bHyph, const sal_uInt16 nId // ----------------------------------------------------------------------- bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -724,7 +719,6 @@ bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const // ----------------------------------------------------------------------- bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Int16 nNewVal = 0; @@ -982,27 +976,6 @@ SvxTabStopItem& SvxTabStopItem::operator=( const SvxTabStopItem& rTSI ) return *this; } - -/* - enum ::com::sun::star::style::TabAlign -{ - TABALIGN_LEFT, - TABALIGN_CENTER, - TABALIGN_RIGHT, - TABALIGN_DECIMAL -}; - -struct ::com::sun::star::style::TabStop -{ - long Position; - ::com::sun::star::style::TabAlign ::com::sun::star::drawing::Alignment; - unsigned short DecimalChar; - unsigned short FillChar; -}; -typedef sequence ::com::sun::star::style::TabStop> TabSTopSequence; - - */ - bool SvxTabStopItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); @@ -1223,11 +1196,9 @@ SfxPoolItem* SvxTabStopItem::Create( SvStream& rStrm, sal_uInt16 ) const SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) const { - //MA 05. Sep. 96: Default-Tabs werden nur noch fuer das default-Attr - //expandiert. Fuer vollstaendige Rueckwaertskompatibilitaet (<=304) - //muessten alle Tabs expandiert werden, dass blaeht aber das File u.U. - //enorm auf. - //Alles nur SWG! + // Default-Tabs are only expanded for the default Attribute. For complete + // backward compabillity (<=304) all tabs have to be expanded, this makes + // the files grow large in size. All only SWG! const SfxItemPool *pPool = SfxItemPool::GetStoringPool(); const bool bStoreDefTabs = pPool @@ -1370,7 +1341,6 @@ SfxPoolItem* SvxPageModelItem::Clone( SfxItemPool* ) const bool SvxPageModelItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -1385,7 +1355,6 @@ bool SvxPageModelItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberI bool SvxPageModelItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet; ::rtl::OUString aStr; @@ -1456,7 +1425,7 @@ USHORT SvxScriptSpaceItem::GetVersion( USHORT nFFVer ) const DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || SOFFICE_FILEFORMAT_50==nFFVer, - "SvxTwoLinesItem: Gibt es ein neues Fileformat?" ); + "SvxTwoLinesItem: Is there a new file format? "); return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0; } @@ -1509,7 +1478,7 @@ USHORT SvxHangingPunctuationItem::GetVersion( USHORT nFFVer ) const DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || SOFFICE_FILEFORMAT_50==nFFVer, - "SvxHangingPunctuationItem: Gibt es ein neues Fileformat?" ); + "SvxHangingPunctuationItem: Is there a new file format? "); return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0; } @@ -1562,7 +1531,7 @@ USHORT SvxForbiddenRuleItem::GetVersion( USHORT nFFVer ) const DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || SOFFICE_FILEFORMAT_50==nFFVer, - "SvxForbiddenRuleItem: Gibt es ein neues Fileformat?" ); + "SvxForbiddenRuleItem: Is there a new file format? "); return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0; } @@ -1704,7 +1673,7 @@ USHORT SvxParaGridItem::GetVersion( USHORT nFFVer ) const DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || SOFFICE_FILEFORMAT_50==nFFVer, - "SvxParaGridItem: Gibt es ein neues Fileformat?" ); + "SvxParaGridItem: Is there a new file format? "); return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0; } diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx index 027ffd2..f6f8c90 100644 --- a/editeng/source/items/svxfont.cxx +++ b/editeng/source/items/svxfont.cxx @@ -43,11 +43,11 @@ #include #include -// Minimum: Prozentwert fuers kernen +// Minimum: Percentage of kernel #define MINKERNPERCENT 5 #ifndef REDUCEDSVXFONT - const sal_Unicode CH_BLANK = sal_Unicode(' '); // ' ' Leerzeichen + const sal_Unicode CH_BLANK = sal_Unicode(' '); // ' ' Space character static sal_Char const sDoubleSpace[] = " "; #endif @@ -73,7 +73,7 @@ SvxFont::SvxFont( const Font &rFont ) } /************************************************************************* - * class SvxFont: Copy-Ctor + * class SvxFont: Copy Constructor *************************************************************************/ SvxFont::SvxFont( const SvxFont &rFont ) @@ -134,7 +134,7 @@ XubString SvxFont::CalcCaseMap( const XubString &rTxt ) const { if( !IsCaseMap() || !rTxt.Len() ) return rTxt; XubString aTxt( rTxt ); - // Ich muss mir noch die Sprache besorgen + // I still have to get the language const LanguageType eLng = LANGUAGE_DONTKNOW == eLang ? LANGUAGE_SYSTEM : eLang; @@ -156,9 +156,9 @@ XubString SvxFont::CalcCaseMap( const XubString &rTxt ) const } case SVX_CASEMAP_TITEL: { - // Jeder Wortbeginn wird gross geschrieben, - // der Rest des Wortes wird unbesehen uebernommen. - // Bug: wenn das Attribut mitten im Wort beginnt. + // Every beginning of a word is capitalized, the rest of the word + // is taken over as is. + // Bug: if the attribute starts in the middle of the word. BOOL bBlank = TRUE; for( USHORT i = 0; i < aTxt.Len(); ++i ) @@ -188,16 +188,16 @@ XubString SvxFont::CalcCaseMap( const XubString &rTxt ) const } /************************************************************************* - * Hier beginnen die Methoden, die im Writer nicht benutzt werden koennen, - * deshalb kann man diesen Bereich durch setzen von REDUCEDSVXFONT ausklammern. +* Starting form here are the methods that can not be used in Writer, +* so we put this section to be excluded by REDUCEDSVXFONT. *************************************************************************/ #ifndef REDUCEDSVXFONT /************************************************************************* * class SvxDoCapitals - * die virtuelle Methode Do wird von SvxFont::DoOnCapitals abwechselnd mit - * den "Gross-" und "Kleinbuchstaben"-Teilen aufgerufen. - * Die Ableitungen von SvxDoCapitals erfuellen diese Methode mit Leben. + * The virtual Method Do si called by SvxFont::DoOnCapitals alternately + * the uppercase and lowercase parts. The derivate of SvxDoCapitals fills + * this method with life. *************************************************************************/ class SvxDoCapitals @@ -235,8 +235,8 @@ void SvxDoCapitals::Do( const XubString &/*_rTxt*/, const xub_StrLen /*_nIdx*/, /************************************************************************* * SvxFont::DoOnCapitals() const - * zerlegt den String in Gross- und Kleinbuchstaben und ruft jeweils die - * Methode SvxDoCapitals::Do( ) auf. + * Decomposes the String into uppercase and lowercase letters and then + * calls the method SvxDoCapitals::Do( ). *************************************************************************/ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const @@ -262,11 +262,11 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const while( nPos < nTxtLen ) { - // Erst kommen die Upper-Chars dran + // first in turn are teh uppercase letters - // 4251: Es gibt Zeichen, die Upper _und_ Lower sind (z.B. das Blank). - // Solche Zweideutigkeiten fuehren ins Chaos, deswegen werden diese - // Zeichen der Menge Lower zugeordnet ! + // There are characters that are both upper- and lower-case L (eg blank) + // Such ambiguities lead to chaos, this is why these characters are + // allocated to the lowercase characters! while( nPos < nTxtLen ) { @@ -297,7 +297,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const nOldPos = nPos; } - // Nun werden die Lower-Chars verarbeitet (ohne Blanks) + // Now the lowercase are processed (without blanks) while( nPos < nTxtLen ) { sal_uInt32 nCharacterType = aCharClass.getCharacterType( aCharString, 0 ); @@ -327,7 +327,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const nOldPos = nPos; } - // Nun werden die Blanks verarbeitet + // Now the blanks areDrawTextArray( rPos, rTxt, pDXArray, nIdx, nLen ); @@ -566,7 +566,7 @@ void SvxFont::QuickDrawText( OutputDevice *pOut, if( IsCapital() ) { - DBG_ASSERT( !pDXArray, "DrawCapital nicht fuer TextArray!" ); + DBG_ASSERT( !pDXArray, "DrawCapital not for TextArray!" ); DrawCapital( pOut, aPos, rTxt, nIdx, nLen ); } else @@ -600,7 +600,7 @@ void SvxFont::DrawPrev( OutputDevice *pOut, Printer* pPrinter, return; xub_StrLen nTmp = nLen; - if ( nTmp == STRING_LEN ) // schon initialisiert? + if ( nTmp == STRING_LEN ) // already initialized? nTmp = rTxt.Len(); Point aPos( rPos ); @@ -674,8 +674,8 @@ SvxFont& SvxFont::operator=( const SvxFont& rFont ) /************************************************************************* * class SvxDoGetCapitalSize - * wird von SvxFont::GetCapitalSize() zur Berechnung der TxtSize bei - * eingestellten Kapitaelchen benutzt. + * Is used by SvxFont::GetCapitalSize() to calculate the text size of the + * set uppercase characters. *************************************************************************/ class SvxDoGetCapitalSize : public SvxDoCapitals @@ -725,7 +725,7 @@ void SvxDoGetCapitalSize::Do( const XubString &_rTxt, const xub_StrLen _nIdx, /************************************************************************* * SvxFont::GetCapitalSize() - * berechnet TxtSize, wenn Kapitaelchen eingestellt sind. + * Calculates the text size when the uppercase is set. *************************************************************************/ Size SvxFont::GetCapitalSize( const OutputDevice *pOut, const XubString &rTxt, @@ -747,7 +747,7 @@ Size SvxFont::GetCapitalSize( const OutputDevice *pOut, const XubString &rTxt, /************************************************************************* * class SvxDoDrawCapital - * wird von SvxFont::DrawCapital zur Ausgabe von Kapitaelchen benutzt. + * Is used by SvxFont::DrawCapital to draw the uppercase letter. *************************************************************************/ class SvxDoDrawCapital : public SvxDoCapitals @@ -806,7 +806,7 @@ void SvxDoDrawCapital::Do( const XubString &_rTxt, const xub_StrLen _nIdx, BYTE nProp = 0; Size aPartSize; - // Einstellen der gewuenschten Fonts + // Set the desired font FontUnderline eUnder = pFont->GetUnderline(); FontStrikeout eStrike = pFont->GetStrikeout(); pFont->SetUnderline( UNDERLINE_NONE ); @@ -828,7 +828,7 @@ void SvxDoDrawCapital::Do( const XubString &_rTxt, const xub_StrLen _nIdx, } pOut->DrawStretchText(aPos,nWidth-nKern,_rTxt,_nIdx,_nLen); - // Font restaurieren + // Restore Font pFont->SetUnderline( eUnder ); pFont->SetStrikeout( eStrike ); if ( !bUpper ) @@ -839,7 +839,7 @@ void SvxDoDrawCapital::Do( const XubString &_rTxt, const xub_StrLen _nIdx, } /************************************************************************* - * SvxFont::DrawCapital() gibt Kapitaelchen aus. + * SvxFont::DrawCapital() draws the uppercase letter. *************************************************************************/ void SvxFont::DrawCapital( OutputDevice *pOut, diff --git a/editeng/source/items/svxitems.src b/editeng/source/items/svxitems.src index 3fb0711..383683b 100644 --- a/editeng/source/items/svxitems.src +++ b/editeng/source/items/svxitems.src @@ -28,7 +28,7 @@ #include // pragma ------------------------------------------------------------------- - // Value-Strings ------------------------------------------------------------ + // Value strings ------------------------------------------------------------ String RID_SVXITEMS_TRUE { Text [ en-US ] = "True" ; diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 1e5bb01..e891d92 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -110,7 +110,6 @@ #include #include -// #90477# #include #define STORE_UNICODE_MAGIC_MARKER 0xFE331188 @@ -119,7 +118,7 @@ using namespace ::rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::text; -// Konvertierung fuer UNO +// Conversion for UNO #define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) #define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L)) #define TWIP_TO_MM100_UNSIGNED(TWIP) ((((TWIP)*127L+36L)/72L)) @@ -260,7 +259,6 @@ SvxFontItem::SvxFontItem( const FontFamily eFam, const XubString& aName, bool SvxFontItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -290,7 +288,6 @@ bool SvxFontItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const // ----------------------------------------------------------------------- bool SvxFontItem::PutValue( const uno::Any& rVal, BYTE nMemberId) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -368,7 +365,7 @@ int SvxFontItem::operator==( const SfxPoolItem& rAttr ) const if ( ePitch != rItem.ePitch || eTextEncoding != rItem.eTextEncoding ) { bRet = sal_False; - DBG_WARNING( "FontItem::operator==(): nur Pitch oder rtl_TextEncoding unterschiedlich" ); + DBG_WARNING( "FontItem::operator==(): only pitch or rtl_TextEncoding different "); } } return bRet; @@ -389,9 +386,6 @@ SvStream& SvxFontItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const GetFamilyName().EqualsAscii( "StarSymbol", 0, sizeof("StarSymbol")-1 ) || GetFamilyName().EqualsAscii( "OpenSymbol", 0, sizeof("OpenSymbol")-1 ); - // #90477# rStrm << (BYTE) GetFamily() - // << (BYTE) GetPitch() - // << (BYTE)(bToBats ? RTL_TEXTENCODING_SYMBOL : GetStoreCharSet( GetCharSet(), (USHORT)rStrm.GetVersion() ) ); rStrm << (BYTE) GetFamily() << (BYTE) GetPitch() << (BYTE)(bToBats ? RTL_TEXTENCODING_SYMBOL : GetSOStoreTextEncoding(GetCharSet(), (sal_uInt16)rStrm.GetVersion())); @@ -401,7 +395,7 @@ SvStream& SvxFontItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const rStrm.WriteByteString(aStoreFamilyName); rStrm.WriteByteString(GetStyleName()); - // #96441# Kach for EditEngine, only set while creating clipboard stream. + // cach for EditEngine, only set while creating clipboard stream. if ( bEnableStoreUnicodeNames ) { sal_uInt32 nMagic = STORE_UNICODE_MAGIC_MARKER; @@ -429,10 +423,10 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, USHORT) const // UNICODE: rStrm >> aStyle; rStrm.ReadByteString(aStyle); - // Task 91008/90471: set the "correct" textencoding + // Set the "correct" textencoding eFontTextEncoding = (BYTE)GetSOLoadTextEncoding( eFontTextEncoding, (USHORT)rStrm.GetVersion() ); - // irgendwann wandelte sich der StarBats vom ANSI- zum SYMBOL-Font + // at some point, the StarBats changes from ANSI font to SYMBOL font if ( RTL_TEXTENCODING_SYMBOL != eFontTextEncoding && aName.EqualsAscii("StarBats") ) eFontTextEncoding = RTL_TEXTENCODING_SYMBOL; @@ -505,7 +499,7 @@ SfxPoolItem* SvxPostureItem::Clone( SfxItemPool * ) const USHORT SvxPostureItem::GetValueCount() const { - return ITALIC_NORMAL + 1; // auch ITALIC_NONE geh"ort dazu + return ITALIC_NORMAL + 1; // ITALIC_NONE also belongs here } // ----------------------------------------------------------------------- @@ -574,7 +568,6 @@ XubString SvxPostureItem::GetValueTextByPos( USHORT nPos ) const bool SvxPostureItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -582,7 +575,7 @@ bool SvxPostureItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const rVal = Bool2Any(GetBoolValue()); break; case MID_POSTURE: - rVal <<= (awt::FontSlant)GetValue(); // Werte von awt::FontSlant und FontItalic sind gleich + rVal <<= (awt::FontSlant)GetValue(); // values from awt::FontSlant and FontItalic are equal break; } return true; @@ -590,7 +583,6 @@ bool SvxPostureItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxPostureItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -668,7 +660,7 @@ void SvxWeightItem::SetBoolValue( sal_Bool bVal ) USHORT SvxWeightItem::GetValueCount() const { - return WEIGHT_BLACK; // WEIGHT_DONTKNOW geh"ort nicht dazu + return WEIGHT_BLACK; // WEIGHT_DONTKNOW does not belong } // ----------------------------------------------------------------------- @@ -729,7 +721,6 @@ XubString SvxWeightItem::GetValueTextByPos( USHORT nPos ) const bool SvxWeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -747,7 +738,6 @@ bool SvxWeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxWeightItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -778,7 +768,7 @@ SvxFontHeightItem::SvxFontHeightItem( const ULONG nSz, const USHORT nId ) : SfxPoolItem( nId ) { - SetHeight( nSz,nPrp ); // mit den Prozenten rechnen + SetHeight( nSz,nPrp ); // calculate in percentage } // ----------------------------------------------------------------------- @@ -798,8 +788,8 @@ SvStream& SvxFontHeightItem::Store( SvStream& rStrm , USHORT nItemVersion ) cons rStrm << GetProp() << (USHORT)GetPropUnit(); else { - // JP 30.06.98: beim Export in alte Versionen geht die relative - // Angabe verloren, wenn es keine Prozentuale ist + // When exporting to the old versions the relative information is lost + // when there is no percentage USHORT _nProp = GetProp(); if( SFX_MAPUNIT_RELATIVE != GetPropUnit() ) _nProp = 100; @@ -846,8 +836,8 @@ int SvxFontHeightItem::operator==( const SfxPoolItem& rItem ) const bool SvxFontHeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { - // In StarOne sind im uno::Any immer 1/100mm. Ueber die MemberId wird - // gesteuert, ob der Wert im Item 1/100mm oder Twips sind. + // In StarOne is the uno::Any always 1/100mm. Through the MemberId it is + // controlled if the value in the Item should be 1/100mm or Twips. sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -857,8 +847,8 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { ::com::sun::star::frame::status::FontHeight aFontHeight; - // Point (also Twips) sind gefragt, - // also umrechnen, wenn CONVERT_TWIPS nicht gesetzt ist + // Point (i.e. Twips) is asked for, thus re-calculate if + // CONVERT_TWIPS is not set. if( bConvert ) { long nTwips = bConvert ? nHeight : MM100_TO_TWIP_UNSIGNED(nHeight); @@ -898,8 +888,8 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const break; case MID_FONTHEIGHT: { - // Point (also Twips) sind gefragt, - // also umrechnen, wenn CONVERT_TWIPS nicht gesetzt ist + // Point (i.e. Twips) is asked for, thus re-calculate if + // CONVERT_TWIPS is not set. if( bConvert ) { long nTwips = bConvert ? nHeight : MM100_TO_TWIP_UNSIGNED(nHeight); @@ -944,7 +934,7 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return sal_True; } -// Relative Abweichung aus der Hoehe herausrechnen +// Calculate the relative deviation from the expected height. sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, SfxMapUnit eProp, sal_Bool bCoreInTwip) { sal_uInt32 nRet = nHeight; @@ -964,11 +954,11 @@ sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, SfxMapUn } break; case SFX_MAPUNIT_100TH_MM: - //dann ist die Core doch wohl auch in 1/100 mm + //then the core is surely also in 1/100 mm nDiff = (short)nProp; break; case SFX_MAPUNIT_TWIP: - // hier doch sicher TWIP + // Here surely TWIP nDiff = ((short)nProp); break; default: ;//prevent warning @@ -998,7 +988,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) nHeight = (long)( fPoint * 20.0 + 0.5 ); // Twips if (!bConvert) - nHeight = TWIP_TO_MM100_UNSIGNED(nHeight); // umrechnen, wenn das Item 1/100mm enthaelt + nHeight = TWIP_TO_MM100_UNSIGNED(nHeight); // Convert, if the item contains 1/100mm nProp = aFontHeight.Prop; } @@ -1023,7 +1013,7 @@ bool SvxFontHeightItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) nHeight = (long)( fPoint * 20.0 + 0.5 ); // Twips if (!bConvert) - nHeight = TWIP_TO_MM100_UNSIGNED(nHeight); // umrechnen, wenn das Item 1/100mm enthaelt + nHeight = TWIP_TO_MM100_UNSIGNED(nHeight); // Convert, if the item contains 1/100mm } break; case MID_FONTHEIGHT_PROP: @@ -1344,7 +1334,7 @@ SfxPoolItem* SvxTextLineItem::Clone( SfxItemPool * ) const USHORT SvxTextLineItem::GetValueCount() const { - return UNDERLINE_DOTTED + 1; // auch UNDERLINE_NONE geh"ort dazu + return UNDERLINE_DOTTED + 1; // UNDERLINE_NONE also belongs here } // ----------------------------------------------------------------------- @@ -1402,7 +1392,6 @@ XubString SvxTextLineItem::GetValueTextByPos( USHORT /*nPos*/ ) const bool SvxTextLineItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -1425,7 +1414,6 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxTextLineItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet = sal_True; switch(nMemberId) @@ -1569,7 +1557,7 @@ void SvxCrossedOutItem::SetBoolValue( sal_Bool bVal ) USHORT SvxCrossedOutItem::GetValueCount() const { - return STRIKEOUT_DOUBLE + 1; // auch STRIKEOUT_NONE geh"ort dazu + return STRIKEOUT_DOUBLE + 1; // STRIKEOUT_NONE belongs also here } // ----------------------------------------------------------------------- @@ -1630,7 +1618,6 @@ XubString SvxCrossedOutItem::GetValueTextByPos( USHORT nPos ) const bool SvxCrossedOutItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -1646,7 +1633,6 @@ bool SvxCrossedOutItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxCrossedOutItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -2000,7 +1986,7 @@ USHORT SvxColorItem::GetVersion( USHORT nFFVer ) const DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || SOFFICE_FILEFORMAT_50==nFFVer, - "SvxColorItem: Gibt es ein neues Fileformat?" ); + "SvxColorItem: Is there a new file format? "); return SOFFICE_FILEFORMAT_50 >= nFFVer ? VERSION_USEAUTOCOLOR : 0; } @@ -2124,8 +2110,6 @@ SfxPoolItem* SvxCharSetColorItem::Clone( SfxItemPool * ) const SvStream& SvxCharSetColorItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const { - // #90477# rStrm << (BYTE) GetStoreCharSet( GetCharSet(), (USHORT)rStrm.GetVersion() ) - // << GetValue(); rStrm << (BYTE)GetSOStoreTextEncoding(GetCharSet(), (sal_uInt16)rStrm.GetVersion()) << GetValue(); return rStrm; @@ -2338,7 +2322,6 @@ bool SvxCaseMapItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const sal_Int16 nRet = style::CaseMap::NONE; switch( GetValue() ) { -// case SVX_CASEMAP_NOT_MAPPED : nRet = style::CaseMap::NONE ; break; case SVX_CASEMAP_VERSALIEN : nRet = style::CaseMap::UPPERCASE; break; case SVX_CASEMAP_GEMEINE : nRet = style::CaseMap::LOWERCASE; break; case SVX_CASEMAP_TITEL : nRet = style::CaseMap::TITLE ; break; @@ -2512,7 +2495,6 @@ void SvxEscapementItem::SetEnumValue( USHORT nVal ) bool SvxEscapementItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -2531,7 +2513,6 @@ bool SvxEscapementItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxEscapementItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -2648,7 +2629,6 @@ SfxItemPresentation SvxLanguageItem::GetPresentation bool SvxLanguageItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -2665,7 +2645,6 @@ bool SvxLanguageItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxLanguageItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -2784,7 +2763,7 @@ SfxItemPresentation SvxNoHyphenItem::GetPresentation } /* - * Dummy-Item fuer ToolBox-Controls: + * Dummy item for ToolBox controls: * */ @@ -2974,7 +2953,6 @@ SfxItemPresentation SvxEmphasisMarkItem::GetPresentation bool SvxEmphasisMarkItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -3001,7 +2979,6 @@ bool SvxEmphasisMarkItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const bool SvxEmphasisMarkItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet = true; switch( nMemberId ) @@ -3035,7 +3012,7 @@ USHORT SvxEmphasisMarkItem::GetVersion( USHORT nFFVer ) const DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || SOFFICE_FILEFORMAT_50==nFFVer, - "SvxEmphasisMarkItem: Gibt es ein neues Fileformat?" ); + "SvxEmphasisMarkItem: Is there a new file format? "); return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0; } @@ -3080,7 +3057,6 @@ SfxPoolItem* SvxTwoLinesItem::Clone( SfxItemPool* ) const bool SvxTwoLinesItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet = true; switch( nMemberId ) @@ -3114,7 +3090,6 @@ bool SvxTwoLinesItem::QueryValue( com::sun::star::uno::Any& rVal, bool SvxTwoLinesItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet = sal_False; OUString s; @@ -3266,7 +3241,6 @@ SfxItemPresentation SvxCharRotateItem::GetPresentation( bool SvxCharRotateItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; bool bRet = true; switch( nMemberId ) @@ -3287,7 +3261,6 @@ bool SvxCharRotateItem::QueryValue( com::sun::star::uno::Any& rVal, bool SvxCharRotateItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; bool bRet = true; switch( nMemberId ) @@ -3342,7 +3315,7 @@ SfxPoolItem* SvxCharScaleWidthItem::Create( SvStream& rStrm, USHORT ) const if ( Which() == EE_CHAR_FONTWIDTH ) { - // #87271#: Was a SvxFontWidthItem in 5.2 + // Was a SvxFontWidthItem in 5.2 // USHORT nFixWidth, USHORT nPropWidth. // nFixWidth has never been used... rStrm >> nVal; @@ -3504,7 +3477,6 @@ SfxItemPresentation SvxCharReliefItem::GetPresentation bool SvxCharReliefItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; bool bRet = true; switch( nMemberId ) @@ -3529,7 +3501,6 @@ bool SvxCharReliefItem::PutValue( const com::sun::star::uno::Any& rVal, bool SvxCharReliefItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const { -// sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; bool bRet = true; switch( nMemberId ) diff --git a/editeng/source/misc/SvXMLAutoCorrectExport.cxx b/editeng/source/misc/SvXMLAutoCorrectExport.cxx index de5f2af..0c5bd94 100644 --- a/editeng/source/misc/SvXMLAutoCorrectExport.cxx +++ b/editeng/source/misc/SvXMLAutoCorrectExport.cxx @@ -39,7 +39,6 @@ using namespace ::com::sun::star; using namespace ::xmloff::token; using namespace ::rtl; -// #110680# SvXMLAutoCorrectExport::SvXMLAutoCorrectExport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, const SvxAutocorrWordList * pNewAutocorr_List, @@ -81,7 +80,6 @@ sal_uInt32 SvXMLAutoCorrectExport::exportDoc(enum XMLTokenEnum /*eClass*/) return 0; } -// #110680# SvXMLExceptionListExport::SvXMLExceptionListExport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, const SvStringsISortDtor &rNewList, diff --git a/editeng/source/misc/SvXMLAutoCorrectExport.hxx b/editeng/source/misc/SvXMLAutoCorrectExport.hxx index 9a2bb77..68e7ce4 100644 --- a/editeng/source/misc/SvXMLAutoCorrectExport.hxx +++ b/editeng/source/misc/SvXMLAutoCorrectExport.hxx @@ -39,7 +39,6 @@ class SvXMLAutoCorrectExport : public SvXMLExport private: const SvxAutocorrWordList *pAutocorr_List; public: - // #110680# SvXMLAutoCorrectExport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, const SvxAutocorrWordList * pNewAutocorr_List, @@ -60,7 +59,6 @@ class SvXMLExceptionListExport : public SvXMLExport private: const SvStringsISortDtor & rList; public: - // #110680# SvXMLExceptionListExport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, const SvStringsISortDtor &rNewList, diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.cxx b/editeng/source/misc/SvXMLAutoCorrectImport.cxx index e81e912..d5b5fd0 100644 --- a/editeng/source/misc/SvXMLAutoCorrectImport.cxx +++ b/editeng/source/misc/SvXMLAutoCorrectImport.cxx @@ -43,7 +43,6 @@ using namespace ::rtl; static OUString sBlockList ( RTL_CONSTASCII_USTRINGPARAM ( "_block-list" ) ); -// #110680# SvXMLAutoCorrectImport::SvXMLAutoCorrectImport( const uno::Reference< lang::XMultiServiceFactory > xServiceFactory, SvxAutocorrWordList *pNewAutocorr_List, @@ -141,8 +140,6 @@ SvXMLWordContext::SvXMLWordContext( if (!sWrong.Len() || !sRight.Len() ) return; -// const International& rInter = Application::GetAppInternational(); -// BOOL bOnlyTxt = COMPARE_EQUAL != rInter.Compare( sRight, sWrong, INTN_COMPARE_IGNORECASE ); BOOL bOnlyTxt = sRight != sWrong; if( !bOnlyTxt ) { @@ -164,7 +161,6 @@ SvXMLWordContext::~SvXMLWordContext ( void ) { } -// #110680# SvXMLExceptionListImport::SvXMLExceptionListImport( const uno::Reference< lang::XMultiServiceFactory > xServiceFactory, SvStringsISortDtor & rNewList ) diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.hxx b/editeng/source/misc/SvXMLAutoCorrectImport.hxx index d79f450..67cd30f 100644 --- a/editeng/source/misc/SvXMLAutoCorrectImport.hxx +++ b/editeng/source/misc/SvXMLAutoCorrectImport.hxx @@ -49,9 +49,7 @@ public: SvxAutocorrWordList *pAutocorr_List; SvxAutoCorrect &rAutoCorrect; com::sun::star::uno::Reference < com::sun::star::embed::XStorage > xStorage; - //SvStorageRef &rStorage; - // #110680# SvXMLAutoCorrectImport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, SvxAutocorrWordList *pNewAutocorr_List, @@ -105,7 +103,6 @@ protected: public: SvStringsISortDtor &rList; - // #110680# SvXMLExceptionListImport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, SvStringsISortDtor & rNewList ); diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx index 8a8a179..dd1c618 100644 --- a/editeng/source/misc/acorrcfg.cxx +++ b/editeng/source/misc/acorrcfg.cxx @@ -48,7 +48,7 @@ using namespace com::sun::star::uno; static SvxAutoCorrCfg* pAutoCorrCfg = 0; /*-------------------------------------------------------------------- - Beschreibung: Ctor Dtor + Description: Constructor Destructor --------------------------------------------------------------------*/ SvxAutoCorrCfg::SvxAutoCorrCfg() : @@ -138,7 +138,7 @@ void SvxBaseAutoCorrCfg::Load(sal_Bool bInit) DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); if(aValues.getLength() == aNames.getLength()) { - long nFlags = 0; // default alles aus + long nFlags = 0; // default all off sal_Int32 nTemp = 0; for(int nProp = 0; nProp < aNames.getLength(); nProp++) { diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx index b3aeda3..7bedc9f 100644 --- a/editeng/source/misc/hangulhanja.cxx +++ b/editeng/source/misc/hangulhanja.cxx @@ -64,32 +64,7 @@ namespace editeng using namespace ::com::sun::star::i18n::TextConversionOption; using namespace ::com::sun::star::i18n::TextConversionType; using namespace ::com::sun::star::lang; -/* - using HangulHanjaConversion::ReplacementAction; - using HangulHanjaConversion::eExchange; - using HangulHanjaConversion::eReplacementBracketed; - using HangulHanjaConversion::eOriginalBracketed; - using HangulHanjaConversion::eReplacementAbove; - using HangulHanjaConversion::eOriginalAbove; - using HangulHanjaConversion::eReplacementBelow; - using HangulHanjaConversion::eOriginalBelow; - - using HangulHanjaConversion::eHangulToHanja; - using HangulHanjaConversion::eHanjaToHangul; - - using HangulHanjaConversion::eSimpleConversion; - using HangulHanjaConversion::eHangulBracketed; - using HangulHanjaConversion::eHanjaBracketed; - using HangulHanjaConversion::eRubyHanjaAbove; - using HangulHanjaConversion::eRubyHanjaBelow; - using HangulHanjaConversion::eRubyHangulAbove; - using HangulHanjaConversion::eRubyHangulBelow; - - using ::com::sun::star::i18n::TextConversionType::TO_HANJA; - using ::com::sun::star::i18n::TextConversionType::TO_HANGUL; - using ::com::sun::star::i18n::TextConversionOption::CHARACTER_BY_CHARACTER; - using ::com::sun::star::i18n::TextConversionOption::NONE; -*/ + //========================================================================= //= HangulHanjaConversion_Impl //========================================================================= @@ -642,15 +617,6 @@ namespace editeng } } - /* - if ( bDocumentDone ) - return sal_True; // we explicitly know that the complete document is done - else if ( bNeedUserInteraction ) - return sal_False; // the doc is not done, we found a convertible, but need the user to decide - else - return sal_True; // we did not find a next convertible, so the document is implicitly done - */ - return bDocumentDone || !bNeedUserInteraction; } diff --git a/editeng/source/misc/lingu.src b/editeng/source/misc/lingu.src index 1467532..ad65e16 100644 --- a/editeng/source/misc/lingu.src +++ b/editeng/source/misc/lingu.src @@ -33,22 +33,22 @@ QueryBox RID_SVXQB_CONTINUE { BUTTONS = WB_YES_NO ; DEFBUTTON = WB_DEF_YES ; - /* ### ACHTUNG: Neuer Text in Resource? Überprüfung am Anfang des Dokumentes fortsetzen? : šberpr³fung am Anfang des Dokumentes fortsetzen? */ - /* ### ACHTUNG: Neuer Text in Resource? Überprüfung am Anfang des Dokumentes fortsetzen? : šberpr³fung am Anfang des Dokumentes fortsetzen? */ + /* ### WARNING: New Text in Resource? überpüfung am Anfang des Dokumentes fortsetzen? : šberpr³fung am Anfang des Dokumentes fortsetzen? */ + /* ### WARNING: New Text in Resource? Überprüfung am Anfang des Dokumentes fortsetzen? : šberpr³fung am Anfang des Dokumentes fortsetzen? */ Message [ en-US ] = "Continue checking at beginning of document?" ; }; QueryBox RID_SVXQB_BW_CONTINUE { BUTTONS = WB_YES_NO ; DEFBUTTON = WB_DEF_YES ; - /* ### ACHTUNG: Neuer Text in Resource? Überprüfung am Ende des Dokumentes fortsetzen? : šberpr³fung am Ende des Dokumentes fortsetzen? */ - /* ### ACHTUNG: Neuer Text in Resource? Überprüfung am Ende des Dokumentes fortsetzen? : šberpr³fung am Ende des Dokumentes fortsetzen? */ + /* ### WARNING: New Text in Resource? Überprüfung am Ende des Dokumentes fortsetzen? : šberpr³fung am Ende des Dokumentes fortsetzen? */ + /* ### WARNING: New Text in Resource? Überprüfung am Ende des Dokumentes fortsetzen? : šberpr³fung am Ende des Dokumentes fortsetzen? */ Message [ en-US ] = "Continue checking at end of document?" ; }; String RID_SVXSTR_HMERR_THESAURUS { - /* ### ACHTUNG: Neuer Text in Resource? Ein Thesaurus für die eingestellte Sprache ist nicht verfügbar. \nÜberprüfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewünschte Sprache : Ein Thesaurus f³r die eingestellte Sprache ist nicht verf³gbar. \nšberpr³fen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gew³nschte Sprache */ - /* ### ACHTUNG: Neuer Text in Resource? Ein Thesaurus für die eingestellte Sprache ist nicht verfügbar. \nÜberprüfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewünschte Sprache : Ein Thesaurus f³r die eingestellte Sprache ist nicht verf³gbar. \nšberpr³fen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gew³nschte Sprache */ + /* ### WARNING: New Text in Resource? Ein Thesaurus für die eingestellte Sprache ist nicht verfügbar. \nÜberprüfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewünschte Sprache : Ein Thesaurus f³r die eingestellte Sprache ist nicht verf³gbar. \nšberpr³fen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gew³nschte Sprache */ + /* ### WARNING: New Text in Resource? Ein Thesaurus für die eingestellte Sprache ist nicht verfügbar. \nÜberprüfen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gewünschte Sprache : Ein Thesaurus f³r die eingestellte Sprache ist nicht verf³gbar. \nšberpr³fen Sie bitte Ihre Installation und installieren Sie \ngegebenenfalls die gew³nschte Sprache */ Text [ en-US ] = "No thesaurus is available for the selected language. \nPlease check your installation and install the desired language\n" ; }; String RID_SVXSTR_DIC_ERR_UNKNOWN diff --git a/editeng/source/misc/makefile.mk b/editeng/source/misc/makefile.mk index 23bdb9c..0b4dbbe 100644 --- a/editeng/source/misc/makefile.mk +++ b/editeng/source/misc/makefile.mk @@ -36,7 +36,7 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/makefile.pmk -# --- Allgemein ---------------------------------------------------------- +# --- General ---------------------------------------------------------- .IF "$(editdebug)" != "" || "$(EDITDEBUG)" != "" CDEFS+=-DEDITDEBUG diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx index d644e78..04063a5 100644 --- a/editeng/source/misc/splwrap.cxx +++ b/editeng/source/misc/splwrap.cxx @@ -46,7 +46,7 @@ #include #include -#include // Der Wrapper +#include // The Wrapper #include #include #include @@ -153,7 +153,7 @@ SvxSpellWrapper::~SvxSpellWrapper() } /*-------------------------------------------------------------------- - * Beschreibung: Ctor, die Pruefreihenfolge wird festgelegt + * Description: Constructor, the test sequence is determined * * !bStart && !bOtherCntnt: BODY_END, BODY_START, OTHER * !bStart && bOtherCntnt: OTHER, BODY @@ -263,15 +263,15 @@ sal_Int16 SvxSpellWrapper::CheckHyphLang( void SvxSpellWrapper::SpellStart( SvxSpellArea /*eSpell*/ ) -{ // Hier muessen die notwendigen Vorbereitungen fuer SpellContinue -} // im uebergebenen Bereich getroffen werden. +{ // Here, the necessary preparations be made for SpellContinue in the +} // given area. // ----------------------------------------------------------------------- sal_Bool SvxSpellWrapper::HasOtherCnt() { - return sal_False; // Gibt es ueberhaupt einen Sonderbereich? + return sal_False; // Is there a special area? } // ----------------------------------------------------------------------- @@ -279,14 +279,14 @@ sal_Bool SvxSpellWrapper::HasOtherCnt() sal_Bool SvxSpellWrapper::SpellMore() { - return sal_False; // Sollen weitere Dokumente geprueft werden? + return sal_False; // Should additional documents be examined? } // ----------------------------------------------------------------------- void SvxSpellWrapper::SpellEnd() -{ // Bereich ist abgeschlossen, ggf. Aufraeumen +{ // Area is complete, tidy up if necessary // display error for last language not found ShowLanguageErrors(); @@ -310,14 +310,14 @@ void SvxSpellWrapper::AutoCorrect( const String&, const String& ) void SvxSpellWrapper::ScrollArea() -{ // Scrollarea einstellen +{ // Set Scroll area } // ----------------------------------------------------------------------- void SvxSpellWrapper::ChangeWord( const String&, const sal_uInt16 ) -{ // Wort ersetzen +{ // Insert Word } // ----------------------------------------------------------------------- @@ -325,7 +325,7 @@ void SvxSpellWrapper::ChangeWord( const String&, const sal_uInt16 ) String SvxSpellWrapper::GetThesWord() { - // Welches Wort soll nachgeschlagen werden? + // What word should be looked up? return String(); } @@ -334,7 +334,7 @@ String SvxSpellWrapper::GetThesWord() void SvxSpellWrapper::ChangeThesWord( const String& ) { - // Wort wg. Thesaurus ersetzen + // replace word due to Thesaurus. } // ----------------------------------------------------------------------- @@ -362,25 +362,25 @@ void SvxSpellWrapper::StartThesaurus( const String &rWord, sal_uInt16 nLanguage // ----------------------------------------------------------------------- void SvxSpellWrapper::ReplaceAll( const String &, sal_Int16 ) -{ // Wort aus der Replace-Liste ersetzen +{ // Replace Word from the the Replace list } // ----------------------------------------------------------------------- void SvxSpellWrapper::SetLanguage( const sal_uInt16 ) -{ // Sprache aendern +{ // Set Language } // ----------------------------------------------------------------------- void SvxSpellWrapper::InsertHyphen( const sal_uInt16 ) -{ // Hyphen einfuegen bzw. loeschen +{ // inserting and deleting Hyphae } // ----------------------------------------------------------------------- -// Pruefung der Dokumentbereiche in der durch die Flags angegebenen Reihenfolge +// Testing of the document areas in the order specified by the flags void SvxSpellWrapper::SpellDocument( ) @@ -420,7 +420,7 @@ void SvxSpellWrapper::SpellDocument( ) } // ----------------------------------------------------------------------- -// Naechsten Bereich auswaehlen +// Select the next area sal_Bool SvxSpellWrapper::SpellNext( ) @@ -432,26 +432,26 @@ sal_Bool SvxSpellWrapper::SpellNext( ) : sal_False; sal_Bool bActRev = bRevAllowed && bWrapReverse; - // bActRev ist die Richtung nach dem Spellen, bReverse die am Anfang. + // bActRev is the direction after Spell checking, bReverse is the one + // at the beginning. if( bActRev == bReverse ) - { // Keine Richtungsaenderung, also ist - if( bStartChk ) // der gewuenschte Bereich ( bStartChk ) - bStartDone = sal_True; // vollstaendig abgearbeitet. + { // No change of direction, thus is the + if( bStartChk ) // desired area ( bStartChk ) + bStartDone = sal_True; // completely processed. else bEndDone = sal_True; } - else if( bReverse == bStartChk ) // Bei einer Richtungsaenderung kann - { // u.U. auch ein Bereich abgearbeitet sein. - if( bStartChk ) // Sollte der vordere Teil rueckwaerts gespellt - bEndDone = sal_True; // werden und wir kehren unterwegs um, so ist - else // der hintere Teil abgearbeitet (und umgekehrt). + else if( bReverse == bStartChk ) //For a change of direction, an area can { // be processed during certain circumstances + if( bStartChk ) // If the firdt part is spell checked in backwards + bEndDone = sal_True; // and this is reversed in the process, then + else // then the end part is processed (and vice-versa). bStartDone = sal_True; } bReverse = bActRev; - if( bOtherCntnt && bStartDone && bEndDone ) // Dokument komplett geprueft? + if( bOtherCntnt && bStartDone && bEndDone ) // Document has been fully checked? { - if ( SpellMore() ) // ein weiteres Dokument pruefen? + if ( SpellMore() ) // spell check another document? { bOtherCntnt = sal_False; bStartDone = !bReverse; @@ -476,13 +476,13 @@ sal_Bool SvxSpellWrapper::SpellNext( ) *(sal_Bool*)xProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UPN_IS_SPELL_SPECIAL)) ).getValue() : sal_False; - // Bodybereich erledigt, Frage nach Sonderbereich + // Body area done, ask for special area if( !IsHyphen() && bIsSpellSpecial && HasOtherCnt() ) { SpellStart( SVX_SPELL_OTHER ); bOtherCntnt = bGoOn = sal_True; } - else if ( SpellMore() ) // ein weiteres Dokument pruefen? + else if ( SpellMore() ) // check another document? { bOtherCntnt = sal_False; bStartDone = !bReverse; @@ -493,11 +493,11 @@ sal_Bool SvxSpellWrapper::SpellNext( ) } else { - // Ein BODY_Bereich erledigt, Frage nach dem anderen BODY_Bereich + // a BODY_area done, ask for the other BODY_area WAIT_OFF(); -// Sobald im Dialog das DontWrapAround gesetzt werden kann, kann der -// folgende #ifdef-Zweig aktiviert werden ... +// As sonn as the DontWrapAround is set in the dialog, the following +// #ifdef-branch may be activated ... #ifdef USED sal_Bool bDontWrapAround = IsHyphen() ? pSpell->GetOptions() & DONT_WRAPAROUND : @@ -510,7 +510,7 @@ sal_Bool SvxSpellWrapper::SpellNext( ) #endif { - // Verzicht auf den anderen Bereich, ggf. Frage nach Sonderbereich + // sacrifice the other area if necessary ask for special area WAIT_ON(); bStartDone = bEndDone = sal_True; return SpellNext(); diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 0ccc1b7..ed14c46 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -37,7 +37,7 @@ #include #include #include -// fuer die Sort-String-Arrays aus dem SVMEM.HXX +// for the Sort-String-Arrays from SVMEM.HXX #define _SVSTDARR_STRINGSISORTDTOR #define _SVSTDARR_STRINGSDTOR #include @@ -98,19 +98,19 @@ static const sal_Char pXMLImplCplStt_ExcptLstStr[] = "SentenceExceptList.xml"; static const sal_Char pXMLImplAutocorr_ListStr[] = "DocumentList.xml"; static const sal_Char - /* auch bei diesen Anfaengen - Klammern auf und alle Arten von Anf.Zei. */ + /* also at these beginnings - Brackets and all kinds of begin characters */ sImplSttSkipChars[] = "\"\'([{\x83\x84\x89\x91\x92\x93\x94", - /* auch bei diesen Ende - Klammern auf und alle Arten von Anf.Zei. */ + /* also at these ends - Brackets and all kinds of begin characters */ sImplEndSkipChars[] = "\"\')]}\x83\x84\x89\x91\x92\x93\x94"; -// diese Zeichen sind in Worten erlaubt: (fuer FnCptlSttSntnc) +// These characters are allowed in words: (for FnCptlSttSntnc) static const sal_Char sImplWordChars[] = "-'"; void EncryptBlockName_Imp( String& rName ); void DecryptBlockName_Imp( String& rName ); -// FileVersions Nummern fuer die Ersetzungs-/Ausnahmelisten getrennt +// FileVersions Number for the Substitution-/Exception list separately #define WORDLIST_VERSION_358 1 #define EXEPTLIST_VERSION_358 0 @@ -175,13 +175,11 @@ static BOOL lcl_IsInAsciiArr( const sal_Char* pArr, const sal_Unicode c ) SvxAutoCorrDoc::~SvxAutoCorrDoc() { } - - - // wird nach dem austauschen der Zeichen von den Funktionen + // Is called by the functions: // - FnCptlSttWrd // - FnCptlSttSntnc - // gerufen. Dann koennen die Worte ggfs. in die Ausnahmelisten - // aufgenommen werden. + // after the exchange of characters. then the words can maybe be inserted + // into the exception list. void SvxAutoCorrDoc::SaveCpltSttWord( ULONG, xub_StrLen, const String&, sal_Unicode ) { @@ -415,7 +413,7 @@ void SvxAutoCorrect::SetAutoCorrFlag( long nFlag, BOOL bOn ) } - // Zwei Grossbuchstaben am Wort-Anfang ?? + // Two capital letters at the beginning of word? BOOL SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen nSttPos, xub_StrLen nEndPos, LanguageType eLang ) @@ -423,8 +421,8 @@ BOOL SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt, BOOL bRet = FALSE; CharClass& rCC = GetCharClass( eLang ); - // loesche alle nicht alpanum. Zeichen am Wortanfang/-ende und - // teste dann ( erkennt: "(min.", "/min.", usw.) + // Delete all non alphanumeric. Test the characters at the beginning/end of + // the word ( recognizes: "(min.", "/min.", and so on.) for( ; nSttPos < nEndPos; ++nSttPos ) if( rCC.isLetterNumeric( rTxt, nSttPos )) break; @@ -432,16 +430,16 @@ BOOL SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt, if( rCC.isLetterNumeric( rTxt, nEndPos - 1 )) break; - // Zwei Grossbuchstaben am Wort-Anfang ?? + // Two capital letters at the beginning of word? if( nSttPos+2 < nEndPos && IsUpperLetter( rCC.getCharacterType( rTxt, nSttPos )) && IsUpperLetter( rCC.getCharacterType( rTxt, ++nSttPos )) && - // ist das 3. Zeichen ein klein geschiebenes Alpha-Zeichen + // Is the third character a lower case IsLowerLetter( rCC.getCharacterType( rTxt, nSttPos +1 )) && - // keine Sonder-Attribute ersetzen + // Do not replace special attributes 0x1 != rTxt.GetChar( nSttPos ) && 0x2 != rTxt.GetChar( nSttPos )) { - // teste ob das Wort in einer Ausnahmeliste steht + // test if the word is in an exception list String sWord( rTxt.Copy( nSttPos - 1, nEndPos - nSttPos + 1 )); if( !FindInWrdSttExceptList(eLang, sWord) ) { @@ -466,8 +464,8 @@ BOOL SvxAutoCorrect::FnChgOrdinalNumber( LanguageType eLang ) { // 1st, 2nd, 3rd, 4 - 0th -// 201th oder 201st -// 12th oder 12nd +// 201th or 201st +// 12th or 12nd CharClass& rCC = GetCharClass( eLang ); BOOL bChg = FALSE; @@ -505,7 +503,7 @@ BOOL SvxAutoCorrect::FnChgOrdinalNumber( if( bChg ) { - // dann pruefe mal, ob alle bis zum Start alle Zahlen sind + // then check to the start, if all are numbers for( xub_StrLen n = nEndPos - 3; nSttPos < n; ) if( !rCC.isDigit( rTxt, --n ) ) { @@ -513,7 +511,7 @@ BOOL SvxAutoCorrect::FnChgOrdinalNumber( break; } - if( bChg ) // dann setze mal das Escapement Attribut + if( bChg ) // then set the escapement attribute { SvxEscapementItem aSvxEscapementItem( DFLT_ESC_AUTO_SUPER, DFLT_ESC_PROP, SID_ATTR_CHAR_ESCAPEMENT ); @@ -539,7 +537,7 @@ BOOL SvxAutoCorrect::FnChgToEnEmDash( eLang = GetAppLang(); bool bAlwaysUseEmDash = (cEmDash && (eLang == LANGUAGE_RUSSIAN || eLang == LANGUAGE_UKRAINIAN)); - // ersetze " - " oder " --" durch "enDash" + // replace " - " or " --" with "enDash" if( cEnDash && 1 < nSttPos && 1 <= nEndPos - nSttPos ) { sal_Unicode cCh = rTxt.GetChar( nSttPos ); @@ -723,11 +721,11 @@ BOOL SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const String& rTxt xub_StrLen, xub_StrLen nEndPos, LanguageType eLang ) { - // Bedingung: - // Am Anfang: _ oder * hinter Space mit nachfolgenden !Space - // Am Ende: _ oder * vor Space (Worttrenner?) + // Condition: + // at the beginning: _ or * after Space with the folloeing !Space + // at the end: _ or * before Space (word delimiter?) - sal_Unicode c, cInsChar = rTxt.GetChar( nEndPos ); // unterstreichen oder fett + sal_Unicode c, cInsChar = rTxt.GetChar( nEndPos ); // underline or bold if( ++nEndPos != rTxt.Len() && !IsWordDelim( rTxt.GetChar( nEndPos ) ) ) return FALSE; @@ -751,7 +749,7 @@ BOOL SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const String& rTxt !IsWordDelim( rTxt.GetChar( nPos+1 ))) nFndPos = nPos; else - // Bedingung ist nicht erfuellt, also abbrechen + // Condition is not satisfied, so cancel nFndPos = STRING_NOTFOUND; nPos = 0; } @@ -764,16 +762,16 @@ BOOL SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const String& rTxt if( STRING_NOTFOUND != nFndPos ) { - // ueber den gefundenen Bereich das Attribut aufspannen und - // das gefunde und am Ende stehende Zeichen loeschen - if( '*' == cInsChar ) // Fett + // Span the Attribute over the area and delete the Character found at + // the end. + if( '*' == cInsChar ) // Bold { SvxWeightItem aSvxWeightItem( WEIGHT_BOLD, SID_ATTR_CHAR_WEIGHT ); rDoc.SetAttr( nFndPos + 1, nEndPos, SID_ATTR_CHAR_WEIGHT, aSvxWeightItem); } - else // unterstrichen + else // underline { SvxUnderlineItem aSvxUnderlineItem( UNDERLINE_SINGLE, SID_ATTR_CHAR_UNDERLINE ); rDoc.SetAttr( nFndPos + 1, nEndPos, @@ -793,7 +791,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, xub_StrLen nSttPos, xub_StrLen nEndPos, LanguageType eLang ) { - // Grossbuchstabe am Satz-Anfang ?? + // Two capital letters at the beginning of a paragraph? if( !rTxt.Len() || nEndPos <= nSttPos ) return FALSE; @@ -821,7 +819,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, { if( lcl_IsInAsciiArr( sImplWordChars, *pStr ) && pWordStt - 1 == pStr && - // l'intallazione at beginning of paragraph. Replaced < by <= (#i38971#) + // Installation at beginning of paragraph. Replaced < by <= (#i38971#) (long)(pStart + 1) <= (long)pStr && rCC.isLetter( aText, @@ -841,16 +839,13 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, aText, sal::static_int_cast< xub_StrLen >( pWordStt - pStart ) ) ) || 0x1 == *pWordStt || 0x2 == *pWordStt ) - return FALSE; // kein zu ersetzendes Zeichen, oder schon ok + return FALSE; // no character to be replaced, or already ok - // JP 27.10.97: wenn das Wort weniger als 3 Zeichen hat und der Trenner - // ein "Num"-Trenner ist, dann nicht ersetzen! - // Damit wird ein "a.", "a)", "a-a" nicht ersetzt! if( *pDelim && 2 >= pDelim - pWordStt && lcl_IsInAsciiArr( ".-)>", *pDelim ) ) return FALSE; - if( !bAtStart ) // noch kein Absatz Anfang ? + if( !bAtStart ) // Still no beginning of a paragraph? { if ( IsWordDelim( *pStr ) ) { @@ -861,17 +856,17 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, // and full width question marks are treated as word delimiters else if ( 0x3002 != *pStr && 0xFF0E != *pStr && 0xFF01 != *pStr && 0xFF1F != *pStr ) - return FALSE; // kein gueltiger Trenner -> keine Ersetzung + return FALSE; // no valid separator -> no replacement } - if( bAtStart ) // am Absatz Anfang ? + if( bAtStart ) // at the beginning of a paragraph? { - // Ueberpruefe den vorherigen Absatz, wenn es diesen gibt. - // Wenn ja, dann pruefe auf SatzTrenner am Ende. + // Check out the previous paragraph, if it exists. + // If so, then check to paragraph separator at the end. const String* pPrevPara = rDoc.GetPrevPara( bNormalPos ); if( !pPrevPara ) { - // gueltiger Trenner -> Ersetze + // valid separator -> replace String sChar( *pWordStt ); rCC.toUpper( sChar ); return sChar != *pWordStt && @@ -883,18 +878,18 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, pStart = aText.GetBuffer(); pStr = pStart + aText.Len(); - do { // alle Blanks ueberlesen + do { // overwrite all blanks --pStr; if( !IsWordDelim( *pStr )) break; } while( 0 == ( bAtStart = (pStart == pStr)) ); if( bAtStart ) - return FALSE; // kein gueltiger Trenner -> keine Ersetzung + return FALSE; // no valid separator -> no replacement } - // bis hierhier wurde [ \t]+[A-Z0-9]+ gefunden. Test jetzt auf den - // Satztrenner. Es koennen alle 3 vorkommen, aber nicht mehrfach !! + // Found [ \t]+[A-Z0-9]+ until here. Test now on the paragraph separator. + // all three can happen, but not more than once! const sal_Unicode* pExceptStt = 0; if( !bAtStart ) { @@ -909,7 +904,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, case 0xFF0E : { if( nFlag & C_FULL_STOP ) - return FALSE; // kein gueltiger Trenner -> keine Ersetzung + return FALSE; // no valid separator -> no replacement nFlag |= C_FULL_STOP; pExceptStt = pStr; } @@ -918,7 +913,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, case 0xFF01 : { if( nFlag & C_EXCLAMATION_MARK ) - return FALSE; // kein gueltiger Trenner -> keine Ersetzung + return FALSE; // no valid separator -> no replacement nFlag |= C_EXCLAMATION_MARK; } break; @@ -926,13 +921,13 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, case 0xFF1F : { if( nFlag & C_QUESTION_MARK) - return FALSE; // kein gueltiger Trenner -> keine Ersetzung + return FALSE; // no valid separator -> no replacement nFlag |= C_QUESTION_MARK; } break; default: if( !nFlag ) - return FALSE; // kein gueltiger Trenner -> keine Ersetzung + return FALSE; // no valid separator -> no replacement else bWeiter = FALSE; break; @@ -940,11 +935,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, if( bWeiter && pStr-- == pStart ) { -// !!! wenn am Anfang, dann nie ersetzen. -// if( !nFlag ) - return FALSE; // kein gueltiger Trenner -> keine Ersetzung -// ++pStr; -// break; // Schleife beenden + return FALSE; // no valid separator -> no replacement } } while( bWeiter ); if( C_FULL_STOP != nFlag ) @@ -991,12 +982,12 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, } if( !bValid ) - return FALSE; // kein gueltiger Trenner -> keine Ersetzung + return FALSE; // no valid separator -> no replacement } BOOL bNumericOnly = '0' <= *(pStr+1) && *(pStr+1) <= '9'; - // suche den Anfang vom Wort + // Search for the beginning of the word while( !IsWordDelim( *pStr )) { if( bNumericOnly && @@ -1010,7 +1001,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, --pStr; } - if( bNumericOnly ) // besteht nur aus Zahlen, dann nicht + if( bNumericOnly ) // consists of only numbers, then not return FALSE; if( IsWordDelim( *pStr )) @@ -1018,7 +1009,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, String sWord; - // ueberpruefe anhand der Exceptionliste + // check on the basis of the exception list if( pExceptStt ) { sWord = String( @@ -1026,15 +1017,15 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, if( FindInCplSttExceptList(eLang, sWord) ) return FALSE; - // loesche alle nicht alpanum. Zeichen am Wortanfang/-ende und - // teste dann noch mal ( erkennt: "(min.", "/min.", usw.) + // Delete all non alphanumeric. Test the characters at the + // beginning/end of the word ( recognizes: "(min.", "/min.", and so on.) String sTmp( sWord ); while( sTmp.Len() && !rCC.isLetterNumeric( sTmp, 0 ) ) sTmp.Erase( 0, 1 ); - // alle hinteren nicht alphanumerische Zeichen bis auf das - // Letzte entfernen + // Remove all non alphanumeric characters towards the end up until + // the last one. xub_StrLen nLen = sTmp.Len(); while( nLen && !rCC.isLetterNumeric( sTmp, nLen-1 ) ) --nLen; @@ -1049,14 +1040,14 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, return FALSE; } - // Ok, dann ersetze mal + // Ok, then replace sal_Unicode cSave = *pWordStt; nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.GetBuffer() ); String sChar( cSave ); rCC.toUpper( sChar ); BOOL bRet = sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar ); - // das Wort will vielleicht jemand haben + // Parahaps someone wants to have the word if( bRet && SaveWordCplSttLst & nFlags ) rDoc.SaveCpltSttWord( CptlSttSntnc, nSttPos, sWord, cSave ); @@ -1117,7 +1108,7 @@ sal_Unicode SvxAutoCorrect::GetQuote( sal_Unicode cInsChar, BOOL bSttQuote, : GetEndSingleQuote() ); if( !cRet ) { - // dann ueber die Language das richtige Zeichen heraussuchen + // then through the Language find the right character if( LANGUAGE_NONE == eLang ) cRet = cInsChar; else @@ -1143,17 +1134,12 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, LanguageType eLang = rDoc.GetLanguage( nInsPos, FALSE ); sal_Unicode cRet = GetQuote( cInsChar, bSttQuote, eLang ); - //JP 13.02.99: damit beim Undo das "einfuegte" Zeichen wieder erscheint, - // wird es erstmal eingefuegt und dann ueberschrieben String sChg( cInsChar ); if( bIns ) rDoc.Insert( nInsPos, sChg ); else rDoc.Replace( nInsPos, sChg ); - //JP 13.08.97: Bug 42477 - bei doppelten Anfuehrungszeichen muss bei - // franzoesischer Sprache an Anfang ein Leerzeichen dahinter - // und am Ende ein Leerzeichen dahinter eingefuegt werden. sChg = cRet; if( '\"' == cInsChar ) @@ -1167,8 +1153,6 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, case LANGUAGE_FRENCH_CANADIAN: case LANGUAGE_FRENCH_SWISS: case LANGUAGE_FRENCH_LUXEMBOURG: - // JP 09.02.99: das zusaetzliche Zeichen immer per Insert einfuegen. - // Es ueberschreibt nichts! { String s( static_cast< sal_Unicode >(0xA0) ); // UNICODE code for no break space @@ -1192,9 +1176,7 @@ String SvxAutoCorrect::GetQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, sal_Unicode cRet = GetQuote( cInsChar, bSttQuote, eLang ); String sRet( cRet ); - //JP 13.08.97: Bug 42477 - bei doppelten Anfuehrungszeichen muss bei - // franzoesischer Sprache an Anfang ein Leerzeichen dahinter - // und am Ende ein Leerzeichen dahinter eingefuegt werden. + if( '\"' == cInsChar ) { if( LANGUAGE_SYSTEM == eLang ) @@ -1227,7 +1209,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, do{ // only for middle check loop !! if( cChar ) { - //JP 10.02.97: doppelte Spaces verhindern + // Prevent double space if( nInsPos && ' ' == cChar && IsAutoCorrFlag( IgnoreDoubleSpace ) && ' ' == rTxt.GetChar( nInsPos - 1 ) ) @@ -1245,8 +1227,6 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, sal_Unicode cPrev; BOOL bSttQuote = !nInsPos || IsWordDelim( ( cPrev = rTxt.GetChar( nInsPos-1 ))) || -// os: #56034# - Warum kein schliessendes Anfuehrungszeichen nach dem Bindestrich? -// strchr( "-([{", cPrev ) || lcl_IsInAsciiArr( "([{", cPrev ) || ( cEmDash && cEmDash == cPrev ) || ( cEnDash && cEnDash == cPrev ); @@ -1301,11 +1281,10 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen nPos = nInsPos - 1; - // Bug 19286: nur direkt hinter dem "Wort" aufsetzen if( IsWordDelim( rTxt.GetChar( nPos ))) break; - // automatisches Fett oder Unterstreichen setzen? + // Set bold or underline automatically? if( '*' == cChar || '_' == cChar ) { if( IsAutoCorrFlag( ChgWeightUnderl ) && @@ -1317,9 +1296,9 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, while( nPos && !IsWordDelim( rTxt.GetChar( --nPos ))) ; - // Absatz-Anfang oder ein Blank gefunden, suche nach dem Wort - // Kuerzel im Auto - xub_StrLen nCapLttrPos = nPos+1; // auf das 1. Zeichen + // Found a Paragraph-start or a Blank, search for the word shortcut in + // auto. + xub_StrLen nCapLttrPos = nPos+1; // on the 1st Character if( !nPos && !IsWordDelim( rTxt.GetChar( 0 ))) --nCapLttrPos; // Absatz Anfang und kein Blank ! @@ -1328,7 +1307,6 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, eLang = MsLangId::getSystemLanguage(); CharClass& rCC = GetCharClass( eLang ); - // Bug 19285: Symbolzeichen nicht anfassen if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nInsPos )) break; @@ -1341,10 +1319,6 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, *this, ppPara ); if( !bChgWord ) { - // JP 16.06.98: dann versuche mal alle !AlphaNum. Zeichen los zu - // werden und teste dann nochmals - //JP 22.04.99: Bug 63883 - entferne nur die "Klammern Start/-Anfaenge", - // alle anderen Zeichen muessen drin bleiben. xub_StrLen nCapLttrPos1 = nCapLttrPos, nInsPos1 = nInsPos; while( nCapLttrPos1 < nInsPos && lcl_IsInAsciiArr( sImplSttSkipChars, rTxt.GetChar( nCapLttrPos1 ) ) @@ -1374,7 +1348,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, !IsWordDelim( pPara->GetChar( nEnd ))) ++nEnd; - // Grossbuchstabe am Satz-Anfang ?? + // Capital letter at beginning of paragraph? if( IsAutoCorrFlag( CptlSttSntnc ) && FnCptlSttSntnc( rDoc, *pPara, FALSE, nCapLttrPos, nEnd, eLang ) ) @@ -1409,12 +1383,12 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, pFrameWin->SimulateKeyPress( KEY_CAPSLOCK ); } - // Grossbuchstabe am Satz-Anfang ?? + // Capital letter at beginning of paragraph ? if( IsAutoCorrFlag( CptlSttSntnc ) && FnCptlSttSntnc( rDoc, rTxt, TRUE, nCapLttrPos, nInsPos, eLang ) ) nRet |= CptlSttSntnc; - // Zwei Grossbuchstaben am Wort-Anfang ?? + // Two capital letters at beginning of word ?? if( IsAutoCorrFlag( CptlSttWrd ) && FnCptlSttWrd( rDoc, rTxt, nCapLttrPos, nInsPos, eLang ) ) nRet |= CptlSttWrd; @@ -1431,7 +1405,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, ULONG nHelpId = 0; if( nRet & ( Autocorrect|CptlSttSntnc|CptlSttWrd|ChgToEnEmDash ) ) { - // von 0 - 15 + // from 0 - 15 if( nRet & ChgToEnEmDash ) nHelpId += 8; if( nRet & Autocorrect ) @@ -1482,7 +1456,7 @@ void SvxAutoCorrect::SaveCplSttExceptList( LanguageType eLang ) #ifdef DBG_UTIL else { - DBG_ERROR("speichern einer leeren Liste?"); + DBG_ERROR("Save an empty list? "); } #endif } @@ -1498,19 +1472,17 @@ void SvxAutoCorrect::SaveWrdSttExceptList(LanguageType eLang) #ifdef DBG_UTIL else { - DBG_ERROR("speichern einer leeren Liste?"); + DBG_ERROR("Save an empty list? "); } #endif } - - // fuegt ein einzelnes Wort hinzu. Die Liste wird sofort - // in die Datei geschrieben! + // Adds a single word. The list will immediately be written to the file! BOOL SvxAutoCorrect::AddCplSttException( const String& rNew, LanguageType eLang ) { SvxAutoCorrectLanguageListsPtr pLists = 0; - //entweder die richtige Sprache ist vorhanden oder es kommt in die allg. Liste + // either the right language is present or it will be this in the general list if( pLangTable->IsKeyValid(ULONG(eLang))) pLists = pLangTable->Seek(ULONG(eLang)); else if(pLangTable->IsKeyValid(ULONG(LANGUAGE_DONTKNOW))|| @@ -1518,24 +1490,23 @@ BOOL SvxAutoCorrect::AddCplSttException( const String& rNew, { pLists = pLangTable->Seek(ULONG(LANGUAGE_DONTKNOW)); } - DBG_ASSERT(pLists, "keine Autokorrekturdatei"); + DBG_ASSERT(pLists, "No auto correction data"); return pLists->AddToCplSttExceptList(rNew); } - // fuegt ein einzelnes Wort hinzu. Die Liste wird sofort - // in die Datei geschrieben! + // Adds a single word. The list will immediately be written to the file! BOOL SvxAutoCorrect::AddWrtSttException( const String& rNew, LanguageType eLang ) { SvxAutoCorrectLanguageListsPtr pLists = 0; - //entweder die richtige Sprache ist vorhanden oder es kommt in die allg. Liste + //either the right language is present or it is set in the general list if(pLangTable->IsKeyValid(ULONG(eLang))) pLists = pLangTable->Seek(ULONG(eLang)); else if(pLangTable->IsKeyValid(ULONG(LANGUAGE_DONTKNOW))|| CreateLanguageFile(LANGUAGE_DONTKNOW, TRUE)) pLists = pLangTable->Seek(ULONG(LANGUAGE_DONTKNOW)); - DBG_ASSERT(pLists, "keine Autokorrekturdatei"); + DBG_ASSERT(pLists, "No auto correction data"); return pLists->AddToWrdSttExceptList(rNew); } @@ -1548,8 +1519,7 @@ void SvxAutoCorrect::SetUserAutoCorrFileName( const String& rNew ) { sUserAutoCorrFile = rNew; - // sind die Listen gesetzt sind, so muessen sie jetzt geloescht - // werden + // if the lists are set, they must now be deleted lcl_ClearTable(*pLangTable); nFlags &= ~(CplSttLstLoad | WrdSttLstLoad | ChgWordLstLoad ); } @@ -1561,8 +1531,7 @@ void SvxAutoCorrect::SetShareAutoCorrFileName( const String& rNew ) { sShareAutoCorrFile = rNew; - // sind die Listen gesetzt sind, so muessen sie jetzt geloescht - // werden + // if the lists are set, they must now be deleted lcl_ClearTable(*pLangTable); nFlags &= ~(CplSttLstLoad | WrdSttLstLoad | ChgWordLstLoad ); } @@ -1578,7 +1547,7 @@ BOOL SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, xub_StrLen nEnde = nPos; - // dahinter muss ein Blank oder Tab folgen! + // it must be followed by a blank or tab! if( ( nPos < rTxt.Len() && !IsWordDelim( rTxt.GetChar( nPos ))) || IsWordDelim( rTxt.GetChar( --nPos ))) @@ -1587,18 +1556,16 @@ BOOL SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, while( nPos && !IsWordDelim( rTxt.GetChar( --nPos ))) ; - // Absatz-Anfang oder ein Blank gefunden, suche nach dem Wort - // Kuerzel im Auto - xub_StrLen nCapLttrPos = nPos+1; // auf das 1. Zeichen + // Found a Paragraph-start or a Blank, search for the word shortcut in + // auto. + xub_StrLen nCapLttrPos = nPos+1; // on the 1st Character if( !nPos && !IsWordDelim( rTxt.GetChar( 0 ))) - --nCapLttrPos; // Absatz Anfang und kein Blank ! + --nCapLttrPos; // Beginning of pargraph and no Blank! while( lcl_IsInAsciiArr( sImplSttSkipChars, rTxt.GetChar( nCapLttrPos )) ) if( ++nCapLttrPos >= nEnde ) return FALSE; - // Bug 19285: Symbolzeichen nicht anfassen - // Interresant erst ab 3 Zeichen if( 3 > nEnde - nCapLttrPos ) return FALSE; @@ -1618,7 +1585,7 @@ BOOL SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, BOOL SvxAutoCorrect::CreateLanguageFile( LanguageType eLang, BOOL bNewFile ) { - DBG_ASSERT(!pLangTable->IsKeyValid(ULONG(eLang)), "Sprache ist bereits vorhanden"); + DBG_ASSERT(!pLangTable->IsKeyValid(ULONG(eLang)), "Language already exists "); String sUserDirFile( GetAutoCorrFileName( eLang, TRUE, FALSE )), sShareDirFile( sUserDirFile ); @@ -1671,7 +1638,7 @@ BOOL SvxAutoCorrect::PutText( const String& rShort, const String& rLong, } - // - loesche einen Eintrag + // - Delete an entry BOOL SvxAutoCorrect::DeleteText( const String& rShort, LanguageType eLang ) { BOOL bRet = FALSE; @@ -1681,14 +1648,14 @@ BOOL SvxAutoCorrect::DeleteText( const String& rShort, LanguageType eLang ) } - // - return den Ersetzungstext (nur fuer SWG-Format, alle anderen - // koennen aus der Wortliste herausgeholt werden!) + // - return the replacement text (only for SWG-Format, all other + // can be taken from the word list!) BOOL SvxAutoCorrect::GetLongText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const String&, const String& , String& ) { return FALSE; } - // - Text mit Attributierung (kann nur der SWG - SWG-Format!) + // Text with attribution (only the SWG - SWG format!) BOOL SvxAutoCorrect::PutText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const String&, const String&, SfxObjectShell&, String& ) { @@ -1771,7 +1738,7 @@ const SvxAutocorrWord* lcl_SearchWordsInList( } -// suche das oder die Worte in der ErsetzungsTabelle +// the search or the words in the substitution table const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( const String& rTxt, xub_StrLen& rStt, xub_StrLen nEndPos, SvxAutoCorrDoc& rDoc, LanguageType& rLang ) @@ -1781,13 +1748,12 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( if( LANGUAGE_SYSTEM == eLang ) eLang = MsLangId::getSystemLanguage(); - // zuerst nach eLang suchen, dann nach der Obersprache - // US-Englisch -> Englisch und zuletzt in LANGUAGE_DONTKNOW - + // First search for eLang, then US-English -> English + // and last in LANGUAGE_DONTKNOW if( pLangTable->IsKeyValid( ULONG( eLang ) ) || CreateLanguageFile( eLang, FALSE )) { - //die Sprache ist vorhanden - also her damit + //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(ULONG(eLang)); pRet = lcl_SearchWordsInList( pList, rTxt, rStt, nEndPos, rDoc ); if( pRet ) @@ -1797,9 +1763,10 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( } } - // wenn es hier noch nicht gefunden werden konnte, dann weitersuchen - ULONG nTmpKey1 = eLang & 0x7ff, // die Hauptsprache in vielen Faellen u.B. DE - nTmpKey2 = eLang & 0x3ff, // sonst z.B. EN + // If it still could not be found here, then keep on searching + + ULONG nTmpKey1 = eLang & 0x7ff, // the main language in many cases DE + nTmpKey2 = eLang & 0x3ff, // otherwise for example EN nTmp; if( ((nTmp = nTmpKey1) != (ULONG)eLang && @@ -1809,7 +1776,7 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( ( pLangTable->IsKeyValid( nTmpKey2 ) || CreateLanguageFile( LanguageType( nTmpKey2 ), FALSE ) )) ) { - //die Sprache ist vorhanden - also her damit + //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek( nTmp ); pRet = lcl_SearchWordsInList( pList, rTxt, rStt, nEndPos, rDoc); if( pRet ) @@ -1821,7 +1788,7 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( if( pLangTable->IsKeyValid( ULONG( LANGUAGE_DONTKNOW ) ) || CreateLanguageFile( LANGUAGE_DONTKNOW, FALSE ) ) { - //die Sprache ist vorhanden - also her damit + //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(ULONG(LANGUAGE_DONTKNOW)); pRet = lcl_SearchWordsInList( pList, rTxt, rStt, nEndPos, rDoc); if( pRet ) @@ -1836,22 +1803,22 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( BOOL SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang, const String& sWord ) { - //zuerst nach eLang suchen, dann nach der Obersprace US-Englisch -> Englisch - //und zuletzt in LANGUAGE_DONTKNOW - ULONG nTmpKey1 = eLang & 0x7ff; // die Hauptsprache in vielen Faellen u.B. DE - ULONG nTmpKey2 = eLang & 0x3ff; // sonst z.B. EN + // First search for eLang, then US-English -> English + // and last in LANGUAGE_DONTKNOW + ULONG nTmpKey1 = eLang & 0x7ff; // the main language in many cases DE + ULONG nTmpKey2 = eLang & 0x3ff; // otherwise for example EN String sTemp(sWord); if( pLangTable->IsKeyValid( ULONG( eLang )) || CreateLanguageFile( eLang, FALSE ) ) { - //die Sprache ist vorhanden - also her damit + //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(ULONG(eLang)); String _sTemp(sWord); if(pList->GetWrdSttExceptList()->Seek_Entry(&_sTemp)) return TRUE; } - // wenn es hier noch nicht gefunden werden konnte, dann weitersuchen + // If it still could not be found here, then keep on searching ULONG nTmp; if( ((nTmp = nTmpKey1) != (ULONG)eLang && ( pLangTable->IsKeyValid( nTmpKey1 ) || @@ -1860,14 +1827,14 @@ BOOL SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang, ( pLangTable->IsKeyValid( nTmpKey2 ) || CreateLanguageFile( LanguageType( nTmpKey2 ), FALSE ) )) ) { - //die Sprache ist vorhanden - also her damit + //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(nTmp); if(pList->GetWrdSttExceptList()->Seek_Entry(&sTemp)) return TRUE; } if(pLangTable->IsKeyValid(ULONG(LANGUAGE_DONTKNOW))|| CreateLanguageFile(LANGUAGE_DONTKNOW, FALSE)) { - //die Sprache ist vorhanden - also her damit + //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(ULONG(LANGUAGE_DONTKNOW)); if(pList->GetWrdSttExceptList()->Seek_Entry(&sTemp)) return TRUE; @@ -1889,13 +1856,13 @@ BOOL lcl_FindAbbreviation( const SvStringsISortDtor* pList, const String& sWord) '~' == ( pAbk = (*pList)[ n ])->GetChar( 0 ); ++n ) { - // ~ und ~. sind nicht erlaubt! + // ~ and ~. are not allowed! if( 2 < pAbk->Len() && pAbk->Len() - 1 <= sWord.Len() ) { String sLowerAbk( *pAbk ); sLowerAbk.ToLowerAscii(); for( xub_StrLen i = sLowerAbk.Len(), ii = sLowerWord.Len(); i; ) { - if( !--i ) // stimmt ueberein + if( !--i ) // agrees return TRUE; if( sLowerAbk.GetChar( i ) != sLowerWord.GetChar( --ii )) @@ -1905,29 +1872,29 @@ BOOL lcl_FindAbbreviation( const SvStringsISortDtor* pList, const String& sWord) } } DBG_ASSERT( !(nPos && '~' == (*pList)[ --nPos ]->GetChar( 0 ) ), - "falsch sortierte ExeptionListe?" ); + "Wrongly sorted exception list?" ); return FALSE; } BOOL SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang, const String& sWord, BOOL bAbbreviation) { - //zuerst nach eLang suchen, dann nach der Obersprace US-Englisch -> Englisch - //und zuletzt in LANGUAGE_DONTKNOW - ULONG nTmpKey1 = eLang & 0x7ff; // die Hauptsprache in vielen Faellen u.B. DE - ULONG nTmpKey2 = eLang & 0x3ff; // sonst z.B. EN + // First search for eLang, then US-English -> English + // and last in LANGUAGE_DONTKNOW + ULONG nTmpKey1 = eLang & 0x7ff; // the main language in many cases DE + ULONG nTmpKey2 = eLang & 0x3ff; // otherwise for example EN String sTemp( sWord ); if( pLangTable->IsKeyValid( ULONG( eLang )) || CreateLanguageFile( eLang, FALSE )) { - //die Sprache ist vorhanden - also her damit + //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(ULONG(eLang)); const SvStringsISortDtor* pList = pLists->GetCplSttExceptList(); if(bAbbreviation ? lcl_FindAbbreviation( pList, sWord) : pList->Seek_Entry( &sTemp ) ) return TRUE; } - // wenn es hier noch nicht gefunden werden konnte, dann weitersuchen + // If it still could not be found here, then keep on searching ULONG nTmp; if( ((nTmp = nTmpKey1) != (ULONG)eLang && @@ -1937,7 +1904,7 @@ BOOL SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang, ( pLangTable->IsKeyValid( nTmpKey2 ) || CreateLanguageFile( LanguageType( nTmpKey2 ), FALSE ) )) ) { - //die Sprache ist vorhanden - also her damit + //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(nTmp); const SvStringsISortDtor* pList = pLists->GetCplSttExceptList(); if(bAbbreviation ? lcl_FindAbbreviation( pList, sWord) @@ -1946,7 +1913,7 @@ BOOL SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang, } if(pLangTable->IsKeyValid(ULONG(LANGUAGE_DONTKNOW))|| CreateLanguageFile(LANGUAGE_DONTKNOW, FALSE)) { - //die Sprache ist vorhanden - also her damit + //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(LANGUAGE_DONTKNOW); const SvStringsISortDtor* pList = pLists->GetCplSttExceptList(); if(bAbbreviation ? lcl_FindAbbreviation( pList, sWord) @@ -2002,14 +1969,13 @@ SvxAutoCorrectLanguageLists::~SvxAutoCorrectLanguageLists() BOOL SvxAutoCorrectLanguageLists::IsFileChanged_Imp() { - // nur alle 2 Minuten aufs FileSystem zugreifen um den - // Dateistempel zu ueberpruefen + // Access the file system only every 2 minutes to check the date stamp BOOL bRet = FALSE; Time nMinTime( 0, 2 ); Time nAktTime; - if( aLastCheckTime > nAktTime || // ueberlauf ? - ( nAktTime -= aLastCheckTime ) > nMinTime ) // min Zeit vergangen + if( aLastCheckTime > nAktTime || // overflow? + ( nAktTime -= aLastCheckTime ) > nMinTime ) // min time past { Date aTstDate; Time aTstTime; if( FStatHelper::GetModifiedDateTimeOfFile( sShareAutoCorrFile, @@ -2017,7 +1983,7 @@ BOOL SvxAutoCorrectLanguageLists::IsFileChanged_Imp() ( aModifiedDate != aTstDate || aModifiedTime != aTstTime )) { bRet = TRUE; - // dann mal schnell alle Listen entfernen! + // then remove all the lists fast! if( CplSttLstLoad & nFlags && pCplStt_ExcptLst ) delete pCplStt_ExcptLst, pCplStt_ExcptLst = 0; if( WrdSttLstLoad & nFlags && pWrdStt_ExcptLst ) @@ -2084,8 +2050,6 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp( } // get filter - // #110680# - // uno::Reference< xml::sax::XDocumentHandler > xFilter = new SvXMLExceptionListImport ( *rpLst ); uno::Reference< xml::sax::XDocumentHandler > xFilter = new SvXMLExceptionListImport ( xServiceFactory, *rpLst ); // connect parser and filter @@ -2112,7 +2076,7 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp( } } - // Zeitstempel noch setzen + // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sShareAutoCorrFile, &aModifiedDate, &aModifiedTime ); aLastCheckTime = Time(); @@ -2167,8 +2131,6 @@ void SvxAutoCorrectLanguageLists::SaveExceptList_Imp( uno::Reference xHandler(xWriter, uno::UNO_QUERY); - // #110680# - // SvXMLExceptionListExport aExp(rLst, sStrmName, xHandler); SvXMLExceptionListExport aExp( xServiceFactory, rLst, sStrmName, xHandler ); aExp.exportDoc( XML_BLOCK_LIST ); @@ -2230,7 +2192,7 @@ SvxAutocorrWordList* SvxAutoCorrectLanguageLists::LoadAutocorrWordList() { } - // Zeitstempel noch setzen + // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sShareAutoCorrFile, &aModifiedDate, &aModifiedTime ); aLastCheckTime = Time(); @@ -2245,7 +2207,7 @@ void SvxAutoCorrectLanguageLists::SetAutocorrWordList( SvxAutocorrWordList* pLis pAutocorr_List = pList; if( !pAutocorr_List ) { - DBG_ASSERT( !this, "keine gueltige Liste" ); + DBG_ASSERT( !this, "No valid list" ); pAutocorr_List = new SvxAutocorrWordList( 16, 16 ); } nFlags |= ChgWordLstLoad; @@ -2276,7 +2238,7 @@ BOOL SvxAutoCorrectLanguageLists::AddToCplSttExceptList(const String& rNew) SaveExceptList_Imp( *pCplStt_ExcptLst, pXMLImplCplStt_ExcptLstStr, xStg ); xStg = 0; - // Zeitstempel noch setzen + // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); aLastCheckTime = Time(); @@ -2298,7 +2260,7 @@ BOOL SvxAutoCorrectLanguageLists::AddToWrdSttExceptList(const String& rNew) SaveExceptList_Imp( *pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg ); xStg = 0; - // Zeitstempel noch setzen + // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); aLastCheckTime = Time(); @@ -2327,7 +2289,7 @@ void SvxAutoCorrectLanguageLists::SaveCplSttExceptList() xStg = 0; - // Zeitstempel noch setzen + // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); aLastCheckTime = Time(); @@ -2341,7 +2303,7 @@ void SvxAutoCorrectLanguageLists::SetCplSttExceptList( SvStringsISortDtor* pList pCplStt_ExcptLst = pList; if( !pCplStt_ExcptLst ) { - DBG_ASSERT( !this, "keine gueltige Liste" ); + DBG_ASSERT( !this, "No valid list" ); pCplStt_ExcptLst = new SvStringsISortDtor( 16, 16 ); } nFlags |= CplSttLstLoad; @@ -2364,7 +2326,7 @@ void SvxAutoCorrectLanguageLists::SaveWrdSttExceptList() SaveExceptList_Imp( *pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg ); xStg = 0; - // Zeitstempel noch setzen + // Set time stamp FStatHelper::GetModifiedDateTimeOfFile( sUserAutoCorrFile, &aModifiedDate, &aModifiedTime ); aLastCheckTime = Time(); @@ -2377,7 +2339,7 @@ void SvxAutoCorrectLanguageLists::SetWrdSttExceptList( SvStringsISortDtor* pList pWrdStt_ExcptLst = pList; if( !pWrdStt_ExcptLst ) { - DBG_ASSERT( !this, "keine gueltige Liste" ); + DBG_ASSERT( !this, "No valid list" ); pWrdStt_ExcptLst = new SvStringsISortDtor( 16, 16 ); } nFlags |= WrdSttLstLoad; @@ -2416,13 +2378,9 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl() INetURLObject aDest; INetURLObject aSource; -// String sDestPath = sUserAutoCorrFile.Copy ( 0, sUserAutoCorrFile.Len()-3); -// sDestPath.AppendAscii ("bak"); - - if (sUserAutoCorrFile != sShareAutoCorrFile ) { - aSource = INetURLObject ( sShareAutoCorrFile ); //aSource.setFSysPath ( sShareAutoCorrFile, INetURLObject::FSYS_DETECT ); + aSource = INetURLObject ( sShareAutoCorrFile ); aDest = INetURLObject ( sUserAutoCorrFile ); if ( SotStorage::IsOLEStorage ( sShareAutoCorrFile ) ) { @@ -2496,8 +2454,6 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl() GetAutocorrWordList(); MakeBlocklist_Imp( *xDstStg ); - // xDstStg is committed in MakeBlocklist_Imp - /*xSrcStg->CopyTo( &xDstStg );*/ sShareAutoCorrFile = sUserAutoCorrFile; xDstStg = 0; try @@ -2520,13 +2476,6 @@ BOOL SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SvStorage& rStg ) BOOL bRet = TRUE, bRemove = !pAutocorr_List || !pAutocorr_List->Count(); if( !bRemove ) { - /* - if ( rStg.IsContained( sStrmName) ) - { - rStg.Remove ( sStrmName ); - rStg.Commit(); - } - */ SvStorageStreamRef refList = rStg.OpenSotStream( sStrmName, ( STREAM_READ | STREAM_WRITE | STREAM_SHARE_DENYWRITE ) ); if( refList.Is() ) @@ -2557,8 +2506,6 @@ BOOL SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SvStorage& rStg ) uno::Reference xHandler(xWriter, uno::UNO_QUERY); - // #110680# - // SvXMLAutoCorrectExport aExp(pAutocorr_List, sStrmName, xHandler); SvXMLAutoCorrectExport aExp( xServiceFactory, pAutocorr_List, sStrmName, xHandler ); aExp.exportDoc( XML_BLOCK_LIST ); @@ -2576,39 +2523,6 @@ BOOL SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SvStorage& rStg ) } } - /* - refList->SetSize( 0 ); - refList->SetBufferSize( 8192 ); - rtl_TextEncoding eEncoding = gsl_getSystemTextEncoding(); - - String aDummy; // Erkennungszeichen fuer neue Streams - refList->WriteByteString( aDummy, RTL_TEXTENCODING_MS_1252 ) - << (BYTE) 4 // Laenge des Headers (ohne den Leerstring) - << (USHORT)WORDLIST_VERSION_358 // Version des Streams - << (BYTE)eEncoding; // der Zeichensatz - - for( USHORT i = 0; i < pAutocorr_List->Count() && - SVSTREAM_OK == refList->GetError(); ++i ) - { - SvxAutocorrWord* p = pAutocorr_List->GetObject( i ); - refList->WriteByteString( p->GetShort(), eEncoding ). - WriteByteString( p->IsTextOnly() - ? p->GetLong() - : p->GetShort(), eEncoding ); - } - refList->Commit(); - bRet = SVSTREAM_OK == refList->GetError(); - if( bRet ) - { - refList.Clear(); - rStg.Commit(); - if( SVSTREAM_OK != rStg.GetError() ) - { - bRemove = TRUE; - bRet = FALSE; - } - } - */ } else bRet = FALSE; @@ -2626,7 +2540,7 @@ BOOL SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SvStorage& rStg ) BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, const String& rLong ) { - // erstmal akt. Liste besorgen! + // First get the current list! GetAutocorrWordList(); MakeUserStorage_Impl(); @@ -2634,12 +2548,7 @@ BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, BOOL bRet = xStg.Is() && SVSTREAM_OK == xStg->GetError(); -/* if( bRet ) - { - // PutText( *xStg, rShort ); - } -*/ - // die Wortliste aktualisieren + // Update the word list if( bRet ) { USHORT nPos; @@ -2648,7 +2557,7 @@ BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, { if( !(*pAutocorr_List)[ nPos ]->IsTextOnly() ) { - // dann ist der Storage noch zu entfernen + // Still have to remove the Storage String sStgNm( rShort ); if (xStg->IsOLEStorage()) EncryptBlockName_Imp( sStgNm ); @@ -2675,11 +2584,11 @@ BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, return bRet; } -// Text mit Attributierung (kann nur der SWG - SWG-Format!) +// Text with attribution (only the SWG - SWG format!) BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, SfxObjectShell& rShell ) { - // erstmal akt. Liste besorgen! + // First get the current list! GetAutocorrWordList(); MakeUserStorage_Impl(); @@ -2689,13 +2598,10 @@ BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, try { uno::Reference < embed::XStorage > xStg = comphelper::OStorageHelper::GetStorageFromURL( sUserAutoCorrFile, embed::ElementModes::READWRITE ); -// String aName( rShort ); -// EncryptBlockName_Imp( aName ); -// bRet = PutText( *xStg, aName, rShell, sLong ); bRet = rAutoCorrect.PutText( xStg, sUserAutoCorrFile, rShort, rShell, sLong ); xStg = 0; - // die Wortliste aktualisieren + // Update the word list if( bRet ) { SvxAutocorrWord* pNew = new SvxAutocorrWord( rShort, sLong, FALSE ); @@ -2715,10 +2621,10 @@ BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, return bRet; } -// loesche einen Eintrag +// Delete an entry BOOL SvxAutoCorrectLanguageLists::DeleteText( const String& rShort ) { - // erstmal akt. Liste besorgen! + // First get the current list! GetAutocorrWordList(); MakeUserStorage_Impl(); @@ -2746,7 +2652,7 @@ BOOL SvxAutoCorrectLanguageLists::DeleteText( const String& rShort ) } } - // die Wortliste aktualisieren + // Update the word list pAutocorr_List->DeleteAndDestroy( nPos ); MakeBlocklist_Imp( *xStg ); xStg = 0; diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx index cc750a9..7cadf52 100644 --- a/editeng/source/misc/txtrange.cxx +++ b/editeng/source/misc/txtrange.cxx @@ -36,12 +36,15 @@ #include #include +<<<<<<< HEAD +======= /************************************************************************* |* |* TextRanger::TextRanger() |* *************************************************************************/ +>>>>>>> 4a8517e08d2e56cb730ed50f3d2cd73107a4d179 #ifdef WIN #pragma optimize ( "", off ) #endif @@ -98,12 +101,15 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon, const baseg #pragma optimize ( "", on ) #endif +<<<<<<< HEAD +======= /************************************************************************* |* |* TextRanger::~TextRanger() |* *************************************************************************/ +>>>>>>> 4a8517e08d2e56cb730ed50f3d2cd73107a4d179 TextRanger::~TextRanger() { for( USHORT i = 0; i < nCacheSize; ++i ) @@ -130,12 +136,15 @@ void TextRanger::SetVertical( BOOL bNew ) } } +<<<<<<< HEAD +======= /************************************************************************* |* |* SvxBoundArgs |* *************************************************************************/ +>>>>>>> 4a8517e08d2e56cb730ed50f3d2cd73107a4d179 class SvxBoundArgs { SvBools aBoolArr; @@ -290,18 +299,17 @@ void SvxBoundArgs::NoteRange( BOOL bToggle ) while( nIdx < nCount && (*pLongArr)[ nIdx ] < nMin ) ++nIdx; BOOL bOdd = nIdx % 2 ? TRUE : FALSE; - // Kein Ueberlappung mit vorhandenen Intervallen? + // No overlap with existing intervals? if( nIdx == nCount || ( !bOdd && nMax < (*pLongArr)[ nIdx ] ) ) - { // Dann wird ein neues eingefuegt ... + { // Then a new one is inserted ... pLongArr->Insert( nMin, nIdx ); pLongArr->Insert( nMax, nIdx + 1 ); aBoolArr.Insert( bToggle, nIdx / 2 ); } else - { // ein vorhandes Intervall erweitern ... + { // expand an existing interval ... USHORT nMaxIdx = nIdx; - // Wenn wir auf einer linken Intervallgrenze gelandet sind, muss diese - // auf nMin gesenkt werden. + // If we end up on a left interval boundary, it must be reduced to nMin. if( bOdd ) --nIdx; else @@ -313,13 +321,12 @@ void SvxBoundArgs::NoteRange( BOOL bToggle ) --nMaxIdx; if( nMaxIdx < nIdx ) nMaxIdx = nIdx; - // Wenn wir auf einer rechten Intervallgrenze landen, muss diese - // auf nMax angehoben werden. + // If we end up on a right interval boundary, it must be raised to nMax. if( nMaxIdx % 2 ) (*pLongArr)[ nMaxIdx-- ] = nMax; - // Jetzt werden eventuell noch Intervalle verschmolzen + // Possible merge of intervals. USHORT nDiff = nMaxIdx - nIdx; - nMaxIdx = nIdx / 2; // Ab hier ist nMaxIdx der Index im BoolArray. + nMaxIdx = nIdx / 2; // From here on is nMaxIdx the Index in BoolArray. if( nDiff ) { (*pLongArr).Remove( nIdx + 1, nDiff ); @@ -355,7 +362,7 @@ void SvxBoundArgs::Calc( const PolyPolygon& rPoly ) } else { - // Der erste Punkt des Polygons liegt innerhalb der Zeile. + // The first point of the polygon is within the line. if( nLast ) { if( bMultiple || !nAct ) @@ -379,8 +386,8 @@ void SvxBoundArgs::Calc( const PolyPolygon& rPoly ) else NotePoint( A(rNull) ); } - nFirst = 0; // In welcher Richtung wird die Zeile verlassen? - nAct = 3; // Wir sind z.Z. innerhalb der Zeile. + nFirst = 0; // leaving the line in which direction? + nAct = 3; // we are within the line at the moment. } if( nCount > 1 ) { @@ -514,12 +521,10 @@ void SvxBoundArgs::Add() pLongArr->Remove( 0, 1 ); pLongArr->Remove( pLongArr->Count() - 1, 1 ); - // Hier wird die Zeile beim "einfachen" Konturumfluss im Innern - // in ein grosses Rechteck zusammengefasst. - // Zur Zeit (April 1999) wertet die EditEngine nur das erste Rechteck - // aus, falls sie eines Tages in der Lage ist, eine Zeile in mehreren - // Teilen auszugeben, kann es sinnvoll sein, die folgenden Zeilen - // zu loeschen. + // Here the line is held inside a large rectangle for "simple" + // contour wrap. Currently (April 1999) the EditEngine evaluates + // only the first rectangle. If it one day is able to output a line + // in several parts, it may be advisable to delete the following lines. if( pTextRanger->IsSimple() && pLongArr->Count() > 2 ) pLongArr->Remove( 1, pLongArr->Count() - 2 ); @@ -544,7 +549,7 @@ void SvxBoundArgs::Concat( const PolyPolygon* pPoly ) { USHORT nOldCount = pOld->Count(); if( nIdx == nOldCount ) - { // Am Ende des alten Arrays angelangt... + { // Reached the end of the old Array... if( !bSubtract ) pOld->Insert( pLongArr, nIdx, i, USHRT_MAX ); break; @@ -555,7 +560,7 @@ void SvxBoundArgs::Concat( const PolyPolygon* pPoly ) while( nLeftPos < nOldCount && nLeft > (*pOld)[ nLeftPos ] ) nLeftPos += 2; if( nLeftPos >= nOldCount ) - { // Das aktuelle Intervall gehoert ans Ende des alten Arrays... + { // The current interval belongs to the end of the old array ... if( !bSubtract ) pOld->Insert( pLongArr, nOldCount, i - 2, USHRT_MAX ); break; @@ -564,16 +569,16 @@ void SvxBoundArgs::Concat( const PolyPolygon* pPoly ) while( nRightPos < nOldCount && nRight >= (*pOld)[ nRightPos ] ) nRightPos += 2; if( nRightPos < nLeftPos ) - { // Das aktuelle Intervall gehoert zwischen zwei alte Intervalle + { // The current interval belongs between two old intervals if( !bSubtract ) pOld->Insert( pLongArr, nRightPos, i - 2, i ); nIdx = nRightPos + 2; } - else if( bSubtract ) // Subtrahieren ggf. Trennen + else if( bSubtract ) // Subtract, if necessary separate { long nOld; if( nLeft > ( nOld = (*pOld)[ nLeftPos - 1 ] ) ) - { // Jetzt spalten wir den linken Teil ab... + { // Now we split the left part... if( nLeft - 1 > nOld ) { pOld->Insert( nOld, nLeftPos - 1 ); @@ -589,7 +594,7 @@ void SvxBoundArgs::Concat( const PolyPolygon* pPoly ) else (*pOld)[ nLeftPos - 1 ] = nRight; } - else // Verschmelzen + else // Merge { if( nLeft < (*pOld)[ nLeftPos - 1 ] ) (*pOld)[ nLeftPos - 1 ] = nLeft; @@ -605,12 +610,12 @@ void SvxBoundArgs::Concat( const PolyPolygon* pPoly ) } /************************************************************************* - * SvxBoundArgs::Area ermittelt den Bereich, in dem sich der Punkt befindet - * 0 = innerhalb der Zeile - * 1 = unterhalb, aber innerhalb der oberen Randes - * 2 = oberhalb, aber innerhalb der unteren Randes - * 5 = unterhalb des oberen Randes - *10 = oberhalb des unteren Randes + * SvxBoundArgs::Area returns the area in which the point is located. + * 0 = within the line + * 1 = below, but within the upper edge + * 2 = above, but within the lower edge + * 5 = below the upper edge + *10 = above the lower edge *************************************************************************/ USHORT SvxBoundArgs::Area( const Point& rPt ) @@ -632,10 +637,10 @@ USHORT SvxBoundArgs::Area( const Point& rPt ) } /************************************************************************* - * lcl_Cut berechnet die X-Koordinate der Strecke (Pt1-Pt2) auf der - * Y-Koordinate nY. - * Vorausgesetzt wird, dass einer der Punkte oberhalb und der andere - * unterhalb der Y-Koordinate liegt. + * lcl_Cut calculates the X-Coordinate of the distance (Pt1-Pt2) at the + * Y-Coordinate nY. + * It is assumed that the one of the points are located above and the other + * one below the Y-Coordinate. *************************************************************************/ long SvxBoundArgs::Cut( long nB, const Point& rPt1, const Point& rPt2 ) diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx index 5ebdbc6..d8c67cf 100644 --- a/editeng/source/misc/unolingu.cxx +++ b/editeng/source/misc/unolingu.cxx @@ -938,9 +938,6 @@ void LinguMgrExitLstnr::AtExit() LinguMgr::bExiting = sal_True; - //TL:TODO: MBA fragen wie ich ohne Absturz hier meinen Speicher - // wieder freibekomme... - //delete LinguMgr::pExitLstnr; LinguMgr::pExitLstnr = 0; } @@ -1029,15 +1026,6 @@ uno::Reference< XSpellChecker1 > LinguMgr::GetSpell() //! use dummy implementation in order to avoid loading of lingu DLL xSpell = new SpellDummy_Impl; -/* if (!xLngSvcMgr.is()) - xLngSvcMgr = GetLngSvcMgr_Impl(); - - if (xLngSvcMgr.is()) - { - xSpell = uno::Reference< XSpellChecker1 > ( - xLngSvcMgr->getSpellChecker(), UNO_QUERY ); - } -*/ return xSpell; } @@ -1052,15 +1040,6 @@ uno::Reference< XHyphenator > LinguMgr::GetHyph() //! use dummy implementation in order to avoid loading of lingu DLL xHyph = new HyphDummy_Impl; -/* - if (!xLngSvcMgr.is()) - xLngSvcMgr = GetLngSvcMgr_Impl(); - - if (xLngSvcMgr.is()) - { - xHyph = xLngSvcMgr->getHyphenator(); - } -*/ return xHyph; } @@ -1077,15 +1056,7 @@ uno::Reference< XThesaurus > LinguMgr::GetThes() //! The dummy accesses the real implementation (and thus loading the DLL) //! when "real" work needs to be done only. xThes = new ThesDummy_Impl; -/* - if (!xLngSvcMgr.is()) - xLngSvcMgr = GetLngSvcMgr_Impl(); - if (xLngSvcMgr.is()) - { - xThes = xLngSvcMgr->getThesaurus(); - } -*/ return xThes; } @@ -1244,7 +1215,7 @@ uno::Reference< XPropertySet > SvxGetLinguPropertySet() return LinguMgr::GetLinguPropertySet(); } -//TL:TODO: remove argument or provide SvxGetIgnoreAllList with the same one +//TODO: remove argument or provide SvxGetIgnoreAllList with the same one uno::Reference< XDictionary > SvxGetOrCreatePosDic( uno::Reference< XDictionaryList > /* xDicList */ ) { @@ -1349,7 +1320,6 @@ short SvxDicError( Window *pParent, sal_Int16 nError ) LanguageType SvxLocaleToLanguage( const Locale& rLocale ) { - // empty Locale -> LANGUAGE_NONE if ( rLocale.Language.getLength() == 0 ) return LANGUAGE_NONE; @@ -1358,7 +1328,7 @@ LanguageType SvxLocaleToLanguage( const Locale& rLocale ) Locale& SvxLanguageToLocale( Locale& rLocale, LanguageType eLang ) { - if ( eLang != LANGUAGE_NONE /* && eLang != LANGUAGE_SYSTEM */) + if ( eLang != LANGUAGE_NONE ) MsLangId::convertLanguageToLocale( eLang, rLocale ); else rLocale = Locale(); @@ -1369,7 +1339,7 @@ Locale& SvxLanguageToLocale( Locale& rLocale, LanguageType eLang ) Locale SvxCreateLocale( LanguageType eLang ) { Locale aLocale; - if ( eLang != LANGUAGE_NONE /* && eLang != LANGUAGE_SYSTEM */) + if ( eLang != LANGUAGE_NONE ) MsLangId::convertLanguageToLocale( eLang, aLocale ); return aLocale; diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx index 6db152d..2767305 100644 --- a/editeng/source/outliner/outleeng.cxx +++ b/editeng/source/outliner/outleeng.cxx @@ -184,7 +184,7 @@ void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const Str void OutlinerEditEng::FieldClicked( const SvxFieldItem& rField, USHORT nPara, USHORT nPos ) { - EditEngine::FieldClicked( rField, nPara, nPos ); // Falls URL + EditEngine::FieldClicked( rField, nPara, nPos ); // If URL pOwner->FieldClicked( rField, nPara, nPos ); } diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx index a18bd95..11baca5 100644 --- a/editeng/source/outliner/outleeng.hxx +++ b/editeng/source/outliner/outleeng.hxx @@ -54,7 +54,6 @@ public: virtual void ParagraphDeleted( USHORT nDeletedParagraph ); virtual void ParagraphConnected( USHORT nLeftParagraph, USHORT nRightParagraph ); - // #101498# virtual void DrawingText( const Point& rStartPos, const XubString& rText, USHORT nTextStart, USHORT nTextLen, const sal_Int32* pDXArray, const SvxFont& rFont, USHORT nPara, USHORT nIndex, BYTE nRightToLeft, diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index 279479c..f6dfff5 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -57,8 +57,8 @@ DBG_NAMEEX(Outliner) using namespace ::com::sun::star::uno; using namespace ::com::sun::star::linguistic2; -// ===================================================================== -// ====================== Einfache Durchreicher ======================= +// ====================================================================== +// ====================== Simple pass-through ======================= // ====================================================================== void Outliner::SetUpdateMode( BOOL bUpdate ) diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 6188d68..9d594e4 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -63,14 +63,14 @@ #include #include -// #101498# calculate if it's RTL or not +// calculate if it's RTL or not #include using ::std::advance; #define DEFAULT_SCALE 75 -static const USHORT nDefStyles = 3; // Sonderbehandlung fuer die ersten 3 Ebenen +static const USHORT nDefStyles = 3; // Special treatment for the first 3 levels static const USHORT nDefBulletIndent = 800; static const USHORT nDefBulletWidth = 700; static const USHORT pDefBulletIndents[nDefStyles]= { 1400, 800, 800 }; @@ -224,7 +224,7 @@ void Outliner::ParagraphDeleted( USHORT nPara ) if ( pPara && ( pPara->GetDepth() > nDepth ) ) { ImplCalcBulletText( nPara, TRUE, FALSE ); - // naechsten auf gleicher Ebene suchen... + // Search for next on the this level ... while ( pPara && pPara->GetDepth() > nDepth ) pPara = pParaList->GetParagraph( ++nPara ); } @@ -429,7 +429,7 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara ) aText.ConvertLineEnd( LINEEND_LF ); if( aText.GetChar( aText.Len()-1 ) == '\x0A' ) - aText.Erase( aText.Len()-1, 1 ); // letzten Umbruch loeschen + aText.Erase( aText.Len()-1, 1 ); // Delete the last break USHORT nCount = aText.GetTokenCount( '\x0A' ); USHORT nPos = 0; @@ -447,20 +447,19 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara ) else nCurDepth = pPara->GetDepth(); - // Im Outliner-Modus die Tabulatoren filtern und die - // Einrueckung ueber ein LRSpaceItem einstellen - // Im EditEngine-Modus ueber Maltes Tabulatoren einruecken + // In the outliner mode, filter the tabs and set the indentation + // about a LRSpaceItem. In EditEngine mode intend over old tabs if( ( ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT ) || ( ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEVIEW ) ) { - // Tabs raus + // Extract Tabs USHORT nTabs = 0; while ( ( nTabs < aStr.Len() ) && ( aStr.GetChar( nTabs ) == '\t' ) ) nTabs++; if ( nTabs ) aStr.Erase( 0, nTabs ); - // Tiefe beibehalten ? (siehe Outliner::Insert) + // Keep depth? (see Outliner::Insert) if( !(pPara->nFlags & PARAFLAG_HOLDDEPTH) ) { nCurDepth = nTabs-1; @@ -469,7 +468,7 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara ) pPara->nFlags &= (~PARAFLAG_HOLDDEPTH); } } - if( nPos ) // nicht mit dem ersten Absatz + if( nPos ) // not with the first paragraph { pParaList->Insert( pPara, nInsPos ); pEditEngine->InsertParagraph( nInsPos, aStr ); @@ -493,7 +492,7 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara ) pEditEngine->SetUpdateMode( bUpdate ); } -// pView == 0 -> Tabulatoren nicht beachten +// pView == 0 -> Ignore tabs bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView) { @@ -528,11 +527,11 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView) if ( nHeadingNumberStart || nNumberingNumberStart ) { - // PowerPoint-Import ? + // PowerPoint import ? if( nHeadingNumberStart && ( aStr.Len() >= 2 ) && ( pPtr[0] != '\t' ) && ( pPtr[1] == '\t' ) ) { - // Bullet & Tab raus + // Extract Bullet and Tab aDelSel = ESelection( (USHORT)nPara, 0, (USHORT)nPara, 2 ); } @@ -541,18 +540,18 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView) aLevel.EraseLeadingChars( ' ' ); nTabs = sal::static_int_cast< USHORT >(aLevel.ToInt32()); if( nTabs ) - nTabs--; // ebene 0 = "heading 1" + nTabs--; // Level 0 = "heading 1" bConverted = TRUE; } else { - // Fuehrende Tabulatoren filtern + // filter leading tabs while( *pPtr == '\t' ) { pPtr++; nTabs++; } - // Tabulatoren aus dem Text entfernen + // Remove tabs from the text if( nTabs ) aDelSel = ESelection( (USHORT)nPara, 0, (USHORT)nPara, nTabs ); } @@ -695,7 +694,7 @@ XubString Outliner::CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, US return String( ' ' ); EditFieldInfo aFldInfo( this, rField, nPara, nPos ); - // Die FldColor ist mit COL_LIGHTGRAY voreingestellt. + // The FldColor is preset with COL_LIGHTGRAY. if ( rpFldColor ) aFldInfo.SetFldColor( *rpFldColor ); @@ -791,9 +790,8 @@ void Outliner::ImplInitDepth( USHORT nPara, sal_Int16 nDepth, BOOL bCreateUndo, sal_Int16 nOldDepth = pPara->GetDepth(); pPara->SetDepth( nDepth ); - // Bei IsInUndo brauchen Attribute und Style nicht eingestellt werden, - // dort werden die alten Werte durch die EditEngine restauriert. - + // For IsInUndo attributes and style do not have to be set, there + // the old values are restored by the EditEngine. if( !IsInUndo() ) { BOOL bUpdate = pEditEngine->GetUpdateMode(); @@ -861,7 +859,7 @@ BOOL Outliner::Expand( Paragraph* pPara ) BOOL Outliner::Collapse( Paragraph* pPara ) { DBG_CHKTHIS(Outliner,0); - if ( pParaList->HasVisibleChilds( pPara ) ) // expandiert + if ( pParaList->HasVisibleChilds( pPara ) ) // expanded { OLUndoExpand* pUndo = 0; BOOL bUndo = FALSE; @@ -897,7 +895,7 @@ Font Outliner::ImpCalcBulletFont( USHORT nPara ) const const SvxNumberFormat* pFmt = GetNumberFormat( nPara ); DBG_ASSERT( pFmt && ( pFmt->GetNumberingType() != SVX_NUM_BITMAP ) && ( pFmt->GetNumberingType() != SVX_NUM_NUMBER_NONE ), "ImpCalcBulletFont: Missing or BitmapBullet!" ); - Font aStdFont; //#107508# + Font aStdFont; if ( !pEditEngine->IsFlatMode() ) { ESelection aSel( nPara, 0, nPara, 0 ); @@ -923,7 +921,7 @@ Font Outliner::ImpCalcBulletFont( USHORT nPara ) const aBulletFont.SetRelief( RELIEF_NONE ); } - // #107508# Use original scale... + // Use original scale... USHORT nStretchX, nStretchY; const_cast(this)->GetGlobalCharStretching(nStretchX, nStretchY); @@ -984,7 +982,7 @@ void Outliner::PaintBullet( USHORT nPara, const Point& rStartPos, if( pFmt->GetNumberingType() != SVX_NUM_BITMAP ) { Font aBulletFont( ImpCalcBulletFont( nPara ) ); - // #2338# Use base line + // Use baseline BOOL bSymbol = pFmt->GetNumberingType() == SVX_NUM_CHAR_SPECIAL; aBulletFont.SetAlign( bSymbol ? ALIGN_BOTTOM : ALIGN_BASELINE ); Font aOldFont = pOutDev->GetFont(); @@ -1010,8 +1008,8 @@ void Outliner::PaintBullet( USHORT nPara, const Point& rStartPos, if ( nOrientation ) { - // Sowohl TopLeft als auch BottomLeft nicht ganz richtig, da - // in EditEngine BaseLine... + // Both TopLeft and bottom left is not quite correct, + // since in EditEngine baseline ... double nRealOrientation = nOrientation*F_PI1800; double nCos = cos( nRealOrientation ); double nSin = sin( nRealOrientation ); @@ -1029,7 +1027,7 @@ void Outliner::PaintBullet( USHORT nPara, const Point& rStartPos, pOutDev->SetFont( aRotatedFont ); } - // #105803# VCL will care for brackets and so on... + // VCL will take care of brackets and so on... ULONG nLayoutMode = pOutDev->GetLayoutMode(); nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL|TEXT_LAYOUT_COMPLEX_DISABLED|TEXT_LAYOUT_BIDI_STRONG); if ( bRightToLeftPara ) @@ -1098,14 +1096,14 @@ void Outliner::PaintBullet( USHORT nPara, const Point& rStartPos, } else { - // MT: Remove CAST when KA made the Draw-Method const + // Remove CAST when KA made the Draw-Method const ((GraphicObject*)pFmt->GetBrush()->GetGraphicObject())->Draw( pOutDev, aBulletPos, pPara->aBulSize ); } } } } - // Bei zusammengeklappten Absaetzen einen Strich vor den Text malen. + // In case of collapsed subparagraphs paint a line before the text. if( pParaList->HasChilds(pPara) && !pParaList->HasVisibleChilds(pPara) && !bStrippingPortions && !nOrientation ) { @@ -1223,7 +1221,7 @@ void Outliner::ImpFilterIndents( ULONG nFirstPara, ULONG nLastPara ) } else if ( pLastConverted ) { - // Normale Absaetze unter der Ueberschrift anordnen... + // Arrange normal paragraphs below the heading ... pPara->SetDepth( pLastConverted->GetDepth() ); } @@ -1269,7 +1267,7 @@ void Outliner::ImpTextPasted( ULONG nStartPara, USHORT nCount ) DepthChangedHdl(); } } - else // EditEngine-Modus + else // EditEngine mode { sal_Int16 nDepth = -1; const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( (USHORT)nStartPara ); @@ -1303,17 +1301,17 @@ long Outliner::IndentingPagesHdl( OutlinerView* pView ) BOOL Outliner::ImpCanIndentSelectedPages( OutlinerView* pCurView ) { DBG_CHKTHIS(Outliner,0); - // Die selektierten Seiten muessen vorher durch ImpCalcSelectedPages - // schon eingestellt sein + // The selected pages must already be set in advance through + // ImpCalcSelectedPages - // Wenn der erste Absatz auf Ebene 0 liegt darf er auf keinen Fall - // eingerueckt werden, evtl folgen aber weitere auf Ebene 0. + // If the first paragraph is on level 0 it can not indented in any case, + // possible there might be indentations in the following on the 0 level. if ( ( mnFirstSelPage == 0 ) && ( ImplGetOutlinerMode() != OUTLINERMODE_TEXTOBJECT ) ) { - if ( nDepthChangedHdlPrevDepth == 1 ) // ist die einzige Seite + if ( nDepthChangedHdlPrevDepth == 1 ) // is the only page return FALSE; else - pCurView->ImpCalcSelectedPages( FALSE ); // ohne die erste + pCurView->ImpCalcSelectedPages( FALSE ); // without the first } return (BOOL)IndentingPagesHdl( pCurView ); } @@ -1322,8 +1320,8 @@ BOOL Outliner::ImpCanIndentSelectedPages( OutlinerView* pCurView ) BOOL Outliner::ImpCanDeleteSelectedPages( OutlinerView* pCurView ) { DBG_CHKTHIS(Outliner,0); - // Die selektierten Seiten muessen vorher durch ImpCalcSelectedPages - // schon eingestellt sein + // The selected pages must already be set in advance through + // ImpCalcSelectedPages return (BOOL)RemovingPagesHdl( pCurView ); } @@ -1368,7 +1366,7 @@ size_t Outliner::InsertView( OutlinerView* pView, size_t nIndex ) { DBG_CHKTHIS(Outliner,0); size_t ActualIndex; -//joe + if ( nIndex >= aViewList.size() ) { aViewList.push_back( pView ); @@ -1392,13 +1390,13 @@ OutlinerView* Outliner::RemoveView( OutlinerView* pView ) { if ( *it == pView ) { - pView->pEditView->HideCursor(); // HACK wg. BugId 10006 + pView->pEditView->HideCursor(); // HACK pEditEngine->RemoveView( pView->pEditView ); aViewList.erase( it ); break; } } - return NULL; // MT: return ueberfluessig + return NULL; // return superfluous } OutlinerView* Outliner::RemoveView( size_t nIndex ) @@ -1406,7 +1404,7 @@ OutlinerView* Outliner::RemoveView( size_t nIndex ) DBG_CHKTHIS(Outliner,0); EditView* pEditView = pEditEngine->GetView( (USHORT)nIndex ); - pEditView->HideCursor(); // HACK wg. BugId 10006 + pEditView->HideCursor(); // HACK pEditEngine->RemoveView( (USHORT)nIndex ); @@ -1416,7 +1414,7 @@ OutlinerView* Outliner::RemoveView( size_t nIndex ) aViewList.erase( it ); } - return NULL; // MT: return ueberfluessig + return NULL; // return superfluous } @@ -1573,11 +1571,10 @@ void Outliner::ParaAttribsChanged( USHORT nPara ) { DBG_CHKTHIS(Outliner,0); - // Der Outliner hat kein eigenes Undo, wenn Absaetz getrennt/verschmolzen werden. - // Beim ParagraphInserted ist das Attribut EE_PARA_OUTLLEVEL - // ggf. noch nicht eingestellt, dies wird aber benoetigt um die Tiefe - // des Absatzes zu bestimmen. - + // The Outliner does not have an undo of its own, when paragraphs are + // separated/merged. When ParagraphInserted the attribute EE_PARA_OUTLLEVEL + // may not be set, this is however needed when the depth of the paragraph + // is to be determined. if( pEditEngine->IsInUndo() ) { if ( pParaList->GetParagraphCount() == pEditEngine->GetParagraphCount() ) @@ -1597,11 +1594,10 @@ void Outliner::StyleSheetChanged( SfxStyleSheet* pStyle ) { DBG_CHKTHIS(Outliner,0); - // Die EditEngine ruft StyleSheetChanged auch fuer abgeleitete Styles. - // MT: Hier wurde frueher alle Absaetze durch ein ImpRecalcParaAttribs - // gejagt, die die besagte Vorlage haben, warum? - // => Eigentlich kann sich nur die Bullet-Repraesentation aendern... - + // The EditEngine calls StyleSheetChanged also for derived styles. + // Here all the paragraphs, which had the said template, used to be + // hunted by a ImpRecalcParaAttribs, why? + // => only the Bullet-representation can really change... USHORT nParas = (USHORT)pParaList->GetParagraphCount(); for( USHORT nPara = 0; nPara < nParas; nPara++ ) { @@ -1609,7 +1605,7 @@ void Outliner::StyleSheetChanged( SfxStyleSheet* pStyle ) { ImplCheckNumBulletItem( nPara ); ImplCalcBulletText( nPara, FALSE, FALSE ); - // #97333# EditEngine formats changed paragraphs before calling this method, + // EditEngine formats changed paragraphs before calling this method, // so they are not reformatted now and use wrong bullet indent pEditEngine->QuickMarkInvalid( ESelection( nPara, 0, nPara, 0 ) ); } @@ -1618,7 +1614,7 @@ void Outliner::StyleSheetChanged( SfxStyleSheet* pStyle ) Rectangle Outliner::ImpCalcBulletArea( USHORT nPara, BOOL bAdjust, BOOL bReturnPaperPos ) { - // Bullet-Bereich innerhalb des Absatzes... + // Bullet area within the paragraph ... Rectangle aBulletArea; const SvxNumberFormat* pFmt = GetNumberFormat( nPara ); @@ -1636,12 +1632,12 @@ Rectangle Outliner::ImpCalcBulletArea( USHORT nPara, BOOL bAdjust, BOOL bReturnP aTopLeft.X() = rLR.GetTxtLeft() + rLR.GetTxtFirstLineOfst() + nSpaceBefore; long nBulletWidth = Max( (long) -rLR.GetTxtFirstLineOfst(), (long) ((-pFmt->GetFirstLineOffset()) + pFmt->GetCharTextDistance()) ); - if ( nBulletWidth < aBulletSize.Width() ) // Bullet macht sich Platz + if ( nBulletWidth < aBulletSize.Width() ) // The Bullet creates its space nBulletWidth = aBulletSize.Width(); if ( bAdjust && !bOutlineMode ) { - // Bei zentriert/rechtsbuendig anpassen + // Adjust when centered or align right const SvxAdjustItem& rItem = (const SvxAdjustItem&)pEditEngine->GetParaAttrib( nPara, EE_PARA_JUST ); if ( ( !pEditEngine->IsRightToLeft( nPara ) && ( rItem.GetAdjust() != SVX_ADJUST_LEFT ) ) || ( pEditEngine->IsRightToLeft( nPara ) && ( rItem.GetAdjust() != SVX_ADJUST_RIGHT ) ) ) @@ -1650,15 +1646,15 @@ Rectangle Outliner::ImpCalcBulletArea( USHORT nPara, BOOL bAdjust, BOOL bReturnP } } - // Vertikal: + // Vertical: ParagraphInfos aInfos = pEditEngine->GetParagraphInfos( nPara ); if ( aInfos.bValid ) { - aTopLeft.Y() = /* aInfos.nFirstLineOffset + */ // #91076# nFirstLineOffset is already added to the StartPos (PaintBullet) from the EditEngine + aTopLeft.Y() = /* aInfos.nFirstLineOffset + */ // nFirstLineOffset is already added to the StartPos (PaintBullet) from the EditEngine aInfos.nFirstLineHeight - aInfos.nFirstLineTextHeight + aInfos.nFirstLineTextHeight / 2 - aBulletSize.Height() / 2; - // ggf. lieber auf der Baseline ausgeben... + // may prefer to print out on the baseline ... if( ( pFmt->GetNumberingType() != SVX_NUM_NUMBER_NONE ) && ( pFmt->GetNumberingType() != SVX_NUM_BITMAP ) && ( pFmt->GetNumberingType() != SVX_NUM_CHAR_SPECIAL ) ) { Font aBulletFont( ImpCalcBulletFont( nPara ) ); @@ -1668,7 +1664,7 @@ Rectangle Outliner::ImpCalcBulletArea( USHORT nPara, BOOL bAdjust, BOOL bReturnP Font aOldFont = pRefDev->GetFont(); pRefDev->SetFont( aBulletFont ); FontMetric aMetric( pRefDev->GetFontMetric() ); - // Leading der ersten Zeile... + // Leading on the first line ... aTopLeft.Y() = /* aInfos.nFirstLineOffset + */ aInfos.nFirstLineMaxAscent; aTopLeft.Y() -= aMetric.GetAscent(); pRefDev->SetFont( aOldFont ); @@ -1686,7 +1682,7 @@ Rectangle Outliner::ImpCalcBulletArea( USHORT nPara, BOOL bAdjust, BOOL bReturnP aTopLeft.X() += ( nBulletWidth - aBulletSize.Width() ) / 2; } - if ( aTopLeft.X() < 0 ) // dann draengeln + if ( aTopLeft.X() < 0 ) // then push aTopLeft.X() = 0; aBulletArea = Rectangle( aTopLeft, aBulletSize ); @@ -1796,7 +1792,6 @@ void Outliner::StripPortions() bStrippingPortions = FALSE; } -// #101498# void Outliner::DrawingText( const Point& rStartPos, const XubString& rText, USHORT nTextStart, USHORT nTextLen, const sal_Int32* pDXArray,const SvxFont& rFont, USHORT nPara, USHORT nIndex, BYTE nRightToLeft, const EEngineData::WrongSpellVector* pWrongSpellVector, @@ -1812,7 +1807,6 @@ void Outliner::DrawingText( const Point& rStartPos, const XubString& rText, USHO if(aDrawPortionHdl.IsSet()) { - // #101498# DrawPortionInfo aInfo( rStartPos, rText, nTextStart, nTextLen, rFont, nPara, nIndex, pDXArray, pWrongSpellVector, pFieldData, pLocale, rOverlineColor, rTextLineColor, nRightToLeft, false, 0, bEndOfLine, bEndOfParagraph, bEndOfBullet); @@ -2062,7 +2056,7 @@ String Outliner::ImplGetBulletText( USHORT nPara ) Paragraph* pPara = pParaList->GetParagraph( nPara ); if (pPara) { - // MT: Optimierung mal wieder aktivieren... + // Enable optimization again ... // if( pPara->nFlags & PARAFLAG_SETBULLETTEXT ) ImplCalcBulletText( nPara, FALSE, FALSE ); aRes = pPara->GetText(); diff --git a/editeng/source/outliner/outlundo.hxx b/editeng/source/outliner/outlundo.hxx index 9e12bb3..3fe9f92 100644 --- a/editeng/source/outliner/outlundo.hxx +++ b/editeng/source/outliner/outlundo.hxx @@ -100,9 +100,9 @@ public: virtual void Repeat(); }; -// Hilfs-Undo: Wenn es fuer eine Aktion keine OutlinerUndoAction gibst, weil -// die EditEngine das handelt, aber z.B. noch das Bullet neu berechnet werden muss. - +// Help-Undo: If it does not exist an OutlinerUndoAction for a certain action +// because this is handled by the EditEngine, but for example the bullet has +// to be recalculated. class OutlinerUndoCheckPara : public OutlinerUndoBase { using SfxUndoAction::Repeat; @@ -133,7 +133,7 @@ public: virtual void Redo(); virtual void Repeat(); - USHORT* pParas; // 0 == nCount enthaelt Absatznummer + USHORT* pParas; // 0 == nCount contains paragraph number Outliner* pOutliner; USHORT nCount; }; diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 7c00f24..40dbe34 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -58,13 +58,13 @@ #include -// Breite der Randzonen innerhalb derer beim D&D gescrollt wird +// Width of the border zones within which is scrolled during Drag and Drop #define OL_SCROLL_LRBORDERWIDTHPIX 10 #define OL_SCROLL_TBBORDERWIDTHPIX 10 -// Wert, um den Fensterinhalt beim D&D gescrollt wird -#define OL_SCROLL_HOROFFSET 20 /* in % von VisibleSize.Width */ -#define OL_SCROLL_VEROFFSET 20 /* in % von VisibleSize.Height */ +// Value to the window content when scrolling during Drag and Drop +#define OL_SCROLL_HOROFFSET 20 /* in % of VisibleSize.Width */ +#define OL_SCROLL_VEROFFSET 20 /* in % of VisibleSize.Height */ using namespace ::com::sun::star; @@ -96,8 +96,8 @@ void OutlinerView::Paint( const Rectangle& rRect ) { DBG_CHKTHIS(OutlinerView,0); - // beim ersten Paint/KeyInput/Drop wird aus einem leeren Outliner ein - // Outliner mit genau einem Absatz + // For the first Paint/KeyInput/Drop an emty Outliner is turned into + // an Outliner with exactly one paragraph. if( pOwner->bFirstParaIsEmpty ) pOwner->Insert( String() ); @@ -108,8 +108,8 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) { DBG_CHKTHIS( OutlinerView, 0 ); - // beim ersten Paint/KeyInput/Drop wird aus einem leeren Outliner ein - // Outliner mit genau einem Absatz + // For the first Paint/KeyInput/Drop an emty Outliner is turned into + // an Outliner with exactly one paragraph. if( pOwner->bFirstParaIsEmpty ) pOwner->Insert( String() ); @@ -172,7 +172,7 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) } } break; - default: // wird dann evtl. unten bearbeitet. + default: // is then possibly edited below. eFunc = KEYFUNC_DONTKNOW; } } @@ -220,13 +220,13 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) { if ( !bReadOnly ) { - // Sonderbehandlung: Hartes Return am Ende eines Absatzes, - // der eingeklappte Unterabsaetze besitzt + // Special treatment: hard return at the end of a paragraph, + // which has collapsed subparagraphs. Paragraph* pPara = pOwner->pParaList->GetParagraph( aSel.nEndPara ); if( !aKeyCode.IsShift() ) { - // Nochmal ImpGetCursor ??? + // ImpGetCursor again??? if( !bSelection && aSel.nEndPos == pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) ) { @@ -236,9 +236,9 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) pOwner->UndoActionStart( OLUNDO_INSERT ); ULONG nTemp = aSel.nEndPara; nTemp += nChilds; - nTemp++; // einfuegen ueber naechstem Non-Child + nTemp++; // insert above next Non-Child pOwner->Insert( String(),nTemp,pPara->GetDepth()); - // Cursor positionieren + // Position the cursor ESelection aTmpSel((USHORT)nTemp,0,(USHORT)nTemp,0); pEditView->SetSelection( aTmpSel ); pEditView->ShowCursor( TRUE, TRUE ); @@ -256,7 +256,7 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) nTemp++; pOwner->Insert( String(), nTemp, pPara->GetDepth()+1 ); - // Cursor positionieren + // Position the cursor ESelection aTmpSel((USHORT)nTemp,0,(USHORT)nTemp,0); pEditView->SetSelection( aTmpSel ); pEditView->ShowCursor( TRUE, TRUE ); @@ -358,7 +358,7 @@ BOOL OutlinerView::MouseButtonDown( const MouseEvent& rMEvt ) ULONG nEndPara = nPara; if ( bHasChilds && pOwner->pParaList->HasVisibleChilds(pPara) ) nEndPara += pOwner->pParaList->GetChildCount( pPara ); - // umgekehrt rum selektieren, damit EditEngine nicht scrollt + // The selection is inverted, so that EditEngine does not scroll ESelection aSel((USHORT)nEndPara, 0xffff,(USHORT)nPara, 0 ); pEditView->SetSelection( aSel ); } @@ -467,7 +467,7 @@ void OutlinerView::ImpPaintDDCursor() pWindow->SetRasterOp( eOldOp ); } -// Berechnet, ueber welchem Absatz eingefuegt werden muss +// Calculates above which paragraph must it must be inserted ULONG OutlinerView::ImpGetInsertionPara( const Point& rPosPixel ) { @@ -549,7 +549,7 @@ void OutlinerView::SetAttribs( const SfxItemSet& rAttrs ) pEditView->SetAttribs( rAttrs ); - // Bullet-Texte aktualisieren + // Update Bullet text for( USHORT nPara= aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) { pOwner->ImplCheckNumBulletItem( nPara ); @@ -575,7 +575,7 @@ ParaRange OutlinerView::ImpGetSelectedParagraphs( BOOL bIncludeHiddenChilds ) ParaRange aParas( aSel.nStartPara, aSel.nEndPara ); aParas.Adjust(); - // unsichtbare Childs des letzten Parents in Selektion mit aufnehmen + // Record the invisible Children of the last Parents in the selection if ( bIncludeHiddenChilds ) { Paragraph* pLast = pOwner->pParaList->GetParagraph( aParas.nEndPara ); @@ -588,7 +588,7 @@ ParaRange OutlinerView::ImpGetSelectedParagraphs( BOOL bIncludeHiddenChilds ) return aParas; } -// MT: Name sollte mal geaendert werden! +// TODO: Name should be changed! void OutlinerView::AdjustDepth( short nDX ) { Indent( nDX ); @@ -610,7 +610,7 @@ void OutlinerView::Indent( short nDiff ) if( bUndo ) pOwner->UndoActionStart( OLUNDO_DEPTH ); - sal_Int16 nMinDepth = -1; // Optimierung: Nicht unnoetig viele Absatze neu berechnen + sal_Int16 nMinDepth = -1; // Optimization: Not to recalculate to manny parargaphs when not really needed. ParaRange aSel = ImpGetSelectedParagraphs( TRUE ); for ( USHORT nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) @@ -625,7 +625,7 @@ void OutlinerView::Indent( short nDiff ) const bool bPage = pPara->HasFlag(PARAFLAG_ISPAGE); if( (bPage && (nDiff == +1)) || (!bPage && (nDiff == -1) && (nOldDepth <= 0)) ) { - // App benachrichtigen + // Notify App pOwner->nDepthChangedHdlPrevDepth = (sal_Int16)nOldDepth; pOwner->mnDepthChangeHdlPrevFlags = pPara->nFlags; pOwner->pHdlParagraph = pPara; @@ -667,10 +667,10 @@ void OutlinerView::Indent( short nDiff ) { if ( ( nPara == aSel.nStartPara ) && aSel.nStartPara && ( pOwner->ImplGetOutlinerMode() != OUTLINERMODE_TEXTOBJECT )) { - // Sonderfall: Der Vorgaenger eines eingerueckten Absatzes ist - // unsichtbar und steht jetzt auf der gleichen Ebene wie der - // sichtbare Absatz. In diesem Fall wird der naechste sichtbare - // Absatz gesucht und aufgeplustert. + // Special case: the predecessor of an indented paragraph is + // invisible and is now on the same level as the visible + // paragraph. In this case, the next visible paragraph is + // searched for and fluffed. #ifdef DBG_UTIL Paragraph* _pPara = pOwner->pParaList->GetParagraph( aSel.nStartPara ); DBG_ASSERT(_pPara->IsVisible(),"Selected Paragraph invisible ?!"); @@ -679,8 +679,8 @@ void OutlinerView::Indent( short nDiff ) if( !pPrev->IsVisible() && ( pPrev->GetDepth() == nNewDepth ) ) { - // Vorgaenger ist eingeklappt und steht auf gleicher Ebene - // => naechsten sichtbaren Absatz suchen und expandieren + // Predecessor is collapsed and is on the same level + // => find next visible paragraph and expand it pPrev = pOwner->pParaList->GetParent( pPrev ); while( !pPrev->IsVisible() ) pPrev = pOwner->pParaList->GetParent( pPrev ); @@ -700,7 +700,7 @@ void OutlinerView::Indent( short nDiff ) if ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT ) pOwner->ImplSetLevelDependendStyleSheet( nPara ); - // App benachrichtigen + // Notify App pOwner->DepthChangedHdl(); } else @@ -710,12 +710,6 @@ void OutlinerView::Indent( short nDiff ) } } - // MT 19.08.99: War mal fuer Optimierung (outliner.cxx#1.193), - // hat aber zu zuviel Wartungsaufwand / doppelten Funktionen gefuehrt - // und zu wenig gebracht: - // pOwner->ImpSetBulletTextsFrom( aSel.nStartPara+1, nMinDepth ); - // Wird jetzt direkt in Schleife mit ImplCalcBulletText() erledigt. - // Jetzt fehlen nur noch die folgenden Ansaetze, die davon betroffen sind. USHORT nParas = (USHORT)pOwner->pParaList->GetParagraphCount(); for ( USHORT n = aSel.nEndPara+1; n < nParas; n++ ) { @@ -778,7 +772,7 @@ Point OutlinerView::ImpGetDocPos( const Point& rPosPixel ) { DBG_CHKTHIS(OutlinerView,0); Rectangle aOutArWin = GetOutputArea(); - // Position in der OutputArea berechnen + // Calculate position in the OutputArea Point aCurPosDoc( rPosPixel ); aCurPosDoc = pEditView->GetWindow()->PixelToLogic( aCurPosDoc ); aCurPosDoc -= aOutArWin.TopLeft(); @@ -786,8 +780,6 @@ Point OutlinerView::ImpGetDocPos( const Point& rPosPixel ) return aCurPosDoc; } -// MT 05/00: Wofuer dies ImpXXXScroll, sollte das nicht die EditEngine machen??? - void OutlinerView::ImpDragScroll( const Point& rPosPix ) { DBG_CHKTHIS(OutlinerView,0); @@ -947,7 +939,7 @@ void OutlinerView::ImplExpandOrCollaps( USHORT nStartPara, USHORT nEndPara, BOOL BOOL bDone = bExpand ? pOwner->Expand( pPara ) : pOwner->Collapse( pPara ); if( bDone ) { - // Der Strich unter dem Absatz muss verschwinden... + // The line under the paragraph should disappear ... pOwner->pEditEngine->QuickMarkToBeRepainted( nPara ); } } @@ -978,16 +970,14 @@ void OutlinerView::Collapse( Paragraph* pPara) void OutlinerView::InsertText( const OutlinerParaObject& rParaObj ) { - // MT: Wie Paste, nur EditView::Insert, statt EditView::Paste. - // Eigentlich nicht ganz richtig, das evtl. Einrueckungen - // korrigiert werden muessen, aber das kommt spaeter durch ein - // allgemeingueltiges Import. - // Dann wird im Inserted gleich ermittelt, was f�r eine Einrueckebene - // Moegliche Struktur: - // pImportInfo mit DestPara, DestPos, nFormat, pParaObj... - // Evtl. Problematisch: - // EditEngine, RTF => Absplittung des Bereichs, spaeter - // zusammenfuehrung + // Like Paste, only EditView::Insert, instead of EditView::Paste. + // Actually not quite true that possible indentations must be corrected, + // but that comes later by a universal import. The indentation level is + // then determined right in the Inserted method. + // Possible structure: + // pImportInfo with DestPara, DestPos, nFormat, pParaObj... + // Possibly problematic: + // EditEngine, RTF => Splitting the area, later join together. DBG_CHKTHIS(OutlinerView,0); @@ -1021,7 +1011,7 @@ void OutlinerView::Cut() void OutlinerView::Paste() { DBG_CHKTHIS(OutlinerView,0); - PasteSpecial(); // HACK(SD ruft nicht PasteSpecial auf) + PasteSpecial(); // HACK(SD does not call PasteSpecial) } void OutlinerView::PasteSpecial() @@ -1164,11 +1154,11 @@ USHORT OutlinerView::ImpCalcSelectedPages( BOOL bIncludeFirstSelected ) USHORT nFirstPage = 0xFFFF; USHORT nStartPara = aSel.nStartPara; if ( !bIncludeFirstSelected ) - nStartPara++; // alle nach StartPara kommenden Absaetze werden geloescht + nStartPara++; // All paragraphs after StartPara will be deleted for ( USHORT nPara = nStartPara; nPara <= aSel.nEndPara; nPara++ ) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); - DBG_ASSERT(pPara, "ImpCalcSelectedPages: ungueltige Selection? "); + DBG_ASSERT(pPara, "ImpCalcSelectedPages: invalid Selection? "); if( pPara->HasFlag(PARAFLAG_ISPAGE) ) { nPages++; @@ -1288,7 +1278,7 @@ void OutlinerView::RemoveAttribs( BOOL bRemoveParaAttribs, USHORT nWhich, BOOL b pEditView->RemoveAttribs( bRemoveParaAttribs, nWhich ); if ( bRemoveParaAttribs ) { - // Ueber alle Absaetze, und Einrueckung und Level einstellen + // Loop through all paragraphs and set indentation and level ESelection aSel = pEditView->GetSelection(); aSel.Adjust(); for ( USHORT nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) @@ -1303,8 +1293,8 @@ void OutlinerView::RemoveAttribs( BOOL bRemoveParaAttribs, USHORT nWhich, BOOL b -// ===================================================================== -// ====================== Einfache Durchreicher ======================= +// ====================================================================== +// ====================== Simple pass-through ======================= // ====================================================================== @@ -1606,9 +1596,6 @@ ULONG OutlinerView::Read( SvStream& rInput, const String& rBaseURL, EETextForma ULONG nRet = pEditView->Read( rInput, rBaseURL, eFormat, bSelect, pHTTPHeaderAttrs ); - // MT 08/00: Hier sollte eigentlich das gleiche wie in PasteSpecial passieren! - // Mal anpassen, wenn dieses ImplInitPaste und ImpPasted-Geraffel ueberarbeitet ist. - long nParaDiff = pEditView->GetEditEngine()->GetParagraphCount() - nOldParaCount; USHORT nChangesStart = aOldSel.nStartPara; USHORT nChangesEnd = sal::static_int_cast< USHORT >(nChangesStart + nParaDiff + (aOldSel.nEndPara-aOldSel.nStartPara)); diff --git a/editeng/source/outliner/paralist.cxx b/editeng/source/outliner/paralist.cxx index 938db52..81eae5c 100644 --- a/editeng/source/outliner/paralist.cxx +++ b/editeng/source/outliner/paralist.cxx @@ -30,7 +30,7 @@ #include "precompiled_editeng.hxx" #include -#include // nur wegen Paragraph, muss geaendert werden! +#include // only because of Paragraph, this must be changed! #include DBG_NAME(Paragraph) diff --git a/editeng/source/rtf/rtfgrf.cxx b/editeng/source/rtf/rtfgrf.cxx index d7a3070..721b24b 100644 --- a/editeng/source/rtf/rtfgrf.cxx +++ b/editeng/source/rtf/rtfgrf.cxx @@ -74,8 +74,8 @@ void GrfWindow::Paint( const Rectangle& ) #endif static BYTE aPal1[ 2 * 4 ] = { - 0x00, 0x00, 0x00, 0x00, // Schwarz - 0xFF, 0xFF, 0xFF, 0x00 // Weiss + 0x00, 0x00, 0x00, 0x00, // Black + 0xFF, 0xFF, 0xFF, 0x00 // White }; static BYTE aPal4[ 16 * 4 ] = { @@ -217,7 +217,7 @@ static void WriteBMPHeader( SvStream& rStream, ULONG n4Height = rPicType.nHeight; USHORT n4ColBits = rPicType.nBitsPerPixel; - USHORT nColors = (1 << n4ColBits); // Anzahl der Farben ( 1, 16, 256 ) + USHORT nColors = (1 << n4ColBits); // Number of colors (1, 16, 256) USHORT nWdtOut = rPicType.nWidthBytes; if( !nWdtOut ) nWdtOut = (USHORT)((( n4Width * n4ColBits + 31 ) / 32 ) * 4 ); @@ -228,8 +228,8 @@ static void WriteBMPHeader( SvStream& rStream, long nSize = nOffset + nWdtOut * n4Height; rStream << "BM" // = "BM" << SwapLong(nSize) // Filesize in Bytes - << SwapShort(0) // Reserviert - << SwapShort(0) // Reserviert + << SwapShort(0) // Reserved + << SwapShort(0) // Reserved << SwapLong(nOffset); // Offset? rStream << SwapLong(40) // sizeof( BmpInfo ) @@ -259,14 +259,14 @@ static void WriteBMPHeader( SvStream& rStream, /* */ - // wandel die ASCII-HexCodes in binaere Zeichen um. Werden - // ungueltige Daten gefunden (Zeichen ausser 0-9|a-f|A-F, so - // wird USHRT_MAX returnt, ansonsten die Anzahl der umgewandelten Ze. + // Converts the ASCII characters to hexadecimal codes in binary. + // If invalid data is found (eg. characters outside 0-9|a-f|A-F), then + // USHRT_MAX is returned, else the number of converted charachters. xub_StrLen SvxRTFParser::HexToBin( String& rToken ) { - // dann mache aus den Hex-Werten mal "Binare Daten" - // (missbrauche den String als temp Buffer) - if( rToken.Len() & 1 ) // ungerade Anzahl, mit 0 auffuellen + // then create "Binary data" from the hex values. + // (missuse the String as temp Buffer) + if( rToken.Len() & 1 ) // odd number, fill out with 0 rToken += '0'; xub_StrLen n, nLen; @@ -284,7 +284,7 @@ xub_StrLen SvxRTFParser::HexToBin( String& rToken ) nVal -= 'a' - 10; else { - DBG_ASSERT( !this, "ungueltiger Hex-Wert" ); + DBG_ASSERT( !this, "invalid Hex value" ); bValidData = FALSE; break; } @@ -300,9 +300,8 @@ xub_StrLen SvxRTFParser::HexToBin( String& rToken ) BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) { - // die alten Daten loeschen + // Delete the old data rGrf.Clear(); -// ULONG nBmpSize = 0; rtl_TextEncoding eOldEnc = GetSrcEncoding(); SetSrcEncoding( RTL_TEXTENCODING_MS_1252 ); @@ -312,7 +311,7 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) int nToken = 0; bool bValidBmp = true, bFirstTextToken = true; - int _nOpenBrakets = 1, // die erste wurde schon vorher erkannt !! + int _nOpenBrakets = 1, // the first was already recognized before! nValidDataBraket = 1; if( RTF_SHPPICT == GetStackPtr(0)->nTokenId ) @@ -359,7 +358,7 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) case RTF_MACPICT: { rPicType.eStyle = SvxRTFPictureType::MAC_QUICKDRAW; - // Mac-Pict bekommt einen leeren Header voran + // Mac-Pict gets a empty header above pTmpFile = new SvCacheStream; ByteString aStr; aStr.Fill( 512, '\0' ); @@ -467,9 +466,6 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) nToken = SkipToken( -1 ); break; case RTF_TEXTTOKEN: - // JP 26.06.98: Bug #51719# - nur TextToken auf 1. Ebene - // auswerten. Alle anderen sind irgendwelche - // nicht auszuwertende Daten if( nValidDataBraket != _nOpenBrakets ) break; @@ -478,7 +474,7 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) switch( rPicType.eStyle ) { case SvxRTFPictureType::RTF_BITMAP: - // erstmal die Header und Info-Struktur schreiben + // first write the header and the info structure if( pTmpFile ) ::WriteBMPHeader( *pTmpFile, rPicType ); break; @@ -540,7 +536,7 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) if( !bValidBmp ) { rGrf.Clear(); - //TODO If nToken were not initialized to 0 above, it would potentially + // TODO: If nToken were not initialized to 0 above, it would potentially // be used uninitialized here (if IsParserWorking() is false at the // start of the while loop above): if( '}' != nToken ) @@ -550,7 +546,6 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) { switch( rPicType.eStyle ) { -//?? ENHANCED_MF, // in den Pict.Daten steht ein Enhanced-Metafile case SvxRTFPictureType::RTF_PNG: case SvxRTFPictureType::RTF_JPG: { @@ -577,7 +572,7 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) } SetSrcEncoding( eOldEnc ); - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + SkipToken( -1 ); // the closing brace is evaluated "above" return bValidBmp; } diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index aa208c5..a03de25 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -96,7 +96,7 @@ #define BRACERIGHT '}' -// einige Hilfs-Funktionen +// Some helper functions // char inline const SvxEscapementItem& GetEscapement(const SfxItemSet& rSet,USHORT nId,BOOL bInP=TRUE) { return (const SvxEscapementItem&)rSet.Get( nId,bInP); } @@ -217,7 +217,7 @@ void SvxRTFParser::SetScriptAttr( RTF_CharTypeDef eType, SfxItemSet& rSet, void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) { - DBG_ASSERT( pSet, "Es muss ein SfxItemSet uebergeben werden!" ); + DBG_ASSERT( pSet, "A SfxItemSet has to be provided as argument!" ); int bFirstToken = TRUE, bWeiter = TRUE; USHORT nStyleNo = 0; // default FontUnderline eUnderline; @@ -229,7 +229,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) int bChkStkPos = !bNewGroup && aAttrStack.Top(); - while( bWeiter && IsParserWorking() ) // solange bekannte Attribute erkannt werden + while( bWeiter && IsParserWorking() ) // as long as known Attribute are recognized { switch( nToken ) { @@ -261,12 +261,12 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if( pAkt->aAttrSet.Count() || pAkt->pChildList || pAkt->nStyleNo ) { - // eine neue Gruppe aufmachen + // Open a new Group SvxRTFItemStackType* pNew = new SvxRTFItemStackType( *pAkt, *pInsPos, TRUE ); pNew->SetRTFDefaults( GetRTFDefaults() ); - // alle bis hierher gueltigen Attribute "setzen" + // "Set" all valid attributes up until this point AttrGroupEnd(); pAkt = aAttrStack.Top(); // can be changed after AttrGroupEnd! pNew->aAttrSet.SetParent( pAkt ? &pAkt->aAttrSet : 0 ); @@ -275,7 +275,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) pAkt = pNew; } else - // diesen Eintrag als neuen weiterbenutzen + // continue to use this entry as a new one pAkt->SetStartPos( *pInsPos ); pSet = &pAkt->aAttrSet; @@ -302,8 +302,8 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) else { nStyleNo = -1 == nTokenValue ? 0 : USHORT(nTokenValue); - // setze am akt. auf dem AttrStack stehenden Style die - // StyleNummer + // Set the StyleNumber for the current style on + // the attribute stack SvxRTFItemStackType* pAkt = aAttrStack.Top(); if( !pAkt ) break; @@ -445,14 +445,14 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) case RTF_SLMULT: if( PARDID->nLinespacing && 1 == nTokenValue ) { - // dann wird auf mehrzeilig umgeschaltet! + // then switches to multi-line! SvxLineSpacingItem aLSpace( GetLineSpacing( *pSet, PARDID->nLinespacing, FALSE )); - // wieviel bekommt man aus dem LineHeight Wert heraus + // how much do you get from the line height value? - // Proportionale-Groesse: - // D.H. das Verhaeltnis ergibt sich aus ( n / 240 ) Twips + // Proportional-Size: + // Ie, the ratio is (n / 240) twips nTokenValue = 240; if( IsCalcValue() ) @@ -461,8 +461,8 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) nTokenValue = short( 100L * aLSpace.GetLineHeight() / long( nTokenValue ) ); - if( nTokenValue > 200 ) // Datenwert fuer PropLnSp - nTokenValue = 200; // ist ein BYTE !!! + if( nTokenValue > 200 ) // Data value for PropLnSp + nTokenValue = 200; // is one BYTE !!! aLSpace.SetPropLineSpace( (const BYTE)nTokenValue ); aLSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO; @@ -474,9 +474,9 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) case RTF_SL: if( PARDID->nLinespacing ) { - // errechne das Verhaeltnis aus dem default Font zu der - // Size Angabe. Der Abstand besteht aus der Zeilenhoehe - // (100%) und dem Leerraum ueber der Zeile (20%). + // Calculate the ratio between the default font and the + // specified size. The distance consists of the line height + // (100%) and the space above the line (20%). SvxLineSpacingItem aLSpace(0, PARDID->nLinespacing); nTokenValue = !bTokenHasValue ? 0 : nTokenValue; @@ -554,7 +554,7 @@ SET_FONTALIGNMENT: /* */ case RTF_B: case RTF_AB: - if( IsAttrSttPos() ) // nicht im Textfluss ? + if( IsAttrSttPos() ) // not in the text flow? { SvxWeightItem aTmpItem( @@ -567,7 +567,7 @@ SET_FONTALIGNMENT: case RTF_CAPS: case RTF_SCAPS: if( PLAINID->nCaseMap && - IsAttrSttPos() ) // nicht im Textfluss ? + IsAttrSttPos() ) // not in the text flow? { SvxCaseMap eCaseMap; if( !nTokenValue ) @@ -692,7 +692,7 @@ SET_FONTALIGNMENT: case RTF_I: case RTF_AI: - if( IsAttrSttPos() ) // nicht im Textfluss ? + if( IsAttrSttPos() ) // not in the text flow? { SvxPostureItem aTmpItem( nTokenValue ? ITALIC_NORMAL : ITALIC_NONE, @@ -703,7 +703,7 @@ SET_FONTALIGNMENT: case RTF_OUTL: if( PLAINID->nContour && - IsAttrSttPos() ) // nicht im Textfluss ? + IsAttrSttPos() ) // not in the text flow? { pSet->Put( SvxContourItem( nTokenValue ? TRUE : FALSE, PLAINID->nContour )); @@ -712,7 +712,7 @@ SET_FONTALIGNMENT: case RTF_SHAD: if( PLAINID->nShadowed && - IsAttrSttPos() ) // nicht im Textfluss ? + IsAttrSttPos() ) // not in the text flow? { pSet->Put( SvxShadowedItem( nTokenValue ? TRUE : FALSE, PLAINID->nShadowed )); @@ -721,7 +721,7 @@ SET_FONTALIGNMENT: case RTF_STRIKE: if( PLAINID->nCrossedOut && - IsAttrSttPos() ) // nicht im Textfluss ? + IsAttrSttPos() ) // not in the text flow? { pSet->Put( SvxCrossedOutItem( nTokenValue ? STRIKEOUT_SINGLE : STRIKEOUT_NONE, @@ -730,7 +730,7 @@ SET_FONTALIGNMENT: break; case RTF_STRIKED: - if( PLAINID->nCrossedOut ) // nicht im Textfluss ? + if( PLAINID->nCrossedOut ) // not in the text flow? { pSet->Put( SvxCrossedOutItem( nTokenValue ? STRIKEOUT_DOUBLE : STRIKEOUT_NONE, @@ -1112,7 +1112,7 @@ ATTR_SETEMPHASIS: case BRACELEFT: { - // teste auf Swg-Interne Tokens + // tests on Swg internal tokens bool bHandled = false; short nSkip = 0; if( RTF_IGNOREFLAG != GetNextToken()) @@ -1126,16 +1126,16 @@ ATTR_SETEMPHASIS: case RTF_PGBRK: case RTF_SOUTLVL: UnknownAttrToken( nToken, pSet ); - // ueberlese die schliessende Klammer + // overwrite the closing parenthesis break; case RTF_SWG_ESCPROP: { - // prozentuale Veraenderung speichern ! + // Store percentage change! BYTE nProp = BYTE( nTokenValue / 100 ); short nEsc = 0; if( 1 == ( nTokenValue % 100 )) - // Erkennung unseres AutoFlags! + // Recognize own auto-flags! nEsc = DFLT_ESC_AUTO_SUPER; if( PLAINID->nEscapement ) @@ -1167,7 +1167,7 @@ ATTR_SETEMPHASIS: pSet->Put( aHypenZone ); } else - SkipGroup(); // ans Ende der Gruppe + SkipGroup(); // at the end of the group } break; @@ -1182,8 +1182,6 @@ ATTR_SETEMPHASIS: if( RTF_SHDW_STYLE != GetNextToken() ) break; - //! (pb) class Brush removed -> obsolete - //! BrushStyle eStyle = BrushStyle( nTokenValue ); if( RTF_SHDW_COL != GetNextToken() ) break; @@ -1191,7 +1189,6 @@ ATTR_SETEMPHASIS: if( RTF_SHDW_FCOL != GetNextToken() ) break; -// USHORT nFillCol = USHORT( nTokenValue ); Color aColor = GetColor( nCol ); @@ -1203,7 +1200,7 @@ ATTR_SETEMPHASIS: } while( FALSE ); if( bSkip ) - SkipGroup(); // ans Ende der Gruppe + SkipGroup(); // at the end of the group } break; @@ -1236,7 +1233,7 @@ ATTR_SETEMPHASIS: nToken = SkipToken( -2 ); ReadBorderAttr( nToken, *pSet ); } - else // also kein Attribut mehr + else // so no more attribute nSkip = -2; break; } @@ -1258,10 +1255,10 @@ ATTR_SETEMPHASIS: else nSkip = -2; - if( nSkip ) // alles voellig unbekannt + if( nSkip ) // all completely unknown { if (!bFirstToken) - --nSkip; // BRACELEFT: ist das naechste Token + --nSkip; // BRACELEFT: is the next token SkipToken( nSkip ); bWeiter = FALSE; } @@ -1276,7 +1273,7 @@ ATTR_SETEMPHASIS: ReadBackgroundAttr( nToken, *pSet ); else { - // kenne das Token nicht also das Token "in den Parser zurueck" + // unknown token, so token "returned in Parser" if( !bFirstToken ) SkipToken( -1 ); bWeiter = FALSE; @@ -1289,38 +1286,12 @@ ATTR_SETEMPHASIS: } bFirstToken = FALSE; } - -/* - // teste Attribute gegen ihre Styles - if( IsChkStyleAttr() && pSet->Count() && !pInsPos->GetCntIdx() ) - { - SvxRTFStyleType* pStyle = aStyleTbl.Get( nStyleNo ); - if( pStyle && pStyle->aAttrSet.Count() ) - { - // alle Attribute, die schon vom Style definiert sind, aus dem - // akt. Set entfernen - const SfxPoolItem* pItem; - SfxItemIter aIter( *pSet ); - USHORT nWhich = aIter.GetCurItem()->Which(); - while( TRUE ) - { - if( SFX_ITEM_SET == pStyle->aAttrSet.GetItemState( - nWhich, FALSE, &pItem ) && *pItem == *aIter.GetCurItem()) - pSet->ClearItem( nWhich ); // loeschen - - if( aIter.IsAtEnd() ) - break; - nWhich = aIter.NextItem()->Which(); - } - } - } -*/ } void SvxRTFParser::ReadTabAttr( int nToken, SfxItemSet& rSet ) { bool bMethodOwnsToken = false; // #i52542# patch from cmc. -// dann lese doch mal alle TabStops ein +// then read all the TabStops SvxTabStop aTabStop; SvxTabStopItem aAttr( 0, 0, SVX_TAB_ADJUST_DEFAULT, PARDID->nTabStop ); int bWeiter = TRUE; @@ -1334,7 +1305,7 @@ void SvxRTFParser::ReadTabAttr( int nToken, SfxItemSet& rSet ) CalcValue(); aTabStop.GetTabPos() = nTokenValue; aAttr.Insert( aTabStop ); - aTabStop = SvxTabStop(); // alle Werte default + aTabStop = SvxTabStop(); // all values default } break; @@ -1359,7 +1330,7 @@ void SvxRTFParser::ReadTabAttr( int nToken, SfxItemSet& rSet ) case BRACELEFT: { - // Swg - Kontrol BRACELEFT RTF_IGNOREFLAG RTF_TLSWG BRACERIGHT + // Swg - control BRACELEFT RTF_IGNOREFLAG RTF_TLSWG BRACERIGHT short nSkip = 0; if( RTF_IGNOREFLAG != GetNextToken() ) nSkip = -1; @@ -1369,13 +1340,13 @@ void SvxRTFParser::ReadTabAttr( int nToken, SfxItemSet& rSet ) { aTabStop.GetDecimal() = BYTE(nTokenValue & 0xff); aTabStop.GetFill() = BYTE((nTokenValue >> 8) & 0xff); - // ueberlese noch die schliessende Klammer + // overwrite the closing parenthesis if (bMethodOwnsToken) GetNextToken(); } if( nSkip ) { - SkipToken( nSkip ); // Ignore wieder zurueck + SkipToken( nSkip ); // Ignore back again bWeiter = FALSE; } } @@ -1391,7 +1362,7 @@ void SvxRTFParser::ReadTabAttr( int nToken, SfxItemSet& rSet ) } } while( bWeiter ); - // mit Defaults aufuellen fehlt noch !!! + // Fill with defaults is still missing! rSet.Put( aAttr ); SkipToken( -1 ); } @@ -1401,7 +1372,7 @@ static void SetBorderLine( int nBorderTyp, SvxBoxItem& rItem, { switch( nBorderTyp ) { - case RTF_BOX: // alle Stufen durchlaufen + case RTF_BOX: // run through all levels case RTF_BRDRT: rItem.SetLine( &rBorder, BOX_LINE_TOP ); @@ -1428,13 +1399,13 @@ static void SetBorderLine( int nBorderTyp, SvxBoxItem& rItem, void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet, int bTableDef ) { - // dann lese doch mal das BoderAttribut ein + // then read the border attribute SvxBoxItem aAttr( PARDID->nBox ); const SfxPoolItem* pItem; if( SFX_ITEM_SET == rSet.GetItemState( PARDID->nBox, FALSE, &pItem ) ) aAttr = *(SvxBoxItem*)pItem; - SvxBorderLine aBrd( 0, DEF_LINE_WIDTH_0, 0, 0 ); // einfache Linien + SvxBorderLine aBrd( 0, DEF_LINE_WIDTH_0, 0, 0 ); // simple lines int bWeiter = TRUE, nBorderTyp = 0; do { @@ -1471,7 +1442,7 @@ void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet, SETBORDER: { - // auf defaults setzen + // set to defaults aBrd.SetOutWidth( DEF_LINE_WIDTH_0 ); aBrd.SetInWidth( 0 ); aBrd.SetDistance( 0 ); @@ -1480,7 +1451,7 @@ SETBORDER: break; -// werden noch nicht ausgewertet +// yet to be evaluated case RTF_BRSP: { switch( nBorderTyp ) @@ -1532,7 +1503,7 @@ case RTF_BRDRBAR: break; goto SETBORDERLINE; case RTF_BRDRSH: - // schattierte Box + // shaded box { rSet.Put( SvxShadowItem( PARDID->nShadow, (Color*) 0, 60 /*3pt*/, SVX_SHADOW_BOTTOMRIGHT ) ); @@ -1542,14 +1513,14 @@ case RTF_BRDRBAR: break; case RTF_BRDRW: if( -1 != nTokenValue ) { - // sollte es eine "dicke" Linie sein ? + // It should be a "thick" line? if( DEF_LINE_WIDTH_0 != aBrd.GetOutWidth() ) nTokenValue *= 2; - // eine Doppelline? + // a double line? if( aBrd.GetInWidth() ) { - // WinWord - Werte an StarOffice anpassen + // WinWord - adapt values to StarOffice if( nTokenValue < DEF_LINE_WIDTH_1 - (DEF_LINE_WIDTH_1/10)) { aBrd.SetOutWidth( DEF_DOUBLE_LINE0_OUT ); @@ -1572,7 +1543,7 @@ case RTF_BRDRBAR: break; } else { - // WinWord - Werte an StarOffice anpassen + // WinWord - adapt values to StarOffice if( nTokenValue < DEF_LINE_WIDTH_1 - (DEF_LINE_WIDTH_1/10)) aBrd.SetOutWidth( DEF_LINE_WIDTH_0 ); else @@ -1667,16 +1638,15 @@ SETBORDERLINE: } } while( bSwgControl ); - // Ende der Swg-Gruppe - // -> lese noch die schliessende Klammer + // End of the Swg-Group + // -> still read the closing parenthesis if( BRACERIGHT == nToken ) ; else if( !bFirstToken ) { - // es ist ein Parser-Fehler, springe zum - // Ende der Gruppe + // It is a parser error, jump to the end of the group SkipGroup(); - // schliessende BRACERIGHT ueberspringen + // Disregard closing BRACERIGHT GetNextToken(); } else @@ -1685,7 +1655,7 @@ SETBORDERLINE: if( nSkip ) { - SkipToken( nSkip ); // Ignore wieder zurueck + SkipToken( nSkip ); // Ignore back again bWeiter = FALSE; } } @@ -1711,7 +1681,7 @@ inline ULONG CalcShading( ULONG nColor, ULONG nFillColor, BYTE nShading ) void SvxRTFParser::ReadBackgroundAttr( int nToken, SfxItemSet& rSet, int bTableDef ) { - // dann lese doch mal das BoderAttribut ein + // then read the border attribute int bWeiter = TRUE; USHORT nColor = USHRT_MAX, nFillColor = USHRT_MAX; BYTE nFillValue = 0; @@ -1798,7 +1768,7 @@ void SvxRTFParser::ReadBackgroundAttr( int nToken, SfxItemSet& rSet, Color aCol( COL_WHITE ), aFCol; if( !nFillValue ) { - // es wurde nur eine von beiden Farben angegeben oder kein BrushTyp + // there was only one of two colors specified or no BrushTyp if( USHRT_MAX != nFillColor ) { nFillValue = 100; @@ -1837,7 +1807,7 @@ void SvxRTFParser::ReadBackgroundAttr( int nToken, SfxItemSet& rSet, // pard / plain abarbeiten void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) { - if( !bNewGroup && aAttrStack.Top() ) // nicht am Anfang einer neuen Gruppe + if( !bNewGroup && aAttrStack.Top() ) // not at the beginning of a new group { SvxRTFItemStackType* pAkt = aAttrStack.Top(); @@ -1849,11 +1819,11 @@ void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) { if( pAkt->aAttrSet.Count() || pAkt->pChildList || pAkt->nStyleNo ) { - // eine neue Gruppe aufmachen + // open a new group SvxRTFItemStackType* pNew = new SvxRTFItemStackType( *pAkt, *pInsPos, TRUE ); pNew->SetRTFDefaults( GetRTFDefaults() ); - // alle bis hierher gueltigen Attribute "setzen" + // Set all until here valid attributes AttrGroupEnd(); pAkt = aAttrStack.Top(); // can be changed after AttrGroupEnd! pNew->aAttrSet.SetParent( pAkt ? &pAkt->aAttrSet : 0 ); @@ -1862,13 +1832,13 @@ void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) } else { - // diesen Eintrag als neuen weiterbenutzen + // continue to use this entry as new pAkt->SetStartPos( *pInsPos ); bNewStkEntry = FALSE; } } - // jetzt noch alle auf default zuruecksetzen + // now reset all to default if( bNewStkEntry && ( pAkt->aAttrSet.GetParent() || pAkt->aAttrSet.Count() )) { @@ -1890,10 +1860,7 @@ void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) for( USHORT n = 0; n < nCnt; ++n, ++pPtr ) { - // Item gesetzt und unterschiedlich -> das Pooldefault setzen - //JP 06.04.98: bei Items die nur SlotItems sind, darf nicht - // auf das Default zugefriffen werden. Diese - // werden gecleart + // Item set and different -> Set the Default Pool if( !*pPtr ) ; else if( SFX_WHICH_MAX < *pPtr ) @@ -1923,7 +1890,7 @@ void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) } } else if( bPard ) - pAkt->nStyleNo = 0; // Style-Nummer zuruecksetzen + pAkt->nStyleNo = 0; // reset Style number *ppSet = &pAkt->aAttrSet; @@ -1969,7 +1936,7 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) case RTF_ADEFLANG: bIsLeftToRightDef = FALSE; // no break! case RTF_DEFLANG: - // default Language merken + // store default Language if( -1 != nValue ) { SvxLanguageItem aTmpItem( (const LanguageType)nValue, @@ -1981,45 +1948,22 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) case RTF_DEFTAB: if( PARDID->nTabStop ) { - // RTF definiert 720 twips als default + // RTF defines 720 twips as default bIsSetDfltTab = TRUE; if( -1 == nValue || !nValue ) nValue = 720; - // wer keine Twips haben moechte ... + // who would like to have no twips ... if( IsCalcValue() ) { nTokenValue = nValue; CalcValue(); nValue = nTokenValue; } -#if 1 - /* - cmc: - This stuff looks a little hairy indeed, this should be totally - unnecessary where default tabstops are understood. Just make one - tabstop and stick the value in there, the first one is all that - matters. - - e.g. - - SvxTabStopItem aNewTab(1, USHORT(nValue), SVX_TAB_ADJUST_DEFAULT, - PARDID->nTabStop); - ((SvxTabStop&)aNewTab[0]).GetAdjustment() = SVX_TAB_ADJUST_DEFAULT; - - - It must exist as a foul hack to support somebody that does not - have a true concept of default tabstops by making a tabsetting - result from the default tabstop, creating a lot of them all at - the default locations to give the effect of the first real - default tabstop being in use just in case the receiving - application doesn't do that for itself. - */ -#endif - // Verhaeltnis der def. TabWidth / Tabs errechnen und - // enstsprechend die neue Anzahl errechnen. - // ?? wie kommt man auf die 13 ?? + // Calculate the ratio of default TabWidth / Tabs and + // calculate the corresponding new number. + // ?? how did one come up with 13 ?? USHORT nAnzTabs = (SVX_TAB_DEFDIST * 13 ) / USHORT(nValue); /* cmc, make sure we have at least one, or all hell breaks loose in @@ -2028,7 +1972,7 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) if (nAnzTabs < 1) nAnzTabs = 1; - // wir wollen Defaulttabs + // we want Defaulttabs SvxTabStopItem aNewTab( nAnzTabs, USHORT(nValue), SVX_TAB_ADJUST_DEFAULT, PARDID->nTabStop ); while( nAnzTabs ) @@ -2054,12 +1998,12 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) } } -// default: keine Umrechnung, alles bei Twips lassen. +// default: no conversion, leaving everything in twips. void SvxRTFParser::CalcValue() { } - // fuer Tokens, die im ReadAttr nicht ausgewertet werden +// for tokens that are not evaluated in ReadAttr void SvxRTFParser::UnknownAttrToken( int, SfxItemSet* ) { } diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 5bd1f0c..aaeaf63 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -74,7 +74,7 @@ CharSet lcl_GetDefaultTextEncodingForRTF() return RTL_TEXTENCODING_MS_1252; } -// -------------- Methoden -------------------- +// -------------- Methods -------------------- SvxRTFParser::SvxRTFParser( SfxItemPool& rPool, SvStream& rIn, uno::Reference i_xDocProps, @@ -147,7 +147,7 @@ void SvxRTFParser::SetInsPos( const SvxPosition& rNew ) SvParserState SvxRTFParser::CallParser() { - DBG_ASSERT( pInsPos, "keine Einfuegeposition" ); + DBG_ASSERT( pInsPos, "no insertion position"); if( !pInsPos ) return SVPAR_ERROR; @@ -167,7 +167,7 @@ SvParserState SvxRTFParser::CallParser() sBaseURL.Erase(); - // erzeuge aus den gesetzten WhichIds die richtige WhichId-Tabelle. + // generate the correct WhichId table from the set WhichIds. BuildWhichTbl(); return SvRTFParser::CallParser(); @@ -186,7 +186,7 @@ void SvxRTFParser::Continue( int nToken ) } -// wird fuer jedes Token gerufen, das in CallParser erkannt wird +// is called for each token that is recognized in CallParser void SvxRTFParser::NextToken( int nToken ) { sal_Unicode cCh; @@ -200,10 +200,10 @@ void SvxRTFParser::NextToken( int nToken ) if( bNewDoc ) { if( aFontTbl.Count() ) - // koennen wir sofort setzen + // Can immediately be set SetDefault( nToken, nTokenValue ); else - // wird nach einlesen der Fonttabelle gesetzt + // is set after reading the font table nDfltFont = int(nTokenValue); } break; @@ -232,11 +232,11 @@ INSINGLECHAR: aToken = ByteString::ConvertToUnicode( (sal_Char)cCh, RTL_TEXTENCODING_MS_1252 ); - // kein Break, aToken wird als Text gesetzt + // no Break, aToken is set as Text case RTF_TEXTTOKEN: { InsertText(); - // alle angesammelten Attribute setzen + // all collected Attributes are set for( USHORT n = aAttrSetList.Count(); n; ) { SvxRTFItemStackType* pStkSet = aAttrSetList[--n]; @@ -251,13 +251,13 @@ INSINGLECHAR: InsertPara(); break; case '{': - if (bNewGroup) // Verschachtelung !! + if (bNewGroup) // Nesting! _GetAttrSet(); EnterEnvironment(); bNewGroup = true; break; case '}': - if( !bNewGroup ) // leere Gruppe ?? + if( !bNewGroup ) // Empty Group ?? AttrGroupEnd(); LeaveEnvironment(); bNewGroup = false; @@ -272,9 +272,9 @@ INSINGLECHAR: break; // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // erstmal gesamt ueberlesen (muessen alle in einer Gruppe stehen !!) - // Koennen auch ohne dem IGNORE-Flag im RTF-File auftreten; alle Gruppen - // mit IGNORE-Flag werden im default-Zweig ueberlesen. + // First overwrite all (all have to be in one group!!) + // Could also appear in the RTF-filewithout the IGNORE-Flag; all Groups + // with the IGNORE-Flag are overwritten in the default branch. case RTF_SWG_PRTDATA: case RTF_FIELD: @@ -345,20 +345,20 @@ void SvxRTFParser::ReadStyleTable() { int nToken, bSaveChkStyleAttr = bChkStyleAttr; short nStyleNo = 0; - int _nOpenBrakets = 1; // die erste wurde schon vorher erkannt !! + int _nOpenBrakets = 1; // the first was already detected earlier!! SvxRTFStyleType* pStyle = new SvxRTFStyleType( *pAttrPool, aWhichMap.GetData() ); pStyle->aAttrSet.Put( GetRTFDefaults() ); bIsInReadStyleTab = TRUE; - bChkStyleAttr = FALSE; // Attribute nicht gegen die Styles checken + bChkStyleAttr = FALSE; // Do not check Attribute against the Styles while( _nOpenBrakets && IsParserWorking() ) { switch( nToken = GetNextToken() ) { case '}': if( --_nOpenBrakets && IsParserWorking() ) - // Style konnte vollstaendig gelesen werden, - // also ist das noch ein stabiler Status + // Style has been completely read, + // so this is still a stable status SaveState( RTF_STYLESHEET ); break; case '{': @@ -370,7 +370,7 @@ void SvxRTFParser::ReadStyleTable() nToken = SkipToken( -2 ); else { - // gleich herausfiltern + // filter out at once ReadUnknownData(); nToken = GetNextToken(); if( '}' != nToken ) @@ -394,19 +394,13 @@ void SvxRTFParser::ReadStyleTable() { pStyle->sName = DelCharAtEnd( aToken, ';' ); -/* -??? soll man das umsetzen ??? - if( !pStyle->sName.Len() ) - pStyle->sName = "Standard"; -*/ - // sollte die Nummer doppelt vergeben werden ? if( aStyleTbl.Count() ) { SvxRTFStyleType* pOldSt = aStyleTbl.Remove( nStyleNo ); if( pOldSt ) delete pOldSt; } - // alle Daten vom Style vorhanden, also ab in die Tabelle + // All data from the font is available, so off to the table aStyleTbl.Insert( nStyleNo, pStyle ); pStyle = new SvxRTFStyleType( *pAttrPool, aWhichMap.GetData() ); pStyle->aAttrSet.Put( GetRTFDefaults() ); @@ -440,10 +434,10 @@ void SvxRTFParser::ReadStyleTable() break; } } - delete pStyle; // loesche das letze Style - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + delete pStyle; // Delete the Last Style + SkipToken( -1 ); // the closing brace is evaluated "above" - // Flag wieder auf alten Zustand + // Flag back to old state bChkStyleAttr = bSaveChkStyleAttr; bIsInReadStyleTab = FALSE; } @@ -461,19 +455,19 @@ void SvxRTFParser::ReadColorTable() case RTF_GREEN: nGreen = BYTE(nTokenValue); break; case RTF_BLUE: nBlue = BYTE(nTokenValue); break; - case RTF_TEXTTOKEN: // oder sollte irgendein Unsin darumstehen? + case RTF_TEXTTOKEN: if( 1 == aToken.Len() ? aToken.GetChar( 0 ) != ';' : STRING_NOTFOUND == aToken.Search( ';' ) ) - break; // es muss zumindestens das ';' gefunden werden + break; // At least the ';' must be found - // else kein break !! + // else no break !! case ';': if( IsParserWorking() ) { - // eine Farbe ist Fertig, in die Tabelle eintragen - // versuche die Werte auf SV interne Namen zu mappen + // one color is finished, fill in the table + // try to map the values to SV internal names ColorPtr pColor = new Color( nRed, nGreen, nBlue ); if( !aColorTbl.Count() && BYTE(-1) == nRed && BYTE(-1) == nGreen && BYTE(-1) == nBlue ) @@ -481,20 +475,20 @@ void SvxRTFParser::ReadColorTable() aColorTbl.Insert( pColor, aColorTbl.Count() ); nRed = 0, nGreen = 0, nBlue = 0; - // Color konnte vollstaendig gelesen werden, - // also ist das noch ein stabiler Status + // Color has been completely read, + // so this is still a stable status SaveState( RTF_COLORTBL ); } break; } } - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + SkipToken( -1 ); // the closing brace is evaluated "above" } void SvxRTFParser::ReadFontTable() { int nToken; - int _nOpenBrakets = 1; // die erste wurde schon vorher erkannt !! + int _nOpenBrakets = 1; // the first was already detected earlier!! Font* pFont = new Font(); short nFontNo(0), nInsFontNo (0); String sAltNm, sFntNm; @@ -511,8 +505,8 @@ void SvxRTFParser::ReadFontTable() { case '}': bIsAltFntNm = FALSE; - // Style konnte vollstaendig gelesen werden, - // also ist das noch ein stabiler Status + // Style has been completely read, + // so this is still a stable status if( --_nOpenBrakets <= 1 && IsParserWorking() ) SaveState( RTF_FONTTBL ); bCheckNewFont = TRUE; @@ -521,15 +515,15 @@ void SvxRTFParser::ReadFontTable() case '{': if( RTF_IGNOREFLAG != GetNextToken() ) nToken = SkipToken( -1 ); - // Unknown und alle bekannten nicht ausgewerteten Gruppen - // sofort ueberspringen + // immediately skip unknown and all known but non-evaluated + // groups else if( RTF_UNKNOWNCONTROL != ( nToken = GetNextToken() ) && RTF_PANOSE != nToken && RTF_FNAME != nToken && RTF_FONTEMB != nToken && RTF_FONTFILE != nToken ) nToken = SkipToken( -2 ); else { - // gleich herausfiltern + // filter out at once ReadUnknownData(); nToken = GetNextToken(); if( '}' != nToken ) @@ -553,7 +547,7 @@ void SvxRTFParser::ReadFontTable() case RTF_FDECOR: pFont->SetFamily( FAMILY_DECORATIVE ); break; - // bei technischen/symbolischen Font wird der CharSet ungeschaltet!! + // for technical/symbolic font of the CharSet is changed! case RTF_FTECH: pFont->SetCharSet( RTL_TEXTENCODING_SYMBOL ); // deliberate fall through @@ -606,7 +600,7 @@ void SvxRTFParser::ReadFontTable() if( bCheckNewFont && 1 >= _nOpenBrakets && sFntNm.Len() ) // one font is ready { - // alle Daten vom Font vorhanden, also ab in die Tabelle + // All data from the font is available, so off to the table if (sAltNm.Len()) (sFntNm += ';' ) += sAltNm; @@ -618,11 +612,11 @@ void SvxRTFParser::ReadFontTable() sFntNm.Erase(); } } - // den letzen muessen wir selbst loeschen + // the last one we have to delete manually delete pFont; - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + SkipToken( -1 ); // the closing brace is evaluated "above" - // setze den default Font am Doc + // set the default font in the Document if( bNewDoc && IsParserWorking() ) SetDefault( RTF_DEFF, nDfltFont ); } @@ -640,7 +634,7 @@ void SvxRTFParser::ReadOLEData() String& SvxRTFParser::GetTextToEndGroup( String& rStr ) { rStr.Erase( 0 ); - int _nOpenBrakets = 1, nToken; // die erste wurde schon vorher erkannt !! + int _nOpenBrakets = 1, nToken; // the first was already detected earlier!! while( _nOpenBrakets && IsParserWorking() ) { @@ -655,7 +649,7 @@ String& SvxRTFParser::GetTextToEndGroup( String& rStr ) nToken = SkipToken( -2 ); else { - // gleich herausfiltern + // filter out at once ReadUnknownData(); nToken = GetNextToken(); if( '}' != nToken ) @@ -671,7 +665,7 @@ String& SvxRTFParser::GetTextToEndGroup( String& rStr ) break; } } - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + SkipToken( -1 ); // the closing brace is evaluated "above" return rStr; } @@ -693,14 +687,14 @@ util::DateTime SvxRTFParser::GetDateTimeStamp( ) bWeiter = FALSE; } } - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + SkipToken( -1 ); // the closing brace is evaluated "above" return aDT; } void SvxRTFParser::ReadInfo( const sal_Char* pChkForVerNo ) { #ifndef SVX_LIGHT - int _nOpenBrakets = 1, nToken; // die erste wurde schon vorher erkannt !! + int _nOpenBrakets = 1, nToken; // the first was already detected earlier!! DBG_ASSERT(m_xDocProps.is(), "SvxRTFParser::ReadInfo: no DocumentProperties"); String sStr, sComment; @@ -719,7 +713,7 @@ void SvxRTFParser::ReadInfo( const sal_Char* pChkForVerNo ) nToken = SkipToken( -2 ); else { - // gleich herausfiltern + // filter out at once ReadUnknownData(); nToken = GetNextToken(); if( '}' != nToken ) @@ -798,7 +792,7 @@ void SvxRTFParser::ReadInfo( const sal_Char* pChkForVerNo ) COMPARE_EQUAL == sComment.CompareToAscii( pChkForVerNo )) nVersionNo = nVersNo; - SkipToken( -1 ); // die schliesende Klammer wird "oben" ausgewertet + SkipToken( -1 ); // the closing brace is evaluated "above" #endif } @@ -893,35 +887,32 @@ void SvxRTFParser::_ClearStyleAttr( SvxRTFItemStackType& rStkType ) if( SFX_WHICH_MAX > nWhich && SFX_ITEM_SET == rSet.GetItemState( nWhich, FALSE, &pItem ) && rPool.GetDefaultItem( nWhich ) == *pItem ) - rSet.ClearItem( nWhich ); // loeschen + rSet.ClearItem( nWhich ); // delete } } else { - // alle Attribute, die schon vom Style definiert sind, aus dem - // akt. AttrSet entfernen + // Delete all Attributes, which are already defined in the Style, + // from the current AttrSet. SfxItemSet &rStyleSet = pStyle->aAttrSet; const SfxPoolItem* pSItem; for( USHORT nWhich = aIter.GetCurWhich(); nWhich; nWhich = aIter.NextWhich() ) { if( SFX_ITEM_SET == rStyleSet.GetItemState( nWhich, TRUE, &pSItem )) { - // JP 22.06.99: im Style und im Set gleich gesetzt -> loeschen if( SFX_ITEM_SET == rSet.GetItemState( nWhich, FALSE, &pItem ) && *pItem == *pSItem ) - rSet.ClearItem( nWhich ); // loeschen + rSet.ClearItem( nWhich ); // delete } - // Bug 59571 - falls nicht im Style gesetzt und gleich mit - // dem PoolDefault -> auch dann loeschen else if( SFX_WHICH_MAX > nWhich && SFX_ITEM_SET == rSet.GetItemState( nWhich, FALSE, &pItem ) && rPool.GetDefaultItem( nWhich ) == *pItem ) - rSet.ClearItem( nWhich ); // loeschen + rSet.ClearItem( nWhich ); // delete } } } -void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen +void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack { if( aAttrStack.Count() ) { @@ -934,9 +925,9 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen ((!pOld->aAttrSet.Count() && !pOld->nStyleNo ) || (nOldSttNdIdx == pInsPos->GetNodeIdx() && pOld->nSttCnt == pInsPos->GetCntIdx() ))) - break; // keine Attribute oder Bereich + break; // no attributes or Area - // setze nur die Attribute, die unterschiedlich zum Parent sind + // set only the attributes that are different from the parent if( pAkt && pOld->aAttrSet.Count() ) { SfxItemIter aIter( pOld->aAttrSet ); @@ -958,19 +949,17 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen break; } - // setze alle Attribute, die von Start bis hier - // definiert sind. + // Set all attributes which have been defined from start until here int bCrsrBack = !pInsPos->GetCntIdx(); if( bCrsrBack ) { - // am Absatzanfang ? eine Position zurueck + // at the beginning of a paragraph? Move back one position ULONG nNd = pInsPos->GetNodeIdx(); MovePos( FALSE ); // if can not move backward then later dont move forward ! bCrsrBack = nNd != pInsPos->GetNodeIdx(); } - //Bug #46608#: ungueltige Bereiche ignorieren! if( ( pOld->pSttNd->GetIdx() < pInsPos->GetNodeIdx() || ( pOld->pSttNd->GetIdx() == pInsPos->GetNodeIdx() && pOld->nSttCnt <= pInsPos->GetCntIdx() )) @@ -978,37 +967,36 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen { if( !bCrsrBack ) { - // alle pard-Attribute gelten nur bis zum vorherigen - // Absatz !! + // all pard attributes are only valid until the previous + // paragraph !! if( nOldSttNdIdx == pInsPos->GetNodeIdx() ) { } else { - // jetzt wirds kompliziert: - // - alle Zeichen-Attribute behalten den Bereich, - // - alle Absatz-Attribute bekommen den Bereich - // bis zum vorherigen Absatz + // Now it gets complicated: + // - all character attributes sre keep the area + // - all paragraph attributes to get the area + // up to the previous paragraph SvxRTFItemStackType* pNew = new SvxRTFItemStackType( *pOld, *pInsPos, TRUE ); pNew->aAttrSet.SetParent( pOld->aAttrSet.GetParent() ); - // loesche aus pNew alle Absatz Attribute + // Delete all paragraph attributes from pNew for( USHORT n = 0; n < aPardMap.Count() && pNew->aAttrSet.Count(); ++n ) if( aPardMap[n] ) pNew->aAttrSet.ClearItem( aPardMap[n] ); pNew->SetRTFDefaults( GetRTFDefaults() ); - // gab es ueberhaupt welche ? + // Were there any? if( pNew->aAttrSet.Count() == pOld->aAttrSet.Count() ) - delete pNew; // das wars dann + delete pNew; else { pNew->nStyleNo = 0; - // spanne jetzt den richtigen Bereich auf - // pNew von alter + // Now span the real area of pNew from old SetEndPrevPara( pOld->pEndNd, pOld->nEndCnt ); pNew->nSttCnt = 0; @@ -1025,14 +1013,14 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen } else { - // letzter vom Stack, also zwischenspeichern, bis der - // naechste Text eingelesen wurde. (keine Attribute - // aufspannen!!) + // Last off the stack, thus cache it until the next text was + // read. (Span no attributes!) + aAttrSetList.Insert( pOld, aAttrSetList.Count() ); aAttrSetList.Insert( pNew, aAttrSetList.Count() ); } - pOld = 0; // pOld nicht loeschen - break; // das wars !! + pOld = 0; // Do not delete pOld + break; } } } @@ -1060,16 +1048,16 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen // to create a "so long" depend list. Bug 95010 if( bCrsrBack && 50 < pAkt->pChildList->Count() ) { - // am Absatzanfang ? eine Position zurueck + // at the beginning of a paragraph? Move back one position MovePos( TRUE ); bCrsrBack = FALSE; - // eine neue Gruppe aufmachen + // Open a new Group. SvxRTFItemStackType* pNew = new SvxRTFItemStackType( *pAkt, *pInsPos, TRUE ); pNew->SetRTFDefaults( GetRTFDefaults() ); - // alle bis hierher gueltigen Attribute "setzen" + // Set all until here valid Attributes AttrGroupEnd(); pAkt = aAttrStack.Top(); // can be changed after AttrGroupEnd! pNew->aAttrSet.SetParent( pAkt ? &pAkt->aAttrSet : 0 ); @@ -1078,16 +1066,15 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen } } else - // letzter vom Stack, also zwischenspeichern, bis der - // naechste Text eingelesen wurde. (keine Attribute - // aufspannen!!) + // Last off the stack, thus cache it until the next text was + // read. (Span no attributes!) aAttrSetList.Insert( pOld, aAttrSetList.Count() ); pOld = 0; } if( bCrsrBack ) - // am Absatzanfang ? eine Position zurueck + // at the beginning of a paragraph? Move back one position MovePos( TRUE ); } while( FALSE ); @@ -1101,7 +1088,7 @@ void SvxRTFParser::AttrGroupEnd() // den akt. Bearbeiten, vom Stack loeschen void SvxRTFParser::SetAllAttrOfStk() // end all Attr. and set it into doc { - // noch alle Attrbute vom Stack holen !! + // Yet to get all Attrbutes from the stack! while( aAttrStack.Count() ) AttrGroupEnd(); @@ -1113,10 +1100,10 @@ void SvxRTFParser::SetAllAttrOfStk() // end all Attr. and set it into doc } } -// setzt alle Attribute, die unterschiedlich zum aktuellen sind +// sets all the attributes that are different from the current void SvxRTFParser::SetAttrSet( SvxRTFItemStackType &rSet ) { - // wurde DefTab nie eingelesen? dann setze auf default + // Was DefTab never read? then set to default if( !bIsSetDfltTab ) SetDefault( RTF_DEFTAB, 720 ); @@ -1125,13 +1112,13 @@ void SvxRTFParser::SetAttrSet( SvxRTFItemStackType &rSet ) if( rSet.aAttrSet.Count() || rSet.nStyleNo ) SetAttrInDoc( rSet ); - // dann mal alle Childs abarbeiten + // then process all the children if( rSet.pChildList ) for( USHORT n = 0; n < rSet.pChildList->Count(); ++n ) SetAttrSet( *(*rSet.pChildList)[ n ] ); } - // wurde noch kein Text eingefuegt ? (SttPos vom obersten StackEintrag!) + // Has no Text been inserted yet? (SttPos from the top Stack entry!) int SvxRTFParser::IsAttrSttPos() { SvxRTFItemStackType* pAkt = aAttrStack.Top(); @@ -1162,9 +1149,9 @@ void SvxRTFParser::BuildWhichTbl() aWhichMap.Remove( 0, aWhichMap.Count() ); aWhichMap.Insert( (USHORT)0, (USHORT)0 ); - // Aufbau einer Which-Map 'rWhichMap' aus einem Array von - // 'pWhichIds' von Which-Ids. Es hat die Lange 'nWhichIds'. - // Die Which-Map wird nicht geloescht. + // Building a Which-Map 'rWhichMap' from an Array of + // 'pWhichIds' frm Which-Ids. It has the long 'nWhichIds'. + // The Which-Map is not going to be deleted. SvParser::BuildWhichTbl( aWhichMap, (USHORT*)aPardMap.GetData(), aPardMap.Count() ); SvParser::BuildWhichTbl( aWhichMap, (USHORT*)aPlainMap.GetData(), aPlainMap.Count() ); } @@ -1192,9 +1179,9 @@ const SfxItemSet& SvxRTFParser::GetRTFDefaults() SvxRTFStyleType::SvxRTFStyleType( SfxItemPool& rPool, const USHORT* pWhichRange ) : aAttrSet( rPool, pWhichRange ) { - nOutlineNo = BYTE(-1); // nicht gesetzt + nOutlineNo = BYTE(-1); // not set nBasedOn = 0; - bBasedOnIsSet = FALSE; //$flr #117411# + bBasedOnIsSet = FALSE; nNext = 0; bIsCharFmt = FALSE; } @@ -1292,7 +1279,7 @@ bool SvxRTFParser::UncompressableStackEntry(const SvxRTFItemStackType &) const void SvxRTFItemStackType::Compress( const SvxRTFParser& rParser ) { - DBG_ASSERT( pChildList, "es gibt keine ChildListe" ); + DBG_ASSERT( pChildList, "There is no child list" ); USHORT n; SvxRTFItemStackType* pTmp = (*pChildList)[0]; @@ -1329,7 +1316,7 @@ void SvxRTFItemStackType::Compress( const SvxRTFParser& rParser ) if( n ) { - // suche alle, die ueber den gesamten Bereich gesetzt sind + // Search for all which are set over the whole area SfxItemIter aIter( aMrgSet ); const SfxPoolItem* pItem; do { @@ -1354,7 +1341,7 @@ void SvxRTFItemStackType::Compress( const SvxRTFParser& rParser ) if( pEndNd->GetIdx() != pLastNd->GetIdx() || nEndCnt != nLastCnt ) return; - // es kann zusammengefasst werden + // It can be merged aAttrSet.Put( aMrgSet ); for( n = 0; n < pChildList->Count(); ++n ) diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx index d186a3c..55754f7 100644 --- a/editeng/source/uno/unoedhlp.cxx +++ b/editeng/source/uno/unoedhlp.cxx @@ -185,14 +185,12 @@ Point SvxEditSourceHelper::UserSpaceToEE( const Point& rPoint, const Size& rEESi Rectangle SvxEditSourceHelper::EEToUserSpace( const Rectangle& rRect, const Size& rEESize, bool bIsVertical ) { - // #106775# Don't touch rect if not vertical return bIsVertical ? Rectangle( EEToUserSpace(rRect.BottomLeft(), rEESize, bIsVertical), EEToUserSpace(rRect.TopRight(), rEESize, bIsVertical) ) : rRect; } Rectangle SvxEditSourceHelper::UserSpaceToEE( const Rectangle& rRect, const Size& rEESize, bool bIsVertical ) { - // #106775# Don't touch rect if not vertical return bIsVertical ? Rectangle( UserSpaceToEE(rRect.TopRight(), rEESize, bIsVertical), UserSpaceToEE(rRect.BottomLeft(), rEESize, bIsVertical) ) : rRect; } diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx index 51ba135..053f871 100644 --- a/editeng/source/uno/unofored.cxx +++ b/editeng/source/uno/unofored.cxx @@ -39,7 +39,7 @@ #include #include #include -#include // nur fuer die GetText-Kruecke +#include // only for the GetText crutch #include @@ -54,7 +54,7 @@ SvxEditEngineForwarder::SvxEditEngineForwarder( EditEngine& rEngine ) : SvxEditEngineForwarder::~SvxEditEngineForwarder() { - // die EditEngine muss ggf. von aussen geloescht werden + // the EditEngine may need to be deleted from the outside } USHORT SvxEditEngineForwarder::GetParagraphCount() const @@ -428,7 +428,6 @@ OutputDevice* SvxEditEngineForwarder::GetRefDevice() const sal_Bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, USHORT& nPara, USHORT& nIndex ) const { - // #101701# Size aSize( rEditEngine.CalcTextWidth(), rEditEngine.GetTextHeight() ); ::std::swap( aSize.Width(), aSize.Height() ); Point aEEPos( SvxEditSourceHelper::UserSpaceToEE( rPos, diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx index a7b67a3..4544fd3 100644 --- a/editeng/source/uno/unoforou.cxx +++ b/editeng/source/uno/unoforou.cxx @@ -76,8 +76,8 @@ USHORT SvxOutlinerForwarder::GetTextLen( USHORT nParagraph ) const String SvxOutlinerForwarder::GetText( const ESelection& rSel ) const { - //! GetText(ESelection) sollte es wohl auch mal am Outliner geben - // solange den Hack fuer die EditEngine uebernehmen: + //! GetText (ESelection) should probably also be in the Outliner + // in the time beeing use as the hack for the EditEngine: EditEngine* pEditEngine = (EditEngine*)&rOutliner.GetEditEngine(); return pEditEngine->GetText( rSel, LINEEND_LF ); } @@ -128,8 +128,8 @@ SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, BOOL bOnlyH } } - //! gibt's das nicht am Outliner ??? - //! und warum ist GetAttribs an der EditEngine nicht const? + //! Does it not exist on the Outliner? + //! and why is the GetAttribs on the EditEngine not a const? EditEngine& rEditEngine = (EditEngine&)rOutliner.GetEditEngine(); SfxItemSet aSet( ImplOutlinerForwarderGetAttribs( rSel, bOnlyHardAttrib, rEditEngine ) ); @@ -305,7 +305,6 @@ EBulletInfo SvxOutlinerForwarder::GetBulletInfo( USHORT nPara ) const Rectangle SvxOutlinerForwarder::GetCharBounds( USHORT nPara, USHORT nIndex ) const { - // #101701# // EditEngine's 'internal' methods like GetCharacterBounds() // don't rotate for vertical text. Size aSize( rOutliner.CalcTextSize() ); @@ -358,7 +357,6 @@ Rectangle SvxOutlinerForwarder::GetParaBounds( USHORT nPara ) const if( rOutliner.IsVertical() ) { - // #101701# // Hargl. Outliner's 'external' methods return the rotated // dimensions, 'internal' methods like GetTextHeight( n ) // don't rotate. @@ -386,7 +384,6 @@ OutputDevice* SvxOutlinerForwarder::GetRefDevice() const sal_Bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, USHORT& nPara, USHORT& nIndex ) const { - // #101701# Size aSize( rOutliner.CalcTextSize() ); ::std::swap( aSize.Width(), aSize.Height() ); Point aEEPos( SvxEditSourceHelper::UserSpaceToEE( rPos, diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index 31c81aa..a2a8292 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -168,13 +168,13 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa if(!pMap || !pMap->nWID) return; - // item holen + // Get item const SfxPoolItem* pItem = 0; SfxPoolItem *pNewItem = 0; SfxItemState eState = rSet.GetItemState( pMap->nWID, sal_True, &pItem ); SfxItemPool* pPool = rSet.GetPool(); - // UnoAny in item-Wert stecken + // Put UnoAny in the item value if(eState < SFX_ITEM_DEFAULT || pItem == NULL) { if( pPool == NULL ) @@ -208,7 +208,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa if( pNewItem->PutValue( aValue, nMemberId ) ) { - // neues item in itemset setzen + // Set new item in item set rSet.Put( *pNewItem, pMap->nWID ); } delete pNewItem; @@ -218,25 +218,22 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa //---------------------------------------------------------------------- uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* pMap ) const { - // Schon ein Wert eingetragen? Dann schnell fertig + // Already entered a value? Then finish quickly uno::Any* pUsrAny = GetUsrAnyForID(pMap->nWID); if(pUsrAny) return *pUsrAny; - // Noch kein UsrAny gemerkt, generiere Default-Eintrag und gib - // diesen zurueck - + // No UsrAny detected yet, generate Default entry and return this const SfxMapUnit eMapUnit = mrItemPool.GetMetric((USHORT)pMap->nWID); BYTE nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM); if( eMapUnit == SFX_MAPUNIT_100TH_MM ) nMemberId &= (~CONVERT_TWIPS); - uno::Any aVal; SfxItemSet aSet( mrItemPool, pMap->nWID, pMap->nWID); if( (pMap->nWID < OWN_ATTR_VALUE_START) && (pMap->nWID > OWN_ATTR_VALUE_END ) ) { - // Default aus ItemPool holen + // Get Default from ItemPool if(mrItemPool.IsWhich(pMap->nWID)) aSet.Put(mrItemPool.GetDefaultItem(pMap->nWID)); } diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index a9c5dd6..cca9f8b 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -279,7 +279,7 @@ Sequence SvxUnoNumberingRules::getNumberingRuleByIndex( sa aVal <<= (sal_Int16)rFmt.GetBulletRelSize(); pArray[nIdx++] = beans::PropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM(UNO_NAME_NRULE_BULLET_RELSIZE)), -1, aVal, beans::PropertyState_DIRECT_VALUE); - DBG_ASSERT( nIdx <= nProps, "FixMe: Array uebergelaufen!!!! [CL]" ); + DBG_ASSERT( nIdx <= nProps, "FixMe: overflow in Array!!! [CL]" ); Sequence< beans::PropertyValue> aSeq(pArray, nIdx); delete [] pArray; diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 3acc7fe..7bcfe0e 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -72,7 +72,7 @@ const SvxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSvxPropertySet() const SfxItemPropertyMapEntry* ImplGetSvxTextPortionPropertyMap() { - // Propertymap fuer einen Outliner Text + // Propertymap for an Outliner Text static const SfxItemPropertyMapEntry aSvxTextPortionPropertyMap[] = { SVX_UNOEDIT_CHAR_PROPERTIES, @@ -101,7 +101,7 @@ const SfxItemPropertySet* ImplGetSvxTextPortionSfxPropertySet() const SfxItemPropertyMapEntry* ImplGetSvxUnoOutlinerTextCursorPropertyMap() { - // Propertymap fuer einen Outliner Text + // Propertymap for an Outliner Text static const SfxItemPropertyMapEntry aSvxUnoOutlinerTextCursorPropertyMap[] = { SVX_UNOEDIT_CHAR_PROPERTIES, @@ -122,7 +122,7 @@ const SfxItemPropertySet* ImplGetSvxUnoOutlinerTextCursorSfxPropertySet() } // ==================================================================== -// helper fuer Item/Property Konvertierung +// helper for Item/Property conversion // ==================================================================== void GetSelection( struct ESelection& rSel, SvxTextForwarder* pForwarder ) throw() @@ -444,14 +444,14 @@ void SAL_CALL SvxUnoTextRangeBase::setString(const OUString& aString) CheckSelection( maSelection, pForwarder ); String aConverted( aString ); - aConverted.ConvertLineEnd( LINEEND_LF ); // Zeilenenden nur einfach zaehlen + aConverted.ConvertLineEnd( LINEEND_LF ); // Simply count the number of line endings pForwarder->QuickInsertText( aConverted, maSelection ); mpEditSource->UpdateData(); - // Selektion anpassen - //! Wenn die EditEngine bei QuickInsertText die Selektion zurueckgeben wuerde, - //! waer's einfacher... + // Adapt selection + //! It would be easier if the EditEngine would return the selection + //! on QuickInsertText... CollapseToStart(); sal_uInt16 nLen = aConverted.Len(); @@ -538,9 +538,9 @@ void SvxUnoTextRangeBase::setPropertyValue( const SfxItemPropertySimpleEntry* pM { if(!SetPropertyValueHelper( rOldSet, pMap, rValue, rNewSet, &rSelection, GetEditSource() )) { - // Fuer Teile von zusammengesetzten Items mit mehreren Properties (z.B. Hintergrund) - // muss vorher das alte Item aus dem Dokument geholt werden - rNewSet.Put(rOldSet.Get(pMap->nWID)); // altes Item in neuen Set + // For parts of composite items with multiple properties (eg background) + // must be taken from the document before the old item. + rNewSet.Put(rOldSet.Get(pMap->nWID)); // Old Item in new Set mpPropSet->setPropertyValue(pMap, rValue, rNewSet, false ); } } @@ -658,7 +658,7 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::_getPropertyValue(const OUString& Propert else pAttribs = pForwarder->GetAttribs( GetSelection() ).Clone(); - // Dontcare durch Default ersetzen, damit man immer eine Reflection hat + // Replace Dontcare with Default, so that one always has a mirror pAttribs->ClearInvalidItems(); getPropertyValue( pMap, aAny, *pAttribs ); @@ -789,7 +789,7 @@ sal_Bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet& rSet, const S return sal_True; } -// wird (noch) nicht unterstuetzt +// is not (yet) supported void SAL_CALL SvxUnoTextRangeBase::addPropertyChangeListener( const OUString& , const uno::Reference< beans::XPropertyChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {} void SAL_CALL SvxUnoTextRangeBase::removePropertyChangeListener( const OUString& , const uno::Reference< beans::XPropertyChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {} void SAL_CALL SvxUnoTextRangeBase::addVetoableChangeListener( const OUString& , const uno::Reference< beans::XVetoableChangeListener >& ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {} @@ -1324,7 +1324,7 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::getPropertyDefault( const OUString& aProp default: { - // Default aus ItemPool holen + // Get Default from ItemPool if(pPool->IsWhich(pMap->nWID)) { SfxItemSet aSet( *pPool, pMap->nWID, pMap->nWID); @@ -1422,7 +1422,7 @@ sal_Bool SvxUnoTextRangeBase::GoLeft(sal_Int16 nCount, sal_Bool Expand) throw() else { if ( !pForwarder ) - pForwarder = mpEditSource->GetTextForwarder(); // erst hier, wenn's noetig ist... + pForwarder = mpEditSource->GetTextForwarder(); // first here, it it is necessary... --nNewPar; nCount -= nNewPos + 1; @@ -1451,7 +1451,7 @@ sal_Bool SvxUnoTextRangeBase::GoRight(sal_Int16 nCount, sal_Bool Expand) throw( CheckSelection( maSelection, pForwarder ); - sal_uInt16 nNewPos = maSelection.nEndPos + nCount; //! Ueberlauf ??? + sal_uInt16 nNewPos = maSelection.nEndPos + nCount; //! Overflow??? sal_uInt16 nNewPar = maSelection.nEndPara; sal_Bool bOk = sal_True; @@ -1758,15 +1758,14 @@ ESelection SvxUnoTextBase::InsertField( const SvxFieldItem& rField ) throw() pForwarder->QuickInsertField( rField, GetSelection() ); GetEditSource()->UpdateData(); - // Selektion anpassen - //! Wenn die EditEngine bei QuickInsertText die Selektion zurueckgeben wuerde, - //! waer's einfacher... - + // Adapt selection + //! It would be easier if the EditEngine would return the selection + //! on QuickInsertText... CollapseToStart(); - GoRight( 1, sal_True ); // Feld ist immer 1 Zeichen + GoRight( 1, sal_True ); // Field is always 1 character } - return GetSelection(); // Selektion mit dem Feld + return GetSelection(); // Selection with the field } // XInterface @@ -1891,11 +1890,12 @@ void SAL_CALL SvxUnoTextBase::insertString( const uno::Reference< text::XTextRan SvxUnoTextRangeBase* pRange = SvxUnoTextRange::getImplementation( xRange ); if(pRange) { - // setString am SvxUnoTextRangeBase statt selber QuickInsertText und UpdateData, - // damit die Selektion am SvxUnoTextRangeBase angepasst wird. - //! Eigentlich muessten alle Cursor-Objekte dieses Textes angepasst werden! + // setString on SvxUnoTextRangeBase instead of itself QuickInsertText + // and UpdateData, so that the selection will be adjusted to + // SvxUnoTextRangeBase. Actually all cursor objects of this Text must + // to be statement to be adapted! - if (!bAbsorb) // nicht ersetzen -> hinten anhaengen + if (!bAbsorb) // do not replace -> append on tail pRange->CollapseToEnd(); pRange->setString( aString ); @@ -1921,7 +1921,7 @@ void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< text { case text::ControlCharacter::PARAGRAPH_BREAK: { - const String aText( (sal_Unicode)13 ); // '\r' geht auf'm Mac nicht + const String aText( (sal_Unicode)13 ); // '\r' does not work on Mac insertString( xRange, aText, bAbsorb ); return; @@ -2530,7 +2530,7 @@ String SvxDummyTextSource::GetText( const ESelection& ) const SfxItemSet SvxDummyTextSource::GetAttribs( const ESelection&, BOOL ) const { - // AW: Very dangerous: The former implementation used a SfxItemPool created on the + // Very dangerous: The former implementation used a SfxItemPool created on the // fly which of course was deleted again ASAP. Thus, the returned SfxItemSet was using // a deleted Pool by design. return SfxItemSet(EditEngine::GetGlobalItemPool()); diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 5f4a19a..731aa8c 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -516,7 +516,8 @@ SvxUnoTextCursor::~SvxUnoTextCursor() throw() { } -// automatisch auskommentiert - [getIdlClass(es) or queryInterface] - Bitte XTypeProvider benutzen! +// Comment out automatically - [getIdlClass(es) or queryInterface] +// Please use the XTypeProvider! //sal_Bool SvxUnoTextCursor::queryInterface( uno::Uik aUIK, Reference< uno::XInterface > & xRef) uno::Any SAL_CALL SvxUnoTextCursor::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException) diff --git a/editeng/source/uno/unoviwou.cxx b/editeng/source/uno/unoviwou.cxx index 6c4c024..2117334 100644 --- a/editeng/source/uno/unoviwou.cxx +++ b/editeng/source/uno/unoviwou.cxx @@ -51,7 +51,7 @@ SvxDrawOutlinerViewForwarder::~SvxDrawOutlinerViewForwarder() Point SvxDrawOutlinerViewForwarder::GetTextOffset() const { - // #101029# calc text offset from shape anchor + // calc text offset from shape anchor Rectangle aOutputRect( mrOutlinerView.GetOutputArea() ); return aOutputRect.TopLeft() - maTextShapeTopLeft; @@ -70,7 +70,6 @@ Rectangle SvxDrawOutlinerViewForwarder::GetVisArea() const { Rectangle aVisArea = mrOutlinerView.GetVisArea(); - // #101029# Point aTextOffset( GetTextOffset() ); aVisArea.Move( aTextOffset.X(), aTextOffset.Y() ); @@ -100,7 +99,6 @@ Point SvxDrawOutlinerViewForwarder::LogicToPixel( const Point& rPoint, const Map Point aPoint1( rPoint ); Point aTextOffset( GetTextOffset() ); - // #101029# aPoint1.X() += aTextOffset.X(); aPoint1.Y() += aTextOffset.Y(); @@ -126,7 +124,6 @@ Point SvxDrawOutlinerViewForwarder::PixelToLogic( const Point& rPoint, const Map Point aPoint2( OutputDevice::LogicToLogic( aPoint1, aMapMode.GetMapUnit(), rMapMode ) ); - // #101029# Point aTextOffset( GetTextOffset() ); aPoint2.X() -= aTextOffset.X(); diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx index 5062aa7..5cc3b16 100644 --- a/editeng/source/xml/xmltxtexp.cxx +++ b/editeng/source/xml/xmltxtexp.cxx @@ -358,7 +358,6 @@ void SAL_CALL SvxSimpleUnoModel::removeEventListener( const ::com::sun::star::un class SvxXMLTextExportComponent : public SvXMLExport { public: - // #110680# SvxXMLTextExportComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, EditEngine* pEditEngine, @@ -381,7 +380,6 @@ private: /////////////////////////////////////////////////////////////////////// -// #110680# SvxXMLTextExportComponent::SvxXMLTextExportComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, EditEngine* pEditEngine, @@ -463,7 +461,6 @@ void SvxWriteXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& // export text const OUString aName; - // #110680# // SvxXMLTextExportComponent aExporter( &rEditEngine, rSel, aName, xHandler ); SvxXMLTextExportComponent aExporter( xServiceFactory, &rEditEngine, rSel, aName, xHandler ); diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx index 78f26b7..4fdbaf6 100644 --- a/editeng/source/xml/xmltxtimp.cxx +++ b/editeng/source/xml/xmltxtimp.cxx @@ -119,7 +119,6 @@ SvXMLImportContext *SvxXMLTextImportContext::CreateChildContext( USHORT nPrefix, class SvxXMLXTextImportComponent : public SvXMLImport { public: - // #110680# SvxXMLXTextImportComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, const uno::Reference< XText > & xText ); @@ -136,7 +135,6 @@ private: // -------------------------------------------------------------------- -// #110680# SvxXMLXTextImportComponent::SvxXMLXTextImportComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, const uno::Reference< XText > & xText ) @@ -227,7 +225,6 @@ void SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& r */ - // #110680# // uno::Reference< XDocumentHandler > xHandler( new SvxXMLXTextImportComponent( xText ) ); uno::Reference< XDocumentHandler > xHandler( new SvxXMLXTextImportComponent( xServiceFactory, xText ) );