diff options
-rw-r--r-- | plugins/QuickSearch/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/QuickSearch/src/window_misc.cpp | 7 |
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"); |