diff options
Diffstat (limited to 'sw/inc/node.hxx')
-rw-r--r-- | sw/inc/node.hxx | 175 |
1 files changed, 78 insertions, 97 deletions
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index 4ff69260b044..839b40510e1d 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.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. @@ -43,7 +44,7 @@ #include <fmtcol.hxx> // --------------------- -// forward Deklarationen +// forward declarations // --------------------- class SvUShorts; @@ -92,18 +93,16 @@ class SW_DLLPUBLIC SwNode : private /* public*/ BigPtrEntry { friend class SwNodes; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 static long nSerial; long nMySerial; #endif sal_uInt8 nNodeType; - // JP 28.03.96 - // fuer Textnodes: Stufungslevel der Autoformatierung. Ist erstmal hier - // gelandet, weil noch Bits frei sind + // For text nodes: level of auto format. Was put here because we had still free bits. sal_uInt8 nAFmtNumLvl : 3; - sal_Bool bSetNumLSpace : 1; // fuer Numerierung: sal_True Einzug setzen + sal_Bool bSetNumLSpace : 1; // For numbering: TRUE: set indent. sal_Bool bIgnoreDontExpand : 1; // for Text Attributes - ignore the flag protected: @@ -111,13 +110,13 @@ protected: SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNodeId ); - // fuer den initialen StartNode + // for the initial StartNode SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNodeId ); public: virtual ~SwNode(); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 long int GetSerial() const { return nMySerial; } #endif @@ -186,13 +185,13 @@ public: */ sal_Bool IsInRedlines() const; - // suche den TabellenNode, in dem dieser steht. Wenn in keiner - // Tabelle wird 0 returnt. + // Search table node, in which it is. If it is in no table + // return 0. SwTableNode *FindTableNode(); inline const SwTableNode *FindTableNode() const; - // suche den SectionNode, in dem dieser steht. Wenn es in keiner - // Section steht wird 0 returnt. + // Search section node, in which it is. If it is in no section + // return 0. SwSectionNode *FindSectionNode(); inline const SwSectionNode *FindSectionNode() const; @@ -210,7 +209,7 @@ public: const SwStartNode* FindFooterStartNode() const { return FindSttNodeByType( SwFooterStartNode ); } - // in welchem Nodes-Array/Doc steht der Node ? + // Node is in which nodes-array/doc? inline SwNodes& GetNodes(); inline const SwNodes& GetNodes() const; inline SwDoc* GetDoc(); @@ -269,32 +268,27 @@ public: /** Provides access to the document's numbered items interface - OD 2007-10-31 #i83479# - @author OD */ IDocumentListItems& getIDocumentListItems(); - // liegt der Node im Sichtbarenbereich der Shell ? + // Is node in the visible area of the Shell? sal_Bool IsInVisibleArea( ViewShell* pSh = 0 ) const; - // befindet sich der Node in einem geschuetzten Bereich? + // Is node in an protected area? sal_Bool IsInProtectSect() const; - // befindet sich der Node in irgendetwas geschuetzten ? - // (Bereich/Rahmen/Tabellenzellen/... incl. des Ankers bei - // Rahmen/Fussnoten/..) + // Is node in something that is protected (range, frame, + // table cells ... including anchor in case of frames or footnotes)? sal_Bool IsProtect() const; - // suche den PageDesc, mit dem dieser Node formatiert ist. Wenn das - // Layout vorhanden ist wird ueber das gesucht, ansonsten gibt es nur - // die harte Tour ueber die Nodes nach vorne suchen!! - // OD 18.03.2003 #106326# + + // Search PageDesc with which this node is formated. If layout is existent + // search over layout, else only the hard way is left: search over the nodes + // to the front!! const SwPageDesc* FindPageDesc( sal_Bool bCalcLay, sal_uInt32* pPgDescNdIdx = 0 ) const; - // falls der Node in einem Fly steht, dann wird das entsprechende Format - // returnt + // If node is in a fly return the respective format. SwFrmFmt* GetFlyFmt() const; - // falls der Node in einer Tabelle steht, dann wird die entsprechende - // TabellenBox returnt + // If node is in a table return the respective table box. SwTableBox* GetTblBox() const; inline sal_uLong GetIndex() const { return GetPos(); } @@ -304,7 +298,7 @@ public: sal_uInt8 HasPrevNextLayNode() const; private: - // privater Constructor, weil nie kopiert werden darf !! + // Private constructor because copying is never allowed!! SwNode( const SwNode & rNodes ); SwNode & operator= ( const SwNode & rNodes ); }; @@ -316,12 +310,12 @@ class SwStartNode: public SwNode { friend class SwNode; friend class SwNodes; - friend class SwEndNode; // um theEndOfSection zu setzen !! + friend class SwEndNode; // to set the theEndOfSection !! SwEndNode* pEndOfSection; SwStartNodeType eSttNdTyp; - // fuer den initialen StartNode + // for the initial StartNode SwStartNode( SwNodes& rNodes, sal_uLong nPos ); protected: @@ -333,11 +327,11 @@ public: SwStartNodeType GetStartNodeType() const { return eSttNdTyp; } - // an alle ContentNodes der Section das ChkCondColl rufen + // Call ChkCondcoll to all ContentNodes of section. void CheckSectionCondColl() const; private: - // privater Constructor, weil nie kopiert werden darf !! + // Private constructor because copying is never allowed!! SwStartNode( const SwStartNode & rNode ); SwStartNode & operator= ( const SwStartNode & rNode ); }; @@ -349,10 +343,10 @@ private: class SwEndNode : public SwNode { friend class SwNodes; - friend class SwTableNode; // um seinen EndNode anlegen zukoennen - friend class SwSectionNode; // um seinen EndNode anlegen zukoennen + friend class SwTableNode; // To enable creation of its EndNote. + friend class SwSectionNode; // To enable creation of its EndNote. - // fuer den initialen StartNode + // for the initial StartNode SwEndNode( SwNodes& rNodes, sal_uLong nPos, SwStartNode& rSttNd ); protected: @@ -361,7 +355,7 @@ protected: DECL_FIXEDMEMPOOL_NEWDEL(SwEndNode) private: - // privater Constructor, weil nie kopiert werden darf !! + // Private constructor because copying is never allowed!! SwEndNode( const SwEndNode & rNode ); SwEndNode & operator= ( const SwEndNode & rNode ); }; @@ -372,9 +366,6 @@ private: // -------------------- class SW_DLLPUBLIC SwCntntNode: public SwModify, public SwNode, public SwIndexReg { - // Der Reader darf NewAttrSet() aufrufen! -// friend class SwSwgReader; -// friend class Sw3IoImp; //FEATURE::CONDCOLL SwDepend* pCondColl; @@ -386,11 +377,11 @@ protected: SwFmtColl *pFmtColl ); virtual ~SwCntntNode(); - // Attribut-Set fuer alle AUTO-Attribute eines CntntNodes - // ( z.B: TxtNode oder NoTxtNode + // Attribute-set for all auto attributes of a CntntNode. + // (e.g. TxtNode or NoTxtNode). boost::shared_ptr<const SfxItemSet> mpAttrSet; - // lasse von den entsprechenden Nodes die spz. AttrSets anlegen + // Make respective nodes create the specific AttrSets. virtual void NewAttrSet( SwAttrPool& ) = 0; // There some functions that like to remove items from the internal @@ -400,7 +391,7 @@ protected: virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); public: - TYPEINFO(); //Bereits in Basisklasse Client drin. + TYPEINFO(); //Already contained in base class Client. // MakeFrm will be called for a certain layout // pSib is another SwFrm of the same layout (e.g. the SwRootFrm itself, a sibling, the parent) @@ -410,8 +401,8 @@ public: virtual SwCntntNode *JoinNext(); virtual SwCntntNode *JoinPrev(); - // koennen 2 Nodes zusammengefasst werden ? - // in pIdx kann die 2. Position returnt werden. + // Is it possible to join two nodes? + // In pIdx the second position can be returned. int CanJoinNext( SwNodeIndex* pIdx =0 ) const; int CanJoinPrev( SwNodeIndex* pIdx =0 ) const; @@ -426,58 +417,49 @@ public: const Point* pDocPos = 0, const SwPosition *pPos = 0, const sal_Bool bCalcFrm = sal_True ) const; - // Gibt die tatsaechlcheGroesse des Frames zurueck bzw. ein leeres - // Rechteck, wenn kein Layout existiert. - // Wird fuer die Export Filter benoetigt. + // Returns the real size of the frame or an empty rectangle if + // no layout exists. Needed for export filters. SwRect FindLayoutRect( const sal_Bool bPrtArea = sal_False, const Point* pPoint = 0, const sal_Bool bCalcFrm = sal_False ) const; SwRect FindPageFrmRect( const sal_Bool bPrtArea = sal_False, const Point* pPoint = 0, const sal_Bool bCalcFrm = sal_False ) const; - /* - * Methode erzeugt fuer den angegebenen Node alle Ansichten vom - * Dokument. Die erzeugten Contentframes werden in das entsprechende - * Layout gehaengt. - */ + + // Method creates all views of document for given node. The content + // frames that are created are put in the respective layout. void MakeFrms( SwCntntNode& rNode ); - /* - * Methode loescht fuer den Node alle Ansichten vom - * Dokument. Die Contentframes werden aus dem entsprechenden - * Layout ausgehaengt. - */ + + // Method deletes all vies of document for the node. The content- + // frames are removed from the respective layout. void DelFrms(); - /* - * liefert die Anzahl der Elemente des Inhalts des Nodes; - * Default ist 1, Unterschiede gibt es beim TextNode und beim - * Formelnode. - */ + // Returns count of elements of node content. Default is 1. + // There are differences between text node and formula node. virtual xub_StrLen Len() const; virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const = 0; - // erfrage vom Client Informationen + + // Get information from Client. virtual sal_Bool GetInfo( SfxPoolItem& ) const; - // SS fuer die PoolItems: (Harte-(Fmt)Attrbutierung) + // SS for PoolItems: hard attributation. - // Ist bInParent sal_False, wird nur in diesem Node nach dem Attribut gesucht. + // If bInParent is FALSE search for attribute only in this node. const SfxPoolItem& GetAttr( sal_uInt16 nWhich, sal_Bool bInParent=sal_True ) const; sal_Bool GetAttr( SfxItemSet& rSet, sal_Bool bInParent=sal_True ) const; - // --> OD 2008-03-13 #refactorlists# // made virtual virtual sal_Bool SetAttr( const SfxPoolItem& ); virtual sal_Bool SetAttr( const SfxItemSet& rSet ); virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 ); virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr ); virtual sal_uInt16 ResetAllAttr(); - // <-- - // liefert das Attribut, das nicht ueber die bedingte Vorlage kommt! + // Obtains attribute that is not delivered via conditional style! const SfxPoolItem* GetNoCondAttr( sal_uInt16 nWhich, sal_Bool bInParents ) const; - // hat der Node schon eigene Auto-Attribute ? - // Zugriff auf SwAttrSet + // Does node has already its own auto-attributes? + // Access to SwAttrSet. inline const SwAttrSet &GetSwAttrSet() const; inline const SwAttrSet *GetpSwAttrSet() const { return static_cast<const SwAttrSet*>(mpAttrSet.get()); } inline sal_Bool HasSwAttrSet() const { return mpAttrSet ? sal_True : sal_False; } @@ -494,15 +476,14 @@ public: void ChkCondColl(); //FEATURE::CONDCOLL - // invalidiert die am Node gesetzte NumRule. Diese wird - // spaetestend in EndAction einer Shell geupdatet + // Invalidates NumRule at the node. NumRule is updated + // on EndAction of a Shell at the latest. sal_Bool InvalidateNumRule(); - // --> OD 2005-02-21 #i42921# - determines the text direction for a certain + // determines the text direction for a certain // position. Return -1, if text direction could *not* be determined. short GetTextDirection( const SwPosition& rPos, const Point* pPt ) const; - // <-- inline void SetModifyAtAttr( bool bSetModifyAtAttr ) const { mbSetModifyAtAttr = bSetModifyAtAttr; } inline bool GetModifyAtAttr() const { return mbSetModifyAtAttr; } @@ -510,7 +491,7 @@ public: static SwOLENodes* CreateOLENodesArray( const SwFmtColl& rColl, bool bOnlyWithInvalidSize ); private: - // privater Constructor, weil nie kopiert werden darf !! + // Private constructor because copying is never allowed!! SwCntntNode( const SwCntntNode & rNode ); SwCntntNode & operator= ( const SwCntntNode & rNode ); }; @@ -534,24 +515,22 @@ public: SwTable& GetTable() { return *pTable; } SwTabFrm *MakeFrm( SwFrm* ); - //Legt die Frms fuer den TableNode (also die TabFrms) an. + // Creates the frms for the table node (i.e. the TabFrms). void MakeFrms( SwNodeIndex* pIdxBehind ); - //Methode loescht fuer den Node alle Ansichten vom - //Dokument. Die Contentframes werden aus dem entsprechenden - //Layout ausgehaengt. + // Method deletes all views of document for the node. + // The content frames are removed from the respective layout. void DelFrms(); - //Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom - //Dokument. Die erzeugten Contentframes werden in das entsprechende - //Layout gehaengt. + // Method creates all views of the document for the previous node. + // The content frames that are created are put into the respective layout. void MakeFrms( const SwNodeIndex & rIdx ); SwTableNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const; void SetNewTable( SwTable* , sal_Bool bNewFrames=sal_True ); private: - // privater Constructor, weil nie kopiert werden darf !! + // Private constructor because copying is never allowed!! SwTableNode( const SwTableNode & rNode ); SwTableNode & operator= ( const SwTableNode & rNode ); }; @@ -581,36 +560,36 @@ public: SwFrm *MakeFrm( SwFrm* ); - //Legt die Frms fuer den SectionNode (also die SectionFrms) an. - //Im Defaultfall wird bis die Frames bis zum Ende des Bereichs angelegt, - //uebergibt man einen weiteren NodeIndex pEnd, so wird bis zu diesem - //ein MakeFrms gerufen, genutzt wird dies von TableToText + // Creates the frms for the SectionNode (i.e. the SectionFrms). + // On default the frames are created until the end of the range. + // When another NodeIndex pEnd is passed a MakeFrms is called up to it. + // Used by TableToText. void MakeFrms( SwNodeIndex* pIdxBehind, SwNodeIndex* pEnd = NULL ); - //Methode loescht fuer den Node alle Ansichten vom - //Dokument. Die Contentframes werden aus dem entsprechenden - //Layout ausgehaengt. + // Method deletes all views of document for the node. The + // content frames are removed from the respective layout. void DelFrms(); - //Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom - //Dokument. Die erzeugten Contentframes werden in das entsprechende - //Layout gehaengt. + // Method creates all views of document for the previous node. + // The content frames created are put into the respective layout. void MakeFrms( const SwNodeIndex & rIdx ); SwSectionNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const; - // setze den Verweis im Format der Section auf sich selbst + // Set pointer in format of section on itself. void NodesArrChgd(); // ueberprueft bei _nicht_ versteckten Bereichen, ob es Inhalt gibt, der // _nicht_ in einem versteckten (Unter-)Bereich liegt + // Check for not hidden areas whether there is content that is not in + // a hidden sub-area. sal_Bool IsCntntHidden() const; + }; -// ---------------------- einige inline Methoden ---------------------- inline SwEndNode *SwNode::GetEndNode() { return ND_ENDNODE == nNodeType ? (SwEndNode*)this : 0; @@ -766,3 +745,5 @@ inline const SfxPoolItem& SwCntntNode::GetAttr( sal_uInt16 nWhich, return GetSwAttrSet().Get( nWhich, bInParents ); } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |