- patchlevel 442

This commit is contained in:
Karsten Hopp 2010-06-05 16:10:27 +00:00
parent 98470840fa
commit 99a7ddd462
3 changed files with 264 additions and 2 deletions

256
7.2.442 Normal file
View File

@ -0,0 +1,256 @@
To: vim-dev@vim.org
Subject: Patch 7.2.442
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 7.2.442 (after 7.2.201)
Problem: Copy/paste with OpenOffice doesn't work.
Solution: Do not offer the HTML target when it is not supported. (James
Vega)
Files: src/gui_gtk_x11.c, src/option.c, src/proto/gui_gtk_x11.pro
*** ../vim-7.2.441/src/gui_gtk_x11.c 2010-02-11 18:19:32.000000000 +0100
--- src/gui_gtk_x11.c 2010-06-05 12:42:23.000000000 +0200
***************
*** 1433,1438 ****
--- 1433,1442 ----
}
#endif /* !HAVE_GTK2 */
+ /* Chop off any traiing NUL bytes. OpenOffice sends these. */
+ while (len > 0 && text[len - 1] == NUL)
+ --len;
+
clip_yank_selection(motion_type, text, (long)len, cbd);
received_selection = RS_OK;
vim_free(tmpbuf);
***************
*** 3463,3468 ****
--- 3467,3532 ----
#endif /* FEAT_GUI_TABLINE */
/*
+ * Add selection targets for PRIMARY and CLIPBOARD selections.
+ */
+ void
+ gui_gtk_set_selection_targets(void)
+ {
+ int i, j = 0;
+ int n_targets = N_SELECTION_TARGETS;
+ GtkTargetEntry targets[N_SELECTION_TARGETS];
+
+ for (i = 0; i < (int)N_SELECTION_TARGETS; ++i)
+ {
+ #ifdef FEAT_MBYTE
+ /* OpenOffice tries to use TARGET_HTML and fails when it doesn't
+ * return something, instead of trying another target. Therefore only
+ * offer TARGET_HTML when it works. */
+ if (!clip_html && selection_targets[i].info == TARGET_HTML)
+ n_targets--;
+ else
+ #endif
+ targets[j++] = selection_targets[i];
+ }
+
+ gtk_selection_clear_targets(gui.drawarea, (GdkAtom)GDK_SELECTION_PRIMARY);
+ gtk_selection_clear_targets(gui.drawarea, (GdkAtom)clip_plus.gtk_sel_atom);
+ gtk_selection_add_targets(gui.drawarea,
+ (GdkAtom)GDK_SELECTION_PRIMARY,
+ targets, n_targets);
+ gtk_selection_add_targets(gui.drawarea,
+ (GdkAtom)clip_plus.gtk_sel_atom,
+ targets, n_targets);
+ }
+
+ /*
+ * Set up for receiving DND items.
+ */
+ void
+ gui_gtk_set_dnd_targets(void)
+ {
+ int i, j = 0;
+ int n_targets = N_DND_TARGETS;
+ GtkTargetEntry targets[N_DND_TARGETS];
+
+ for (i = 0; i < (int)N_DND_TARGETS; ++i)
+ {
+ #ifdef FEAT_MBYTE
+ if (!clip_html && selection_targets[i].info == TARGET_HTML)
+ n_targets--;
+ else
+ #endif
+ targets[j++] = dnd_targets[i];
+ }
+
+ gtk_drag_dest_unset(gui.drawarea);
+ gtk_drag_dest_set(gui.drawarea,
+ GTK_DEST_DEFAULT_ALL,
+ targets, n_targets,
+ GDK_ACTION_COPY);
+ }
+
+ /*
* Initialize the GUI. Create all the windows, set up all the callbacks etc.
* Returns OK for success, FAIL when the GUI can't be started.
*/
***************
*** 3925,3939 ****
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_received",
GTK_SIGNAL_FUNC(selection_received_cb), NULL);
! /*
! * Add selection targets for PRIMARY and CLIPBOARD selections.
! */
! gtk_selection_add_targets(gui.drawarea,
! (GdkAtom)GDK_SELECTION_PRIMARY,
! selection_targets, N_SELECTION_TARGETS);
! gtk_selection_add_targets(gui.drawarea,
! (GdkAtom)clip_plus.gtk_sel_atom,
! selection_targets, N_SELECTION_TARGETS);
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_get",
GTK_SIGNAL_FUNC(selection_get_cb), NULL);
--- 3989,3995 ----
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_received",
GTK_SIGNAL_FUNC(selection_received_cb), NULL);
! gui_gtk_set_selection_targets();
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "selection_get",
GTK_SIGNAL_FUNC(selection_get_cb), NULL);
***************
*** 4057,4063 ****
return TRUE;
}
-
/*
* Open the GUI window which was created by a call to gui_mch_init().
*/
--- 4113,4118 ----
***************
*** 4225,4237 ****
GTK_SIGNAL_FUNC(form_configure_event), NULL);
#ifdef FEAT_DND
! /*
! * Set up for receiving DND items.
! */
! gtk_drag_dest_set(gui.drawarea,
! GTK_DEST_DEFAULT_ALL,
! dnd_targets, N_DND_TARGETS,
! GDK_ACTION_COPY);
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "drag_data_received",
GTK_SIGNAL_FUNC(drag_data_received_cb), NULL);
--- 4280,4287 ----
GTK_SIGNAL_FUNC(form_configure_event), NULL);
#ifdef FEAT_DND
! /* Set up for receiving DND items. */
! gui_gtk_set_dnd_targets();
gtk_signal_connect(GTK_OBJECT(gui.drawarea), "drag_data_received",
GTK_SIGNAL_FUNC(drag_data_received_cb), NULL);
***************
*** 4428,4434 ****
/* this will cause the proper resizement to happen too */
update_window_manager_hints(0, 0);
! #else /* HAVE_GTK2 */
/* this will cause the proper resizement to happen too */
if (gtk_socket_id == 0)
update_window_manager_hints(0, 0);
--- 4478,4484 ----
/* this will cause the proper resizement to happen too */
update_window_manager_hints(0, 0);
! #else
/* this will cause the proper resizement to happen too */
if (gtk_socket_id == 0)
update_window_manager_hints(0, 0);
***************
*** 4444,4457 ****
else
update_window_manager_hints(width, height);
! #if 0
if (!resize_idle_installed)
{
g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
&force_shell_resize_idle, NULL, NULL);
resize_idle_installed = TRUE;
}
! #endif
/*
* Wait until all events are processed to prevent a crash because the
* real size of the drawing area doesn't reflect Vim's internal ideas.
--- 4494,4507 ----
else
update_window_manager_hints(width, height);
! # if 0
if (!resize_idle_installed)
{
g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
&force_shell_resize_idle, NULL, NULL);
resize_idle_installed = TRUE;
}
! # endif
/*
* Wait until all events are processed to prevent a crash because the
* real size of the drawing area doesn't reflect Vim's internal ideas.
*** ../vim-7.2.441/src/option.c 2010-05-14 17:32:53.000000000 +0200
--- src/option.c 2010-06-05 12:19:38.000000000 +0200
***************
*** 7112,7117 ****
--- 7112,7124 ----
clip_html = new_html;
vim_free(clip_exclude_prog);
clip_exclude_prog = new_exclude_prog;
+ #ifdef FEAT_GUI_GTK
+ if (gui.in_use)
+ {
+ gui_gtk_set_selection_targets();
+ gui_gtk_set_dnd_targets();
+ }
+ #endif
}
else
vim_free(new_exclude_prog);
*** ../vim-7.2.441/src/proto/gui_gtk_x11.pro 2009-09-23 18:14:13.000000000 +0200
--- src/proto/gui_gtk_x11.pro 2010-06-05 12:31:22.000000000 +0200
***************
*** 9,14 ****
--- 9,16 ----
int gui_mch_showing_tabline __ARGS((void));
void gui_mch_update_tabline __ARGS((void));
void gui_mch_set_curtab __ARGS((int nr));
+ void gui_gtk_set_selection_targets __ARGS((void));
+ void gui_gtk_set_dnd_targets __ARGS((void));
int gui_mch_init __ARGS((void));
void gui_mch_forked __ARGS((void));
void gui_mch_new_colors __ARGS((void));
*** ../vim-7.2.441/src/version.c 2010-05-30 16:55:17.000000000 +0200
--- src/version.c 2010-06-05 12:48:01.000000000 +0200
***************
*** 683,684 ****
--- 683,686 ----
{ /* Add new patch number below this line */
+ /**/
+ 442,
/**/
--
hundred-and-one symptoms of being an internet addict:
158. You get a tuner card so you can watch TV while surfing.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

