GridCtrl: Removed blank column from text clipboard

git-svn-id: svn://ultimatepp.org/upp/trunk@5613 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
unodgs 2012-12-02 14:25:08 +00:00
parent c0a565b8a5
commit 65cd7f32bd

View file

@ -675,6 +675,7 @@ void GridCtrl::SetClipboard(bool all, bool silent)
bool row_selected = select_row && IsSelected(i, false);
for(int j = fixed_cols; j < total_cols; j++)
{
if(all || row_selected || IsSelected(i, j, false))
{
if(prev_row < 0)
@ -699,8 +700,15 @@ void GridCtrl::SetClipboard(bool all, bool silent)
sc[j] = 1;
}
}
int cnt = body.GetCount();
if(cnt > 0 && body[cnt - 1] == '\t')
body.Remove(cnt - 1);
}
LOG(body);
String header;
if(copy_column_names)
@ -708,7 +716,10 @@ void GridCtrl::SetClipboard(bool all, bool silent)
for(int i = 0; i < sc.GetCount(); i++)
if(sc[i] >= 0)
header += hitems[i].GetName() + '\t';
int cnt = header.GetCount();
if(cnt > 0 && header[cnt - 1] == '\t')
header.Remove(cnt - 1);
header += "\r\n";
}