OSDN Git Service

crystaledit: Use GetProfile*()/WriteProfile*() to read and write the registry wheneve...
[winmerge-jp/winmerge-jp.git] / Src / GhostTextBuffer.h
index 39f0234..7751e7a 100644 (file)
@@ -21,7 +21,7 @@
  */
 enum GHOST_LINEFLAGS
 {
-       LF_GHOST = 0x00400000L, /**< Ghost line. */
+       LF_GHOST = 0x00400000UL, /**< Ghost line. */
 };
 
 /////////////////////////////////////////////////////////////////////////////
@@ -59,7 +59,9 @@ private:
 
        // Operations
 private:
+#if 0
        bool InternalInsertGhostLine (CCrystalTextView * pSource, int nLine);
+#endif
        bool InternalDeleteGhostLine (CCrystalTextView * pSource, int nLine, int nCount);
 public :
        // Construction/destruction code
@@ -72,25 +74,30 @@ public :
        */
        virtual void GetTextWithoutEmptys (int nStartLine, int nStartChar,
                        int nEndLine, int nEndChar, CString &text,
-                       CRLFSTYLE nCrlfStyle =CRLF_STYLE_AUTOMATIC,
-                       bool bExcludeInvisibleLines = true);
+                       CRLFSTYLE nCrlfStyle =CRLFSTYLE::AUTOMATIC,
+                       bool bExcludeInvisibleLines = true) const override;
 
+       virtual bool IsIndentableLine(int nLine) const override { return (GetLineFlags(nLine) & LF_GHOST) == 0; }
 
        // Text modification functions
        virtual bool InsertText (CCrystalTextView * pSource, int nLine, int nPos,
-               LPCTSTR pszText, int cchText, int &nEndLine, int &nEndChar,
-               int nAction = CE_ACTION_UNKNOWN, bool bHistory =true);
+               LPCTSTR pszText, size_t cchText, int &nEndLine, int &nEndChar,
+               int nAction = CE_ACTION_UNKNOWN, bool bHistory =true) override;
        virtual bool DeleteText2 (CCrystalTextView * pSource, int nStartLine,
                int nStartPos, int nEndLine, int nEndPos,
-               int nAction = CE_ACTION_UNKNOWN, bool bHistory =true);
+               int nAction = CE_ACTION_UNKNOWN, bool bHistory =true) override;
+#if 0
        bool InsertGhostLine (CCrystalTextView * pSource, int nLine);
+#endif
 
        virtual void AddUndoRecord (bool bInsert, const CPoint & ptStartPos, const CPoint & ptEndPos,
-                                   LPCTSTR pszText, int cchText, int nActionType = CE_ACTION_UNKNOWN, CDWordArray *paSavedRevisionNumbers = NULL);
-       virtual UndoRecord GetUndoRecord(int nUndoPos) const;
+                                   LPCTSTR pszText, size_t cchText, int nActionType = CE_ACTION_UNKNOWN, CDWordArray *paSavedRevisionNumbers = nullptr) override;
+       virtual UndoRecord GetUndoRecord(int nUndoPos) const override;
+       virtual bool UndoInsert(CCrystalTextView * pSource, CPoint & ptCursorPos,
+                                                       const CPoint apparent_ptStartPos, CPoint const apparent_ptEndPos, const UndoRecord & ur) override;
 
-       virtual CDWordArray *CopyRevisionNumbers(int nStartLine, int nEndLine) const;
-       virtual void RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisionNumbers);
+       virtual CDWordArray *CopyRevisionNumbers(int nStartLine, int nEndLine) const override;
+       virtual void RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisionNumbers) override;
 
 public:
        //@{
@@ -119,8 +126,9 @@ public:
 
 private:
        void RecomputeRealityMapping();
+       void CountEolAndLastLineLength(const CPoint& ptStartPos, LPCTSTR pszText, size_t cchText, int& nLastLineLength, int& nEol);
        /** For debugging purpose */
-       void checkFlagsFromReality(bool bFlag) const;
+       void checkFlagsFromReality() const;
 
 protected:
        virtual void OnNotifyLineHasBeenEdited(int nLine);