View File

@ -473,3 +473,4 @@ Individual patches for Vim 7.2:
3110 7.2.439 invalid memory access for thesaurus completion and 'infercase'
5861 7.2.440 crash when deleting a funcref in the function it refers to
3446 7.2.441 when using ":earlier" undo information may be wrong
7872 7.2.442 (after 7.2.201) copy/paste with OpenOffice doesn't work

View File

@ -18,13 +18,13 @@
#used for pre-releases:
%define beta %{nil}
%define vimdir vim72%{?beta}
%define patchlevel 441
%define patchlevel 442
Summary: The VIM editor
URL: http://www.vim.org/
Name: vim
Version: %{baseversion}.%{beta}%{patchlevel}
Release: 2%{?dist}
Release: 1%{?dist}
License: Vim
Group: Applications/Editors
Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}%{?beta}%{?CVSDATE}.tar.bz2
@ -507,6 +507,7 @@ Patch438: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.438
Patch439: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.439
Patch440: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.440
Patch441: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.441
Patch442: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.442
Patch3000: vim-7.0-syntax.patch
Patch3002: vim-7.1-nowarnings.patch
@ -1086,6 +1087,7 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk
%patch439 -p0
%patch440 -p0
%patch441 -p0
%patch442 -p0
# install spell files
@ -1550,6 +1552,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/icons/hicolor/*/apps/*
%changelog
* Sat Jun 05 2010 Karsten Hopp <karsten@redhat.com> 7.2.442-1
- patchlevel 442
* Wed Jun 02 2010 Marcela Maslanova <mmaslano@redhat.com> - 2:7.2.441-2
- Mass rebuild with perl-5.12.0