On Friday, May 17, 2013, Michael Shapiro wrote:
> I am running 1.16.1 (Windows 7). I can reproduce this. It makes a
> difference, though, if you use ctrl-c vs the right-click/Copy. ctrl-c does
> the whole entry, right-click/Copy gets just what is highlighted. ctrl-c
> gets the whole entry even if nothing is highlighted.
>
>
> On Fri, May 17, 2013 at 5:34 AM, Kieran
> <[email protected]<javascript:_e({}, 'cvml',
> '[email protected]');>
> > wrote:
>
>> Hi
>>
>> Sorry if this has been raised before, but it's been a nuisance to me for
>> quite a while and I thought I should mention it.
>>
>> To reproduce the problem :-
>>
>> 1. Open the Edit Data window on a table
>> 2. Click into a text field containing some text and highlight a single
>> word
>> 3. Paste what you have just copied.
>>
>> You will get the whole contents of the field not what you just
>> highlighted.
>>
>> My environment is
>> Windows Vista
>> pgAdmin 1.16.1
>>
>>
I believe the attached patch fixes this. With it, if you're in Edit Mode in
a cell, then Copy works more like it would in a regular text box - only the
highlighted text is copied, and there are no quotes etc. added. In View
Mode, whatever cells are selected will be copied, and quoting/delimiting
applied.
Can someone review it please (Dhiraj :-p )?
Thanks.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
[1mdiff --git a/pgadmin/ctl/ctlSQLGrid.cpp b/pgadmin/ctl/ctlSQLGrid.cpp[m
[1mindex 9d1a533..a217283 100644[m
[1m--- a/pgadmin/ctl/ctlSQLGrid.cpp[m
[1m+++ b/pgadmin/ctl/ctlSQLGrid.cpp[m
[36m@@ -25,7 +25,6 @@[m
#define EXTRAEXTENT_WIDTH 6[m
[m
BEGIN_EVENT_TABLE(ctlSQLGrid, wxGrid)[m
[31m- EVT_MENU(MNU_COPY, ctlSQLGrid::OnCopy)[m
EVT_MOUSEWHEEL(ctlSQLGrid::OnMouseWheel)[m
END_EVENT_TABLE()[m
[m
[36m@@ -51,11 +50,6 @@[m [mctlSQLGrid::ctlSQLGrid(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons[m
SetColLabelSize(fntLabel.GetPointSize() * 4);[m
SetDefaultCellOverflow(false);[m
[m
[31m- wxAcceleratorEntry entries[1];[m
[31m- entries[0].Set(wxACCEL_CTRL, (int)'C', MNU_COPY);[m
[31m- wxAcceleratorTable accel(1, entries);[m
[31m- SetAcceleratorTable(accel);[m
[31m-[m
Connect(wxID_ANY, wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEventHandler(ctlSQLGrid::OnLabelDoubleClick));[m
}[m
[m
[1mdiff --git a/pgadmin/frm/frmEditGrid.cpp b/pgadmin/frm/frmEditGrid.cpp[m
[1mindex 8df535b..2cd9327 100644[m
[1m--- a/pgadmin/frm/frmEditGrid.cpp[m
[1m+++ b/pgadmin/frm/frmEditGrid.cpp[m
[36m@@ -732,15 +732,22 @@[m [mvoid frmEditGrid::OnCopy(wxCommandEvent &ev)[m
if (sqlGrid->GetTable()->IsColText(sqlGrid->GetGridCursorCol()))[m
{[m
wxStyledTextCtrl *text = (wxStyledTextCtrl *)sqlGrid->GetCellEditor(sqlGrid->GetGridCursorRow(), sqlGrid->GetGridCursorCol())->GetControl();[m
[31m- if (text)[m
[32m+[m [32mif (text && !text->GetSelectedText().IsEmpty())[m
[32m+[m [32m{[m
wxTheClipboard->SetData(new wxTextDataObject(text->GetSelectedText()));[m
[32m+[m [32mSetStatusText(_("Data from one cell copied to clipboard."));[m
[32m+[m [32m}[m
}[m
else[m
{[m
wxTextCtrl *text = (wxTextCtrl *)sqlGrid->GetCellEditor(sqlGrid->GetGridCursorRow(), sqlGrid->GetGridCursorCol())->GetControl();[m
[31m- if (text)[m
[32m+[m [32mif (text && !text->GetStringSelection().IsEmpty())[m
[32m+[m [32m{[m
wxTheClipboard->SetData(new wxTextDataObject(text->GetStringSelection()));[m
[32m+[m [32mSetStatusText(_("Data from one cell copied to clipboard."));[m
[32m+[m [32m}[m
}[m
[32m+[m
wxTheClipboard->Close();[m
}[m
}[m
--
Sent via pgadmin-support mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support