• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28964 (tree)
Zeit2020-09-16 01:56:14
Autorstefankueng

Log Message

use DrawText instead of ExtTextOut in all other places where necessary.

Ändern Zusammenfassung

Diff

--- trunk/src/SVN/SVNStatusListCtrl.cpp (revision 28963)
+++ trunk/src/SVN/SVNStatusListCtrl.cpp (revision 28964)
@@ -4869,7 +4869,7 @@
48694869 RECT labelRect = { 0 };
48704870 labelRect.top = LVGGR_LABEL;
48714871 SendMessage(LVM_GETGROUPRECT, pLVCD->nmcd.dwItemSpec, (LPARAM)&labelRect);
4872- ExtTextOut(pLVCD->nmcd.hdc, labelRect.left, labelRect.top, ETO_CLIPPED, &labelRect, gInfo.pszHeader, gInfo.cchHeader, nullptr);
4872+ ::DrawText(pLVCD->nmcd.hdc, gInfo.pszHeader, gInfo.cchHeader, &labelRect, DT_HIDEPREFIX | DT_NOPREFIX | DT_SINGLELINE);
48734873
48744874 RECT groupRect = { 0 };
48754875 groupRect.top = LVGGR_HEADER;
--- trunk/src/TortoiseBlame/TortoiseBlame.cpp (revision 28963)
+++ trunk/src/TortoiseBlame/TortoiseBlame.cpp (revision 28964)
@@ -1639,7 +1639,10 @@
16391639 else
16401640 wcscpy_s(buf, L" ---- ");
16411641 rc.right = rc.left + m_revWidth;
1642- ::ExtTextOut(hDC, 0, (int)Y, ETO_CLIPPED, &rc, buf, (UINT)wcslen(buf), 0);
1642+ RECT drawRC = rc;
1643+ drawRC.left = 0;
1644+ drawRC.top = (LONG)Y;
1645+ ::DrawText(hDC, buf, (int)wcslen(buf), &drawRC, DT_HIDEPREFIX | DT_NOPREFIX | DT_SINGLELINE);
16431646 int Left = m_revWidth;
16441647 if (ShowDate)
16451648 {
@@ -1652,7 +1655,10 @@
16521655 {
16531656 rc.right = rc.left + Left + m_authorWidth;
16541657 swprintf_s(buf, L"%-30s ", author.c_str());
1655- ::ExtTextOut(hDC, Left, (int)Y, ETO_CLIPPED, &rc, buf, (UINT)wcslen(buf), 0);
1658+ drawRC = rc;
1659+ drawRC.left = Left;
1660+ drawRC.top = (LONG)Y;
1661+ ::DrawText(hDC, buf, (int)wcslen(buf), &drawRC, DT_HIDEPREFIX | DT_NOPREFIX | DT_SINGLELINE);
16561662 Left += m_authorWidth;
16571663 }
16581664 if (ShowPath && !m_mergedPaths.empty())
@@ -1659,7 +1665,10 @@
16591665 {
16601666 rc.right = rc.left + Left + m_pathWidth;
16611667 swprintf_s(buf, L"%-60s ", m_mergedPaths[i].c_str());
1662- ::ExtTextOut(hDC, Left, (int)Y, ETO_CLIPPED, &rc, buf, (UINT)wcslen(buf), 0);
1668+ drawRC = rc;
1669+ drawRC.left = Left;
1670+ drawRC.top = (LONG)Y;
1671+ ::DrawText(hDC, buf, (int)wcslen(buf), &drawRC, DT_HIDEPREFIX | DT_NOPREFIX | DT_SINGLELINE);
16631672 Left += m_authorWidth;
16641673 }
16651674 if ((i == m_selectedLine) && (currentDialog))
--- trunk/src/TortoiseIDiff/PicWindow.cpp (revision 28963)
+++ trunk/src/TortoiseIDiff/PicWindow.cpp (revision 28964)
@@ -631,25 +631,19 @@
631631 {
632632 int nStringLength = stringsize.cx;
633633 int texttop = pSecondPic ? textrect.top + (header_height /2) - stringsize.cy : textrect.top + (header_height /2) - stringsize.cy/2;
634- ExtTextOut(hDC,
635- max(textrect.left + ((textrect.right-textrect.left)-nStringLength)/2, 1),
636- texttop,
637- ETO_CLIPPED,
638- &textrect,
639- realtitle.c_str(),
640- (UINT)realtitle.size(),
641- nullptr);
634+
635+ RECT drawRC = textrect;
636+ drawRC.left = max(textrect.left + ((textrect.right - textrect.left) - nStringLength) / 2, 1);
637+ drawRC.top = texttop;
638+ ::DrawText(hDC, realtitle.c_str(), (int)realtitle.size(), &drawRC, DT_HIDEPREFIX | DT_NOPREFIX | DT_SINGLELINE);
639+
642640 if (pSecondPic)
643641 {
644642 realtitle = (pictitle2.empty() ? picpath2 : pictitle2);
645- ExtTextOut(hDC,
646- max(textrect.left + ((textrect.right-textrect.left)-nStringLength)/2, 1),
647- texttop + stringsize.cy,
648- ETO_CLIPPED,
649- &textrect,
650- realtitle.c_str(),
651- (UINT)realtitle.size(),
652- nullptr);
643+ drawRC = textrect;
644+ drawRC.left = max(textrect.left + ((textrect.right - textrect.left) - nStringLength) / 2, 1);
645+ drawRC.top = texttop + stringsize.cy;
646+ ::DrawText(hDC, realtitle.c_str(), (int)realtitle.size(), &drawRC, DT_HIDEPREFIX | DT_NOPREFIX | DT_SINGLELINE);
653647 }
654648 }
655649 if (HasMultipleImages())
@@ -658,14 +652,10 @@
658652 {
659653 int nStringLength = stringsize.cx;
660654
661- ExtTextOut(hDC,
662- max(textrect.left + ((textrect.right-textrect.left)-nStringLength)/2, 1),
663- textrect.top + header_height + (header_height /2) - stringsize.cy/2,
664- ETO_CLIPPED,
665- &textrect,
666- imgnumstring.c_str(),
667- (UINT)imgnumstring.size(),
668- nullptr);
655+ RECT drawRC = textrect;
656+ drawRC.left = max(textrect.left + ((textrect.right - textrect.left) - nStringLength) / 2, 1);
657+ drawRC.top = textrect.top + header_height + (header_height / 2) - stringsize.cy / 2;
658+ ::DrawText(hDC, imgnumstring.c_str(), (int)imgnumstring.size(), &drawRC, DT_HIDEPREFIX | DT_NOPREFIX | DT_SINGLELINE);
669659 }
670660 }
671661 SelectObject(hDC, (HGDIOBJ)hFontOld);
@@ -1377,14 +1367,10 @@
13771367 {
13781368 int nStringLength = stringsize.cx;
13791369
1380- ExtTextOut(memDC,
1381- max(rect.left + ((rect.right-rect.left)-nStringLength)/2, 1),
1382- rect.top + ((rect.bottom-rect.top) - stringsize.cy)/2,
1383- ETO_CLIPPED,
1384- &rect,
1385- str,
1386- (UINT)wcslen(str),
1387- nullptr);
1370+ RECT drawRC = rect;
1371+ drawRC.left = max(rect.left + ((rect.right - rect.left) - nStringLength) / 2, 1);
1372+ drawRC.top = rect.top + ((rect.bottom - rect.top) - stringsize.cy) / 2;
1373+ ::DrawText(memDC, str, (int)wcslen(str), &drawRC, DT_HIDEPREFIX | DT_NOPREFIX | DT_SINGLELINE);
13881374 }
13891375 SelectObject(memDC, (HGDIOBJ)hFontOld);
13901376 DeleteObject(hFont);
--- trunk/src/TortoiseProc/RevisionGraph/RevisionGraphDlgDraw.cpp (revision 28963)
+++ trunk/src/TortoiseProc/RevisionGraph/RevisionGraphDlgDraw.cpp (revision 28964)
@@ -958,7 +958,7 @@
958958 // iterate over all visible nodes
959959
960960 if (graphics.pDC)
961- graphics.pDC->SetTextAlign (TA_CENTER | TA_TOP);
961+ graphics.pDC->SetTextAlign (TA_LEFT | TA_TOP | TA_NOUPDATECP);
962962 CSyncPointer<const ILayoutTextList> texts (m_state.GetTexts());
963963 for ( index_t index = texts->GetFirstVisible (logRect)
964964 ; index != NO_INDEX
@@ -980,7 +980,7 @@
980980 ? CTheme::Instance().GetThemeColor(m_Colors.GetColor (CColors::gdpWCNodeBorder), true).ToCOLORREF()
981981 : standardTextColor );
982982 graphics.pDC->SelectObject (GetFont (FALSE, text.style != ILayoutTextList::SText::STYLE_DEFAULT));
983- graphics.pDC->ExtTextOut ((textRect.left + textRect.right)/2, textRect.top, 0, &textRect, text.text, NULL);
983+ graphics.pDC->DrawText(text.text, &textRect, DT_HIDEPREFIX | DT_NOPREFIX | DT_SINGLELINE | DT_CENTER | DT_TOP);
984984 }
985985 else if (graphics.pSVG)
986986 {
Show on old repository browser