OSDN Git Service

Update RevisionGraph to 15570
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / RevisionGraph / StandardLayoutTextList.cpp
index c8b3082..8e40a3f 100644 (file)
@@ -20,6 +20,7 @@
 #include "StandardLayoutTextList.h"\r
 #include "UnicodeUtils.h"\r
 #include "VisibleGraphNode.h"\r
+#include "resource.h"\r
 \r
 // construction\r
 \r
@@ -67,7 +68,7 @@ index_t CStandardLayoutTextList::GetNextVisible
 \r
 index_t CStandardLayoutTextList::GetAt \r
     ( const CPoint& /* point */\r
-    , long /* delta */) const\r
+    , CSize /* delta */) const\r
 {\r
     return static_cast<index_t>(NO_INDEX);\r
 }\r
@@ -82,34 +83,58 @@ CStandardLayoutTextList::GetText (index_t index) const
     const CStandardLayout::STextInfo& textInfo = texts[index];\r
     const CStandardLayoutNodeInfo& nodeInfo = nodes[textInfo.nodeIndex];\r
 \r
+    bool isModifiedWC = nodeInfo.node->GetClassification().Is \r
+                            (CNodeClassification::IS_MODIFIED_WC);\r
+\r
     CString text;\r
     CRect rect = nodeInfo.rect;\r
     if (textInfo.subPathIndex > 0)\r
     {\r
         rect.top = rect.top + 25 + 21 * (textInfo.subPathIndex-1);\r
 \r
-        CString path = CUnicodeUtils::StdGetUnicode \r
-                         (nodeInfo.node->GetPath().GetPath()).c_str();\r
-        int index = 0;\r
-        for (int i = textInfo.subPathIndex; i > 0; --i)\r
-            text = path.Tokenize (_T("/"), index);\r
-\r
+        size_t index = textInfo.subPathIndex-1 + nodeInfo.skipStartPathElements;\r
+        const CDictionaryBasedTempPath& path = nodeInfo.node->GetPath();\r
+        size_t visibleElementCount = path.GetDepth() \r
+                                   - nodeInfo.skipStartPathElements\r
+                                   - nodeInfo.skipTailPathElements;\r
+        text = CUnicodeUtils::StdGetUnicode (path[index]).c_str();\r
         text.Insert (0, _T('/'));\r
+\r
+        // add "...." pre- and post-fixes, if elements have been skipped\r
+\r
+        if ((textInfo.subPathIndex == 1) && (nodeInfo.skipStartPathElements > 0))\r
+            text.Insert (0, CString ('.', nodeInfo.skipStartPathElements));\r
+\r
+        if (   (visibleElementCount == (size_t)textInfo.subPathIndex) \r
+            && (nodeInfo.skipTailPathElements != 0))\r
+        {\r
+            text.AppendChar (_T('/'));\r
+            text.Append (CString ('.', nodeInfo.skipTailPathElements));\r
+        }\r
     }\r
     else\r
     {\r
-        rect.top += 3;\r
-\r
-        TCHAR buffer[20];\r
-        _itot_s (nodeInfo.node->GetRevision(), buffer, 10);\r
-        text = buffer;\r
+        rect.top += 4;\r
+        if (isModifiedWC)\r
+        {\r
+            text.LoadString (IDS_SVN_SUMMARIZEMODIFIED);\r
+        }\r
+        else\r
+        {\r
+            TCHAR buffer[20];\r
+            _itot_s (nodeInfo.node->GetRevision(), buffer, 10);\r
+            text = buffer;\r
+        }\r
     }\r
 \r
     // construct result\r
 \r
     SText result;\r
 \r
-    result.style = textInfo.subPathIndex == 0;\r
+    result.style = textInfo.subPathIndex == 0\r
+                 ? isModifiedWC ? SText::STYLE_WARNING\r
+                                : SText::STYLE_HEADING\r
+                 : SText::STYLE_DEFAULT;\r
     result.rotation = 0;\r
     result.rect = rect;\r
     result.text = text;\r