From fe16c1aab89e0f5fa40bab36d5676e3ad6ec3340 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Tue, 16 Oct 2018 08:51:43 +0200 Subject: [PATCH] Don't import ogdf namespace Signed-off-by: Sven Strickroth --- src/TortoiseProc/RevisionGraph/RevisionGraphDlgDraw.cpp | 17 ++++++----------- src/TortoiseProc/RevisionGraph/RevisionGraphDlgFunc.cpp | 13 +++++-------- src/TortoiseProc/RevisionGraph/RevisionGraphWnd.cpp | 17 ++++++++--------- 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/src/TortoiseProc/RevisionGraph/RevisionGraphDlgDraw.cpp b/src/TortoiseProc/RevisionGraph/RevisionGraphDlgDraw.cpp index ac395d5dc..8f868e074 100644 --- a/src/TortoiseProc/RevisionGraph/RevisionGraphDlgDraw.cpp +++ b/src/TortoiseProc/RevisionGraph/RevisionGraphDlgDraw.cpp @@ -42,7 +42,6 @@ static char THIS_FILE[] = __FILE__; #endif using namespace Gdiplus; -using namespace ogdf; Color GetColorFromSysColor(int nIndex) { @@ -333,7 +332,7 @@ RectF CRevisionGraphWnd::TransformRectToScreen (const CRect& rect, const CSize& } -RectF CRevisionGraphWnd::GetNodeRect (const node& node, const CSize& offset) const +RectF CRevisionGraphWnd::GetNodeRect(const ogdf::node& node, const CSize& offset) const { // get node and position @@ -817,7 +816,7 @@ void CRevisionGraphWnd::DrawStripes (GraphicsDevice& graphics, const CSize& offs } #endif -PointF CRevisionGraphWnd::cutPoint(node v,double lw,PointF ps, PointF pt) +PointF CRevisionGraphWnd::cutPoint(ogdf::node v, double lw, PointF ps, PointF pt) { double x = m_GraphAttr.x(v); double y = m_GraphAttr.y(v); @@ -882,11 +881,11 @@ void CRevisionGraphWnd::DrawConnections (GraphicsDevice& graphics, const CRect& Gdiplus::Pen pen(GetColorFromSysColor(COLOR_WINDOWTEXT), penwidth); // iterate over all visible lines - edge e; + ogdf::edge e; forall_edges(e, m_Graph) { // get connection and point position - const DPolyline &dpl = this->m_GraphAttr.bends(e); + const auto& dpl = this->m_GraphAttr.bends(e); points.RemoveAll(); pts.RemoveAll(); @@ -897,8 +896,7 @@ void CRevisionGraphWnd::DrawConnections (GraphicsDevice& graphics, const CRect& points.Add(pt); - ListConstIterator it; - for(it = dpl.begin(); it.valid(); ++it) + for (auto it = dpl.begin(); it.valid(); ++it) { pt.X = (REAL)(*it).m_x; pt.Y = (REAL)(*it).m_y; @@ -995,13 +993,10 @@ void CRevisionGraphWnd::DrawTexts (GraphicsDevice& graphics, const CRect& /*logR DWORD revGraphUseLocalForCur = CRegDWORD(L"Software\\TortoiseGit\\TortoiseProc\\Graph\\RevGraphUseLocalForCur"); - node v; + ogdf::node v; forall_nodes(v,m_Graph) { // get node and position - - String label=this->m_GraphAttr.labelNode(v); - RectF noderect (GetNodeRect (v, offset)); // draw the revision text diff --git a/src/TortoiseProc/RevisionGraph/RevisionGraphDlgFunc.cpp b/src/TortoiseProc/RevisionGraph/RevisionGraphDlgFunc.cpp index 318f66d70..66dddbcec 100644 --- a/src/TortoiseProc/RevisionGraph/RevisionGraphDlgFunc.cpp +++ b/src/TortoiseProc/RevisionGraph/RevisionGraphDlgFunc.cpp @@ -1,4 +1,4 @@ -// TortoiseGit - a Windows shell extension for easy version control +// TortoiseGit - a Windows shell extension for easy version control // Copyright (C) 2003-2011 - TortoiseSVN // Copyright (C) 2012-2018 - TortoiseGit @@ -44,7 +44,6 @@ static char THIS_FILE[] = __FILE__; #endif using namespace Gdiplus; -using namespace ogdf; void CRevisionGraphWnd::InitView() { @@ -213,7 +212,7 @@ bool CRevisionGraphWnd::FetchRevisionData ReloadHashMap(); this->m_Graph.clear(); - CArray nodes; + CArray nodes; GraphicsDevice dev; dev.pDC = this->GetDC(); dev.graphics = Graphics::FromHDC(dev.pDC->m_hDC); @@ -223,8 +222,7 @@ bool CRevisionGraphWnd::FetchRevisionData for (size_t i = 0; i < m_logEntries.size(); ++i) { - node nd; - nd = this->m_Graph.newNode(); + auto nd = m_Graph.newNode(); nodes.Add(nd); m_GraphAttr.width(nd)=100; m_GraphAttr.height(nd)=20; @@ -242,8 +240,7 @@ bool CRevisionGraphWnd::FetchRevisionData { TRACE(L"Can't found parent node"); //new parent node as new node - node nd; - nd = this->m_Graph.newNode(); + auto nd = this->m_Graph.newNode(); m_Graph.newEdge(nodes[i], nd); m_logEntries.push_back(rev.m_ParentHash[j]); m_logEntries.m_HashMap[rev.m_ParentHash[j]] = (int)m_logEntries.size() -1; @@ -264,7 +261,7 @@ bool CRevisionGraphWnd::FetchRevisionData m_SugiyamLayout.call(m_GraphAttr); - node v; + ogdf::node v; double xmax = 0; double ymax = 0; forall_nodes(v,m_Graph) diff --git a/src/TortoiseProc/RevisionGraph/RevisionGraphWnd.cpp b/src/TortoiseProc/RevisionGraph/RevisionGraphWnd.cpp index 96ad7a9d0..a56645a82 100644 --- a/src/TortoiseProc/RevisionGraph/RevisionGraphWnd.cpp +++ b/src/TortoiseProc/RevisionGraph/RevisionGraphWnd.cpp @@ -53,7 +53,6 @@ static char THIS_FILE[] = __FILE__; #endif using namespace Gdiplus; -using namespace ogdf; enum RevisionGraphContextMenuCommands { @@ -175,7 +174,7 @@ CRevisionGraphWnd::CRevisionGraphWnd() this->m_Graph.newEdge(three, four); #endif - FastHierarchyLayout *pOHL = ::new FastHierarchyLayout; + auto pOHL = ::new ogdf::FastHierarchyLayout; //It will auto delte when m_SugiyamLayout destroy pOHL->layerDistance(30.0); @@ -335,7 +334,7 @@ CPoint CRevisionGraphWnd::GetLogCoordinates (CPoint point) const , (int)((point.y + nVScrollPos) / m_fZoomFactor)); } -node CRevisionGraphWnd::GetHitNode (CPoint point, CSize /*border*/) const +ogdf::node CRevisionGraphWnd::GetHitNode(CPoint point, CSize /*border*/) const { #if 0 // any nodes at all? @@ -349,7 +348,7 @@ node CRevisionGraphWnd::GetHitNode (CPoint point, CSize /*border*/) const return nodeList->GetAt (GetLogCoordinates (point), border); #endif - node v; + ogdf::node v; forall_nodes(v,m_Graph) { RectF noderect (GetNodeRect (v, CPoint(GetScrollPos(SB_HORZ), GetScrollPos(SB_VERT)))); @@ -585,7 +584,7 @@ void CRevisionGraphWnd::OnLButtonDown(UINT nFlags, CPoint point) return __super::OnLButtonDown(nFlags, point); } #endif - node nodeIndex = GetHitNode (point); + auto nodeIndex = GetHitNode(point); if (nodeIndex) { if (bControl) @@ -732,7 +731,7 @@ INT_PTR CRevisionGraphWnd::OnToolHitTest(CPoint point, TOOLINFO* pTI) const if (IsUpdateJobRunning()) return -1; - node nodeIndex = GetHitNode (point); + auto nodeIndex = GetHitNode(point); if (m_tooltipIndex != nodeIndex) { // force tooltip to be updated @@ -904,7 +903,7 @@ CString CRevisionGraphWnd::DisplayableText ( const CString& wholeText return result; } -CString CRevisionGraphWnd::TooltipText(node index) +CString CRevisionGraphWnd::TooltipText(ogdf::node index) { if(index) { @@ -1106,7 +1105,7 @@ void CRevisionGraphWnd::OnMouseHWheel(UINT nFlags, short zDelta, CPoint pt) return __super::OnMouseHWheel(nFlags, zDelta, pt); } -bool CRevisionGraphWnd::UpdateSelectedEntry (node clickedentry) +bool CRevisionGraphWnd::UpdateSelectedEntry(ogdf::node clickedentry) { if (!m_SelectedEntry1 && !clickedentry) return false; @@ -1418,7 +1417,7 @@ void CRevisionGraphWnd::OnContextMenu(CWnd* /*pWnd*/, CPoint point) CPoint clientpoint = point; this->ScreenToClient(&clientpoint); - node nodeIndex = GetHitNode (clientpoint); + auto nodeIndex = GetHitNode(clientpoint); if ( !UpdateSelectedEntry (nodeIndex)) return; -- 2.11.4.GIT