MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / Copy

Method Copy

DebugView++/LogView.cpp:1508–1534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1506}
1507
1508void CLogView::Copy()
1509{
1510 std::ostringstream ss;
1511
1512 if (!m_highlightText.empty())
1513 {
1514 ss << Str(m_highlightText);
1515 }
1516 else
1517 {
1518 int item = -1;
1519 while ((item = GetNextItem(item, LVNI_ALL | LVNI_SELECTED)) >= 0)
1520 ss << GetItemText(item) << "\r\n";
1521 }
1522 const std::string& str = ss.str();
1523
1524 Win32::HGlobal hdst(GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, str.size() + 1));
1525 Win32::GlobalLock<char> lock(hdst);
1526 std::copy(str.begin(), str.end(), stdext::checked_array_iterator<char*>(lock.Ptr(), str.size()));
1527 lock.Ptr()[str.size()] = '\0';
1528 if (OpenClipboard())
1529 {
1530 EmptyClipboard();
1531 SetClipboardData(CF_TEXT, hdst.release());
1532 CloseClipboard();
1533 }
1534}
1535
1536std::wstring CLogView::GetHighlightText() const
1537{

Callers

nothing calls this directly

Calls 6

StrClass · 0.85
GetItemTextFunction · 0.85
releaseMethod · 0.80
strMethod · 0.45
sizeMethod · 0.45
PtrMethod · 0.45

Tested by

no test coverage detected