This file is indexed.

/usr/lib/libreoffice/share/extensions/DmathsAddon/CmathOOo/mCopy2Spip.xba is in libreoffice-dmaths 3.4+dfsg1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="mCopy2Spip" script:language="StarBasic">&apos; +-------------------------------------------------------------------------+
&apos; | This source file is part of MaXOpenInfo.com and MaXForms.com projects   |
&apos; |                                                                         |
&apos; +-------------------------------------------------------------------------+
&apos; | Copyright © 2003-2004 - Robert DARGAUD - BOBICIEL. All rights reserved. |
&apos; +-------------------------------------------------------------------------+
&apos; | This source file is free software; you can redistribute it and/or       |
&apos; | modify it under the terms of the GNU Lesser General Public              |
&apos; | License as published by the Free Software Foundation; either            |
&apos; | version 2.1 of the License, or (at your option) any later version.      |
&apos; |                                                                         |
&apos; | This source file is distributed in the hope that it will be useful,     |
&apos; | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
&apos; | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU        |
&apos; | Lesser General Public License for more details.                         |
&apos; | http://www.opensource.org/licenses/lgpl-license.php                     |
&apos; |                                                                         |
&apos; | You should have received a copy of the GNU General Public License       |
&apos; | along with this  source file; if not, write to the Free Software        |
&apos; | Foundation Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  |
&apos; +-------------------------------------------------------------------------+
&apos; | Author: Robert DARGAUD &lt;rdargaud@bobiciel.com&gt;                          |
&apos; +-------------------------------------------------------------------------+
&apos; | Download new version : www.maxopeninfo.com / www.maxopeninfo.org        |
&apos; +-------------------------------------------------------------------------+
&apos; | WikiWiki adaptation       Author                                        |
&apos; |                                                                         |
&apos; | www.spip.net            : Robert DARGAUD - BOBICIEL - July 2004         |
&apos; | www.wikipedia.org       : ............................................  |
&apos; | www.wikini.net          : ............................................  |
&apos; | your WikiWikiWeb        : ............................................  |
&apos; | your WikiWikiWeb        : ............................................  |
&apos; | your WikiWikiWeb        : ............................................  |
&apos; | your WikiWikiWeb        : ............................................  |
&apos; | your WikiWikiWeb        : ............................................  |
&apos; |                                                                         |
&apos; +-------------------------------------------------------------------------+
&apos; | AddOn OpenOffice.org / Sun StarOffice                                   |
&apos; +-------------------------------------------------------------------------+
&apos; | History :                                                               |
&apos; +-------------------------------------------------------------------------+
&apos; | beta 0.1 : 2004/08/02                                                   |
&apos; | beta 0.2 : 2004/08/09 correction pour OOo 1.1.1 dont le &quot;with&quot; semble   |
&apos; |            bogué ! (merci à Luc et Stéphane pour ce retour)             |
&apos; | beta 0.3 : 2004/08/10 correction de la détection BOLD/ITALIC/UNDERLINE  |
&apos; | beta 0.4 : 2004/08/10 support noms de style de paragraphe de la forme   |
&apos; |            WikiWikiName_xxxxxxx  ex: spip_code ==&gt; &lt;code&gt;bla bla&lt;/code&gt; |
&apos; | beta 0.5 : 2004/08/10 support de TextFrame (&lt;cadre&gt; &lt;/cadre&gt; pour Spip) |
&apos; | beta 0.6 : 2004/09/06 eol pour MS Windows et Linux/Unix (merci Tony)    |
&apos; | beta 0.7 : 2004/09/06 modif des débuts et fin de paragraphes suite aux  |
&apos; |            tests de Tony.                                               |
&apos; | novembre 2005 : code modifé par C. Devalland pour repérer les formules 	|
&apos; | mathématiques        													|                                                                         |
&apos; +-------------------------------------------------------------------------+

REM  *****  BASIC  *****

option explicit

&apos;*********************************************************************************
private SpipName as string
private SpipUrl as string

&apos; text frame
private TextOnStartOfTextFrame as string
private TextOnEndOfTextFrame as string
&apos; text section
private TextOnStartOfTextSection as string
private TextOnEndOfTextSection as string
&apos; paragraph
private TextOnStartOfNormalParagraph as string
private TextOnEndOfNormalParagraph as string
&apos; quotation paragraph
private TextOnStartOfQuotationParagraph as string
private TextOnEndOfQuotationParagraph as string
&apos; paragraph title
private TextOnStartOfTitle1Paragraph as string
private TextOnEndOfTitle1Paragraph as string
private TextOnStartOfTitle2Paragraph as string
private TextOnEndOfTitle2Paragraph as string
private TextOnStartOfTitle3Paragraph as string
private TextOnEndOfTitle3Paragraph as string
private TextOnStartOfTitle4Paragraph as string
private TextOnEndOfTitle4Paragraph as string
private TextOnStartOfTitle5Paragraph as string
private TextOnEndOfTitle5Paragraph as string
&apos; paragraph bullet list
private TextOnStartOfBulletList1Paragraph as string
private TextOnEndOfBulletList1Paragraph as string
private TextOnStartOfBulletList2Paragraph as string
private TextOnEndOfBulletList2Paragraph as string
private TextOnStartOfBulletList3Paragraph as string
private TextOnEndOfBulletList3Paragraph as string
private TextOnStartOfBulletList4Paragraph as string
private TextOnEndOfBulletList4Paragraph as string
private TextOnStartOfBulletList5Paragraph as string
private TextOnEndOfBulletList5Paragraph as string
&apos; paragraph numbered list
private TextOnStartOfNumberedList1Paragraph as string
private TextOnEndOfNumberedList1Paragraph as string
private TextOnStartOfNumberedList2Paragraph as string
private TextOnEndOfNumberedList2Paragraph as string
private TextOnStartOfNumberedList3Paragraph as string
private TextOnEndOfNumberedList3Paragraph as string
private TextOnStartOfNumberedList4Paragraph as string
private TextOnEndOfNumberedList4Paragraph as string
private TextOnStartOfNumberedList5Paragraph as string
private TextOnEndOfNumberedList5Paragraph as string
&apos; table
private TextOnStartOfTextTable as string
private TextOnEndOfTextTable as string
private TextOnStartOfRow as string
private TextOnEndOfRow as string
private TextOnStartOfCell as string
private TextOnEmptyCell as string
private TextOnEndOfCell as string
&apos; embeded object
private TextOnStartOfTextEmbeddedObject as string
private TextOnEndOfTextEmbeddedObject as string

&apos; ajouté par C. Devalland
&apos; formula object
private TextOnStartOfFormulaEmbeddedObject as string
private TextOnEndOfFormulaEmbeddedObject as string

&apos; text portion
private TextOnStartOfNormalTextPortion as string
private TextOnEndOfNormalTextPortion as string
private TextOnStartOfBoldTextPortion as string
private TextOnEndOfBoldTextPortion as string
private TextOnStartOfItalicTextPortion as string
private TextOnEndOfItalicTextPortion as string
private TextOnStartOfUnderlineTextPortion as string
private TextOnEndOfUnderlineTextPortion as string
&apos; link
private TextFormatOfInternalLinkTextPortion as string
private TextFormatOfExternalLinkTextPortion as string
&apos; text field
private TextOnStartOfTextField as string
private TextOnEndOfTextField as string
&apos; foot note, control character, index, bookmark, redline
private TextOnStartOfFootnote as string
private TextOnEndOfFootnote as string
private TextOnStartOfControlCharacter as string
private TextOnEndOfControlCharacter as string
private TextOnStartOfReferenceMark as string
private TextOnEndOfReferenceMark as string
private TextOnStartOfDocumentIndexMark as string
private TextOnEndOfDocumentIndexMark as string
private TextOnStartOfBookmark as string
private TextOnEndOfBookmark as string
private TextOnStartOfRedline as string
private TextOnEndOfRedline as string
private TextOnStartOfRuby as string
private TextOnEndOfRuby as string
&apos; graphic object (image)
private TextOnStartOfTextGraphicObject as string
private TextOnEndOfTextGraphicObject as string
&apos; drawing shape
private TextOnStartOfTextShape as string
private TextOnEndOfTextShape as string
private TextOnStartOfDrawingShape as string
private TextOnEndOfDrawingShape as string
&apos; form control
private TextOnStartOfFormControl as string
private TextOnEndOfFormControl as string

&apos; -----------------------------
private sSpipText as string

&apos; *********************************************************************************
sub InitSpip
	static initOk as boolean
	dim eol as string
	
	if initOk then
		exit sub
	end if

	&apos; &lt;en&gt; end of line
	&apos; &lt;fr&gt; caractères de fin de ligne en fonction du sytème d&apos;exploitation
&apos;	if getGUIType() = 1 then
&apos;		eol = chr(13) + chr(10) &apos;testé sur MS Win2000
&apos;	else
		eol = chr(10) &apos; pour Linux et Apple Mac OSX
&apos;	end if

	&apos; ------------------------------- www.spip.net -------------------------------

	SpipName = &quot;spip&quot;
	SpipUrl = &quot;http://www.spip.net&quot;
	&apos; text frame
	TextOnStartOfTextFrame = eol &amp; &quot;&lt;cadre&gt;&quot;
	TextOnEndOfTextFrame = &quot;&lt;/cadre&gt;&quot; &amp; eol
	&apos; text section
	TextOnStartOfTextSection = &quot;&quot;
	TextOnEndOfTextSection = &quot;&quot;
	&apos; paragraph
	TextOnStartOfNormalParagraph = eol
	TextOnEndOfNormalParagraph = eol
	&apos; quotation paragraph
	TextOnStartOfQuotationParagraph = eol &amp; &quot;&lt;quote&gt;&quot;
	TextOnEndOfQuotationParagraph = &quot;&lt;/quote&gt;&quot; &amp;  eol
	&apos; paragraph title
	TextOnStartOfTitle1Paragraph = eol &amp; &quot;{{{&quot;
	TextOnEndOfTitle1Paragraph = &quot;}}}&quot; &amp;  eol
	TextOnStartOfTitle2Paragraph = eol &amp; &quot;{{{&quot;
	TextOnEndOfTitle2Paragraph = &quot;}}}&quot; &amp;  eol
	TextOnStartOfTitle3Paragraph = eol &amp; &quot;{{&quot;
	TextOnEndOfTitle3Paragraph = &quot;}}&quot; &amp;  eol
	TextOnStartOfTitle4Paragraph = eol &amp; &quot;{ {{&quot;
	TextOnEndOfTitle4Paragraph = &quot;}} }&quot; &amp;  eol &amp; eol
	TextOnStartOfTitle5Paragraph = eol &amp; &quot;{ {{&quot;
	TextOnEndOfTitle5Paragraph = &quot;}} }&quot; &amp;  eol
	&apos; paragraph bullet list
	TextOnStartOfBulletList1Paragraph = &quot;- &quot;
	TextOnEndOfBulletList1Paragraph = eol
	TextOnStartOfBulletList2Paragraph = &quot;-* &quot;
	TextOnEndOfBulletList2Paragraph = eol
	TextOnStartOfBulletList3Paragraph = &quot;-** &quot;
	TextOnEndOfBulletList3Paragraph = eol
	TextOnStartOfBulletList4Paragraph = &quot;-*** &quot;
	TextOnEndOfBulletList4Paragraph = eol
	TextOnStartOfBulletList5Paragraph = &quot;-**** &quot;
	TextOnEndOfBulletList5Paragraph = eol
	&apos; paragraph numbered list
	TextOnStartOfNumberedList1Paragraph = &quot;-# &quot;
	TextOnEndOfNumberedList1Paragraph = eol
	TextOnStartOfNumberedList2Paragraph = &quot;-## &quot;
	TextOnEndOfNumberedList2Paragraph = eol
	TextOnStartOfNumberedList3Paragraph = &quot;-### &quot;
	TextOnEndOfNumberedList3Paragraph = eol
	TextOnStartOfNumberedList4Paragraph = &quot;-#### &quot;
	TextOnEndOfNumberedList4Paragraph = eol
	TextOnStartOfNumberedList5Paragraph = &quot;-##### &quot;
	TextOnEndOfNumberedList5Paragraph = eol
	&apos; table
	TextOnStartOfTextTable = eol
	TextOnEndOfTextTable =  eol
	TextOnStartOfRow = &quot;|&quot;
	TextOnEndOfRow = eol
	TextOnStartOfCell = &quot;&quot;
	TextOnEmptyCell = &quot; &quot;
	TextOnEndOfCell = &quot;|&quot;
	&apos; embeded object
	TextOnStartOfTextEmbeddedObject = &quot;&quot;
	TextOnEndOfTextEmbeddedObject = &quot;&quot;
	&apos;ajouté par C. Devalland
	TextOnStartOfFormulaEmbeddedObject = &quot;&lt;math&gt;&quot;
	TextOnEndOfFormulaEmbeddedObject = &quot;&lt;/math&gt;&quot;
	
	&apos; text portion
	TextOnStartOfNormalTextPortion = &quot;&quot;
	TextOnEndOfNormalTextPortion = &quot;&quot;
	TextOnStartOfBoldTextPortion = &quot;{{&quot;
	TextOnEndOfBoldTextPortion = &quot;}}&quot;
	TextOnStartOfItalicTextPortion = &quot;{ &quot;
	TextOnEndOfItalicTextPortion = &quot; }&quot;
	TextOnStartOfUnderlineTextPortion = &quot;&quot;
	TextOnEndOfUnderlineTextPortion = &quot;&quot;
	&apos; link
	TextFormatOfInternalLinkTextPortion = &quot;&quot;
	TextFormatOfExternalLinkTextPortion = &quot;[$string-&gt;$url]&quot;
	&apos; text field
	TextOnStartOfTextField = &quot;&quot;
	TextOnEndOfTextField = &quot;&quot;
	&apos; foot note, control character, index, bookmark, redline
	TextOnStartOfFootnote = &quot;&quot;
	TextOnEndOfFootnote = &quot;&quot;
	TextOnStartOfControlCharacter = &quot;&quot;
	TextOnEndOfControlCharacter = &quot;&quot;
	TextOnStartOfReferenceMark = &quot;&quot;
	TextOnEndOfReferenceMark = &quot;&quot;
	TextOnStartOfDocumentIndexMark = &quot;&quot;
	TextOnEndOfDocumentIndexMark = &quot;&quot;
	TextOnStartOfBookmark = &quot;&quot;
	TextOnEndOfBookmark = &quot;&quot;
	TextOnStartOfRedline = &quot;&quot;
	TextOnEndOfRedline = &quot;&quot;
	TextOnStartOfRuby = &quot;&quot;
	TextOnEndOfRuby = &quot;&quot;
	&apos; graphic object (image)
	TextOnStartOfTextGraphicObject = &quot;&quot; &apos; RMQ: (définir format ?) &lt;img000|center&gt;
	TextOnEndOfTextGraphicObject = &quot;&quot;
	&apos; drawing shape
	TextOnStartOfTextShape = &quot;&quot;
	TextOnEndOfTextShape = &quot;&quot;
	TextOnStartOfDrawingShape = &quot;&quot;
	TextOnEndOfDrawingShape = &quot;&quot;
	&apos; form control
	TextOnStartOfFormControl = &quot;&quot;
	TextOnEndOfFormControl = &quot;&quot;

	initOk = true
