1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
http://www.freebsd.org/cgi/query-pr.cgi?pr=121953 (Dwayne MacKinnon)
http://qa.openoffice.org/issues/show_bug.cgi?id=75190
Turn the GTK Recent Manager feature off.
Other workaround
% setenv OOO_FORCE_DESKTOP gnome
Backout of misfeature in cws_src680_obr05 branch.
* rev 1.9 of gsl/shell/source/unix/sysshell/recently_used_file_handler.cxx
* rev 1.8 of gsl/shell/source/unix/sysshell/systemshell.cxx
See also
http://lists.freebsd.org/pipermail/freebsd-openoffice/2007-December/003453.html
gsl/shell/source/unix/sysshell/recently_used_file_handler.cxx
(rev. 1.8.44.2)
gsl/shell/source/unix/sysshell/systemshell.cxx
(rev. 1.7.44.1)
Index: systemshell.cxx
===================================================================
RCS file: /cvs/gsl/shell/source/unix/sysshell/systemshell.cxx,v
retrieving revision 1.8
diff -u -u -r1.8 systemshell.cxx
--- shell/source/unix/sysshell/systemshell.cxx 19 Jun 2007 16:12:44 -0000 1.8
+++ shell/source/unix/sysshell/systemshell.cxx 30 Mar 2008 22:06:15 -0000
@@ -72,9 +72,6 @@
const rtl::OUString LIB_RECENT_FILE = UNISTRING("librecentfile.so");
const rtl::OUString DEFAULT_CONTEXT = UNISTRING("DefaultContext");
-void * (* sym_gtk_recent_manager_get_default) () = NULL;
-void (* sym_gtk_recent_manager_add_item) (void *, const char *) = NULL;
-
// We need to re-encode file urls because osl_getFileURLFromSystemPath converts
// to UTF-8 before encoding non ascii characters, which is not what other apps expect.
static rtl::OUString translateToExternalUrl(const rtl::OUString& internalUrl)
@@ -114,57 +111,31 @@
return url;
}
- bool init_recent_manager_api()
- {
- oslModule hDefault;
- if( osl_getModuleHandle( NULL, &hDefault ) )
- {
- sym_gtk_recent_manager_get_default = (void * (*)())
- osl_getAsciiFunctionSymbol(hDefault, "gtk_recent_manager_get_default");
- sym_gtk_recent_manager_add_item = (void (*)(void *, const char *))
- osl_getAsciiFunctionSymbol(hDefault, "gtk_recent_manager_add_item");
-
- }
- bool ret = (NULL != sym_gtk_recent_manager_get_default) && (NULL != sym_gtk_recent_manager_add_item);
- return ret;
- }
-
-
//##############################
void AddToRecentDocumentList(const rtl::OUString& aFileUrl, const rtl::OUString& aMimeType)
{
- static bool bIsRecentManagerPresent = init_recent_manager_api();
-
// Convert file URL for external use (see above)
rtl::OUString externalUrl = translateToExternalUrl(aFileUrl);
+ rtl::OUString librecentfile_url = get_absolute_library_url(LIB_RECENT_FILE);
+
if( 0 == externalUrl.getLength() )
externalUrl = aFileUrl;
-
- if( bIsRecentManagerPresent )
- {
- void * recent_manager = sym_gtk_recent_manager_get_default();
- sym_gtk_recent_manager_add_item(recent_manager, rtl::OUStringToOString(aFileUrl, RTL_TEXTENCODING_UTF8).getStr());
- }
- else
+
+ if (librecentfile_url.getLength())
{
- rtl::OUString librecentfile_url = get_absolute_library_url(LIB_RECENT_FILE);
-
- if (librecentfile_url.getLength())
- {
- osl::Module module(librecentfile_url);
+ osl::Module module(librecentfile_url);
- if (module.is())
- {
- // convert from reinterpret_cast<PFUNC_ADD_TO_RECENTLY_USED_LIST>
- // not allowed in gcc 3.3 without permissive.
- PFUNC_ADD_TO_RECENTLY_USED_LIST add_to_recently_used_file_list =
- reinterpret_cast<PFUNC_ADD_TO_RECENTLY_USED_LIST>(module.getFunctionSymbol(SYM_ADD_TO_RECENTLY_USED_FILE_LIST));
-
- if (add_to_recently_used_file_list)
- add_to_recently_used_file_list(aFileUrl, aMimeType);
- }
+ if (module.is())
+ {
+ // convert from reinterpret_cast<PFUNC_ADD_TO_RECENTLY_USED_LIST>
+ // not allowed in gcc 3.3 without permissive.
+ PFUNC_ADD_TO_RECENTLY_USED_LIST add_to_recently_used_file_list =
+ reinterpret_cast<PFUNC_ADD_TO_RECENTLY_USED_LIST>(module.getFunctionSymbol(SYM_ADD_TO_RECENTLY_USED_FILE_LIST));
+
+ if (add_to_recently_used_file_list)
+ add_to_recently_used_file_list(aFileUrl, aMimeType);
}
- }
+ }
}
} // namespace SystemShell
|