Filename | /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer/windows/shortcut.pm |
Statements | Executed 1969861 statements in 1.76s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 549ms | 2.07s | create_shortcut_table | installer::windows::shortcut::
872 | 1 | 1 | 546ms | 548ms | get_shortcut_component | installer::windows::shortcut::
872 | 1 | 1 | 533ms | 536ms | get_folderitem_target | installer::windows::shortcut::
872 | 1 | 1 | 62.6ms | 62.6ms | get_folderitem_wkdir | installer::windows::shortcut::
872 | 1 | 1 | 13.2ms | 89.8ms | get_shortcut_name | installer::windows::shortcut::
5232 | 6 | 1 | 8.91ms | 8.91ms | CORE:match (opcode) | installer::windows::shortcut::
872 | 1 | 1 | 7.34ms | 9.75ms | get_folderitem_icon | installer::windows::shortcut::
872 | 1 | 1 | 6.97ms | 8.98ms | get_folderitem_iconindex | installer::windows::shortcut::
872 | 1 | 1 | 6.24ms | 6.24ms | get_folderitem_directory | installer::windows::shortcut::
872 | 1 | 1 | 4.56ms | 4.56ms | get_shortcut_description | installer::windows::shortcut::
872 | 1 | 1 | 4.33ms | 4.33ms | get_folderitem_arguments | installer::windows::shortcut::
872 | 1 | 1 | 4.13ms | 4.13ms | get_shortcut_identifier | installer::windows::shortcut::
872 | 1 | 1 | 3.00ms | 3.00ms | get_shortcut_hotkey | installer::windows::shortcut::
872 | 1 | 1 | 2.98ms | 2.98ms | get_folderitem_showcmd | installer::windows::shortcut::
872 | 1 | 1 | 851µs | 851µs | CORE:subst (opcode) | installer::windows::shortcut::
1 | 1 | 1 | 412µs | 416µs | BEGIN@30 | installer::windows::shortcut::
1 | 1 | 1 | 17µs | 19µs | BEGIN@32 | installer::windows::shortcut::
1 | 1 | 1 | 16µs | 18µs | BEGIN@31 | installer::windows::shortcut::
1 | 1 | 1 | 14µs | 16µs | BEGIN@33 | installer::windows::shortcut::
0 | 0 | 0 | 0s | 0s | get_shortcut_arguments | installer::windows::shortcut::
0 | 0 | 0 | 0s | 0s | get_shortcut_directory | installer::windows::shortcut::
0 | 0 | 0 | 0s | 0s | get_shortcut_icon | installer::windows::shortcut::
0 | 0 | 0 | 0s | 0s | get_shortcut_iconindex | installer::windows::shortcut::
0 | 0 | 0 | 0s | 0s | get_shortcut_showcmd | installer::windows::shortcut::
0 | 0 | 0 | 0s | 0s | get_shortcut_target | installer::windows::shortcut::
0 | 0 | 0 | 0s | 0s | get_shortcut_wkdir | installer::windows::shortcut::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | #************************************************************************* | ||||
2 | # | ||||
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||||
4 | # | ||||
5 | # Copyright 2000, 2010 Oracle and/or its affiliates. | ||||
6 | # | ||||
7 | # OpenOffice.org - a multi-platform office productivity suite | ||||
8 | # | ||||
9 | # This file is part of OpenOffice.org. | ||||
10 | # | ||||
11 | # OpenOffice.org is free software: you can redistribute it and/or modify | ||||
12 | # it under the terms of the GNU Lesser General Public License version 3 | ||||
13 | # only, as published by the Free Software Foundation. | ||||
14 | # | ||||
15 | # OpenOffice.org is distributed in the hope that it will be useful, | ||||
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
18 | # GNU Lesser General Public License version 3 for more details | ||||
19 | # (a copy is included in the LICENSE file that accompanied this code). | ||||
20 | # | ||||
21 | # You should have received a copy of the GNU Lesser General Public License | ||||
22 | # version 3 along with OpenOffice.org. If not, see | ||||
23 | # <http://www.openoffice.org/license.html> | ||||
24 | # for a copy of the LGPLv3 License. | ||||
25 | # | ||||
26 | #************************************************************************* | ||||
27 | |||||
28 | package installer::windows::shortcut; | ||||
29 | |||||
30 | 2 | 65µs | 2 | 420µs | # spent 416µs (412+4) within installer::windows::shortcut::BEGIN@30 which was called:
# once (412µs+4µs) by installer::BEGIN@80 at line 30 # spent 416µs making 1 call to installer::windows::shortcut::BEGIN@30
# spent 4µs making 1 call to UNIVERSAL::import |
31 | 2 | 141µs | 2 | 20µs | # spent 18µs (16+2) within installer::windows::shortcut::BEGIN@31 which was called:
# once (16µs+2µs) by installer::BEGIN@80 at line 31 # spent 18µs making 1 call to installer::windows::shortcut::BEGIN@31
# spent 2µs making 1 call to UNIVERSAL::import |
32 | 2 | 53µs | 2 | 21µs | # spent 19µs (17+2) within installer::windows::shortcut::BEGIN@32 which was called:
# once (17µs+2µs) by installer::BEGIN@80 at line 32 # spent 19µs making 1 call to installer::windows::shortcut::BEGIN@32
# spent 2µs making 1 call to UNIVERSAL::import |
33 | 2 | 5.43ms | 2 | 17µs | # spent 16µs (14+1) within installer::windows::shortcut::BEGIN@33 which was called:
# once (14µs+1µs) by installer::BEGIN@80 at line 33 # spent 16µs making 1 call to installer::windows::shortcut::BEGIN@33
# spent 2µs making 1 call to UNIVERSAL::import |
34 | |||||
35 | ############################################################## | ||||
36 | # Returning identifier for shortcut table. | ||||
37 | ############################################################## | ||||
38 | |||||
39 | sub get_shortcut_identifier | ||||
40 | # spent 4.13ms within installer::windows::shortcut::get_shortcut_identifier which was called 872 times, avg 5µs/call:
# 872 times (4.13ms+0s) by installer::windows::shortcut::create_shortcut_table at line 616, avg 5µs/call | ||||
41 | 2616 | 6.07ms | my ($shortcut) = @_; | ||
42 | |||||
43 | my $identifier = $shortcut->{'gid'}; | ||||
44 | |||||
45 | return $identifier; | ||||
46 | } | ||||
47 | |||||
48 | ############################################################## | ||||
49 | # Returning directory for shortcut table. | ||||
50 | ############################################################## | ||||
51 | |||||
52 | sub get_shortcut_directory | ||||
53 | { | ||||
54 | my ($shortcut, $dirref) = @_; | ||||
55 | |||||
56 | # For shortcuts it is easy to convert the gid_Dir_Abc into the unique name in | ||||
57 | # the directory table, for instance help_en_simpressidx. | ||||
58 | # For files (components) this is not so easy, because files can be included | ||||
59 | # in zip files with subdirectories that are not defined in scp. | ||||
60 | |||||
61 | my $onedir; | ||||
62 | my $shortcutdirectory = $shortcut->{'Dir'}; | ||||
63 | my $directory = ""; | ||||
64 | my $found = 0; | ||||
65 | |||||
66 | for ( my $i = 0; $i <= $#{$dirref}; $i++ ) | ||||
67 | { | ||||
68 | $onedir = ${$dirref}[$i]; | ||||
69 | my $directorygid = $onedir->{'Dir'}; | ||||
70 | |||||
71 | if ( $directorygid eq $shortcutdirectory ) | ||||
72 | { | ||||
73 | $found = 1; | ||||
74 | last; | ||||
75 | } | ||||
76 | } | ||||
77 | |||||
78 | if (!($found)) | ||||
79 | { | ||||
80 | installer::exiter::exit_program("ERROR: Did not find DirectoryID $shortcutdirectory in directory collection for shortcut", "get_shortcut_directory"); | ||||
81 | } | ||||
82 | |||||
83 | $directory = $onedir->{'uniquename'}; | ||||
84 | |||||
85 | if ($directory eq "") { $directory = "INSTALLLOCATION"; } # Shortcuts in the root directory | ||||
86 | |||||
87 | return $directory; | ||||
88 | } | ||||
89 | |||||
90 | ############################################################## | ||||
91 | # Returning name for shortcut table. | ||||
92 | ############################################################## | ||||
93 | |||||
94 | sub get_shortcut_name | ||||
95 | # spent 89.8ms (13.2+76.6) within installer::windows::shortcut::get_shortcut_name which was called 872 times, avg 103µs/call:
# 872 times (13.2ms+76.6ms) by installer::windows::shortcut::create_shortcut_table at line 618, avg 103µs/call | ||||
96 | 6976 | 13.9ms | my ($shortcut, $shortnamesref, $onelanguage) = @_; | ||
97 | |||||
98 | my $returnstring; | ||||
99 | |||||
100 | my $name = $shortcut->{'Name'}; | ||||
101 | |||||
102 | 872 | 75.8ms | my $shortstring = installer::windows::idtglobal::make_eight_three_conform($name, "shortcut", $shortnamesref); # spent 75.8ms making 872 calls to installer::windows::idtglobal::make_eight_three_conform, avg 87µs/call | ||
103 | 872 | 851µs | $shortstring =~ s/\s/\_/g; # replacing white spaces with underline # spent 851µs making 872 calls to installer::windows::shortcut::CORE:subst, avg 976ns/call | ||
104 | |||||
105 | if ( $shortstring eq $name ) { $returnstring = $name; } # nothing changed | ||||
106 | else {$returnstring = $shortstring . "\|" . $name; } | ||||
107 | |||||
108 | return $returnstring; | ||||
109 | } | ||||
110 | |||||
111 | ############################################################## | ||||
112 | # Returning component for shortcut table. | ||||
113 | ############################################################## | ||||
114 | |||||
115 | sub get_shortcut_component | ||||
116 | # spent 548ms (546+1.47) within installer::windows::shortcut::get_shortcut_component which was called 872 times, avg 628µs/call:
# 872 times (546ms+1.47ms) by installer::windows::shortcut::create_shortcut_table at line 619, avg 628µs/call | ||||
117 | 636015 | 550ms | my ($shortcut, $filesref) = @_; | ||
118 | |||||
119 | my $onefile; | ||||
120 | my $component = ""; | ||||
121 | my $found = 0; | ||||
122 | my $shortcut_fileid = $shortcut->{'FileID'}; | ||||
123 | |||||
124 | my $absolute_filename = 0; | ||||
125 | if ( $shortcut->{'Styles'} ) { $styles = $shortcut->{'Styles'}; } | ||||
126 | 872 | 787µs | if ( $styles =~ /\bABSOLUTE_FILENAME\b/ ) { $absolute_filename = 1; } # FileID contains an absolute filename # spent 787µs making 872 calls to installer::windows::shortcut::CORE:match, avg 903ns/call | ||
127 | 872 | 687µs | if ( $styles =~ /\bUSE_HELPER_FILENAME\b/ ) { $absolute_filename = 1; } # ComponentIDFile contains id of a helper file # spent 687µs making 872 calls to installer::windows::shortcut::CORE:match, avg 788ns/call | ||
128 | |||||
129 | # if the FileID contains an absolute filename, therefore the entry for "ComponentIDFile" has to be used. | ||||
130 | if ( $absolute_filename ) { $shortcut_fileid = $shortcut->{'ComponentIDFile'}; } | ||||
131 | |||||
132 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
133 | { | ||||
134 | $onefile = ${$filesref}[$i]; | ||||
135 | my $filegid = $onefile->{'gid'}; | ||||
136 | |||||
137 | if ( $filegid eq $shortcut_fileid ) | ||||
138 | { | ||||
139 | $found = 1; | ||||
140 | last; | ||||
141 | } | ||||
142 | } | ||||
143 | |||||
144 | if (!($found)) | ||||
145 | { | ||||
146 | installer::exiter::exit_program("ERROR: Did not find FileID $shortcut_fileid in file collection for shortcut", "get_shortcut_component"); | ||||
147 | } | ||||
148 | |||||
149 | $component = $onefile->{'componentname'}; | ||||
150 | |||||
151 | # finally saving the componentname in the folderitem collector | ||||
152 | |||||
153 | $shortcut->{'component'} = $component; | ||||
154 | |||||
155 | return $component; | ||||
156 | } | ||||
157 | |||||
158 | ############################################################## | ||||
159 | # Returning target for shortcut table. | ||||
160 | ############################################################## | ||||
161 | |||||
162 | sub get_shortcut_target | ||||
163 | { | ||||
164 | my ($shortcut, $filesref) = @_; | ||||
165 | |||||
166 | my $target = ""; | ||||
167 | my $found = 0; | ||||
168 | my $shortcut_fileid = $shortcut->{'FileID'}; | ||||
169 | my $onefile; | ||||
170 | |||||
171 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
172 | { | ||||
173 | $onefile = ${$filesref}[$i]; | ||||
174 | my $filegid = $onefile->{'gid'}; | ||||
175 | |||||
176 | if ( $filegid eq $shortcut_fileid ) | ||||
177 | { | ||||
178 | $found = 1; | ||||
179 | last; | ||||
180 | } | ||||
181 | } | ||||
182 | |||||
183 | if (!($found)) | ||||
184 | { | ||||
185 | installer::exiter::exit_program("ERROR: Did not find FileID $shortcut_fileid in file collection for shortcut", "get_shortcut_target"); | ||||
186 | } | ||||
187 | |||||
188 | if ( $onefile->{'Name'} ) | ||||
189 | { | ||||
190 | $target = $onefile->{'Name'}; | ||||
191 | } | ||||
192 | |||||
193 | $target = "\[\#" . $target . "\]"; # format for Non-Advertised shortcuts | ||||
194 | |||||
195 | return $target; | ||||
196 | } | ||||
197 | |||||
198 | ############################################################## | ||||
199 | # Returning arguments for shortcut table. | ||||
200 | ############################################################## | ||||
201 | |||||
202 | sub get_shortcut_arguments | ||||
203 | { | ||||
204 | my ($shortcut) = @_; | ||||
205 | |||||
206 | return ""; | ||||
207 | } | ||||
208 | |||||
209 | ############################################################## | ||||
210 | # Returning the localized description for shortcut table. | ||||
211 | ############################################################## | ||||
212 | |||||
213 | sub get_shortcut_description | ||||
214 | # spent 4.56ms within installer::windows::shortcut::get_shortcut_description which was called 872 times, avg 5µs/call:
# 872 times (4.56ms+0s) by installer::windows::shortcut::create_shortcut_table at line 622, avg 5µs/call | ||||
215 | 3488 | 6.16ms | my ($shortcut, $onelanguage) = @_; | ||
216 | |||||
217 | my $description = ""; | ||||
218 | if ( $shortcut->{'Tooltip'} ) { $description = $shortcut->{'Tooltip'}; } | ||||
219 | |||||
220 | return $description; | ||||
221 | } | ||||
222 | |||||
223 | ############################################################## | ||||
224 | # Returning hotkey for shortcut table. | ||||
225 | ############################################################## | ||||
226 | |||||
227 | sub get_shortcut_hotkey | ||||
228 | # spent 3.00ms within installer::windows::shortcut::get_shortcut_hotkey which was called 872 times, avg 3µs/call:
# 872 times (3.00ms+0s) by installer::windows::shortcut::create_shortcut_table at line 623, avg 3µs/call | ||||
229 | 1744 | 4.61ms | my ($shortcut) = @_; | ||
230 | |||||
231 | return ""; | ||||
232 | } | ||||
233 | |||||
234 | ############################################################## | ||||
235 | # Returning icon for shortcut table. | ||||
236 | ############################################################## | ||||
237 | |||||
238 | sub get_shortcut_icon | ||||
239 | { | ||||
240 | my ($shortcut) = @_; | ||||
241 | |||||
242 | return ""; | ||||
243 | } | ||||
244 | |||||
245 | ############################################################## | ||||
246 | # Returning iconindex for shortcut table. | ||||
247 | ############################################################## | ||||
248 | |||||
249 | sub get_shortcut_iconindex | ||||
250 | { | ||||
251 | my ($shortcut) = @_; | ||||
252 | |||||
253 | return ""; | ||||
254 | } | ||||
255 | |||||
256 | ############################################################## | ||||
257 | # Returning show command for shortcut table. | ||||
258 | ############################################################## | ||||
259 | |||||
260 | sub get_shortcut_showcmd | ||||
261 | { | ||||
262 | my ($shortcut) = @_; | ||||
263 | |||||
264 | return ""; | ||||
265 | } | ||||
266 | |||||
267 | ############################################################## | ||||
268 | # Returning working directory for shortcut table. | ||||
269 | ############################################################## | ||||
270 | |||||
271 | sub get_shortcut_wkdir | ||||
272 | { | ||||
273 | my ($shortcut) = @_; | ||||
274 | |||||
275 | return ""; | ||||
276 | } | ||||
277 | |||||
278 | #################################################################### | ||||
279 | # Returning working directory for shortcut table for FolderItems. | ||||
280 | #################################################################### | ||||
281 | |||||
282 | sub get_folderitem_wkdir | ||||
283 | # spent 62.6ms within installer::windows::shortcut::get_folderitem_wkdir which was called 872 times, avg 72µs/call:
# 872 times (62.6ms+0s) by installer::windows::shortcut::create_shortcut_table at line 627, avg 72µs/call | ||||
284 | 74992 | 64.4ms | my ($onelink, $dirref) = @_; | ||
285 | |||||
286 | # For shortcuts it is easy to convert the gid_Dir_Abc into the unique name in | ||||
287 | # the directory table, for instance help_en_simpressidx. | ||||
288 | |||||
289 | my $onedir; | ||||
290 | my $workingdirectory = ""; | ||||
291 | if ( $onelink->{'WkDir'} ) { $workingdirectory = $onelink->{'WkDir'}; } | ||||
292 | my $directory = ""; | ||||
293 | |||||
294 | if ( $workingdirectory ) | ||||
295 | { | ||||
296 | my $found = 0; | ||||
297 | |||||
298 | for ( my $i = 0; $i <= $#{$dirref}; $i++ ) | ||||
299 | { | ||||
300 | $onedir = ${$dirref}[$i]; | ||||
301 | my $directorygid = $onedir->{'Dir'}; | ||||
302 | |||||
303 | if ( $directorygid eq $workingdirectory ) | ||||
304 | { | ||||
305 | $found = 1; | ||||
306 | last; | ||||
307 | } | ||||
308 | } | ||||
309 | |||||
310 | if (!($found)) | ||||
311 | { | ||||
312 | installer::exiter::exit_program("ERROR: Did not find DirectoryID $workingdirectory in directory collection for FolderItem", "get_folderitem_wkdir"); | ||||
313 | } | ||||
314 | |||||
315 | $directory = $onedir->{'uniquename'}; | ||||
316 | |||||
317 | if ($directory eq "") { $directory = "INSTALLLOCATION"; } | ||||
318 | } | ||||
319 | |||||
320 | return $directory; | ||||
321 | } | ||||
322 | |||||
323 | ################################################################### | ||||
324 | # Returning the directory for a folderitem for shortcut table. | ||||
325 | ################################################################### | ||||
326 | |||||
327 | sub get_folderitem_directory | ||||
328 | # spent 6.24ms within installer::windows::shortcut::get_folderitem_directory which was called 872 times, avg 7µs/call:
# 872 times (6.24ms+0s) by installer::windows::shortcut::create_shortcut_table at line 617, avg 7µs/call | ||||
329 | 6322 | 7.95ms | my ($shortcut) = @_; | ||
330 | |||||
331 | my $directory = "$installer::globals::officemenufolder"; # default | ||||
332 | |||||
333 | # The default is not correct for the | ||||
334 | # PREDEFINED folders, like PREDEFINED_AUTOSTART | ||||
335 | |||||
336 | if ( $shortcut->{'FolderID'} eq "PREDEFINED_AUTOSTART" ) | ||||
337 | { | ||||
338 | $directory = $installer::globals::startupfolder; | ||||
339 | } | ||||
340 | |||||
341 | if ( $shortcut->{'FolderID'} eq "PREDEFINED_DESKTOP" ) | ||||
342 | { | ||||
343 | $directory = $installer::globals::desktopfolder; | ||||
344 | $installer::globals::desktoplinkexists = 1; | ||||
345 | } | ||||
346 | |||||
347 | if ( $shortcut->{'FolderID'} eq "PREDEFINED_STARTMENU" ) | ||||
348 | { | ||||
349 | $directory = $installer::globals::programmenufolder; | ||||
350 | } | ||||
351 | |||||
352 | # saving the directory in the folderitems collector | ||||
353 | |||||
354 | $shortcut->{'directory'} = $directory; | ||||
355 | |||||
356 | return $directory; | ||||
357 | } | ||||
358 | |||||
359 | ######################################################################## | ||||
360 | # Returning the target (feature) for a folderitem for shortcut table. | ||||
361 | # For non-advertised shortcuts this is a formatted string. | ||||
362 | ######################################################################## | ||||
363 | |||||
364 | sub get_folderitem_target | ||||
365 | # spent 536ms (533+3.02) within installer::windows::shortcut::get_folderitem_target which was called 872 times, avg 615µs/call:
# 872 times (533ms+3.02ms) by installer::windows::shortcut::create_shortcut_table at line 620, avg 615µs/call | ||||
366 | 632854 | 538ms | my ($shortcut, $filesref) = @_; | ||
367 | |||||
368 | my $onefile; | ||||
369 | my $target = ""; | ||||
370 | my $found = 0; | ||||
371 | my $shortcut_fileid = $shortcut->{'FileID'}; | ||||
372 | |||||
373 | my $styles = ""; | ||||
374 | my $nonadvertised = 0; | ||||
375 | my $absolute_filename = 0; | ||||
376 | if ( $shortcut->{'Styles'} ) { $styles = $shortcut->{'Styles'}; } | ||||
377 | 872 | 2.52ms | if ( $styles =~ /\bNON_ADVERTISED\b/ ) { $nonadvertised = 1; } # this is a non-advertised shortcut # spent 2.52ms making 872 calls to installer::windows::shortcut::CORE:match, avg 3µs/call | ||
378 | 872 | 497µs | if ( $styles =~ /\bABSOLUTE_FILENAME\b/ ) { $absolute_filename = 1; } # FileID contains an absolute filename # spent 497µs making 872 calls to installer::windows::shortcut::CORE:match, avg 570ns/call | ||
379 | |||||
380 | # if the FileID contains an absolute filename this can simply be returned as target for the shortcut table. | ||||
381 | if ( $absolute_filename ) | ||||
382 | { | ||||
383 | $shortcut->{'target'} = $shortcut_fileid; | ||||
384 | return $shortcut_fileid; | ||||
385 | } | ||||
386 | |||||
387 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
388 | { | ||||
389 | $onefile = ${$filesref}[$i]; | ||||
390 | my $filegid = $onefile->{'gid'}; | ||||
391 | |||||
392 | if ( $filegid eq $shortcut_fileid ) | ||||
393 | { | ||||
394 | $found = 1; | ||||
395 | last; | ||||
396 | } | ||||
397 | } | ||||
398 | |||||
399 | if (!($found)) | ||||
400 | { | ||||
401 | installer::exiter::exit_program("ERROR: Did not find FileID $shortcut_fileid in file collection for folderitem", "get_folderitem_target"); | ||||
402 | } | ||||
403 | |||||
404 | # Non advertised shortcuts do not return the feature, but the path to the file | ||||
405 | if ( $nonadvertised ) | ||||
406 | { | ||||
407 | $target = "\[" . $onefile->{'uniquedirname'} . "\]" . "\\" . $onefile->{'Name'}; | ||||
408 | $shortcut->{'target'} = $target; | ||||
409 | return $target; | ||||
410 | } | ||||
411 | |||||
412 | # the rest only for advertised shortcuts, which contain the feature in the shortcut table. | ||||
413 | |||||
414 | if ( $onefile->{'modules'} ) { $target = $onefile->{'modules'}; } | ||||
415 | |||||
416 | # If modules contains a list of modules, only taking the first one. | ||||
417 | # But this should never be needed | ||||
418 | |||||
419 | if ( $target =~ /^\s*(.*?)\,/ ) { $target = $1; } | ||||
420 | |||||
421 | # Attention: Maximum feature length is 38! | ||||
422 | installer::windows::idtglobal::shorten_feature_gid(\$target); | ||||
423 | |||||
424 | # and finally saving the target in the folderitems collector | ||||
425 | |||||
426 | $shortcut->{'target'} = $target; | ||||
427 | |||||
428 | return $target; | ||||
429 | } | ||||
430 | |||||
431 | ######################################################################## | ||||
432 | # Returning the arguments for a folderitem for shortcut table. | ||||
433 | ######################################################################## | ||||
434 | |||||
435 | sub get_folderitem_arguments | ||||
436 | # spent 4.33ms within installer::windows::shortcut::get_folderitem_arguments which was called 872 times, avg 5µs/call:
# 872 times (4.33ms+0s) by installer::windows::shortcut::create_shortcut_table at line 621, avg 5µs/call | ||||
437 | 3488 | 5.83ms | my ($shortcut) = @_; | ||
438 | |||||
439 | my $parameter = ""; | ||||
440 | |||||
441 | if ( $shortcut->{'Parameter'} ) { $parameter = $shortcut->{'Parameter'}; } | ||||
442 | |||||
443 | return $parameter; | ||||
444 | } | ||||
445 | |||||
446 | ######################################################################## | ||||
447 | # Returning the icon for a folderitem for shortcut table. | ||||
448 | # The returned value has to be defined in the icon table. | ||||
449 | ######################################################################## | ||||
450 | |||||
451 | sub get_folderitem_icon | ||||
452 | # spent 9.75ms (7.34+2.41) within installer::windows::shortcut::get_folderitem_icon which was called 872 times, avg 11µs/call:
# 872 times (7.34ms+2.41ms) by installer::windows::shortcut::create_shortcut_table at line 624, avg 11µs/call | ||||
453 | 3488 | 11.2ms | my ($shortcut, $filesref, $iconfilecollector) = @_; | ||
454 | |||||
455 | my $styles = ""; | ||||
456 | if ( $shortcut->{'Styles'} ) { $styles = $shortcut->{'Styles'}; } | ||||
457 | 872 | 2.41ms | if ( $styles =~ /\bNON_ADVERTISED\b/ ) { return ""; } # no icon for non-advertised shortcuts # spent 2.41ms making 872 calls to installer::windows::shortcut::CORE:match, avg 3µs/call | ||
458 | |||||
459 | my $iconfilegid = ""; | ||||
460 | |||||
461 | if ( $shortcut->{'IconFile'} ) { $iconfilegid = $shortcut->{'IconFile'}; } | ||||
462 | else { $iconfilegid = $shortcut->{'FileID'}; } | ||||
463 | |||||
464 | my $onefile; | ||||
465 | my $found = 0; | ||||
466 | |||||
467 | for ( my $i = 0; $i <= $#{$filesref}; $i++ ) | ||||
468 | { | ||||
469 | $onefile = ${$filesref}[$i]; | ||||
470 | my $filegid = $onefile->{'gid'}; | ||||
471 | |||||
472 | if ( $filegid eq $iconfilegid ) | ||||
473 | { | ||||
474 | $found = 1; | ||||
475 | last; | ||||
476 | } | ||||
477 | } | ||||
478 | |||||
479 | if (!($found)) | ||||
480 | { | ||||
481 | installer::exiter::exit_program("ERROR: Did not find FileID $iconfilegid in file collection", "get_folderitem_icon"); | ||||
482 | } | ||||
483 | |||||
484 | $iconfile = $onefile->{'Name'}; | ||||
485 | |||||
486 | # collecting all icon files to copy them into the icon directory | ||||
487 | |||||
488 | my $sourcepath = $onefile->{'sourcepath'}; | ||||
489 | |||||
490 | if (! grep {$_ eq $sourcepath} @{$iconfilecollector}) | ||||
491 | { | ||||
492 | push(@{$iconfilecollector}, $sourcepath); | ||||
493 | } | ||||
494 | |||||
495 | return $iconfile; | ||||
496 | } | ||||
497 | |||||
498 | ######################################################################## | ||||
499 | # Returning the iconindex for a folderitem for shortcut table. | ||||
500 | ######################################################################## | ||||
501 | |||||
502 | sub get_folderitem_iconindex | ||||
503 | # spent 8.98ms (6.97+2.00) within installer::windows::shortcut::get_folderitem_iconindex which was called 872 times, avg 10µs/call:
# 872 times (6.97ms+2.00ms) by installer::windows::shortcut::create_shortcut_table at line 625, avg 10µs/call | ||||
504 | 3488 | 10.3ms | my ($shortcut) = @_; | ||
505 | |||||
506 | my $styles = ""; | ||||
507 | if ( $shortcut->{'Styles'} ) { $styles = $shortcut->{'Styles'}; } | ||||
508 | 872 | 2.00ms | if ( $styles =~ /\bNON_ADVERTISED\b/ ) { return ""; } # no iconindex for non-advertised shortcuts # spent 2.00ms making 872 calls to installer::windows::shortcut::CORE:match, avg 2µs/call | ||
509 | |||||
510 | my $iconid = 0; | ||||
511 | |||||
512 | if ( $shortcut->{'IconID'} ) { $iconid = $shortcut->{'IconID'}; } | ||||
513 | |||||
514 | return $iconid; | ||||
515 | } | ||||
516 | |||||
517 | ######################################################################## | ||||
518 | # Returning the show command for a folderitem for shortcut table. | ||||
519 | ######################################################################## | ||||
520 | |||||
521 | sub get_folderitem_showcmd | ||||
522 | # spent 2.98ms within installer::windows::shortcut::get_folderitem_showcmd which was called 872 times, avg 3µs/call:
# 872 times (2.98ms+0s) by installer::windows::shortcut::create_shortcut_table at line 626, avg 3µs/call | ||||
523 | 1744 | 4.71ms | my ($shortcut) = @_; | ||
524 | |||||
525 | return "1"; | ||||
526 | } | ||||
527 | |||||
528 | ########################################################################################################### | ||||
529 | # Creating the file Shortcut.idt dynamically | ||||
530 | # Content: | ||||
531 | # Shortcut Directory_ Name Component_ Target Arguments Description Hotkey Icon_ IconIndex ShowCmd WkDir | ||||
532 | ########################################################################################################### | ||||
533 | |||||
534 | sub create_shortcut_table | ||||
535 | # spent 2.07s (549ms+1.52) within installer::windows::shortcut::create_shortcut_table which was called:
# once (549ms+1.52s) by installer::run at line 1519 of /cygdrive/c/lo/libo-master/instsetoo_native/util/C:/lo/libo-master/solenv/bin/modules/installer.pm | ||||
536 | 592637 | 528ms | my ($filesref, $linksref, $folderref, $folderitemsref, $dirref, $basedir, $languagesarrayref, $includepatharrayref, $iconfilecollector) = @_; | ||
537 | |||||
538 | for ( my $m = 0; $m <= $#{$languagesarrayref}; $m++ ) | ||||
539 | { | ||||
540 | my $onelanguage = ${$languagesarrayref}[$m]; | ||||
541 | |||||
542 | my @shortcuttable = (); | ||||
543 | |||||
544 | my @shortnames = (); # to collect all short names | ||||
545 | |||||
546 | 109 | 2.30ms | installer::windows::idtglobal::write_idt_header(\@shortcuttable, "shortcut"); # spent 2.30ms making 109 calls to installer::windows::idtglobal::write_idt_header, avg 21µs/call | ||
547 | |||||
548 | # First the links, defined in scp as ShortCut | ||||
549 | |||||
550 | for ( my $i = 0; $i <= $#{$linksref}; $i++ ) | ||||
551 | { | ||||
552 | my $onelink = ${$linksref}[$i]; | ||||
553 | |||||
554 | # Controlling the language! | ||||
555 | # Only language independent folderitems or folderitems with the correct language | ||||
556 | # will be included into the table | ||||
557 | |||||
558 | if (! (!(( $onelink->{'ismultilingual'} )) || ( $onelink->{'specificlanguage'} eq $onelanguage )) ) { next; } | ||||
559 | |||||
560 | my %shortcut = (); | ||||
561 | |||||
562 | $shortcut{'Shortcut'} = get_shortcut_identifier($onelink); | ||||
563 | $shortcut{'Directory_'} = get_shortcut_directory($onelink, $dirref); | ||||
564 | $shortcut{'Name'} = get_shortcut_name($onelink, \@shortnames, $onelanguage); # localized name | ||||
565 | $shortcut{'Component_'} = get_shortcut_component($onelink, $filesref); | ||||
566 | $shortcut{'Target'} = get_shortcut_target($onelink, $filesref); | ||||
567 | $shortcut{'Arguments'} = get_shortcut_arguments($onelink); | ||||
568 | $shortcut{'Description'} = get_shortcut_description($onelink, $onelanguage); # localized description | ||||
569 | $shortcut{'Hotkey'} = get_shortcut_hotkey($onelink); | ||||
570 | $shortcut{'Icon_'} = get_shortcut_icon($onelink); | ||||
571 | $shortcut{'IconIndex'} = get_shortcut_iconindex($onelink); | ||||
572 | $shortcut{'ShowCmd'} = get_shortcut_showcmd($onelink); | ||||
573 | $shortcut{'WkDir'} = get_shortcut_wkdir($onelink); | ||||
574 | |||||
575 | my $oneline = $shortcut{'Shortcut'} . "\t" . $shortcut{'Directory_'} . "\t" . $shortcut{'Name'} . "\t" | ||||
576 | . $shortcut{'Component_'} . "\t" . $shortcut{'Target'} . "\t" . $shortcut{'Arguments'} . "\t" | ||||
577 | . $shortcut{'Description'} . "\t" . $shortcut{'Hotkey'} . "\t" . $shortcut{'Icon_'} . "\t" | ||||
578 | . $shortcut{'IconIndex'} . "\t" . $shortcut{'ShowCmd'} . "\t" . $shortcut{'WkDir'} . "\n"; | ||||
579 | |||||
580 | push(@shortcuttable, $oneline); | ||||
581 | } | ||||
582 | |||||
583 | # Second the entries into the start menu, defined in scp as Folder and Folderitem | ||||
584 | # These shortcuts will fill the icons table. | ||||
585 | |||||
586 | for ( my $i = 0; $i <= $#{$folderref}; $i++ ) | ||||
587 | { | ||||
588 | my $foldergid = ${$folderref}[$i]->{'gid'}; | ||||
589 | |||||
590 | # iterating over all folderitems for this folder | ||||
591 | |||||
592 | for ( my $j = 0; $j <= $#{$folderitemsref}; $j++ ) | ||||
593 | { | ||||
594 | my $onelink = ${$folderitemsref}[$j]; | ||||
595 | |||||
596 | # Controlling the language! | ||||
597 | # Only language independent folderitems or folderitems with the correct language | ||||
598 | # will be included into the table | ||||
599 | |||||
600 | if (! (!(( $onelink->{'ismultilingual'} )) || ( $onelink->{'specificlanguage'} eq $onelanguage )) ) { next; } | ||||
601 | |||||
602 | # controlling the folder | ||||
603 | |||||
604 | my $localused = 0; | ||||
605 | |||||
606 | if ( $onelink->{'used'} ) { $localused = $onelink->{'used'}; } | ||||
607 | |||||
608 | if (!($localused == 1)) { $onelink->{'used'} = "0"; } # no resetting | ||||
609 | |||||
610 | if (!( $onelink->{'FolderID'} eq $foldergid )) { next; } | ||||
611 | |||||
612 | $onelink->{'used'} = "1"; | ||||
613 | |||||
614 | my %shortcut = (); | ||||
615 | |||||
616 | 872 | 4.13ms | $shortcut{'Shortcut'} = get_shortcut_identifier($onelink); # spent 4.13ms making 872 calls to installer::windows::shortcut::get_shortcut_identifier, avg 5µs/call | ||
617 | 872 | 6.24ms | $shortcut{'Directory_'} = get_folderitem_directory($onelink); # spent 6.24ms making 872 calls to installer::windows::shortcut::get_folderitem_directory, avg 7µs/call | ||
618 | 872 | 89.8ms | $shortcut{'Name'} = get_shortcut_name($onelink, \@shortnames, $onelanguage); # localized name # spent 89.8ms making 872 calls to installer::windows::shortcut::get_shortcut_name, avg 103µs/call | ||
619 | 872 | 548ms | $shortcut{'Component_'} = get_shortcut_component($onelink, $filesref); # spent 548ms making 872 calls to installer::windows::shortcut::get_shortcut_component, avg 628µs/call | ||
620 | 872 | 536ms | $shortcut{'Target'} = get_folderitem_target($onelink, $filesref); # spent 536ms making 872 calls to installer::windows::shortcut::get_folderitem_target, avg 615µs/call | ||
621 | 872 | 4.33ms | $shortcut{'Arguments'} = get_folderitem_arguments($onelink); # spent 4.33ms making 872 calls to installer::windows::shortcut::get_folderitem_arguments, avg 5µs/call | ||
622 | 872 | 4.56ms | $shortcut{'Description'} = get_shortcut_description($onelink, $onelanguage); # localized description # spent 4.56ms making 872 calls to installer::windows::shortcut::get_shortcut_description, avg 5µs/call | ||
623 | 872 | 3.00ms | $shortcut{'Hotkey'} = get_shortcut_hotkey($onelink); # spent 3.00ms making 872 calls to installer::windows::shortcut::get_shortcut_hotkey, avg 3µs/call | ||
624 | 872 | 9.75ms | $shortcut{'Icon_'} = get_folderitem_icon($onelink, $filesref, $iconfilecollector); # spent 9.75ms making 872 calls to installer::windows::shortcut::get_folderitem_icon, avg 11µs/call | ||
625 | 872 | 8.98ms | $shortcut{'IconIndex'} = get_folderitem_iconindex($onelink); # spent 8.98ms making 872 calls to installer::windows::shortcut::get_folderitem_iconindex, avg 10µs/call | ||
626 | 872 | 2.98ms | $shortcut{'ShowCmd'} = get_folderitem_showcmd($onelink); # spent 2.98ms making 872 calls to installer::windows::shortcut::get_folderitem_showcmd, avg 3µs/call | ||
627 | 872 | 62.6ms | $shortcut{'WkDir'} = get_folderitem_wkdir($onelink, $dirref); # spent 62.6ms making 872 calls to installer::windows::shortcut::get_folderitem_wkdir, avg 72µs/call | ||
628 | |||||
629 | my $oneline = $shortcut{'Shortcut'} . "\t" . $shortcut{'Directory_'} . "\t" . $shortcut{'Name'} . "\t" | ||||
630 | . $shortcut{'Component_'} . "\t" . $shortcut{'Target'} . "\t" . $shortcut{'Arguments'} . "\t" | ||||
631 | . $shortcut{'Description'} . "\t" . $shortcut{'Hotkey'} . "\t" . $shortcut{'Icon_'} . "\t" | ||||
632 | . $shortcut{'IconIndex'} . "\t" . $shortcut{'ShowCmd'} . "\t" . $shortcut{'WkDir'} . "\n"; | ||||
633 | |||||
634 | push(@shortcuttable, $oneline); | ||||
635 | } | ||||
636 | } | ||||
637 | |||||
638 | # The soffice.ico has to be included into the icon table | ||||
639 | # as icon for the ARP applet | ||||
640 | |||||
641 | my $onefile = ""; | ||||
642 | my $sofficefile = "soffice.ico"; | ||||
643 | |||||
644 | 109 | 154ms | my $sourcepathref = installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic(\$sofficefile, $includepatharrayref, 0); # spent 154ms making 109 calls to installer::scriptitems::get_sourcepath_from_filename_and_includepath_classic, avg 1.41ms/call | ||
645 | |||||
646 | if ($$sourcepathref eq "") { installer::exiter::exit_program("ERROR: Could not find $sofficefile as icon!", "create_shortcut_table"); } | ||||
647 | |||||
648 | if (! grep {$_ eq $$sourcepathref} @{$iconfilecollector}) | ||||
649 | { | ||||
650 | unshift(@{$iconfilecollector}, $$sourcepathref); | ||||
651 | $installer::globals::sofficeiconadded = 1; | ||||
652 | } | ||||
653 | |||||
654 | my $localinfoline = "Added icon file $$sourcepathref for language pack into icon file collector.\n"; | ||||
655 | push(@installer::globals::logfileinfo, $localinfoline); | ||||
656 | |||||
657 | # Saving the file | ||||
658 | |||||
659 | my $shortcuttablename = $basedir . $installer::globals::separator . "Shortcut.idt" . "." . $onelanguage; | ||||
660 | 109 | 86.1ms | installer::files::save_file($shortcuttablename ,\@shortcuttable); # spent 86.1ms making 109 calls to installer::files::save_file, avg 790µs/call | ||
661 | my $infoline = "Created idt file: $shortcuttablename\n"; | ||||
662 | push(@installer::globals::logfileinfo, $infoline); | ||||
663 | } | ||||
664 | } | ||||
665 | |||||
666 | |||||
667 | 1 | 8µs | 1; | ||
# spent 8.91ms within installer::windows::shortcut::CORE:match which was called 5232 times, avg 2µs/call:
# 872 times (2.52ms+0s) by installer::windows::shortcut::get_folderitem_target at line 377, avg 3µs/call
# 872 times (2.41ms+0s) by installer::windows::shortcut::get_folderitem_icon at line 457, avg 3µs/call
# 872 times (2.00ms+0s) by installer::windows::shortcut::get_folderitem_iconindex at line 508, avg 2µs/call
# 872 times (787µs+0s) by installer::windows::shortcut::get_shortcut_component at line 126, avg 903ns/call
# 872 times (687µs+0s) by installer::windows::shortcut::get_shortcut_component at line 127, avg 788ns/call
# 872 times (497µs+0s) by installer::windows::shortcut::get_folderitem_target at line 378, avg 570ns/call | |||||
# spent 851µs within installer::windows::shortcut::CORE:subst which was called 872 times, avg 976ns/call:
# 872 times (851µs+0s) by installer::windows::shortcut::get_shortcut_name at line 103, avg 976ns/call |