end sub

&apos;&lt;fr&gt; l&apos;énumération commence
sub onStartOfEnumeration(oTheComponent as object)
	with oTheComponent
		InitSpip
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un paragraphe
sub onStartOfParagraph(oTheParagraph as object)
	dim a
	with oTheParagraph
		a=-1
		if left(.ParaStyleName,7)=&quot;Heading&quot; then a=oTheParagraph.NumberingLevel &apos;ParaChapterNumberingLevel ne marche plus avec OOo3.1
&apos;		if not isempty(.Cell) then (ok avec OOo 1.1.2)
		if not isempty(oTheParagraph.Cell) then
			&apos; dgjlkg
			&apos;&lt;fr&gt; l&apos;intérieur d&apos;un tableau
		elseif (a &gt;= 0) then
			select case .NumberingLevel 
			case 0
				sSpipText = sSpipText &amp; TextOnStartOfTitle1Paragraph
			case 1
				sSpipText = sSpipText &amp; TextOnStartOfTitle2Paragraph
			case 2
				sSpipText = sSpipText &amp; TextOnStartOfTitle3Paragraph
			case 3
				sSpipText = sSpipText &amp; TextOnStartOfTitle4Paragraph
			case else
				sSpipText = sSpipText &amp; TextOnStartOfTitle5Paragraph
			end select
		elseif isListParagraph(oTheParagraph) then
			if (BulletChar(oTheParagraph) &lt;&gt; &quot;&quot;) then
				select case .NumberingLevel
				case 0
					sSpipText = sSpipText &amp; TextOnStartOfBulletList1Paragraph
				case 1
					sSpipText = sSpipText &amp; TextOnStartOfBulletList2Paragraph
				case 2
					sSpipText = sSpipText &amp; TextOnStartOfBulletList3Paragraph
				case 3
					sSpipText = sSpipText &amp; TextOnStartOfBulletList4Paragraph
				case else
					sSpipText = sSpipText &amp; TextOnStartOfBulletList5Paragraph
				end select
			else
				select case .NumberingLevel
				case 0
					sSpipText = sSpipText &amp; TextOnStartOfNumberedList1Paragraph
				case 1
					sSpipText = sSpipText &amp; TextOnStartOfNumberedList2Paragraph
				case 2
					sSpipText = sSpipText &amp; TextOnStartOfNumberedList3Paragraph
				case 3
					sSpipText = sSpipText &amp; TextOnStartOfNumberedList4Paragraph
				case else
					sSpipText = sSpipText &amp; TextOnStartOfNumberedList5Paragraph
				end select
			end if
			
&apos;	.NumberingStyleName
&apos; print	.NumberingStartValue
&apos; print isempty(.NumberingRules)
&apos; print .NumberingStyleName
&apos; print .ParaIsNumberingRestart

		&apos; &lt;fr&gt; Style de paragraphe &quot;Citation&quot;
		elseif (lcase(oTheParagraph.ParaStyleName) = &quot;quotations&quot;) then
			sSpipText = sSpipText &amp; TextOnStartOfQuotationParagraph
		&apos; &lt;fr&gt; si le style du paragraphe est de la forme : wikiName_xxxxxxxx (exemple : spip_code on génère : &lt;code&gt;contenu du paragraphe&lt;/code&gt; )
 		elseif (left(lcase(oTheParagraph.ParaStyleName), len(SpipName)+1) = (SpipName &amp; &quot;_&quot;)) then
			sSpipText = sSpipText &amp; TextOnStartOfNormalParagraph &amp; &quot;&lt;&quot; &amp; mid(lcase(oTheParagraph.ParaStyleName), len(SpipName)+2) &amp; &quot;&gt;&quot;
		&apos; &lt;fr&gt; paragraphe normal
		else
			sSpipText = sSpipText &amp; TextOnStartOfNormalParagraph
		end if
			
	end with
end sub

sub onEndOfParagraph(oTheParagraph as object)
	with oTheParagraph
		&apos; RMQ: oTheParagraph.Cell pour remédier à ce qui semble être un bug dans le OOoBasic de la 1.1.1,
		&apos; qui semble être corrigé dans la 1.1.2 et qui &quot;rebogue&quot; avec la 2.0 !!!???!!!
&apos;		if not isempty(.Cell) then (ok avec OOo 1.1.2)
		if not isempty(oTheParagraph.Cell) then
			&apos;&lt;fr&gt; l&apos;intérieur d&apos;un tableau
		elseif (left(.ParaStyleName,7)=&quot;Heading&quot;) then &apos;.ParaChapterNumberingLevel&gt;=0 bug
			select case .NumberingLevel &apos;ParaChapterNumberingLevel
			case 0
				sSpipText = sSpipText &amp; TextOnEndOfTitle1Paragraph
			case 1
				sSpipText = sSpipText &amp; TextOnEndOfTitle2Paragraph
			case 2
				sSpipText = sSpipText &amp; TextOnEndOfTitle3Paragraph
			case 3
				sSpipText = sSpipText &amp; TextOnEndOfTitle4Paragraph
			case else
				sSpipText = sSpipText &amp; TextOnEndOfTitle5Paragraph
			end select
		elseif isListParagraph(oTheParagraph) then
			if (BulletChar(oTheParagraph) &lt;&gt; &quot;&quot;) then
				select case .NumberingLevel
				case 0
					sSpipText = sSpipText &amp; TextOnEndOfBulletList1Paragraph
				case 1
					sSpipText = sSpipText &amp; TextOnEndOfBulletList2Paragraph
				case 2
					sSpipText = sSpipText &amp; TextOnEndOfBulletList3Paragraph
				case 3
					sSpipText = sSpipText &amp; TextOnEndOfBulletList4Paragraph
				case else
					sSpipText = sSpipText &amp; TextOnEndOfBulletList5Paragraph
				end select
			else
				select case .NumberingLevel
				case 0
					sSpipText = sSpipText &amp; TextOnEndOfNumberedList1Paragraph
				case 1
					sSpipText = sSpipText &amp; TextOnEndOfNumberedList2Paragraph
				case 2
					sSpipText = sSpipText &amp; TextOnEndOfNumberedList3Paragraph
				case 3
					sSpipText = sSpipText &amp; TextOnEndOfNumberedList4Paragraph
				case else
					sSpipText = sSpipText &amp; TextOnEndOfNumberedList5Paragraph
				end select
			end if
		&apos; &lt;fr&gt; Style de paragraphe &quot;Citation&quot;
&apos;		elseif (lcase(.ParaStyleName) = &quot;quotations&quot;) then &apos; (ok avec OOo 1.1.2)
 		elseif (lcase(oTheParagraph.ParaStyleName) = &quot;quotations&quot;) then
			sSpipText = sSpipText &amp; TextOnEndOfQuotationParagraph
		&apos; &lt;fr&gt; si le style du paragraphe est de la forme : wikiName_xxxxxxxx (exemple : spip_code on génère : &lt;code&gt;contenu du paragraphe&lt;/code&gt; )
 		elseif (left(lcase(oTheParagraph.ParaStyleName), len(SpipName)+1) = (SpipName &amp; &quot;_&quot;)) then
			sSpipText = sSpipText &amp; &quot;&lt;/&quot; &amp; mid(lcase(oTheParagraph.ParaStyleName), len(SpipName)+2) &amp; &quot;&gt;&quot; &amp; TextOnEndOfNormalParagraph
		&apos; &lt;fr&gt; paragraphe normal
		else
			sSpipText = sSpipText &amp; TextOnEndOfNormalParagraph
		end if
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un tableau
sub onStartOfTextTable(oTheTextTable as object)
	with oTheTextTable
		sSpipText = sSpipText &amp; TextOnStartOfTextTable
	end with
end sub

sub onEndOfTextTable(oTheTextTable as object)
	with oTheTextTable
		sSpipText = sSpipText &amp; TextOnEndOfTextTable
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est une ligne de tableau
sub onStartOfRow(oTheRow as object, iTheIndex as integer)
	with oTheRow
		sSpipText = sSpipText &amp; TextOnStartOfRow
	end with
end sub

sub onEndOfRow(oTheRow as object, iTheIndex as integer)
	with oTheRow
		sSpipText = sSpipText &amp; TextOnEndOfRow
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est une cellule de tableau
sub onStartOfCell(oTheCell as object, iTheIndex as integer)
	with oTheCell
&apos;		Xray.Xray oTheCell
&apos;		.CellName;
		&apos;&lt;fr&gt; la cellule est vide
&apos;		if (.String = &quot;&quot;) then
			sSpipText = sSpipText &amp; TextOnStartOfCell &apos;&amp; TextOnEmptyCell
			&apos;&lt;fr&gt; on désactive l&apos;énumération
&apos;			DisableEnumeration
&apos;		end if	
	end with
end sub

sub onEndOfCell(oTheCell as object, iTheIndex as integer)
	with oTheCell
		sSpipText = sSpipText &amp; TextOnEndOfCell
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est une section
sub onStartOfTextSection(oTheTextSection as object)
	with oTheTextSection
		sSpipText = sSpipText &amp; TextOnStartOfTextSection
	end with
end sub

sub onEndOfTextSection(oTheTextSection as object)
	with oTheTextSection
		sSpipText = sSpipText &amp; TextOnEndOfTextSection
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un cadre de texte
sub onStartOfTextFrame(oTheTextFrame as object)
	with oTheTextFrame
		sSpipText = sSpipText &amp; TextOnStartOfTextFrame
	end with
end sub

sub onEndOfTextFrame(oTheTextFrame as object)
	with oTheTextFrame
		sSpipText = sSpipText &amp; TextOnEndOfTextFrame
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un objet incrusté (rmq &apos;embedded&apos; revoir la traduction)
&apos; ajouté par C. Devalland pour tenir compte des formules mathématiques

sub onFormulaEmbeddedObject(oTheTextEmbeddedObject as object)
	with oTheTextEmbeddedObject
		sSpipText = sSpipText &amp; TextOnStartOfFormulaEmbeddedObject &amp; sFormuleOOo2TeX(oTheTextEmbeddedObject.embeddedobject) &amp; TextOnEndOfFormulaEmbeddedObject
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un objet incrusté (rmq &apos;embedded&apos; revoir la traduction)

sub onStartOfTextEmbeddedObject(oTheTextEmbeddedObject as object)
	with oTheTextEmbeddedObject
		sSpipText = sSpipText &amp; TextOnStartOfTextEmbeddedObject &amp; TheTextEmbeddedObject.embeddedobject.formula
	end with
end sub

sub onEndOfTextEmbeddedObject(oTheTextEmbeddedObject as object)
	with oTheTextEmbeddedObject
		sSpipText = sSpipText &amp; TextOnEndOfTextEmbeddedObject
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est une portion de texte
function NormalTextPortion(sTheText as string) as string
	NormalTextPortion = TextOnStartOfNormalTextPortion &amp; sTheText &amp; TextOnEndOfNormalTextPortion
end function

function BoldTextPortion(sTheText as string) as string
	BoldTextPortion = TextOnStartOfBoldTextPortion &amp; sTheText &amp; TextOnEndOfBoldTextPortion
end function

function UnderlineTextPortion(sTheText as string) as string
	UnderlineTextPortion = TextOnStartOfUnderlineTextPortion &amp; sTheText &amp; TextOnEndOfUnderlineTextPortion
end function

function ItalicTextPortion(sTheText as string) as string
	ItalicTextPortion = TextOnStartOfItalicTextPortion &amp; sTheText &amp; TextOnEndOfItalicTextPortion
end function

sub onTextPortion(oTheTextPortion as object)
	dim s as string
	dim isNormalTextPortion as boolean
	with oTheTextPortion
		&apos;&lt;fr&gt; c&apos;est un lien
		if (.HyperLinkURL &lt;&gt; &quot;&quot;) then
			&apos;.HyperLinkEvents, .HyperLinkName, .HyperLinkTarget
&apos;&lt;fr&gt; RMQ: TextFormatOf... doit être généralisé pour tous les objets
			s = TextFormatOfExternalLinkTextPortion
&apos;			s = searchAndReplaceInString(s, &quot;$url&quot;, .HyperLinkURL) &apos; (ok avec OOo 1.1.2)
&apos;			s = searchAndReplaceInString(s, &quot;$string&quot;, .String) &apos; (ok avec OOo 1.1.2)
			s = searchAndReplaceInString(s, &quot;$url&quot;, oTheTextPortion.HyperLinkURL)
			s = searchAndReplaceInString(s, &quot;$string&quot;, oTheTextPortion.String)
			sSpipText = sSpipText &amp; s
		&apos;&lt;fr&gt; c&apos;est une portion de texte non vide
		elseif (.String &lt;&gt; &quot;&quot;) then
			&apos;&lt;fr&gt; dans un titre
			if (left(.ParaStyleName,7)=&quot;Heading&quot;) then &apos;ParaChapterNumberingLevel&gt;=0 bug
				sSpipText = sSpipText &amp; .String
			&apos;&lt;fr&gt; dans un paragraph
			else
				&apos;détection des retours à la ligne
				s = .String
				s=searchAndReplaceInString(s, chr(10), chr(10)&amp;&quot;_ &quot;)
				&apos;&lt;fr&gt; le texte est enrichi
				if (.CharUnderline &lt;&gt; com.sun.star.awt.FontUnderline.NONE) _
				or (.CharWeight &gt; com.sun.star.awt.FontWeight.NORMAL) _
				or (.CharPosture &lt;&gt; com.sun.star.awt.FontSlant.NONE) then
					
					&apos;NONE, SINGLE, DOUBLE, DOTTED, DONTKNOW, DASH, LONGDASH,
					&apos;DASHDOT, DASHDOTDOT, SMALLWAVE, WAVE, DOUBLEWAVE, BOLD,
					&apos;BOLDDOTTED, BOLDDASH, BOLDLONGDASH, BOLDDASHDOT,
					&apos;BOLDDASHDOTDOT, BOLDWAVE
					if (.CharUnderline &lt;&gt; com.sun.star.awt.FontUnderline.NONE) then
						s = UnderlineTextPortion(s)
					end if
					&apos;DONTKNOW, THIN, ULTRALIGHT, LIGHT, SEMILIGHT,
					&apos;NORMAL, SEMIBOLD, BOLD, ULTRABOLD, BLACK
					&apos;These are really only constants where THIN is 50, NORMAL is 100
					&apos; BOLD is 150, and BLACK is 200.
					if (.CharWeight &gt; com.sun.star.awt.FontWeight.NORMAL) then
						s = BoldTextPortion(s)
					end if
					&apos;NONE, OBLIQUE, ITALIC, DONTKNOW, REVERSE_OBLIQUE, REVERSE_ITALIC
					&apos;&lt;fr&gt; merci Bernard :-)
					if (.CharPosture &lt;&gt; com.sun.star.awt.FontSlant.NONE) then
						s = ItalicTextPortion(s)
					end if
					sSpipText = sSpipText &amp; s
				&apos;&lt;fr&gt; le texte n&apos;est pas enrichi
				else
&apos;					sSpipText = sSpipText &amp; NormalTextPortion(.String) &apos; (ok avec OOo 1.1.2)
&apos;					sSpipText = sSpipText &amp; NormalTextPortion(oTheTextPortion.String)
					sSpipText = sSpipText &amp; NormalTextPortion(s)
				end if
			end if
		end if
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un mot
sub onWord(sTheWord as string)
&apos;&lt;fr&gt; RMQ: à implémenter (prévoir de ne l&apos;activer que lorsque c&apos;est nécessaire)

end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un champ
sub onTextField(oTheTextField as object, sTheString as string)
	with oTheTextField
		sSpipText = sSpipText &amp; TextOnStartOfTextField &amp; sTheString &amp; TextOnEndOfTextField
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est une note de bas de page
sub onFootnote(oTheFootnote as object)
	with oTheFootnote
		sSpipText = sSpipText &amp; TextOnStartOfFootnote &amp; .String &amp; TextOnEndOfFootnote
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un caractere de contrôle
sub onControlCharacter(oTheControlCharacter as object)
	with oTheControlCharacter
		sSpipText = sSpipText &amp; TextOnStartOfControlCharacter &amp; .String &amp; TextOnEndOfControlCharacter
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un signet de référence (rmq: revoir la traduction)
sub onReferenceMark(oTheReferenceMark as object)
	with oTheReferenceMark
		sSpipText = sSpipText &amp; TextOnStartOfReferenceMark &amp; .String &amp; TextOnEndOfReferenceMark
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un signet d&apos;index (rmq: revoir la traduction)
sub onDocumentIndexMark(oTheDocumentIndexMark as object)
	with oTheDocumentIndexMark
		sSpipText = sSpipText &amp; TextOnStartOfDocumentIndexMark &amp; .String &amp; TextOnEndOfDocumentIndexMark
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un signet
sub onBookmark(oTheBookmark as object)
	with oTheBookmark
		sSpipText = sSpipText &amp; TextOnStartOfBookmark &amp; .String &amp; TextOnEndOfBookmark
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un resultat (of the change tracking feature) marque de révision ? (rmq: revoir la traduction)
sub onRedline(oTheRedline as object)
	with oTheRedline
		sSpipText = sSpipText &amp; TextOnStartOfRedline &amp; .String &amp; TextOnEndOfRedline
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un attribut utilisé pour les textes asiatiques
sub onRuby(oTheRuby as object)
	with oTheRuby
		sSpipText = sSpipText &amp; TextOnStartOfRuby &amp; .String &amp; TextOnEndOfRuby
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est une image
sub onTextGraphicObject(oTheTextGraphicObject as object)
	with oTheTextGraphicObject
