mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
.RichEdit/Clip.cpp: clipboard copy in single object selection mode stores the object on system clipboard as QTF / RTF in addition to object-specific clipboard format(s)
git-svn-id: svn://ultimatepp.org/upp/trunk@3195 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d1a1a76afd
commit
f6952c9aad
1 changed files with 14 additions and 12 deletions
|
|
@ -181,23 +181,25 @@ static String sQTF(const Value& data)
|
|||
|
||||
void RichEdit::Copy()
|
||||
{
|
||||
if(IsSelection()) {
|
||||
ClearClipboard();
|
||||
RichText txt = GetSelection();
|
||||
AppendClipboardUnicodeText(txt.GetPlainText());
|
||||
Value clip = RawPickToValue(txt);
|
||||
AppendClipboard("text/QTF", clip, sQTF);
|
||||
AppendClipboard(RTFS, clip, sRTF);
|
||||
RichText txt;
|
||||
if(IsSelection())
|
||||
txt = GetSelection();
|
||||
else if(objectpos >= 0)
|
||||
txt = text.Copy(cursor, 1);
|
||||
else {
|
||||
BeepExclamation();
|
||||
return;
|
||||
}
|
||||
else
|
||||
ClearClipboard();
|
||||
AppendClipboardUnicodeText(txt.GetPlainText());
|
||||
Value clip = RawPickToValue(txt);
|
||||
AppendClipboard("text/QTF", clip, sQTF);
|
||||
AppendClipboard(RTFS, clip, sRTF);
|
||||
if(objectpos >= 0) {
|
||||
RichObject o = GetObject();
|
||||
Vector<String> v = Split(o.GetType().GetClipFmts(), ';');
|
||||
for(int i = 0; i < v.GetCount(); i++) {
|
||||
if(i == 0)
|
||||
ClearClipboard();
|
||||
for(int i = 0; i < v.GetCount(); i++)
|
||||
AppendClipboard(v[i], o.GetType().GetClip(o.GetData(), v[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue