diff options
Diffstat (limited to 'sw/inc/crsrsh.hxx')
-rw-r--r-- | sw/inc/crsrsh.hxx | 436 |
1 files changed, 197 insertions, 239 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 6dbb2fbc3fe7..b24d29742db2 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,21 +36,18 @@ #include <IShellCursorSupplier.hxx> #include "swdllapi.h" -#include <swtypes.hxx> // fuer SWPOSDOC -#include <viewsh.hxx> // fuer ViewShell -#include <calbck.hxx> // fuer SwClient -#include <cshtyp.hxx> // fuer die CursorShell Typen -#include <crstate.hxx> // fuer die CursorMove-Staties +#include <swtypes.hxx> // for SWPOSDOC +#include <viewsh.hxx> // for ViewShell +#include <calbck.hxx> // for SwClient +#include <cshtyp.hxx> // for CursorShell types +#include <crstate.hxx> // for CursorMove-States #include <toxe.hxx> // SwTOXSearchDir -#include <tblsel.hxx> //SwTblSearchType +#include <tblsel.hxx> // SwTblSearchType #include <viscrs.hxx> #include <node.hxx> #include <tblsel.hxx> #include <IDocumentMarkAccess.hxx> - -// einige Forward Deklarationen - class KeyCode; class SfxItemSet; class SfxPoolItem; @@ -75,10 +73,10 @@ class SwCellFrms; class SwTOXMark; class SwRedline; class IBlockCursor; -class SwCntntNode; // #i23726# -// --> OD 2008-06-19 #i90516# +class SwCntntNode; + class SwPostItField; -// <-- + struct SwPosition; namespace com { namespace sun { namespace star { namespace util { @@ -93,7 +91,7 @@ namespace com { namespace sun { namespace star { namespace container { class XStringKeyMap; }}}} -// enum und struktur, um ueber die Doc-Position Informationen zu erfragen +// enum and struct to get informations via the Doc-Position struct SwContentAtPos { @@ -109,13 +107,13 @@ struct SwContentAtPos SW_OUTLINE = 0x0040, SW_TOXMARK = 0x0080, SW_REFMARK = 0x0100, - SW_NUMLABEL = 0x0200, // #i23726# - SW_CONTENT_CHECK = 0x0400, // --> FME 2005-05-13 #i43742# <-- + SW_NUMLABEL = 0x0200, + SW_CONTENT_CHECK = 0x0400, SW_SMARTTAG = 0x0800, SW_FORMCTRL = 0x1000 -#ifndef PRODUCT - ,SW_CURR_ATTRS = 0x4000 // nur zum Debuggen - ,SW_TABLEBOXVALUE = 0x8000 // nur zum Debuggen +#if OSL_DEBUG_LEVEL > 1 + ,SW_CURR_ATTRS = 0x4000 // only for debugging + ,SW_TABLEBOXVALUE = 0x8000 // only for debugging #endif } eCntntAtPos; @@ -123,11 +121,11 @@ struct SwContentAtPos const SwField* pFld; const SfxPoolItem* pAttr; const SwRedline* pRedl; - SwCntntNode * pNode; // #i23726# + SwCntntNode * pNode; const sw::mark::IFieldmark* pFldmark; } aFnd; - int nDist; // #i23726# + int nDist; String sStr; const SwTxtAttr* pFndTxtAttr; @@ -140,20 +138,18 @@ struct SwContentAtPos nDist = 0; // #i23726# } - // befindet sich der Node in einem geschuetzten Bereich? sal_Bool IsInProtectSect() const; bool IsInRTLText()const; }; -// ReturnWerte von SetCrsr (werden verodert) -const int CRSR_POSOLD = 0x01, // Cursor bleibt an alter Doc-Position - CRSR_POSCHG = 0x02; // Position vom Layout veraendert +// return values of SetCrsr (can be combined via ||) +const int CRSR_POSOLD = 0x01, // cursor stays at old position + CRSR_POSCHG = 0x02; // position changed by the layout // Helperfunction to resolve backward references in regular expressions String *ReplaceBackReferences( const com::sun::star::util::SearchOptions& rSearchOpt, SwPaM* pPam ); -// die Cursor - Shell class SW_DLLPUBLIC SwCrsrShell : public ViewShell , public SwModify @@ -164,50 +160,47 @@ class SW_DLLPUBLIC SwCrsrShell friend class SwSelPaintRects; friend class SwChgLinkFlag; - //Braucht den Crsr als IntrnlCrsr. + // requires the Crsr as InternalCrsr friend sal_Bool GetAutoSumSel( const SwCrsrShell&, SwCellFrms& ); -public: // public, damit defaultet werden kann !! +public: - /* ein enum fuer den Aufruf von UpdateCrsr */ + /* for calling UpdateCrsr */ enum CrsrFlag { - UPDOWN = (1 << 0), // Up/Down auf Spalte halten - SCROLLWIN = (1 << 1), // Window Scrollen - CHKRANGE = (1 << 2), // ueberpruefen von ueberlappenden PaM's - NOCALRECT = (1 << 3), // CharRect nicht neu berechnen - READONLY = (1 << 4) // Sichtbar machen trotz Readonly + UPDOWN = (1 << 0), // keep Up/Down on columns + SCROLLWIN = (1 << 1), // scroll window + CHKRANGE = (1 << 2), // check overlapping PaMs + NOCALRECT = (1 << 3), // don't recalculate CharRect + READONLY = (1 << 4) // make visible in spite of Readonly }; private: - SwRect aCharRect; // Char-SRectangle auf dem der Cursor steht - Point aCrsrHeight; // Hohe&Offset von sichtbaren Cursor - Point aOldRBPos; // Right/Bottom von letzter VisArea - // (wird im Invalidate vom Cursor benutzt) - + SwRect aCharRect; // Char-SRectangle on which the cursor is located + Point aCrsrHeight; // height & offset from visible Cursor + Point aOldRBPos; // Right/Bottom of last VisArea + // (used in Invalidate by Cursor) - // um event. Macro was anhaengt auszufuehren. Link aFlyMacroLnk; // Link will be called, if the Crsr is set // into a fly. A macro can be then becalled Link aChgLnk; // link will be called by every attribut/ // format changes at cursor position. - Link aGrfArrivedLnk; // Link calls to UI if a grafik is arrived - + Link aGrfArrivedLnk; // Link calls to UI if a graphic is arrived - SwShellCrsr* pCurCrsr; // der aktuelle Cursor - SwShellCrsr* pCrsrStk; // Stack fuer den Cursor - SwVisCrsr *pVisCrsr; // der Sichtbare-Cursor + SwShellCrsr* pCurCrsr; // current cursor + SwShellCrsr* pCrsrStk; // stack for the cursor + SwVisCrsr *pVisCrsr; // the visible cursor IBlockCursor *pBlockCrsr; // interface of cursor for block (=rectangular) selection - SwShellTableCrsr* pTblCrsr; // Tabellen-Crsr; nur in Tabellen, wenn - // die Selection ueber 2 Spalten liegt + SwShellTableCrsr* pTblCrsr; // table Crsr; only in tables when the + // selection lays over 2 columns - SwNodeIndex* pBoxIdx; // fuers erkennen der veraenderten - SwTableBox* pBoxPtr; // Tabellen-Zelle + SwNodeIndex* pBoxIdx; // for recognizing of the changed + SwTableBox* pBoxPtr; // table row - long nUpDownX; // versuche den Cursor bei Up/Down immer in - // der gleichen Spalte zu bewegen + long nUpDownX; // try to move the cursor on up/down always + // in the same column long nLeftFrmPos; sal_uLong nAktNode; // save CursorPos at Start-Action xub_StrLen nAktCntnt; @@ -215,44 +208,40 @@ private: bool bAktSelection; /* - * Mit den Methoden SttCrsrMove und EndCrsrMove wird dieser Zaehler - * Inc-/Decrementiert. Solange der Zaehler ungleich 0 ist, erfolgt - * auf den akt. Cursor kein Update. Dadurch koennen "komplizierte" - * Cursorbewegungen (ueber Find()) realisiert werden. + * Via the Method SttCrsrMove and EndCrsrMove this counter gets + * incremented/decremented. As long as the counter is inequal to 0, the + * current Cursor gets no update. This way, "complicated" cursor movements + * (via Find()) can be realised. */ sal_uInt16 nCrsrMove; - sal_uInt16 nBasicActionCnt; // Actions, die vom Basic geklammert wurden - CrsrMoveState eMvState; // Status fuers Crsr-Travelling - GetCrsrOfst + sal_uInt16 nBasicActionCnt; // Actions which are parenthesized by Basic + CrsrMoveState eMvState; // Status for Crsr-Travelling - GetCrsrOfst - // --> OD 2008-04-02 #refactorlists# String sMarkedListId; int nMarkedListLevel; - // <-- - - sal_Bool bHasFocus : 1; // Shell ist in einem Window "aktiv" - sal_Bool bSVCrsrVis : 1; // SV-Cursor Un-/Sichtbar - sal_Bool bChgCallFlag : 1; // Attributaenderung innerhalb von - // Start- und EndAction - sal_Bool bVisPortChgd : 1; // befindet sich im VisPortChg-Aufruf - // (wird im Invalidate vom Cursor benutzt) - - sal_Bool bCallChgLnk : 1; // Flag fuer abgeleitete Klassen: - // sal_True -> ChgLnk callen - // Zugriff nur ueber SwChgLinkFlag - sal_Bool bAllProtect : 1; // Flag fuer Bereiche - // sal_True -> alles geschuetzt / versteckt - sal_Bool bInCMvVisportChgd : 1; // Flag fuer CrsrMoves - // sal_True -> die Sicht wurde verschoben - sal_Bool bGCAttr : 1; // sal_True -> es existieren nichtaufgespannte Attr. - sal_Bool bIgnoreReadonly : 1; // sal_True -> Beim naechsten EndAction trotz - // Readonly den Crsr sichtbar machen. - sal_Bool bSelTblCells : 1; // sal_True -> Zellen uebers InputWin selektieren - sal_Bool bAutoUpdateCells : 1; // sal_True -> Zellen werden autoformatiert - sal_Bool bBasicHideCrsr : 1; // sal_True -> HideCrsr vom Basic - sal_Bool bSetCrsrInReadOnly : 1;// sal_True -> Cursor darf in ReadOnly-Bereiche + + sal_Bool bHasFocus : 1; // Shell is "active" in a window + sal_Bool bSVCrsrVis : 1; // SV-Cursor visible/invisible + sal_Bool bChgCallFlag : 1; // attribute change inside Start- and EndAction + sal_Bool bVisPortChgd : 1; // in VisPortChg-Call + // (used in Invalidate by the Cursor) + + sal_Bool bCallChgLnk : 1; // flag for derived classes + // TRUE -> call ChgLnk + // access only via SwChgLinkFlag + sal_Bool bAllProtect : 1; // Flag for areas + // TRUE -> everything protected / hidden + sal_Bool bInCMvVisportChgd : 1; // Flag for CrsrMoves + // TRUE -> view was moved + sal_Bool bGCAttr : 1; // TRUE -> non expanded attributes exist. + sal_Bool bIgnoreReadonly : 1; // TRUE -> make the cursor visible on next + // EndAction in spite of Readonly + sal_Bool bSelTblCells : 1; // TRUE -> select cells over the InputWin + sal_Bool bAutoUpdateCells : 1; // TRUE -> autoformat cells + sal_Bool bBasicHideCrsr : 1; // TRUE -> HideCrsr from Basic + sal_Bool bSetCrsrInReadOnly : 1;// TRUE -> Cursor is allowed in ReadOnly-Areas sal_Bool bOverwriteCrsr : 1; // sal_True -> show Overwrite Crsr - // OD 11.02.2003 #100556# - flag to allow/avoid execution of marcos (default: true) bool mbMacroExecAllowed : 1; SW_DLLPRIVATE void UpdateCrsr( sal_uInt16 eFlags @@ -261,11 +250,8 @@ private: SW_DLLPRIVATE void _ParkPams( SwPaM* pDelRg, SwShellCrsr** ppDelRing ); - // -> #i27615# - /** Mark a certain list level of a certain list - OD 2008-04-02 #refactorlists# levels of a certain lists are marked now @param sListId list Id of the list whose level is marked @@ -275,7 +261,6 @@ private: */ SW_DLLPRIVATE void MarkListLevel( const String& sListId, const int nLevel ); - // <- #i27615# // private method(s) accessed from public inline method(s) must be exported. sal_Bool LeftRight( sal_Bool, sal_uInt16, sal_uInt16, sal_Bool ); @@ -309,17 +294,13 @@ protected: }; int CompareCursor( CrsrCompareType eType ) const; - // Setzt alle PaMs in OldNode auf NewPos + Offset + // set all PaMs in OldNode to NewPos + Offset void PaMCorrAbs(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const xub_StrLen nOffset = 0 ); - // --> FME 2004-07-30 #i32329# Enhanced table selection sal_Bool _SelTblRowOrCol( bool bRow, bool bRowSimple = false ); - // <-- - // --> FME 2005-01-31 #i41424# Only update the marked number levels if necessary bool SetInFrontOfLabel( sal_Bool bNew ); - // <-- void RefreshBlockCursor(); @@ -333,19 +314,18 @@ protected: public: TYPEINFO(); SwCrsrShell( SwDoc& rDoc, Window *pWin, const SwViewOption *pOpt = 0 ); - // verkleideter Copy-Constructor + // disguised copy constructor SwCrsrShell( SwCrsrShell& rShell, Window *pWin ); virtual ~SwCrsrShell(); - // IShellCursorSupplier + // create new cursor and append the old one virtual SwPaM & CreateNewShellCursor(); virtual SwPaM & GetCurrentShellCursor(); - // neuen Cusror erzeugen und den alten anhaengen SwPaM * CreateCrsr(); - // loesche den aktuellen Cursor und der folgende wird zum Aktuellen + // delete the current cursor and make the following into the current sal_Bool DestroyCrsr(); - // TableCursor in normale Cursor verwandeln, Tablemode aufheben + // transform TableCursor to normal cursor, nullify Tablemode void TblCrsrToCursor(); // enter block mode, change normal cursor into block cursor void CrsrToBlockCrsr(); @@ -359,27 +339,26 @@ public: SwPaM* GetCrsr( sal_Bool bMakeTblCrsr = sal_True ) const; inline SwCursor* GetSwCrsr( sal_Bool bMakeTblCrsr = sal_True ) const; - // nur den akt. Cursor returnen + // return only the current cursor SwShellCrsr* _GetCrsr() { return pCurCrsr; } const SwShellCrsr* _GetCrsr() const { return pCurCrsr; } - // uebergebenen Cursor anzeigen - fuer UNO + // show passed cursor - for UNO void SetSelection(const SwPaM& rCrsr); - // alle Cursor aus den ContentNodes entfernen und auf 0 setzen. - // Wurde aus der FEShell hierher verschoben. + // remove all cursors from ContentNodes and set to 0 void ParkCrsr( const SwNodeIndex &rIdx ); - // gebe den akt. Cursor-Stack zurueck. - // ( Wird in der EditShell beim Loeschen von Inhalten benoetigt! ) + // return the current cursor stack + // (required in EditShell when deleting contents) inline SwPaM* GetStkCrsr() const; - // Start der Klammerung, SV-Cursor und selektierte Bereiche hiden + // start parenthesing, hide SV-Cursor and selected areas void StartAction(); - // Ende der Klammerung, SV-Cursor und selektierte Bereiche anzeigen + // end parenthesing, show SV-Cursor and selected areas void EndAction( const sal_Bool bIdleEnd = sal_False ); - // Basiscursortravelling + // basic cursor travelling long GetUpDownX() const { return nUpDownX; } sal_Bool Left( sal_uInt16 nCnt, sal_uInt16 nMode, sal_Bool bAllowVisual = sal_False ) @@ -399,7 +378,6 @@ public: sal_Bool MoveColumn( SwWhichColumn, SwPosColumn ); sal_Bool MoveRegion( SwWhichRegion, SwPosRegion ); - // die Suchfunktionen sal_uLong Find( const com::sun::star::util::SearchOptions& rSearchOpt, sal_Bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnde, @@ -418,28 +396,25 @@ public: const com::sun::star::util::SearchOptions* pSearchOpt = 0, const SfxItemSet* rReplSet = 0 ); - // Positionieren des Cursors - // returnt - // CRSR_POSCHG: wenn der ob der SPoint vom Layout korrigiert wurde. - // CRSR_POSOLD: wenn der Crsr nicht veraendert wurde + // Position the Cursor + // return values: + // CRSR_POSCHG: when cursor was corrected from SPoint by the layout + // CRSR_POSOLD: when the cursor was not changed int SetCrsr( const Point &rPt, sal_Bool bOnlyText = sal_False, bool bBlock = true ); - /* - * Benachrichtung, dass der sichtbare Bereich sich geaendert - * hat. aVisArea wird neu gesetzt, anschliessend wird - * gescrollt. Das uebergebene Rectangle liegt auf - * Pixelgrenzen, um Pixelfehler beim Scrollen zu vermeiden. + * Notification that the visible area was changed. aVisArea is reset, then + * scrolling is done. The passed Rectangle lays on pixel borders to avoid + * pixel errors. */ virtual void VisPortChgd( const SwRect & ); /* - * Virtuelle PaintMethode, damit die Selection nach dem Paint wieder - * sichtbar wird. + * virtual paint method to make selection visible again after Paint */ void Paint( const Rectangle & rRect ); - // Bereiche + // Areas inline void SetMark(); inline sal_Bool HasMark(); @@ -456,131 +431,130 @@ public: void SwapPam(); sal_Bool ChgCurrPam( const Point & rPt, - sal_Bool bTstOnly = sal_True, //Nur testen, nicht setzen - sal_Bool bTstHit = sal_False ); //Nur genaue Treffer + sal_Bool bTstOnly = sal_True, // test only, don't set + sal_Bool bTstHit = sal_False ); // only exact matches void KillPams(); - // erzeuge eine Kopie vom Cursor und speicher diese im Stack + // story a copy of the cursor in the stack void Push(); /* - * Loescht einen Cursor (gesteuert durch bOldCrsr) - * - vom Stack oder ( bOldCrsr = sal_True ) - * - den aktuellen und der auf dem Stack stehende wird zum aktuellen - * - * Return: es war auf dem Stack noch einer vorhanden + * Delete a cursor (controlled by bOldCrsr) + * - from stack or (bOldCrsr = TRUE) + * - delete the current one and replace it with the cursor from the + * stack + * Return: whether there was one left one the stack */ sal_Bool Pop( sal_Bool bOldCrsr = sal_True ); /* - * Verbinde zwei Cursor miteinander. - * Loesche vom Stack den obersten und setzen dessen Mark im Aktuellen. + * Combine 2 Cursors. + * Delete the topmost from the stack and move its Mark into the current. */ void Combine(); -#if !defined(DBG_UTIL) +#if OSL_DEBUG_LEVEL > 1 + void SttCrsrMove(); + void EndCrsrMove( const sal_Bool bIdleEnd = sal_False ); +#else void SttCrsrMove() { ++nCrsrMove; StartAction(); } void EndCrsrMove( const sal_Bool bIdleEnd = sal_False ) { EndAction( bIdleEnd ); --nCrsrMove; } -#else - void SttCrsrMove(); - void EndCrsrMove( const sal_Bool bIdleEnd = sal_False ); #endif /* - * Beim Abgeben des Focuses werden die selektierten Bereiche nicht mehr - * angezeigt; andererseits beim Erhalten des Focuses, werden alle selek- - * tierten Bereiche wieder angezeigt. (Bereiche muessen neu berechnet - * werden!) + * When the focus is lost the selected ranges are not displayed anymore. + * On the other hand, on receiving the focus all selected ranges are displayed again + * (ranges must be recalculated!). */ sal_Bool HasShFcs() const { return bHasFocus; } void ShLooseFcs(); void ShGetFcs( sal_Bool bUpdate = sal_True ); - // Methoden zum Anzeigen bzw. Verstecken des sichtbaren Text-Cursors + // Methods for displaying or hiding the visible text cursor. void ShowCrsr(); void HideCrsr(); - // Methoden zum Anzeigen bzw. Verstecken der selektierten Bereiche mit - // dem sichtbaren Cursor + // Methods for displaying or hiding the selected ranges with visible cursor. void ShowCrsrs( sal_Bool bCrsrVis ); void HideCrsrs(); sal_Bool IsOverwriteCrsr() const { return bOverwriteCrsr; } void SetOverwriteCrsr( sal_Bool bFlag ) { bOverwriteCrsr = bFlag; } - // gebe den aktuellen Frame, in dem der Cursor steht, zurueck + // Return current frame in which the cursor is placed. SwCntntFrm *GetCurrFrm( const sal_Bool bCalcFrm = sal_True ) const; - //sal_True wenn der Crsr wenn der Crsr wegen Readonly gehidet ist, - //sal_False wenn der arbeitet (trotz Readonly). + //TRUE if cursor is hidden because of readonly. + //FALSE if it is working despite readonly. sal_Bool IsCrsrReadonly() const; - // Cursor steht in etwas geschuetztem oder in die Selektion umspannt - // etwas geschuetztes. + + // Cursor is placed in something that is protected or selection contains + // something that is protected. sal_Bool HasReadonlySel() const; - // darf der Cursor in ReadOnlyBereiche? + + // Can the cursor be set to read only ranges? sal_Bool IsReadOnlyAvailable() const { return bSetCrsrInReadOnly; } void SetReadOnlyAvailable( sal_Bool bFlag ); sal_Bool IsOverReadOnlyPos( const Point& rPt ) const; - // Methoden fuer aFlyMacroLnk + // Methods for aFlyMacroLnk. void SetFlyMacroLnk( const Link& rLnk ) { aFlyMacroLnk = rLnk; } const Link& GetFlyMacroLnk() const { return aFlyMacroLnk; } - // Methoden geben/aendern den Link fuer die Attribut/Format-Aenderungen + // Methods returning/altering link for changes of attributes/formates. void SetChgLnk( const Link &rLnk ) { aChgLnk = rLnk; } const Link& GetChgLnk() const { return aChgLnk; } - // Methoden geben/aendern den Link fuers "Grafik vollstaendig geladen" + // Methods returning/altering ling for "graphic completely loaded". void SetGrfArrivedLnk( const Link &rLnk ) { aGrfArrivedLnk = rLnk; } const Link& GetGrfArrivedLnk() const { return aGrfArrivedLnk; } - //ChgLink callen, innerhalb einer Action wird der Ruf verzoegert. + //Call ChgLink. When within an action calling will be delayed. void CallChgLnk(); - // Abfrage, ob der aktuelle Cursor eine Selektion aufspannt, - // also, ob Mark gesetzt und SPoint und Mark unterschiedlich sind. + // Check if the current cursor contains a selection, i.e. + // if Mark is set and SPoint and Mark are different. sal_Bool HasSelection() const; - // Abfrage, ob ueberhaupt eine Selektion existiert, sprich der akt. Cursor - // aufgespannt oder nicht der einzigste ist. + // Check if a selection exists, i.e. if the current cursor comprises a selection. inline sal_Bool IsSelection() const; // returns if multiple cursors are available inline sal_Bool IsMultiSelection() const; - // Abfrage, ob ein kompletter Absatz selektiert wurde + // Check if a complete paragraph was selected. sal_Bool IsSelFullPara() const; - // Abfrage, ob die Selektion in einem Absatz ist - inline sal_Bool IsSelOnePara() const; - //Sollte fuer das Clipboard der WaitPtr geschaltet werden. + // Check if selection is within one paragraph. + + //Should WaitPtr be activated for Clipboard. sal_Bool ShouldWait() const; + // Check if selection is within one paragraph. + inline sal_Bool IsSelOnePara() const; + /* - * liefert das SRectangle, auf dem der Cursor steht. + * Returns SRectangle, at which the cursor is located. */ const SwRect &GetCharRect() const { return aCharRect; } /* - * liefert zurueck, ob der Cursor sich ganz oder teilweise im - * sichtbaren Bereich befindet. + * Returns if cursor is wholly or partly within visible range. */ sal_Bool IsCrsrVisible() const { return VisArea().IsOver( GetCharRect() ); } - // gebe die aktuelle Seitennummer zurueck: - // sal_True: in der der Cursor steht - // sal_False: die am oberen Rand sichtbar ist + // Return current page number: + // TRUE: in which cursor is located. + // FALSE: which is visible at the upper margin. void GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, sal_Bool bAtCrsrPos = sal_True, const sal_Bool bCalcFrm = sal_True ); - // bestimme in welche Richtung "leere Seiten" behandelt werden! - // (wird benutzt im PhyPage.. ) + // Determine how "empty pages" are handled + // (used in PhyPage). sal_uInt16 GetNextPrevPageNum( sal_Bool bNext = sal_True ); - // setze den Cursor auf die Seite "nPage" an den Anfang + // Move cursor at the bginning of page "nPage". sal_Bool GotoPage( sal_uInt16 nPage ); - // gebe alle Dokumentseiten zurueck sal_uInt16 GetPageCnt(); - // Gehe zur naechsten Selection sal_Bool GoNextCrsr(); - // gehe zur vorherigen Selection + sal_Bool GoPrevCrsr(); // at CurCrsr.SPoint @@ -600,21 +574,20 @@ public: ::sw::mark::IFieldmark* GetFieldmarkBefore(); bool GotoFieldmark( const ::sw::mark::IFieldmark* const pMark ); - // aktualisiere den Crsrs, d.H. setze ihn wieder in den Content. - // Das sollte nur aufgerufen werden, wenn der Cursor z.B. beim - // Loeschen von Rahmen irgendwohin gesetzt wurde. Die Position - // ergibt sich aus seiner aktuellen Position im Layout !! + // update Cursr, i.e. reset it into content should only be called when the + // cursor was set to a random position e.g. when deleting frames void UpdateCrsrPos(); - // returne den am akt. Cursor selektierten Text. Dieser wird mit - // Felder etc. aufgefuellt!! + // get the selected text at the current cursor. it will be filled with + // fields etc. String GetSelTxt() const; - // gebe nur den Text ab der akt. Cursor Position zurueck (bis zum NodeEnde) + // return only the text starting from the current cursor position (to the + // end of the node) String GetText() const; - // pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen + // Check of SPoint or Mark of current cursor are placed within a table. inline const SwTableNode* IsCrsrInTbl( sal_Bool bIsPtInTbl = sal_True ) const; - // erfrage die Document - Layout - Position vom akt. Crsr + inline Point& GetCrsrDocPos( sal_Bool bPoint = sal_True ) const; inline sal_Bool IsCrsrPtAtEnd() const; @@ -623,41 +596,37 @@ public: sal_Bool IsTblComplex() const; sal_Bool IsTblComplexForChart(); - // erfrage die akt. TabellenSelektion als Text + // get current table selection as text String GetBoxNms() const; - // setze Crsr in die naechsten/vorherigen Celle + // set Crsr to the next/previous cell sal_Bool GoNextCell( sal_Bool bAppendLine = sal_True ); sal_Bool GoPrevCell(); - // gehe zu dieser Box (wenn vorhanden und in Tabelle!) + // go to this box (if available and inside of table) sal_Bool GotoTable( const String& rName ); // select a table row, column or box (based on the current cursor) sal_Bool SelTblRow() { return _SelTblRowOrCol( true ); } sal_Bool SelTblCol() { return _SelTblRowOrCol( false ); } sal_Bool SelTblBox(); - // --> FME 2004-07-30 #i32329# Enhanced table selection + sal_Bool SelTbl(); - // <-- - // zum naechsten/vorhergehenden Punkt auf gleicher Ebene sal_Bool GotoNextNum(); sal_Bool GotoPrevNum(); - // zu diesem Gliederungspunkt sal_Bool GotoOutline( const String& rName ); - // zum naechsten/vorhergehenden oder angegebenen OultineNode + // to the next/previous or the given OutlineNode void GotoOutline( sal_uInt16 nIdx ); - // suche die "Outline-Position" im Nodes-Array vom akt. Kaiptel + // find the "outline position" in the nodes array of the current chapter sal_uInt16 GetOutlinePos( sal_uInt8 nLevel = UCHAR_MAX ); - // selektiere den angeben Bereich von OutlineNodes. Optional - // inclusive der Childs. Die sal_uInt16 sind die Positionen im - // OutlineNds-Array!! (EditShell) + // select the given range of OutlineNodes. Optionally including the children + // the sal_uInt16s are the positions in OutlineNodes-Array (EditShell) sal_Bool MakeOutlineSel( sal_uInt16 nSttPos, sal_uInt16 nEndPos, sal_Bool bWithChilds = sal_False ); - sal_Bool GotoNextOutline(); // naechster Node mit Outline-Num. - sal_Bool GotoPrevOutline(); // vorheriger Node mit Outline-Num. + sal_Bool GotoNextOutline(); + sal_Bool GotoPrevOutline(); /** Delivers the current shell cursor @@ -677,78 +646,72 @@ public: const SwShellCrsr* getShellCrsr( bool bBlock ) const { return (const_cast<SwCrsrShell*>(this))->getShellCrsr( bBlock ); } - FASTBOOL IsBlockMode() const { return 0 != pBlockCrsr; } + bool IsBlockMode() const { return 0 != pBlockCrsr; } const IBlockCursor* GetBlockCrsr() const { return pBlockCrsr; } IBlockCursor* GetBlockCrsr() { return pBlockCrsr; } - // ist der Crsr in einer Tabelle und ist die Selection ueber - // zwei Spalten + // is the Crsr in a table and is the selection over 2 columns sal_Bool IsTableMode() const { return 0 != pTblCrsr; } - // erfrage den Tabellen Crsr; ausserhalb von Tabellen immer 0 const SwShellTableCrsr* GetTableCrsr() const { return pTblCrsr; } SwShellTableCrsr* GetTableCrsr() { return pTblCrsr; } sal_uInt16 UpdateTblSelBoxes(); - sal_Bool GotoFtnTxt(); // springe aus dem Content zur Fussnote - sal_Bool GotoFtnAnchor(); // springe aus der Fussnote zum Anker + sal_Bool GotoFtnTxt(); // jump from content to footnote + sal_Bool GotoFtnAnchor(); // jump from footnote to anchor sal_Bool GotoPrevFtnAnchor(); sal_Bool GotoNextFtnAnchor(); - sal_Bool GotoFlyAnchor(); // springe aus dem Rahmen zum Anker - sal_Bool GotoHeaderTxt(); // springe aus dem Content zum Header - sal_Bool GotoFooterTxt(); // springe aus dem Content zum Footer - // springe in den Header/Footer des angegebenen oder akt. PageDesc + sal_Bool GotoFlyAnchor(); // jump from the frame to the anchor + sal_Bool GotoHeaderTxt(); // jump from the content to the header + sal_Bool GotoFooterTxt(); // jump from the content to the footer + // jump to the header/footer of the given or current PageDesc sal_Bool SetCrsrInHdFt( sal_uInt16 nDescNo = USHRT_MAX, sal_Bool bInHeader = sal_True ); // is point of cursor in header/footer. pbInHeader return sal_True if it is // in a headerframe otherwise in a footerframe sal_Bool IsInHeaderFooter( sal_Bool* pbInHeader = 0 ) const; - // springe zum naechsten Verzeichnis [mit dem Namen] sal_Bool GotoNextTOXBase( const String* = 0 ); - // springe zum vorherigen Verzeichnis [mit dem Namen] sal_Bool GotoPrevTOXBase( const String* = 0 ); - sal_Bool GotoTOXMarkBase(); // springe zum Verzeichnis vom TOXMark - // springe zum naechsten (vorherigen) Verzeichniseintrag + sal_Bool GotoTOXMarkBase(); + // jump to the next or previous index entry sal_Bool GotoNxtPrvTOXMark( sal_Bool bNext = sal_True ); - // Zur naechsten/ vorherigen Verzeichnismarke dieses Typs traveln + // jump to the next/previous index mark of this type const SwTOXMark& GotoTOXMark( const SwTOXMark& rStart, SwTOXSearch eDir ); - // springe zum naechsten (vorherigen) Tabellenformel - // optional auch nur zu kaputten Formeln springen + // jump to the next or previous table formula + // optionally only to broken formulas sal_Bool GotoNxtPrvTblFormula( sal_Bool bNext = sal_True, sal_Bool bOnlyErrors = sal_False ); // jump to the next / previous hyperlink - inside text and also // on graphics sal_Bool SelectNxtPrvHyperlink( sal_Bool bNext = sal_True ); - // springe zu dieser Refmark sal_Bool GotoRefMark( const String& rRefMark, sal_uInt16 nSubType = 0, sal_uInt16 nSeqNo = 0 ); - // hole vom Start/Ende der akt. Selection das nte Zeichen + // get the nth character from the start or end of the current selection sal_Unicode GetChar( sal_Bool bEnd = sal_True, long nOffset = 0 ); - // erweiter die akt. Selection am Anfang/Ende um n Zeichen sal_Bool ExtendSelection( sal_Bool bEnd = sal_True, xub_StrLen nCount = 1 ); - // setze nur den sichtbaren Cursor an die angegebene Dokument-Pos. - // returnt sal_False: wenn der ob der SPoint vom Layout korrigiert wurde. - // (wird zum Anzeigen von Drag&Drop/Copy-Cursor benoetigt) + + // Place only the visible cursor at the given position in the document. + // Return FALSE if SPoint was corrected by layout. + // (This is needed for displaying the Drag&Drop/Copy-Cursor.) sal_Bool SetVisCrsr( const Point &rPt ); inline void UnSetVisCrsr(); - // springe zum nachsten/vorherigen Feld des entsprechenden Types + // jump to the next or previous field of the corresponding type sal_Bool MoveFldType( const SwFieldType* pFldType, sal_Bool bNext, sal_uInt16 nSubType = USHRT_MAX, sal_uInt16 nResType = USHRT_MAX ); - // springe genau zu diesem Feld sal_Bool GotoFld( const SwFmtFld& rFld ); - // returne die Anzahl der Cursor im Ring (Flag besagt ob man nur - // aufgepspannte haben will - sprich etwas selektiert ist (Basic)) + // Return number of cursors in ring (The flag indicates whether + // only cursors containing selections are requested). sal_uInt16 GetCrsrCnt( sal_Bool bAll = sal_True ) const; - // Char Travelling - Methoden (in crstrvl1.cxx) + // Char Travelling - methods (in crstrvl1.cxx) sal_Bool GoStartWord(); sal_Bool GoEndWord(); sal_Bool GoNextWord(); @@ -760,7 +723,7 @@ public: sal_Bool SelectWord( const Point* pPt = 0 ); sal_Bool ExpandToSentenceBorders(); - // Position vom akt. Cursor erfragen + // get position from current cursor sal_Bool IsStartWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES )const; sal_Bool IsEndWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; sal_Bool IsInWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; @@ -774,35 +737,34 @@ public: sal_Bool IsAtLeftMargin() const { return IsAtLRMargin( sal_True ); } sal_Bool IsAtRightMargin(sal_Bool bAPI = sal_False) const { return IsAtLRMargin( sal_False, bAPI ); } - // loesche alle erzeugten Crsr, setze den Tabellen-Crsr und den letzten - // Cursor auf seinen TextNode (oder StartNode?). - // Beim naechsten ::GetCrsr werden sie wieder alle erzeugt. - // Wird fuers Drag&Drop/ClipBorad-Paste in Tabellen benoetigt. + // delete all created cursors, set the table cursor and the last cursor to + // its TextNode (or StartNode?) + // They all get created on the next ::GetCrsr again + // Used for Drag&Drop/Clipboard-Paste in tables sal_Bool ParkTblCrsr(); - // gibt es nicht aufgespannte Attribute? + // Non expanded attributes? sal_Bool IsGCAttr() const { return bGCAttr; } void ClearGCAttr() { bGCAttr = sal_False; } void UpdateAttr() { bGCAttr = sal_True; } - // ist das gesamte Dokument geschuetzt/versteckt?? (fuer UI,..) + // is the whole document protected/hidden (for UI...) sal_Bool IsAllProtect() const { return bAllProtect; } #ifdef SW_CRSR_TIMER - // setze das Flag am VisCrsr, ob dieser ueber Timer getriggert (sal_True) - // oder direkt (sal_False) angezeigt wird. (default ist Timer getriggert) + // Set flag at VisCrsr. Is it triggered by Timer (TRUE) or directly (FALSE). + // Default is triggert by Timer. sal_Bool ChgCrsrTimerFlag( sal_Bool bTimerOn = sal_True ); #endif sal_Bool BasicActionPend() const { return nBasicActionCnt != nStartAction; } - // springe zum benannten Bereich sal_Bool GotoRegion( const String& rName ); - // zeige die aktuelle Selektion an + // show the current selection virtual void MakeSelVisible(); - // setzte den Cursor auf einen NICHT geschuetzten/versteckten Node + // set the cursor to a NOT protected/hidden node sal_Bool FindValidCntntNode( sal_Bool bOnlyText = sal_False ); sal_Bool GetContentAtPos( const Point& rPt, @@ -810,9 +772,7 @@ public: sal_Bool bSetCrsr = sal_False, SwRect* pFldRect = 0 ); - // --> OD 2008-06-19 #i90516# const SwPostItField* GetPostItFieldAtCursor() const; - // <-- // get smart tags at point position void GetSmartTagTerm( const Point& rPt, @@ -828,7 +788,6 @@ public: sal_Bool IsPageAtPos( const Point &rPt ) const; - // Attribut selelktieren sal_Bool SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand, const SwTxtAttr* pAttr = 0 ); sal_Bool GotoINetAttr( const SwTxtINetFmt& rAttr ); const SwFmtINetFmt* FindINetAttr( const String& rName ) const; @@ -838,8 +797,8 @@ public: void ClearTblBoxCntnt(); sal_Bool EndAllTblBoxEdit(); - // wird gerufen, wenn eine Tabellenselektion im UpdateCrsr erzeugt wird, - // ohne das die UI davon etaws weiss + // gets called when a table selection gets created in UpdateCrsr without + // the UI knowing of it virtual void NewCoreSelection(); void SetSelTblCells( sal_Bool bFlag ) { bSelTblCells = bFlag; } @@ -868,7 +827,6 @@ public: // remove all invalid cursors void ClearUpCrsrs(); - // OD 11.02.2003 #100556# - set/get flag to allow/avoid execution of macros inline void SetMacroExecAllowed( const bool _bMacroExecAllowed ) { mbMacroExecAllowed = _bMacroExecAllowed; @@ -878,7 +836,6 @@ public: return mbMacroExecAllowed; } - // #111827# /** Returns textual description of the current selection. @@ -893,7 +850,6 @@ public: SwRect GetRectOfCurrentChar(); }; - // Cursor Inlines: inline SwMoveFnCollection* SwCrsrShell::MakeFindRange( sal_uInt16 nStt, sal_uInt16 nEnd, SwPaM* pPam ) const @@ -960,3 +916,5 @@ inline void SwCrsrShell::UnSetVisCrsr() } #endif // _CRSRSH_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |