summaryrefslogtreecommitdiff
path: root/plugins/QuickSearch/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-05-15 21:16:21 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-05-15 21:16:21 +0300
commitd1caa1504479537d10cce4385688cb0cce9ff7dd (patch)
tree00c07ead7f19c35519ce99a59931b95cc7a0600d /plugins/QuickSearch/src
parent06e1bd18909b1d617b97d18739211ada6446c542 (diff)
for #2881 (p.1, если выделить в окне QS несколько контактов и скопировать, то копируются все контакты, а не только выделенные)
Diffstat (limited to 'plugins/QuickSearch/src')
-rw-r--r--plugins/QuickSearch/src/stdafx.h1
-rw-r--r--plugins/QuickSearch/src/window_misc.cpp7
2 files changed, 7 insertions, 1 deletions
diff --git a/plugins/QuickSearch/src/stdafx.h b/plugins/QuickSearch/src/stdafx.h
index f2a830e9d7..a6cd211e45 100644
--- a/plugins/QuickSearch/src/stdafx.h
+++ b/plugins/QuickSearch/src/stdafx.h
@@ -274,6 +274,7 @@ struct CRowItem : public QSFlags
wchar_t *text = nullptr;
UINT_PTR data = UINT_PTR(-1);
+ wchar_t* getText() const { return (text) ? text : L""; }
void LoadOneItem(MCONTACT hContact, const ColumnItem &pCol, class QSMainDlg *pDlg);
}
*pValues;
diff --git a/plugins/QuickSearch/src/window_misc.cpp b/plugins/QuickSearch/src/window_misc.cpp
index d636374896..9013619723 100644
--- a/plugins/QuickSearch/src/window_misc.cpp
+++ b/plugins/QuickSearch/src/window_misc.cpp
@@ -119,13 +119,18 @@ void QSMainDlg::CopyMultiLines()
buf.Append(L"\r\n");
int nRows = m_grid.GetItemCount();
+ int nSelected = m_grid.GetSelectedCount();
+
for (int j = 0; j < nRows; j++) {
+ if (nSelected > 1 && !m_grid.GetItemState(j, LVIS_SELECTED))
+ continue;
+
auto *pRow = GetRow(j);
i = 0;
for (auto &it : g_plugin.m_columns) {
if (it->bEnabled && it->width >= 10)
- buf.AppendFormat(L"%s\t", pRow->pValues[i].text);
+ buf.AppendFormat(L"%s\t", pRow->pValues[i].getText());
i++;
}
buf.Append(L"\r\n");