|
|
@@ -4396,14 +4396,8 @@ begin
|
|
|
Result := ws;
|
|
|
end;
|
|
|
|
|
|
-//------------------------------------------------------------------------------
|
|
|
-
|
|
|
-
|
|
|
function TTalkingForm.PasteImage(AUseTemp: Boolean = True): Boolean;
|
|
|
var
|
|
|
- //vMetafile: TMetafile;
|
|
|
-
|
|
|
-
|
|
|
Picture: TPicture;
|
|
|
Bitmap: TBitmap;
|
|
|
GIF: TGIFImage;
|
|
|
@@ -4425,16 +4419,9 @@ begin
|
|
|
Result := False;
|
|
|
ClipboardText := Clipboard.AsText;
|
|
|
|
|
|
+ /// 如果复制内容是文件
|
|
|
if Clipboard.HasFormat(CF_HDROP) and ((not Clipboard.HasFormat(CF_METAFILEPICT)) and (not Clipboard.HasFormat(CF_PICTURE))) then
|
|
|
begin
|
|
|
-// if FCategory = tcTeam then
|
|
|
-// begin
|
|
|
-// Result := True;
|
|
|
-// Exit;
|
|
|
-// end;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
GetMem(PFileName, MAX_PATH + 1);
|
|
|
DataHandle := Clipboard.GetAsHandle(CF_HDROP);
|
|
|
FilesCount := DragQueryFile(DataHandle, MAXDWORD, PFileName, MAX_PATH);
|
|
|
@@ -4469,6 +4456,7 @@ begin
|
|
|
|
|
|
//粘贴HTML数据
|
|
|
CF_HTML := RegisterClipboardFormat('HTML Format');
|
|
|
+ ///如果复制内容是HTML
|
|
|
if Clipboard.HasFormat(CF_HTML) and not ((Length(ClipboardText) > 0) and (tabCount > 0) and (tabCount >= returnCount) and (Clipboard.HasFormat(CF_METAFILEPICT))) then
|
|
|
begin
|
|
|
Screen.Cursor := crHourGlass;
|
|
|
@@ -4482,22 +4470,12 @@ begin
|
|
|
StrHTML := GetHTMLUBBCode(StrHTML, ABaseURL);
|
|
|
RichEditTemp.Clear;
|
|
|
RichEditTemp.Lines.Add(StrHTML);
|
|
|
- APasted := ReAlighHTMLContent(ABaseURL);
|
|
|
+ ///提取出HTML中的图片
|
|
|
+ Result := ReAlighHTMLContent(ABaseURL);
|
|
|
finally
|
|
|
Screen.Cursor := crDefault;
|
|
|
end;
|
|
|
-
|
|
|
- if (not APasted) then
|
|
|
- begin
|
|
|
-
|
|
|
-// Result := False;
|
|
|
-// Exit;
|
|
|
- end
|
|
|
- else
|
|
|
- begin
|
|
|
- Result := True;
|
|
|
- Exit;
|
|
|
- end;
|
|
|
+ Exit;
|
|
|
end;
|
|
|
|
|
|
{$region '先在临时RichEdit中粘贴'}
|
|
|
@@ -4505,32 +4483,29 @@ begin
|
|
|
begin
|
|
|
RichEditTemp.Clear;
|
|
|
RichEditTemp.PasteFromClipboard;
|
|
|
- AIndexes := RichEditTemp.GetFaceIndexes;
|
|
|
-
|
|
|
+ AIndexes := RichEditTemp.GetFaceIndexes;
|
|
|
if High(AIndexes) = 0 then //只有一个对象
|
|
|
-
|
|
|
- begin
|
|
|
+
begin
|
|
|
AFaceInRichEdit := AIndexes[0];
|
|
|
if AFaceInRichEdit.FaceIndex > 0 then //已经是表情对象
|
|
|
-
|
|
|
- begin
|
|
|
+
begin
|
|
|
Result := False;
|
|
|
RichEditTemp.Clear;
|
|
|
- Exit;
|
|
|
end
|
|
|
else if ((not Clipboard.HasFormat(CF_METAFILEPICT)) and (not Clipboard.HasFormat(CF_PICTURE))) then
|
|
|
begin
|
|
|
Result := True;
|
|
|
RichEditTemp.Clear;
|
|
|
- Exit;
|
|
|
end;
|
|
|
end;
|
|
|
+ Exit;
|
|
|
end;
|
|
|
{$endregion}
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
+ ///截图
|
|
|
if Clipboard.HasFormat(CF_METAFILEPICT) then
|
|
|
begin
|
|
|
if (Length(ClipboardText) > 0) and (tabCount > 0) and (tabCount >= returnCount) then
|
|
|
@@ -4586,9 +4561,9 @@ begin
|
|
|
on E: Exception do
|
|
|
Error(E.Message, 'TTalkingForm.PasteImage');
|
|
|
end;
|
|
|
+ RichEdInputer.PasteFromClipboard;
|
|
|
end;
|
|
|
-//------------------------------------------------------------------------------
|
|
|
-
|
|
|
+
|
|
|
|
|
|
procedure TTalkingForm.btCloseClick(Sender: TObject);
|
|
|
begin
|