&apos;&lt;fr&gt; RMQ: à revoir
		sSpipText = sSpipText &amp; TextOnStartOfTextGraphicObject &amp; TextOnEndOfTextGraphicObject
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un dessin
sub onTextShape(oTheTextShape as object)
	with oTheTextShape
&apos;		sSpipText = sSpipText &amp; TextOnStartOfTextShape &amp; ? &amp; TextOnEndOfTextShape
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un dessin (sur la page draw)
sub onDrawingShape(oTheDrawingShape as object)
	with oTheDrawingShape
&apos;		sSpipText = sSpipText &amp; TextOnStartOfDrawingShape &amp; ? &amp; TextOnEndOfDrawingShape
	end with
end sub

&apos;&lt;fr&gt; l&apos;objet énuméré est un contrôle de formulaire
sub onFormControl(oTheFormControl as object)
	with oTheFormControl
&apos;		sSpipText = sSpipText &amp; TextOnStartOfFormControl &amp; ? &amp; TextOnEndOfFormControl
	end with
end sub

&apos;&lt;fr&gt; l&apos;énumération est terminée
sub onEndOfEnumeration(oTheComponent as object)
	with oTheComponent
		&apos;&lt;fr&gt; copie du texte WikiWiki dans le presse-papier
		mTextToClipboard.TextToClipboard(sSpipText)
	end with
end sub

&apos; *****************************************************************************************
function searchAndReplaceInString(sTheTargetString, sTheSearchString, sTheNewString) as string
	dim pos as integer
	dim s as string
	s = sTheTargetString
	pos = -len(sTheNewString)
	do
		pos = instr(pos + len(sTheNewString) + 1, s, sTheSearchString)
		if (pos &gt; 0) then
			s = left(s, pos - 1) &amp; sTheNewString &amp; mid(s, pos + len(sTheSearchString))
		end if
	loop while pos &gt; 0
	searchAndReplaceInString = s
end function

function BulletChar(oTheParagraph as object) as string
	dim oNumberingRulesForLevel
	dim i as integer

	BulletChar = &quot;&quot;
	if (not isNull(oTheParagraph.NumberingRules) and not isEmpty(oTheParagraph.NumberingRules)) then
        oNumberingRulesForLevel = oTheParagraph.NumberingRules.getByIndex(oTheParagraph.NumberingLevel)
&apos;&lt;fr&gt; RMQ: voir s&apos;il n&apos;est pas possible d&apos;utiliser une fonction du genre getByName(&quot;BulletChar&quot;), pour éviter cette boucle
		for i = lbound(oNumberingRulesForLevel) to ubound(oNumberingRulesForLevel)
			with oNumberingRulesForLevel(i)
	        	if (.Name = &quot;BulletChar&quot;) then
					BulletChar = .Value
					exit for
				end if
			end with
        next
	end if
end function

function isListParagraph(oTheParagraph as object) as boolean
	isListParagraph = not(IsNull(oTheParagraph.NumberingStyleName) or IsEmpty(oTheParagraph.NumberingStyleName) or (len(oTheParagraph.NumberingStyleName) = 0))
end function


rem Procédure principale. 
sub Copy2Spip
	dim oDoc as object
	InitVariablesOOo2TeX
	&apos; traiter la selection éventuelle
	if ThisComponent.getcurrentcontroller.viewcursor.iscollapsed then
		&apos; tout le document est converti

		DocumentEnumeration(&quot;Writer&quot;, ThisComponent, mCopy2Spip)
	else
		&apos; la selection est convertie
		&apos; c&apos;est de la pure bidouille : copie de la selection dans un nouveau document
		&apos; puis conversion de ce document et enfin fermeture.
		&apos; lorsque ce document est caché, cela ne fonctionne pas...
		&apos; en attendant mieux... !
	    ClipboardCopy( ThisComponent )
	   	oDoc = StarDesktop.loadComponentFromURL( &quot;private:factory/swriter&quot;, &quot;_blank&quot;, 0,Array( MakePropertyValue( &quot;Hidden&quot;, false ) ) )
		oDoc.CurrentController.Frame.ContainerWindow.Visible=False
		ClipboardPaste( oDoc )
		DocumentEnumeration(&quot;Writer&quot;, oDoc, mCopy2Spip)
		oDoc.close( True )
	end if
end sub

</script:module>