writer2latex-1.4/0000755000175000017500000000000012603463653012466 5ustar renerenewriter2latex-1.4/build.xml0000644000175000017500000003200612470406570014305 0ustar renerene writer2latex - build file Usage: ant <target> The following targets are supported: all Build nearly everything compile Compile all file except the tests. jar Create the standalone jar file. oxt Create extension packages for OOo distro Create the distribution packages javadoc Create the javadoc documentation in target/javadoc. clean writer2latex-1.4/source/0000755000175000017500000000000012603463653013766 5ustar renerenewriter2latex-1.4/source/distro/0000755000175000017500000000000012603463652015271 5ustar renerenewriter2latex-1.4/source/distro/Readme.txt0000644000175000017500000000064212470406570017227 0ustar renereneWriter2LaTeX version 1.4 ======================== This is the distribution of Writer2LaTeX version 1.4 Latest version can be found at the web site http://writer2latex.sourceforge.net You can read about installation and usage of Writer2LaTeX in the user guide, which is included in the directory doc. Bugs and feature requests should be reported to writer2latex (at) gmail.com February 2015 Henrik Just writer2latex-1.4/source/distro/latex/0000755000175000017500000000000012603463652016406 5ustar renerenewriter2latex-1.4/source/distro/latex/obsolete/0000755000175000017500000000000012603463652020222 5ustar renerenewriter2latex-1.4/source/distro/latex/obsolete/writer.sty0000644000175000017500000000773711147474702022315 0ustar renerene%% File: ooomath.sty, Copyright (C) 2002-2004 Henrik Just %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.2 %% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.2 or later is part of all distributions of LaTeX %% version 1999/12/01 or later. %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{ooomath}[2004/08/08 v1.0 - stylefile used by Writer2LaTeX] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Some math mode macros defining additional symbols % \ddotsup is taken from "The comprehensive LaTeX symbol list" \newcommand\defeq{\stackrel{\mathrm{def}}{=}} \newcommand\lambdabar{\mathchar'26\mkern-10mu\lambda} \newcommand\ddotsup{\mathinner{\mkern1mu\raise\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu\raise4\p@\hbox{.}\mkern2mu\raise7\p@ \hbox{.}\mkern1mu}} % Fallback definitions for math mode macros defined in other packages \providecommand\multimapdotbothA{\bullet\kern-0.4em-\kern-0.4em\circ} \providecommand\multimapdotbothB{\circ\kern-0.4em-\kern-0.4em\bullet} \providecommand\oiint{\oint} % should be area integral... \providecommand\oiiint{\oint} % should be volume integral... \providecommand\llbracket{[} % should be double... \providecommand\rrbracket{]} % should be double... % More math mode macros \newcommand\wideslash[2]{{}^{#1}/_{#2}} % too small \newcommand\widebslash[2]{{}_{#1}\backslash^{#2}} % too small \newcommand\normalsubformula[1]{\text{$#1$}} \newcommand\boldsubformula[1]{\text{\mathversion{bold}$#1$}} % Multiscripts, based on leftidx.sty by Harald Harders \newlength{\idxmathdepth} \newlength{\idxmathtotal} \newlength{\idxmathwidth} \newlength{\idxraiseme} % \newcommand{\idxdheight}[1]{% \protect\settoheight{\idxmathtotal}{\(\displaystyle#1\)}% \protect\settodepth{\idxmathdepth}{\(\displaystyle#1\)}% \protect\settowidth{\idxmathwidth}{\(\displaystyle#1\)}% \protect\addtolength{\idxmathtotal}{\idxmathdepth}% \protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}} \newcommand{\idxtheight}[1]{% \protect\settoheight{\idxmathtotal}{\(\textstyle #1\)}% \protect\settodepth{\idxmathdepth}{\(\textstyle #1\)}% \protect\settowidth{\idxmathwidth}{\(\textstyle#1\)}% \protect\addtolength{\idxmathtotal}{\idxmathdepth}% \protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}} \newcommand{\idxsheight}[1]{% \protect\settoheight{\idxmathtotal}{\(\scriptstyle #1\)}% \protect\settodepth{\idxmathdepth}{\(\scriptstyle #1\)}% \protect\settowidth{\idxmathwidth}{\(\scriptstyle#1\)}% \protect\addtolength{\idxmathtotal}{\idxmathdepth}% \protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}} \newcommand{\idxssheight}[1]{% \protect\settoheight{\idxmathtotal}{\(\scriptscriptstyle #1\)}% \protect\settodepth{\idxmathdepth}{\(\scriptscriptstyle #1\)}% \protect\settowidth{\idxmathwidth}{\(\scriptscriptstyle#1\)}% \protect\addtolength{\idxmathtotal}{\idxmathdepth}% \protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}} % \multiscripts{}{}{}{}{} \newcommand\multiscripts[5]{% \mathchoice% {\idxdheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2} {\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}% {\idxtheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2} {\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}% {\idxsheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2} {\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}% {\idxssheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2} {\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5} }% \newcommand\mathoverstrike[1]{% \mathchoice% {\idxdheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}% {\idxtheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}% {\idxsheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}% {\idxssheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}% } \endinput writer2latex-1.4/source/distro/latex/ooomath.sty0000644000175000017500000000776411147474702020633 0ustar renerene%% File: ooomath.sty, Copyright (C) 2002-2004 Henrik Just %% %% This file may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.2 %% of this license or (at your option) any later version. %% The latest version of this license is in %% http://www.latex-project.org/lppl.txt %% and version 1.2 or later is part of all distributions of LaTeX %% version 1999/12/01 or later. %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{ooomath}[2004/12/27 v1.01 - stylefile used by Writer2LaTeX] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Some math mode macros defining additional symbols % \ddotsup is taken from "The comprehensive LaTeX symbol list" \newcommand\defeq{\stackrel{\mathrm{def}}{=}} \newcommand\lambdabar{\mathchar'26\mkern-10mu\lambda} \newcommand\ddotsup{\mathinner{\mkern1mu\raise\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu\raise4\p@\hbox{.}\mkern2mu\raise7\p@ \hbox{.}\mkern1mu}} % Fallback definitions for math mode macros defined in other packages \providecommand\multimapdotbothA{\bullet\kern-0.4em-\kern-0.4em\circ} \providecommand\multimapdotbothB{\circ\kern-0.4em-\kern-0.4em\bullet} \providecommand\oiint{\oint} % should be area integral... \providecommand\oiiint{\oint} % should be volume integral... \providecommand\llbracket{[} % should be double... \providecommand\rrbracket{]} % should be double... % More math mode macros \newcommand\wideslash[2]{{}^{#1}/_{#2}} % too small \newcommand\widebslash[2]{{}_{#1}\backslash^{#2}} % too small \newcommand\normalsubformula[1]{\text{\mathversion{normal}$#1$}} \newcommand\boldsubformula[1]{\text{\mathversion{bold}$#1$}} % Multiscripts, based on leftidx.sty by Harald Harders \newlength{\idxmathdepth} \newlength{\idxmathtotal} \newlength{\idxmathwidth} \newlength{\idxraiseme} % \newcommand{\idxdheight}[1]{% \protect\settoheight{\idxmathtotal}{\(\displaystyle#1\)}% \protect\settodepth{\idxmathdepth}{\(\displaystyle#1\)}% \protect\settowidth{\idxmathwidth}{\(\displaystyle#1\)}% \protect\addtolength{\idxmathtotal}{\idxmathdepth}% \protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}} \newcommand{\idxtheight}[1]{% \protect\settoheight{\idxmathtotal}{\(\textstyle #1\)}% \protect\settodepth{\idxmathdepth}{\(\textstyle #1\)}% \protect\settowidth{\idxmathwidth}{\(\textstyle#1\)}% \protect\addtolength{\idxmathtotal}{\idxmathdepth}% \protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}} \newcommand{\idxsheight}[1]{% \protect\settoheight{\idxmathtotal}{\(\scriptstyle #1\)}% \protect\settodepth{\idxmathdepth}{\(\scriptstyle #1\)}% \protect\settowidth{\idxmathwidth}{\(\scriptstyle#1\)}% \protect\addtolength{\idxmathtotal}{\idxmathdepth}% \protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}} \newcommand{\idxssheight}[1]{% \protect\settoheight{\idxmathtotal}{\(\scriptscriptstyle #1\)}% \protect\settodepth{\idxmathdepth}{\(\scriptscriptstyle #1\)}% \protect\settowidth{\idxmathwidth}{\(\scriptscriptstyle#1\)}% \protect\addtolength{\idxmathtotal}{\idxmathdepth}% \protect\setlength{\idxraiseme}{\idxmathtotal/2-\idxmathdepth}} % \multiscripts{}{}{}{}{} \newcommand\multiscripts[5]{% \mathchoice% {\idxdheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2} {\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}% {\idxtheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2} {\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}% {\idxsheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2} {\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5}% {\idxssheight{#4}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#1\underset{#2} {\overset{#3}{#4}}\rule[-\idxmathdepth]{0mm}{\idxmathtotal}#5} }% \newcommand\mathoverstrike[1]{% \mathchoice% {\idxdheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}% {\idxtheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}% {\idxsheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}% {\idxssheight{#1}\rlap{\rule[\idxraiseme]{\idxmathwidth}{0.4pt}}{#1}}% } \endinput writer2latex-1.4/source/distro/w2l.bat0000644000175000017500000000051211526156714016464 0ustar renerene@echo off rem *Very* simple batch file to run Writer2LaTeX rem Last modified february 2011 rem If the Java executable is not in your path, please edit the following rem line to contain the full path and file name set JAVAEXE="java" %JAVAEXE% -jar "%~dp0\writer2latex.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9 set JAVAEXE= writer2latex-1.4/source/distro/samples/0000755000175000017500000000000012603463652016735 5ustar renerenewriter2latex-1.4/source/distro/samples/xhtml/0000755000175000017500000000000012603463652020071 5ustar renerenewriter2latex-1.4/source/distro/samples/xhtml/sample-xhtml.odt0000644000175000017500000003046511147474702023224 0ustar renerenePKsD6^2 ''mimetypeapplication/vnd.oasis.opendocument.textPKsD6Configurations2/statusbar/PKsD6'Configurations2/accelerator/current.xmlPKPKsD6Configurations2/floater/PKsD6Configurations2/popupmenu/PKsD6Configurations2/progressbar/PKsD6Configurations2/menubar/PKsD6Configurations2/toolbar/PKsD6Configurations2/images/Bitmaps/PKsD6 content.xml[[o~ 4hHcH 7ۭSH ;-J"!gI%)aҟ_sȹiFہm Hfs!5y*iÕa2Tq7'xf3Q4fC%-K[R-GnF̌l8R 9רJ=rkњW-[ٶHK5;*w-3Uj˼2?SzPkV_ƽ(`y2Pz 7[tI€ L0 6fi&42ji#n:#; T Gޓ}xO*oLbGL0*sAmu!TIk7=u_)U ~:sN^^%_jn{C*qo PipD;Er}u.XLKb~ϥT"2YIۨhzMP ̠xg4dL/ {7u\l1My['Q pH5B+>_X򏝺W~PZFJs*[qok…Rޢح,1?,NN"~2\dOv(a GNUTx#$856c+horfLygΆ[*x蠨(أ^ږ r܃uPvIYuTn]3)L71N;*=RmP6t޲L \UȲo ,8GϿV bA7),ո7L{߾p㉹ :%y9q*Sَ}v@)0 )!gGC#uHNJ/#ΞOyzN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2xd7!ɧa87|"sϩ]PK5b9>JPKsD6^2 ''mimetypePKsD6MConfigurations2/statusbar/PKsD6'Configurations2/accelerator/current.xmlPKsD6Configurations2/floater/PKsD6Configurations2/popupmenu/PKsD6JConfigurations2/progressbar/PKsD6Configurations2/menubar/PKsD6Configurations2/toolbar/PKsD6Configurations2/images/Bitmaps/PKsD6&iUo1 -content.xmlPKsD6m$3 5 styles.xmlPKsD6\meta.xmlPKsD6<QThumbnails/thumbnail.pngPKsD6̴R $&settings.xmlPKsD65b9>J+META-INF/manifest.xmlPK1-writer2latex-1.4/source/distro/samples/latex/0000755000175000017500000000000012603463652020052 5ustar renerenewriter2latex-1.4/source/distro/samples/latex/sample-article.odt0000644000175000017500000007631011346414331023464 0ustar renerenePK}@l<^2 ''mimetypeapplication/vnd.oasis.opendocument.textPK}@l<Configurations2/statusbar/PK}@l<'Configurations2/accelerator/current.xmlPKPK}@l<Configurations2/floater/PK}@l<Configurations2/popupmenu/PK}@l<Configurations2/progressbar/PK}@l<Configurations2/menubar/PK}@l<Configurations2/toolbar/PK}@l<Configurations2/images/Bitmaps/PK}@l< layout-cachecd`d(g``d``ц1 PKiPK}@l< content.xml]㶑VRHIR&;Vf8JA$$C4@f׽=ý7'n%4kv=GwC_K<0{q.׽o?_0|v '^ ;"j^b\ 蒩ȹ! ZWWIQѓ߸.Ǩie,Kg9ڮ,(5[}.V~T~.@ːF ţσEpZ@ptyy9ԹNZ.Kΐ h0&e,MòYx9cjhDKؠǣ16t|N;qu462n? Myaٜ4X P-dh~gJ_I1)l-PI5.UJr!i |TPa<4ian$;cK. y"5#6t(Y(d*f`BoS.lh }ye) qdoRq'Nc$NJǞ/zSWy#&a w^F4z l0MԟS]j1!i21Q]Dr&sZr&@1Ǿ2L^kWpY渘*)K2䊄L>[3Ks[ m6yz;Wo'/So\RO;XaD?EsҴ 8ͰN1sS_ ,͎ۨI[аظ26 ) w9\ fJ=0lqe{,m4"*>h!c?ͥ PhIqk[.n \mLOTXsg{HƬY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cv|Q\Fe*8hK>U9}%/ U$U~YDW?.'+sD먜f//BROgU?B)2$ʊsO-bj8-/.r< `ܶL׻HODNuR*8 nHo&vP=&&_C0l5pzt?݉ub7!| jMP*#짤RL$:89MgmL tT%FobbyobwdJd*2;_ݰt5=^Žu6Jb?~y=-~bZ/w!RW>,»_gu^X!a+ؐ?ZlּtUˍ~ ;k8uX4d{cՇԜ \u&~uX]㷇B)\N ejG3s )ҞpvPe`u/HO$۝ɇ)c.sš%;ۍ"xT /&Qmp%S觓{1l#ĐPְ|+5uv}JDc"j XR r w t qE,A/){+boM:A_ KDKcIjfGUYs&TduɄ4InwNhD:p)~Ksh-x-A厘i,u9rZ+PS#z>* {0{|Ѣ*gt-~Ĩj!G2 tuWcwcsK8)A`mj- kÚ}R*~M*.c"1Y/CS[&lWX`0I J /otF0mz"-kyKe ;K`6[1_.06y񳣄@䠇]Y23t U⿌wYt"-UG dMdOP=\@ME²!Çgj0};\7?PKA.Wt%PK}@l<META-INF/manifest.xmln @{5I\H6U#f[5[Aنa0igX=r}#7ox^/VX!q}i1i- H5ySq@dZ/ ˴0EGV)NmutUsEx`q=j9EcJkS^t16ZJbH[yLS!Lfwetc&w>t3b&|p}@wSHE:ndm#TQWj.] o0^]Rፊʩ\og.hnmւ6$4 oa9=Ү䷗xPKybUPK}@l<^2 ''mimetypePK}@l<MConfigurations2/statusbar/PK}@l<'Configurations2/accelerator/current.xmlPK}@l<Configurations2/floater/PK}@l<Configurations2/popupmenu/PK}@l<JConfigurations2/progressbar/PK}@l<Configurations2/menubar/PK}@l<Configurations2/toolbar/PK}@l<Configurations2/images/Bitmaps/PK}@l writer2latex-1.4/source/distro/w2l0000644000175000017500000000131711147474702015722 0ustar renerene# *Very* simple script to run Writer2LaTeX (unix version) # Created by Henrik Just, october 2003 # Modified december 2003 as suggested by Juan Julian Merelo Guervos # Modified may 2004 as suggested by J. Wolfgang Kaltz # Last modified december 2008 # If writer2latex.jar is not in the same directory as the script, please # edit the following line to contain the full path to Writer2LaTeX: W2LPATH=`dirname $0` # If the required JVM is not in your path, or the path is not set by JAVA_HOME, # please edit the following line to contain the full path and file name MYJAVAEXE="java" if [ "$JAVA_HOME" = "" ] then JAVAEXE="$MYJAVAEXE" else JAVAEXE="$JAVA_HOME/bin/java" fi $JAVAEXE -jar "$W2LPATH/writer2latex.jar" "$@"writer2latex-1.4/source/distro/History.txt0000644000175000017500000001652312470406570017500 0ustar renereneVersion history for Writer2LaTeX ================================ Version 1.4 (February 2015) - All: - Optimized memory usage - Images that are used more than once in the document are now only exported once - Now requires Java 6 - LaTeX: - New option display_hidden_text to toggle the export of hidden text in the document - Merge spans with identical formatting - Support for TexMaths equations - The package ooomath.sty is no longer required by standard configurations - StarMath bugfixes - XHTML: - Support for (polyglot) HTML5, replacing the target format XHTML+MathML+XSLT - New option use_mathjax to load the MathJax library if the target format is XHTML+MathML or HTML5 - Support for TexMaths equations (only if use_mathjax=true) - Vector graphics is now converted to SVG if target format is HTML5 - New option embed_svg to embed SVG directly in HTML if target format is HTML5 - Support for HTML5 elements in templates - Merge span elements with identical attributes - New option table_size replacing the option ignore_table_dimensions - Support display equations Version 1.2.1 (September 2014) - All: - Updated to work with LO 4.x Version 1.2 beta (March 2012) - Filters: - Added user interface to edit custom configuration - Added help files - New Writer4LaTeX extension supporting the use of Writer as a frontend to LaTeX - LaTeX: - Support XeTeX and polyglossia.sty - Support for xepersian.sty - Support Zotero, JabRef and natbib.sty - Improved support for cross references - Support unnumbered headings - Support first/last foot for multipage tables - Cleaner export of formulas (avoiding redundant braces) - Support for new StarMath constructs - Support the "numbered formula" AutoText in Writer - XHTML: - Support conversion to EPUB format - Support conversion to XHTML 1.1 (without MathML) - The style sheet can now be created in a separate file - New option to export images using relative width - Improved support for footnotes and endnotes - Improved support for list formatting - Support split by page breaks - Support optional export of hidden text - Formulas can now be exported as images - Added option to avoid pretty printing of the xhtml source - General: - New methods to load custom templates and style sheets in the converter API - Support for complex options in the converter API - New method in the converter API to access the metadata of the converted document - The converter API now provides pointers to headings and other important places in the converted document - The converter API now provides better identification of files that are part of the main document flow - New attributes Resources, ResourceURL in filter API Version 1.0 (September 2009) -Filters: - Changed to oxt format and separated into Writer2LaTeX and Writer2xhtml extensions - Added (localized) dialogs to the filters - LaTeX: - Export vector graphics to pdf for use with pdfTeX. - Support equations generated by OOoLaTeX. - XHTML: - Improved navigation features for splitted documents - Do not export hidden or filtered rows and columns. Apply print ranges. - Improved batch conversion - General: - Export images to a subdirectory. Version 0.5 (June 2007) - LaTeX: - support fancyhdr.sty - support geometry.sty - support supertabular.sty - support tabulary.sty - support colortbl.sty - support l, c, r columns in tables - support floating figures and tables - some graphics improvements - custom tabstop handling - flexible handling of notes (ignore, comment, marginpar, pdf annotation) - string replace (eg. LaTeX -> \LaTeX) - XHTML: - convert an entire directory with index page(s) - convert using a template document - support html forms - custom tabstop handling - support continued lists - improved export of table formatting - support background images - improved table of contents - General: - support OpenDocument - now installable as uno package (extension) - no longer using the XMerge framework Version 0.4 (July 2005) - LaTeX: - improved readability of output (wrap long lines, do not include unused labels and hypertargets) - support for more languages - writer.sty is replaced by the optional package ooomath.sty - color.sty is now optional - new options to ignore hard page and line breaks - new option to ignore double spaces - new option to specify that the document is *not* multilingual - support for cp1251 (Windows cyrillic) and latin2 inputenc - improved style maps for paragraphs (avoid line break, verbatim content) - cleaned up configuration of formatting - improved export of list formatting - support for other documentclasses than article - support for lastpage.sty - support for eurosym.sty - support for tipa.sty - support for various 8-bit fonts: Wingdings, Windows Symbol - support for OpenSymbol - XHTML: - converts units to px (default) - Calc2xhtml added - improved support for table formatting; table formatting is now always exported - (partial) bidi support - support for sections (margins and background color) - new option to scale column widths - new options to ignore double spaces, hard line breaks and empty paragraphs - General - Added ant build file (provided by Michael Niedermair) - Now possible to specify output path+file name on command line - removed usage of document specific configuration files (*-config.xml) - new option to create user configuration automatically Version 0.3.2 (February 2004) - LaTeX: - support for custom math symbols (%symbol) - improved handling of paragraph formatting - support for table borders - support for alphabetical index - support for pdf meta data - XHTML: - support for three different XHTML variants - long documents can be split in several XHTML documents - support for custom style sheets - more flexible handling of fomatting - support for most XHTML elements (including blockquote, dl, hr) - support for alphabetical index - support for meta data Version 0.3 (October 2003) - support for BibTeX - support for greek and russian text - support for more languages - support for latin1, cp1250, iso-8859-7, koi8-r and utf8 (Dominique Unruh's ucs.sty) inputencodings - support for symbol fonts: pifont.sty, wasysym.sty, ifsym.sty and bbding.sty - support for ulem.sty (underline/cross out) - export of footnotes configuration, list label styles, heading styles and hard paragraph formatting can be disabled - custom export of list styles - bugfixes Version 0.2 (March 2003) - support for tables - support for graphics - support for outline numbering and list styles - support for page styles - support for sections (columns) - custom export of text and paragraph styles - integration with xmerge (enables use as export filter) - export to XHTML + MathML Version 0.1 (September 2002) - first simple versionwriter2latex-1.4/source/distro/changelog.txt0000644000175000017500000001667212470406570017773 0ustar renereneChangelog for Writer2LaTeX version 1.2 -> 1.4 ---------- version 1.4 final ---------- [all] The help button is now labeled Help in all export dialogs [w2x] Bugfix: No longer include xmlns attribute on math nodes in HTML5 export [w2l] Workaround for an oddity seen in AOO 4.1 and LO 4.0: For SVG images the alternative PNG representation is stored before the SVG image in the document. Now the alternative image is preferred if it can be converted to the default vector format of the conversion. [w2x] Bugfix: The option pages for editing the custom style are now also visible in Calc [w2l] Bugfix: In the export dialog, the LaTeX format is now persistent, also for custom formats [w2x] Bugfix: The date dialog used by the EPUB Metadata dialog now has a title [w2x] Bugfix: The date field in the EPUB Metadata dialog did not work in LO 4.1 and newer. This was due to an API change in LO (long replaced by com.sun.star.util.Date), and is now fixed. ---------- version 1.4 beta ---------- [w4l] Zotero BibTeX exporter is updated to the latest version [all] Build file is now set up to cross compile for java 6 [w2x] If the export dialogs are loaded with a setting for scaling or column_scaling of 1% or less, the value is reset to 100%. This is a workaround for an obscure bug in the extension manager, which in some cases sets the value to 1% if the export is used right after installation. [w2x] Bugfix: The help button on the EPUB export dialog now works [w2x] Bugfix: Avoid null pointer exception in HTML5 export if embed_svg is true and an image is used more than once [all] An image that is used more than once in the source document is now only exported once. This was already the case for the package format (since 1.3.2), but now also for flat XML. [w2x] The The option inline_svg has been renamed (again) to embed_svg, and the default is changed to false [w2x] The experimental option zen_hack has been removed [w2x] For templates it is no longer required that the footer, header and panel are contained in a div element. This allows for HTML5 code like
. The default header and footer are now created with header+nav and footer+nav elements if the target format is HTML5. ---------- version 1.3.2 alpha ---------- [w2l] Two or more span elements in a row which generates identical formatting in LaTeX are now merged. This avoids constructs like \textbf{this is }\textbf{bold}. [w2l] Optimization: The SimpleDomBuilder now merges text nodes [w2l] Replace usage of StringBuffer with StringBuilder everywhere (marginal optimization) [w2l] The standard configurations pdfprint.xml and pdfscreen.xml no longer requires ooomath.sty [w2l] A bookmark in a heading no longer results in an optional argument to \section commands [w2l] New option display_hidden_text (default false) to toggle whether or not hidden text should be included in the export. In the export filter, this option can be toggled in the export options dialog. [w2l] Bugfix (StarMath conversion): The five colors red, green, blue, magenta and yellow is now exported to the correct dark colors rather than the previous bright colors (the colors white, black and yellow are unchanged) [w2x] If a border has a width which is equivalent to less that 1px, it is now exported with the width 1px. This fixes an issue with some browsers, that would render the border invisible. [w2x] Two or more span elements in a row with identical attributes are now merged [all] Filters: Appended [Writer2LaTeX] or [Writer2xhtml] to all filter UI names to make them more visible [w2l] Bugfix: Avoid null pointer exception caused by list styles in some cases [w2x] Bugfix: EPUB export filter works again (was broken in 1.3.1) [w2x] Bugfix: Text boxes are no longer lost if within a paragraph [w2x] SVG support in HTML5 is now finished: Images in SVG format are kept in the original format. Other vector images are converted to SVG (filter only). This only works with recent versions of the office (LO 4.2 and AOO 4.1 are known to work). The option use_svg has been renamed to inline_svg. If set to true (default) inline SVG is used, if set to false, external SVG-files (img-elements) are used. In the UI, this setting can be found on the options page Writer2xhtml - Content. [all] If an image image cannot be converted to an acceptable format, the optional alternative image will now be tried [all] Bugfix: Avoid null pointer exception if a table has no defined table width [w2l] Bugfix (StarMath conversion): Protect the character [ after \\ in gather and matrix environments [w2l] Bugfix: Protect the character [ after \\ in tables [w2l] Bugfix (StarMath conversion): Usage of \multiscripts and \mathoverstrike now loads the required calc.sty [w2l] Bugfix (StarMath conversion): Do not create display equations in table cells [w2l] Bugfix (StarMath conversion): Set the counter MaxMatrixCols if there are matrices with more than 10 columns [w2l] Bugfix (StarMath conversion): Add braces if the argument to a command is a space, e.g. \text{ } [all] Refactored and optimized memory usage of image conversion [all] Refactored and rearranged some code; in particular the last remaining bits of the old xmerge framework has been removed [all] Optimized reading of package format: The settings.xml files are not parsed and the unused parts of the ZIP file are disposed ---------- version 1.3.1 alpha ---------- [w2x] Starting with version 4.2, LibreOffice exports display="math" on display equations. This attribute is now removed if a display equation is used inline in the source document. [w2x] Support for the obsolete output format XHTML+MahtML+XSL has been removed (replaced by MathJax). As a consequence the option xslt_path has been removed. Also the vacant spot in the export dialog is now used for the option use_mathjax (only active for XHTML+MathML and HTML5) [all] Added support for TexMaths equations in LaTeX, XHTML+MathML and HTML5 (the last two only if use_mathjax=true) [all] The command line application now gives an explanation if the source file is not in ODF format [all] Bugfix: Fixed typo that caused writer2latex.office.MIMETypes.getMagicMIMEType() to fail in some cases [w2x] The option ignore_table_dimensions has been replaced by a new option table_size with values none (do not export table dimensions), relative (always use relative width) and auto (use the formatting of the source document): If set to true, all tables are exported with relative width, even if they have an absolute width in the source document [w2x] New boolean option use_mathjax (default false): If set to true and export format is XHTML+MATHML or HTML5, documents will load the MathJax JavaScript library for rendering of formulas (otherwise the document will rely on native MathML support in the browser) [w2x] New boolean option use_svg (default false): If set to true and export format is HTML5, vector graphics are exported as inline SVG, if possible [w2x] Added support for HTML5 as export type (the ConverterFactory understands the pseudo-MIME type text/html5). The converter creates polyglot HTML5 documents, i.e. documents will be conforming to HTML5 as well as XML standards. [all] Optimized the parsing of the source document saving some time and space (several intermediate steps and large byte arrays are now avoided) [all] API change: The converters can now convert directly from a DOM tree [all] Removed unused code in writer2latex.xmerge [w2x] Moved localized strings to .properties fileswriter2latex-1.4/source/distro/doc/0000755000175000017500000000000012603463652016036 5ustar renerenewriter2latex-1.4/source/distro/doc/w2llogo.png0000644000175000017500000001275011147474702020136 0ustar renerenePNG  IHDRNkIDATx]KvUh-xl#fl#z-xm!@T5[=9NKf@~߾};V履L?~C]ϟ_^^hD%a?CpΌr}PU J?Ҵ^Aݛ>_KX IЍG ` aNNAˋr&_~_~&LFC,+:=??_Lrr.k#j:d!(+[}򿙹_(mNM$Ǐ۾-aYgvau xTE ƂP43!ÝThHsdgV#¢97j_Ak,tJJ*&vrJHTR5Q}[FPT|:*R%W-ME&\N { p[ &} K(hDsJR9·Xɲ8)'aNJvȖj2>̈`>^6` I8Gc#3WҎbcpL=23g u,%s%}Ak2 Oe;(!h^~l l4I4)n8νY ŽR a On~i}ȑxi!'p;ai`:XM|ea8$U,(#uteR5ְFؕ."\&y7(MOO6|bU XcH \هJhf!.({)j~t'b-i筿&$;vwWx`[qȇ' #qY^%/(؉ɿ[p~O7r 는נ2.bp k$(KCMJ@;p/Fjwأ3|,5W^xOzj-]u_Hq-VRtMdeЄscDM}ݑi\ YL0OLk}CjgwLw+%7mmOǏ#Q KBͬ:T5;sVYNtFKCد, E; sZK8$Q2.cnXpL&0mtVVu˺Sfb}(sظ:˅ɒlW/{ L~Z"tlW6hlWDv/_帕q1ӧUŹ;P ;rWuGTyi5db.I/q3MfX!2[!GnzSn`sOxRWzI63*lfV ~;4CnG$}2S φzőxd(|<7[Pq54].[45)jHa߃\hdLz#\fsgɘ;xKN js0aB"5sIFfxOpġK`_͛g|Մコ zpLFdngW3zeMU٩SoK l}d] ಌ*PߢQҫ4rlMVȉzG9۳1Wxk} 2 *𬂃6H :j1^s> d͈v@bRڄ3 G0Hñrs} U3*RM >fsFPX?%HjDsw"^.ԴEX+V+ݦr<[BDIdT,Sp-@ƨe#z+ i6əǗeI(oI0M 6)؏du5jK!}Ɣʮ[lkP84 83;v__fRcj:mA$ 1 Lم)a밹,+3VӺpI77GJ_#hZd1Up핺pFfڕ"\ u2Q4I<Η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<EPҀ!ĉWޣUd^)Ҏze'JquA1Uzڷxo'0}B*T ZX[ߦld jȼF $xz?__XG(Ys'^MrFu57wMبR r}Zq#w7"rTiE(N.f#lM!0qFat x ЉrJWMRh'2"~R ,=^ NV5^0a0LZ`O/J./F3iLdIikR/յL- p%q&؆K3wrJ.tӫh9}h#g(((L᪬{="gڠ.!B>Uqc4e*?mH \kдՁ/obg]^Μ%~!Pv)~+O W]bҐz9+_^.d{Pa8~E hn8Z<Ù !L72)}py_X%X?GG7bҝ&d4 #~[c7α1&PK(~HAePKȡE manifest.rdf͓n0D|e`9\_X/.%}]'*͡]fh8C;4`kg*|>y&ڸ^jj~ *!eI^eYExE%yL,Ƽ FD>} fy%N:90;:PD LچL(-&)}܂Gm-c1su_5R`""?^v}㧓 Fz{ ?VG5'PK=PKȡEConfigurations2/popupmenu/PKȡEConfigurations2/toolpanel/PKȡEConfigurations2/progressbar/PKȡEConfigurations2/statusbar/PKȡE'Configurations2/accelerator/current.xmlPKPKȡEConfigurations2/floater/PKȡEConfigurations2/images/Bitmaps/PKȡEConfigurations2/toolbar/PKȡEConfigurations2/menubar/PKȡEMETA-INF/manifest.xmlTKn fU8YT LA!o_j>U*V|{ѻ1@xϢ@2Vc^z@dC[IH6iIѡCz=1+K^:,_\+n\k %VY<r,uJ# 5Gvdʎ՘Kfwng b?qên0QcznB>{dxZ֯uso8AcL2d\#+YPKw,PKȡE^2 ''mimetypePKȡE!Sa%a%MThumbnails/thumbnail.pngPKȡE+ + %layout-cachePKȡE#5 &content.xmlPKȡE Ea) gsettings.xmlPKȡEp2meta.xmlPKȡE(~HAe 'styles.xmlPKȡE= manifest.rdfPKȡEConfigurations2/popupmenu/PKȡEConfigurations2/toolpanel/PKȡEJConfigurations2/progressbar/PKȡEConfigurations2/statusbar/PKȡE'Configurations2/accelerator/current.xmlPKȡEConfigurations2/floater/PKȡEIConfigurations2/images/Bitmaps/PKȡEConfigurations2/toolbar/PKȡEConfigurations2/menubar/PKȡEw,META-INF/manifest.xmlPKawriter2latex-1.4/source/distro/COPYING.TXT0000644000175000017500000005747711147474702017026 0ustar renerene GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS writer2latex-1.4/source/distro/zotero/0000755000175000017500000000000012603463652016613 5ustar renerenewriter2latex-1.4/source/distro/zotero/BibTeX-Writer2LaTeX.js0000644000175000017500000043715012414437217022530 0ustar renerene{ "translatorID":"47fef559-4549-4815-b68f-bdf3b3819ac5", "label": "BibTeX (Writer2LaTeX)", "creator": "Simon Kornblith, Richard Karnesky and Emiliano heyns - modified by Henrik Just", "target": "bib", "minVersion": "2.1.9", "maxVersion": "", "priority": 200, "configOptions": { "getCollections": true }, "displayOptions": { "exportCharset": "UTF-8", "exportNotes": true, "exportFileData": false, "useJournalAbbreviation": false }, "inRepository": true, "translatorType": 3, "browserSupport": "gcsv", "lastUpdated": "2014-10-01 20:00:00" } function detectImport() { var maxChars = 1048576; // 1MB var inComment = false; var block = ""; var buffer = ""; var chr = ""; var charsRead = 0; var re = /^\s*@[a-zA-Z]+[\(\{]/; while((buffer = Zotero.read(4096)) && charsRead < maxChars) { Zotero.debug("Scanning " + buffer.length + " characters for BibTeX"); charsRead += buffer.length; for (var i=0; i 1) { rec.field = line.substr(0,splitAt).trim(); rec.value = line.substr(splitAt + 1).trim(); } fields.push(rec); } return fields; } function extraFieldsToString(extra) { var str = ''; for(var i=0; i":"{\\textgreater}", "~":"{\\textasciitilde}", "^":"{\\textasciicircum}", "\\":"{\\textbackslash}", "{" : "\\{", "}" : "\\}" }; var strings = {}; var keyRe = /[a-zA-Z0-9\-]/; var keywordSplitOnSpace = true; var keywordDelimRe = '\\s*[,;]\\s*'; var keywordDelimReFlags = ''; function setKeywordSplitOnSpace( val ) { keywordSplitOnSpace = val; } function setKeywordDelimRe( val, flags ) { //expect string, but it could be RegExp if(typeof(val) != 'string') { keywordDelimRe = val.toString().slice(1, val.toString().lastIndexOf('/')); keywordDelimReFlags = val.toString().slice(val.toString().lastIndexOf('/')+1); } else { keywordDelimRe = val; keywordDelimReFlags = flags; } } function processField(item, field, value, rawValue) { if(Zotero.Utilities.trim(value) == '') return null; if(fieldMap[field]) { item[fieldMap[field]] = value; } else if(inputFieldMap[field]) { item[inputFieldMap[field]] = value; } else if(field == "journal") { if(item.publicationTitle) { item.journalAbbreviation = value; } else { item.publicationTitle = value; } } else if(field == "fjournal") { if(item.publicationTitle) { // move publicationTitle to abbreviation, since itprobably came from 'journal' item.journalAbbreviation = item.publicationTitle; } item.publicationTitle = value; } else if(field == "author" || field == "editor" || field == "translator") { // parse authors/editors/translators var names = splitUnprotected(rawValue.trim(), /\sand\s/gi); for(var i in names) { var name = names[i]; // skip empty names if (!name) continue; // Names in BibTeX can have three commas pieces = splitUnprotected(name, /\s*,\s*/g); var creator = {}; if (pieces.length > 1) { creator.firstName = pieces.pop(); creator.lastName = unescapeBibTeX(pieces.shift()); if(pieces.length) { // If anything is left, it should only be the 'Jr' part creator.firstName += ', ' + pieces.join(', '); } creator.firstName = unescapeBibTeX(creator.firstName); creator.creatorType = field; } else if(splitUnprotected(name, / +/g).length > 1){ creator = Zotero.Utilities.cleanAuthor(unescapeBibTeX(name), field, false); } else { creator = { lastName: unescapeBibTeX(name), creatorType: field, fieldMode: 1 } } item.creators.push(creator); } } else if(field == "institution" || field == "organization") { item.backupPublisher = value; } else if(field == "number"){ // fix for techreport if (item.itemType == "report") { item.reportNumber = value; } else if (item.itemType == "book" || item.itemType == "bookSection") { item.seriesNumber = value; } else if (item.itemType == "patent"){ item.patentNumber = value; } else { item.issue = value; } } else if(field == "month") { var monthIndex = months.indexOf(value.toLowerCase()); if(monthIndex != -1) { value = Zotero.Utilities.formatDate({month:monthIndex}); } else { value += " "; } if(item.date) { if(value.indexOf(item.date) != -1) { // value contains year and more item.date = value; } else { item.date = value+item.date; } } else { item.date = value; } } else if(field == "year") { if(item.date) { if(item.date.indexOf(value) == -1) { // date does not already contain year item.date += value; } } else { item.date = value; } } else if(field == "date") { //We're going to assume that "date" and the date parts don't occur together. If they do, we pick date, which should hold all. item.date = value; } else if(field == "pages") { if (item.itemType == "book" || item.itemType == "thesis" || item.itemType == "manuscript") { item.numPages = value; } else { item.pages = value.replace(/--/g, "-"); } } else if(field == "note") { item._extraFields.push({raw: value.trim()}); } else if(field == "howpublished") { if(value.length >= 7) { var str = value.substr(0, 7); if(str == "http://" || str == "https:/" || str == "mailto:") { item.url = value; } else { item._extraFields.push({field: 'Published', value: value}); } } } //accept lastchecked or urldate for access date. These should never both occur. //If they do we don't know which is better so we might as well just take the second one else if (field == "lastchecked"|| field == "urldate"){ item.accessDate = value; } else if(field == "keywords" || field == "keyword") { var re = new RegExp(keywordDelimRe, keywordDelimReFlags); if(!value.match(re) && keywordSplitOnSpace) { // keywords/tags item.tags = value.split(/\s+/); } else { item.tags = value.split(re); } } else if (field == "comment" || field == "annote" || field == "review" || field == "notes") { item.notes.push({note:Zotero.Utilities.text2html(value)}); } else if (field == "pdf" || field == "path" /*Papers2 compatibility*/) { item.attachments.push({path:value, mimeType:"application/pdf"}); } else if (field == "sentelink") { // the reference manager 'Sente' has a unique file scheme in exported BibTeX; it can occur multiple times item.attachments.push({path:value.split(",")[0], mimeType:"application/pdf"}); } else if (field == "file") { var start = 0, attachment; rawValue = rawValue.replace(/\$\\backslash\$/g, '\\') // Mendeley invention? .replace(/([^\\](?:\\\\)*)\\(.){}/g, '$1$2'); // part of Mendeley's escaping (e.g. \~{} = ~) for(var i=0; inextPossibleSplit.index) { // Must have been inside braces nextPossibleSplit = delim.exec(str); if(!nextPossibleSplit) { parts.push(str.substr(nextPartStart)); return parts; } } if(str[i] == '\\') { // Skip next character i++; continue; } if(str[i] == '{') { open++; continue; } if(str[i] == '}') { open--; if(open < 0) open = 0; // Shouldn't happen, but... continue; } if(open) continue; if(i == nextPossibleSplit.index) { parts.push(str.substring(nextPartStart, i)); i += nextPossibleSplit[0].length - 1; // We can jump past the split delim nextPartStart = i + 1; nextPossibleSplit = delim.exec(str); if(!nextPossibleSplit) { parts.push(str.substr(nextPartStart)); return parts; } } } // I don't think we should ever get here*, but just to be safe // *we should always be returning from the for loop var last = str.substr(nextPartStart).trim(); if(last) parts.push(last); return parts; } function parseFilePathRecord(record) { var start = 0, fields = []; for(var i=0; i 0) { if (result.length == 0) { result = ['']; } if (str[0] == sep) { str.shift(); result.push(''); } else { if (str[0] == '\\') { str.shift(); } result[result.length - 1] += str.shift(); } } return result; } function jabrefCollect(arr, func) { if (arr == null) { return []; } var result = []; for (var i = 0; i < arr.length; i++) { if (func(arr[i])) { result.push(arr[i]); } } return result; } function processComment() { var comment = ""; var read; var collectionPath = []; var parentCollection, collection; while(read = Zotero.read(1)) { if (read == "}") { break; } // JabRef ought to escape '}' but doesn't; embedded '}' chars will break the import just as it will on JabRef itself comment += read; } if (comment == 'jabref-meta: groupsversion:3;') { jabref.format = 3; return; } if (comment.indexOf('jabref-meta: groupstree:') == 0) { if (jabref.format != 3) { Zotero.debug("jabref: fatal: unsupported group format: " + jabref.format); return; } comment = comment.replace(/^jabref-meta: groupstree:/, '').replace(/[\r\n]/gm, '') var records = jabrefSplit(comment, ';'); while (records.length > 0) { var record = records.shift(); var keys = jabrefSplit(record, ';'); if (keys.length < 2) { continue; } var record = {id: keys.shift()}; record.data = record.id.match(/^([0-9]) ([^:]*):(.*)/); if (record.data == null) { Zotero.debug("jabref: fatal: unexpected non-match for group " + record.id); return; } record.level = parseInt(record.data[1]); record.type = record.data[2] record.name = record.data[3] record.intersection = keys.shift(); // 0 = independent, 1 = intersection, 2 = union if (isNaN(record.level)) { Zotero.debug("jabref: fatal: unexpected record level in " + record.id); return; } if (record.level == 0) { continue; } if (record.type != 'ExplicitGroup') { Zotero.debug("jabref: fatal: group type " + record.type + " is not supported"); return; } collectionPath = collectionPath.slice(0, record.level - 1).concat([record.name]); Zotero.debug("jabref: locating level " + record.level + ": " + collectionPath.join('/')); if (jabref.root.hasOwnProperty(collectionPath[0])) { collection = jabref.root[collectionPath[0]]; Zotero.debug("jabref: root " + collection.name + " found"); } else { collection = new Zotero.Collection(); collection.name = collectionPath[0]; collection.type = 'collection'; collection.children = []; jabref.root[collectionPath[0]] = collection; Zotero.debug("jabref: root " + collection.name + " created"); } parentCollection = null; for (var i = 1; i < collectionPath.length; i++) { var path = collectionPath[i]; Zotero.debug("jabref: looking for child " + path + " under " + collection.name); var child = jabrefCollect(collection.children, function(n) { return (n.name == path)}) if (child.length != 0) { child = child[0] Zotero.debug("jabref: child " + child.name + " found under " + collection.name); } else { child = new Zotero.Collection(); child.name = path; child.type = 'collection'; child.children = []; collection.children.push(child); Zotero.debug("jabref: child " + child.name + " created under " + collection.name); } parentCollection = collection; collection = child; } if (parentCollection) { parentCollection = jabrefCollect(parentCollection.children, function(n) { return (n.type == 'item') }); } if (record.intersection == '2' && parentCollection) { // union with parent collection.children = parentCollection; } while(keys.length > 0) { key = keys.shift(); if (key != '') { Zotero.debug('jabref: adding ' + key + ' to ' + collection.name); collection.children.push({type: 'item', id: key}); } } if (parentCollection && record.intersection == '1') { // intersection with parent collection.children = jabrefMap(collection.children, function(n) { parentCollection.indexOf(n) !== -1; }); } } } } function beginRecord(type, closeChar) { type = Zotero.Utilities.trimInternal(type.toLowerCase()); if(type != "string") { var zoteroType = bibtex2zoteroTypeMap[type]; if (!zoteroType) { Zotero.debug("discarded item from BibTeX; type was "+type); return; } var item = new Zotero.Item(zoteroType); item._extraFields = []; } var field = ""; // by setting dontRead to true, we can skip a read on the next iteration // of this loop. this is useful after we read past the end of a string. var dontRead = false; var value, rawValue; while(dontRead || (read = Zotero.read(1))) { dontRead = false; if(read == "=") { // equals begin a field // read whitespace var read = Zotero.read(1); while(" \n\r\t".indexOf(read) != -1) { read = Zotero.read(1); } if(keyRe.test(read)) { // read numeric data here, since we might get an end bracket // that we should care about value = ""; value += read; // character is a number while((read = Zotero.read(1)) && keyRe.test(read)) { value += read; } // don't read the next char; instead, process the character // we already read past the end of the string dontRead = true; // see if there's a defined string if(strings[value]) value = strings[value]; } else { rawValue = getFieldValue(read); value = unescapeBibTeX(rawValue); } if(item) { processField(item, field.toLowerCase(), value, rawValue); } else if(type == "string") { strings[field] = value; } field = ""; } else if(read == ",") { // commas reset if (item.itemID == null) { item.itemID = field; // itemID = citekey } field = ""; } else if(read == closeChar) { if(item) { item.extra = extraFieldsToString(item._extraFields); delete item._extraFields; if (!item.publisher && item.backupPublisher){ item.publisher=item.backupPublisher; delete item.backupPublisher; } item.complete(); } return; } else if(" \n\r\t".indexOf(read) == -1) { // skip whitespace field += read; } } } function doImport() { var read = "", text = "", recordCloseElement = false; var type = false; while(read = Zotero.read(1)) { if(read == "@") { type = ""; } else if(type !== false) { if(type == "comment") { processComment(); type = false; } else if(read == "{") { // possible open character beginRecord(type, "}"); type = false; } else if(read == "(") { // possible open character beginRecord(type, ")"); type = false; } else if(/[a-zA-Z0-9-_]/.test(read)) { type += read; } } } for (var key in jabref.root) { if (jabref.root.hasOwnProperty(key)) { jabref.root[key].complete(); } } } // some fields are, in fact, macros. If that is the case then we should not put the // data in the braces as it will cause the macros to not expand properly function writeField(field, value, isMacro) { if (!value && typeof value != "number") return; value = value + ""; // convert integers to strings Zotero.write(",\n\t" + field + " = "); if (!isMacro) Zotero.write("{"); // url field is preserved, for use with \href and \url // Other fields (DOI?) may need similar treatment if (!isMacro && !(field == "url" || field == "doi" || field == "file" || field == "lccn" )) { // I hope these are all the escape characters! value = value.replace(/[|\<\>\~\^\\\{\}]/g, mapEscape).replace(/([\#\$\%\&\_])/g, "\\$1"); //disable /** if (field == "title" || field == "type" || field == "shorttitle" || field == "booktitle" || field == "series") { if (!isTitleCase(value)) { //protect caps for everything but the first letter value = value.replace(/(.)([A-Z]+)/g, "$1{$2}"); } else { //protect all-caps vords and initials value = value.replace(/([\s.-])([A-Z]+)(?=\.)/g, "$1{$2}"); //protect initials if(value.toUpperCase() != value) value = value.replace(/(\s)([A-Z]{2,})(?=[\.,\s]|$)/g, "$1{$2}"); } } **/ // Case of words with uppercase characters in non-initial positions is preserved with braces. // we're looking at all unicode letters var protectCaps = new ZU.XRegExp("\\b\\p{Letter}+\\p{Uppercase_Letter}\\p{Letter}*", 'g') if (field != "pages") { value = ZU.XRegExp.replace(value, protectCaps, "{$0}"); } } if (Zotero.getOption("exportCharset") != "UTF-8") { value = value.replace(/[\u0080-\uFFFF]/g, mapAccent); } //convert the HTML markup allowed in Zotero for rich text to TeX; excluding doi/url/file shouldn't be necessary, but better to be safe; if (!((field == "url") || (field == "doi") || (field == "file"))) value = mapHTMLmarkup(value); Zotero.write(value); if (!isMacro) Zotero.write("}"); } function mapHTMLmarkup(characters){ //converts the HTML markup allowed in Zotero for rich text to TeX //since < and > have already been escaped, we need this rather hideous code - I couldn't see a way around it though. //italics and bold characters = characters.replace(/\{\\textless\}i\{\\textgreater\}(.+?)\{\\textless\}\/i{\\textgreater\}/g, "\\textit{$1}") .replace(/\{\\textless\}b\{\\textgreater\}(.+?)\{\\textless\}\/b{\\textgreater\}/g, "\\textbf{$1}"); //sub and superscript characters = characters.replace(/\{\\textless\}sup\{\\textgreater\}(.+?)\{\\textless\}\/sup{\\textgreater\}/g, "\$^{\\textrm{$1}}\$") .replace(/\{\\textless\}sub\{\\textgreater\}(.+?)\{\\textless\}\/sub\{\\textgreater\}/g, "\$_{\\textrm{$1}}\$"); //two variants of small caps characters = characters.replace(/\{\\textless\}span\sstyle=\"small\-caps\"\{\\textgreater\}(.+?)\{\\textless\}\/span{\\textgreater\}/g, "\\textsc{$1}") .replace(/\{\\textless\}sc\{\\textgreater\}(.+?)\{\\textless\}\/sc\{\\textgreater\}/g, "\\textsc{$1}"); return characters; } function mapTeXmarkup(tex){ //reverse of the above - converts tex mark-up into html mark-up permitted by Zotero //italics and bold tex = tex.replace(/\\textit\{([^\}]+\})/g, "$1").replace(/\\textbf\{([^\}]+\})/g, "$1"); //two versions of subscript the .* after $ is necessary because people m tex = tex.replace(/\$[^\{\$]*_\{([^\}]+\})\$/g, "$1").replace(/\$[^\{]*_\{\\textrm\{([^\}]+\}\})/g, "$1"); //two version of superscript tex = tex.replace(/\$[^\{]*\^\{([^\}]+\}\$)/g, "$1").replace(/\$[^\{]*\^\{\\textrm\{([^\}]+\}\})/g, "$1"); //small caps tex = tex.replace(/\\textsc\{([^\}]+)/g, "$1"); return tex; } //Disable the isTitleCase function until we decide what to do with it. /* const skipWords = ["but", "or", "yet", "so", "for", "and", "nor", "a", "an", "the", "at", "by", "from", "in", "into", "of", "on", "to", "with", "up", "down", "as", "while", "aboard", "about", "above", "across", "after", "against", "along", "amid", "among", "anti", "around", "as", "before", "behind", "below", "beneath", "beside", "besides", "between", "beyond", "but", "despite", "down", "during", "except", "for", "inside", "like", "near", "off", "onto", "over", "past", "per", "plus", "round", "save", "since", "than", "through", "toward", "towards", "under", "underneath", "unlike", "until", "upon", "versus", "via", "within", "without"]; function isTitleCase(string) { const wordRE = /[\s[(]([^\s,\.:?!\])]+)/g; var word; while (word = wordRE.exec(string)) { word = word[1]; if(word.search(/\d/) != -1 //ignore words with numbers (including just numbers) || skipWords.indexOf(word.toLowerCase()) != -1) { continue; } if(word.toLowerCase() == word) return false; } return true; } */ function mapEscape(character) { return alwaysMap[character]; } function mapAccent(character) { return (mappingTable[character] ? mappingTable[character] : "?"); } var filePathSpecialChars = '\\\\:;{}$'; // $ for Mendeley var encodeFilePathRE = new RegExp('[' + filePathSpecialChars + ']', 'g'); function encodeFilePathComponent(value) { return value.replace(encodeFilePathRE, "\\$&"); } function decodeFilePathComponent(value) { return value.replace(/\\([^A-Za-z0-9.])/g, "$1"); } // a little substitution function for BibTeX keys, where we don't want LaTeX // escaping, but we do want to preserve the base characters function tidyAccents(s) { var r=s.toLowerCase(); // XXX Remove conditional when we drop Zotero 2.1.x support // This is supported in Zotero 3.0 and higher if (ZU.removeDiacritics !== undefined) r = ZU.removeDiacritics(r, true); else { // We fall back on the replacement list we used previously r = r.replace(new RegExp("[ä]", 'g'),"ae"); r = r.replace(new RegExp("[ö]", 'g'),"oe"); r = r.replace(new RegExp("[ü]", 'g'),"ue"); r = r.replace(new RegExp("[àáâãå]", 'g'),"a"); r = r.replace(new RegExp("æ", 'g'),"ae"); r = r.replace(new RegExp("ç", 'g'),"c"); r = r.replace(new RegExp("[èéêë]", 'g'),"e"); r = r.replace(new RegExp("[ìíîï]", 'g'),"i"); r = r.replace(new RegExp("ñ", 'g'),"n"); r = r.replace(new RegExp("[òóôõ]", 'g'),"o"); r = r.replace(new RegExp("œ", 'g'),"oe"); r = r.replace(new RegExp("[ùúû]", 'g'),"u"); r = r.replace(new RegExp("[ýÿ]", 'g'),"y"); } return r; }; var numberRe = /^[0-9]+/; // Below is a list of words that should not appear as part of the citation key // in includes the indefinite articles of English, German, French and Spanish, as well as a small set of English prepositions whose // force is more grammatical than lexical, i.e. which are likely to strike many as 'insignificant'. // The assumption is that most who want a title word in their key would prefer the first word of significance. var citeKeyTitleBannedRe = /\b(a|an|the|some|from|on|in|to|of|do|with|der|die|das|ein|eine|einer|eines|einem|einen|un|une|la|le|l\'|el|las|los|al|uno|una|unos|unas|de|des|del|d\')(\s+|\b)/g; var citeKeyConversionsRe = /%([a-zA-Z])/; var citeKeyCleanRe = /[^a-z0-9\!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|]+/g; var citeKeyConversions = { "a":function (flags, item) { if(item.creators && item.creators[0] && item.creators[0].lastName) { return item.creators[0].lastName.toLowerCase().replace(/ /g,"_").replace(/,/g,""); } return ""; }, "t":function (flags, item) { if (item["title"]) { return item["title"].toLowerCase().replace(citeKeyTitleBannedRe, "").split(/\s+/g)[0]; } return ""; }, "y":function (flags, item) { if(item.date) { var date = Zotero.Utilities.strToDate(item.date); if(date.year && numberRe.test(date.year)) { return date.year; } } return "????"; }, // HJ: Add original key as an option "k":function (flags, item) { if (item.key) { return item.key; } return "????"; } } function buildCiteKey (item,citekeys) { var basekey = ""; var counter = 0; citeKeyFormatRemaining = citeKeyFormat; while (citeKeyConversionsRe.test(citeKeyFormatRemaining)) { if (counter > 100) { Zotero.debug("Pathological BibTeX format: " + citeKeyFormat); break; } var m = citeKeyFormatRemaining.match(citeKeyConversionsRe); if (m.index > 0) { //add data before the conversion match to basekey basekey = basekey + citeKeyFormatRemaining.substr(0, m.index); } var flags = ""; // for now var f = citeKeyConversions[m[1]]; if (typeof(f) == "function") { var value = f(flags, item); Zotero.debug("Got value " + value + " for %" + m[1]); //add conversion to basekey basekey = basekey + value; } citeKeyFormatRemaining = citeKeyFormatRemaining.substr(m.index + m.length); counter++; } if (citeKeyFormatRemaining.length > 0) { basekey = basekey + citeKeyFormatRemaining; } // for now, remove any characters not explicitly known to be allowed; // we might want to allow UTF-8 citation keys in the future, depending // on implementation support. // // no matter what, we want to make sure we exclude // " # % ' ( ) , = { } ~ and backslash // however, we want to keep the base characters basekey = tidyAccents(basekey); basekey = basekey.replace(citeKeyCleanRe, ""); var citekey = basekey; var i = 0; while(citekeys[citekey]) { i++; citekey = basekey + "-" + i; } citekeys[citekey] = true; return citekey; } function doExport() { //Zotero.write("% BibTeX export generated by Zotero "+Zotero.Utilities.getVersion()); // to make sure the BOM gets ignored Zotero.write("\n"); var first = true; var citekeys = new Object(); var item; while(item = Zotero.nextItem()) { //don't export standalone notes and attachments if(item.itemType == "note" || item.itemType == "attachment") continue; // determine type var type = zotero2bibtexTypeMap[item.itemType]; if (typeof(type) == "function") { type = type(item); } if(!type) type = "misc"; // create a unique citation key var citekey = buildCiteKey(item, citekeys); // write citation key Zotero.write((first ? "" : "\n\n") + "@"+type+"{"+citekey); first = false; for(var field in fieldMap) { if(item[fieldMap[field]]) { writeField(field, item[fieldMap[field]]); } } if(item.reportNumber || item.issue || item.seriesNumber || item.patentNumber) { writeField("number", item.reportNumber || item.issue || item.seriesNumber|| item.patentNumber); } if (item.accessDate){ var accessYMD = item.accessDate.replace(/\s*\d+:\d+:\d+/, ""); writeField("urldate", accessYMD); } if(item.publicationTitle) { if(item.itemType == "bookSection" || item.itemType == "conferencePaper") { writeField("booktitle", item.publicationTitle); } else if(Zotero.getOption("useJournalAbbreviation") && item.journalAbbreviation){ writeField("journal", item.journalAbbreviation); } else { writeField("journal", item.publicationTitle); } } if(item.publisher) { if(item.itemType == "thesis") { writeField("school", item.publisher); } else if(item.itemType =="report") { writeField("institution", item.publisher); } else { writeField("publisher", item.publisher); } } if(item.creators && item.creators.length) { // split creators into subcategories var author = ""; var editor = ""; var translator = ""; var collaborator = ""; var primaryCreatorType = Zotero.Utilities.getCreatorsForType(item.itemType)[0]; for(var i in item.creators) { var creator = item.creators[i]; var creatorString; if (creator.firstName) { var fname = creator.firstName.split(/\s*,!?\s*/); fname.push(fname.shift()); // If we have a Jr. part(s), it should precede first name creatorString = creator.lastName + ", " + fname.join(', '); } else { creatorString = creator.lastName; } creatorString = creatorString.replace(/[|\<\>\~\^\\\{\}]/g, mapEscape) .replace(/([\#\$\%\&\_])/g, "\\$1"); if (creator.fieldMode == true) { // fieldMode true, assume corporate author creatorString = "{" + creatorString + "}"; } else { creatorString = creatorString.replace(/ (and) /gi, ' {$1} '); } if (creator.creatorType == "editor" || creator.creatorType == "seriesEditor") { editor += " and "+creatorString; } else if (creator.creatorType == "translator") { translator += " and "+creatorString; } else if (creator.creatorType == primaryCreatorType) { author += " and "+creatorString; } else { collaborator += " and "+creatorString; } } if(author) { writeField("author", "{" + author.substr(5) + "}", true); } if(editor) { writeField("editor", "{" + editor.substr(5) + "}", true); } if(translator) { writeField("translator", "{" + translator.substr(5) + "}", true); } if(collaborator) { writeField("collaborator", "{" + collaborator.substr(5) + "}", true); } } if(item.date) { var date = Zotero.Utilities.strToDate(item.date); // need to use non-localized abbreviation if(typeof date.month == "number") { writeField("month", months[date.month], true); } if(date.year) { writeField("year", date.year); } } if(item.extra) { // Export identifiers var extraFields = parseExtraFields(item.extra); for(var i=0; i", // TRIANGULAR BULLET "\u2024":".", // ONE DOT LEADER "\u2025":"..", // TWO DOT LEADER "\u2026":"{\\textellipsis}", // HORIZONTAL ELLIPSIS "\u2027":"-", // HYPHENATION POINT "\u202F":" ", // NARROW NO-BREAK SPACE "\u2030":"{\\textperthousand}", // PER MILLE SIGN "\u2032":"'", // PRIME "\u2033":"'", // DOUBLE PRIME "\u2034":"'''", // TRIPLE PRIME "\u2035":"`", // REVERSED PRIME "\u2036":"``", // REVERSED DOUBLE PRIME "\u2037":"```", // REVERSED TRIPLE PRIME "\u2039":"{\\guilsinglleft}", // SINGLE LEFT-POINTING ANGLE QUOTATION MARK "\u203A":"{\\guilsinglright}", // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK "\u203C":"!!", // DOUBLE EXCLAMATION MARK "\u203E":"-", // OVERLINE "\u2043":"-", // HYPHEN BULLET "\u2044":"{\\textfractionsolidus}", // FRACTION SLASH "\u2048":"?!", // QUESTION EXCLAMATION MARK "\u2049":"!?", // EXCLAMATION QUESTION MARK "\u204A":"7", // TIRONIAN SIGN ET "\u2070":"$^{0}$", // SUPERSCRIPT ZERO "\u2074":"$^{4}$", // SUPERSCRIPT FOUR "\u2075":"$^{5}$", // SUPERSCRIPT FIVE "\u2076":"$^{6}$", // SUPERSCRIPT SIX "\u2077":"$^{7}$", // SUPERSCRIPT SEVEN "\u2078":"$^{8}$", // SUPERSCRIPT EIGHT "\u2079":"$^{9}$", // SUPERSCRIPT NINE "\u207A":"$^{+}$", // SUPERSCRIPT PLUS SIGN "\u207B":"$^{-}$", // SUPERSCRIPT MINUS "\u207C":"$^{=}$", // SUPERSCRIPT EQUALS SIGN "\u207D":"$^{(}$", // SUPERSCRIPT LEFT PARENTHESIS "\u207E":"$^{)}$", // SUPERSCRIPT RIGHT PARENTHESIS "\u207F":"$^{n}$", // SUPERSCRIPT LATIN SMALL LETTER N "\u2080":"$_{0}$", // SUBSCRIPT ZERO "\u2081":"$_{1}$", // SUBSCRIPT ONE "\u2082":"$_{2}$", // SUBSCRIPT TWO "\u2083":"$_{3}$", // SUBSCRIPT THREE "\u2084":"$_{4}$", // SUBSCRIPT FOUR "\u2085":"$_{5}$", // SUBSCRIPT FIVE "\u2086":"$_{6}$", // SUBSCRIPT SIX "\u2087":"$_{7}$", // SUBSCRIPT SEVEN "\u2088":"$_{8}$", // SUBSCRIPT EIGHT "\u2089":"$_{9}$", // SUBSCRIPT NINE "\u208A":"$_{+}$", // SUBSCRIPT PLUS SIGN "\u208B":"$_{-}$", // SUBSCRIPT MINUS "\u208C":"$_{=}$", // SUBSCRIPT EQUALS SIGN "\u208D":"$_{(}$", // SUBSCRIPT LEFT PARENTHESIS "\u208E":"$_{)}$", // SUBSCRIPT RIGHT PARENTHESIS "\u20AC":"{\\texteuro}", // EURO SIGN "\u2100":"a/c", // ACCOUNT OF "\u2101":"a/s", // ADDRESSED TO THE SUBJECT "\u2103":"{\\textcelsius}", // DEGREE CELSIUS "\u2105":"c/o", // CARE OF "\u2106":"c/u", // CADA UNA "\u2109":"F", // DEGREE FAHRENHEIT "\u2113":"l", // SCRIPT SMALL L "\u2116":"{\\textnumero}", // NUMERO SIGN "\u2117":"{\\textcircledP}", // SOUND RECORDING COPYRIGHT "\u2120":"{\\textservicemark}", // SERVICE MARK "\u2121":"TEL", // TELEPHONE SIGN "\u2122":"{\\texttrademark}", // TRADE MARK SIGN "\u2126":"{\\textohm}", // OHM SIGN "\u212A":"K", // KELVIN SIGN "\u212B":"A", // ANGSTROM SIGN "\u212E":"{\\textestimated}", // ESTIMATED SYMBOL "\u2153":" 1/3", // VULGAR FRACTION ONE THIRD "\u2154":" 2/3", // VULGAR FRACTION TWO THIRDS "\u2155":" 1/5", // VULGAR FRACTION ONE FIFTH "\u2156":" 2/5", // VULGAR FRACTION TWO FIFTHS "\u2157":" 3/5", // VULGAR FRACTION THREE FIFTHS "\u2158":" 4/5", // VULGAR FRACTION FOUR FIFTHS "\u2159":" 1/6", // VULGAR FRACTION ONE SIXTH "\u215A":" 5/6", // VULGAR FRACTION FIVE SIXTHS "\u215B":" 1/8", // VULGAR FRACTION ONE EIGHTH "\u215C":" 3/8", // VULGAR FRACTION THREE EIGHTHS "\u215D":" 5/8", // VULGAR FRACTION FIVE EIGHTHS "\u215E":" 7/8", // VULGAR FRACTION SEVEN EIGHTHS "\u215F":" 1/", // FRACTION NUMERATOR ONE "\u2160":"I", // ROMAN NUMERAL ONE "\u2161":"II", // ROMAN NUMERAL TWO "\u2162":"III", // ROMAN NUMERAL THREE "\u2163":"IV", // ROMAN NUMERAL FOUR "\u2164":"V", // ROMAN NUMERAL FIVE "\u2165":"VI", // ROMAN NUMERAL SIX "\u2166":"VII", // ROMAN NUMERAL SEVEN "\u2167":"VIII", // ROMAN NUMERAL EIGHT "\u2168":"IX", // ROMAN NUMERAL NINE "\u2169":"X", // ROMAN NUMERAL TEN "\u216A":"XI", // ROMAN NUMERAL ELEVEN "\u216B":"XII", // ROMAN NUMERAL TWELVE "\u216C":"L", // ROMAN NUMERAL FIFTY "\u216D":"C", // ROMAN NUMERAL ONE HUNDRED "\u216E":"D", // ROMAN NUMERAL FIVE HUNDRED "\u216F":"M", // ROMAN NUMERAL ONE THOUSAND "\u2170":"i", // SMALL ROMAN NUMERAL ONE "\u2171":"ii", // SMALL ROMAN NUMERAL TWO "\u2172":"iii", // SMALL ROMAN NUMERAL THREE "\u2173":"iv", // SMALL ROMAN NUMERAL FOUR "\u2174":"v", // SMALL ROMAN NUMERAL FIVE "\u2175":"vi", // SMALL ROMAN NUMERAL SIX "\u2176":"vii", // SMALL ROMAN NUMERAL SEVEN "\u2177":"viii", // SMALL ROMAN NUMERAL EIGHT "\u2178":"ix", // SMALL ROMAN NUMERAL NINE "\u2179":"x", // SMALL ROMAN NUMERAL TEN "\u217A":"xi", // SMALL ROMAN NUMERAL ELEVEN "\u217B":"xii", // SMALL ROMAN NUMERAL TWELVE "\u217C":"l", // SMALL ROMAN NUMERAL FIFTY "\u217D":"c", // SMALL ROMAN NUMERAL ONE HUNDRED "\u217E":"d", // SMALL ROMAN NUMERAL FIVE HUNDRED "\u217F":"m", // SMALL ROMAN NUMERAL ONE THOUSAND "\u2190":"{\\textleftarrow}", // LEFTWARDS ARROW "\u2191":"{\\textuparrow}", // UPWARDS ARROW "\u2192":"{\\textrightarrow}", // RIGHTWARDS ARROW "\u2193":"{\\textdownarrow}", // DOWNWARDS ARROW "\u2194":"<->", // LEFT RIGHT ARROW "\u21D0":"<=", // LEFTWARDS DOUBLE ARROW "\u21D2":"=>", // RIGHTWARDS DOUBLE ARROW "\u21D4":"<=>", // LEFT RIGHT DOUBLE ARROW "\u2212":"-", // MINUS SIGN "\u2215":"/", // DIVISION SLASH "\u2216":"\\", // SET MINUS "\u2217":"*", // ASTERISK OPERATOR "\u2218":"o", // RING OPERATOR "\u2219":".", // BULLET OPERATOR "\u221E":"$\\infty$", // INFINITY "\u2223":"|", // DIVIDES "\u2225":"||", // PARALLEL TO "\u2236":":", // RATIO "\u223C":"\\~{}", // TILDE OPERATOR "\u2260":"/=", // NOT EQUAL TO "\u2261":"=", // IDENTICAL TO "\u2264":"<=", // LESS-THAN OR EQUAL TO "\u2265":">=", // GREATER-THAN OR EQUAL TO "\u226A":"<<", // MUCH LESS-THAN "\u226B":">>", // MUCH GREATER-THAN "\u2295":"(+)", // CIRCLED PLUS "\u2296":"(-)", // CIRCLED MINUS "\u2297":"(x)", // CIRCLED TIMES "\u2298":"(/)", // CIRCLED DIVISION SLASH "\u22A2":"|-", // RIGHT TACK "\u22A3":"-|", // LEFT TACK "\u22A6":"|-", // ASSERTION "\u22A7":"|=", // MODELS "\u22A8":"|=", // TRUE "\u22A9":"||-", // FORCES "\u22C5":".", // DOT OPERATOR "\u22C6":"*", // STAR OPERATOR "\u22D5":"$\\#$", // EQUAL AND PARALLEL TO "\u22D8":"<<<", // VERY MUCH LESS-THAN "\u22D9":">>>", // VERY MUCH GREATER-THAN "\u2329":"{\\textlangle}", // LEFT-POINTING ANGLE BRACKET "\u232A":"{\\textrangle}", // RIGHT-POINTING ANGLE BRACKET "\u2400":"NUL", // SYMBOL FOR NULL "\u2401":"SOH", // SYMBOL FOR START OF HEADING "\u2402":"STX", // SYMBOL FOR START OF TEXT "\u2403":"ETX", // SYMBOL FOR END OF TEXT "\u2404":"EOT", // SYMBOL FOR END OF TRANSMISSION "\u2405":"ENQ", // SYMBOL FOR ENQUIRY "\u2406":"ACK", // SYMBOL FOR ACKNOWLEDGE "\u2407":"BEL", // SYMBOL FOR BELL "\u2408":"BS", // SYMBOL FOR BACKSPACE "\u2409":"HT", // SYMBOL FOR HORIZONTAL TABULATION "\u240A":"LF", // SYMBOL FOR LINE FEED "\u240B":"VT", // SYMBOL FOR VERTICAL TABULATION "\u240C":"FF", // SYMBOL FOR FORM FEED "\u240D":"CR", // SYMBOL FOR CARRIAGE RETURN "\u240E":"SO", // SYMBOL FOR SHIFT OUT "\u240F":"SI", // SYMBOL FOR SHIFT IN "\u2410":"DLE", // SYMBOL FOR DATA LINK ESCAPE "\u2411":"DC1", // SYMBOL FOR DEVICE CONTROL ONE "\u2412":"DC2", // SYMBOL FOR DEVICE CONTROL TWO "\u2413":"DC3", // SYMBOL FOR DEVICE CONTROL THREE "\u2414":"DC4", // SYMBOL FOR DEVICE CONTROL FOUR "\u2415":"NAK", // SYMBOL FOR NEGATIVE ACKNOWLEDGE "\u2416":"SYN", // SYMBOL FOR SYNCHRONOUS IDLE "\u2417":"ETB", // SYMBOL FOR END OF TRANSMISSION BLOCK "\u2418":"CAN", // SYMBOL FOR CANCEL "\u2419":"EM", // SYMBOL FOR END OF MEDIUM "\u241A":"SUB", // SYMBOL FOR SUBSTITUTE "\u241B":"ESC", // SYMBOL FOR ESCAPE "\u241C":"FS", // SYMBOL FOR FILE SEPARATOR "\u241D":"GS", // SYMBOL FOR GROUP SEPARATOR "\u241E":"RS", // SYMBOL FOR RECORD SEPARATOR "\u241F":"US", // SYMBOL FOR UNIT SEPARATOR "\u2420":"SP", // SYMBOL FOR SPACE "\u2421":"DEL", // SYMBOL FOR DELETE "\u2423":"{\\textvisiblespace}", // OPEN BOX "\u2424":"NL", // SYMBOL FOR NEWLINE "\u2425":"///", // SYMBOL FOR DELETE FORM TWO "\u2426":"?", // SYMBOL FOR SUBSTITUTE FORM TWO "\u2460":"(1)", // CIRCLED DIGIT ONE "\u2461":"(2)", // CIRCLED DIGIT TWO "\u2462":"(3)", // CIRCLED DIGIT THREE "\u2463":"(4)", // CIRCLED DIGIT FOUR "\u2464":"(5)", // CIRCLED DIGIT FIVE "\u2465":"(6)", // CIRCLED DIGIT SIX "\u2466":"(7)", // CIRCLED DIGIT SEVEN "\u2467":"(8)", // CIRCLED DIGIT EIGHT "\u2468":"(9)", // CIRCLED DIGIT NINE "\u2469":"(10)", // CIRCLED NUMBER TEN "\u246A":"(11)", // CIRCLED NUMBER ELEVEN "\u246B":"(12)", // CIRCLED NUMBER TWELVE "\u246C":"(13)", // CIRCLED NUMBER THIRTEEN "\u246D":"(14)", // CIRCLED NUMBER FOURTEEN "\u246E":"(15)", // CIRCLED NUMBER FIFTEEN "\u246F":"(16)", // CIRCLED NUMBER SIXTEEN "\u2470":"(17)", // CIRCLED NUMBER SEVENTEEN "\u2471":"(18)", // CIRCLED NUMBER EIGHTEEN "\u2472":"(19)", // CIRCLED NUMBER NINETEEN "\u2473":"(20)", // CIRCLED NUMBER TWENTY "\u2474":"(1)", // PARENTHESIZED DIGIT ONE "\u2475":"(2)", // PARENTHESIZED DIGIT TWO "\u2476":"(3)", // PARENTHESIZED DIGIT THREE "\u2477":"(4)", // PARENTHESIZED DIGIT FOUR "\u2478":"(5)", // PARENTHESIZED DIGIT FIVE "\u2479":"(6)", // PARENTHESIZED DIGIT SIX "\u247A":"(7)", // PARENTHESIZED DIGIT SEVEN "\u247B":"(8)", // PARENTHESIZED DIGIT EIGHT "\u247C":"(9)", // PARENTHESIZED DIGIT NINE "\u247D":"(10)", // PARENTHESIZED NUMBER TEN "\u247E":"(11)", // PARENTHESIZED NUMBER ELEVEN "\u247F":"(12)", // PARENTHESIZED NUMBER TWELVE "\u2480":"(13)", // PARENTHESIZED NUMBER THIRTEEN "\u2481":"(14)", // PARENTHESIZED NUMBER FOURTEEN "\u2482":"(15)", // PARENTHESIZED NUMBER FIFTEEN "\u2483":"(16)", // PARENTHESIZED NUMBER SIXTEEN "\u2484":"(17)", // PARENTHESIZED NUMBER SEVENTEEN "\u2485":"(18)", // PARENTHESIZED NUMBER EIGHTEEN "\u2486":"(19)", // PARENTHESIZED NUMBER NINETEEN "\u2487":"(20)", // PARENTHESIZED NUMBER TWENTY "\u2488":"1.", // DIGIT ONE FULL STOP "\u2489":"2.", // DIGIT TWO FULL STOP "\u248A":"3.", // DIGIT THREE FULL STOP "\u248B":"4.", // DIGIT FOUR FULL STOP "\u248C":"5.", // DIGIT FIVE FULL STOP "\u248D":"6.", // DIGIT SIX FULL STOP "\u248E":"7.", // DIGIT SEVEN FULL STOP "\u248F":"8.", // DIGIT EIGHT FULL STOP "\u2490":"9.", // DIGIT NINE FULL STOP "\u2491":"10.", // NUMBER TEN FULL STOP "\u2492":"11.", // NUMBER ELEVEN FULL STOP "\u2493":"12.", // NUMBER TWELVE FULL STOP "\u2494":"13.", // NUMBER THIRTEEN FULL STOP "\u2495":"14.", // NUMBER FOURTEEN FULL STOP "\u2496":"15.", // NUMBER FIFTEEN FULL STOP "\u2497":"16.", // NUMBER SIXTEEN FULL STOP "\u2498":"17.", // NUMBER SEVENTEEN FULL STOP "\u2499":"18.", // NUMBER EIGHTEEN FULL STOP "\u249A":"19.", // NUMBER NINETEEN FULL STOP "\u249B":"20.", // NUMBER TWENTY FULL STOP "\u249C":"(a)", // PARENTHESIZED LATIN SMALL LETTER A "\u249D":"(b)", // PARENTHESIZED LATIN SMALL LETTER B "\u249E":"(c)", // PARENTHESIZED LATIN SMALL LETTER C "\u249F":"(d)", // PARENTHESIZED LATIN SMALL LETTER D "\u24A0":"(e)", // PARENTHESIZED LATIN SMALL LETTER E "\u24A1":"(f)", // PARENTHESIZED LATIN SMALL LETTER F "\u24A2":"(g)", // PARENTHESIZED LATIN SMALL LETTER G "\u24A3":"(h)", // PARENTHESIZED LATIN SMALL LETTER H "\u24A4":"(i)", // PARENTHESIZED LATIN SMALL LETTER I "\u24A5":"(j)", // PARENTHESIZED LATIN SMALL LETTER J "\u24A6":"(k)", // PARENTHESIZED LATIN SMALL LETTER K "\u24A7":"(l)", // PARENTHESIZED LATIN SMALL LETTER L "\u24A8":"(m)", // PARENTHESIZED LATIN SMALL LETTER M "\u24A9":"(n)", // PARENTHESIZED LATIN SMALL LETTER N "\u24AA":"(o)", // PARENTHESIZED LATIN SMALL LETTER O "\u24AB":"(p)", // PARENTHESIZED LATIN SMALL LETTER P "\u24AC":"(q)", // PARENTHESIZED LATIN SMALL LETTER Q "\u24AD":"(r)", // PARENTHESIZED LATIN SMALL LETTER R "\u24AE":"(s)", // PARENTHESIZED LATIN SMALL LETTER S "\u24AF":"(t)", // PARENTHESIZED LATIN SMALL LETTER T "\u24B0":"(u)", // PARENTHESIZED LATIN SMALL LETTER U "\u24B1":"(v)", // PARENTHESIZED LATIN SMALL LETTER V "\u24B2":"(w)", // PARENTHESIZED LATIN SMALL LETTER W "\u24B3":"(x)", // PARENTHESIZED LATIN SMALL LETTER X "\u24B4":"(y)", // PARENTHESIZED LATIN SMALL LETTER Y "\u24B5":"(z)", // PARENTHESIZED LATIN SMALL LETTER Z "\u24B6":"(A)", // CIRCLED LATIN CAPITAL LETTER A "\u24B7":"(B)", // CIRCLED LATIN CAPITAL LETTER B "\u24B8":"(C)", // CIRCLED LATIN CAPITAL LETTER C "\u24B9":"(D)", // CIRCLED LATIN CAPITAL LETTER D "\u24BA":"(E)", // CIRCLED LATIN CAPITAL LETTER E "\u24BB":"(F)", // CIRCLED LATIN CAPITAL LETTER F "\u24BC":"(G)", // CIRCLED LATIN CAPITAL LETTER G "\u24BD":"(H)", // CIRCLED LATIN CAPITAL LETTER H "\u24BE":"(I)", // CIRCLED LATIN CAPITAL LETTER I "\u24BF":"(J)", // CIRCLED LATIN CAPITAL LETTER J "\u24C0":"(K)", // CIRCLED LATIN CAPITAL LETTER K "\u24C1":"(L)", // CIRCLED LATIN CAPITAL LETTER L "\u24C2":"(M)", // CIRCLED LATIN CAPITAL LETTER M "\u24C3":"(N)", // CIRCLED LATIN CAPITAL LETTER N "\u24C4":"(O)", // CIRCLED LATIN CAPITAL LETTER O "\u24C5":"(P)", // CIRCLED LATIN CAPITAL LETTER P "\u24C6":"(Q)", // CIRCLED LATIN CAPITAL LETTER Q "\u24C7":"(R)", // CIRCLED LATIN CAPITAL LETTER R "\u24C8":"(S)", // CIRCLED LATIN CAPITAL LETTER S "\u24C9":"(T)", // CIRCLED LATIN CAPITAL LETTER T "\u24CA":"(U)", // CIRCLED LATIN CAPITAL LETTER U "\u24CB":"(V)", // CIRCLED LATIN CAPITAL LETTER V "\u24CC":"(W)", // CIRCLED LATIN CAPITAL LETTER W "\u24CD":"(X)", // CIRCLED LATIN CAPITAL LETTER X "\u24CE":"(Y)", // CIRCLED LATIN CAPITAL LETTER Y "\u24CF":"(Z)", // CIRCLED LATIN CAPITAL LETTER Z "\u24D0":"(a)", // CIRCLED LATIN SMALL LETTER A "\u24D1":"(b)", // CIRCLED LATIN SMALL LETTER B "\u24D2":"(c)", // CIRCLED LATIN SMALL LETTER C "\u24D3":"(d)", // CIRCLED LATIN SMALL LETTER D "\u24D4":"(e)", // CIRCLED LATIN SMALL LETTER E "\u24D5":"(f)", // CIRCLED LATIN SMALL LETTER F "\u24D6":"(g)", // CIRCLED LATIN SMALL LETTER G "\u24D7":"(h)", // CIRCLED LATIN SMALL LETTER H "\u24D8":"(i)", // CIRCLED LATIN SMALL LETTER I "\u24D9":"(j)", // CIRCLED LATIN SMALL LETTER J "\u24DA":"(k)", // CIRCLED LATIN SMALL LETTER K "\u24DB":"(l)", // CIRCLED LATIN SMALL LETTER L "\u24DC":"(m)", // CIRCLED LATIN SMALL LETTER M "\u24DD":"(n)", // CIRCLED LATIN SMALL LETTER N "\u24DE":"(o)", // CIRCLED LATIN SMALL LETTER O "\u24DF":"(p)", // CIRCLED LATIN SMALL LETTER P "\u24E0":"(q)", // CIRCLED LATIN SMALL LETTER Q "\u24E1":"(r)", // CIRCLED LATIN SMALL LETTER R "\u24E2":"(s)", // CIRCLED LATIN SMALL LETTER S "\u24E3":"(t)", // CIRCLED LATIN SMALL LETTER T "\u24E4":"(u)", // CIRCLED LATIN SMALL LETTER U "\u24E5":"(v)", // CIRCLED LATIN SMALL LETTER V "\u24E6":"(w)", // CIRCLED LATIN SMALL LETTER W "\u24E7":"(x)", // CIRCLED LATIN SMALL LETTER X "\u24E8":"(y)", // CIRCLED LATIN SMALL LETTER Y "\u24E9":"(z)", // CIRCLED LATIN SMALL LETTER Z "\u24EA":"(0)", // CIRCLED DIGIT ZERO "\u2500":"-", // BOX DRAWINGS LIGHT HORIZONTAL "\u2501":"=", // BOX DRAWINGS HEAVY HORIZONTAL "\u2502":"|", // BOX DRAWINGS LIGHT VERTICAL "\u2503":"|", // BOX DRAWINGS HEAVY VERTICAL "\u2504":"-", // BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL "\u2505":"=", // BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL "\u2506":"|", // BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL "\u2507":"|", // BOX DRAWINGS HEAVY TRIPLE DASH VERTICAL "\u2508":"-", // BOX DRAWINGS LIGHT QUADRUPLE DASH HORIZONTAL "\u2509":"=", // BOX DRAWINGS HEAVY QUADRUPLE DASH HORIZONTAL "\u250A":"|", // BOX DRAWINGS LIGHT QUADRUPLE DASH VERTICAL "\u250B":"|", // BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL "\u250C":"+", // BOX DRAWINGS LIGHT DOWN AND RIGHT "\u250D":"+", // BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY "\u250E":"+", // BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT "\u250F":"+", // BOX DRAWINGS HEAVY DOWN AND RIGHT "\u2510":"+", // BOX DRAWINGS LIGHT DOWN AND LEFT "\u2511":"+", // BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY "\u2512":"+", // BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT "\u2513":"+", // BOX DRAWINGS HEAVY DOWN AND LEFT "\u2514":"+", // BOX DRAWINGS LIGHT UP AND RIGHT "\u2515":"+", // BOX DRAWINGS UP LIGHT AND RIGHT HEAVY "\u2516":"+", // BOX DRAWINGS UP HEAVY AND RIGHT LIGHT "\u2517":"+", // BOX DRAWINGS HEAVY UP AND RIGHT "\u2518":"+", // BOX DRAWINGS LIGHT UP AND LEFT "\u2519":"+", // BOX DRAWINGS UP LIGHT AND LEFT HEAVY "\u251A":"+", // BOX DRAWINGS UP HEAVY AND LEFT LIGHT "\u251B":"+", // BOX DRAWINGS HEAVY UP AND LEFT "\u251C":"+", // BOX DRAWINGS LIGHT VERTICAL AND RIGHT "\u251D":"+", // BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY "\u251E":"+", // BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT "\u251F":"+", // BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT "\u2520":"+", // BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT "\u2521":"+", // BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY "\u2522":"+", // BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY "\u2523":"+", // BOX DRAWINGS HEAVY VERTICAL AND RIGHT "\u2524":"+", // BOX DRAWINGS LIGHT VERTICAL AND LEFT "\u2525":"+", // BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY "\u2526":"+", // BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT "\u2527":"+", // BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT "\u2528":"+", // BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT "\u2529":"+", // BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY "\u252A":"+", // BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY "\u252B":"+", // BOX DRAWINGS HEAVY VERTICAL AND LEFT "\u252C":"+", // BOX DRAWINGS LIGHT DOWN AND HORIZONTAL "\u252D":"+", // BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT "\u252E":"+", // BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT "\u252F":"+", // BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY "\u2530":"+", // BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT "\u2531":"+", // BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY "\u2532":"+", // BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY "\u2533":"+", // BOX DRAWINGS HEAVY DOWN AND HORIZONTAL "\u2534":"+", // BOX DRAWINGS LIGHT UP AND HORIZONTAL "\u2535":"+", // BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT "\u2536":"+", // BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT "\u2537":"+", // BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY "\u2538":"+", // BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT "\u2539":"+", // BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY "\u253A":"+", // BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY "\u253B":"+", // BOX DRAWINGS HEAVY UP AND HORIZONTAL "\u253C":"+", // BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL "\u253D":"+", // BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT "\u253E":"+", // BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT "\u253F":"+", // BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY "\u2540":"+", // BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT "\u2541":"+", // BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT "\u2542":"+", // BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT "\u2543":"+", // BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT "\u2544":"+", // BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT "\u2545":"+", // BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT "\u2546":"+", // BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT "\u2547":"+", // BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY "\u2548":"+", // BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY "\u2549":"+", // BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY "\u254A":"+", // BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY "\u254B":"+", // BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL "\u254C":"-", // BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL "\u254D":"=", // BOX DRAWINGS HEAVY DOUBLE DASH HORIZONTAL "\u254E":"|", // BOX DRAWINGS LIGHT DOUBLE DASH VERTICAL "\u254F":"|", // BOX DRAWINGS HEAVY DOUBLE DASH VERTICAL "\u2550":"=", // BOX DRAWINGS DOUBLE HORIZONTAL "\u2551":"|", // BOX DRAWINGS DOUBLE VERTICAL "\u2552":"+", // BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE "\u2553":"+", // BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE "\u2554":"+", // BOX DRAWINGS DOUBLE DOWN AND RIGHT "\u2555":"+", // BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE "\u2556":"+", // BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE "\u2557":"+", // BOX DRAWINGS DOUBLE DOWN AND LEFT "\u2558":"+", // BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE "\u2559":"+", // BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE "\u255A":"+", // BOX DRAWINGS DOUBLE UP AND RIGHT "\u255B":"+", // BOX DRAWINGS UP SINGLE AND LEFT DOUBLE "\u255C":"+", // BOX DRAWINGS UP DOUBLE AND LEFT SINGLE "\u255D":"+", // BOX DRAWINGS DOUBLE UP AND LEFT "\u255E":"+", // BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE "\u255F":"+", // BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE "\u2560":"+", // BOX DRAWINGS DOUBLE VERTICAL AND RIGHT "\u2561":"+", // BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE "\u2562":"+", // BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE "\u2563":"+", // BOX DRAWINGS DOUBLE VERTICAL AND LEFT "\u2564":"+", // BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE "\u2565":"+", // BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE "\u2566":"+", // BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL "\u2567":"+", // BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE "\u2568":"+", // BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE "\u2569":"+", // BOX DRAWINGS DOUBLE UP AND HORIZONTAL "\u256A":"+", // BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE "\u256B":"+", // BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE "\u256C":"+", // BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL "\u256D":"+", // BOX DRAWINGS LIGHT ARC DOWN AND RIGHT "\u256E":"+", // BOX DRAWINGS LIGHT ARC DOWN AND LEFT "\u256F":"+", // BOX DRAWINGS LIGHT ARC UP AND LEFT "\u2570":"+", // BOX DRAWINGS LIGHT ARC UP AND RIGHT "\u2571":"/", // BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT "\u2572":"\\", // BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT "\u2573":"X", // BOX DRAWINGS LIGHT DIAGONAL CROSS "\u257C":"-", // BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT "\u257D":"|", // BOX DRAWINGS LIGHT UP AND HEAVY DOWN "\u257E":"-", // BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT "\u257F":"|", // BOX DRAWINGS HEAVY UP AND LIGHT DOWN "\u25CB":"o", // WHITE CIRCLE "\u25E6":"{\\textopenbullet}", // WHITE BULLET "\u2605":"*", // BLACK STAR "\u2606":"*", // WHITE STAR "\u2612":"X", // BALLOT BOX WITH X "\u2613":"X", // SALTIRE "\u2639":":-(", // WHITE FROWNING FACE "\u263A":":-)", // WHITE SMILING FACE "\u263B":"(-:", // BLACK SMILING FACE "\u266D":"b", // MUSIC FLAT SIGN "\u266F":"$\\#$", // MUSIC SHARP SIGN "\u2701":"$\\%<$", // UPPER BLADE SCISSORS "\u2702":"$\\%<$", // BLACK SCISSORS "\u2703":"$\\%<$", // LOWER BLADE SCISSORS "\u2704":"$\\%<$", // WHITE SCISSORS "\u270C":"V", // VICTORY HAND "\u2713":"v", // CHECK MARK "\u2714":"V", // HEAVY CHECK MARK "\u2715":"x", // MULTIPLICATION X "\u2716":"x", // HEAVY MULTIPLICATION X "\u2717":"X", // BALLOT X "\u2718":"X", // HEAVY BALLOT X "\u2719":"+", // OUTLINED GREEK CROSS "\u271A":"+", // HEAVY GREEK CROSS "\u271B":"+", // OPEN CENTRE CROSS "\u271C":"+", // HEAVY OPEN CENTRE CROSS "\u271D":"+", // LATIN CROSS "\u271E":"+", // SHADOWED WHITE LATIN CROSS "\u271F":"+", // OUTLINED LATIN CROSS "\u2720":"+", // MALTESE CROSS "\u2721":"*", // STAR OF DAVID "\u2722":"+", // FOUR TEARDROP-SPOKED ASTERISK "\u2723":"+", // FOUR BALLOON-SPOKED ASTERISK "\u2724":"+", // HEAVY FOUR BALLOON-SPOKED ASTERISK "\u2725":"+", // FOUR CLUB-SPOKED ASTERISK "\u2726":"+", // BLACK FOUR POINTED STAR "\u2727":"+", // WHITE FOUR POINTED STAR "\u2729":"*", // STRESS OUTLINED WHITE STAR "\u272A":"*", // CIRCLED WHITE STAR "\u272B":"*", // OPEN CENTRE BLACK STAR "\u272C":"*", // BLACK CENTRE WHITE STAR "\u272D":"*", // OUTLINED BLACK STAR "\u272E":"*", // HEAVY OUTLINED BLACK STAR "\u272F":"*", // PINWHEEL STAR "\u2730":"*", // SHADOWED WHITE STAR "\u2731":"*", // HEAVY ASTERISK "\u2732":"*", // OPEN CENTRE ASTERISK "\u2733":"*", // EIGHT SPOKED ASTERISK "\u2734":"*", // EIGHT POINTED BLACK STAR "\u2735":"*", // EIGHT POINTED PINWHEEL STAR "\u2736":"*", // SIX POINTED BLACK STAR "\u2737":"*", // EIGHT POINTED RECTILINEAR BLACK STAR "\u2738":"*", // HEAVY EIGHT POINTED RECTILINEAR BLACK STAR "\u2739":"*", // TWELVE POINTED BLACK STAR "\u273A":"*", // SIXTEEN POINTED ASTERISK "\u273B":"*", // TEARDROP-SPOKED ASTERISK "\u273C":"*", // OPEN CENTRE TEARDROP-SPOKED ASTERISK "\u273D":"*", // HEAVY TEARDROP-SPOKED ASTERISK "\u273E":"*", // SIX PETALLED BLACK AND WHITE FLORETTE "\u273F":"*", // BLACK FLORETTE "\u2740":"*", // WHITE FLORETTE "\u2741":"*", // EIGHT PETALLED OUTLINED BLACK FLORETTE "\u2742":"*", // CIRCLED OPEN CENTRE EIGHT POINTED STAR "\u2743":"*", // HEAVY TEARDROP-SPOKED PINWHEEL ASTERISK "\u2744":"*", // SNOWFLAKE "\u2745":"*", // TIGHT TRIFOLIATE SNOWFLAKE "\u2746":"*", // HEAVY CHEVRON SNOWFLAKE "\u2747":"*", // SPARKLE "\u2748":"*", // HEAVY SPARKLE "\u2749":"*", // BALLOON-SPOKED ASTERISK "\u274A":"*", // EIGHT TEARDROP-SPOKED PROPELLER ASTERISK "\u274B":"*", // HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK "\uFB00":"ff", // LATIN SMALL LIGATURE FF "\uFB01":"fi", // LATIN SMALL LIGATURE FI "\uFB02":"fl", // LATIN SMALL LIGATURE FL "\uFB03":"ffi", // LATIN SMALL LIGATURE FFI "\uFB04":"ffl", // LATIN SMALL LIGATURE FFL "\uFB05":"st", // LATIN SMALL LIGATURE LONG S T "\uFB06":"st", // LATIN SMALL LIGATURE ST /* Derived accented characters */ /* These two require the "semtrans" package to work; uncomment to enable */ /* "\u02BF":"\{\\Ayn}", // MGR Ayn "\u02BE":"\{\\Alif}", // MGR Alif/Hamza */ "\u00C0":"{\\`A}", // LATIN CAPITAL LETTER A WITH GRAVE "\u00C1":"{\\'A}", // LATIN CAPITAL LETTER A WITH ACUTE "\u00C2":"{\\^A}", // LATIN CAPITAL LETTER A WITH CIRCUMFLEX "\u00C3":"{\\~A}", // LATIN CAPITAL LETTER A WITH TILDE "\u00C4":"{\\\"A}", // LATIN CAPITAL LETTER A WITH DIAERESIS "\u00C5":"{\\r A}", // LATIN CAPITAL LETTER A WITH RING ABOVE "\u00C7":"{\\c C}", // LATIN CAPITAL LETTER C WITH CEDILLA "\u00C8":"{\\`E}", // LATIN CAPITAL LETTER E WITH GRAVE "\u00C9":"{\\'E}", // LATIN CAPITAL LETTER E WITH ACUTE "\u00CA":"{\\^E}", // LATIN CAPITAL LETTER E WITH CIRCUMFLEX "\u00CB":"{\\\"E}", // LATIN CAPITAL LETTER E WITH DIAERESIS "\u00CC":"{\\`I}", // LATIN CAPITAL LETTER I WITH GRAVE "\u00CD":"{\\'I}", // LATIN CAPITAL LETTER I WITH ACUTE "\u00CE":"{\\^I}", // LATIN CAPITAL LETTER I WITH CIRCUMFLEX "\u00CF":"{\\\"I}", // LATIN CAPITAL LETTER I WITH DIAERESIS "\u00D1":"{\\~N}", // LATIN CAPITAL LETTER N WITH TILDE "\u00D2":"{\\`O}", // LATIN CAPITAL LETTER O WITH GRAVE "\u00D3":"{\\'O}", // LATIN CAPITAL LETTER O WITH ACUTE "\u00D4":"{\\^O}", // LATIN CAPITAL LETTER O WITH CIRCUMFLEX "\u00D5":"{\\~O}", // LATIN CAPITAL LETTER O WITH TILDE "\u00D6":"{\\\"O}", // LATIN CAPITAL LETTER O WITH DIAERESIS "\u00D9":"{\\`U}", // LATIN CAPITAL LETTER U WITH GRAVE "\u00DA":"{\\'U}", // LATIN CAPITAL LETTER U WITH ACUTE "\u00DB":"{\\^U}", // LATIN CAPITAL LETTER U WITH CIRCUMFLEX "\u00DC":"{\\\"U}", // LATIN CAPITAL LETTER U WITH DIAERESIS "\u00DD":"{\\'Y}", // LATIN CAPITAL LETTER Y WITH ACUTE "\u00E0":"{\\`a}", // LATIN SMALL LETTER A WITH GRAVE "\u00E1":"{\\'a}", // LATIN SMALL LETTER A WITH ACUTE "\u00E2":"{\\^a}", // LATIN SMALL LETTER A WITH CIRCUMFLEX "\u00E3":"{\\~a}", // LATIN SMALL LETTER A WITH TILDE "\u00E4":"{\\\"a}", // LATIN SMALL LETTER A WITH DIAERESIS "\u00E5":"{\\r a}", // LATIN SMALL LETTER A WITH RING ABOVE "\u00E7":"{\\c c}", // LATIN SMALL LETTER C WITH CEDILLA "\u00E8":"{\\`e}", // LATIN SMALL LETTER E WITH GRAVE "\u00E9":"{\\'e}", // LATIN SMALL LETTER E WITH ACUTE "\u00EA":"{\\^e}", // LATIN SMALL LETTER E WITH CIRCUMFLEX "\u00EB":"{\\\"e}", // LATIN SMALL LETTER E WITH DIAERESIS "\u00EC":"{\\`i}", // LATIN SMALL LETTER I WITH GRAVE "\u00ED":"{\\'i}", // LATIN SMALL LETTER I WITH ACUTE "\u00EE":"{\\^i}", // LATIN SMALL LETTER I WITH CIRCUMFLEX "\u00EF":"{\\\"i}", // LATIN SMALL LETTER I WITH DIAERESIS "\u00F1":"{\\~n}", // LATIN SMALL LETTER N WITH TILDE "\u00F2":"{\\`o}", // LATIN SMALL LETTER O WITH GRAVE "\u00F3":"{\\'o}", // LATIN SMALL LETTER O WITH ACUTE "\u00F4":"{\\^o}", // LATIN SMALL LETTER O WITH CIRCUMFLEX "\u00F5":"{\\~o}", // LATIN SMALL LETTER O WITH TILDE "\u00F6":"{\\\"o}", // LATIN SMALL LETTER O WITH DIAERESIS "\u00F9":"{\\`u}", // LATIN SMALL LETTER U WITH GRAVE "\u00FA":"{\\'u}", // LATIN SMALL LETTER U WITH ACUTE "\u00FB":"{\\^u}", // LATIN SMALL LETTER U WITH CIRCUMFLEX "\u00FC":"{\\\"u}", // LATIN SMALL LETTER U WITH DIAERESIS "\u00FD":"{\\'y}", // LATIN SMALL LETTER Y WITH ACUTE "\u00FF":"{\\\"y}", // LATIN SMALL LETTER Y WITH DIAERESIS "\u0100":"{\\=A}", // LATIN CAPITAL LETTER A WITH MACRON "\u0101":"{\\=a}", // LATIN SMALL LETTER A WITH MACRON "\u0102":"{\\u A}", // LATIN CAPITAL LETTER A WITH BREVE "\u0103":"{\\u a}", // LATIN SMALL LETTER A WITH BREVE "\u0104":"{\\k A}", // LATIN CAPITAL LETTER A WITH OGONEK "\u0105":"{\\k a}", // LATIN SMALL LETTER A WITH OGONEK "\u0106":"{\\'C}", // LATIN CAPITAL LETTER C WITH ACUTE "\u0107":"{\\'c}", // LATIN SMALL LETTER C WITH ACUTE "\u0108":"{\\^C}", // LATIN CAPITAL LETTER C WITH CIRCUMFLEX "\u0109":"{\\^c}", // LATIN SMALL LETTER C WITH CIRCUMFLEX "\u010A":"{\\.C}", // LATIN CAPITAL LETTER C WITH DOT ABOVE "\u010B":"{\\.c}", // LATIN SMALL LETTER C WITH DOT ABOVE "\u010C":"{\\v C}", // LATIN CAPITAL LETTER C WITH CARON "\u010D":"{\\v c}", // LATIN SMALL LETTER C WITH CARON "\u010E":"{\\v D}", // LATIN CAPITAL LETTER D WITH CARON "\u010F":"{\\v d}", // LATIN SMALL LETTER D WITH CARON "\u0112":"{\\=E}", // LATIN CAPITAL LETTER E WITH MACRON "\u0113":"{\\=e}", // LATIN SMALL LETTER E WITH MACRON "\u0114":"{\\u E}", // LATIN CAPITAL LETTER E WITH BREVE "\u0115":"{\\u e}", // LATIN SMALL LETTER E WITH BREVE "\u0116":"{\\.E}", // LATIN CAPITAL LETTER E WITH DOT ABOVE "\u0117":"{\\.e}", // LATIN SMALL LETTER E WITH DOT ABOVE "\u0118":"{\\k E}", // LATIN CAPITAL LETTER E WITH OGONEK "\u0119":"{\\k e}", // LATIN SMALL LETTER E WITH OGONEK "\u011A":"{\\v E}", // LATIN CAPITAL LETTER E WITH CARON "\u011B":"{\\v e}", // LATIN SMALL LETTER E WITH CARON "\u011C":"{\\^G}", // LATIN CAPITAL LETTER G WITH CIRCUMFLEX "\u011D":"{\\^g}", // LATIN SMALL LETTER G WITH CIRCUMFLEX "\u011E":"{\\u G}", // LATIN CAPITAL LETTER G WITH BREVE "\u011F":"{\\u g}", // LATIN SMALL LETTER G WITH BREVE "\u0120":"{\\.G}", // LATIN CAPITAL LETTER G WITH DOT ABOVE "\u0121":"{\\.g}", // LATIN SMALL LETTER G WITH DOT ABOVE "\u0122":"{\\c G}", // LATIN CAPITAL LETTER G WITH CEDILLA "\u0123":"{\\c g}", // LATIN SMALL LETTER G WITH CEDILLA "\u0124":"{\\^H}", // LATIN CAPITAL LETTER H WITH CIRCUMFLEX "\u0125":"{\\^h}", // LATIN SMALL LETTER H WITH CIRCUMFLEX "\u0128":"{\\~I}", // LATIN CAPITAL LETTER I WITH TILDE "\u0129":"{\\~i}", // LATIN SMALL LETTER I WITH TILDE "\u012A":"{\\=I}", // LATIN CAPITAL LETTER I WITH MACRON "\u012B":"{\\=\\i}", // LATIN SMALL LETTER I WITH MACRON "\u012C":"{\\u I}", // LATIN CAPITAL LETTER I WITH BREVE "\u012D":"{\\u i}", // LATIN SMALL LETTER I WITH BREVE "\u012E":"{\\k I}", // LATIN CAPITAL LETTER I WITH OGONEK "\u012F":"{\\k i}", // LATIN SMALL LETTER I WITH OGONEK "\u0130":"{\\.I}", // LATIN CAPITAL LETTER I WITH DOT ABOVE "\u0134":"{\\^J}", // LATIN CAPITAL LETTER J WITH CIRCUMFLEX "\u0135":"{\\^j}", // LATIN SMALL LETTER J WITH CIRCUMFLEX "\u0136":"{\\c K}", // LATIN CAPITAL LETTER K WITH CEDILLA "\u0137":"{\\c k}", // LATIN SMALL LETTER K WITH CEDILLA "\u0139":"{\\'L}", // LATIN CAPITAL LETTER L WITH ACUTE "\u013A":"{\\'l}", // LATIN SMALL LETTER L WITH ACUTE "\u013B":"{\\c L}", // LATIN CAPITAL LETTER L WITH CEDILLA "\u013C":"{\\c l}", // LATIN SMALL LETTER L WITH CEDILLA "\u013D":"{\\v L}", // LATIN CAPITAL LETTER L WITH CARON "\u013E":"{\\v l}", // LATIN SMALL LETTER L WITH CARON "\u0141":"{\\L }", //LATIN CAPITAL LETTER L WITH STROKE "\u0142":"{\\l }", //LATIN SMALL LETTER L WITH STROKE "\u0143":"{\\'N}", // LATIN CAPITAL LETTER N WITH ACUTE "\u0144":"{\\'n}", // LATIN SMALL LETTER N WITH ACUTE "\u0145":"{\\c N}", // LATIN CAPITAL LETTER N WITH CEDILLA "\u0146":"{\\c n}", // LATIN SMALL LETTER N WITH CEDILLA "\u0147":"{\\v N}", // LATIN CAPITAL LETTER N WITH CARON "\u0148":"{\\v n}", // LATIN SMALL LETTER N WITH CARON "\u014C":"{\\=O}", // LATIN CAPITAL LETTER O WITH MACRON "\u014D":"{\\=o}", // LATIN SMALL LETTER O WITH MACRON "\u014E":"{\\u O}", // LATIN CAPITAL LETTER O WITH BREVE "\u014F":"{\\u o}", // LATIN SMALL LETTER O WITH BREVE "\u0150":"{\\H O}", // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE "\u0151":"{\\H o}", // LATIN SMALL LETTER O WITH DOUBLE ACUTE "\u0154":"{\\'R}", // LATIN CAPITAL LETTER R WITH ACUTE "\u0155":"{\\'r}", // LATIN SMALL LETTER R WITH ACUTE "\u0156":"{\\c R}", // LATIN CAPITAL LETTER R WITH CEDILLA "\u0157":"{\\c r}", // LATIN SMALL LETTER R WITH CEDILLA "\u0158":"{\\v R}", // LATIN CAPITAL LETTER R WITH CARON "\u0159":"{\\v r}", // LATIN SMALL LETTER R WITH CARON "\u015A":"{\\'S}", // LATIN CAPITAL LETTER S WITH ACUTE "\u015B":"{\\'s}", // LATIN SMALL LETTER S WITH ACUTE "\u015C":"{\\^S}", // LATIN CAPITAL LETTER S WITH CIRCUMFLEX "\u015D":"{\\^s}", // LATIN SMALL LETTER S WITH CIRCUMFLEX "\u015E":"{\\c S}", // LATIN CAPITAL LETTER S WITH CEDILLA "\u015F":"{\\c s}", // LATIN SMALL LETTER S WITH CEDILLA "\u0160":"{\\v S}", // LATIN CAPITAL LETTER S WITH CARON "\u0161":"{\\v s}", // LATIN SMALL LETTER S WITH CARON "\u0162":"{\\c T}", // LATIN CAPITAL LETTER T WITH CEDILLA "\u0163":"{\\c t}", // LATIN SMALL LETTER T WITH CEDILLA "\u0164":"{\\v T}", // LATIN CAPITAL LETTER T WITH CARON "\u0165":"{\\v t}", // LATIN SMALL LETTER T WITH CARON "\u0168":"{\\~U}", // LATIN CAPITAL LETTER U WITH TILDE "\u0169":"{\\~u}", // LATIN SMALL LETTER U WITH TILDE "\u016A":"{\\=U}", // LATIN CAPITAL LETTER U WITH MACRON "\u016B":"{\\=u}", // LATIN SMALL LETTER U WITH MACRON "\u016C":"{\\u U}", // LATIN CAPITAL LETTER U WITH BREVE "\u016D":"{\\u u}", // LATIN SMALL LETTER U WITH BREVE "\u0170":"{\\H U}", // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE "\u0171":"{\\H u}", // LATIN SMALL LETTER U WITH DOUBLE ACUTE "\u0172":"{\\k U}", // LATIN CAPITAL LETTER U WITH OGONEK "\u0173":"{\\k u}", // LATIN SMALL LETTER U WITH OGONEK "\u0174":"{\\^W}", // LATIN CAPITAL LETTER W WITH CIRCUMFLEX "\u0175":"{\\^w}", // LATIN SMALL LETTER W WITH CIRCUMFLEX "\u0176":"{\\^Y}", // LATIN CAPITAL LETTER Y WITH CIRCUMFLEX "\u0177":"{\\^y}", // LATIN SMALL LETTER Y WITH CIRCUMFLEX "\u0178":"{\\\"Y}", // LATIN CAPITAL LETTER Y WITH DIAERESIS "\u0179":"{\\'Z}", // LATIN CAPITAL LETTER Z WITH ACUTE "\u017A":"{\\'z}", // LATIN SMALL LETTER Z WITH ACUTE "\u017B":"{\\.Z}", // LATIN CAPITAL LETTER Z WITH DOT ABOVE "\u017C":"{\\.z}", // LATIN SMALL LETTER Z WITH DOT ABOVE "\u017D":"{\\v Z}", // LATIN CAPITAL LETTER Z WITH CARON "\u017E":"{\\v z}", // LATIN SMALL LETTER Z WITH CARON "\u01CD":"{\\v A}", // LATIN CAPITAL LETTER A WITH CARON "\u01CE":"{\\v a}", // LATIN SMALL LETTER A WITH CARON "\u01CF":"{\\v I}", // LATIN CAPITAL LETTER I WITH CARON "\u01D0":"{\\v i}", // LATIN SMALL LETTER I WITH CARON "\u01D1":"{\\v O}", // LATIN CAPITAL LETTER O WITH CARON "\u01D2":"{\\v o}", // LATIN SMALL LETTER O WITH CARON "\u01D3":"{\\v U}", // LATIN CAPITAL LETTER U WITH CARON "\u01D4":"{\\v u}", // LATIN SMALL LETTER U WITH CARON "\u01E6":"{\\v G}", // LATIN CAPITAL LETTER G WITH CARON "\u01E7":"{\\v g}", // LATIN SMALL LETTER G WITH CARON "\u01E8":"{\\v K}", // LATIN CAPITAL LETTER K WITH CARON "\u01E9":"{\\v k}", // LATIN SMALL LETTER K WITH CARON "\u01EA":"{\\k O}", // LATIN CAPITAL LETTER O WITH OGONEK "\u01EB":"{\\k o}", // LATIN SMALL LETTER O WITH OGONEK "\u01F0":"{\\v j}", // LATIN SMALL LETTER J WITH CARON "\u01F4":"{\\'G}", // LATIN CAPITAL LETTER G WITH ACUTE "\u01F5":"{\\'g}", // LATIN SMALL LETTER G WITH ACUTE "\u1E02":"{\\.B}", // LATIN CAPITAL LETTER B WITH DOT ABOVE "\u1E03":"{\\.b}", // LATIN SMALL LETTER B WITH DOT ABOVE "\u1E04":"{\\d B}", // LATIN CAPITAL LETTER B WITH DOT BELOW "\u1E05":"{\\d b}", // LATIN SMALL LETTER B WITH DOT BELOW "\u1E06":"{\\b B}", // LATIN CAPITAL LETTER B WITH LINE BELOW "\u1E07":"{\\b b}", // LATIN SMALL LETTER B WITH LINE BELOW "\u1E0A":"{\\.D}", // LATIN CAPITAL LETTER D WITH DOT ABOVE "\u1E0B":"{\\.d}", // LATIN SMALL LETTER D WITH DOT ABOVE "\u1E0C":"{\\d D}", // LATIN CAPITAL LETTER D WITH DOT BELOW "\u1E0D":"{\\d d}", // LATIN SMALL LETTER D WITH DOT BELOW "\u1E0E":"{\\b D}", // LATIN CAPITAL LETTER D WITH LINE BELOW "\u1E0F":"{\\b d}", // LATIN SMALL LETTER D WITH LINE BELOW "\u1E10":"{\\c D}", // LATIN CAPITAL LETTER D WITH CEDILLA "\u1E11":"{\\c d}", // LATIN SMALL LETTER D WITH CEDILLA "\u1E1E":"{\\.F}", // LATIN CAPITAL LETTER F WITH DOT ABOVE "\u1E1F":"{\\.f}", // LATIN SMALL LETTER F WITH DOT ABOVE "\u1E20":"{\\=G}", // LATIN CAPITAL LETTER G WITH MACRON "\u1E21":"{\\=g}", // LATIN SMALL LETTER G WITH MACRON "\u1E22":"{\\.H}", // LATIN CAPITAL LETTER H WITH DOT ABOVE "\u1E23":"{\\.h}", // LATIN SMALL LETTER H WITH DOT ABOVE "\u1E24":"{\\d H}", // LATIN CAPITAL LETTER H WITH DOT BELOW "\u1E25":"{\\d h}", // LATIN SMALL LETTER H WITH DOT BELOW "\u1E26":"{\\\"H}", // LATIN CAPITAL LETTER H WITH DIAERESIS "\u1E27":"{\\\"h}", // LATIN SMALL LETTER H WITH DIAERESIS "\u1E28":"{\\c H}", // LATIN CAPITAL LETTER H WITH CEDILLA "\u1E29":"{\\c h}", // LATIN SMALL LETTER H WITH CEDILLA "\u1E30":"{\\'K}", // LATIN CAPITAL LETTER K WITH ACUTE "\u1E31":"{\\'k}", // LATIN SMALL LETTER K WITH ACUTE "\u1E32":"{\\d K}", // LATIN CAPITAL LETTER K WITH DOT BELOW "\u1E33":"{\\d k}", // LATIN SMALL LETTER K WITH DOT BELOW "\u1E34":"{\\b K}", // LATIN CAPITAL LETTER K WITH LINE BELOW "\u1E35":"{\\b k}", // LATIN SMALL LETTER K WITH LINE BELOW "\u1E36":"{\\d L}", // LATIN CAPITAL LETTER L WITH DOT BELOW "\u1E37":"{\\d l}", // LATIN SMALL LETTER L WITH DOT BELOW "\u1E3A":"{\\b L}", // LATIN CAPITAL LETTER L WITH LINE BELOW "\u1E3B":"{\\b l}", // LATIN SMALL LETTER L WITH LINE BELOW "\u1E3E":"{\\'M}", // LATIN CAPITAL LETTER M WITH ACUTE "\u1E3F":"{\\'m}", // LATIN SMALL LETTER M WITH ACUTE "\u1E40":"{\\.M}", // LATIN CAPITAL LETTER M WITH DOT ABOVE "\u1E41":"{\\.m}", // LATIN SMALL LETTER M WITH DOT ABOVE "\u1E42":"{\\d M}", // LATIN CAPITAL LETTER M WITH DOT BELOW "\u1E43":"{\\d m}", // LATIN SMALL LETTER M WITH DOT BELOW "\u1E44":"{\\.N}", // LATIN CAPITAL LETTER N WITH DOT ABOVE "\u1E45":"{\\.n}", // LATIN SMALL LETTER N WITH DOT ABOVE "\u1E46":"{\\d N}", // LATIN CAPITAL LETTER N WITH DOT BELOW "\u1E47":"{\\d n}", // LATIN SMALL LETTER N WITH DOT BELOW "\u1E48":"{\\b N}", // LATIN CAPITAL LETTER N WITH LINE BELOW "\u1E49":"{\\b n}", // LATIN SMALL LETTER N WITH LINE BELOW "\u1E54":"{\\'P}", // LATIN CAPITAL LETTER P WITH ACUTE "\u1E55":"{\\'p}", // LATIN SMALL LETTER P WITH ACUTE "\u1E56":"{\\.P}", // LATIN CAPITAL LETTER P WITH DOT ABOVE "\u1E57":"{\\.p}", // LATIN SMALL LETTER P WITH DOT ABOVE "\u1E58":"{\\.R}", // LATIN CAPITAL LETTER R WITH DOT ABOVE "\u1E59":"{\\.r}", // LATIN SMALL LETTER R WITH DOT ABOVE "\u1E5A":"{\\d R}", // LATIN CAPITAL LETTER R WITH DOT BELOW "\u1E5B":"{\\d r}", // LATIN SMALL LETTER R WITH DOT BELOW "\u1E5E":"{\\b R}", // LATIN CAPITAL LETTER R WITH LINE BELOW "\u1E5F":"{\\b r}", // LATIN SMALL LETTER R WITH LINE BELOW "\u1E60":"{\\.S}", // LATIN CAPITAL LETTER S WITH DOT ABOVE "\u1E61":"{\\.s}", // LATIN SMALL LETTER S WITH DOT ABOVE "\u1E62":"{\\d S}", // LATIN CAPITAL LETTER S WITH DOT BELOW "\u1E63":"{\\d s}", // LATIN SMALL LETTER S WITH DOT BELOW "\u1E6A":"{\\.T}", // LATIN CAPITAL LETTER T WITH DOT ABOVE "\u1E6B":"{\\.t}", // LATIN SMALL LETTER T WITH DOT ABOVE "\u1E6C":"{\\d T}", // LATIN CAPITAL LETTER T WITH DOT BELOW "\u1E6D":"{\\d t}", // LATIN SMALL LETTER T WITH DOT BELOW "\u1E6E":"{\\b T}", // LATIN CAPITAL LETTER T WITH LINE BELOW "\u1E6F":"{\\b t}", // LATIN SMALL LETTER T WITH LINE BELOW "\u1E7C":"{\\~V}", // LATIN CAPITAL LETTER V WITH TILDE "\u1E7D":"{\\~v}", // LATIN SMALL LETTER V WITH TILDE "\u1E7E":"{\\d V}", // LATIN CAPITAL LETTER V WITH DOT BELOW "\u1E7F":"{\\d v}", // LATIN SMALL LETTER V WITH DOT BELOW "\u1E80":"{\\`W}", // LATIN CAPITAL LETTER W WITH GRAVE "\u1E81":"{\\`w}", // LATIN SMALL LETTER W WITH GRAVE "\u1E82":"{\\'W}", // LATIN CAPITAL LETTER W WITH ACUTE "\u1E83":"{\\'w}", // LATIN SMALL LETTER W WITH ACUTE "\u1E84":"{\\\"W}", // LATIN CAPITAL LETTER W WITH DIAERESIS "\u1E85":"{\\\"w}", // LATIN SMALL LETTER W WITH DIAERESIS "\u1E86":"{\\.W}", // LATIN CAPITAL LETTER W WITH DOT ABOVE "\u1E87":"{\\.w}", // LATIN SMALL LETTER W WITH DOT ABOVE "\u1E88":"{\\d W}", // LATIN CAPITAL LETTER W WITH DOT BELOW "\u1E89":"{\\d w}", // LATIN SMALL LETTER W WITH DOT BELOW "\u1E8A":"{\\.X}", // LATIN CAPITAL LETTER X WITH DOT ABOVE "\u1E8B":"{\\.x}", // LATIN SMALL LETTER X WITH DOT ABOVE "\u1E8C":"{\\\"X}", // LATIN CAPITAL LETTER X WITH DIAERESIS "\u1E8D":"{\\\"x}", // LATIN SMALL LETTER X WITH DIAERESIS "\u1E8E":"{\\.Y}", // LATIN CAPITAL LETTER Y WITH DOT ABOVE "\u1E8F":"{\\.y}", // LATIN SMALL LETTER Y WITH DOT ABOVE "\u1E90":"{\\^Z}", // LATIN CAPITAL LETTER Z WITH CIRCUMFLEX "\u1E91":"{\\^z}", // LATIN SMALL LETTER Z WITH CIRCUMFLEX "\u1E92":"{\\d Z}", // LATIN CAPITAL LETTER Z WITH DOT BELOW "\u1E93":"{\\d z}", // LATIN SMALL LETTER Z WITH DOT BELOW "\u1E94":"{\\b Z}", // LATIN CAPITAL LETTER Z WITH LINE BELOW "\u1E95":"{\\b z}", // LATIN SMALL LETTER Z WITH LINE BELOW "\u1E96":"{\\b h}", // LATIN SMALL LETTER H WITH LINE BELOW "\u1E97":"{\\\"t}", // LATIN SMALL LETTER T WITH DIAERESIS "\u1EA0":"{\\d A}", // LATIN CAPITAL LETTER A WITH DOT BELOW "\u1EA1":"{\\d a}", // LATIN SMALL LETTER A WITH DOT BELOW "\u1EB8":"{\\d E}", // LATIN CAPITAL LETTER E WITH DOT BELOW "\u1EB9":"{\\d e}", // LATIN SMALL LETTER E WITH DOT BELOW "\u1EBC":"{\\~E}", // LATIN CAPITAL LETTER E WITH TILDE "\u1EBD":"{\\~e}", // LATIN SMALL LETTER E WITH TILDE "\u1ECA":"{\\d I}", // LATIN CAPITAL LETTER I WITH DOT BELOW "\u1ECB":"{\\d i}", // LATIN SMALL LETTER I WITH DOT BELOW "\u1ECC":"{\\d O}", // LATIN CAPITAL LETTER O WITH DOT BELOW "\u1ECD":"{\\d o}", // LATIN SMALL LETTER O WITH DOT BELOW "\u1EE4":"{\\d U}", // LATIN CAPITAL LETTER U WITH DOT BELOW "\u1EE5":"{\\d u}", // LATIN SMALL LETTER U WITH DOT BELOW "\u1EF2":"{\\`Y}", // LATIN CAPITAL LETTER Y WITH GRAVE "\u1EF3":"{\\`y}", // LATIN SMALL LETTER Y WITH GRAVE "\u1EF4":"{\\d Y}", // LATIN CAPITAL LETTER Y WITH DOT BELOW "\u1EF5":"{\\d y}", // LATIN SMALL LETTER Y WITH DOT BELOW "\u1EF8":"{\\~Y}", // LATIN CAPITAL LETTER Y WITH TILDE "\u1EF9":"{\\~y}" // LATIN SMALL LETTER Y WITH TILDE }; /* unfortunately the mapping isn't reversible - hence this second table - sigh! */ var reversemappingTable = { "\\url" : "", // strip 'url' "\\href" : "", // strip 'href' "{\\textexclamdown}" : "\u00A1", // INVERTED EXCLAMATION MARK "{\\textcent}" : "\u00A2", // CENT SIGN "{\\textsterling}" : "\u00A3", // POUND SIGN "{\\textyen}" : "\u00A5", // YEN SIGN "{\\textbrokenbar}" : "\u00A6", // BROKEN BAR "{\\textsection}" : "\u00A7", // SECTION SIGN "{\\textasciidieresis}" : "\u00A8", // DIAERESIS "{\\textcopyright}" : "\u00A9", // COPYRIGHT SIGN "{\\textordfeminine}" : "\u00AA", // FEMININE ORDINAL INDICATOR "{\\guillemotleft}" : "\u00AB", // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK "{\\textlnot}" : "\u00AC", // NOT SIGN "{\\textregistered}" : "\u00AE", // REGISTERED SIGN "{\\textasciimacron}" : "\u00AF", // MACRON "{\\textdegree}" : "\u00B0", // DEGREE SIGN "{\\textpm}" : "\u00B1", // PLUS-MINUS SIGN "{\\texttwosuperior}" : "\u00B2", // SUPERSCRIPT TWO "{\\textthreesuperior}" : "\u00B3", // SUPERSCRIPT THREE "{\\textasciiacute}" : "\u00B4", // ACUTE ACCENT "{\\textmu}" : "\u00B5", // MICRO SIGN "{\\textparagraph}" : "\u00B6", // PILCROW SIGN "{\\textperiodcentered}" : "\u00B7", // MIDDLE DOT "{\\c\\ }" : "\u00B8", // CEDILLA "{\\textonesuperior}" : "\u00B9", // SUPERSCRIPT ONE "{\\textordmasculine}" : "\u00BA", // MASCULINE ORDINAL INDICATOR "{\\guillemotright}" : "\u00BB", // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK "{\\textonequarter}" : "\u00BC", // VULGAR FRACTION ONE QUARTER "{\\textonehalf}" : "\u00BD", // VULGAR FRACTION ONE HALF "{\\textthreequarters}" : "\u00BE", // VULGAR FRACTION THREE QUARTERS "{\\textquestiondown}" : "\u00BF", // INVERTED QUESTION MARK "{\\AE}" : "\u00C6", // LATIN CAPITAL LETTER AE "{\\DH}" : "\u00D0", // LATIN CAPITAL LETTER ETH "{\\texttimes}" : "\u00D7", // MULTIPLICATION SIGN "{\\O}" : "\u00D8", // LATIN SMALL LETTER O WITH STROKE "{\\TH}" : "\u00DE", // LATIN CAPITAL LETTER THORN "{\\ss}" : "\u00DF", // LATIN SMALL LETTER SHARP S "{\\ae}" : "\u00E6", // LATIN SMALL LETTER AE "{\\dh}" : "\u00F0", // LATIN SMALL LETTER ETH "{\\textdiv}" : "\u00F7", // DIVISION SIGN "{\\o}" : "\u00F8", // LATIN SMALL LETTER O WITH STROKE "{\\th}" : "\u00FE", // LATIN SMALL LETTER THORN "{\\i}" : "\u0131", // LATIN SMALL LETTER DOTLESS I //"'n" : "\u0149", // LATIN SMALL LETTER N PRECEDED BY APOSTROPHE "{\\NG}" : "\u014A", // LATIN CAPITAL LETTER ENG "{\\ng}" : "\u014B", // LATIN SMALL LETTER ENG "{\\OE}" : "\u0152", // LATIN CAPITAL LIGATURE OE "{\\oe}" : "\u0153", // LATIN SMALL LIGATURE OE "{\\textasciicircum}" : "\u02C6", // MODIFIER LETTER CIRCUMFLEX ACCENT // "\\~{}" : "\u02DC", // SMALL TILDE "{\\textacutedbl}" : "\u02DD", // DOUBLE ACUTE ACCENT //Greek Letters Courtesy of Spartanroc "$\\Gamma$" : "\u0393", // GREEK Gamma "$\\Delta$" : "\u0394", // GREEK Delta "$\\Theta$" : "\u0398", // GREEK Theta "$\\Lambda$" : "\u039B", // GREEK Lambda "$\\Xi$" : "\u039E", // GREEK Xi "$\\Pi$" : "\u03A0", // GREEK Pi "$\\Sigma$" : "\u03A3", // GREEK Sigma "$\\Phi$" : "\u03A6", // GREEK Phi "$\\Psi$" : "\u03A8", // GREEK Psi "$\\Omega$" : "\u03A9", // GREEK Omega "$\\alpha$" : "\u03B1", // GREEK alpha "$\\beta$" : "\u03B2", // GREEK beta "$\\gamma$" : "\u03B3", // GREEK gamma "$\\delta$" : "\u03B4", // GREEK delta "$\\varepsilon$": "\u03B5", // GREEK var-epsilon "$\\zeta$" : "\u03B6", // GREEK zeta "$\\eta$" : "\u03B7", // GREEK eta "$\\theta$" : "\u03B8", // GREEK theta "$\\iota$" : "\u03B9", // GREEK iota "$\\kappa$" : "\u03BA", // GREEK kappa "$\\lambda$" : "\u03BB", // GREEK lambda "$\\mu$" : "\u03BC", // GREEK mu "$\\nu$" : "\u03BD", // GREEK nu "$\\xi$" : "\u03BE", // GREEK xi "$\\pi$" : "\u03C0", // GREEK pi "$\\rho$" : "\u03C1", // GREEK rho "$\\varsigma$" : "\u03C2", // GREEK var-sigma "$\\sigma$" : "\u03C3", // GREEK sigma "$\\tau$" : "\u03C4", // GREEK tau "$\\upsilon$" : "\u03C5", // GREEK upsilon "$\\varphi$" : "\u03C6", // GREEK var-phi "$\\chi$" : "\u03C7", // GREEK chi "$\\psi$" : "\u03C8", // GREEK psi "$\\omega$" : "\u03C9", // GREEK omega "$\\vartheta$" : "\u03D1", // GREEK var-theta "$\\Upsilon$" : "\u03D2", // GREEK Upsilon "$\\phi$" : "\u03D5", // GREEK phi "$\\varpi$" : "\u03D6", // GREEK var-pi "$\\varrho$" : "\u03F1", // GREEK var-rho "$\\epsilon$" : "\u03F5", // GREEK epsilon //Greek letters end "{\\textendash}" : "\u2013", // EN DASH "{\\textemdash}" : "\u2014", // EM DASH "---" : "\u2014", // EM DASH "--" : "\u2013", // EN DASH "{\\textbardbl}" : "\u2016", // DOUBLE VERTICAL LINE "{\\textunderscore}" : "\u2017", // DOUBLE LOW LINE "{\\textquoteleft}" : "\u2018", // LEFT SINGLE QUOTATION MARK "{\\textquoteright}" : "\u2019", // RIGHT SINGLE QUOTATION MARK "{\\quotesinglbase}" : "\u201A", // SINGLE LOW-9 QUOTATION MARK "{\\textquotedblleft}" : "\u201C", // LEFT DOUBLE QUOTATION MARK "{\\textquotedblright}" : "\u201D", // RIGHT DOUBLE QUOTATION MARK "{\\quotedblbase}" : "\u201E", // DOUBLE LOW-9 QUOTATION MARK // "{\\quotedblbase}" : "\u201F", // DOUBLE HIGH-REVERSED-9 QUOTATION MARK "{\\textdagger}" : "\u2020", // DAGGER "{\\textdaggerdbl}" : "\u2021", // DOUBLE DAGGER "{\\textbullet}" : "\u2022", // BULLET "{\\textellipsis}" : "\u2026", // HORIZONTAL ELLIPSIS "{\\textperthousand}" : "\u2030", // PER MILLE SIGN "'''" : "\u2034", // TRIPLE PRIME "''" : "\u201D", // RIGHT DOUBLE QUOTATION MARK (could be a double prime) "``" : "\u201C", // LEFT DOUBLE QUOTATION MARK (could be a reversed double prime) "```" : "\u2037", // REVERSED TRIPLE PRIME "{\\guilsinglleft}" : "\u2039", // SINGLE LEFT-POINTING ANGLE QUOTATION MARK "{\\guilsinglright}" : "\u203A", // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK "!!" : "\u203C", // DOUBLE EXCLAMATION MARK "{\\textfractionsolidus}" : "\u2044", // FRACTION SLASH "?!" : "\u2048", // QUESTION EXCLAMATION MARK "!?" : "\u2049", // EXCLAMATION QUESTION MARK "$^{0}$" : "\u2070", // SUPERSCRIPT ZERO "$^{4}$" : "\u2074", // SUPERSCRIPT FOUR "$^{5}$" : "\u2075", // SUPERSCRIPT FIVE "$^{6}$" : "\u2076", // SUPERSCRIPT SIX "$^{7}$" : "\u2077", // SUPERSCRIPT SEVEN "$^{8}$" : "\u2078", // SUPERSCRIPT EIGHT "$^{9}$" : "\u2079", // SUPERSCRIPT NINE "$^{+}$" : "\u207A", // SUPERSCRIPT PLUS SIGN "$^{-}$" : "\u207B", // SUPERSCRIPT MINUS "$^{=}$" : "\u207C", // SUPERSCRIPT EQUALS SIGN "$^{(}$" : "\u207D", // SUPERSCRIPT LEFT PARENTHESIS "$^{)}$" : "\u207E", // SUPERSCRIPT RIGHT PARENTHESIS "$^{n}$" : "\u207F", // SUPERSCRIPT LATIN SMALL LETTER N "$_{0}$" : "\u2080", // SUBSCRIPT ZERO "$_{1}$" : "\u2081", // SUBSCRIPT ONE "$_{2}$" : "\u2082", // SUBSCRIPT TWO "$_{3}$" : "\u2083", // SUBSCRIPT THREE "$_{4}$" : "\u2084", // SUBSCRIPT FOUR "$_{5}$" : "\u2085", // SUBSCRIPT FIVE "$_{6}$" : "\u2086", // SUBSCRIPT SIX "$_{7}$" : "\u2087", // SUBSCRIPT SEVEN "$_{8}$" : "\u2088", // SUBSCRIPT EIGHT "$_{9}$" : "\u2089", // SUBSCRIPT NINE "$_{+}$" : "\u208A", // SUBSCRIPT PLUS SIGN "$_{-}$" : "\u208B", // SUBSCRIPT MINUS "$_{=}$" : "\u208C", // SUBSCRIPT EQUALS SIGN "$_{(}$" : "\u208D", // SUBSCRIPT LEFT PARENTHESIS "$_{)}$" : "\u208E", // SUBSCRIPT RIGHT PARENTHESIS "{\\texteuro}" : "\u20AC", // EURO SIGN //"a/c" : "\u2100", // ACCOUNT OF //"a/s" : "\u2101", // ADDRESSED TO THE SUBJECT "{\\textcelsius}" : "\u2103", // DEGREE CELSIUS //"c/o" : "\u2105", // CARE OF //"c/u" : "\u2106", // CADA UNA "{\\textnumero}" : "\u2116", // NUMERO SIGN "{\\textcircledP}" : "\u2117", // SOUND RECORDING COPYRIGHT "{\\textservicemark}" : "\u2120", // SERVICE MARK "{TEL}" : "\u2121", // TELEPHONE SIGN "{\\texttrademark}" : "\u2122", // TRADE MARK SIGN "{\\textohm}" : "\u2126", // OHM SIGN "{\\textestimated}" : "\u212E", // ESTIMATED SYMBOL /*" 1/3" : "\u2153", // VULGAR FRACTION ONE THIRD " 2/3" : "\u2154", // VULGAR FRACTION TWO THIRDS " 1/5" : "\u2155", // VULGAR FRACTION ONE FIFTH " 2/5" : "\u2156", // VULGAR FRACTION TWO FIFTHS " 3/5" : "\u2157", // VULGAR FRACTION THREE FIFTHS " 4/5" : "\u2158", // VULGAR FRACTION FOUR FIFTHS " 1/6" : "\u2159", // VULGAR FRACTION ONE SIXTH " 5/6" : "\u215A", // VULGAR FRACTION FIVE SIXTHS " 1/8" : "\u215B", // VULGAR FRACTION ONE EIGHTH " 3/8" : "\u215C", // VULGAR FRACTION THREE EIGHTHS " 5/8" : "\u215D", // VULGAR FRACTION FIVE EIGHTHS " 7/8" : "\u215E", // VULGAR FRACTION SEVEN EIGHTHS " 1/" : "\u215F", // FRACTION NUMERATOR ONE */ "{\\textleftarrow}" : "\u2190", // LEFTWARDS ARROW "{\\textuparrow}" : "\u2191", // UPWARDS ARROW "{\\textrightarrow}" : "\u2192", // RIGHTWARDS ARROW "{\\textdownarrow}" : "\u2193", // DOWNWARDS ARROW /*"<->" : "\u2194", // LEFT RIGHT ARROW "<=" : "\u21D0", // LEFTWARDS DOUBLE ARROW "=>" : "\u21D2", // RIGHTWARDS DOUBLE ARROW "<=>" : "\u21D4", // LEFT RIGHT DOUBLE ARROW */ "$\\infty$" : "\u221E", // INFINITY /*"||" : "\u2225", // PARALLEL TO "/=" : "\u2260", // NOT EQUAL TO "<=" : "\u2264", // LESS-THAN OR EQUAL TO ">=" : "\u2265", // GREATER-THAN OR EQUAL TO "<<" : "\u226A", // MUCH LESS-THAN ">>" : "\u226B", // MUCH GREATER-THAN "(+)" : "\u2295", // CIRCLED PLUS "(-)" : "\u2296", // CIRCLED MINUS "(x)" : "\u2297", // CIRCLED TIMES "(/)" : "\u2298", // CIRCLED DIVISION SLASH "|-" : "\u22A2", // RIGHT TACK "-|" : "\u22A3", // LEFT TACK "|-" : "\u22A6", // ASSERTION "|=" : "\u22A7", // MODELS "|=" : "\u22A8", // TRUE "||-" : "\u22A9", // FORCES */ "$\\#$" : "\u22D5", // EQUAL AND PARALLEL TO //"<<<" : "\u22D8", // VERY MUCH LESS-THAN //">>>" : "\u22D9", // VERY MUCH GREATER-THAN "{\\textlangle}" : "\u2329", // LEFT-POINTING ANGLE BRACKET "{\\textrangle}" : "\u232A", // RIGHT-POINTING ANGLE BRACKET "{\\textvisiblespace}" : "\u2423", // OPEN BOX //"///" : "\u2425", // SYMBOL FOR DELETE FORM TWO "{\\textopenbullet}" : "\u25E6", // WHITE BULLET //":-(" : "\u2639", // WHITE FROWNING FACE //":-)" : "\u263A", // WHITE SMILING FACE //"(-: " : "\u263B", // BLACK SMILING FACE // "$\\#$" : "\u266F", // MUSIC SHARP SIGN "$\\%<$" : "\u2701", // UPPER BLADE SCISSORS /* "$\\%<$" : "\u2702", // BLACK SCISSORS "$\\%<$" : "\u2703", // LOWER BLADE SCISSORS "$\\%<$" : "\u2704", // WHITE SCISSORS */ /* Derived accented characters */ "{\\`A}" : "\u00C0", // LATIN CAPITAL LETTER A WITH GRAVE "{\\'A}" : "\u00C1", // LATIN CAPITAL LETTER A WITH ACUTE "{\\^A}" : "\u00C2", // LATIN CAPITAL LETTER A WITH CIRCUMFLEX "{\\~A}" : "\u00C3", // LATIN CAPITAL LETTER A WITH TILDE "{\\\"A}" : "\u00C4", // LATIN CAPITAL LETTER A WITH DIAERESIS "{\\r A}" : "\u00C5", // LATIN CAPITAL LETTER A WITH RING ABOVE "{\\c C}" : "\u00C7", // LATIN CAPITAL LETTER C WITH CEDILLA "{\\`E}" : "\u00C8", // LATIN CAPITAL LETTER E WITH GRAVE "{\\'E}" : "\u00C9", // LATIN CAPITAL LETTER E WITH ACUTE "{\\^E}" : "\u00CA", // LATIN CAPITAL LETTER E WITH CIRCUMFLEX "{\\\"E}" : "\u00CB", // LATIN CAPITAL LETTER E WITH DIAERESIS "{\\`I}" : "\u00CC", // LATIN CAPITAL LETTER I WITH GRAVE "{\\'I}" : "\u00CD", // LATIN CAPITAL LETTER I WITH ACUTE "{\\^I}" : "\u00CE", // LATIN CAPITAL LETTER I WITH CIRCUMFLEX "{\\\"I}" : "\u00CF", // LATIN CAPITAL LETTER I WITH DIAERESIS "{\\~N}" : "\u00D1", // LATIN CAPITAL LETTER N WITH TILDE "{\\`O}" : "\u00D2", // LATIN CAPITAL LETTER O WITH GRAVE "{\\'O}" : "\u00D3", // LATIN CAPITAL LETTER O WITH ACUTE "{\\^O}" : "\u00D4", // LATIN CAPITAL LETTER O WITH CIRCUMFLEX "{\\~O}" : "\u00D5", // LATIN CAPITAL LETTER O WITH TILDE "{\\\"O}" : "\u00D6", // LATIN CAPITAL LETTER O WITH DIAERESIS "{\\`U}" : "\u00D9", // LATIN CAPITAL LETTER U WITH GRAVE "{\\'U}" : "\u00DA", // LATIN CAPITAL LETTER U WITH ACUTE "{\\^U}" : "\u00DB", // LATIN CAPITAL LETTER U WITH CIRCUMFLEX "{\\\"U}" : "\u00DC", // LATIN CAPITAL LETTER U WITH DIAERESIS "{\\'Y}" : "\u00DD", // LATIN CAPITAL LETTER Y WITH ACUTE "{\\`a}" : "\u00E0", // LATIN SMALL LETTER A WITH GRAVE "{\\'a}" : "\u00E1", // LATIN SMALL LETTER A WITH ACUTE "{\\^a}" : "\u00E2", // LATIN SMALL LETTER A WITH CIRCUMFLEX "{\\~a}" : "\u00E3", // LATIN SMALL LETTER A WITH TILDE "{\\\"a}" : "\u00E4", // LATIN SMALL LETTER A WITH DIAERESIS "{\\r a}" : "\u00E5", // LATIN SMALL LETTER A WITH RING ABOVE "{\\c c}" : "\u00E7", // LATIN SMALL LETTER C WITH CEDILLA "{\\`e}" : "\u00E8", // LATIN SMALL LETTER E WITH GRAVE "{\\'e}" : "\u00E9", // LATIN SMALL LETTER E WITH ACUTE "{\\^e}" : "\u00EA", // LATIN SMALL LETTER E WITH CIRCUMFLEX "{\\\"e}" : "\u00EB", // LATIN SMALL LETTER E WITH DIAERESIS "{\\`i}" : "\u00EC", // LATIN SMALL LETTER I WITH GRAVE "{\\'i}" : "\u00ED", // LATIN SMALL LETTER I WITH ACUTE "{\\^i}" : "\u00EE", // LATIN SMALL LETTER I WITH CIRCUMFLEX "{\\\"i}" : "\u00EF", // LATIN SMALL LETTER I WITH DIAERESIS "{\\~n}" : "\u00F1", // LATIN SMALL LETTER N WITH TILDE "{\\`o}" : "\u00F2", // LATIN SMALL LETTER O WITH GRAVE "{\\'o}" : "\u00F3", // LATIN SMALL LETTER O WITH ACUTE "{\\^o}" : "\u00F4", // LATIN SMALL LETTER O WITH CIRCUMFLEX "{\\~o}" : "\u00F5", // LATIN SMALL LETTER O WITH TILDE "{\\\"o}" : "\u00F6", // LATIN SMALL LETTER O WITH DIAERESIS "{\\`u}" : "\u00F9", // LATIN SMALL LETTER U WITH GRAVE "{\\'u}" : "\u00FA", // LATIN SMALL LETTER U WITH ACUTE "{\\^u}" : "\u00FB", // LATIN SMALL LETTER U WITH CIRCUMFLEX "{\\\"u}" : "\u00FC", // LATIN SMALL LETTER U WITH DIAERESIS "{\\'y}" : "\u00FD", // LATIN SMALL LETTER Y WITH ACUTE "{\\\"y}" : "\u00FF", // LATIN SMALL LETTER Y WITH DIAERESIS "{\\=A}" : "\u0100", // LATIN CAPITAL LETTER A WITH MACRON "{\\=a}" : "\u0101", // LATIN SMALL LETTER A WITH MACRON "{\\u A}" : "\u0102", // LATIN CAPITAL LETTER A WITH BREVE "{\\u a}" : "\u0103", // LATIN SMALL LETTER A WITH BREVE "{\\k A}" : "\u0104", // LATIN CAPITAL LETTER A WITH OGONEK "{\\k a}" : "\u0105", // LATIN SMALL LETTER A WITH OGONEK "{\\'C}" : "\u0106", // LATIN CAPITAL LETTER C WITH ACUTE "{\\'c}" : "\u0107", // LATIN SMALL LETTER C WITH ACUTE "{\\^C}" : "\u0108", // LATIN CAPITAL LETTER C WITH CIRCUMFLEX "{\\^c}" : "\u0109", // LATIN SMALL LETTER C WITH CIRCUMFLEX "{\\.C}" : "\u010A", // LATIN CAPITAL LETTER C WITH DOT ABOVE "{\\.c}" : "\u010B", // LATIN SMALL LETTER C WITH DOT ABOVE "{\\v C}" : "\u010C", // LATIN CAPITAL LETTER C WITH CARON "{\\v c}" : "\u010D", // LATIN SMALL LETTER C WITH CARON "{\\v D}" : "\u010E", // LATIN CAPITAL LETTER D WITH CARON "{\\v d}" : "\u010F", // LATIN SMALL LETTER D WITH CARON "{\\=E}" : "\u0112", // LATIN CAPITAL LETTER E WITH MACRON "{\\=e}" : "\u0113", // LATIN SMALL LETTER E WITH MACRON "{\\u E}" : "\u0114", // LATIN CAPITAL LETTER E WITH BREVE "{\\u e}" : "\u0115", // LATIN SMALL LETTER E WITH BREVE "{\\.E}" : "\u0116", // LATIN CAPITAL LETTER E WITH DOT ABOVE "{\\.e}" : "\u0117", // LATIN SMALL LETTER E WITH DOT ABOVE "{\\k E}" : "\u0118", // LATIN CAPITAL LETTER E WITH OGONEK "{\\k e}" : "\u0119", // LATIN SMALL LETTER E WITH OGONEK "{\\v E}" : "\u011A", // LATIN CAPITAL LETTER E WITH CARON "{\\v e}" : "\u011B", // LATIN SMALL LETTER E WITH CARON "{\\^G}" : "\u011C", // LATIN CAPITAL LETTER G WITH CIRCUMFLEX "{\\^g}" : "\u011D", // LATIN SMALL LETTER G WITH CIRCUMFLEX "{\\u G}" : "\u011E", // LATIN CAPITAL LETTER G WITH BREVE "{\\u g}" : "\u011F", // LATIN SMALL LETTER G WITH BREVE "{\\.G}" : "\u0120", // LATIN CAPITAL LETTER G WITH DOT ABOVE "{\\.g}" : "\u0121", // LATIN SMALL LETTER G WITH DOT ABOVE "{\\c G}" : "\u0122", // LATIN CAPITAL LETTER G WITH CEDILLA "{\\c g}" : "\u0123", // LATIN SMALL LETTER G WITH CEDILLA "{\\^H}" : "\u0124", // LATIN CAPITAL LETTER H WITH CIRCUMFLEX "{\\^h}" : "\u0125", // LATIN SMALL LETTER H WITH CIRCUMFLEX "{\\~I}" : "\u0128", // LATIN CAPITAL LETTER I WITH TILDE "{\\~i}" : "\u0129", // LATIN SMALL LETTER I WITH TILDE "{\\=I}" : "\u012A", // LATIN CAPITAL LETTER I WITH MACRON "{\\=i}" : "\u012B", // LATIN SMALL LETTER I WITH MACRON "{\\=\\i}" : "\u012B", // LATIN SMALL LETTER I WITH MACRON "{\\u I}" : "\u012C", // LATIN CAPITAL LETTER I WITH BREVE "{\\u i}" : "\u012D", // LATIN SMALL LETTER I WITH BREVE "{\\k I}" : "\u012E", // LATIN CAPITAL LETTER I WITH OGONEK "{\\k i}" : "\u012F", // LATIN SMALL LETTER I WITH OGONEK "{\\.I}" : "\u0130", // LATIN CAPITAL LETTER I WITH DOT ABOVE "{\\^J}" : "\u0134", // LATIN CAPITAL LETTER J WITH CIRCUMFLEX "{\\^j}" : "\u0135", // LATIN SMALL LETTER J WITH CIRCUMFLEX "{\\c K}" : "\u0136", // LATIN CAPITAL LETTER K WITH CEDILLA "{\\c k}" : "\u0137", // LATIN SMALL LETTER K WITH CEDILLA "{\\'L}" : "\u0139", // LATIN CAPITAL LETTER L WITH ACUTE "{\\'l}" : "\u013A", // LATIN SMALL LETTER L WITH ACUTE "{\\c L}" : "\u013B", // LATIN CAPITAL LETTER L WITH CEDILLA "{\\c l}" : "\u013C", // LATIN SMALL LETTER L WITH CEDILLA "{\\v L}" : "\u013D", // LATIN CAPITAL LETTER L WITH CARON "{\\v l}" : "\u013E", // LATIN SMALL LETTER L WITH CARON "{\\L }" : "\u0141", //LATIN CAPITAL LETTER L WITH STROKE "{\\l }" : "\u0142", //LATIN SMALL LETTER L WITH STROKE "{\\'N}" : "\u0143", // LATIN CAPITAL LETTER N WITH ACUTE "{\\'n}" : "\u0144", // LATIN SMALL LETTER N WITH ACUTE "{\\c N}" : "\u0145", // LATIN CAPITAL LETTER N WITH CEDILLA "{\\c n}" : "\u0146", // LATIN SMALL LETTER N WITH CEDILLA "{\\v N}" : "\u0147", // LATIN CAPITAL LETTER N WITH CARON "{\\v n}" : "\u0148", // LATIN SMALL LETTER N WITH CARON "{\\=O}" : "\u014C", // LATIN CAPITAL LETTER O WITH MACRON "{\\=o}" : "\u014D", // LATIN SMALL LETTER O WITH MACRON "{\\u O}" : "\u014E", // LATIN CAPITAL LETTER O WITH BREVE "{\\u o}" : "\u014F", // LATIN SMALL LETTER O WITH BREVE "{\\H O}" : "\u0150", // LATIN CAPITAL LETTER O WITH DOUBLE ACUTE "{\\H o}" : "\u0151", // LATIN SMALL LETTER O WITH DOUBLE ACUTE "{\\'R}" : "\u0154", // LATIN CAPITAL LETTER R WITH ACUTE "{\\'r}" : "\u0155", // LATIN SMALL LETTER R WITH ACUTE "{\\c R}" : "\u0156", // LATIN CAPITAL LETTER R WITH CEDILLA "{\\c r}" : "\u0157", // LATIN SMALL LETTER R WITH CEDILLA "{\\v R}" : "\u0158", // LATIN CAPITAL LETTER R WITH CARON "{\\v r}" : "\u0159", // LATIN SMALL LETTER R WITH CARON "{\\'S}" : "\u015A", // LATIN CAPITAL LETTER S WITH ACUTE "{\\'s}" : "\u015B", // LATIN SMALL LETTER S WITH ACUTE "{\\^S}" : "\u015C", // LATIN CAPITAL LETTER S WITH CIRCUMFLEX "{\\^s}" : "\u015D", // LATIN SMALL LETTER S WITH CIRCUMFLEX "{\\c S}" : "\u015E", // LATIN CAPITAL LETTER S WITH CEDILLA "{\\c s}" : "\u015F", // LATIN SMALL LETTER S WITH CEDILLA "{\\v S}" : "\u0160", // LATIN CAPITAL LETTER S WITH CARON "{\\v s}" : "\u0161", // LATIN SMALL LETTER S WITH CARON "{\\c T}" : "\u0162", // LATIN CAPITAL LETTER T WITH CEDILLA "{\\c t}" : "\u0163", // LATIN SMALL LETTER T WITH CEDILLA "{\\v T}" : "\u0164", // LATIN CAPITAL LETTER T WITH CARON "{\\v t}" : "\u0165", // LATIN SMALL LETTER T WITH CARON "{\\~U}" : "\u0168", // LATIN CAPITAL LETTER U WITH TILDE "{\\~u}" : "\u0169", // LATIN SMALL LETTER U WITH TILDE "{\\=U}" : "\u016A", // LATIN CAPITAL LETTER U WITH MACRON "{\\=u}" : "\u016B", // LATIN SMALL LETTER U WITH MACRON "{\\u U}" : "\u016C", // LATIN CAPITAL LETTER U WITH BREVE "{\\u u}" : "\u016D", // LATIN SMALL LETTER U WITH BREVE "{\\H U}" : "\u0170", // LATIN CAPITAL LETTER U WITH DOUBLE ACUTE "{\\H u}" : "\u0171", // LATIN SMALL LETTER U WITH DOUBLE ACUTE "{\\k U}" : "\u0172", // LATIN CAPITAL LETTER U WITH OGONEK "{\\k u}" : "\u0173", // LATIN SMALL LETTER U WITH OGONEK "{\\^W}" : "\u0174", // LATIN CAPITAL LETTER W WITH CIRCUMFLEX "{\\^w}" : "\u0175", // LATIN SMALL LETTER W WITH CIRCUMFLEX "{\\^Y}" : "\u0176", // LATIN CAPITAL LETTER Y WITH CIRCUMFLEX "{\\^y}" : "\u0177", // LATIN SMALL LETTER Y WITH CIRCUMFLEX "{\\\"Y}" : "\u0178", // LATIN CAPITAL LETTER Y WITH DIAERESIS "{\\'Z}" : "\u0179", // LATIN CAPITAL LETTER Z WITH ACUTE "{\\'z}" : "\u017A", // LATIN SMALL LETTER Z WITH ACUTE "{\\.Z}" : "\u017B", // LATIN CAPITAL LETTER Z WITH DOT ABOVE "{\\.z}" : "\u017C", // LATIN SMALL LETTER Z WITH DOT ABOVE "{\\v Z}" : "\u017D", // LATIN CAPITAL LETTER Z WITH CARON "{\\v z}" : "\u017E", // LATIN SMALL LETTER Z WITH CARON "{\\v A}" : "\u01CD", // LATIN CAPITAL LETTER A WITH CARON "{\\v a}" : "\u01CE", // LATIN SMALL LETTER A WITH CARON "{\\v I}" : "\u01CF", // LATIN CAPITAL LETTER I WITH CARON "{\\v i}" : "\u01D0", // LATIN SMALL LETTER I WITH CARON "{\\v O}" : "\u01D1", // LATIN CAPITAL LETTER O WITH CARON "{\\v o}" : "\u01D2", // LATIN SMALL LETTER O WITH CARON "{\\v U}" : "\u01D3", // LATIN CAPITAL LETTER U WITH CARON "{\\v u}" : "\u01D4", // LATIN SMALL LETTER U WITH CARON "{\\v G}" : "\u01E6", // LATIN CAPITAL LETTER G WITH CARON "{\\v g}" : "\u01E7", // LATIN SMALL LETTER G WITH CARON "{\\v K}" : "\u01E8", // LATIN CAPITAL LETTER K WITH CARON "{\\v k}" : "\u01E9", // LATIN SMALL LETTER K WITH CARON "{\\k O}" : "\u01EA", // LATIN CAPITAL LETTER O WITH OGONEK "{\\k o}" : "\u01EB", // LATIN SMALL LETTER O WITH OGONEK "{\\v j}" : "\u01F0", // LATIN SMALL LETTER J WITH CARON "{\\'G}" : "\u01F4", // LATIN CAPITAL LETTER G WITH ACUTE "{\\'g}" : "\u01F5", // LATIN SMALL LETTER G WITH ACUTE "{\\.B}" : "\u1E02", // LATIN CAPITAL LETTER B WITH DOT ABOVE "{\\.b}" : "\u1E03", // LATIN SMALL LETTER B WITH DOT ABOVE "{\\d B}" : "\u1E04", // LATIN CAPITAL LETTER B WITH DOT BELOW "{\\d b}" : "\u1E05", // LATIN SMALL LETTER B WITH DOT BELOW "{\\b B}" : "\u1E06", // LATIN CAPITAL LETTER B WITH LINE BELOW "{\\b b}" : "\u1E07", // LATIN SMALL LETTER B WITH LINE BELOW "{\\.D}" : "\u1E0A", // LATIN CAPITAL LETTER D WITH DOT ABOVE "{\\.d}" : "\u1E0B", // LATIN SMALL LETTER D WITH DOT ABOVE "{\\d D}" : "\u1E0C", // LATIN CAPITAL LETTER D WITH DOT BELOW "{\\d d}" : "\u1E0D", // LATIN SMALL LETTER D WITH DOT BELOW "{\\b D}" : "\u1E0E", // LATIN CAPITAL LETTER D WITH LINE BELOW "{\\b d}" : "\u1E0F", // LATIN SMALL LETTER D WITH LINE BELOW "{\\c D}" : "\u1E10", // LATIN CAPITAL LETTER D WITH CEDILLA "{\\c d}" : "\u1E11", // LATIN SMALL LETTER D WITH CEDILLA "{\\.F}" : "\u1E1E", // LATIN CAPITAL LETTER F WITH DOT ABOVE "{\\.f}" : "\u1E1F", // LATIN SMALL LETTER F WITH DOT ABOVE "{\\=G}" : "\u1E20", // LATIN CAPITAL LETTER G WITH MACRON "{\\=g}" : "\u1E21", // LATIN SMALL LETTER G WITH MACRON "{\\.H}" : "\u1E22", // LATIN CAPITAL LETTER H WITH DOT ABOVE "{\\.h}" : "\u1E23", // LATIN SMALL LETTER H WITH DOT ABOVE "{\\d H}" : "\u1E24", // LATIN CAPITAL LETTER H WITH DOT BELOW "{\\d h}" : "\u1E25", // LATIN SMALL LETTER H WITH DOT BELOW "{\\\"H}" : "\u1E26", // LATIN CAPITAL LETTER H WITH DIAERESIS "{\\\"h}" : "\u1E27", // LATIN SMALL LETTER H WITH DIAERESIS "{\\c H}" : "\u1E28", // LATIN CAPITAL LETTER H WITH CEDILLA "{\\c h}" : "\u1E29", // LATIN SMALL LETTER H WITH CEDILLA "{\\'K}" : "\u1E30", // LATIN CAPITAL LETTER K WITH ACUTE "{\\'k}" : "\u1E31", // LATIN SMALL LETTER K WITH ACUTE "{\\d K}" : "\u1E32", // LATIN CAPITAL LETTER K WITH DOT BELOW "{\\d k}" : "\u1E33", // LATIN SMALL LETTER K WITH DOT BELOW "{\\b K}" : "\u1E34", // LATIN CAPITAL LETTER K WITH LINE BELOW "{\\b k}" : "\u1E35", // LATIN SMALL LETTER K WITH LINE BELOW "{\\d L}" : "\u1E36", // LATIN CAPITAL LETTER L WITH DOT BELOW "{\\d l}" : "\u1E37", // LATIN SMALL LETTER L WITH DOT BELOW "{\\b L}" : "\u1E3A", // LATIN CAPITAL LETTER L WITH LINE BELOW "{\\b l}" : "\u1E3B", // LATIN SMALL LETTER L WITH LINE BELOW "{\\'M}" : "\u1E3E", // LATIN CAPITAL LETTER M WITH ACUTE "{\\'m}" : "\u1E3F", // LATIN SMALL LETTER M WITH ACUTE "{\\.M}" : "\u1E40", // LATIN CAPITAL LETTER M WITH DOT ABOVE "{\\.m}" : "\u1E41", // LATIN SMALL LETTER M WITH DOT ABOVE "{\\d M}" : "\u1E42", // LATIN CAPITAL LETTER M WITH DOT BELOW "{\\d m}" : "\u1E43", // LATIN SMALL LETTER M WITH DOT BELOW "{\\.N}" : "\u1E44", // LATIN CAPITAL LETTER N WITH DOT ABOVE "{\\.n}" : "\u1E45", // LATIN SMALL LETTER N WITH DOT ABOVE "{\\d N}" : "\u1E46", // LATIN CAPITAL LETTER N WITH DOT BELOW "{\\d n}" : "\u1E47", // LATIN SMALL LETTER N WITH DOT BELOW "{\\b N}" : "\u1E48", // LATIN CAPITAL LETTER N WITH LINE BELOW "{\\b n}" : "\u1E49", // LATIN SMALL LETTER N WITH LINE BELOW "{\\'P}" : "\u1E54", // LATIN CAPITAL LETTER P WITH ACUTE "{\\'p}" : "\u1E55", // LATIN SMALL LETTER P WITH ACUTE "{\\.P}" : "\u1E56", // LATIN CAPITAL LETTER P WITH DOT ABOVE "{\\.p}" : "\u1E57", // LATIN SMALL LETTER P WITH DOT ABOVE "{\\.R}" : "\u1E58", // LATIN CAPITAL LETTER R WITH DOT ABOVE "{\\.r}" : "\u1E59", // LATIN SMALL LETTER R WITH DOT ABOVE "{\\d R}" : "\u1E5A", // LATIN CAPITAL LETTER R WITH DOT BELOW "{\\d r}" : "\u1E5B", // LATIN SMALL LETTER R WITH DOT BELOW "{\\b R}" : "\u1E5E", // LATIN CAPITAL LETTER R WITH LINE BELOW "{\\b r}" : "\u1E5F", // LATIN SMALL LETTER R WITH LINE BELOW "{\\.S}" : "\u1E60", // LATIN CAPITAL LETTER S WITH DOT ABOVE "{\\.s}" : "\u1E61", // LATIN SMALL LETTER S WITH DOT ABOVE "{\\d S}" : "\u1E62", // LATIN CAPITAL LETTER S WITH DOT BELOW "{\\d s}" : "\u1E63", // LATIN SMALL LETTER S WITH DOT BELOW "{\\.T}" : "\u1E6A", // LATIN CAPITAL LETTER T WITH DOT ABOVE "{\\.t}" : "\u1E6B", // LATIN SMALL LETTER T WITH DOT ABOVE "{\\d T}" : "\u1E6C", // LATIN CAPITAL LETTER T WITH DOT BELOW "{\\d t}" : "\u1E6D", // LATIN SMALL LETTER T WITH DOT BELOW "{\\b T}" : "\u1E6E", // LATIN CAPITAL LETTER T WITH LINE BELOW "{\\b t}" : "\u1E6F", // LATIN SMALL LETTER T WITH LINE BELOW "{\\~V}" : "\u1E7C", // LATIN CAPITAL LETTER V WITH TILDE "{\\~v}" : "\u1E7D", // LATIN SMALL LETTER V WITH TILDE "{\\d V}" : "\u1E7E", // LATIN CAPITAL LETTER V WITH DOT BELOW "{\\d v}" : "\u1E7F", // LATIN SMALL LETTER V WITH DOT BELOW "{\\`W}" : "\u1E80", // LATIN CAPITAL LETTER W WITH GRAVE "{\\`w}" : "\u1E81", // LATIN SMALL LETTER W WITH GRAVE "{\\'W}" : "\u1E82", // LATIN CAPITAL LETTER W WITH ACUTE "{\\'w}" : "\u1E83", // LATIN SMALL LETTER W WITH ACUTE "{\\\"W}" : "\u1E84", // LATIN CAPITAL LETTER W WITH DIAERESIS "{\\\"w}" : "\u1E85", // LATIN SMALL LETTER W WITH DIAERESIS "{\\.W}" : "\u1E86", // LATIN CAPITAL LETTER W WITH DOT ABOVE "{\\.w}" : "\u1E87", // LATIN SMALL LETTER W WITH DOT ABOVE "{\\d W}" : "\u1E88", // LATIN CAPITAL LETTER W WITH DOT BELOW "{\\d w}" : "\u1E89", // LATIN SMALL LETTER W WITH DOT BELOW "{\\.X}" : "\u1E8A", // LATIN CAPITAL LETTER X WITH DOT ABOVE "{\\.x}" : "\u1E8B", // LATIN SMALL LETTER X WITH DOT ABOVE "{\\\"X}" : "\u1E8C", // LATIN CAPITAL LETTER X WITH DIAERESIS "{\\\"x}" : "\u1E8D", // LATIN SMALL LETTER X WITH DIAERESIS "{\\.Y}" : "\u1E8E", // LATIN CAPITAL LETTER Y WITH DOT ABOVE "{\\.y}" : "\u1E8F", // LATIN SMALL LETTER Y WITH DOT ABOVE "{\\^Z}" : "\u1E90", // LATIN CAPITAL LETTER Z WITH CIRCUMFLEX "{\\^z}" : "\u1E91", // LATIN SMALL LETTER Z WITH CIRCUMFLEX "{\\d Z}" : "\u1E92", // LATIN CAPITAL LETTER Z WITH DOT BELOW "{\\d z}" : "\u1E93", // LATIN SMALL LETTER Z WITH DOT BELOW "{\\b Z}" : "\u1E94", // LATIN CAPITAL LETTER Z WITH LINE BELOW "{\\b z}" : "\u1E95", // LATIN SMALL LETTER Z WITH LINE BELOW "{\\b h}" : "\u1E96", // LATIN SMALL LETTER H WITH LINE BELOW "{\\\"t}" : "\u1E97", // LATIN SMALL LETTER T WITH DIAERESIS "{\\d A}" : "\u1EA0", // LATIN CAPITAL LETTER A WITH DOT BELOW "{\\d a}" : "\u1EA1", // LATIN SMALL LETTER A WITH DOT BELOW "{\\d E}" : "\u1EB8", // LATIN CAPITAL LETTER E WITH DOT BELOW "{\\d e}" : "\u1EB9", // LATIN SMALL LETTER E WITH DOT BELOW "{\\~E}" : "\u1EBC", // LATIN CAPITAL LETTER E WITH TILDE "{\\~e}" : "\u1EBD", // LATIN SMALL LETTER E WITH TILDE "{\\d I}" : "\u1ECA", // LATIN CAPITAL LETTER I WITH DOT BELOW "{\\d i}" : "\u1ECB", // LATIN SMALL LETTER I WITH DOT BELOW "{\\d O}" : "\u1ECC", // LATIN CAPITAL LETTER O WITH DOT BELOW "{\\d o}" : "\u1ECD", // LATIN SMALL LETTER O WITH DOT BELOW "{\\d U}" : "\u1EE4", // LATIN CAPITAL LETTER U WITH DOT BELOW "{\\d u}" : "\u1EE5", // LATIN SMALL LETTER U WITH DOT BELOW "{\\`Y}" : "\u1EF2", // LATIN CAPITAL LETTER Y WITH GRAVE "{\\`y}" : "\u1EF3", // LATIN SMALL LETTER Y WITH GRAVE "{\\d Y}" : "\u1EF4", // LATIN CAPITAL LETTER Y WITH DOT BELOW "{\\d y}" : "\u1EF5", // LATIN SMALL LETTER Y WITH DOT BELOW "{\\~Y}" : "\u1EF8", // LATIN CAPITAL LETTER Y WITH TILDE "{\\~y}" : "\u1EF9", // LATIN SMALL LETTER Y WITH TILDE "{\\~}" : "\u223C", // TILDE OPERATOR "~" : "\u00A0" // NO-BREAK SPACE };/** BEGIN TEST CASES **/ var testCases = [ { "type": "import", "input": "@article{Adams2001,\nauthor = {Adams, Nancy K and DeSilva, Shanaka L and Self, Steven and Salas, Guido and Schubring, Steven and Permenter, Jason L and Arbesman, Kendra},\nfile = {:Users/heatherwright/Documents/Scientific Papers/Adams\\_Huaynaputina.pdf:pdf;::},\njournal = {Bulletin of Volcanology},\nkeywords = {Vulcanian eruptions,breadcrust,plinian},\npages = {493--518},\ntitle = {{The physical volcanology of the 1600 eruption of Huaynaputina, southern Peru}},\nvolume = {62},\nyear = {2001}\n}", "items": [ { "itemType": "journalArticle", "creators": [ { "firstName": "Nancy K", "lastName": "Adams", "creatorType": "author" }, { "firstName": "Shanaka L", "lastName": "DeSilva", "creatorType": "author" }, { "firstName": "Steven", "lastName": "Self", "creatorType": "author" }, { "firstName": "Guido", "lastName": "Salas", "creatorType": "author" }, { "firstName": "Steven", "lastName": "Schubring", "creatorType": "author" }, { "firstName": "Jason L", "lastName": "Permenter", "creatorType": "author" }, { "firstName": "Kendra", "lastName": "Arbesman", "creatorType": "author" } ], "notes": [], "tags": [ "Vulcanian eruptions", "breadcrust", "plinian" ], "seeAlso": [], "attachments": [ { "path": "Users/heatherwright/Documents/Scientific Papers/Adams_Huaynaputina.pdf", "mimeType": "application/pdf", "title": "Attachment" } ], "itemID": "Adams2001", "publicationTitle": "Bulletin of Volcanology", "pages": "493–518", "title": "The physical volcanology of the 1600 eruption of Huaynaputina, southern Peru", "volume": "62", "date": "2001" } ] }, { "type": "import", "input": "@Book{abramowitz+stegun,\n author = \"Milton {Abramowitz} and Irene A. {Stegun}\",\n title = \"Handbook of Mathematical Functions with\n Formulas, Graphs, and Mathematical Tables\",\n publisher = \"Dover\",\n year = 1964,\n address = \"New York\",\n edition = \"ninth Dover printing, tenth GPO printing\"\n}\n\n@Book{Torre2008,\n author = \"Joe Torre and Tom Verducci\",\n publisher = \"Doubleday\",\n title = \"The Yankee Years\",\n year = 2008,\n isbn = \"0385527403\"\n}\n", "items": [ { "itemType": "book", "creators": [ { "firstName": "Milton", "lastName": "Abramowitz", "creatorType": "author" }, { "firstName": "Irene A.", "lastName": "Stegun", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "abramowitz+stegun", "place": "New York", "edition": "ninth Dover printing, tenth GPO printing", "title": "Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables", "publisher": "Dover", "date": "1964" }, { "itemType": "book", "creators": [ { "firstName": "Joe", "lastName": "Torre", "creatorType": "author" }, { "firstName": "Tom", "lastName": "Verducci", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "Torre2008", "ISBN": "0385527403", "publisher": "Doubleday", "title": "The Yankee Years", "date": "2008" } ] }, { "type": "import", "input": "@INPROCEEDINGS {author:06,\n title = {Some publication title},\n author = {First Author and Second Author},\n crossref = {conference:06},\n pages = {330—331},\n}\n@PROCEEDINGS {conference:06,\n editor = {First Editor and Second Editor},\n title = {Proceedings of the Xth Conference on XYZ},\n booktitle = {Proceedings of the Xth Conference on XYZ},\n year = {2006},\n month = oct,\n}", "items": [ { "itemType": "conferencePaper", "creators": [ { "firstName": "First", "lastName": "Author", "creatorType": "author" }, { "firstName": "Second", "lastName": "Author", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "author:06", "title": "Some publication title", "pages": "330—331" }, { "itemType": "book", "creators": [ { "firstName": "First", "lastName": "Editor", "creatorType": "editor" }, { "firstName": "Second", "lastName": "Editor", "creatorType": "editor" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "conference:06", "title": "Proceedings of the Xth Conference on XYZ", "date": "October 2006" } ] }, { "type": "import", "input": "@Book{hicks2001,\n author = \"von Hicks, III, Michael\",\n title = \"Design of a Carbon Fiber Composite Grid Structure for the GLAST\n Spacecraft Using a Novel Manufacturing Technique\",\n publisher = \"Stanford Press\",\n year = 2001,\n address = \"Palo Alto\",\n edition = \"1st,\",\n isbn = \"0-69-697269-4\"\n}", "items": [ { "itemType": "book", "creators": [ { "firstName": "Michael, III", "lastName": "von Hicks", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "hicks2001", "place": "Palo Alto", "edition": "1st,", "ISBN": "0-69-697269-4", "title": "Design of a Carbon Fiber Composite Grid Structure for the GLAST Spacecraft Using a Novel Manufacturing Technique", "publisher": "Stanford Press", "date": "2001" } ] }, { "type": "import", "input": "@article{Oliveira_2009, title={USGS monitoring ecological impacts}, volume={107}, number={29}, journal={Oil & Gas Journal}, author={Oliveira, A}, year={2009}, pages={29}}", "items": [ { "itemType": "journalArticle", "creators": [ { "firstName": "A", "lastName": "Oliveira", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "Oliveira_2009", "issue": "29", "title": "USGS monitoring ecological impacts", "volume": "107", "publicationTitle": "Oil & Gas Journal", "date": "2009", "pages": "29" } ] }, { "type": "import", "input": "@article{test-ticket1661,\ntitle={non-braking space: ~; accented characters: {\\~n} and \\~{n}; tilde operator: \\~},\n} ", "items": [ { "itemType": "journalArticle", "creators": [], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "test-ticket1661", "title": "non-braking space: ; accented characters: ñ and ñ; tilde operator: ∼" } ] }, { "type": "import", "input": "@ARTICLE{Frit2,\n author = {Fritz, U. and Corti, C. and P\\\"{a}ckert, M.},\n title = {Test of markupconversion: Italics, bold, superscript, subscript, and small caps: Mitochondrial DNA$_{\\textrm{2}}$ sequences suggest unexpected phylogenetic position\n of Corso-Sardinian grass snakes (\\textit{Natrix cetti}) and \\textbf{do not}\n support their \\textsc{species status}, with notes on phylogeography and subspecies\n delineation of grass snakes.},\n journal = {Actes du $4^{\\textrm{ème}}$ Congrès Français d'Acoustique},\n year = {2012},\n volume = {12},\n pages = {71-80},\n doi = {10.1007/s13127-011-0069-8}\n}\n", "items": [ { "itemType": "journalArticle", "creators": [ { "firstName": "U.", "lastName": "Fritz", "creatorType": "author" }, { "firstName": "C.", "lastName": "Corti", "creatorType": "author" }, { "firstName": "M.", "lastName": "Päckert", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "Frit2", "DOI": "10.1007/s13127-011-0069-8", "title": "Test of markupconversion: Italics, bold, superscript, subscript, and small caps: Mitochondrial DNA2$ sequences suggest unexpected phylogenetic position of Corso-Sardinian grass snakes (Natrix cetti) and do not support their species status, with notes on phylogeography and subspecies delineation of grass snakes.", "publicationTitle": "Actes du ème$ Congrès Français d'Acoustique", "date": "2012", "volume": "12", "pages": "71-80" } ] }, { "type": "import", "input": "@misc{american_rights_at_work_public_2012,\n title = {Public Service Research Foundation},\n\turl = {http://www.americanrightsatwork.org/blogcategory-275/},\n\turldate = {2012-07-27},\n\tauthor = {American Rights at Work},\n\tyear = {2012},\n\thowpublished = {http://www.americanrightsatwork.org/blogcategory-275/},\n}", "items": [ { "itemType": "book", "creators": [ { "firstName": "American Rights at", "lastName": "Work", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "american_rights_at_work_public_2012", "url": "http://www.americanrightsatwork.org/blogcategory-275/", "title": "Public Service Research Foundation", "date": "2012" } ] }, { "type": "import", "input": "@article{zoteroFilePath1,\n title = {Zotero: single attachment},\n file = {Test:files/47/test2.pdf:application/pdf}\n}\n\n@article{zoteroFilePaths2,\n title = {Zotero: multiple attachments},\n file = {Test1:files/47/test2.pdf:application/pdf;Test2:files/46/test2-min.pdf:application/pdf}\n}\n\n@article{zoteroFilePaths3,\n title = {Zotero: linked attachments (old)},\n file = {Test:E:\\some\\random\\folder\\test2.pdf:application/pdf}\n}\n\n@article{zoteroFilePaths4,\n title = {Zotero: linked attachments},\n file = {Test:E\\:\\\\some\\\\random\\\\folder\\\\test2.pdf:application/pdf}\n}\n\n@article{mendeleyFilePaths1,\n title = {Mendeley: single attachment},\n url = {https://forums.zotero.org/discussion/28347/unable-to-get-pdfs-stored-on-computer-into-zotero-standalone/},\n file = {:C$\\backslash$:/Users/somewhere/AppData/Local/Mendeley Ltd./Mendeley Desktop/Downloaded/test.pdf:pdf}\n}\n\n@article{mendeleyFilePaths2,\ntitle = {Mendeley: escaped characters}\nfile = {:C$\\backslash$:/some/path/,.$\\backslash$;'[]\\{\\}`-=\\~{}!@\\#\\$\\%\\^{}\\&()\\_+.pdf:pdf},\n}\n\n@article{citaviFilePaths1,\n title = {Citavi: single attachment},\n url = {https://forums.zotero.org/discussion/35909/bibtex-import-from-citavi-including-pdf-attachments/},\n file = {Test:Q\\:\\\\some\\\\random\\\\folder\\\\test.pdf:pdf}\n}", "items": [ { "itemType": "journalArticle", "creators": [], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "Test", "path": "files/47/test2.pdf", "mimeType": "application/pdf" } ], "itemID": "zoteroFilePath1", "title": "Zotero: single attachment" }, { "itemType": "journalArticle", "creators": [], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "Test1", "path": "files/47/test2.pdf", "mimeType": "application/pdf" }, { "title": "Test2", "path": "files/46/test2-min.pdf", "mimeType": "application/pdf" } ], "itemID": "zoteroFilePaths2", "title": "Zotero: multiple attachments" }, { "itemType": "journalArticle", "creators": [], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "zoteroFilePaths3", "title": "Zotero: linked attachments (old)" }, { "itemType": "journalArticle", "creators": [], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "Test", "path": "E:\\some\\random\\folder\\test2.pdf", "mimeType": "application/pdf" } ], "itemID": "zoteroFilePaths4", "title": "Zotero: linked attachments" }, { "itemType": "journalArticle", "creators": [], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "Attachment", "path": "C:/Users/somewhere/AppData/Local/Mendeley Ltd./Mendeley Desktop/Downloaded/test.pdf", "mimeType": "application/pdf" } ], "itemID": "mendeleyFilePaths1", "url": "https://forums.zotero.org/discussion/28347/unable-to-get-pdfs-stored-on-computer-into-zotero-standalone/", "title": "Mendeley: single attachment" }, { "itemType": "journalArticle", "creators": [], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "Attachment", "path": "C:/some/path/,.;'[]{}`-=~!@#$%^&()_+.pdf", "mimeType": "application/pdf" } ], "itemID": "mendeleyFilePaths2", "title": "Mendeley: escaped characters" }, { "itemType": "journalArticle", "creators": [], "notes": [], "tags": [], "seeAlso": [], "attachments": [ { "title": "Test", "path": "Q:\\some\\random\\folder\\test.pdf", "mimeType": "application/pdf" } ], "itemID": "citaviFilePaths1", "url": "https://forums.zotero.org/discussion/35909/bibtex-import-from-citavi-including-pdf-attachments/", "title": "Citavi: single attachment" } ] }, { "type": "import", "input": "@article{BibTeXEscapeTest1,\n title = {\textbackslash\textbackslash\\{\\}: \\\\{}}\n}", "items": [ { "itemType": "journalArticle", "creators": [], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "BibTeXEscapeTest1", "title": "extbackslash extbackslash{}: {" } ] }, { "type": "import", "input": "@article{sasson_increasing_2013,\n title = {Increasing cardiopulmonary resuscitation provision in communities with low bystander cardiopulmonary resuscitation rates: a science advisory from the American Heart Association for healthcare providers, policymakers, public health departments, and community leaders},\n\tvolume = {127},\n\tissn = {1524-4539},\n\tshorttitle = {Increasing cardiopulmonary resuscitation provision in communities with low bystander cardiopulmonary resuscitation rates},\n\tdoi = {10.1161/CIR.0b013e318288b4dd},\n\tlanguage = {eng},\n\tnumber = {12},\n\tjournal = {Circulation},\n\tauthor = {Sasson, Comilla and Meischke, Hendrika and Abella, Benjamin S and Berg, Robert A and Bobrow, Bentley J and Chan, Paul S and Root, Elisabeth Dowling and Heisler, Michele and Levy, Jerrold H and Link, Mark and Masoudi, Frederick and Ong, Marcus and Sayre, Michael R and Rumsfeld, John S and Rea, Thomas D and {American Heart Association Council on Quality of Care and Outcomes Research} and {Emergency Cardiovascular Care Committee} and {Council on Cardiopulmonary, Critical Care, Perioperative and Resuscitation} and {Council on Clinical Cardiology} and {Council on Cardiovascular Surgery and Anesthesia}},\n\tmonth = mar,\n\tyear = {2013},\n\tnote = {{PMID:} 23439512},\n\tkeywords = {Administrative Personnel, American Heart Association, Cardiopulmonary Resuscitation, Community Health Services, Health Personnel, Heart Arrest, Humans, Leadership, Public Health, United States},\n\tpages = {1342--1350}\n}", "items": [ { "itemType": "journalArticle", "creators": [ { "firstName": "Comilla", "lastName": "Sasson", "creatorType": "author" }, { "firstName": "Hendrika", "lastName": "Meischke", "creatorType": "author" }, { "firstName": "Benjamin S", "lastName": "Abella", "creatorType": "author" }, { "firstName": "Robert A", "lastName": "Berg", "creatorType": "author" }, { "firstName": "Bentley J", "lastName": "Bobrow", "creatorType": "author" }, { "firstName": "Paul S", "lastName": "Chan", "creatorType": "author" }, { "firstName": "Elisabeth Dowling", "lastName": "Root", "creatorType": "author" }, { "firstName": "Michele", "lastName": "Heisler", "creatorType": "author" }, { "firstName": "Jerrold H", "lastName": "Levy", "creatorType": "author" }, { "firstName": "Mark", "lastName": "Link", "creatorType": "author" }, { "firstName": "Frederick", "lastName": "Masoudi", "creatorType": "author" }, { "firstName": "Marcus", "lastName": "Ong", "creatorType": "author" }, { "firstName": "Michael R", "lastName": "Sayre", "creatorType": "author" }, { "firstName": "John S", "lastName": "Rumsfeld", "creatorType": "author" }, { "firstName": "Thomas D", "lastName": "Rea", "creatorType": "author" }, { "lastName": "American Heart Association Council on Quality of Care and Outcomes Research", "creatorType": "author", "fieldMode": 1 }, { "lastName": "Emergency Cardiovascular Care Committee", "creatorType": "author", "fieldMode": 1 }, { "lastName": "Council on Cardiopulmonary, Critical Care, Perioperative and Resuscitation", "creatorType": "author", "fieldMode": 1 }, { "lastName": "Council on Clinical Cardiology", "creatorType": "author", "fieldMode": 1 }, { "lastName": "Council on Cardiovascular Surgery and Anesthesia", "creatorType": "author", "fieldMode": 1 } ], "notes": [], "tags": [ "Administrative Personnel", "American Heart Association", "Cardiopulmonary Resuscitation", "Community Health Services", "Health Personnel", "Heart Arrest", "Humans", "Leadership", "Public Health", "United States" ], "seeAlso": [], "attachments": [], "itemID": "sasson_increasing_2013", "ISSN": "1524-4539", "shortTitle": "Increasing cardiopulmonary resuscitation provision in communities with low bystander cardiopulmonary resuscitation rates", "DOI": "10.1161/CIR.0b013e318288b4dd", "language": "eng", "issue": "12", "extra": "PMID: 23439512", "title": "Increasing cardiopulmonary resuscitation provision in communities with low bystander cardiopulmonary resuscitation rates: a science advisory from the American Heart Association for healthcare providers, policymakers, public health departments, and community leaders", "volume": "127", "publicationTitle": "Circulation", "date": "March 2013", "pages": "1342–1350" } ] }, { "type": "import", "input": "@article{smith_testing_????,\n title = {Testing identifier import},\n\tauthor = {Smith, John},\n\tlccn = {L123456},\n\tmrnumber = {MR123456},\n\tzmnumber = {ZM123456},\n\tpmid = {P123456},\n\tpmcid = {PMC123456},\n\teprinttype = {arxiv},\n\teprint = {AX123456}\n}", "items": [ { "itemType": "journalArticle", "creators": [ { "firstName": "John", "lastName": "Smith", "creatorType": "author" } ], "notes": [], "tags": [], "seeAlso": [], "attachments": [], "itemID": "smith_testing_????", "extra": "LCCN: L123456\nMR: MR123456\nZbl: ZM123456\nPMID: P123456\nPMCID: PMC123456\narXiv: AX123456", "title": "Testing identifier import" } ] } ] /** END TEST CASES **/ writer2latex-1.4/source/distro/zotero/COPYING-ZOTERO.txt0000644000175000017500000010451311524722053021502 0ustar renerene GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . writer2latex-1.4/source/java/0000755000175000017500000000000012603463650014704 5ustar renerenewriter2latex-1.4/source/java/org/0000755000175000017500000000000012636604221015470 5ustar renerenewriter2latex-1.4/source/java/org/openoffice/0000755000175000017500000000000012603463647017616 5ustar renerenewriter2latex-1.4/source/java/org/openoffice/da/0000755000175000017500000000000012603463647020202 5ustar renerenewriter2latex-1.4/source/java/org/openoffice/da/comp/0000755000175000017500000000000012603463650021132 5ustar renerenewriter2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/0000755000175000017500000000000012603463650023605 5ustar renerenewriter2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/EpubOptionsDialog.java0000644000175000017500000003441712411277733030052 0ustar renerene/************************************************************************ * * EpubOptionsDialog.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-25) * */ package org.openoffice.da.comp.writer2xhtml; import java.awt.GraphicsEnvironment; import com.sun.star.awt.XDialog; import com.sun.star.beans.XPropertySet; import com.sun.star.lang.XComponent; import com.sun.star.ui.dialogs.XExecutableDialog; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper; import org.openoffice.da.comp.w2lcommon.filter.OptionsDialogBase; /** This class provides a UNO component which implements a filter UI for the * EPUB export */ public class EpubOptionsDialog extends OptionsDialogBase { /** The component will be registered under this name. */ public static String __serviceName = "org.openoffice.da.writer2xhtml.EpubOptionsDialog"; /** The component should also have an implementation name. */ public static String __implementationName = "org.openoffice.da.comp.writer2xhtml.EpubOptionsDialog"; @Override public String getDialogLibraryName() { return "W2XDialogs2"; } /** Return the name of the dialog within the library */ @Override public String getDialogName() { return "EpubOptions"; } /** Return the name of the registry path */ @Override public String getRegistryPath() { return "/org.openoffice.da.Writer2xhtml.Options/EpubOptions"; } /** Create a new EpubOptionsDialog */ public EpubOptionsDialog(XComponentContext xContext) { super(xContext); xMSF = W2XRegistration.xMultiServiceFactory; } /** Load settings from the registry to the dialog */ @Override protected void loadSettings(XPropertySet xProps) { // Style loadConfig(xProps); int nScaling = loadNumericOption(xProps, "Scaling"); if (nScaling<=1) { // Workaround for an obscure bug in the extension manager setNumericFieldValue("Scaling",100); } int nColumnScaling = loadNumericOption(xProps, "ColumnScaling"); if (nColumnScaling<=1) { setNumericFieldValue("ColumnScaling",100); } loadCheckBoxOption(xProps, "RelativeFontSize"); loadNumericOption(xProps, "FontScaling"); int nFontScaling = loadNumericOption(xProps, "FontScaling"); if (nFontScaling<=1) { setNumericFieldValue("FontScaling",100); } loadCheckBoxOption(xProps, "RelativeFontSize"); loadCheckBoxOption(xProps, "UseDefaultFont"); loadComboBoxOption(xProps, "DefaultFontName"); loadCheckBoxOption(xProps, "ConvertToPx"); loadListBoxOption(xProps, "ImageSize"); // Fill the font name list with all installed fonts setListBoxStringItemList("DefaultFontName", GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()); // AutoCorrect loadCheckBoxOption(xProps, "IgnoreHardLineBreaks"); loadCheckBoxOption(xProps, "IgnoreEmptyParagraphs"); loadCheckBoxOption(xProps, "IgnoreDoubleSpaces"); // Special content loadCheckBoxOption(xProps, "DisplayHiddenText"); loadCheckBoxOption(xProps, "Notes"); // Document division loadListBoxOption(xProps, "SplitLevel"); loadListBoxOption(xProps, "PageBreakSplit"); loadCheckBoxOption(xProps, "UseImageSplit"); loadNumericOption(xProps, "ImageSplit"); loadCheckBoxOption(xProps, "CoverImage"); loadCheckBoxOption(xProps, "UseSplitAfter"); loadNumericOption(xProps, "SplitAfter"); // Navigation table loadListBoxOption(xProps, "ExternalTocDepth"); loadCheckBoxOption(xProps, "IncludeToc"); updateLockedOptions(); enableControls(); } /** Save settings from the dialog to the registry and create FilterData */ @Override protected void saveSettings(XPropertySet xProps, PropertyHelper helper) { // Style short nConfig = saveConfig(xProps, helper); switch (nConfig) { case 0: helper.put("ConfigURL","*default.xml"); break; case 1: helper.put("ConfigURL","$(user)/writer2xhtml.xml"); helper.put("AutoCreate","true"); helper.put("TemplateURL", "$(user)/writer2xhtml-template.xhtml"); helper.put("StyleSheetURL", "$(user)/writer2xhtml-styles.css"); helper.put("ResourceURL", "$(user)/writer2xhtml-resources"); } saveNumericOptionAsPercentage(xProps, helper, "Scaling", "scaling"); saveNumericOptionAsPercentage(xProps, helper, "ColumnScaling", "column_scaling"); saveCheckBoxOption(xProps, helper, "RelativeFontSize", "relative_font_size"); saveNumericOptionAsPercentage(xProps, helper, "FontScaling", "font_scaling"); saveCheckBoxOption(xProps, helper, "UseDefaultFont", "use_default_font"); saveTextFieldOption(xProps, helper, "DefaultFontName", "default_font_name"); saveCheckBoxOption(xProps, helper, "ConvertToPx", "convert_to_px"); saveListBoxOption(xProps, "ImageSize"); switch (getListBoxSelectedItem("ImageSize")) { case 0: helper.put("image_size", "absolute"); break; case 1: helper.put("image_size", "relative"); break; case 2: helper.put("image_size", "none"); } // AutoCorrect saveCheckBoxOption(xProps, helper, "IgnoreHardLineBreaks", "ignore_hard_line_breaks"); saveCheckBoxOption(xProps, helper, "IgnoreEmptyParagraphs", "ignore_empty_paragraphs"); saveCheckBoxOption(xProps, helper, "IgnoreDoubleSpaces", "ignore_double_spaces"); // Special content saveCheckBoxOption(xProps, helper, "DisplayHiddenText", "display_hidden_text"); saveCheckBoxOption(xProps, helper, "Notes", "notes"); // Document division short nSplitLevel = saveListBoxOption(xProps, "SplitLevel"); if (!isLocked("split_level")) { helper.put("split_level",Integer.toString(nSplitLevel)); } short nPageBreakSplit = saveListBoxOption(xProps, "PageBreakSplit"); if (!isLocked("page_break_split")) { switch (nPageBreakSplit) { case 0: helper.put("page_break_split","none"); break; case 1: helper.put("page_break_split", "styles"); break; case 2: helper.put("page_break_split", "explicit"); break; case 3: helper.put("page_break_split", "all"); } } boolean bUseImageSplit = saveCheckBoxOption(xProps, "UseImageSplit"); int nImageSplit = saveNumericOption(xProps, "ImageSplit"); if (!isLocked("image_split")) { if (bUseImageSplit) { helper.put("image_split", nImageSplit+"%"); } else { helper.put("image_split", "none"); } } saveCheckBoxOption(xProps, helper, "CoverImage", "cover_image"); boolean bUseSplitAfter = saveCheckBoxOption(xProps, "UseSplitAfter"); int nSplitAfter = saveNumericOption(xProps, "SplitAfter"); if (!isLocked("split_after")) { if (bUseSplitAfter) { helper.put("split_after", Integer.toString(nSplitAfter)); } else { helper.put("split_after", "0"); } } // Navigation table short nExternalTocDepth = saveListBoxOption(xProps, "ExternalTocDepth"); helper.put("external_toc_depth", Integer.toString(nExternalTocDepth+1)); saveCheckBoxOption(xProps, helper, "IncludeToc", "include_toc"); } // Implement XDialogEventHandler @Override public boolean callHandlerMethod(XDialog xDialog, Object event, String sMethod) { if (sMethod.equals("ConfigChange")) { updateLockedOptions(); enableControls(); } else if (sMethod.equals("RelativeFontSizeChange")) { relativeFontSizeChange(); } else if (sMethod.equals("UseDefaultFontChange")) { useDefaultFontChange(); } else if (sMethod.equals("EditMetadataClick")) { editMetadataClick(); } else if (sMethod.equals("UseImageSplitChange")) { useImageSplitChange(); } else if (sMethod.equals("UseSplitAfterChange")) { useSplitAfterChange(); } return true; } @Override public String[] getSupportedMethodNames() { String[] sNames = { "ConfigChange", "RelativeFontSizeChange", "UseDefaultFontChange", "EditMetadataClick", "UseImageSplitChange", "UseSplitAfterChange" }; return sNames; } private void enableControls() { // Style setControlEnabled("ScalingLabel",!isLocked("scaling")); setControlEnabled("Scaling",!isLocked("scaling")); setControlEnabled("ColumnScalingLabel",!isLocked("column_scaling")); setControlEnabled("ColumnScaling",!isLocked("column_scaling")); boolean bRelativeFontSize = getCheckBoxStateAsBoolean("RelativeFontSize"); setControlEnabled("RelativeFontSize",!isLocked("relative_font_size")); setControlEnabled("FontScalingLabel", !isLocked("font_scaling") && bRelativeFontSize); setControlEnabled("FontScaling",!isLocked("font_scaling") && bRelativeFontSize); setControlEnabled("FontScalingPercentLabel", !isLocked("font_scaling") && bRelativeFontSize); boolean bUseDefaultFont = getCheckBoxStateAsBoolean("UseDefaultFont"); setControlEnabled("UseDefaultFont",!isLocked("use_default_font")); setControlEnabled("DefaultFontNameLabel",!isLocked("default_font_name") && bUseDefaultFont); setControlEnabled("DefaultFontName",!isLocked("default_font_name") && bUseDefaultFont); setControlEnabled("ConvertToPx",!isLocked("convert_to_px")); setControlEnabled("ImageSize",!isLocked("image_size")); // AutoCorrect setControlEnabled("IgnoreHardLineBreaks",!isLocked("ignore_hard_line_breaks")); setControlEnabled("IgnoreEmptyParagraphs",!isLocked("ignore_empty_paragraphs")); setControlEnabled("IgnoreDoubleSpaces",!isLocked("ignore_double_spaces")); // Special content setControlEnabled("DisplayHiddenText",!isLocked("display_hidden_text")); setControlEnabled("Notes",!isLocked("notes")); // Document division setControlEnabled("SplitLevelLabel",!isLocked("split_level")); setControlEnabled("SplitLevel",!isLocked("split_level")); setControlEnabled("PageBreakSplitLabel",!isLocked("page_break_split")); setControlEnabled("PageBreakSplit",!isLocked("page_break_split")); boolean bUseImageSplit = getCheckBoxStateAsBoolean("UseImageSplit"); setControlEnabled("UseImageSplit",!isLocked("image_split")); setControlEnabled("ImageSplitLabel",!isLocked("image_split") && bUseImageSplit); setControlEnabled("ImageSplit",!isLocked("image_split") && bUseImageSplit); setControlEnabled("ImageSplitPercentLabel",!isLocked("image_split") && bUseImageSplit); setControlEnabled("CoverImage", !isLocked("cover_image")); boolean bUseSplitAfter = getCheckBoxStateAsBoolean("UseSplitAfter"); setControlEnabled("UseSplitAfter",!isLocked("split_after")); setControlEnabled("SplitAfterLabel",!isLocked("split_after") && bUseSplitAfter); setControlEnabled("SplitAfter",!isLocked("split_after") && bUseSplitAfter); // Navigation table setControlEnabled("ExternalTocDepthLabel", !isLocked("external_toc_depth")); setControlEnabled("ExternalTocDepth", !isLocked("external_toc_depth")); setControlEnabled("IncludeToc", !isLocked("include_toc")); } private void relativeFontSizeChange() { if (!isLocked("font_scaling")) { boolean bState = getCheckBoxStateAsBoolean("RelativeFontSize"); setControlEnabled("FontScalingLabel", bState); setControlEnabled("FontScaling", bState); setControlEnabled("FontScalingPercentLabel", bState); } } private void useDefaultFontChange() { if (!isLocked("default_font_name")) { boolean bState = getCheckBoxStateAsBoolean("UseDefaultFont"); setControlEnabled("DefaultFontNameLabel", bState); setControlEnabled("DefaultFontName", bState); } } private void editMetadataClick() { Object dialog; try { dialog = xContext.getServiceManager().createInstanceWithContext("org.openoffice.da.writer2xhtml.EpubMetadataDialog", xContext); XExecutableDialog xDialog = (XExecutableDialog) UnoRuntime.queryInterface(XExecutableDialog.class, dialog); xDialog.execute(); // Dispose the dialog after execution (to free up the memory) XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, dialog); if (xComponent!=null) { xComponent.dispose(); } } catch (Exception e) { // Failed to get dialog } } private void useImageSplitChange() { if (!isLocked("image_split")) { boolean bEnable = getCheckBoxStateAsBoolean("UseImageSplit"); setControlEnabled("ImageSplitLabel",bEnable); setControlEnabled("ImageSplit",bEnable); setControlEnabled("ImageSplitPercentLabel",bEnable); } } private void useSplitAfterChange() { if (!isLocked("split_after")) { boolean bState = getCheckBoxStateAsBoolean("UseSplitAfter"); setControlEnabled("SplitAfterLabel",bState); setControlEnabled("SplitAfter",bState); } } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/BatchHandlerAdapter.java0000644000175000017500000000410111147474702030266 0ustar renerene/************************************************************************ * * BatchHandlerAdapter.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2008 by Henrik Just * * All Rights Reserved. * * Version 1.0 (2008-10-05) * */ package org.openoffice.da.comp.writer2xhtml; import writer2latex.api.BatchHandler; import org.openoffice.da.writer2xhtml.XBatchHandler; /** The uno interface provides an XBatchHandler implementation, the java * interface requires a BatchHandler implementation. This simple class * implements the latter using an instance of the former. */ public class BatchHandlerAdapter implements BatchHandler { private XBatchHandler unoHandler; public BatchHandlerAdapter(XBatchHandler unoHandler) { this.unoHandler = unoHandler; } public void startConversion() { unoHandler.startConversion(); } public void endConversion() { unoHandler.endConversion(); } public void startDirectory(String sName) { unoHandler.startDirectory(sName); } public void endDirectory(String sName, boolean bSuccess) { unoHandler.endDirectory(sName, bSuccess); } public void startFile(String sName) { unoHandler.startFile(sName); } public void endFile(String sName, boolean bSuccess) { unoHandler.endFile(sName, bSuccess); } public boolean cancel() { return unoHandler.cancel(); } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/W2XRegistration.java0000644000175000017500000001435112375043725027472 0ustar renerene/************************************************************************ * * W2XRegistration.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-08-18) * */ package org.openoffice.da.comp.writer2xhtml; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XSingleServiceFactory; import com.sun.star.registry.XRegistryKey; import com.sun.star.comp.loader.FactoryHelper; /** This class provides a static method to instantiate our uno components * on demand (__getServiceFactory()), and a static method to give * information about the components (__writeRegistryServiceInfo()). * Furthermore, it saves the XMultiServiceFactory provided to the * __getServiceFactory method for future reference by the componentes. */ public class W2XRegistration { public static XMultiServiceFactory xMultiServiceFactory; /** * Returns a factory for creating the service. * This method is called by the JavaLoader * * @return returns a XSingleServiceFactory for creating the * component * * @param implName the name of the implementation for which a * service is desired * @param multiFactory the service manager to be used if needed * @param regKey the registryKey * * @see com.sun.star.comp.loader.JavaLoader */ public static XSingleServiceFactory __getServiceFactory(String implName, XMultiServiceFactory multiFactory, XRegistryKey regKey) { xMultiServiceFactory = multiFactory; XSingleServiceFactory xSingleServiceFactory = null; if (implName.equals(W2XExportFilter.class.getName()) ) { xSingleServiceFactory = FactoryHelper.getServiceFactory(W2XExportFilter.class, W2XExportFilter.__serviceName, multiFactory, regKey); } else if (implName.equals(BatchConverter.__implementationName) ) { xSingleServiceFactory = FactoryHelper.getServiceFactory(BatchConverter.class, BatchConverter.__serviceName, multiFactory, regKey); } else if (implName.equals(XhtmlOptionsDialog.__implementationName)) { xSingleServiceFactory = FactoryHelper.getServiceFactory(XhtmlOptionsDialog.class, XhtmlOptionsDialog.__serviceName, multiFactory, regKey); } else if (implName.equals(XhtmlOptionsDialogMath.__implementationName)) { xSingleServiceFactory = FactoryHelper.getServiceFactory(XhtmlOptionsDialogMath.class, XhtmlOptionsDialogMath.__serviceName, multiFactory, regKey); } else if (implName.equals(XhtmlOptionsDialogCalc.__implementationName)) { xSingleServiceFactory = FactoryHelper.getServiceFactory(XhtmlOptionsDialogCalc.class, XhtmlOptionsDialogCalc.__serviceName, multiFactory, regKey); } else if (implName.equals(EpubOptionsDialog.__implementationName)) { xSingleServiceFactory = FactoryHelper.getServiceFactory(EpubOptionsDialog.class, EpubOptionsDialog.__serviceName, multiFactory, regKey); } else if (implName.equals(EpubMetadataDialog.__implementationName)) { xSingleServiceFactory = FactoryHelper.getServiceFactory(EpubMetadataDialog.class, EpubMetadataDialog.__serviceName, multiFactory, regKey); } else if (implName.equals(ConfigurationDialog.__implementationName)) { xSingleServiceFactory = FactoryHelper.getServiceFactory(ConfigurationDialog.class, ConfigurationDialog.__serviceName, multiFactory, regKey); } return xSingleServiceFactory; } /** * Writes the service information into the given registry key. * This method is called by the JavaLoader *

* @return returns true if the operation succeeded * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { return FactoryHelper.writeRegistryServiceInfo(BatchConverter.__implementationName, BatchConverter.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(W2XExportFilter.__implementationName, W2XExportFilter.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(XhtmlOptionsDialog.__implementationName, XhtmlOptionsDialog.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(XhtmlOptionsDialogMath.__implementationName, XhtmlOptionsDialogMath.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(XhtmlOptionsDialogCalc.__implementationName, XhtmlOptionsDialogCalc.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(EpubOptionsDialog.__implementationName, EpubOptionsDialog.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(EpubMetadataDialog.__implementationName, EpubMetadataDialog.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(ConfigurationDialog.__implementationName, ConfigurationDialog.__serviceName, regKey); } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/XhtmlOptionsDialogMath.java0000644000175000017500000000333512375043725031061 0ustar renerene/************************************************************************ * * XhtmlOptionsDialogXsl.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2004 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-08-18) * */ package org.openoffice.da.comp.writer2xhtml; import com.sun.star.uno.XComponentContext; /** This class provides a uno component which implements a filter ui for the * Xhtml export for the XHTML+MathML and HTML export. * This variant of the dialog has the MahtJax setting enabled */ public class XhtmlOptionsDialogMath extends XhtmlOptionsDialog { /** The component will be registered under this name. */ public static String __serviceName = "org.openoffice.da.writer2xhtml.XhtmlOptionsDialogMath"; /** The component should also have an implementation name. */ public static String __implementationName = "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialogMath"; /** Create a new XhtmlOptionsDialogMath */ public XhtmlOptionsDialogMath(XComponentContext xContext) { super(xContext); } }writer2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/ConfigurationDialog.java0000644000175000017500000005001312410605107030365 0ustar renerene/************************************************************************ * * ConfigurationDialog.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-23) * */ package org.openoffice.da.comp.writer2xhtml; import java.util.Map; import org.openoffice.da.comp.w2lcommon.filter.ConfigurationDialogBase; import org.openoffice.da.comp.w2lcommon.helper.DialogAccess; import com.sun.star.container.NoSuchElementException; import com.sun.star.lang.XServiceInfo; import com.sun.star.ucb.CommandAbortedException; import com.sun.star.uno.Exception; import com.sun.star.uno.XComponentContext; public class ConfigurationDialog extends ConfigurationDialogBase implements XServiceInfo { private String sResourceDirName; // Implement the interface XServiceInfo /** The component will be registered under this name. */ public static String __serviceName = "org.openoffice.da.writer2xhtml.ConfigurationDialog"; /** The component should also have an implementation name. */ public static String __implementationName = "org.openoffice.da.comp.writer2xhtml.ConfigurationDialog"; public boolean supportsService(String sServiceName) { return sServiceName.equals(__serviceName); } public String getImplementationName() { return __implementationName; } public String[] getSupportedServiceNames() { String[] sSupportedServiceNames = { __serviceName }; return sSupportedServiceNames; } // Configure the base class @Override protected String getMIMEType() { return "text/html"; } @Override protected String getDialogLibraryName() { return "W2XDialogs2"; } @Override protected String getConfigFileName() { return "writer2xhtml.xml"; } /** Construct a new ConfigurationDialog */ public ConfigurationDialog(XComponentContext xContext) { super(xContext); // Create the resource dir name try { sResourceDirName = xPathSub.substituteVariables("$(user)/writer2xhtml-resources", false); } catch (NoSuchElementException e) { sResourceDirName = "writer2xhtml-resources"; } pageHandlers.put("General", new GeneralHandler()); pageHandlers.put("Template", new TemplateHandler()); pageHandlers.put("Stylesheets", new StylesheetsHandler()); pageHandlers.put("Formatting", new FormattingHandler()); pageHandlers.put("Styles1", new Styles1Handler()); pageHandlers.put("Styles2", new Styles2Handler()); pageHandlers.put("Formatting", new FormattingHandler()); pageHandlers.put("Content", new ContentHandler()); } // Implement remaining method from XContainerWindowEventHandler public String[] getSupportedMethodNames() { String[] sNames = { "EncodingChange", // General "CustomTemplateChange", "LoadTemplateClick", // Template "UseCustomStylesheetChange", "IncludeCustomStylesheetClick", "LoadStylesheetClick", "NewResourceClick", "DeleteResourceClick", // Stylesheet "StyleFamilyChange", "StyleNameChange", "NewStyleClick", "DeleteStyleClick", "LoadDefaultsClick" // Styles1 }; return sNames; } // the page handlers private final String[] sCharElements = { "span", "abbr", "acronym", "b", "big", "cite", "code", "del", "dfn", "em", "i", "ins", "kbd", "samp", "small", "strong", "sub", "sup", "tt", "var", "q" }; private class GeneralHandler extends PageHandler { private final String[] sEncodingValues = { "UTF-8", "UTF-16", "ISO-8859-1", "US-ASCII" }; @Override protected void setControls(DialogAccess dlg) { checkBoxFromConfig(dlg, "NoDoctype", "no_doctype"); listBoxFromConfig(dlg, "Encoding", "encoding", sEncodingValues, (short) 0); checkBoxFromConfig(dlg, "AddBOM", "add_bom"); if ("true".equals(config.getOption("hexadecimal_entities"))) { dlg.setListBoxSelectedItem("HexadecimalEntities", (short) 0); } else { dlg.setListBoxSelectedItem("HexadecimalEntities", (short) 1); } checkBoxFromConfig(dlg, "UseNamedEntities", "use_named_entities"); checkBoxFromConfig(dlg, "Multilingual", "multilingual"); checkBoxFromConfig(dlg, "PrettyPrint", "pretty_print"); encodingChange(dlg); } @Override protected void getControls(DialogAccess dlg) { checkBoxToConfig(dlg, "NoDoctype", "no_doctype"); listBoxToConfig(dlg, "Encoding", "encoding", sEncodingValues); checkBoxToConfig(dlg, "AddBOM", "add_bom"); config.setOption("hexadecimal_entities", Boolean.toString(dlg.getListBoxSelectedItem("HexadecimalEntities")==(short)0)); checkBoxToConfig(dlg, "UseNamedEntities", "use_named_entities"); checkBoxToConfig(dlg, "Multilingual", "multilingual"); checkBoxToConfig(dlg, "PrettyPrint", "pretty_print"); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("EncodingChange")) { encodingChange(dlg); return true; } return false; } private void encodingChange(DialogAccess dlg) { int nEncoding = dlg.getListBoxSelectedItem("Encoding"); dlg.setControlEnabled("AddBOM", nEncoding==0); // Only for UTF-8 dlg.setControlEnabled("HexadecimalEntitiesLabel", nEncoding>1); // Not for UNICODE dlg.setControlEnabled("HexadecimalEntities", nEncoding>1); // Not for UNICODE } } private class TemplateHandler extends CustomFileHandler { protected String getSuffix() { return "Template"; } protected String getFileName() { return "writer2xhtml-template.xhtml"; } protected void useCustomInner(DialogAccess dlg, boolean bEnable) { dlg.setControlEnabled("ContentIdLabel", bEnable); dlg.setControlEnabled("ContentId", bEnable); dlg.setControlEnabled("HeaderIdLabel", bEnable); dlg.setControlEnabled("HeaderId", bEnable); dlg.setControlEnabled("FooterIdLabel", bEnable); dlg.setControlEnabled("FooterId", bEnable); dlg.setControlEnabled("PanelIdLabel", bEnable); dlg.setControlEnabled("PanelId", bEnable); } @Override protected void setControls(DialogAccess dlg) { super.setControls(dlg); String[] sCustomIds = config.getOption("template_ids").split(","); if (sCustomIds.length>0) { dlg.setComboBoxText("ContentId", sCustomIds[0]); } if (sCustomIds.length>1) { dlg.setComboBoxText("HeaderId", sCustomIds[1]); } if (sCustomIds.length>2) { dlg.setComboBoxText("FooterId", sCustomIds[2]); } if (sCustomIds.length>3) { dlg.setComboBoxText("PanelId", sCustomIds[3]); } } @Override protected void getControls(DialogAccess dlg) { super.getControls(dlg); config.setOption("template_ids", dlg.getComboBoxText("ContentId").trim()+","+ dlg.getComboBoxText("HeaderId").trim()+","+ dlg.getComboBoxText("FooterId").trim()+","+ dlg.getComboBoxText("PanelId").trim()); } } private class StylesheetsHandler extends CustomFileHandler { protected String getSuffix() { return "Stylesheet"; } protected String getFileName() { return "writer2xhtml-styles.css"; } protected void useCustomInner(DialogAccess dlg, boolean bEnable) { dlg.setControlEnabled("ResourceLabel", bEnable); dlg.setControlEnabled("Resources", bEnable); dlg.setControlEnabled("NewResourceButton", bEnable); dlg.setControlEnabled("DeleteResourceButton", bEnable); updateResources(dlg); } @Override protected void setControls(DialogAccess dlg) { super.setControls(dlg); dlg.setCheckBoxStateAsBoolean("LinkCustomStylesheet", config.getOption("custom_stylesheet").length()>0); textFieldFromConfig(dlg, "CustomStylesheetURL", "custom_stylesheet"); linkCustomStylesheetChange(dlg); updateResources(dlg); } @Override protected void getControls(DialogAccess dlg) { super.getControls(dlg); if (dlg.getCheckBoxStateAsBoolean("LinkCustomStylesheet")) { textFieldToConfig(dlg, "CustomStylesheetURL", "custom_stylesheet"); } else { config.setOption("custom_stylesheet", ""); } } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (super.handleEvent(dlg, sMethod)) { return true; } if (sMethod.equals("LinkCustomStylesheetChange")) { linkCustomStylesheetChange(dlg); return true; } else if (sMethod.equals("NewResourceClick")) { newResourceClick(dlg); return true; } else if (sMethod.equals("DeleteResourceClick")) { deleteResourceClick(dlg); return true; } return false; } private void linkCustomStylesheetChange(DialogAccess dlg) { boolean bLinkCustomStylesheet = dlg.getCheckBoxStateAsBoolean("LinkCustomStylesheet"); dlg.setControlEnabled("CustomStylesheetURLLabel", bLinkCustomStylesheet); dlg.setControlEnabled("CustomStylesheetURL", bLinkCustomStylesheet); } private void newResourceClick(DialogAccess dlg) { String[] sFileNames=filePicker.getPaths(); if (sFileNames!=null) { createResourceDir(); for (String sFileName : sFileNames) { String sBaseFileName = sFileName.substring(sFileName.lastIndexOf('/')+1); try { String sTargetFileName = sResourceDirName+"/"+sBaseFileName; if (fileExists(sTargetFileName)) { killFile(sTargetFileName); } sfa2.copy(sFileName, sTargetFileName); } catch (CommandAbortedException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } updateResources(dlg); } } private void deleteResourceClick(DialogAccess dlg) { int nItem = dlg.getListBoxSelectedItem("Resources"); if (nItem>=0) { String sFileName = dlg.getListBoxStringItemList("Resources")[nItem]; if (deleteItem(sFileName)) { killFile(sResourceDirName+"/"+sFileName); updateResources(dlg); } } } private void updateResources(DialogAccess dlg) { createResourceDir(); try { String[] sFiles = sfa2.getFolderContents(sResourceDirName, false); // do not include folders int nCount = sFiles.length; for (int i=0; i attr) { if (!attr.containsKey("element")) { attr.put("element", ""); } if (!attr.containsKey("css")) { attr.put("css", ""); } dlg.setComboBoxText("Element", attr.get("element")); dlg.setTextFieldText("Css", none2empty(attr.get("css"))); if (nCurrentFamily==1 || nCurrentFamily==2) { if (!attr.containsKey("block-element")) { attr.put("block-element", ""); } if (!attr.containsKey("block-css")) { attr.put("block-css", ""); } dlg.setComboBoxText("BlockElement", attr.get("block-element")); dlg.setTextFieldText("BlockCss", none2empty(attr.get("block-css"))); } else { dlg.setComboBoxText("BlockElement", ""); dlg.setTextFieldText("BlockCss", ""); } } protected void getControls(DialogAccess dlg, Map attr) { attr.put("element", dlg.getComboBoxText("Element")); attr.put("css", empty2none(dlg.getTextFieldText("Css"))); if (nCurrentFamily==1 || nCurrentFamily==2) { attr.put("block-element", dlg.getComboBoxText("BlockElement")); attr.put("block-css", empty2none(dlg.getTextFieldText("BlockCss"))); } } protected void clearControls(DialogAccess dlg) { dlg.setComboBoxText("Element", ""); dlg.setTextFieldText("Css", ""); dlg.setComboBoxText("BlockElement", ""); dlg.setTextFieldText("BlockCss", ""); } protected void prepareControls(DialogAccess dlg, boolean bHasMappings) { dlg.setListBoxStringItemList("Element", sElements[nCurrentFamily]); dlg.setListBoxStringItemList("BlockElement", sBlockElements[nCurrentFamily]); dlg.setControlEnabled("ElementLabel", bHasMappings && nCurrentFamily<=2); dlg.setControlEnabled("Element", bHasMappings && nCurrentFamily<=2); dlg.setControlEnabled("CssLabel", bHasMappings); dlg.setControlEnabled("Css", bHasMappings); dlg.setControlEnabled("BlockElementLabel", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2)); dlg.setControlEnabled("BlockElement", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2)); dlg.setControlEnabled("BlockCssLabel", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2)); dlg.setControlEnabled("BlockCss", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2)); } } private class Styles2Handler extends AttributePageHandler { private String[] sXhtmlAttributeNames = { "bold", "italics", "fixed", "superscript", "subscript", "underline", "overstrike" }; public Styles2Handler() { sAttributeNames = sXhtmlAttributeNames; } @Override public void setControls(DialogAccess dlg) { super.setControls(dlg); textFieldFromConfig(dlg,"TabstopStyle","tabstop_style"); } @Override public void getControls(DialogAccess dlg) { super.getControls(dlg); textFieldToConfig(dlg,"TabstopStyle","tabstop_style"); } protected void setControls(DialogAccess dlg, Map attr) { if (!attr.containsKey("element")) { attr.put("element", ""); } if (!attr.containsKey("css")) { attr.put("css", ""); } dlg.setListBoxStringItemList("Element", sCharElements); dlg.setComboBoxText("Element", attr.get("element")); dlg.setTextFieldText("Css", none2empty(attr.get("css"))); } protected void getControls(DialogAccess dlg, Map attr) { attr.put("element", dlg.getComboBoxText("Element")); attr.put("css", empty2none(dlg.getTextFieldText("Css"))); } protected void prepareControls(DialogAccess dlg, boolean bEnable) { dlg.setControlEnabled("ElementLabel", bEnable); dlg.setControlEnabled("Element", bEnable); dlg.setControlEnabled("CssLabel", bEnable); dlg.setControlEnabled("Css", bEnable); } } private class FormattingHandler extends PageHandler { private final String[] sExportValues = { "convert_all", "ignore_styles", "ignore_hard", "ignore_all" }; private final String[] sListExportValues = { "css1", "css1_hack", "hard_labels" }; @Override protected void setControls(DialogAccess dlg) { listBoxFromConfig(dlg, "Formatting", "formatting", sExportValues, (short) 0); listBoxFromConfig(dlg, "FrameFormatting", "frame_formatting", sExportValues, (short) 0); // OOo does not support styles for sections and tables, hence this simplified variant dlg.setCheckBoxStateAsBoolean("SectionFormatting", config.getOption("section_formatting").equals("convert_all") || config.getOption("section_formatting").equals("ignore_styles")); dlg.setCheckBoxStateAsBoolean("TableFormatting", config.getOption("table_formatting").equals("convert_all") || config.getOption("table_formatting").equals("ignore_styles")); checkBoxFromConfig(dlg, "IgnoreTableDimensions", "ignore_table_dimensions"); listBoxFromConfig(dlg, "ListFormatting", "list_formatting", sListExportValues, (short) 0); //TODO: These have been postponed //checkBoxFromConfig(dlg, "ConvertToPx", "convert_to_px"); //checkBoxFromConfig(dlg, "SeparateStylesheet", "separate_stylesheet"); } @Override protected void getControls(DialogAccess dlg) { listBoxToConfig(dlg, "Formatting", "formatting", sExportValues); listBoxToConfig(dlg, "FrameFormatting", "frame_formatting", sExportValues); config.setOption("section_formatting", dlg.getCheckBoxStateAsBoolean("SectionFormatting") ? "convert_all" : "ignore_all"); config.setOption("table_formatting", dlg.getCheckBoxStateAsBoolean("TableFormatting") ? "convert_all" : "ignore_all"); checkBoxToConfig(dlg, "IgnoreTableDimensions", "ignore_table_dimensions"); listBoxToConfig(dlg, "ListFormatting", "list_formatting", sListExportValues); //TODO: These have been postponed //checkBoxToConfig(dlg, "ConvertToPx", "convert_to_px"); //checkBoxToConfig(dlg, "SeparateStylesheet", "separate_stylesheet"); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { return false; } } private class ContentHandler extends PageHandler { private final String[] sFormulaValues = { "image+starmath", "image+latex", "starmath", "latex" }; @Override protected void setControls(DialogAccess dlg) { listBoxFromConfig(dlg, "Formulas", "formulas", sFormulaValues, (short) 0); textFieldFromConfig(dlg, "EndnotesHeading", "endnotes_heading"); textFieldFromConfig(dlg, "FootnotesHeading", "footnotes_heading"); checkBoxFromConfig(dlg, "EmbedSvg", "embed_svg"); } @Override protected void getControls(DialogAccess dlg) { listBoxToConfig(dlg, "Formulas", "formulas", sFormulaValues); textFieldToConfig(dlg, "EndnotesHeading", "endnotes_heading"); textFieldToConfig(dlg, "FootnotesHeading", "footnotes_heading"); checkBoxToConfig(dlg, "EmbedSvg", "embed_svg"); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { return false; } } private String none2empty(String s) { return s.equals("(none)") ? "" : s; } private String empty2none(String s) { String t = s.trim(); return t.length()==0 ? "(none)" : t; } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/BatchConverter.java0000644000175000017500000004555212367640075027401 0ustar renerene/************************************************************************ * * BatchConverter.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2009 by Henrik Just * * All Rights Reserved. * * Version 1.3.1 (2014-08-04) * */ package org.openoffice.da.comp.writer2xhtml; import java.io.IOException; import java.io.OutputStream; import java.net.URI; import java.net.URISyntaxException; import com.sun.star.lib.uno.adapter.XInputStreamToInputStreamAdapter; import com.sun.star.lib.uno.adapter.XOutputStreamToOutputStreamAdapter; import com.sun.star.beans.PropertyValue; import com.sun.star.document.XDocumentProperties; import com.sun.star.document.XDocumentPropertiesSupplier; import com.sun.star.frame.XComponentLoader; import com.sun.star.frame.XStorable; import com.sun.star.io.NotConnectedException; import com.sun.star.io.XInputStream; import com.sun.star.io.XOutputStream; import com.sun.star.lang.XComponent; import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XServiceName; import com.sun.star.lang.XTypeProvider; import com.sun.star.sheet.XSpreadsheetDocument; import com.sun.star.text.XTextDocument; import com.sun.star.ucb.CommandAbortedException; import com.sun.star.ucb.XSimpleFileAccess2; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; //import writer2latex.api.BatchConverter; //import writer2latex.api.BatchHandler; //import writer2latex.api.Converter; import writer2latex.api.ConverterFactory; import writer2latex.api.IndexPageEntry; import writer2latex.api.MIMETypes; import writer2latex.api.OutputFile; // Import interfaces as defined in uno idl import org.openoffice.da.writer2xhtml.XBatchConverter; import org.openoffice.da.writer2xhtml.XBatchHandler; import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper; /** This class provides a uno component which implements the interface * org.openoffice.da.writer2xhtml.XBatchConverter */ public class BatchConverter implements XBatchConverter, XServiceName, XServiceInfo, XTypeProvider { /** The component will be registered under this name. */ public static final String __serviceName = "org.openoffice.da.writer2xhtml.BatchConverter"; public static final String __implementationName = "org.openoffice.da.comp.writer2xhtml.BatchConverter"; private XComponentContext xComponentContext = null; private XSimpleFileAccess2 sfa2 = null; private writer2latex.api.BatchConverter batchConverter = null; private XBatchHandler handler; // Based on convert arguments private boolean bRecurse = true; private String sWriterFilterName = "org.openoffice.da.writer2xhtml"; private Object writerFilterData = null; private String sCalcFilterName = "org.openoffice.da.calc2xhtml"; private Object calcFilterData = null; private boolean bIncludePdf = true; private boolean bIncludeOriginal = false; private boolean bUseTitle = true; private boolean bUseDescription = true; private String sUplink = ""; private String sDirectoryIcon = ""; private String sDocumentIcon = ""; private String sTemplateURL = null; public BatchConverter(XComponentContext xComponentContext) { this.xComponentContext = xComponentContext; // Get the SimpleFileAccess service try { Object sfaObject = xComponentContext.getServiceManager().createInstanceWithContext( "com.sun.star.ucb.SimpleFileAccess", xComponentContext); sfa2 = (XSimpleFileAccess2) UnoRuntime.queryInterface(XSimpleFileAccess2.class, sfaObject); } catch (com.sun.star.uno.Exception e) { // failed to get SimpleFileAccess service (should not happen) } } // Helper: Get a string from an any private String getValue(Object any) { if (AnyConverter.isString(any)) { try { return AnyConverter.toString(any); } catch (com.sun.star.lang.IllegalArgumentException e) { return ""; } } else { return ""; } } // Implementation of XBatchConverter: public void convert(String sSourceURL, String sTargetURL, PropertyValue[] lArguments, XBatchHandler handler) { // Create batch converter (currently we don't need to set a converter) batchConverter = ConverterFactory.createBatchConverter(MIMETypes.XHTML); this.handler = handler; // Read the arguments int nSize = lArguments.length; for (int i=0; i0) { entry.setDisplayName(loadedTitle); } String loadedDescription = docProps.getDescription(); if (bUseDescription && loadedDescription.length()>0) { entry.setDescription(loadedDescription); } // Determine the type of the component boolean bText = false; boolean bSpreadsheet = false; if (UnoRuntime.queryInterface(XTextDocument.class, xDocument)!=null) { bText=true; } else if (UnoRuntime.queryInterface(XSpreadsheetDocument.class, xDocument)!=null) { bSpreadsheet=true; } if (!bText && !bSpreadsheet) { handler.endFile(sSourceFileURL,false); xDocument.dispose(); return null; } // Convert using requested filter boolean bHtmlSuccess = true; PropertyHelper exportProps = new PropertyHelper(); exportProps.put("FilterName", bText ? sWriterFilterName : sCalcFilterName); exportProps.put("Overwrite", new Boolean(true)); if (bText && writerFilterData!=null) { exportProps.put("FilterData", writerFilterData); } if (bSpreadsheet && calcFilterData!=null) { exportProps.put("FilterData", calcFilterData); } try { XStorable xStore = (XStorable) UnoRuntime.queryInterface (XStorable.class, xDocument); xStore.storeToURL (sTargetFileURL, exportProps.toArray()); } catch (com.sun.star.io.IOException e) { // Failed to convert; continue anyway, but don't link to the file name entry.setFile(null); bHtmlSuccess = false; } // Convet to pdf if requested boolean bPdfSuccess = true; if (bIncludePdf) { PropertyValue[] pdfProps = new PropertyValue[2]; pdfProps[0] = new PropertyValue(); pdfProps[0].Name = "FilterName"; pdfProps[0].Value = bText ? "writer_pdf_Export" : "calc_pdf_Export"; pdfProps[1] = new PropertyValue(); pdfProps[1].Name = "Overwrite"; pdfProps[1].Value = new Boolean(true); String sPdfFileURL = ensureSlash(sTargetURL) + getBaseName(sSourceFileURL) + ".pdf"; try { XStorable xStore = (XStorable) UnoRuntime.queryInterface (XStorable.class, xDocument); xStore.storeToURL (sPdfFileURL, pdfProps); entry.setPdfFile(sPdfFileURL); } catch (com.sun.star.io.IOException e) { // Not critical, continue without pdf bPdfSuccess = false; } } xDocument.dispose(); // Include original document if required if (bIncludeOriginal) { // TODO } // Report a failure to the user if either of the exports failed handler.endFile(sSourceFileURL,bHtmlSuccess && bPdfSuccess); // But return the index entry even if only one succeded if (bHtmlSuccess || bPdfSuccess) { return entry; } else { return null; } } private String getName(String sURL) { int n = sURL.lastIndexOf("/"); return n>-1 ? sURL.substring(n+1) : sURL; } private String getBaseName(String sURL) { String sName = getName(sURL); int n = sName.lastIndexOf("."); return n>-1 ? sName.substring(0,n) : sName; } private String ensureSlash(String sURL) { return sURL.endsWith("/") ? sURL : sURL+"/"; } private String decodeURL(String sURL) { try { return new URI(sURL).getPath(); } catch (URISyntaxException e) { return sURL; } } // Implement methods from interface XTypeProvider public com.sun.star.uno.Type[] getTypes() { Type[] typeReturn = {}; try { typeReturn = new Type[] { new Type( XBatchConverter.class ), new Type( XTypeProvider.class ), new Type( XServiceName.class ), new Type( XServiceInfo.class ) }; } catch( Exception exception ) { } return( typeReturn ); } public byte[] getImplementationId() { byte[] byteReturn = {}; byteReturn = new String( "" + this.hashCode() ).getBytes(); return( byteReturn ); } // Implement method from interface XServiceName public String getServiceName() { return( __serviceName ); } // Implement methods from interface XServiceInfo public boolean supportsService(String stringServiceName) { return( stringServiceName.equals( __serviceName ) ); } public String getImplementationName() { return( __implementationName ); } public String[] getSupportedServiceNames() { String[] stringSupportedServiceNames = { __serviceName }; return( stringSupportedServiceNames ); } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/XhtmlOptionsDialog.java0000644000175000017500000002134312411277733030245 0ustar renerene/************************************************************************ * * XhtmlOptionsDialog.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-25) * */ package org.openoffice.da.comp.writer2xhtml; import com.sun.star.awt.XDialog; import com.sun.star.beans.XPropertySet; import com.sun.star.uno.XComponentContext; import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper; import org.openoffice.da.comp.w2lcommon.filter.OptionsDialogBase; /** This class provides a uno component which implements a filter ui for the * Xhtml export */ public class XhtmlOptionsDialog extends OptionsDialogBase { /** The component will be registered under this name. */ public static String __serviceName = "org.openoffice.da.writer2xhtml.XhtmlOptionsDialog"; /** The component should also have an implementation name. */ public static String __implementationName = "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialog"; public String getDialogLibraryName() { return "W2XDialogs"; } /** Return the name of the dialog within the library */ public String getDialogName() { return "XhtmlOptions"; } /** Return the name of the registry path */ public String getRegistryPath() { return "/org.openoffice.da.Writer2xhtml.Options/XhtmlOptions"; } /** Create a new XhtmlOptionsDialog */ public XhtmlOptionsDialog(XComponentContext xContext) { super(xContext); xMSF = W2XRegistration.xMultiServiceFactory; } /** Load settings from the registry to the dialog */ protected void loadSettings(XPropertySet xProps) { // Style loadConfig(xProps); loadCheckBoxOption(xProps, "ConvertToPx"); int nScaling = loadNumericOption(xProps, "Scaling"); if (nScaling<=1) { // Workaround for an obscure bug in the extension manager setNumericFieldValue("Scaling",100); } int nColumnScaling = loadNumericOption(xProps, "ColumnScaling"); if (nColumnScaling<=1) { setNumericFieldValue("ColumnScaling",100); } loadCheckBoxOption(xProps, "OriginalImageSize"); // Special content loadCheckBoxOption(xProps, "Notes"); loadCheckBoxOption(xProps, "UseDublinCore"); // AutoCorrect loadCheckBoxOption(xProps, "IgnoreHardLineBreaks"); loadCheckBoxOption(xProps, "IgnoreEmptyParagraphs"); loadCheckBoxOption(xProps, "IgnoreDoubleSpaces"); // Files loadCheckBoxOption(xProps, "Split"); loadListBoxOption(xProps, "SplitLevel"); loadListBoxOption(xProps, "RepeatLevels"); loadCheckBoxOption(xProps, "SaveImagesInSubdir"); loadCheckBoxOption(xProps, "UseMathjax"); updateLockedOptions(); enableControls(); } /** Save settings from the dialog to the registry and create FilterData */ protected void saveSettings(XPropertySet xProps, PropertyHelper helper) { // Style short nConfig = saveConfig(xProps, helper); String[] sCoreStyles = { "Chocolate", "Midnight", "Modernist", "Oldstyle", "Steely", "Swiss", "Traditional", "Ultramarine" }; switch (nConfig) { case 0: helper.put("ConfigURL","*default.xml"); break; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: helper.put("ConfigURL","*cleanxhtml.xml"); helper.put("custom_stylesheet", "http://www.w3.org/StyleSheets/Core/"+sCoreStyles[nConfig-1]); break; case 9: helper.put("ConfigURL","$(user)/writer2xhtml.xml"); helper.put("AutoCreate","true"); helper.put("TemplateURL", "$(user)/writer2xhtml-template.xhtml"); helper.put("StyleSheetURL", "$(user)/writer2xhtml-styles.css"); } saveCheckBoxOption(xProps, helper, "ConvertToPx", "convert_to_px"); saveNumericOptionAsPercentage(xProps, helper, "Scaling", "scaling"); saveNumericOptionAsPercentage(xProps, helper, "ColumnScaling", "column_scaling"); saveCheckBoxOption(xProps, "OriginalImageSize"); // TODO: Support "relative" helper.put("image_size", getCheckBoxStateAsBoolean("OriginalImageSize") ? "none" : "absolute"); // Special content saveCheckBoxOption(xProps, helper, "Notes", "notes"); saveCheckBoxOption(xProps, helper, "UseDublinCore", "use_dublin_core"); // AutoCorrect saveCheckBoxOption(xProps, helper, "IgnoreHardLineBreaks", "ignore_hard_line_breaks"); saveCheckBoxOption(xProps, helper, "IgnoreEmptyParagraphs", "ignore_empty_paragraphs"); saveCheckBoxOption(xProps, helper, "IgnoreDoubleSpaces", "ignore_double_spaces"); // Files boolean bSplit = saveCheckBoxOption(xProps, "Split"); short nSplitLevel = saveListBoxOption(xProps, "SplitLevel"); short nRepeatLevels = saveListBoxOption(xProps, "RepeatLevels"); if (!isLocked("split_level")) { if (bSplit) { helper.put("split_level",Integer.toString(nSplitLevel+1)); helper.put("repeat_levels",Integer.toString(nRepeatLevels)); } else { helper.put("split_level","0"); } } saveCheckBoxOption(xProps, helper, "SaveImagesInSubdir", "save_images_in_subdir"); saveCheckBoxOption(xProps, helper, "UseMathjax", "use_mathjax"); } // Implement XDialogEventHandler public boolean callHandlerMethod(XDialog xDialog, Object event, String sMethod) { if (sMethod.equals("ConfigChange")) { updateLockedOptions(); enableControls(); } else if (sMethod.equals("SplitChange")) { enableSplitLevel(); } return true; } public String[] getSupportedMethodNames() { String[] sNames = { "ConfigChange", "SplitChange" }; return sNames; } private void enableControls() { // Style setControlEnabled("ScalingLabel",!isLocked("scaling")); setControlEnabled("Scaling",!isLocked("scaling")); setControlEnabled("ColumnScalingLabel",!isLocked("column_scaling")); setControlEnabled("ColumnScaling",!isLocked("column_scaling")); setControlEnabled("ConvertToPx",!isLocked("convert_to_px")); setControlEnabled("OriginalImageSize",!isLocked("image_size") && !isLocked("original_image_size")); // Special content setControlEnabled("Notes",!isLocked("notes")); setControlEnabled("UseDublinCore",!isLocked("use_dublin_core")); // AutoCorrect setControlEnabled("IgnoreHardLineBreaks",!isLocked("ignore_hard_line_breaks")); setControlEnabled("IgnoreEmptyParagraphs",!isLocked("ignore_empty_paragraphs")); setControlEnabled("IgnoreDoubleSpaces",!isLocked("ignore_double_spaces")); // Files boolean bSplit = getCheckBoxStateAsBoolean("Split"); setControlEnabled("Split",!isLocked("split_level")); setControlEnabled("SplitLevelLabel",!isLocked("split_level") && bSplit); setControlEnabled("SplitLevel",!isLocked("split_level") && bSplit); setControlEnabled("RepeatLevelsLabel",!isLocked("repeat_levels") && !isLocked("split_level") && bSplit); setControlEnabled("RepeatLevels",!isLocked("repeat_levels") && !isLocked("split_level") && bSplit); setControlEnabled("SaveImagesInSubdir",!isLocked("save_images_in_subdir")); setControlEnabled("UseMathjax",(this instanceof XhtmlOptionsDialogMath) && !isLocked("use_mathjax")); } private void enableSplitLevel() { if (!isLocked("split_level")) { boolean bState = getCheckBoxStateAsBoolean("Split"); setControlEnabled("SplitLevelLabel",bState); setControlEnabled("SplitLevel",bState); if (!isLocked("repeat_levels")) { setControlEnabled("RepeatLevelsLabel",bState); setControlEnabled("RepeatLevels",bState); } } } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/W2XExportFilter.java0000644000175000017500000000335111251136744027441 0ustar renerene/************************************************************************ * * W2XExportFilter.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2009 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2009-09-06) * */ package org.openoffice.da.comp.writer2xhtml; import com.sun.star.uno.XComponentContext; import org.openoffice.da.comp.w2lcommon.filter.ExportFilterBase; /** This class implements the xhtml export filter component */ public class W2XExportFilter extends ExportFilterBase { /** Service name for the component */ public static final String __serviceName = "org.openoffice.da.comp.writer2xhtml.W2XExportFilter"; /** Implementation name for the component */ public static final String __implementationName = "org.openoffice.da.comp.writer2xhtml.W2XExportFilter"; /** Filter name to include in error messages */ public final String __displayName = "Writer2xhtml"; public W2XExportFilter(XComponentContext xComponentContext1) { super(xComponentContext1); xMSF = W2XRegistration.xMultiServiceFactory; } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/XhtmlOptionsDialogCalc.java0000644000175000017500000001615512411277733031035 0ustar renerene/************************************************************************ * * XhtmlOptionsDialogCalc.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-25) * */ package org.openoffice.da.comp.writer2xhtml; import com.sun.star.awt.XDialog; import com.sun.star.beans.XPropertySet; import com.sun.star.uno.XComponentContext; import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper; import org.openoffice.da.comp.w2lcommon.filter.OptionsDialogBase; /** This class provides a uno component which implements a filter ui for the * Xhtml export in Calc */ public class XhtmlOptionsDialogCalc extends OptionsDialogBase { /** The component will be registered under this name. */ public static String __serviceName = "org.openoffice.da.writerxhtml.XhtmlOptionsDialogCalc"; /** The component should also have an implementation name. */ public static String __implementationName = "org.openoffice.da.comp.writer2xhtml.XhtmlOptionsDialogCalc"; public String getDialogLibraryName() { return "W2XDialogs"; } /** Return the name of the dialog within the library */ public String getDialogName() { return "XhtmlOptionsCalc"; } /** Return the name of the registry path */ public String getRegistryPath() { return "/org.openoffice.da.Writer2xhtml.Options/XhtmlOptionsCalc"; } /** Create a new XhtmlOptionsDialogCalc */ public XhtmlOptionsDialogCalc(XComponentContext xContext) { super(xContext); xMSF = W2XRegistration.xMultiServiceFactory; } /** Load settings from the registry to the dialog */ protected void loadSettings(XPropertySet xProps) { // Style loadConfig(xProps); loadCheckBoxOption(xProps, "ConvertToPx"); int nScaling = loadNumericOption(xProps, "Scaling"); if (nScaling<=1) { // Workaround for an obscure bug in the extension manager setNumericFieldValue("Scaling",100); } int nColumnScaling = loadNumericOption(xProps, "ColumnScaling"); if (nColumnScaling<=1) { setNumericFieldValue("ColumnScaling",100); } loadCheckBoxOption(xProps, "OriginalImageSize"); // Special content loadCheckBoxOption(xProps, "Notes"); loadCheckBoxOption(xProps, "UseDublinCore"); // Sheets loadCheckBoxOption(xProps, "DisplayHiddenSheets"); loadCheckBoxOption(xProps, "DisplayHiddenRowsCols"); loadCheckBoxOption(xProps, "DisplayFilteredRowsCols"); loadCheckBoxOption(xProps, "ApplyPrintRanges"); loadCheckBoxOption(xProps, "UseTitleAsHeading"); loadCheckBoxOption(xProps, "UseSheetNamesAsHeadings"); // Files loadCheckBoxOption(xProps, "CalcSplit"); loadCheckBoxOption(xProps, "SaveImagesInSubdir"); updateLockedOptions(); enableControls(); } /** Save settings from the dialog to the registry and create FilterData */ protected void saveSettings(XPropertySet xProps, PropertyHelper helper) { // Style short nConfig = saveConfig(xProps, helper); if (nConfig==0) { helper.put("ConfigURL","*default.xml"); } else if (nConfig==1) { helper.put("ConfigURL","$(user)/writer2xhtml.xml"); helper.put("AutoCreate","true"); } saveCheckBoxOption(xProps, helper, "ConvertToPx", "convert_to_px"); saveNumericOptionAsPercentage(xProps, helper, "Scaling", "scaling"); saveNumericOptionAsPercentage(xProps, helper, "ColumnScaling", "column_scaling"); saveCheckBoxOption(xProps, "OriginalImageSize"); // TODO: Support "relative" helper.put("image_size", getCheckBoxStateAsBoolean("OriginalImageSize") ? "none" : "absolute"); // Special content saveCheckBoxOption(xProps, helper, "Notes", "notes"); saveCheckBoxOption(xProps, helper, "UseDublinCore", "use_dublin_core"); // Sheets saveCheckBoxOption(xProps, helper, "DisplayHiddenSheets", "display_hidden_sheets"); saveCheckBoxOption(xProps, helper, "DisplayHiddenRowsCols", "display_hidden_rows_cols"); saveCheckBoxOption(xProps, helper, "DisplayFilteredRowsCols", "display_filtered_rows_cols"); saveCheckBoxOption(xProps, helper, "ApplyPrintRanges", "apply_print_ranges"); saveCheckBoxOption(xProps, helper, "UseTitleAsHeading", "use_title_as_heading"); saveCheckBoxOption(xProps, helper, "UseSheetNamesAsHeadings", "use_sheet_names_as_headings"); // Files saveCheckBoxOption(xProps, helper, "CalcSplit", "calc_split"); saveCheckBoxOption(xProps, helper, "SaveImagesInSubdir", "save_images_in_subdir"); } // Implement XDialogEventHandler public boolean callHandlerMethod(XDialog xDialog, Object event, String sMethod) { if (sMethod.equals("ConfigChange")) { updateLockedOptions(); enableControls(); } return true; } public String[] getSupportedMethodNames() { String[] sNames = { "ConfigChange" }; return sNames; } private void enableControls() { // Style setControlEnabled("ConvertToPx",!isLocked("convert_to_px")); setControlEnabled("ScalingLabel",!isLocked("scaling")); setControlEnabled("Scaling",!isLocked("scaling")); setControlEnabled("ColumnScalingLabel",!isLocked("column_scaling")); setControlEnabled("ColumnScaling",!isLocked("column_scaling")); setControlEnabled("OriginalImageSize",!isLocked("image_size") && !isLocked("original_image_size")); // Special content setControlEnabled("Notes",!isLocked("notes")); setControlEnabled("UseDublinCore",!isLocked("use_dublin_core")); // Sheets setControlEnabled("DisplayHiddenSheets", !isLocked("display_hidden_sheets")); setControlEnabled("DisplayHiddenRowsCols", !isLocked("display_hidden_rows_cols")); setControlEnabled("DisplayFilteredRowsCols", !isLocked("display_filtered_rows_cols")); setControlEnabled("ApplyPrintRanges", !isLocked("apply_print_ranges")); setControlEnabled("UseTitleAsHeading", !isLocked("use_title_as_heading")); setControlEnabled("UseSheetNamesAsHeadings", !isLocked("use_sheet_names_as_headings")); // Files setControlEnabled("CalcSplit",!isLocked("calc_split")); setControlEnabled("SaveImagesInSubdir",!isLocked("save_images_in_subdir")); } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2xhtml/EpubMetadataDialog.java0000644000175000017500000006041112411031012030102 0ustar renerene/************************************************************************ * * EpubMetadataDialog.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2011 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2011-07-20) * */ package org.openoffice.da.comp.writer2xhtml; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.HashMap; import java.util.HashSet; import java.util.Vector; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.openoffice.da.comp.w2lcommon.helper.DialogBase; import org.openoffice.da.comp.w2lcommon.helper.SimpleDialog; import writer2latex.util.CSVList; import writer2latex.util.Misc; import com.sun.star.awt.XDialog; import com.sun.star.beans.IllegalTypeException; import com.sun.star.beans.NotRemoveableException; import com.sun.star.beans.Property; import com.sun.star.beans.PropertyExistException; import com.sun.star.beans.PropertyVetoException; import com.sun.star.beans.UnknownPropertyException; import com.sun.star.beans.XPropertyContainer; import com.sun.star.beans.XPropertySet; import com.sun.star.document.XDocumentProperties; import com.sun.star.document.XDocumentPropertiesSupplier; import com.sun.star.frame.XDesktop; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lang.WrappedTargetException; import com.sun.star.lang.XComponent; import com.sun.star.ui.dialogs.ExecutableDialogResults; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.util.DateTime; // TODO: Create the UNO helper class DocumentPropertiesAccess /** This class provides a UNO component which implements a custom metadata editor UI for the EPUB export */ public class EpubMetadataDialog extends DialogBase { // Author data private class AuthorInfo { String sName = ""; boolean isCreator = true; String sRole = ""; } // Date data private class DateInfo { int nDate = 0; String sEvent = ""; } // All the user defined properties we handle private static final String IDENTIFIER="Identifier"; private static final String CREATOR="Creator"; private static final String CONTRIBUTOR="Contributor"; private static final String DATE="Date"; private static final String PUBLISHER="Publisher"; private static final String TYPE="Type"; private static final String FORMAT="Format"; private static final String SOURCE="Source"; private static final String RELATION="Relation"; private static final String COVERAGE="Coverage"; private static final String RIGHTS="Rights"; private static final String[] sRoles = {"", "adp", "ann", "arr", "art", "asn", "aut", "aqt", "aft", "aui", "ant", "bkp", "clb", "cmm", "dsr", "edt", "ill", "lyr", "mdc", "mus", "nrt", "oth", "pht", "prt", "red", "rev", "spn", "ths", "trc", "trl"}; private static HashMap backRoles; static { backRoles = new HashMap(); int nCount = sRoles.length; for (short i=0; i authors = new Vector(); private Vector dates = new Vector(); // Number formatter private NumberFormat formatter = new DecimalFormat("00"); // Pattern matcher for dates Pattern datePattern = Pattern.compile("(\\d{4})-(\\d{2})-(\\d{2})"); public EpubMetadataDialog(XComponentContext xContext) { super(xContext); } /** The component will be registered under this name. */ public static String __serviceName = "org.openoffice.da.writer2xhtml.EpubMetadataDialog"; /** The component should also have an implementation name. */ public static String __implementationName = "org.openoffice.da.comp.writer2xhtml.EpubMetadataDialog"; // -------------------------------------------------- // Ensure that the super can find us :-) @Override public String getDialogLibraryName() { return "W2XDialogs2"; } @Override public String getDialogName() { return "EpubMetadata"; } // -------------------------------------------------- // Implement the interface XDialogEventHandler @Override public boolean callHandlerMethod(XDialog xDialog, Object event, String sMethod) { if (sMethod.equals("UseCustomIdentifierChange")) { return useCustomIdentifierChange(); } else if (sMethod.equals("AuthorAddClick")) { return authorAddclick(); } else if (sMethod.equals("AuthorModifyClick")) { return authorModifyclick(); } else if (sMethod.equals("AuthorDeleteClick")) { return authorDeleteclick(); } else if (sMethod.equals("AuthorUpClick")) { return authorUpclick(); } else if (sMethod.equals("AuthorDownClick")) { return authorDownclick(); } else if (sMethod.equals("DateAddClick")) { return dateAddClick(); } else if (sMethod.equals("DateModifyClick")) { return dateModifyClick(); } else if (sMethod.equals("DateDeleteClick")) { return dateDeleteClick(); } else if (sMethod.equals("DateUpClick")) { return dateUpClick(); } else if (sMethod.equals("DateDownClick")) { return dateDownClick(); } return false; } @Override public String[] getSupportedMethodNames() { String[] sNames = { "UseCustomIdentifierChange", "AuthorAddClick", "AuthorModifyClick", "AuthorDeleteClick", "AuthorUpClick", "AuthorDownClick", "DataAddClick", "DateModifyClick", "DateDeleteClick", "DateUpClick", "DateDownClick"}; return sNames; } private boolean useCustomIdentifierChange() { boolean bEnabled = getCheckBoxStateAsBoolean("UseCustomIdentifier"); setControlEnabled("IdentifierLabel",bEnabled); setControlEnabled("Identifier",bEnabled); setControlEnabled("IdentifierTypeLabel",bEnabled); setControlEnabled("IdentifierType",bEnabled); return true; } private boolean authorAddclick() { SimpleDialog dialog = new SimpleDialog(xContext,"W2XDialogs2.AuthorDialog"); if (dialog.getDialog()!=null) { dialog.getControls().setListBoxSelectedItem("Type", (short) 0); dialog.getControls().setListBoxSelectedItem("Role", (short) 0); if (dialog.getDialog().execute()==ExecutableDialogResults.OK) { AuthorInfo author = new AuthorInfo(); author.sName = dialog.getControls().getTextFieldText("Author"); author.sRole = sRoles[dialog.getControls().getListBoxSelectedItem("Role")]; author.isCreator = dialog.getControls().getListBoxSelectedItem("Type")==0; authors.add(author); updateAuthorList((short) (authors.size()-1)); } dialog.getDialog().endExecute(); } return true; } private boolean authorModifyclick() { short nIndex = getListBoxSelectedItem("Authors"); AuthorInfo author = authors.get(nIndex); SimpleDialog dialog = new SimpleDialog(xContext,"W2XDialogs2.AuthorDialog"); if (dialog.getDialog()!=null) { dialog.getControls().setTextFieldText("Author", author.sName); dialog.getControls().setListBoxSelectedItem("Type", author.isCreator ? (short)0 : (short) 1); dialog.getControls().setListBoxSelectedItem("Role", backRoles.containsKey(author.sRole)? backRoles.get(author.sRole) : (short)0); if (dialog.getDialog().execute()==ExecutableDialogResults.OK) { author.sName = dialog.getControls().getTextFieldText("Author"); author.sRole = sRoles[dialog.getControls().getListBoxSelectedItem("Role")]; author.isCreator = dialog.getControls().getListBoxSelectedItem("Type")==0; updateAuthorList(nIndex); } dialog.getDialog().endExecute(); } return true; } private boolean authorDeleteclick() { if (authors.size()>0) { SimpleDialog dialog = new SimpleDialog(xContext,"W2XDialogs2.DeleteDialog"); if (dialog.getDialog()!=null) { short nIndex = getListBoxSelectedItem("Authors"); String sLabel = dialog.getControls().getLabelText("DeleteLabel"); sLabel = sLabel.replaceAll("%s", authors.get(nIndex).sName); dialog.getControls().setLabelText("DeleteLabel", sLabel); if (dialog.getDialog().execute()==ExecutableDialogResults.OK) { authors.remove(nIndex); updateAuthorList(nIndex0) { AuthorInfo author = authors.get(nIndex); authors.set(nIndex, authors.get(nIndex-1)); authors.set(nIndex-1, author); updateAuthorList((short) (nIndex-1)); } return true; } private boolean authorDownclick() { short nIndex = getListBoxSelectedItem("Authors"); if (nIndex+10) { SimpleDialog dialog = new SimpleDialog(xContext,"W2XDialogs2.DeleteDialog"); if (dialog.getDialog()!=null) { short nIndex = getListBoxSelectedItem("Dates"); String sLabel = dialog.getControls().getLabelText("DeleteLabel"); sLabel = sLabel.replaceAll("%s", formatDate(dates.get(nIndex).nDate)); dialog.getControls().setLabelText("DeleteLabel", sLabel); if (dialog.getDialog().execute()==ExecutableDialogResults.OK) { dates.remove(nIndex); updateDateList(nIndex0) { DateInfo date = dates.get(nIndex); dates.set(nIndex, dates.get(nIndex-1)); dates.set(nIndex-1, date); updateDateList((short) (nIndex-1)); } return true; } private boolean dateDownClick() { short nIndex = getListBoxSelectedItem("Dates"); if (nIndex+10); useCustomIdentifierChange(); if (sIdentifiers.length>0) { // Use the first if we have several... setTextFieldText("Identifier",getStringValue(sIdentifiers[0])); setTextFieldText("IdentifierType",getSuffix(sIdentifiers[0])); } // Get the authors and set the list box String[] sCreators = getProperties(CREATOR,false); for (String sCreator : sCreators) { AuthorInfo creator = new AuthorInfo(); creator.sName = getStringValue(sCreator); creator.sRole = getSuffix(sCreator); creator.isCreator = true; authors.add(creator); } String[] sContributors = getProperties(CONTRIBUTOR,false); for (String sContributor : sContributors) { AuthorInfo contributor = new AuthorInfo(); contributor.sName = getStringValue(sContributor); contributor.sRole = getSuffix(sContributor); contributor.isCreator = false; authors.add(contributor); } updateAuthorList((short) 0); // Get the dates and set the list box String[] sDates = getProperties(DATE,false); for (String sDate : sDates) { DateInfo date = new DateInfo(); DateTime dt = getDateValue(sDate); if (dt!=null) { // We accept either a date date.nDate = datetime2int(dt); } else { // Or a string in the form yyyy-mm-dd date.nDate = parseDate(getStringValue(sDate)); } date.sEvent = getSuffix(sDate); dates.add(date); } updateDateList((short) 0); // Get the standard properties and set the text fields setTextFieldText("Title",xDocumentProperties.getTitle()); setTextFieldText("Subject",xDocumentProperties.getSubject()); String[] sKeywords = xDocumentProperties.getKeywords(); CSVList keywords = new CSVList(", "); for (String sKeyword : sKeywords) { keywords.addValue(sKeyword); } setTextFieldText("Keywords",keywords.toString()); setTextFieldText("Description",xDocumentProperties.getDescription()); // Get the simple user properties and set the text fields readSimpleProperty(PUBLISHER); readSimpleProperty(TYPE); readSimpleProperty(FORMAT); readSimpleProperty(SOURCE); readSimpleProperty(RELATION); readSimpleProperty(COVERAGE); readSimpleProperty(RIGHTS); } @Override protected void endDialog() { // Set the custom identifier from the text fields String[] sIdentifiers = getProperties(IDENTIFIER,false); for (String sIdentifier : sIdentifiers) { // Remove old identifier(s) removeProperty(sIdentifier); } if (getCheckBoxStateAsBoolean("UseCustomIdentifier")) { String sName = IDENTIFIER; if (getTextFieldText("IdentifierType").trim().length()>0) { sName+="."+getTextFieldText("IdentifierType").trim(); } addProperty(sName); setValue(sName,getTextFieldText("Identifier")); } // Set the authors from the list box String[] sCreators = getProperties(CREATOR,false); for (String sCreator : sCreators) { // remove old creators removeProperty(sCreator); } String[] sContributors = getProperties(CONTRIBUTOR,false); for (String sContributor : sContributors) { // remove old contributors removeProperty(sContributor); } int i=0; for (AuthorInfo author : authors) { String sName = (author.isCreator ? CREATOR : CONTRIBUTOR)+formatter.format(++i); if (author.sRole.length()>0) { sName+="."+author.sRole; } addProperty(sName); setValue(sName,author.sName); } // Set the dates from the list box String[] sDates = getProperties(DATE,false); for (String sDate : sDates) { // remove old dates removeProperty(sDate); } i=0; for (DateInfo date : dates) { String sName = DATE+formatter.format(++i); if (date.sEvent.length()>0) { sName+="."+date.sEvent; } addProperty(sName); setValue(sName,formatDate(date.nDate)); // Doesn't work (why not?) //setValue(sName,int2datetime(date.nDate)); } // Set the standard properties from the text fields xDocumentProperties.setTitle(getTextFieldText("Title")); xDocumentProperties.setSubject(getTextFieldText("Subject")); String[] sKeywords = getTextFieldText("Keywords").split(","); for (int j=0; j-1 ? sPropertyName.substring(nDot+1) : ""; } // Get all currently defined user properties with a specific name or prefix private String[] getProperties(String sPrefix, boolean bComplete) { HashSet names = new HashSet(); Property[] xProps = xUserPropertySet.getPropertySetInfo().getProperties(); for (Property prop : xProps) { String sName = prop.Name; String sLCName = sName.toLowerCase(); String sLCPrefix = sPrefix.toLowerCase(); if ((bComplete && sLCName.equals(sLCPrefix)) || (!bComplete && sLCName.startsWith(sLCPrefix))) { names.add(sName); } } return Misc.sortStringSet(names); } // Add a user property private void addProperty(String sName) { try { xUserProperties.addProperty(sName, (short) 128, ""); // 128 means removeable, last parameter is default value } catch (PropertyExistException e) { } catch (IllegalTypeException e) { } catch (IllegalArgumentException e) { } } // Delete a user property private void removeProperty(String sName) { try { xUserProperties.removeProperty(sName); } catch (UnknownPropertyException e) { } catch (NotRemoveableException e) { } } // Set the value of a user property (failing silently if the property does not exist) private void setValue(String sName, Object value) { try { xUserPropertySet.setPropertyValue(sName, value); } catch (UnknownPropertyException e) { } catch (PropertyVetoException e) { } catch (IllegalArgumentException e) { } catch (WrappedTargetException e) { } } // Get the string value of a user property (returning null if the property does not exist) private String getStringValue(String sName) { Object value = getValue(sName); if (value!=null && AnyConverter.isString(value)) { try { return AnyConverter.toString(value); } catch (IllegalArgumentException e) { return null; } } return null; } private DateTime getDateValue(String sName) { Object value = getValue(sName); if (value!=null && value instanceof DateTime) { return (DateTime) value; } return null; } // Get the value of a user property (returning null if the property does not exist) private Object getValue(String sName) { try { return xUserPropertySet.getPropertyValue(sName); } catch (UnknownPropertyException e) { return null; } catch (WrappedTargetException e) { return null; } } private void updateAuthorList(short nItem) { int nCount = authors.size(); if (nCount>0) { String[] sAuthors = new String[nCount]; for (int i=0; i0 ? ", "+author.sRole : "") +")"; } setListBoxStringItemList("Authors", sAuthors); setListBoxSelectedItem("Authors",nItem); setControlEnabled("Authors", true); } else { // Display the fall-back author String[] sAuthors = new String[1]; //sAuthors[0] = xDocumentProperties.getAuthor()+" (default creator)"; sAuthors[0] = xDocumentProperties.getModifiedBy()+" (default creator)"; setListBoxStringItemList("Authors", sAuthors); setControlEnabled("Authors", false); } setControlEnabled("ModifyAuthorButton",nCount>0); setControlEnabled("DeleteAuthorButton",nCount>0); setControlEnabled("AuthorUpButton",nCount>1); setControlEnabled("AuthorDownButton",nCount>1); } private void updateDateList(short nItem) { int nCount = dates.size(); if (nCount>0) { String[] sDates = new String[nCount]; for (int i=0; i0) { sDates[i]+=" (" + date.sEvent + ")"; } } setListBoxStringItemList("Dates", sDates); setListBoxSelectedItem("Dates",nItem); setControlEnabled("Dates", true); } else { // Display the fall-back date String[] sDates = new String[1]; sDates[0] = formatDate(datetime2int(xDocumentProperties.getModificationDate()))+" (default date)"; setListBoxStringItemList("Dates", sDates); setControlEnabled("Dates", false); } setControlEnabled("ModifyDateButton",nCount>0); setControlEnabled("DeleteDateButton",nCount>0); setControlEnabled("DateUpButton",nCount>1); setControlEnabled("DateDownButton",nCount>1); } private void readSimpleProperty(String sName) { String[] sNames = getProperties(sName,true); if (sNames.length>0) { String sValue = getStringValue(sNames[0]); if (sValue!=null) { setTextFieldText(sName, sValue); } } } private void writeSimpleProperty(String sName) { String[] sOldNames = getProperties(sName,true); for (String sOldName : sOldNames) { removeProperty(sOldName); } String sValue = getTextFieldText(sName); if (sValue.length()>0) { addProperty(sName); setValue(sName,sValue); } } // Date fields uses integers for dates (format yyyymmdd) // Document properties uses com.sun.star.util.DateTime // Also dates should be formatted as yyyy-mm-dd as strings // Thus we need a few conversion methods // Format a integer date as yyyy-mm-dd private String formatDate(int nDate) { String sDate = Integer.toString(nDate); if (sDate.length()==8) { return sDate.substring(0,4)+"-"+sDate.substring(4, 6)+"-"+sDate.substring(6); } else { return "???"; } } // Parse a string as a date in the format yyyy-mm-dd (returning 0 on failure) private int parseDate(String sDate) { Matcher matcher = datePattern.matcher(sDate); if (matcher.matches()) { return Misc.getPosInteger(matcher.group(1)+matcher.group(2)+matcher.group(3),0); } return 0; } // Convert an integer to com.sun.star.util.DateTime /*private DateTime int2datetime(int nDate) { DateTime date = new DateTime(); date.Year = (short) (nDate/10000); date.Month = (short) ((nDate%10000)/100); date.Day = (short) (nDate%100); return date; }*/ // Convert a com.sun.star.util.DateTime to integer private int datetime2int(DateTime date) { return 10000*date.Year+100*date.Month+date.Day; } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2latex/0000755000175000017500000000000012603463650023566 5ustar renerenewriter2latex-1.4/source/java/org/openoffice/da/comp/writer2latex/W2LStarMathConverter.java0000644000175000017500000000751411147474702030402 0ustar renerene/************************************************************************ * * W2LStarMathConverter.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2008 by Henrik Just * * All Rights Reserved. */ // Version 1.0 (2008-11-22) package org.openoffice.da.comp.writer2latex; import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XTypeProvider; import com.sun.star.uno.Type; //import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.lang.XServiceName; import writer2latex.api.ConverterFactory; import writer2latex.api.StarMathConverter; // Import interface as defined in uno idl import org.openoffice.da.writer2latex.XW2LStarMathConverter; /** This class provides a uno component which implements the interface * org.openoffice.da.writer2latex.XW2LConverter */ public class W2LStarMathConverter implements XW2LStarMathConverter, XServiceName, XServiceInfo, XTypeProvider { /** The component will be registered under this name. */ public static final String __serviceName = "org.openoffice.da.writer2latex.W2LStarMathConverter"; public static final String __implementationName = "org.openoffice.da.comp.writer2latex.W2LStarMathConverter"; //private static XComponentContext xComponentContext = null; private static StarMathConverter starMathConverter; public W2LStarMathConverter(XComponentContext xComponentContext1) { starMathConverter = ConverterFactory.createStarMathConverter(); } // Implementation of XW2LConverter: public String convertFormula(String sStarMathFormula) { return starMathConverter.convert(sStarMathFormula); } public String getPreamble() { return starMathConverter.getPreamble(); } // Implement methods from interface XTypeProvider // Implementation of XTypeProvider public com.sun.star.uno.Type[] getTypes() { Type[] typeReturn = {}; try { typeReturn = new Type[] { new Type( XW2LStarMathConverter.class ), new Type( XTypeProvider.class ), new Type( XServiceName.class ), new Type( XServiceInfo.class ) }; } catch( Exception exception ) { } return( typeReturn ); } public byte[] getImplementationId() { byte[] byteReturn = {}; byteReturn = new String( "" + this.hashCode() ).getBytes(); return( byteReturn ); } // Implement method from interface XServiceName public String getServiceName() { return( __serviceName ); } // Implement methods from interface XServiceInfo public boolean supportsService(String stringServiceName) { return( stringServiceName.equals( __serviceName ) ); } public String getImplementationName() { return( __implementationName ); } public String[] getSupportedServiceNames() { String[] stringSupportedServiceNames = { __serviceName }; return( stringSupportedServiceNames ); } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2latex/ConfigurationDialog.java0000644000175000017500000012341012406234417030357 0ustar renerene/************************************************************************ * * ConfigurationDialog.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-16) * */ package org.openoffice.da.comp.writer2latex; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import writer2latex.api.ComplexOption; import writer2latex.util.Misc; import org.openoffice.da.comp.w2lcommon.filter.ConfigurationDialogBase; import org.openoffice.da.comp.w2lcommon.helper.DialogAccess; import org.openoffice.da.comp.w2lcommon.helper.FieldMasterNameProvider; import org.openoffice.da.comp.w2lcommon.helper.StyleNameProvider; import com.sun.star.lang.XServiceInfo; import com.sun.star.uno.XComponentContext; /** This class provides a UNO component which implements the configuration * of Writer2LaTeX. The same component is used for all pages - using the * dialog title to distinguish between the pages. */ public final class ConfigurationDialog extends ConfigurationDialogBase implements XServiceInfo { /** The component will be registered under this name. */ public static String __serviceName = "org.openoffice.da.writer2latex.ConfigurationDialog"; /** The component should also have an implementation name. */ public static String __implementationName = "org.openoffice.da.comp.writer2latex.ConfigurationDialog"; // Implement the interface XServiceInfo public boolean supportsService(String sServiceName) { return sServiceName.equals(__serviceName); } public String getImplementationName() { return __implementationName; } public String[] getSupportedServiceNames() { String[] sSupportedServiceNames = { __serviceName }; return sSupportedServiceNames; } // Configure the base class @Override protected String getMIMEType() { return "application/x-latex"; } @Override protected String getDialogLibraryName() { return "W2LDialogs2"; } @Override protected String getConfigFileName() { return "writer2latex.xml"; } /** Construct a new ConfigurationDialog */ public ConfigurationDialog(XComponentContext xContext) { super(xContext); pageHandlers.put("Documentclass", new DocumentclassHandler()); pageHandlers.put("Headings", new HeadingsHandler()); pageHandlers.put("Styles", new StylesHandler()); pageHandlers.put("Characters", new CharactersHandler()); pageHandlers.put("Fonts", new FontsHandler()); pageHandlers.put("Pages", new PagesHandler()); pageHandlers.put("Tables", new TablesHandler()); pageHandlers.put("Figures", new FiguresHandler()); pageHandlers.put("TextAndMath", new TextAndMathHandler()); } // Implement remaining method from XContainerWindowEventHandler public String[] getSupportedMethodNames() { String[] sNames = { "NoPreambleChange", // Documentclass "MaxLevelChange", "WriterLevelChange", "NoIndexChange", // Headings "StyleFamilyChange", "StyleNameChange", "NewStyleClick", "DeleteStyleClick", "AddNextClick", "RemoveNextClick", "LoadDefaultsClick", // Styles "UseSoulChange", "FormattingAttributeChange", "CustomAttributeChange", // Characters "ExportGeometryChange", "ExportHeaderAndFooterChange", // Pages "NoTablesChange", "UseSupertabularChange", "UseLongtableChange", // Tables "NoImagesChange", // Figures "MathSymbolNameChange", "NewSymbolClick", "DeleteSymbolClick", "TextInputChange", "NewTextClick", "DeleteTextClick" // Text and Math }; return sNames; } // The page "Documentclass" // This page handles the options no_preamble, documentclass, global_options and the custom-preamble private class DocumentclassHandler extends PageHandler { @Override protected void setControls(DialogAccess dlg) { checkBoxFromConfig(dlg,"NoPreamble","no_preamble"); textFieldFromConfig(dlg,"Documentclass","documentclass"); textFieldFromConfig(dlg,"GlobalOptions","global_options"); textFieldFromConfig(dlg,"CustomPreamble","custom-preamble"); noPreambleChange(dlg); } @Override protected void getControls(DialogAccess dlg) { checkBoxToConfig(dlg,"NoPreamble", "no_preamble"); textFieldToConfig(dlg,"Documentclass","documentclass"); textFieldToConfig(dlg,"GlobalOptions","global_options"); textFieldToConfig(dlg,"CustomPreamble","custom-preamble"); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("NoPreambleChange")) { noPreambleChange(dlg); return true; } return false; } private void noPreambleChange(DialogAccess dlg) { boolean bPreamble = !dlg.getCheckBoxStateAsBoolean("NoPreamble"); dlg.setControlEnabled("DocumentclassLabel",bPreamble); dlg.setControlEnabled("Documentclass",bPreamble); dlg.setControlEnabled("GlobalOptionsLabel",bPreamble); dlg.setControlEnabled("GlobalOptions",bPreamble); dlg.setControlEnabled("CustomPreambleLabel",bPreamble); dlg.setControlEnabled("CustomPreamble",bPreamble); } } // The page "Headings" // This page handles the heading map as well as the options no_index, use_titlesec and use_titletoc private class HeadingsHandler extends PageHandler { ComplexOption headingMap = new ComplexOption(); // Cached heading map short nCurrentWriterLevel = -1; // Currently displayed level @Override protected void setControls(DialogAccess dlg) { // Load heading map from config headingMap.clear(); headingMap.copyAll(config.getComplexOption("heading-map")); nCurrentWriterLevel = -1; // Determine and set the max level (from 0 to 10) short nMaxLevel = 0; while(nMaxLevel<10 && headingMap.containsKey(Integer.toString(nMaxLevel+1))) { nMaxLevel++; } dlg.setListBoxSelectedItem("MaxLevel", nMaxLevel); maxLevelChange(dlg); // Get other controls from config checkBoxFromConfig(dlg,"UseTitlesec","use_titlesec"); checkBoxFromConfig(dlg,"NoIndex","no_index"); checkBoxFromConfig(dlg,"UseTitletoc","use_titletoc"); noIndexChange(dlg); } @Override protected void getControls(DialogAccess dlg) { updateHeadingMap(dlg); // Save heading map to config config.getComplexOption("heading-map").clear(); int nMaxLevel = dlg.getListBoxSelectedItem("MaxLevel"); for (int i=1; i<=nMaxLevel; i++) { String sLevel = Integer.toString(i); config.getComplexOption("heading-map").copy(sLevel,headingMap.get(sLevel)); } // Save other controls to config checkBoxToConfig(dlg,"UseTitlesec","use_titlesec"); checkBoxToConfig(dlg,"NoIndex","no_index"); checkBoxToConfig(dlg,"UseTitletoc","use_titletoc"); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("MaxLevelChange")) { maxLevelChange(dlg); return true; } else if (sMethod.equals("WriterLevelChange")) { writerLevelChange(dlg); return true; } else if (sMethod.equals("NoIndexChange")) { noIndexChange(dlg); return true; } return false; } private void maxLevelChange(DialogAccess dlg) { // Remember current writer level and clear it short nPreviousWriterLevel = nCurrentWriterLevel; dlg.setListBoxSelectedItem("WriterLevel", (short) -1); // Adjust the presented writer levels to the max level short nMaxLevel = dlg.getListBoxSelectedItem("MaxLevel"); String[] sWriterLevels = new String[nMaxLevel]; for (int i=0; i0) { short nNewWriterLevel; if (nPreviousWriterLevel+1>nMaxLevel) { // If we lower the max level, we may have to change the displayed Writer level nNewWriterLevel = (short)(nMaxLevel-1); } else if (nPreviousWriterLevel>-1){ // Otherwise reselect the current level, if any nNewWriterLevel = nPreviousWriterLevel; } else { // Or select the top level nNewWriterLevel = (short) 0; } dlg.setListBoxSelectedItem("WriterLevel", nNewWriterLevel); } writerLevelChange(dlg); // All controls should be disabled if the maximum level is zero boolean bUpdate = dlg.getListBoxSelectedItem("MaxLevel")>0; dlg.setControlEnabled("WriterLevelLabel", bUpdate); dlg.setControlEnabled("WriterLevel", bUpdate); dlg.setControlEnabled("LaTeXLevelLabel", bUpdate); dlg.setControlEnabled("LaTeXLevel", bUpdate); dlg.setControlEnabled("LaTeXNameLabel", bUpdate); dlg.setControlEnabled("LaTeXName", bUpdate); // Until implemented: dlg.setControlEnabled("UseTitlesec", false); //dlg.setControlEnabled("UseTitlesec", bUpdate); } private void writerLevelChange(DialogAccess dlg) { updateHeadingMap(dlg); // Load the values for the new level nCurrentWriterLevel = dlg.getListBoxSelectedItem("WriterLevel"); if (nCurrentWriterLevel>-1) { String sLevel = Integer.toString(nCurrentWriterLevel+1); if (headingMap.containsKey(sLevel)) { Map attr = headingMap.get(sLevel); dlg.setComboBoxText("LaTeXLevel", attr.containsKey("level") ? attr.get("level") : ""); dlg.setComboBoxText("LaTeXName", attr.containsKey("name") ? attr.get("name") : ""); } else { dlg.setListBoxSelectedItem("LaTeXLevel", (short)2); dlg.setComboBoxText("LaTeXName", ""); } } else { dlg.setComboBoxText("LaTeXLevel", ""); dlg.setComboBoxText("LaTeXName", ""); } } private void noIndexChange(DialogAccess dlg) { // Until implemented: dlg.setControlEnabled("UseTitletoc", false); //boolean bNoIndex = dlg.getCheckBoxStateAsBoolean("NoIndex"); //dlg.setControlEnabled("UseTitletoc", !bNoIndex); } private void updateHeadingMap(DialogAccess dlg) { // Save the current writer level in our cache if (nCurrentWriterLevel>-1) { Map attr = new HashMap(); attr.put("name", dlg.getComboBoxText("LaTeXName")); attr.put("level", dlg.getComboBoxText("LaTeXLevel")); headingMap.put(Integer.toString(nCurrentWriterLevel+1), attr); } } } // The page "Styles" // This page handles the various style maps as well as the options other_styles and formatting // Limitation: Cannot handle the values "error" and "warning" for other_styles private class StylesHandler extends StylesPageHandler { private final String[] sLaTeXFamilyNames = { "text", "paragraph", "paragraph-block", "list", "listitem" }; private final String[] sLaTeXOOoFamilyNames = { "CharacterStyles", "ParagraphStyles", "ParagraphStyles", "NumberingStyles", "NumberingStyles" }; protected StylesHandler() { super(5); sFamilyNames =sLaTeXFamilyNames; sOOoFamilyNames = sLaTeXOOoFamilyNames; } // Override standard PageHandler methods @Override public void setControls(DialogAccess dlg) { super.setControls(dlg); String sOtherStyles = config.getOption("other_styles"); if ("accept".equals(sOtherStyles)) { dlg.setListBoxSelectedItem("OtherStyles", (short)1); } else { dlg.setListBoxSelectedItem("OtherStyles", (short)0); } String sFormatting = config.getOption("formatting"); if ("ignore_all".equals(sFormatting)) { dlg.setListBoxSelectedItem("Formatting", (short)0); } else if ("ignore_most".equals(sFormatting)) { dlg.setListBoxSelectedItem("Formatting", (short)1); } else if ("convert_most".equals(sFormatting)) { dlg.setListBoxSelectedItem("Formatting", (short)3); } else if ("convert_all".equals(sFormatting)) { dlg.setListBoxSelectedItem("Formatting", (short)4); } else { dlg.setListBoxSelectedItem("Formatting", (short)2); } } @Override public void getControls(DialogAccess dlg) { super.getControls(dlg); switch (dlg.getListBoxSelectedItem("OtherStyles")) { case 0: config.setOption("other_styles", "ignore"); break; case 1: config.setOption("other_styles", "accept"); } switch (dlg.getListBoxSelectedItem("Formatting")) { case 0: config.setOption("formatting", "ignore_all"); break; case 1: config.setOption("formatting", "ignore_most"); break; case 2: config.setOption("formatting", "convert_basic"); break; case 3: config.setOption("formatting", "convert_most"); break; case 4: config.setOption("formatting", "convert_all"); } } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("AddNextClick")) { addNextClick(dlg); return true; } else if (sMethod.equals("RemoveNextClick")) { removeNextClick(dlg); return true; } return super.handleEvent(dlg, sMethod); } // Define methods required by super protected String getDefaultConfigName() { return "clean.xml"; } protected void setControls(DialogAccess dlg, Map attr) { // Always set before and after, and ensure they are defined if (!attr.containsKey("before")) { attr.put("before", ""); } if (!attr.containsKey("after")) { attr.put("after", ""); } dlg.setTextFieldText("Before", attr.get("before")); dlg.setTextFieldText("After", attr.get("after")); // Set next for paragraph block only String[] sNextItems; if (nCurrentFamily==2 && attr.containsKey("next") && attr.get("next").length()>0) { sNextItems = attr.get("next").split(";"); // Localize known styles Map displayNames = styleNameProvider.getDisplayNames(sOOoFamilyNames[nCurrentFamily]); int nLen = sNextItems.length; for (int i=0; i attr) { // Always get before and after attr.put("before", dlg.getTextFieldText("Before")); attr.put("after", dlg.getTextFieldText("After")); // Get next for paragraph block only if (nCurrentFamily==2) { String[] sNextItems = dlg.getListBoxStringItemList("Next"); // Internalize known styles Map internalNames = styleNameProvider.getInternalNames(sOOoFamilyNames[nCurrentFamily]); int nLen = sNextItems.length; for (int i=0; i0) list.append(';'); list.append(sNextItems[i]); } attr.put("next", list.toString()); } // Get verbatim for paragraph and character styles only if (nCurrentFamily<2) { attr.put("verbatim", Boolean.toString(dlg.getCheckBoxStateAsBoolean("Verbatim"))); } // Get line break for paragraph style only if (nCurrentFamily==1) { attr.put("line-break", Boolean.toString(dlg.getCheckBoxStateAsBoolean("LineBreak"))); } } protected void clearControls(DialogAccess dlg) { dlg.setTextFieldText("Before", ""); dlg.setTextFieldText("After", ""); dlg.setListBoxStringItemList("Next", new String[0]); dlg.setCheckBoxStateAsBoolean("Verbatim", false); dlg.setCheckBoxStateAsBoolean("LineBreak", false); } protected void prepareControls(DialogAccess dlg, boolean bHasMappings) { dlg.setControlEnabled("BeforeLabel", bHasMappings); dlg.setControlEnabled("Before", bHasMappings); dlg.setControlEnabled("AfterLabel", bHasMappings); dlg.setControlEnabled("After", bHasMappings); dlg.setControlEnabled("NextLabel", bHasMappings && nCurrentFamily==2); dlg.setControlEnabled("Next", bHasMappings && nCurrentFamily==2); dlg.setControlEnabled("AddNextButton", bHasMappings && nCurrentFamily==2); //dlg.setControlEnabled("RemoveNextButton", bHasMappings && nCurrentFamily==2); dlg.setControlEnabled("Verbatim", bHasMappings && nCurrentFamily<2); dlg.setControlEnabled("LineBreak", bHasMappings && nCurrentFamily==1); updateRemoveNextButton(dlg); } // Define own event handlers private void addNextClick(DialogAccess dlg) { appendItem(dlg, "Next",styleNameProvider.getInternalNames(sOOoFamilyNames[nCurrentFamily]).keySet()); updateRemoveNextButton(dlg); } private void removeNextClick(DialogAccess dlg) { deleteCurrentItem(dlg, "Next"); updateRemoveNextButton(dlg); } private void updateRemoveNextButton(DialogAccess dlg) { dlg.setControlEnabled("RemoveNextButton", dlg.getListBoxStringItemList("Next").length>0); } } // The page "Characters" // This page handles the options use_color, use_soul, use_ulem and use_hyperref // In addition it handles style maps for formatting attributes private class CharactersHandler extends AttributePageHandler { private final String[] sLaTeXAttributeNames = { "bold", "italic", "small-caps", "superscript", "subscript" }; protected CharactersHandler() { super(); sAttributeNames = sLaTeXAttributeNames; } @Override protected void setControls(DialogAccess dlg) { super.setControls(dlg); checkBoxFromConfig(dlg,"UseHyperref","use_hyperref"); checkBoxFromConfig(dlg,"UseColor","use_color"); checkBoxFromConfig(dlg,"UseSoul","use_soul"); checkBoxFromConfig(dlg,"UseUlem","use_ulem"); } @Override protected void getControls(DialogAccess dlg) { super.getControls(dlg); checkBoxToConfig(dlg,"UseHyperref","use_hyperref"); checkBoxToConfig(dlg,"UseColor","use_color"); checkBoxToConfig(dlg,"UseSoul","use_soul"); checkBoxToConfig(dlg,"UseUlem","use_ulem"); } @Override protected void setControls(DialogAccess dlg, Map attr) { if (!attr.containsKey("before")) { attr.put("before", ""); } if (!attr.containsKey("after")) { attr.put("after", ""); } dlg.setTextFieldText("Before", attr.get("before")); dlg.setTextFieldText("After", attr.get("after")); } @Override protected void getControls(DialogAccess dlg, Map attr) { attr.put("before", dlg.getComboBoxText("Before")); attr.put("after", dlg.getComboBoxText("After")); } @Override protected void prepareControls(DialogAccess dlg, boolean bEnable) { dlg.setControlEnabled("BeforeLabel", bEnable); dlg.setControlEnabled("Before", bEnable); dlg.setControlEnabled("AfterLabel", bEnable); dlg.setControlEnabled("After", bEnable); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("UseSoulChange")) { useSoulChange(dlg); return true; } else { return super.handleEvent(dlg, sMethod); } } private void useSoulChange(DialogAccess dlg) { // Until implemented... dlg.setControlEnabled("UseSoul", false); // After which it should be... //boolean bUseSoul = dlg.getCheckBoxStateAsBoolean("UseSoul"); //dlg.setControlEnabled("UseUlem", !bUseSoul); } } // The page "Fonts" // This page handles the options use_fontspec, use_pifont, use_tipa, use_eurosym, use_wasysym, // use_ifsym, use_bbding private class FontsHandler extends PageHandler { @Override protected void setControls(DialogAccess dlg) { checkBoxFromConfig(dlg,"UsePifont","use_pifont"); checkBoxFromConfig(dlg,"UseTipa","use_tipa"); checkBoxFromConfig(dlg,"UseEurosym","use_eurosym"); checkBoxFromConfig(dlg,"UseWasysym","use_wasysym"); checkBoxFromConfig(dlg,"UseIfsym","use_ifsym"); checkBoxFromConfig(dlg,"UseBbding","use_bbding"); checkBoxFromConfig(dlg,"UseFontspec","use_fontspec"); // Until implemented: dlg.setControlEnabled("UseFontspec", false); } @Override protected void getControls(DialogAccess dlg) { checkBoxToConfig(dlg,"UsePifont","use_pifont"); checkBoxToConfig(dlg,"UseTipa","use_tipa"); checkBoxToConfig(dlg,"UseEurosym","use_eurosym"); checkBoxToConfig(dlg,"UseWasysym","use_wasysym"); checkBoxToConfig(dlg,"UseIfsym","use_ifsym"); checkBoxToConfig(dlg,"UseBbding","use_bbding"); checkBoxToConfig(dlg,"UseFontspec","use_fontspec"); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { // Currently no events return false; } } // The page "Pages" // This page handles the options page_formatting, use_geometry, use_fancyhdr, use_lastpage and use_endnotes private class PagesHandler extends PageHandler { @Override protected void setControls(DialogAccess dlg) { // The option page_formatting is presented as two options in the user interface String sPageFormatting = config.getOption("page_formatting"); if ("ignore_all".equals(sPageFormatting)) { dlg.setCheckBoxStateAsBoolean("ExportGeometry", false); dlg.setCheckBoxStateAsBoolean("ExportHeaderFooter", false); } else if ("convert_geometry".equals(sPageFormatting)) { dlg.setCheckBoxStateAsBoolean("ExportGeometry", true); dlg.setCheckBoxStateAsBoolean("ExportHeaderFooter", false); } else if ("convert_header_footer".equals(sPageFormatting)) { dlg.setCheckBoxStateAsBoolean("ExportGeometry", false); dlg.setCheckBoxStateAsBoolean("ExportHeaderFooter", true); } else if ("convert_all".equals(sPageFormatting)) { dlg.setCheckBoxStateAsBoolean("ExportGeometry", true); dlg.setCheckBoxStateAsBoolean("ExportHeaderFooter", true); } checkBoxFromConfig(dlg,"UseGeometry", "use_geometry"); checkBoxFromConfig(dlg,"UseFancyhdr", "use_fancyhdr"); checkBoxFromConfig(dlg,"UseLastpage", "use_lastpage"); checkBoxFromConfig(dlg,"UseEndnotes", "use_endnotes"); // Trigger change events exportGeometryChange(dlg); exportHeaderAndFooterChange(dlg); } @Override protected void getControls(DialogAccess dlg) { boolean bGeometry = dlg.getCheckBoxStateAsBoolean("ExportGeometry"); boolean bHeaderFooter = dlg.getCheckBoxStateAsBoolean("ExportHeaderFooter"); if (bGeometry && bHeaderFooter) { config.setOption("page_formatting", "convert_all"); } else if (bGeometry && !bHeaderFooter) { config.setOption("page_formatting", "convert_geometry"); } else if (!bGeometry && bHeaderFooter) { config.setOption("page_formatting", "convert_header_footer"); } else { config.setOption("page_formatting", "ignore_all"); } checkBoxToConfig(dlg,"UseGeometry", "use_geometry"); checkBoxToConfig(dlg,"UseFancyhdr", "use_fancyhdr"); checkBoxToConfig(dlg,"UseLastpage", "use_lastpage"); checkBoxToConfig(dlg,"UseEndnotes", "use_endnotes"); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("ExportGeometryChange")) { exportGeometryChange(dlg); return true; } else if (sMethod.equals("ExportHeaderAndFooterChange")) { exportHeaderAndFooterChange(dlg); return true; } return false; } private void exportGeometryChange(DialogAccess dlg) { dlg.setControlEnabled("UseGeometry", dlg.getCheckBoxStateAsBoolean("ExportGeometry")); } private void exportHeaderAndFooterChange(DialogAccess dlg) { dlg.setControlEnabled("UseFancyhdr", dlg.getCheckBoxStateAsBoolean("ExportHeaderFooter")); } } // The page "Tables" // This page handles the options table_content, use_tabulary, use_colortbl, use_multirow, use_supertabular, use_longtable, // table_first_head_style, table_head_style, table_foot_style, table_last_foot_style // Limitation: Cannot handle the values "error" and "warning" for table_content private class TablesHandler extends PageHandler { protected TablesHandler() { } @Override protected void setControls(DialogAccess dlg) { // Fill the table style combo boxes with style names StyleNameProvider styleNameProvider = new StyleNameProvider(xContext); Map internalNames = styleNameProvider.getInternalNames("ParagraphStyles"); if (internalNames!=null) { String[] styleNames = Misc.sortStringSet(internalNames.keySet()); dlg.setListBoxStringItemList("TableFirstHeadStyle",styleNames); dlg.setListBoxStringItemList("TableHeadStyle",styleNames); dlg.setListBoxStringItemList("TableFootStyle",styleNames); dlg.setListBoxStringItemList("TableLastFootStyle",styleNames); } // Fill the table sequence combo box with sequence names FieldMasterNameProvider fieldMasterNameProvider = new FieldMasterNameProvider(xContext); dlg.setListBoxStringItemList("TableSequenceName", Misc.sortStringSet(fieldMasterNameProvider.getFieldMasterNames("com.sun.star.text.fieldmaster.SetExpression."))); dlg.setCheckBoxStateAsBoolean("NoTables", !"accept".equals(config.getOption("table_content"))); checkBoxFromConfig(dlg,"UseColortbl","use_colortbl"); checkBoxFromConfig(dlg,"UseTabulary","use_tabulary"); //checkBoxFromConfig(dlg,"UseMultirow","use_multirow"); checkBoxFromConfig(dlg,"UseSupertabular","use_supertabular"); checkBoxFromConfig(dlg,"UseLongtable","use_longtable"); textFieldFromConfig(dlg,"TableFirstHeadStyle","table_first_head_style"); textFieldFromConfig(dlg,"TableHeadStyle","table_head_style"); textFieldFromConfig(dlg,"TableFootStyle","table_foot_style"); textFieldFromConfig(dlg,"TableLastFootStyle","table_last_foot_style"); textFieldFromConfig(dlg,"TableSequenceName","table_sequence_name"); checkBoxChange(dlg); } @Override protected void getControls(DialogAccess dlg) { config.setOption("table_content", dlg.getCheckBoxStateAsBoolean("NoTables") ? "ignore" : "accept"); checkBoxToConfig(dlg,"UseColortbl","use_colortbl"); checkBoxToConfig(dlg,"UseTabulary","use_tabulary"); //checkBoxToConfig(dlg,"UseMultirow","use_multirow"); checkBoxToConfig(dlg,"UseSupertabular","use_supertabular"); checkBoxToConfig(dlg,"UseLongtable","use_longtable"); textFieldToConfig(dlg,"TableFirstHeadStyle","table_first_head_style"); textFieldToConfig(dlg,"TableHeadStyle","table_head_style"); textFieldToConfig(dlg,"TableFootStyle","table_foot_style"); textFieldToConfig(dlg,"TableLastFootStyle","table_last_foot_style"); textFieldToConfig(dlg,"TableSequenceName","table_sequence_name"); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("NoTablesChange")) { checkBoxChange(dlg); return true; } else if (sMethod.equals("UseSupertabularChange")) { checkBoxChange(dlg); return true; } else if (sMethod.equals("UseLongtableChange")) { checkBoxChange(dlg); return true; } return false; } private void checkBoxChange(DialogAccess dlg) { boolean bNoTables = dlg.getCheckBoxStateAsBoolean("NoTables"); boolean bSupertabular = dlg.getCheckBoxStateAsBoolean("UseSupertabular"); boolean bLongtable = dlg.getCheckBoxStateAsBoolean("UseLongtable"); dlg.setControlEnabled("UseColortbl", !bNoTables); dlg.setControlEnabled("UseTabulary", !bNoTables); dlg.setControlEnabled("UseMultirow", false); dlg.setControlEnabled("UseSupertabular", !bNoTables); dlg.setControlEnabled("UseLongtable", !bNoTables && !bSupertabular); dlg.setControlEnabled("TableFirstHeadLabel", !bNoTables && (bSupertabular || bLongtable)); dlg.setControlEnabled("TableFirstHeadStyle", !bNoTables && (bSupertabular || bLongtable)); dlg.setControlEnabled("TableHeadLabel", !bNoTables && (bSupertabular || bLongtable)); dlg.setControlEnabled("TableHeadStyle", !bNoTables && (bSupertabular || bLongtable)); dlg.setControlEnabled("TableFootLabel", !bNoTables && (bSupertabular || bLongtable)); dlg.setControlEnabled("TableFootStyle", !bNoTables && (bSupertabular || bLongtable)); dlg.setControlEnabled("TableLastFootLabel", !bNoTables && (bSupertabular || bLongtable)); dlg.setControlEnabled("TableLastFootStyle", !bNoTables && (bSupertabular || bLongtable)); dlg.setControlEnabled("TableSequenceLabel", !bNoTables); dlg.setControlEnabled("TableSequenceName", !bNoTables); } } // The page "Figures" // This page handles the options use_caption, align_frames, figure_sequence_name, image_content, // remove_graphics_extension and image_options // Limitation: Cannot handle the values "error" and "warning" for image_content private class FiguresHandler extends PageHandler { @Override protected void setControls(DialogAccess dlg) { // Fill the figure sequence combo box with sequence names FieldMasterNameProvider fieldMasterNameProvider = new FieldMasterNameProvider(xContext); dlg.setListBoxStringItemList("FigureSequenceName", Misc.sortStringSet(fieldMasterNameProvider.getFieldMasterNames("com.sun.star.text.fieldmaster.SetExpression."))); checkBoxFromConfig(dlg,"UseCaption","use_caption"); checkBoxFromConfig(dlg,"AlignFrames","align_frames"); textFieldFromConfig(dlg,"FigureSequenceName","figure_sequence_name"); dlg.setCheckBoxStateAsBoolean("NoImages", !"accept".equals(config.getOption("image_content"))); checkBoxFromConfig(dlg,"RemoveGraphicsExtension","remove_graphics_extension"); textFieldFromConfig(dlg,"ImageOptions","image_options"); noImagesChange(dlg); } @Override protected void getControls(DialogAccess dlg) { checkBoxToConfig(dlg,"UseCaption","use_caption"); checkBoxToConfig(dlg,"AlignFrames","align_frames"); textFieldToConfig(dlg,"FigureSequenceName","figure_sequence_name"); config.setOption("image_content", dlg.getCheckBoxStateAsBoolean("NoImages") ? "ignore" : "accept"); checkBoxToConfig(dlg,"RemoveGraphicsExtension","remove_graphics_extension"); textFieldToConfig(dlg,"ImageOptions","image_options"); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("NoImagesChange")) { noImagesChange(dlg); return true; } return false; } private void noImagesChange(DialogAccess dlg) { boolean bNoImages = dlg.getCheckBoxStateAsBoolean("NoImages"); dlg.setControlEnabled("RemoveGraphicsExtension", !bNoImages); dlg.setControlEnabled("ImageOptionsLabel", !bNoImages); dlg.setControlEnabled("ImageOptions", !bNoImages); } } // The page "TextAndMath" // This page handles the options use_ooomath and tabstop as well as the // text replacements and math symbol definitions private class TextAndMathHandler extends UserListPageHandler { private CustomSymbolNameProvider customSymbolNameProvider = null; private ComplexOption mathSymbols; private ComplexOption stringReplace; private String sCurrentMathSymbol = null; private String sCurrentText = null; protected TextAndMathHandler() { super(); customSymbolNameProvider = new CustomSymbolNameProvider(xContext); } @Override protected void setControls(DialogAccess dlg) { // Get math symbols from config if (mathSymbols!=null) { mathSymbols.clear(); } else { mathSymbols = new ComplexOption(); } mathSymbols.copyAll(config.getComplexOption("math-symbol-map")); sCurrentMathSymbol = null; dlg.setListBoxStringItemList("MathSymbolName", Misc.sortStringSet(mathSymbols.keySet())); dlg.setListBoxSelectedItem("MathSymbolName", (short)Math.min(0,mathSymbols.keySet().size()-1)); // Trigger change event (on some versions of OOo this is automatic due to a bug) mathSymbolNameChange(dlg); // Get string replace from config if (stringReplace!=null) { stringReplace.clear(); } else { stringReplace = new ComplexOption(); } stringReplace.copyAll(config.getComplexOption("string-replace")); sCurrentText = null; dlg.setListBoxStringItemList("TextInput", Misc.sortStringSet(stringReplace.keySet())); dlg.setListBoxSelectedItem("TextInput", (short)Math.min(0,stringReplace.keySet().size()-1)); // Trigger change event (on some versions of OOo this is automatic due to a bug) textInputChange(dlg); // Get other options from config checkBoxFromConfig(dlg,"UseOoomath","use_ooomath"); textFieldFromConfig(dlg,"TabStopLaTeX", "tabstop"); } @Override protected void getControls(DialogAccess dlg) { // Save math symbols to config updateSymbol(dlg); config.getComplexOption("math-symbol-map").clear(); config.getComplexOption("math-symbol-map").copyAll(mathSymbols); // Save string replace to config updateText(dlg); config.getComplexOption("string-replace").clear(); config.getComplexOption("string-replace").copyAll(stringReplace); // Save other options to config checkBoxToConfig(dlg,"UseOoomath","use_ooomath"); textFieldToConfig(dlg,"TabStopLaTeX", "tabstop"); } @Override protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("MathSymbolNameChange")) { mathSymbolNameChange(dlg); return true; } else if (sMethod.equals("NewSymbolClick")) { newSymbolClick(dlg); return true; } else if (sMethod.equals("DeleteSymbolClick")) { deleteSymbolClick(dlg); return true; } else if (sMethod.equals("TextInputChange")) { textInputChange(dlg); return true; } else if (sMethod.equals("NewTextClick")) { newTextClick(dlg); return true; } else if (sMethod.equals("DeleteTextClick")) { deleteTextClick(dlg); return true; } return false; } private void mathSymbolNameChange(DialogAccess dlg) { updateSymbol(dlg); updateSymbolControls(dlg); } private void newSymbolClick(DialogAccess dlg) { appendItem(dlg,"MathSymbolName",customSymbolNameProvider.getNames()); // Trigger change event (on some versions of OOo this is automatic due to a bug) mathSymbolNameChange(dlg); } private void deleteSymbolClick(DialogAccess dlg) { String sMathSymbol = sCurrentMathSymbol; if (deleteCurrentItem(dlg,"MathSymbolName")) { mathSymbols.remove(sMathSymbol); sCurrentMathSymbol=null; // invalidate current symbol } // Trigger change event (on some versions of OOo this is automatic due to a bug) mathSymbolNameChange(dlg); } private void updateSymbol(DialogAccess dlg) { // Save the current math symbol in our cache if (sCurrentMathSymbol!=null) { Map attr = new HashMap(); attr.put("latex", dlg.getTextFieldText("MathLaTeX")); mathSymbols.put(sCurrentMathSymbol, attr); } } // Update symbol controls based on currently selected list item private void updateSymbolControls(DialogAccess dlg) { short nSymbolItem = dlg.getListBoxSelectedItem("MathSymbolName"); if (nSymbolItem>=0) { sCurrentMathSymbol = dlg.getListBoxStringItemList("MathSymbolName")[nSymbolItem]; Map attributes; if (mathSymbols.containsKey(sCurrentMathSymbol)) { attributes = mathSymbols.get(sCurrentMathSymbol); } else { // New symbol, add empty definition to cache attributes = new HashMap(); attributes.put("latex", ""); mathSymbols.put(sCurrentMathSymbol, attributes); } dlg.setTextFieldText("MathLaTeX", attributes.get("latex")); dlg.setControlEnabled("MathLaTeX", true); dlg.setControlEnabled("DeleteSymbolButton", true); } else { // The list is empty, or nothing is selected sCurrentMathSymbol = null; dlg.setTextFieldText("MathLaTeX", ""); dlg.setControlEnabled("MathLaTeX", false); dlg.setControlEnabled("DeleteSymbolButton", false); } } private void textInputChange(DialogAccess dlg) { updateText(dlg); updateTextControls(dlg); } private void newTextClick(DialogAccess dlg) { appendItem(dlg, "TextInput", new HashSet()); // Trigger change event (on some versions of OOo this is automatic due to a bug) textInputChange(dlg); } private void deleteTextClick(DialogAccess dlg) { String sText = sCurrentText; if (deleteCurrentItem(dlg, "TextInput")) { stringReplace.remove(sText); sCurrentText = null; // Invalidate current string replace } // Trigger change event (on some versions of OOo this is automatic due to a bug) textInputChange(dlg); } private void updateText(DialogAccess dlg) { // Save the current string replace in our cache if (sCurrentText!=null) { Map attr = new HashMap(); attr.put("latex-code", dlg.getTextFieldText("LaTeX")); attr.put("fontenc", "any"); stringReplace.put(sCurrentText, attr); } } // Update text controls based on currently selected list item private void updateTextControls(DialogAccess dlg) { // Get the current input string, if any short nItem = dlg.getListBoxSelectedItem("TextInput"); if (nItem>=0) { sCurrentText = dlg.getListBoxStringItemList("TextInput")[nItem]; Map attributes; if (stringReplace.containsKey(sCurrentText)) { attributes = stringReplace.get(sCurrentText); } else { // New string replace, add empty definition to cache attributes = new HashMap(); attributes.put("latex-code", ""); attributes.put("fontenc", "any"); stringReplace.put(sCurrentText, attributes); } dlg.setTextFieldText("LaTeX", attributes.get("latex-code")); //dlg.setTextFieldText("Fontenc", attributes.get("fontenc")); dlg.setControlEnabled("LaTeX", true); dlg.setControlEnabled("DeleteTextButton", !"\u00A0!".equals(sCurrentText) && !"\u00A0?".equals(sCurrentText) && !"\u00A0:".equals(sCurrentText) && !"\u00A0;".equals(sCurrentText) && !"\u00A0\u2014".equals(sCurrentText)); } else { // The list is empty, or nothing is selected sCurrentText = null; dlg.setTextFieldText("LaTeX", ""); //dlg.setTextFieldText("Fontenc", "any"); dlg.setControlEnabled("DeleteTextButton", false); } } } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2latex/W2LRegistration.java0000644000175000017500000001076311251136744027436 0ustar renerene/************************************************************************ * * W2LRegistration.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2009 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2009-09-06) * */ package org.openoffice.da.comp.writer2latex; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XSingleServiceFactory; import com.sun.star.registry.XRegistryKey; import com.sun.star.comp.loader.FactoryHelper; /** This class provides a static method to instantiate our uno components * on demand (__getServiceFactory()), and a static method to give * information about the components (__writeRegistryServiceInfo()). * Furthermore, it saves the XMultiServiceFactory provided to the * __getServiceFactory method for future reference by the componentes. */ public class W2LRegistration { public static XMultiServiceFactory xMultiServiceFactory; /** * Returns a factory for creating the service. * This method is called by the JavaLoader * * @return returns a XSingleServiceFactory for creating the * component * * @param implName the name of the implementation for which a * service is desired * @param multiFactory the service manager to be used if needed * @param regKey the registryKey * * @see com.sun.star.comp.loader.JavaLoader */ public static XSingleServiceFactory __getServiceFactory(String implName, XMultiServiceFactory multiFactory, XRegistryKey regKey) { xMultiServiceFactory = multiFactory; XSingleServiceFactory xSingleServiceFactory = null; if (implName.equals(W2LExportFilter.class.getName()) ) { xSingleServiceFactory = FactoryHelper.getServiceFactory(W2LExportFilter.class, W2LExportFilter.__serviceName, multiFactory, regKey); } else if (implName.equals(LaTeXOptionsDialog.__implementationName)) { xSingleServiceFactory = FactoryHelper.getServiceFactory(LaTeXOptionsDialog.class, LaTeXOptionsDialog.__serviceName, multiFactory, regKey); } else if (implName.equals(W2LStarMathConverter.__implementationName)) { xSingleServiceFactory = FactoryHelper.getServiceFactory(W2LStarMathConverter.class, W2LStarMathConverter.__serviceName, multiFactory, regKey); } else if (implName.equals(ConfigurationDialog.__implementationName)) { xSingleServiceFactory = FactoryHelper.getServiceFactory(ConfigurationDialog.class, ConfigurationDialog.__serviceName, multiFactory, regKey); } return xSingleServiceFactory; } /** * Writes the service information into the given registry key. * This method is called by the JavaLoader *

* @return returns true if the operation succeeded * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { return FactoryHelper.writeRegistryServiceInfo(W2LExportFilter.__implementationName, W2LExportFilter.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(LaTeXOptionsDialog.__implementationName, LaTeXOptionsDialog.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(W2LStarMathConverter.__implementationName, W2LStarMathConverter.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(ConfigurationDialog.__implementationName, ConfigurationDialog.__serviceName, regKey); } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2latex/CustomSymbolNameProvider.java0000644000175000017500000000560011351636127031406 0ustar renerene/** * CustomSymbolNameProvider.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2009 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2009-11-09) * */ package org.openoffice.da.comp.writer2latex; import org.openoffice.da.comp.w2lcommon.helper.RegistryHelper; import org.openoffice.da.comp.w2lcommon.helper.XPropertySetHelper; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XNameAccess; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import java.util.Collections; import java.util.HashSet; import java.util.Set; /** This class provides access to the names of all user defined symbols in math * */ public class CustomSymbolNameProvider { Set names; /** Construct a new CustomSymbolNameProvider * * @param xContext the component context providing access to the api */ public CustomSymbolNameProvider(XComponentContext xContext) { names = new HashSet(); RegistryHelper registry = new RegistryHelper(xContext); try { // Prepare registry view Object view = registry.getRegistryView("/org.openoffice.Office.Math/",false); XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,view); // Get the list of symbols Object symbols = XPropertySetHelper.getPropertyValue(xProps,"SymbolList"); XNameAccess xSymbols = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,symbols); String[] sNames = xSymbols.getElementNames(); int nCount = sNames.length; for (int i=0; i getNames() { return Collections.unmodifiableSet(names); } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2latex/W2LExportFilter.java0000644000175000017500000000336411251136744027412 0ustar renerene/************************************************************************ * * W2LExportFilter.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2009 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2009-09-06) * */ package org.openoffice.da.comp.writer2latex; import com.sun.star.uno.XComponentContext; import org.openoffice.da.comp.w2lcommon.filter.ExportFilterBase; /** This class implements the LaTeX and BibTeX export filter component */ public class W2LExportFilter extends ExportFilterBase { /** Service name for the component */ public static final String __serviceName = "org.openoffice.da.comp.writer2latex.W2LExportFilter"; /** Implementation name for the component */ public static final String __implementationName = "org.openoffice.da.comp.writer2latex.W2LExportFilter"; /** Filter name to include in error messages */ public final String __displayName = "Writer2LaTeX"; public W2LExportFilter(XComponentContext xComponentContext1) { super(xComponentContext1); xMSF = W2LRegistration.xMultiServiceFactory; } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer2latex/LaTeXOptionsDialog.java0000644000175000017500000003712312407045472030110 0ustar renerene/************************************************************************ * * LaTeXOptionsDialog.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-19) * */ package org.openoffice.da.comp.writer2latex; import com.sun.star.awt.XDialog; import com.sun.star.beans.XPropertySet; //import com.sun.star.frame.XDesktop; //import com.sun.star.lang.XComponent; //import com.sun.star.text.XTextFieldsSupplier; //import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper; import org.openoffice.da.comp.w2lcommon.filter.OptionsDialogBase; /** This class provides a UNO component which implements a filter ui for the * LaTeX export */ public class LaTeXOptionsDialog extends OptionsDialogBase { // Translate list box items to configuration option values private static final String[] BACKEND_VALUES = { "generic", "pdftex", "dvips", "xetex", "unspecified" }; private static final String[] INPUTENCODING_VALUES = { "ascii", "latin1", "latin2", "iso-8859-7", "cp1250", "cp1251", "koi8-r", "utf8" }; private static final String[] NOTES_VALUES = { "ignore", "comment", "marginpar", "pdfannotation" }; private static final String[] FLOATOPTIONS_VALUES = { "", "tp", "bp", "htp", "hbp" }; /** The component will be registered under this name. */ public static String __serviceName = "org.openoffice.da.writer2latex.LaTeXOptionsDialog"; /** The component should also have an implementation name. * The subclass should override this with a suitable name */ public static String __implementationName = "org.openoffice.da.comp.writer2latex.LaTeXOptionsDialog"; public String getDialogLibraryName() { return "W2LDialogs"; } /** Create a new LaTeXOptionsDialog */ public LaTeXOptionsDialog(XComponentContext xContext) { super(xContext); xMSF = W2LRegistration.xMultiServiceFactory; } /** Return the name of the dialog within the library */ public String getDialogName() { return "LaTeXOptions"; } /** Return the name of the registry path */ public String getRegistryPath() { return "/org.openoffice.da.Writer2LaTeX.Options/LaTeXOptions"; } /** Load settings from the registry to the dialog */ protected void loadSettings(XPropertySet xProps) { // General loadConfig(xProps); loadListBoxOption(xProps,"Backend"); loadListBoxOption(xProps,"Inputencoding"); loadCheckBoxOption(xProps,"Multilingual"); loadCheckBoxOption(xProps,"GreekMath"); loadCheckBoxOption(xProps,"AdditionalSymbols"); // Bibliography loadCheckBoxOption(xProps,"UseBibtex"); loadComboBoxOption(xProps,"BibtexStyle"); // Files loadCheckBoxOption(xProps,"WrapLines"); loadNumericOption(xProps,"WrapLinesAfter"); loadCheckBoxOption(xProps,"SplitLinkedSections"); loadCheckBoxOption(xProps,"SplitToplevelSections"); loadCheckBoxOption(xProps,"SaveImagesInSubdir"); // Special content loadListBoxOption(xProps,"Notes"); loadCheckBoxOption(xProps,"Metadata"); loadCheckBoxOption(xProps,"DisplayHiddenText"); // Figures and tables loadCheckBoxOption(xProps,"OriginalImageSize"); loadCheckBoxOption(xProps,"OptimizeSimpleTables"); loadNumericOption(xProps,"SimpleTableLimit"); loadCheckBoxOption(xProps,"FloatTables"); loadCheckBoxOption(xProps,"FloatFigures"); loadListBoxOption(xProps,"FloatOptions"); // AutoCorrect loadCheckBoxOption(xProps,"IgnoreHardPageBreaks"); loadCheckBoxOption(xProps,"IgnoreHardLineBreaks"); loadCheckBoxOption(xProps,"IgnoreEmptyParagraphs"); loadCheckBoxOption(xProps,"IgnoreDoubleSpaces"); updateLockedOptions(); enableControls(); } /** Save settings from the dialog to the registry and create FilterData */ protected void saveSettings(XPropertySet xProps, PropertyHelper filterData) { // General short nConfig = saveConfig(xProps, filterData); switch (nConfig) { case 0: filterData.put("ConfigURL","*ultraclean.xml"); break; case 1: filterData.put("ConfigURL","*clean.xml"); break; case 2: filterData.put("ConfigURL","*default.xml"); break; case 3: filterData.put("ConfigURL","*pdfprint.xml"); break; case 4: filterData.put("ConfigURL","*pdfscreen.xml"); break; case 5: filterData.put("ConfigURL","$(user)/writer2latex.xml"); filterData.put("AutoCreate","true"); } saveListBoxOption(xProps, filterData, "Backend", "backend", BACKEND_VALUES ); if (getListBoxSelectedItem("Config")==4) { // pdfscreen locks the backend to pdftex filterData.put("backend","pdftex"); } saveListBoxOption(xProps, filterData, "Inputencoding", "inputencoding", INPUTENCODING_VALUES); saveCheckBoxOption(xProps, filterData, "Multilingual", "multilingual"); saveCheckBoxOption(xProps, filterData, "GreekMath", "greek_math"); // AdditionalSymbols sets 5 different w2l options... saveCheckBoxOption(xProps, filterData, "AdditionalSymbols", "use_pifont"); saveCheckBoxOption(xProps, filterData, "AdditionalSymbols", "use_ifsym"); saveCheckBoxOption(xProps, filterData, "AdditionalSymbols", "use_wasysym"); saveCheckBoxOption(xProps, filterData, "AdditionalSymbols", "use_eurosym"); saveCheckBoxOption(xProps, filterData, "AdditionalSymbols", "use_tipa"); // Bibliography saveCheckBoxOption(xProps, filterData, "UseBibtex", "use_bibtex"); saveComboBoxOption(xProps, filterData, "BibtexStyle", "bibtex_style"); // Files boolean bWrapLines = saveCheckBoxOption(xProps, "WrapLines"); int nWrapLinesAfter = saveNumericOption(xProps, "WrapLinesAfter"); if (!isLocked("wrap_lines_after")) { if (bWrapLines) { filterData.put("wrap_lines_after",Integer.toString(nWrapLinesAfter)); } else { filterData.put("wrap_lines_after","0"); } } saveCheckBoxOption(xProps, filterData, "SplitLinkedSections", "split_linked_sections"); saveCheckBoxOption(xProps, filterData, "SplitToplevelSections", "split_toplevel_sections"); saveCheckBoxOption(xProps, filterData, "SaveImagesInSubdir", "save_images_in_subdir"); // Special content saveListBoxOption(xProps, filterData, "Notes", "notes", NOTES_VALUES); saveCheckBoxOption(xProps, filterData, "Metadata", "metadata"); saveCheckBoxOption(xProps, filterData, "DisplayHiddenText", "display_hidden_text"); // Figures and tables saveCheckBoxOption(xProps, filterData, "OriginalImageSize", "original_image_size"); boolean bOptimizeSimpleTables = saveCheckBoxOption(xProps,"OptimizeSimpleTables"); int nSimpleTableLimit = saveNumericOption(xProps,"SimpleTableLimit"); if (!isLocked("simple_table_limit")) { if (bOptimizeSimpleTables) { filterData.put("simple_table_limit",Integer.toString(nSimpleTableLimit)); } else { filterData.put("simple_table_limit","0"); } } saveCheckBoxOption(xProps, filterData, "FloatTables", "float_tables"); saveCheckBoxOption(xProps, filterData, "FloatFigures", "float_figures"); saveListBoxOption(xProps, filterData, "FloatOptions", "float_options", FLOATOPTIONS_VALUES); // AutoCorrect saveCheckBoxOption(xProps, filterData, "IgnoreHardPageBreaks", "ignore_hard_page_breaks"); saveCheckBoxOption(xProps, filterData, "IgnoreHardLineBreaks", "ignore_hard_line_breaks"); saveCheckBoxOption(xProps, filterData, "IgnoreEmptyParagraphs", "ignore_empty_paragraphs"); saveCheckBoxOption(xProps, filterData, "IgnoreDoubleSpaces", "ignore_double_spaces"); } // Implement XDialogEventHandler public boolean callHandlerMethod(XDialog xDialog, Object event, String sMethod) { if (sMethod.equals("ConfigChange") || sMethod.equals("BackendChange")) { updateLockedOptions(); enableControls(); } else if (sMethod.equals("UseBibtexChange")) { enableBibtexStyle(); } else if (sMethod.equals("WrapLinesChange")) { enableWrapLinesAfter(); } else if (sMethod.equals("OptimizeSimpleTablesChange")) { enableSimpleTableLimit(); } else if (sMethod.equals("FloatTablesChange")) { enableFloatOptions(); } else if (sMethod.equals("FloatFiguresChange")) { enableFloatOptions(); } return true; } public String[] getSupportedMethodNames() { String[] sNames = { "ConfigChange", "UseBibtexChange", "WrapLinesChange", "OptimizeSimpleTablesChange", "FloatTablesChange", "FloatFiguresChange" }; return sNames; } protected boolean isLocked(String sOptionName) { if ("backend".equals(sOptionName)) { // backend must be pdf for pdfscreen return getListBoxSelectedItem("Config")==4 || super.isLocked(sOptionName); } else if ("inputencoding".equals(sOptionName)) { // backend=xetex locks the encoding to utf8 return getListBoxSelectedItem("Backend")==3 || super.isLocked(sOptionName); } else if ("greek_math".equals(sOptionName)) { // this option has no effect if backend=xetex return getListBoxSelectedItem("Backend")==3 || super.isLocked(sOptionName); } else if ("additional_symbols".equals(sOptionName)) { // additional_symbols is disabled for custom config (where the 5 // individual options can be set independently) // it is also disabled for backend=xetex return getListBoxSelectedItem("Backend")==3 || getListBoxSelectedItem("Config")==5 || super.isLocked(sOptionName); } else if ("use_pifont".equals(sOptionName)) { return isLocked("additional_symbols"); } else if ("use_ifsym".equals(sOptionName)) { return isLocked("additional_symbols"); } else if ("use_wasysym".equals(sOptionName)) { return isLocked("additional_symbols"); } else if ("use_eurosym".equals(sOptionName)) { return isLocked("additional_symbols"); } else if ("use_tipa".equals(sOptionName)) { return isLocked("additional_symbols"); } else { return super.isLocked(sOptionName); } } private void enableControls() { // General setControlEnabled("BackendLabel",!isLocked("backend")); setControlEnabled("Backend",!isLocked("backend")); setControlEnabled("InputencodingLabel",!isLocked("inputencoding")); setControlEnabled("Inputencoding",!isLocked("inputencoding")); setControlEnabled("Multilingual",!isLocked("multilingual")); setControlEnabled("GreekMath",!isLocked("greek_math")); setControlEnabled("AdditionalSymbols",!isLocked("additional_symbols")); // Bibliography setControlEnabled("UseBibtex",!isLocked("use_bibtex")); boolean bUseBibtex = getCheckBoxStateAsBoolean("UseBibtex"); setControlEnabled("BibtexStyleLabel",!isLocked("bibtex_style") && bUseBibtex); setControlEnabled("BibtexStyle",!isLocked("bibtex_style") && bUseBibtex); // Files setControlEnabled("WrapLines",!isLocked("wrap_lines_after")); boolean bWrapLines = getCheckBoxStateAsBoolean("WrapLines"); setControlEnabled("WrapLinesAfterLabel",!isLocked("wrap_lines_after") && bWrapLines); setControlEnabled("WrapLinesAfter",!isLocked("wrap_lines_after") && bWrapLines); setControlEnabled("SplitLinkedSections",!isLocked("split_linked_sections")); setControlEnabled("SplitToplevelSections",!isLocked("split_toplevel_sections")); setControlEnabled("SaveImagesInSubdir",!isLocked("save_images_in_subdir")); // Special content setControlEnabled("NotesLabel",!isLocked("notes")); setControlEnabled("Notes",!isLocked("notes")); setControlEnabled("Metadata",!isLocked("metadata")); setControlEnabled("DisplayHiddenText",!isLocked("display_hidden_text")); // Figures and tables setControlEnabled("OriginalImageSize",!isLocked("original_image_size")); setControlEnabled("OptimizeSimpleTables",!isLocked("simple_table_limit")); boolean bOptimizeSimpleTables = getCheckBoxStateAsBoolean("OptimizeSimpleTables"); setControlEnabled("SimpleTableLimitLabel",!isLocked("simple_table_limit") && bOptimizeSimpleTables); setControlEnabled("SimpleTableLimit",!isLocked("simple_table_limit") && bOptimizeSimpleTables); setControlEnabled("FloatTables",!isLocked("float_tables")); setControlEnabled("FloatFigures",!isLocked("float_figures")); boolean bFloat = getCheckBoxStateAsBoolean("FloatFigures") || getCheckBoxStateAsBoolean("FloatTables"); setControlEnabled("FloatOptionsLabel",!isLocked("float_options") && bFloat); setControlEnabled("FloatOptions",!isLocked("float_options") && bFloat); // AutoCorrect setControlEnabled("IgnoreHardPageBreaks",!isLocked("ignore_hard_page_breaks")); setControlEnabled("IgnoreHardLineBreaks",!isLocked("ignore_hard_line_breaks")); setControlEnabled("IgnoreEmptyParagraphs",!isLocked("ignore_empty_paragraphs")); setControlEnabled("IgnoreDoubleSpaces",!isLocked("ignore_double_spaces")); } private void enableBibtexStyle() { if (!isLocked("bibtex_style")) { boolean bState = getCheckBoxStateAsBoolean("UseBibtex"); setControlEnabled("BibtexStyleLabel",bState); setControlEnabled("BibtexStyle",bState); } } private void enableWrapLinesAfter() { if (!isLocked("wrap_lines_after")) { boolean bState = getCheckBoxStateAsBoolean("WrapLines"); setControlEnabled("WrapLinesAfterLabel",bState); setControlEnabled("WrapLinesAfter",bState); } } private void enableSimpleTableLimit() { if (!isLocked("simple_table_limit")) { boolean bState = getCheckBoxStateAsBoolean("OptimizeSimpleTables"); setControlEnabled("SimpleTableLimitLabel",bState); setControlEnabled("SimpleTableLimit",bState); } } private void enableFloatOptions() { if (!isLocked("float_options")) { boolean bState = getCheckBoxStateAsBoolean("FloatFigures") || getCheckBoxStateAsBoolean("FloatTables"); setControlEnabled("FloatOptionsLabel",bState); setControlEnabled("FloatOptions",bState); } } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer4latex/0000755000175000017500000000000012603463650023570 5ustar renerenewriter2latex-1.4/source/java/org/openoffice/da/comp/writer4latex/ExternalApps.java0000644000175000017500000002100611524722053027034 0ustar renerene/************************************************************************ * * ExternalApps.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2011 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2011-01-25) * */ package org.openoffice.da.comp.writer4latex; import java.io.File; import java.io.IOException; import java.lang.Process; import java.lang.ProcessBuilder; import java.util.HashMap; import java.util.Map; import java.util.Vector; import org.openoffice.da.comp.w2lcommon.helper.RegistryHelper; //import java.util.Map; import com.sun.star.beans.XMultiHierarchicalPropertySet; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.util.XChangesBatch; /** This class manages and executes external applications used by Writer4LaTeX. * These include TeX and friends as well as viewers for the various backend * formats. The registry is used for persistent storage of the settings. */ public class ExternalApps { public final static String LATEX = "LaTeX"; public final static String PDFLATEX = "PdfLaTeX"; public final static String XELATEX = "XeLaTeX"; public final static String BIBTEX = "BibTeX"; public final static String MAKEINDEX = "Makeindex"; public final static String MK4HT = "Mk4ht"; public final static String DVIPS = "Dvips"; public final static String DVIVIEWER = "DVIViewer"; public final static String POSTSCRIPTVIEWER = "PostscriptViewer"; public final static String PDFVIEWER = "PdfViewer"; private final static String[] sApps = { LATEX, PDFLATEX, XELATEX, BIBTEX, MAKEINDEX, MK4HT, DVIPS, DVIVIEWER, POSTSCRIPTVIEWER, PDFVIEWER }; private XComponentContext xContext; private HashMap apps; /** Construct a new ExternalApps object, with empty definitions */ public ExternalApps(XComponentContext xContext) { this.xContext = xContext; apps = new HashMap(); for (int i=0; i env, boolean bWaitFor) { return execute(sAppName, "", sFileName, workDir, env, bWaitFor); } /** Execute an external application * @param sAppName the name of the application to execute * @param sCommand subcommand/option to pass to the command * @param sFileName the file name to use * @param workDir the working directory to use * @param env map of environment variables to set (or null if no variables needs to be set) * @param bWaitFor true if the method should wait for the execution to finish * @return error code */ public int execute(String sAppName, String sCommand, String sFileName, File workDir, Map env, boolean bWaitFor) { // Assemble the command String[] sApp = getApplication(sAppName); if (sApp==null) { return 1; } try { Vector command = new Vector(); command.add(sApp[0]); String[] sArguments = sApp[1].split(" "); for (String s : sArguments) { command.add(s.replace("%c",sCommand).replace("%s",sFileName)); } ProcessBuilder pb = new ProcessBuilder(command); pb.directory(workDir); if (env!=null) { pb.environment().putAll(env); } Process proc = pb.start(); // Gobble the error stream of the application StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR"); // Gobble the output stream of the application StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT"); // Kick them off errorGobbler.start(); outputGobbler.start(); // Any error? return bWaitFor ? proc.waitFor() : 0; } catch (InterruptedException e) { return 1; } catch (IOException e) { return 1; } } /** Load the external applications from the registry */ public void load() { RegistryHelper registry = new RegistryHelper(xContext); Object view; try { // Prepare registry view view = registry.getRegistryView("/org.openoffice.da.Writer4LaTeX.Options/Applications",false); } catch (com.sun.star.uno.Exception e) { // Give up... return; } XMultiHierarchicalPropertySet xProps = (XMultiHierarchicalPropertySet) UnoRuntime.queryInterface(XMultiHierarchicalPropertySet.class, view); for (int i=0; i command = new Vector(); command.add("which"); command.add(sAppName); ProcessBuilder pb = new ProcessBuilder(command); Process proc = pb.start(); // Gobble the error stream of the application StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR"); // Gobble the output stream of the application StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT"); errorGobbler.start(); outputGobbler.start(); // The application exists if the process exits with 0 return proc.waitFor()==0; } catch (InterruptedException e) { return false; } catch (IOException e) { return false; } } // Unix: Configure a certain application testing the availability private boolean configureApp(String sName, String sAppName, String sArguments) { if (hasApp(sAppName)) { externalApps.setApplication(sName, sAppName, sArguments); return true; } else { externalApps.setApplication(sName, "???", "???"); return false; } } // Unix: Configure a certain application, reporting the availability private boolean configureApp(String sName, String sAppName, String sArguments, StringBuilder info) { if (hasApp(sAppName)) { externalApps.setApplication(sName, sAppName, sArguments); info.append("Found "+sAppName+" - OK\n"); return true; } else { externalApps.setApplication(sName, "???", "???"); info.append("Failed to find "+sAppName+"\n"); return false; } } // Unix: Configure a certain application testing the availability // This variant uses an array of potential apps private boolean configureApp(String sName, String[] sAppNames, String sArguments, StringBuilder info) { for (String sAppName : sAppNames) { if (configureApp(sName, sAppName, sArguments)) { info.append("Found "+sName+": "+sAppName+" - OK\n"); return true; } } info.append("Failed to find "+sName+"\n"); return false; } // Windows: Test that the given path contains a given executable private boolean containsExecutable(String sPath,String sExecutable) { File dir = new File(sPath); if (dir.exists() && dir.canRead()) { File exe = new File(dir,sExecutable); return exe.exists(); } return false; } // Windows: Configure a certain MikTeX application private boolean configureMikTeX(String sPath, String sName, String sAppName, String sArguments, StringBuilder info, boolean bRequired) { File app = new File(new File(sPath),sAppName+".exe"); if (app.exists()) { externalApps.setApplication(sName, sAppName, sArguments); info.append(" Found "+sName+": "+sAppName+" - OK\n"); return true; } else if (bRequired) { externalApps.setApplication(sName, "???", "???"); info.append(" Failed to find "+sName+"\n"); } return false; } // Configure the applications automatically (OS dependent) private boolean autoConfigure(XWindow xWindow) { String sOsName = System.getProperty("os.name"); String sOsVersion = System.getProperty("os.version"); String sOsArch = System.getProperty("os.arch"); StringBuilder info = new StringBuilder(); info.append("Results of configuration:\n\n"); info.append("Your system identifies itself as "+sOsName+" version "+sOsVersion+ " (" + sOsArch +")\n\n"); if (sOsName.startsWith("Windows")) { // Assume MikTeX String sMikTeXPath = null; String[] sPaths = System.getenv("PATH").split(";"); for (String s : sPaths) { if (s.toLowerCase().indexOf("miktex")>-1 && containsExecutable(s,"latex.exe")) { sMikTeXPath = s; break; } } if (sMikTeXPath==null) { for (String s : sPaths) { if (containsExecutable(s,"latex.exe")) { sMikTeXPath = s; break; } } } boolean bFoundTexworks = false; if (sMikTeXPath!=null) { info.append("Found MikTeX\n"); configureMikTeX(sMikTeXPath, ExternalApps.LATEX, "latex", "--interaction=batchmode %s", info, true); configureMikTeX(sMikTeXPath, ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s", info, true); configureMikTeX(sMikTeXPath, ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s", info, true); configureMikTeX(sMikTeXPath, ExternalApps.DVIPS, "dvips", "%s", info, true); configureMikTeX(sMikTeXPath, ExternalApps.BIBTEX, "bibtex", "%s", info, true); configureMikTeX(sMikTeXPath, ExternalApps.MAKEINDEX, "makeindex", "%s", info, true); //configureMikTeX(sMikTeXPath, ExternalApps.MK4HT, "mk4ht", "%c %s", info, true); configureMikTeX(sMikTeXPath, ExternalApps.DVIVIEWER, "yap", "--single-instance %s", info, true); // MikTeX 2.8 provides texworks for pdf viewing bFoundTexworks = configureMikTeX(sMikTeXPath, ExternalApps.PDFVIEWER, "texworks", "%s", info, true); } else { info.append("Failed to find MikTeX\n"); info.append("Writer4LaTeX has been configured to work if MikTeX is added to your path\n"); externalApps.setApplication(ExternalApps.LATEX, "latex", "--interaction=batchmode %s"); externalApps.setApplication(ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s"); externalApps.setApplication(ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s"); externalApps.setApplication(ExternalApps.DVIPS, "dvips", "%s"); externalApps.setApplication(ExternalApps.BIBTEX, "bibtex", "%s"); externalApps.setApplication(ExternalApps.MAKEINDEX, "makeindex", "%s"); //externalApps.setApplication(ExternalApps.MK4HT, "mk4ht", "%c %s"); externalApps.setApplication(ExternalApps.DVIVIEWER, "yap", "--single-instance %s"); } info.append("\n"); // Assume gsview for pdf and ps String sGsview = null; String sProgramFiles = System.getenv("ProgramFiles"); if (sProgramFiles!=null) { if (containsExecutable(sProgramFiles+"\\ghostgum\\gsview","gsview32.exe")) { sGsview = sProgramFiles+"\\ghostgum\\gsview\\gsview32.exe"; } } if (sGsview!=null) { info.append("Found gsview - OK\n"); } else { info.append("Failed to find gsview\n"); sGsview = "gsview32.exe"; // at least this helps a bit.. } if (!bFoundTexworks) { externalApps.setApplication(ExternalApps.PDFVIEWER, sGsview, "-e \"%s\""); } externalApps.setApplication(ExternalApps.POSTSCRIPTVIEWER, sGsview, "-e \"%s\""); } else { // Assume a Unix-like system supporting the "which" command configureApp(ExternalApps.LATEX, "latex", "--interaction=batchmode %s",info); configureApp(ExternalApps.PDFLATEX, "pdflatex", "--interaction=batchmode %s",info); configureApp(ExternalApps.XELATEX, "xelatex", "--interaction=batchmode %s",info); configureApp(ExternalApps.DVIPS, "dvips", "%s",info); configureApp(ExternalApps.BIBTEX, "bibtex", "%s",info); configureApp(ExternalApps.MAKEINDEX, "makeindex", "%s",info); //configureApp(ExternalApps.MK4HT, "mk4ht", "%c %s",info); // We have several possible viewers String[] sDviViewers = {"evince", "okular", "xdvi"}; configureApp(ExternalApps.DVIVIEWER, sDviViewers, "%s",info); String[] sPdfViewers = {"evince", "okular", "xpdf"}; configureApp(ExternalApps.PDFVIEWER, sPdfViewers, "%s",info); String[] sPsViewers = {"evince", "okular", "ghostview"}; configureApp(ExternalApps.POSTSCRIPTVIEWER, sPsViewers, "%s",info); } // Maybe add some info for Ubuntu users // sudo apt-get install texlive // sudo apt-get install texlive-xetex // sudo apt-get install texlive-latex-extra // sudo apt-get install tex4ht displayAutoConfigInfo(info.toString()); changeApplication(xWindow); return true; } private String getSelectedAppName(XWindow xWindow) { short nItem = getListBoxSelectedItem(xWindow, "Application"); //String sAppName = null; switch (nItem) { case 0: return ExternalApps.LATEX; case 1: return ExternalApps.PDFLATEX; case 2: return ExternalApps.XELATEX; case 3: return ExternalApps.DVIPS; case 4: return ExternalApps.BIBTEX; case 5: return ExternalApps.MAKEINDEX; //case 6: return ExternalApps.MK4HT; case 6: return ExternalApps.DVIVIEWER; case 7: return ExternalApps.PDFVIEWER; case 8: return ExternalApps.POSTSCRIPTVIEWER; } return "???"; } private XDialog getDialog(String sDialogName) { XMultiComponentFactory xMCF = xContext.getServiceManager(); try { Object provider = xMCF.createInstanceWithContext( "com.sun.star.awt.DialogProvider2", xContext); XDialogProvider2 xDialogProvider = (XDialogProvider2) UnoRuntime.queryInterface(XDialogProvider2.class, provider); String sDialogUrl = "vnd.sun.star.script:"+sDialogName+"?location=application"; return xDialogProvider.createDialogWithHandler(sDialogUrl, this); } catch (Exception e) { return null; } } private void displayAutoConfigInfo(String sText) { XDialog xDialog = getDialog("W4LDialogs.AutoConfigInfo"); if (xDialog!=null) { DialogAccess info = new DialogAccess(xDialog); info.setTextFieldText("Info", sText); xDialog.execute(); xDialog.endExecute(); } } // Some helpers copied from DialogBase private XPropertySet getControlProperties(XWindow xWindow, String sControlName) { XControlContainer xContainer = (XControlContainer) UnoRuntime.queryInterface(XControlContainer.class, xWindow); XControl xControl = xContainer.getControl(sControlName); XControlModel xModel = xControl.getModel(); XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xModel); return xPropertySet; } private String getComboBoxText(XWindow xWindow, String sControlName) { // Returns the text of a combobox XPropertySet xPropertySet = getControlProperties(xWindow, sControlName); try { return (String) xPropertySet.getPropertyValue("Text"); } catch (Exception e) { // Will fail if the control does not exist or is not a combo return ""; } } private void setComboBoxText(XWindow xWindow, String sControlName, String sText) { XPropertySet xPropertySet = getControlProperties(xWindow, sControlName); try { xPropertySet.setPropertyValue("Text", sText); } catch (Exception e) { // Will fail if the control does not exist or is not a combo box or // nText is an illegal value } } private short getListBoxSelectedItem(XWindow xWindow, String sControlName) { // Returns the first selected element in case of a multiselection XPropertySet xPropertySet = getControlProperties(xWindow, sControlName); try { short[] selection = (short[]) xPropertySet.getPropertyValue("SelectedItems"); return selection[0]; } catch (Exception e) { // Will fail if the control does not exist or is not a list box return -1; } } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer4latex/Writer4LaTeX.java0000644000175000017500000007074111542571044026700 0ustar renerene/************************************************************************ * * Writer4LaTeX.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2011 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2011-03-23) * */ package org.openoffice.da.comp.writer4latex; import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.util.regex.Pattern; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertyAccess; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XNameAccess; import com.sun.star.frame.XController; import com.sun.star.frame.XFrame; import com.sun.star.frame.XModel; import com.sun.star.frame.XStorable; import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.task.XStatusIndicator; import com.sun.star.task.XStatusIndicatorFactory; import com.sun.star.ui.dialogs.ExecutableDialogResults; import com.sun.star.ui.dialogs.XExecutableDialog; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import org.openoffice.da.comp.w2lcommon.helper.MacroExpander; import org.openoffice.da.comp.w2lcommon.helper.MessageBox; import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper; import org.openoffice.da.comp.w2lcommon.helper.RegistryHelper; import org.openoffice.da.comp.w2lcommon.helper.XPropertySetHelper; import writer2latex.util.CSVList; import writer2latex.util.Misc; /** This class implements the ui (dispatch) commands provided by Writer4LaTeX. * The actual processing is done by the three core classes TeXify, * LaTeXImporter and BibTeXImporter */ public final class Writer4LaTeX extends WeakBase implements com.sun.star.lang.XServiceInfo, com.sun.star.frame.XDispatchProvider, com.sun.star.lang.XInitialization, com.sun.star.frame.XDispatch { private static final String PROTOCOL = "org.openoffice.da.writer4latex:"; // From constructor+initialization private final XComponentContext m_xContext; private XFrame m_xFrame; private XModel xModel = null; // Global data private TeXify texify = null; private PropertyValue[] mediaProps = null; private String sBasePath = null; private String sBaseFileName = null; public static final String __implementationName = Writer4LaTeX.class.getName(); public static final String __serviceName = "com.sun.star.frame.ProtocolHandler"; private static final String[] m_serviceNames = { __serviceName }; public Writer4LaTeX( XComponentContext xContext ) { m_xContext = xContext; } // com.sun.star.lang.XInitialization: public void initialize( Object[] object ) throws com.sun.star.uno.Exception { if ( object.length > 0 ) { // The first item is the current frame m_xFrame = (com.sun.star.frame.XFrame) UnoRuntime.queryInterface( com.sun.star.frame.XFrame.class, object[0]); // Get the model for the document from the frame XController xController = m_xFrame.getController(); if (xController!=null) { xModel = xController.getModel(); } } } // com.sun.star.lang.XServiceInfo: public String getImplementationName() { return __implementationName; } public boolean supportsService( String sService ) { int len = m_serviceNames.length; for( int i=0; i < len; i++) { if (sService.equals(m_serviceNames[i])) return true; } return false; } public String[] getSupportedServiceNames() { return m_serviceNames; } // com.sun.star.frame.XDispatchProvider: public com.sun.star.frame.XDispatch queryDispatch( com.sun.star.util.URL aURL, String sTargetFrameName, int iSearchFlags ) { if ( aURL.Protocol.compareTo(PROTOCOL) == 0 ) { if ( aURL.Path.compareTo("ProcessDocument") == 0 ) return this; else if ( aURL.Path.compareTo("ProcessDirectly") == 0 ) return this; else if ( aURL.Path.compareTo("ViewLog") == 0 ) return this; } return null; } public com.sun.star.frame.XDispatch[] queryDispatches( com.sun.star.frame.DispatchDescriptor[] seqDescriptors ) { int nCount = seqDescriptors.length; com.sun.star.frame.XDispatch[] seqDispatcher = new com.sun.star.frame.XDispatch[seqDescriptors.length]; for( int i=0; i < nCount; ++i ) { seqDispatcher[i] = queryDispatch(seqDescriptors[i].FeatureURL, seqDescriptors[i].FrameName, seqDescriptors[i].SearchFlags ); } return seqDispatcher; } // com.sun.star.frame.XDispatch: public void dispatch( com.sun.star.util.URL aURL, com.sun.star.beans.PropertyValue[] aArguments ) { if ( aURL.Protocol.compareTo(PROTOCOL) == 0 ) { if ( aURL.Path.compareTo("ProcessDocument") == 0 ) { if (updateLocation() && updateMediaProperties()) { process(); } return; } else if ( aURL.Path.compareTo("ProcessDirectly") == 0 ) { if (updateLocation()) { updateMediaPropertiesSilent(); process(); } return; } else if ( aURL.Path.compareTo("ViewLog") == 0 ) { viewLog(); return; } } } public void addStatusListener( com.sun.star.frame.XStatusListener xControl, com.sun.star.util.URL aURL ) { } public void removeStatusListener( com.sun.star.frame.XStatusListener xControl, com.sun.star.util.URL aURL ) { } // The actual commands... private void process() { // Create a (somewhat coarse grained) status indicator/progress bar XStatusIndicatorFactory xFactory = (com.sun.star.task.XStatusIndicatorFactory) UnoRuntime.queryInterface(com.sun.star.task.XStatusIndicatorFactory.class, m_xFrame); XStatusIndicator xStatus = xFactory.createStatusIndicator(); xStatus.start("Writer4LaTeX",10); xStatus.setValue(1); // At least we have started, that's 10% :-) // First work a bit on the FilterData (get the backend and set bibliography options) String sBackend = "generic"; String sBibinputs = null; PropertyHelper mediaHelper = new PropertyHelper(mediaProps); Object filterData = mediaHelper.get("FilterData"); if (filterData instanceof PropertyValue[]) { PropertyHelper filterHelper = new PropertyHelper((PropertyValue[])filterData); // Get the backend Object backend = filterHelper.get("backend"); if (backend instanceof String) { sBackend = (String) backend; } // Set the bibliography options according to the settings RegistryHelper registry = new RegistryHelper(m_xContext); try { Object view = registry.getRegistryView(BibliographyDialog.REGISTRY_PATH, false); XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,view); String sBibTeXFiles = getFileList(XPropertySetHelper.getPropertyValueAsShort(xProps, "BibTeXLocation"), XPropertySetHelper.getPropertyValueAsString(xProps, "BibTeXDir")); if (XPropertySetHelper.getPropertyValueAsBoolean(xProps, "ConvertZoteroCitations")) { filterHelper.put("zotero_bibtex_files", sBibTeXFiles); } if (XPropertySetHelper.getPropertyValueAsBoolean(xProps, "ConvertJabRefCitations")) { filterHelper.put("jabref_bibtex_files", sBibTeXFiles); } if (XPropertySetHelper.getPropertyValueAsBoolean(xProps, "UseExternalBibTeXFiles")) { filterHelper.put("external_bibtex_files", sBibTeXFiles); } filterHelper.put("include_original_citations", Boolean.toString(XPropertySetHelper.getPropertyValueAsBoolean(xProps, "IncludeOriginalCitations"))); String sBibTeXDir = XPropertySetHelper.getPropertyValueAsString(xProps, "BibTeXDir"); if (sBibTeXDir.length()>0) { // The separator character in BIBINPUTS is OS specific sBibinputs = sBibTeXDir+File.pathSeparatorChar; } filterHelper.put("use_natbib", Boolean.toString(XPropertySetHelper.getPropertyValueAsBoolean(xProps, "UseNatbib"))); filterHelper.put("natbib_options", XPropertySetHelper.getPropertyValueAsString(xProps, "NatbibOptions")); mediaHelper.put("FilterData",filterHelper.toArray()); mediaProps = mediaHelper.toArray(); registry.disposeRegistryView(view); } catch (Exception e) { // Failed to get registry view } } try { // Convert to LaTeX String sTargetUrl = sBasePath+sBaseFileName+".tex"; XStorable xStorable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xModel); xStorable.storeToURL(sTargetUrl, mediaProps); } catch (com.sun.star.io.IOException e) { xStatus.end(); MessageBox msgBox = new MessageBox(m_xContext, m_xFrame); msgBox.showMessage("Writer4LaTeX Error","Failed to export document to LaTeX"); return; } xStatus.setValue(6); // Export is finished, that's more than half :-) if (texify==null) { texify = new TeXify(m_xContext); } File file = new File(urlToFile(sBasePath),sBaseFileName); boolean bResult = true; try { if (sBackend=="pdftex") { bResult = texify.process(file, sBibinputs, TeXify.PDFTEX, true); } else if (sBackend=="dvips") { bResult = texify.process(file, sBibinputs, TeXify.DVIPS, true); } else if (sBackend=="xetex") { bResult = texify.process(file, sBibinputs, TeXify.XETEX, true); } else if (sBackend=="generic") { bResult = texify.process(file, sBibinputs, TeXify.GENERIC, true); } } catch (IOException e) { MessageBox msgBox = new MessageBox(m_xContext, m_xFrame); msgBox.showMessage("Writer4LaTeX Error",e.getMessage()); } xStatus.setValue(10); // The user will usually not see this... if (!bResult) { MessageBox msgBox = new MessageBox(m_xContext, m_xFrame); msgBox.showMessage("Writer4LaTeX Error","Failed to execute LaTeX - see log for details"); } xStatus.end(); } private String getFileList(short nType, String sDirectory) { File dir; switch (nType) { case 0: // absolute path dir = new File(sDirectory); break; case 1: // relative path dir = new File(urlToFile(sBasePath),sDirectory); break; default: // document directory dir = urlToFile(sBasePath); } CSVList filelist = new CSVList(","); if (dir.isDirectory()) { File[] files = dir.listFiles(); for (File file : files) { if (file.isFile() && file.getName().endsWith(".bib")) { //filelist.addValue(file.getAbsolutePath()); filelist.addValue(Misc.removeExtension(file.getName())); } } } String sFileList = filelist.toString(); return sFileList.length()>0 ? sFileList : "dummy"; } private void viewLog() { if (updateLocation()) { // Execute the log viewer dialog try { Object[] args = new Object[1]; args[0] = sBasePath+sBaseFileName; Object dialog = m_xContext.getServiceManager() .createInstanceWithArgumentsAndContext( "org.openoffice.da.writer4latex.LogViewerDialog", args, m_xContext); XExecutableDialog xDialog = (XExecutableDialog) UnoRuntime.queryInterface(XExecutableDialog.class, dialog); if (xDialog.execute()==ExecutableDialogResults.OK) { // Closed with the close button } } catch (com.sun.star.uno.Exception e) { } } } // Some utility methods private void prepareMediaProperties() { // Create inital media properties mediaProps = new PropertyValue[2]; mediaProps[0] = new PropertyValue(); mediaProps[0].Name = "FilterName"; mediaProps[0].Value = "org.openoffice.da.writer2latex"; mediaProps[1] = new PropertyValue(); mediaProps[1].Name = "Overwrite"; mediaProps[1].Value = "true"; } private boolean updateMediaProperties() { prepareMediaProperties(); try { // Display options dialog Object dialog = m_xContext.getServiceManager() .createInstanceWithContext("org.openoffice.da.writer2latex.LaTeXOptionsDialog", m_xContext); // If Writer2LaTeX is not installed, this will return null if (dialog==null) { mediaProps = null; MessageBox msgBox = new MessageBox(m_xContext, m_xFrame); msgBox.showMessage("Writer4LaTeX Error","Please install Writer2LaTeX version 1.0 or later"); return false; } XPropertyAccess xPropertyAccess = (XPropertyAccess) UnoRuntime.queryInterface(XPropertyAccess.class, dialog); xPropertyAccess.setPropertyValues(mediaProps); XExecutableDialog xDialog = (XExecutableDialog) UnoRuntime.queryInterface(XExecutableDialog.class, dialog); if (xDialog.execute()==ExecutableDialogResults.OK) { mediaProps = xPropertyAccess.getPropertyValues(); return true; } else { mediaProps = null; return false; } } catch (com.sun.star.beans.UnknownPropertyException e) { // setPropertyValues will not fail.. mediaProps = null; return false; } catch (com.sun.star.uno.Exception e) { // getServiceManager will not fail.. mediaProps = null; return false; } } private String getOptionAsString(XPropertySet xProps, String sName) { Object value = XPropertySetHelper.getPropertyValue(xProps, sName); // Try to convert the value to a string if (value instanceof String) return (String) value; else if (value instanceof Boolean) return ((Boolean) value).toString(); else if (value instanceof Integer) return ((Integer) value).toString(); else if (value instanceof Short) return ((Short) value).toString(); else return null; } private void loadOption(XPropertySet xProps, PropertyHelper filterData, String sRegName, String sOptionName) { String sValue = getOptionAsString(xProps,sRegName); if (sValue!=null) { // Set the filter data filterData.put(sOptionName, sValue); } } // Read the configuration directly from the registry rather than using the dialog // TODO: Should probably do some refactoring in the Options dialogs to avoid this solution private void updateMediaPropertiesSilent() { prepareMediaProperties(); RegistryHelper registry = new RegistryHelper(m_xContext); // Read the stored settings from the registry rather than displaying a dialog try { // Prepare registry view Object view = registry.getRegistryView("/org.openoffice.da.Writer2LaTeX.Options/LaTeXOptions",true); XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,view); PropertyHelper filterData = new PropertyHelper(); // Read the configuration file short nConfig = XPropertySetHelper.getPropertyValueAsShort(xProps, "Config"); switch (nConfig) { case 0: filterData.put("ConfigURL","*ultraclean.xml"); break; case 1: filterData.put("ConfigURL","*clean.xml"); break; case 2: filterData.put("ConfigURL","*default.xml"); break; case 3: filterData.put("ConfigURL","*pdfprint.xml"); break; case 4: filterData.put("ConfigURL","*pdfscreen.xml"); break; case 5: filterData.put("ConfigURL","$(user)/writer2latex.xml"); filterData.put("AutoCreate","true"); break; default: // Get the actual URL from the registry String sConfigName = XPropertySetHelper.getPropertyValueAsString(xProps, "ConfigName"); Object configurations = XPropertySetHelper.getPropertyValue(xProps,"Configurations"); XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,configurations); Object config = xNameAccess.getByName(sConfigName); XPropertySet xCfgProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,config); MacroExpander expander = new MacroExpander(m_xContext); filterData.put("ConfigURL",expander.expandMacros(XPropertySetHelper.getPropertyValueAsString(xCfgProps,"ConfigURL"))); } // Read the options // General short nBackend = XPropertySetHelper.getPropertyValueAsShort(xProps,"Backend"); switch (nBackend) { case 0: filterData.put("backend","generic"); break; case 1: filterData.put("backend","pdftex"); break; case 2: filterData.put("backend","dvips"); break; case 3: filterData.put("backend","xetex"); break; case 4: filterData.put("backend","unspecified"); } short nInputencoding = XPropertySetHelper.getPropertyValueAsShort(xProps,"Inputencoding"); switch (nInputencoding) { case 0: filterData.put("inputencoding", "ascii"); break; case 1: filterData.put("inputencoding", "latin1"); break; case 2: filterData.put("inputencoding", "latin2"); break; case 3: filterData.put("inputencoding", "iso-8859-7"); break; case 4: filterData.put("inputencoding", "cp1250"); break; case 5: filterData.put("inputencoding", "cp1251"); break; case 6: filterData.put("inputencoding", "koi8-r"); break; case 7: filterData.put("inputencoding", "utf8"); } loadOption(xProps,filterData,"Multilingual","multilingual"); loadOption(xProps,filterData,"GreekMath","greek_math"); loadOption(xProps,filterData,"AdditionalSymbols","use_pifont"); loadOption(xProps,filterData,"AdditionalSymbols","use_ifsym"); loadOption(xProps,filterData,"AdditionalSymbols","use_wasysym"); loadOption(xProps,filterData,"AdditionalSymbols","use_eurosym"); loadOption(xProps,filterData,"AdditionalSymbols","use_tipa"); // Bibliography loadOption(xProps,filterData,"UseBibtex","use_bibtex"); loadOption(xProps,filterData,"BibtexStyle","bibtex_style"); // Files boolean bWrapLines = XPropertySetHelper.getPropertyValueAsBoolean(xProps,"WrapLines"); if (bWrapLines) { loadOption(xProps,filterData,"WrapLinesAfter","wrap_lines_after"); } else { filterData.put("wrap_lines_after", "0"); } loadOption(xProps,filterData,"SplitLinkedSections","split_linked_sections"); loadOption(xProps,filterData,"SplitToplevelSections","split_toplevel_sections"); loadOption(xProps,filterData,"SaveImagesInSubdir","save_images_in_subdir"); // Special content short nNotes = XPropertySetHelper.getPropertyValueAsShort(xProps, "Notes"); switch (nNotes) { case 0: filterData.put("notes","ignore"); break; case 1: filterData.put("notes","comment"); break; case 2: filterData.put("notes","pdfannotation"); break; case 3: filterData.put("notes","marginpar"); } loadOption(xProps,filterData,"Metadata","metadata"); // Figures and tables loadOption(xProps,filterData,"OriginalImageSize","original_image_size"); boolean bOptimizeSimpleTables = XPropertySetHelper.getPropertyValueAsBoolean(xProps,"OptimizeSimpleTables"); if (bOptimizeSimpleTables) { loadOption(xProps,filterData,"SimpleTableLimit","simple_table_limit"); } else { filterData.put("simple_table_limit", "0"); } loadOption(xProps,filterData,"FloatTables","float_tables"); loadOption(xProps,filterData,"FloatFigures","float_figures"); loadOption(xProps,filterData,"FloatOptions","float_options"); short nFloatOptions = XPropertySetHelper.getPropertyValueAsShort(xProps, "FloatOptions"); switch (nFloatOptions) { case 0: filterData.put("float_options", ""); break; case 1: filterData.put("float_options", "tp"); break; case 2: filterData.put("float_options", "bp"); break; case 3: filterData.put("float_options", "htp"); break; case 4: filterData.put("float_options", "hbp"); } // AutoCorrect loadOption(xProps,filterData,"IgnoreHardPageBreaks","ignore_hard_page_breaks"); loadOption(xProps,filterData,"IgnoreHardLineBreaks","ignore_hard_line_breaks"); loadOption(xProps,filterData,"IgnoreEmptyParagraphs","ignore_empty_paragraphs"); loadOption(xProps,filterData,"IgnoreDoubleSpaces","ignore_empty_spaces"); registry.disposeRegistryView(view); // Update the media properties with the FilterData PropertyHelper helper = new PropertyHelper(mediaProps); helper.put("FilterData",filterData.toArray()); mediaProps = helper.toArray(); } catch (com.sun.star.uno.Exception e) { // Failed to get registry view, ignore } } private boolean updateLocation() { String sDocumentUrl = xModel.getURL(); if (sDocumentUrl.length()!=0) { if (sDocumentUrl.startsWith("file:")) { if (System.getProperty("os.name").startsWith("Windows")) { Pattern windowsPattern = Pattern.compile("^file:///[A-Za-z][|:].*"); if (!windowsPattern.matcher(sDocumentUrl).matches()) { MessageBox msgBox = new MessageBox(m_xContext, m_xFrame); msgBox.showMessage("Please save the document on a location with a drive name!", "LaTeX does not support UNC paths"); return false; } } // Get the file name (without extension) File f = urlToFile(sDocumentUrl); sBaseFileName = f.getName(); int iDot = sBaseFileName.lastIndexOf("."); if (iDot>-1) { // remove extension sBaseFileName = sBaseFileName.substring(0,iDot); } sBaseFileName=makeTeXSafe(sBaseFileName); // Get the path int iSlash = sDocumentUrl.lastIndexOf("/"); if (iSlash>-1) { sBasePath = sDocumentUrl.substring(0,iSlash+1); } else { sBasePath = ""; } return true; } else { MessageBox msgBox = new MessageBox(m_xContext, m_xFrame); msgBox.showMessage("Please save the document locally!","LaTeX does not support documents in remote storages"); return false; } } else { MessageBox msgBox = new MessageBox(m_xContext, m_xFrame); msgBox.showMessage("Document not saved!","Please save the document before processing the file"); return false; } } private String makeTeXSafe(String sArgument) { String sResult = ""; for (int i=0; i='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9')) { sResult += Character.toString(c); } else { switch (c) { case '.': sResult += "."; break; case '-': sResult += "-"; break; case ' ' : sResult += "-"; break; case '_' : sResult += "-"; break; // Replace accented and national characters case '\u00c0' : sResult += "A"; break; case '\u00c1' : sResult += "A"; break; case '\u00c2' : sResult += "A"; break; case '\u00c3' : sResult += "A"; break; case '\u00c4' : sResult += "AE"; break; case '\u00c5' : sResult += "AA"; break; case '\u00c6' : sResult += "AE"; break; case '\u00c7' : sResult += "C"; break; case '\u00c8' : sResult += "E"; break; case '\u00c9' : sResult += "E"; break; case '\u00ca' : sResult += "E"; break; case '\u00cb' : sResult += "E"; break; case '\u00cc' : sResult += "I"; break; case '\u00cd' : sResult += "I"; break; case '\u00ce' : sResult += "I"; break; case '\u00cf' : sResult += "I"; break; case '\u00d0' : sResult += "D"; break; case '\u00d1' : sResult += "N"; break; case '\u00d2' : sResult += "O"; break; case '\u00d3' : sResult += "O"; break; case '\u00d4' : sResult += "O"; break; case '\u00d5' : sResult += "O"; break; case '\u00d6' : sResult += "OE"; break; case '\u00d8' : sResult += "OE"; break; case '\u00d9' : sResult += "U"; break; case '\u00da' : sResult += "U"; break; case '\u00db' : sResult += "U"; break; case '\u00dc' : sResult += "UE"; break; case '\u00dd' : sResult += "Y"; break; case '\u00df' : sResult += "sz"; break; case '\u00e0' : sResult += "a"; break; case '\u00e1' : sResult += "a"; break; case '\u00e2' : sResult += "a"; break; case '\u00e3' : sResult += "a"; break; case '\u00e4' : sResult += "ae"; break; case '\u00e5' : sResult += "aa"; break; case '\u00e6' : sResult += "ae"; break; case '\u00e7' : sResult += "c"; break; case '\u00e8' : sResult += "e"; break; case '\u00e9' : sResult += "e"; break; case '\u00ea' : sResult += "e"; break; case '\u00eb' : sResult += "e"; break; case '\u00ec' : sResult += "i"; break; case '\u00ed' : sResult += "i"; break; case '\u00ee' : sResult += "i"; break; case '\u00ef' : sResult += "i"; break; case '\u00f0' : sResult += "d"; break; case '\u00f1' : sResult += "n"; break; case '\u00f2' : sResult += "o"; break; case '\u00f3' : sResult += "o"; break; case '\u00f4' : sResult += "o"; break; case '\u00f5' : sResult += "o"; break; case '\u00f6' : sResult += "oe"; break; case '\u00f8' : sResult += "oe"; break; case '\u00f9' : sResult += "u"; break; case '\u00fa' : sResult += "u"; break; case '\u00fb' : sResult += "u"; break; case '\u00fc' : sResult += "ue"; break; case '\u00fd' : sResult += "y"; break; case '\u00ff' : sResult += "y"; break; } } } if (sResult.length()==0) { return "writer4latex"; } else { return sResult; } } private File urlToFile(String sUrl) { try { return new File(new URI(sUrl)); } catch (URISyntaxException e) { return new File("."); } } /*private String urlToPath(String sUrl) { try { return (new File(new URI(sUrl))).getCanonicalPath(); } catch (URISyntaxException e) { return "."; } catch (IOException e) { return "."; } }*/ }writer2latex-1.4/source/java/org/openoffice/da/comp/writer4latex/W4LRegistration.java0000644000175000017500000001247611455250660027445 0ustar renerene/************************************************************************ * * W4LRegistration.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2010 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2010-10-10) * */ package org.openoffice.da.comp.writer4latex; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XSingleServiceFactory; import com.sun.star.registry.XRegistryKey; import com.sun.star.comp.loader.FactoryHelper; /** This class provides a static method to instantiate our uno components * on demand (__getServiceFactory()), and a static method to give * information about the components (__writeRegistryServiceInfo()). * Furthermore, it saves the XMultiServiceFactory provided to the * __getServiceFactory method for future reference by the componentes. */ public class W4LRegistration { public static XMultiServiceFactory xMultiServiceFactory; /** * Returns a factory for creating the service. * This method is called by the JavaLoader * * @return returns a XSingleServiceFactory for creating the * component * * @param implName the name of the implementation for which a * service is desired * @param multiFactory the service manager to be used if needed * @param regKey the registryKey * * @see com.sun.star.comp.loader.JavaLoader */ public static XSingleServiceFactory __getServiceFactory(String implName, XMultiServiceFactory multiFactory, XRegistryKey regKey) { xMultiServiceFactory = multiFactory; XSingleServiceFactory xSingleServiceFactory = null; if (implName.equals(Writer4LaTeX.__implementationName) ) { xSingleServiceFactory = FactoryHelper.getServiceFactory(Writer4LaTeX.class, Writer4LaTeX.__serviceName, multiFactory, regKey); } else if (implName.equals(TeXImportFilter.__implementationName) ) { xSingleServiceFactory = FactoryHelper.getServiceFactory(TeXImportFilter.class, TeXImportFilter.__serviceName, multiFactory, regKey); } else if (implName.equals(TeXDetectService.__implementationName) ) { xSingleServiceFactory = FactoryHelper.getServiceFactory(TeXDetectService.class, TeXDetectService.__serviceName, multiFactory, regKey); } else if (implName.equals(ApplicationsDialog.__implementationName) ) { xSingleServiceFactory = FactoryHelper.getServiceFactory(ApplicationsDialog.class, ApplicationsDialog.__serviceName, multiFactory, regKey); } else if (implName.equals(BibliographyDialog.__implementationName) ) { xSingleServiceFactory = FactoryHelper.getServiceFactory(BibliographyDialog.class, BibliographyDialog.__serviceName, multiFactory, regKey); } else if (implName.equals(LogViewerDialog.__implementationName) ) { xSingleServiceFactory = FactoryHelper.getServiceFactory(LogViewerDialog.class, LogViewerDialog.__serviceName, multiFactory, regKey); } return xSingleServiceFactory; } /** * Writes the service information into the given registry key. * This method is called by the JavaLoader *

* @return returns true if the operation succeeded * @param regKey the registryKey * @see com.sun.star.comp.loader.JavaLoader */ public static boolean __writeRegistryServiceInfo(XRegistryKey regKey) { return FactoryHelper.writeRegistryServiceInfo(Writer4LaTeX.__implementationName, Writer4LaTeX.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(TeXImportFilter.__implementationName, TeXImportFilter.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(TeXDetectService.__implementationName, TeXDetectService.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(ApplicationsDialog.__implementationName, ApplicationsDialog.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(BibliographyDialog.__implementationName, BibliographyDialog.__serviceName, regKey) & FactoryHelper.writeRegistryServiceInfo(LogViewerDialog.__implementationName, LogViewerDialog.__serviceName, regKey); } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer4latex/TeXify.java0000644000175000017500000001427411540075666025660 0ustar renerene/************************************************************************ * * TeXify.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2010 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2011-01-25) * */ package org.openoffice.da.comp.writer4latex; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; import com.sun.star.uno.XComponentContext; /** This class builds LaTeX documents into DVI, Postscript or PDF and displays * the result. */ public final class TeXify { /** Backend format generic (dvi) */ public static final short GENERIC = 1; /** Backend format dvips (postscript) */ public static final short DVIPS = 2; /** Backend format pdfTeX (pdf) */ public static final short PDFTEX = 3; /** Backend format XeTeX (also pdf, usually) */ public static final short XETEX = 4; // Define the applications to run for each backend private static final String[] genericTexify = { ExternalApps.LATEX, ExternalApps.BIBTEX, ExternalApps.MAKEINDEX, ExternalApps.LATEX, ExternalApps.MAKEINDEX, ExternalApps.LATEX }; private static final String[] pdfTexify = { ExternalApps.PDFLATEX, ExternalApps.BIBTEX, ExternalApps.MAKEINDEX, ExternalApps.PDFLATEX, ExternalApps.MAKEINDEX, ExternalApps.PDFLATEX }; private static final String[] dvipsTexify = { ExternalApps.LATEX, ExternalApps.BIBTEX, ExternalApps.MAKEINDEX, ExternalApps.LATEX, ExternalApps.MAKEINDEX, ExternalApps.LATEX, ExternalApps.DVIPS }; private static final String[] xeTexify = { ExternalApps.XELATEX, ExternalApps.BIBTEX, ExternalApps.MAKEINDEX, ExternalApps.XELATEX, ExternalApps.MAKEINDEX, ExternalApps.XELATEX }; // Global objects //private XComponentContext xContext; private ExternalApps externalApps; public TeXify(XComponentContext xContext) { //this.xContext = xContext; externalApps = new ExternalApps(xContext); } /** Process a document * @param file the LaTeX file to process * @param sBibinputs value for the BIBINPUTS environment variable (or null if it should not be extended) * @param nBackend the desired backend format (generic, dvips, pdftex) * @param bView set the true if the result should be displayed in the viewer * @throws IOException if the document cannot be read * @return true if the first LaTeX run was successful */ public boolean process(File file, String sBibinputs, short nBackend, boolean bView) throws IOException { // Remove extension from file if (file.getName().endsWith(".tex")) { file = new File(file.getParentFile(), file.getName().substring(0,file.getName().length()-4)); } // Update external apps from registry externalApps.load(); // Process LaTeX document boolean bResult = false; if (nBackend==GENERIC) { bResult = doTeXify(genericTexify, file, sBibinputs); if (!bResult) return false; if (externalApps.execute(ExternalApps.DVIVIEWER, new File(file.getParentFile(),file.getName()+".dvi").getPath(), file.getParentFile(), null, false)>0) { throw new IOException("Error executing dvi viewer"); } } else if (nBackend==PDFTEX) { bResult = doTeXify(pdfTexify, file, sBibinputs); if (!bResult) return false; if (externalApps.execute(ExternalApps.PDFVIEWER, new File(file.getParentFile(),file.getName()+".pdf").getPath(), file.getParentFile(), null, false)>0) { throw new IOException("Error executing pdf viewer"); } } else if (nBackend==DVIPS) { bResult = doTeXify(dvipsTexify, file, sBibinputs); if (!bResult) return false; if (externalApps.execute(ExternalApps.POSTSCRIPTVIEWER, new File(file.getParentFile(),file.getName()+".ps").getPath(), file.getParentFile(), null, false)>0) { throw new IOException("Error executing postscript viewer"); } } else if (nBackend==XETEX) { bResult = doTeXify(xeTexify, file, sBibinputs); if (!bResult) return false; if (externalApps.execute(ExternalApps.PDFVIEWER, new File(file.getParentFile(),file.getName()+".pdf").getPath(), file.getParentFile(), null, false)>0) { throw new IOException("Error executing pdf viewer"); } } return bResult; } private boolean doTeXify(String[] sAppList, File file, String sBibinputs) throws IOException { // Remove the .aux file first (to avoid potential error messages) File aux = new File(file.getParentFile(), file.getName()+".aux"); aux.delete(); for (int i=0; i env =null; if (ExternalApps.BIBTEX.equals(sAppList[i]) && sBibinputs!=null) { env = new HashMap(); env.put("BIBINPUTS", sBibinputs); } int nReturnCode = externalApps.execute( sAppList[i], file.getName(), file.getParentFile(), env, true); if (i==0 && nReturnCode>0) { return false; //throw new IOException("Error executing "+sAppList[i]); } } return true; } }writer2latex-1.4/source/java/org/openoffice/da/comp/writer4latex/TeXImportFilter.java0000644000175000017500000002537412411031012027463 0ustar renerene/************************************************************************ * * TeXImportFilter.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-24) * */ package org.openoffice.da.comp.writer4latex; //import com.sun.star.lib.uno.helper.Factory; import java.io.File; import java.net.URI; import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.document.XDocumentInsertable; import com.sun.star.lang.XServiceInfo; import com.sun.star.task.XStatusIndicator; import com.sun.star.text.XTextCursor; import com.sun.star.text.XTextDocument; import com.sun.star.uno.XComponentContext; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.AnyConverter; import com.sun.star.beans.PropertyValue; import com.sun.star.lang.XInitialization; import com.sun.star.container.XNamed; import com.sun.star.document.XImporter; import com.sun.star.document.XFilter; /** This class implements an import filter for TeX documents using TeX4ht * It is thus an implementation of the service com.sun.star.document.ImportFilter */ public class TeXImportFilter extends WeakBase implements XInitialization, XNamed, XImporter, XFilter, XServiceInfo { // Constants // Identify this service public static final String __implementationName = TeXImportFilter.class.getName(); public static final String __serviceName = "com.sun.star.document.ImportFilter"; private static final String[] m_serviceNames = { __serviceName }; // Possible states of the filtering process public static final int FILTERPROC_RUNNING = 0; public static final int FILTERPROC_BREAKING = 1; public static final int FILTERPROC_STOPPED = 2; // Global data // From constructor private final XComponentContext m_xContext; // The filter name private String m_sFilterName; // The target document for the import private com.sun.star.text.XTextDocument m_xTargetDoc; // The current state of the filtering process private int m_nState; /** Construct a new TeXImportFilter * * @param xContext The Component Context */ public TeXImportFilter( XComponentContext xContext ) { m_xContext = xContext; m_sFilterName = ""; m_xTargetDoc = null; m_nState = FILTERPROC_STOPPED; } // Implement com.sun.star.lang.XServiceInfo: public String getImplementationName() { return __implementationName; } public boolean supportsService( String sService ) { int len = m_serviceNames.length; for(int i=0; i < len; i++) { if (sService.equals(m_serviceNames[i])) return true; } return false; } public String[] getSupportedServiceNames() { return m_serviceNames; } // The following methods may be called from multiple threads (e.g. if someone wants to cancel the filtering), // thus all access to class members must be synchronized // Implement XInitialization: public void initialize( Object[] arguments ) throws com.sun.star.uno.Exception { if (arguments.length>0) { // The first argument contains configuration data, from which we extract the filter name for further reference // We need this to know which flavour of TeX we're supposed to handle PropertyValue[] config = (PropertyValue[]) arguments[0]; int nLen = config.length; for (int i=0; i 0 ) { if (object[0] instanceof String) { sBaseUrl = (String) object[0]; } } } // Implement XDialogEventHandler public boolean callHandlerMethod(XDialog xDialog, Object event, String sMethod) { if (sMethod.equals("ViewLaTeXLog")) { setComboBoxText("LogContents", sLaTeXLog); } else if (sMethod.equals("ViewBibTeXLog")) { setComboBoxText("LogContents", sBibTeXLog); } else if (sMethod.equals("ViewMakeindexLog")) { setComboBoxText("LogContents", sMakeindexLog); } return true; } public String[] getSupportedMethodNames() { String[] sNames = { "ViewLaTeXLog", "ViewBibTeXLog", "ViewMakeindexLog" }; return sNames; } // Utility methods private String readTextFile(String sUrl) { StringBuilder buf = new StringBuilder(); try { File file = new File(new URI(sUrl)); if (file.exists() && file.isFile()) { InputStreamReader isr = new InputStreamReader(new FileInputStream(file)); int n; do { n = isr.read(); if (n>-1) { buf.append((char)n); } } while (n>-1); isr.close(); } } catch (URISyntaxException e) { return ""; } catch (IOException e) { return ""; } return buf.toString(); } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer4latex/BibliographyDialog.java0000644000175000017500000003250711524722053030171 0ustar renerene/************************************************************************ * * BibliographyDialog.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2011 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2011-01-31) * */ package org.openoffice.da.comp.writer4latex; import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import com.sun.star.awt.XContainerWindowEventHandler; import com.sun.star.awt.XDialog; import com.sun.star.awt.XWindow; import com.sun.star.beans.XPropertySet; import com.sun.star.frame.XDesktop; import com.sun.star.frame.XModel; import com.sun.star.lang.XComponent; import com.sun.star.lang.XServiceInfo; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Exception; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.util.XChangesBatch; import com.sun.star.lib.uno.helper.WeakBase; import org.openoffice.da.comp.w2lcommon.helper.DialogAccess; import org.openoffice.da.comp.w2lcommon.helper.FolderPicker; import org.openoffice.da.comp.w2lcommon.helper.MessageBox; import org.openoffice.da.comp.w2lcommon.helper.RegistryHelper; import org.openoffice.da.comp.w2lcommon.helper.XPropertySetHelper; /** This class provides a uno component which implements the configuration * of the bibliography in Writer4LaTeX. */ public final class BibliographyDialog extends WeakBase implements XServiceInfo, XContainerWindowEventHandler { public static final String REGISTRY_PATH = "/org.openoffice.da.Writer4LaTeX.Options/BibliographyOptions"; private XComponentContext xContext; private FolderPicker folderPicker; /** The component will be registered under this name. */ public static String __serviceName = "org.openoffice.da.writer4latex.BibliographyDialog"; /** The component should also have an implementation name. */ public static String __implementationName = "org.openoffice.da.comp.writer4latex.BibliographyDialog"; /** Create a new ConfigurationDialog */ public BibliographyDialog(XComponentContext xContext) { this.xContext = xContext; folderPicker = new FolderPicker(xContext); } // Implement XContainerWindowEventHandler public boolean callHandlerMethod(XWindow xWindow, Object event, String sMethod) throws com.sun.star.lang.WrappedTargetException { XDialog xDialog = (XDialog)UnoRuntime.queryInterface(XDialog.class, xWindow); DialogAccess dlg = new DialogAccess(xDialog); try { if (sMethod.equals("external_event") ){ return handleExternalEvent(dlg, event); } else if (sMethod.equals("ConvertZoteroCitationsChange")) { return convertZoteroCitationsChange(dlg); } else if (sMethod.equals("ConvertJabRefCitationsChange")) { return convertJabRefCitationsChange(dlg); } else if (sMethod.equals("UseExternalBibTeXFilesChange")) { return useExternalBibTeXFilesChange(dlg); } else if (sMethod.equals("UseNatbibChange")) { return useNatbibChange(dlg); } else if (sMethod.equals("BibTeXLocationChange")) { return bibTeXLocationChange(dlg); } else if (sMethod.equals("BibTeXDirClick")) { return bibTeXDirClick(dlg); } } catch (com.sun.star.uno.RuntimeException e) { throw e; } catch (com.sun.star.uno.Exception e) { throw new com.sun.star.lang.WrappedTargetException(sMethod, this, e); } return false; } public String[] getSupportedMethodNames() { String[] sNames = { "external_event", "UseExternalBibTeXFilesChange", "ConvertZoteroCitationsChange", "ConvertJabRefCitationsChange", "UseNatbibChange", "BibTeXLocationChange", "ExternalBibTeXDirClick" }; return sNames; } // Implement the interface XServiceInfo public boolean supportsService(String sServiceName) { return sServiceName.equals(__serviceName); } public String getImplementationName() { return __implementationName; } public String[] getSupportedServiceNames() { String[] sSupportedServiceNames = { __serviceName }; return sSupportedServiceNames; } // Private stuff private boolean handleExternalEvent(DialogAccess dlg, Object aEventObject) throws com.sun.star.uno.Exception { try { String sMethod = AnyConverter.toString(aEventObject); if (sMethod.equals("ok")) { saveConfiguration(dlg); return true; } else if (sMethod.equals("back") || sMethod.equals("initialize")) { loadConfiguration(dlg); enableBibTeXSettings(dlg); useNatbibChange(dlg); return true; } } catch (com.sun.star.lang.IllegalArgumentException e) { throw new com.sun.star.lang.IllegalArgumentException( "Method external_event requires a string in the event object argument.", this,(short) -1); } return false; } // Load settings from the registry into the dialog private void loadConfiguration(DialogAccess dlg) { RegistryHelper registry = new RegistryHelper(xContext); try { Object view = registry.getRegistryView(REGISTRY_PATH, false); XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,view); dlg.setCheckBoxStateAsBoolean("UseExternalBibTeXFiles", XPropertySetHelper.getPropertyValueAsBoolean(xProps, "UseExternalBibTeXFiles")); dlg.setCheckBoxStateAsBoolean("ConvertZoteroCitations", XPropertySetHelper.getPropertyValueAsBoolean(xProps, "ConvertZoteroCitations")); dlg.setCheckBoxStateAsBoolean("ConvertJabRefCitations", XPropertySetHelper.getPropertyValueAsBoolean(xProps, "ConvertJabRefCitations")); dlg.setCheckBoxStateAsBoolean("IncludeOriginalCitations", XPropertySetHelper.getPropertyValueAsBoolean(xProps, "IncludeOriginalCitations")); dlg.setListBoxSelectedItem("BibTeXLocation", XPropertySetHelper.getPropertyValueAsShort(xProps, "BibTeXLocation")); dlg.setTextFieldText("BibTeXDir", XPropertySetHelper.getPropertyValueAsString(xProps, "BibTeXDir")); dlg.setCheckBoxStateAsBoolean("UseNatbib", XPropertySetHelper.getPropertyValueAsBoolean(xProps, "UseNatbib")); dlg.setTextFieldText("NatbibOptions", XPropertySetHelper.getPropertyValueAsString(xProps, "NatbibOptions")); registry.disposeRegistryView(view); } catch (Exception e) { // Failed to get registry view } // Update dialog according to the settings convertZoteroCitationsChange(dlg); useExternalBibTeXFilesChange(dlg); } // Save settings from the dialog to the registry private void saveConfiguration(DialogAccess dlg) { RegistryHelper registry = new RegistryHelper(xContext); try { Object view = registry.getRegistryView(REGISTRY_PATH, true); XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,view); XPropertySetHelper.setPropertyValue(xProps, "UseExternalBibTeXFiles", dlg.getCheckBoxStateAsBoolean("UseExternalBibTeXFiles")); XPropertySetHelper.setPropertyValue(xProps, "ConvertZoteroCitations", dlg.getCheckBoxStateAsBoolean("ConvertZoteroCitations")); XPropertySetHelper.setPropertyValue(xProps, "ConvertJabRefCitations", dlg.getCheckBoxStateAsBoolean("ConvertJabRefCitations")); XPropertySetHelper.setPropertyValue(xProps, "IncludeOriginalCitations", dlg.getCheckBoxStateAsBoolean("IncludeOriginalCitations")); XPropertySetHelper.setPropertyValue(xProps, "BibTeXLocation", dlg.getListBoxSelectedItem("BibTeXLocation")); XPropertySetHelper.setPropertyValue(xProps, "BibTeXDir", dlg.getTextFieldText("BibTeXDir")); XPropertySetHelper.setPropertyValue(xProps, "UseNatbib", dlg.getCheckBoxStateAsBoolean("UseNatbib")); XPropertySetHelper.setPropertyValue(xProps, "NatbibOptions", dlg.getTextFieldText("NatbibOptions")); // Commit registry changes XChangesBatch xUpdateContext = (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class,view); try { xUpdateContext.commitChanges(); } catch (Exception e) { // ignore } registry.disposeRegistryView(view); } catch (Exception e) { // Failed to get registry view } } private boolean useExternalBibTeXFilesChange(DialogAccess dlg) { enableBibTeXSettings(dlg); return true; } private boolean convertZoteroCitationsChange(DialogAccess dlg) { enableBibTeXSettings(dlg); return true; } private boolean convertJabRefCitationsChange(DialogAccess dlg) { enableBibTeXSettings(dlg); return true; } private boolean useNatbibChange(DialogAccess dlg) { boolean bUseNatbib = dlg.getCheckBoxStateAsBoolean("UseNatbib"); dlg.setControlEnabled("NatbibOptionsLabel", bUseNatbib); dlg.setControlEnabled("NatbibOptions", bUseNatbib); return true; } private boolean bibTeXLocationChange(DialogAccess dlg) { enableBibTeXSettings(dlg); return true; } private void enableBibTeXSettings(DialogAccess dlg) { boolean bConvertZoteroJabRef = dlg.getCheckBoxStateAsBoolean("ConvertZoteroCitations") || dlg.getCheckBoxStateAsBoolean("ConvertJabRefCitations"); boolean bEnableLocation = dlg.getCheckBoxStateAsBoolean("UseExternalBibTeXFiles") || bConvertZoteroJabRef; boolean bEnableDir = dlg.getListBoxSelectedItem("BibTeXLocation")<2; dlg.setControlEnabled("IncludeOriginalCitations", bConvertZoteroJabRef); dlg.setControlEnabled("BibTeXLocationLabel", bEnableLocation); dlg.setControlEnabled("BibTeXLocation", bEnableLocation); dlg.setControlEnabled("BibTeXDirLabel", bEnableLocation && bEnableDir); dlg.setControlEnabled("BibTeXDir", bEnableLocation && bEnableDir); dlg.setControlEnabled("BibTeXDirButton", bEnableLocation && bEnableDir); } private String getDocumentDirURL() { // Get the desktop from the service manager Object desktop=null; try { desktop = xContext.getServiceManager().createInstanceWithContext("com.sun.star.frame.Desktop", xContext); } catch (Exception e) { // Failed to get the desktop service return ""; } XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, desktop); // Get the current component and verify that it really is a text document if (xDesktop!=null) { XComponent xComponent = xDesktop.getCurrentComponent(); XServiceInfo xInfo = (XServiceInfo)UnoRuntime.queryInterface(XServiceInfo.class, xComponent); if (xInfo!=null && xInfo.supportsService("com.sun.star.text.TextDocument")) { // Get the model, which provides the URL XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xComponent); if (xModel!=null) { String sURL = xModel.getURL(); int nSlash = sURL.lastIndexOf('/'); return nSlash>-1 ? sURL.substring(0, nSlash) : ""; } } } return ""; } private boolean hasBibTeXFiles(File dir) { if (dir.isDirectory()) { File[] files = dir.listFiles(); for (File file : files) { if (file.isFile() && file.getName().endsWith(".bib")) { return true; } } } return false; } private boolean bibTeXDirClick(DialogAccess dlg) { String sPath = folderPicker.getPath(); if (sPath!=null) { try { File bibDir = new File(new URI(sPath)); String sBibPath = bibDir.getCanonicalPath(); if (dlg.getListBoxSelectedItem("BibTeXLocation")==1) { // Path relative to document directory, remove the document directory part String sDocumentDirURL = getDocumentDirURL(); if (sDocumentDirURL.length()>0) { String sDocumentDirPath = new File(new URI(sDocumentDirURL)).getCanonicalPath(); if (sBibPath.startsWith(sDocumentDirPath)) { if (sBibPath.length()>sDocumentDirPath.length()) { sBibPath = sBibPath.substring(sDocumentDirPath.length()+1); } else { // Same as document directory sBibPath = ""; } } else { // not a subdirectory sBibPath = ""; } } } dlg.setTextFieldText("BibTeXDir", sBibPath); if (!hasBibTeXFiles(bibDir)) { MessageBox msgBox = new MessageBox(xContext); msgBox.showMessage("Writer4LaTeX warning", "The selected directory does not contain any BibTeX files"); } } catch (IOException e) { } catch (URISyntaxException e) { } } return true; } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer4latex/DeTeXtive.java0000644000175000017500000001446212411031012026257 0ustar renerene/************************************************************************ * * DeTeXtive.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-24) * */ package org.openoffice.da.comp.writer4latex; import java.io.InputStream; import java.io.InputStreamReader; import java.io.IOException; import java.util.HashSet; import org.openoffice.da.comp.w2lcommon.tex.tokenizer.Mouth; import org.openoffice.da.comp.w2lcommon.tex.tokenizer.Token; import org.openoffice.da.comp.w2lcommon.tex.tokenizer.TokenType; /** This class analyzes a stream and detects if it is a TeX stream. * Currently it is able to identify LaTeX and XeLaTeX (ConTeXt and plain TeX may be * added later). */ public class DeTeXtive { private Mouth mouth; private Token token; private HashSet packages; /** Construct a new DeTeXtive */ public DeTeXtive() { } /** Detect the format of a given stream * * @param is the input stream * @return a string representing the detected format; null if the format is unknown. * Currently the values "LaTeX", "XeLaTeX" are supported. * @throws IOException if we fail to read the stream */ public String deTeXt(InputStream is) throws IOException { // It makes no harm to assume that the stream uses ISO Latin1 - we only consider ASCII characters mouth = new Mouth(new InputStreamReader(is,"ISO8859_1")); token = mouth.getTokenObject(); packages = new HashSet(); mouth.getToken(); if (parseHeader() && parsePreamble()) { if (packages.contains("xunicode")) { return "XeLaTeX"; } else { return "LaTeX"; } } // Unknown format return null; } // The parser! // Parse a LaTeX header such as \documentclass[a4paper]{article} // Return true in case of success private boolean parseHeader() throws IOException { skipBlanks(); if (token.isCS("documentclass") || token.isCS("documentstyle")) { // The first non-blank token is \documentclass or \documentstyle => could be a LaTeX document //System.out.println("** Found "+token.toString()); mouth.getToken(); skipSpaces(); // Skip options, if any if (token.is('[',TokenType.OTHER)) { skipOptional(); skipSpaces(); } if (token.getType()==TokenType.BEGIN_GROUP) { // Get class name String sClassName = parseArgumentAsString(); //System.out.println("** Found the class name "+sClassName); // Accept any class name of one or more characters if (sClassName.length()>0) { return true; } } } //System.out.println("** Doesn't look like LaTeX; failed to get class name"); return false; } // Parse a LaTeX preamble // Return true in case of success (that is, \begin{document} was found) private boolean parsePreamble() throws IOException { while (token.getType()!=TokenType.ENDINPUT) { if (token.isCS("usepackage")) { // We collect the names of all used packages, but discard their options // (Recall that this is only relevant for LaTeX 2e) mouth.getToken(); skipSpaces(); if (token.is('[',TokenType.OTHER)) { skipOptional(); skipSpaces(); } String sName = parseArgumentAsString(); //System.out.println("** Found package "+sName); packages.add(sName); } else if (token.getType()==TokenType.BEGIN_GROUP) { // We ignore anything inside a group skipGroup(); } else if (token.isCS("begin")) { // This would usually indicate the end of the preamble mouth.getToken(); skipSpaces(); if ("document".equals(parseArgumentAsString())) { //System.out.println("Found \\begin{document}"); return true; } } else { // Any other content in the preamble is simply ignored mouth.getToken(); } } //System.out.println("** Doesn't look like LaTeX; failed to find \\begin{document}"); return false; } private void skipBlanks() throws IOException { while (token.getType()==TokenType.SPACE || token.isCS("par")) { mouth.getToken(); } } private void skipSpaces() throws IOException { // Actually, we will never get two space tokens in a row while (token.getType()==TokenType.SPACE) { mouth.getToken(); } } private void skipOptional() throws IOException { assert token.is('[', TokenType.OTHER); mouth.getToken(); // skip the [ while (!token.is(']',TokenType.OTHER) && token.getType()!=TokenType.ENDINPUT) { if (token.getType()==TokenType.BEGIN_GROUP) { skipGroup(); } else { mouth.getToken(); // skip this token } } mouth.getToken(); // skip the ] } private void skipGroup() throws IOException { assert token.getType()==TokenType.BEGIN_GROUP; mouth.getToken(); // skip the { while (token.getType()!=TokenType.END_GROUP && token.getType()!=TokenType.ENDINPUT) { if (token.getType()==TokenType.BEGIN_GROUP) { skipGroup(); } else { mouth.getToken(); // skip this token } } mouth.getToken(); // skip the } } private String parseArgumentAsString() throws IOException { if (token.getType()==TokenType.BEGIN_GROUP) { // Argument is contained in a group mouth.getToken(); // skip the { StringBuilder sb = new StringBuilder(); while (token.getType()!=TokenType.END_GROUP && token.getType()!=TokenType.ENDINPUT) { if (token.getType()!=TokenType.COMMAND_SEQUENCE) { // should not include cs, ignore if it happens sb.append(token.getChar()); } mouth.getToken(); } mouth.getToken(); // skip the } return sb.toString(); } else { // Argument is a single token String s = ""; if (token.getType()!=TokenType.COMMAND_SEQUENCE) { // should not include cs, ignore if it happens s = token.getString(); } mouth.getToken(); return s; } } } writer2latex-1.4/source/java/org/openoffice/da/comp/writer4latex/TeXDetectService.java0000644000175000017500000001177412411031012027573 0ustar renerene/************************************************************************ * * TeXDetectService.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-24) * */ package org.openoffice.da.comp.writer4latex; import java.io.IOException; import com.sun.star.lib.uno.adapter.XInputStreamToInputStreamAdapter; import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.beans.PropertyValue; import com.sun.star.document.XExtendedFilterDetection; import com.sun.star.lang.XServiceInfo; import com.sun.star.io.XInputStream; import com.sun.star.ucb.XSimpleFileAccess2; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; /** This class provides detect services for TeX documents * It is thus an implementation of the service com.sun.star.document.ExtendedTypeDetection */ public class TeXDetectService extends WeakBase implements XExtendedFilterDetection, XServiceInfo { // Constants // Identify this service public static final String __implementationName = TeXDetectService.class.getName(); public static final String __serviceName = "com.sun.star.document.ExtendedTypeDetection"; private static final String[] m_serviceNames = { __serviceName }; // The type names private static final String LATEX_FILE = "org.openoffice.da.writer4latex.LaTeX_File"; private static final String XELATEX_FILE = "org.openoffice.da.writer4latex.XeLaTeX_File"; // From constructor+initialization private final XComponentContext m_xContext; /** Construct a new TeXDetectService * * @param xContext The Component Context */ public TeXDetectService( XComponentContext xContext ) { m_xContext = xContext; } // Implement com.sun.star.lang.XServiceInfo: public String getImplementationName() { return __implementationName; } public boolean supportsService( String sService ) { int len = m_serviceNames.length; for(int i=0; i < len; i++) { if (sService.equals(m_serviceNames[i])) return true; } return false; } public String[] getSupportedServiceNames() { return m_serviceNames; } // Implement XExtendedFilterDetection public String detect(PropertyValue[][] mediaDescriptor) { // Read the media properties String sURL = null; String sTypeName = null; if (mediaDescriptor.length>0) { int nLength = mediaDescriptor[0].length; for (int i=0; iFieldMasterNameProvider * * @param xContext the component context to get the desktop from */ public FieldMasterNameProvider(XComponentContext xContext) { fieldMasterNames = new String[0]; // TODO: This code should be shared (identical with StyleNameProvider...) // Get the model for the current frame XModel xModel = null; try { Object desktop = xContext.getServiceManager().createInstanceWithContext("com.sun.star.frame.Desktop", xContext); XDesktop xDesktop = (XDesktop)UnoRuntime.queryInterface(XDesktop.class, desktop); XController xController = xDesktop.getCurrentFrame().getController(); if (xController!=null) { xModel = xController.getModel(); } } catch (Exception e) { // do nothing } // Get the field masters from the model if (xModel!=null) { XTextFieldsSupplier xSupplier = (XTextFieldsSupplier) UnoRuntime.queryInterface( XTextFieldsSupplier.class, xModel); if (xSupplier!=null) { XNameAccess xFieldMasters = xSupplier.getTextFieldMasters(); fieldMasterNames = xFieldMasters.getElementNames(); } } } /** Get the names of all field masters relative to a given prefix * * @param sPrefix the prefix to look for, e.g. "com.sun.star.text.fieldmaster.SetExpression." * @return a read only Set containing all known names with the given prefix, stripped for the prefix */ public Set getFieldMasterNames(String sPrefix) { Set names = new HashSet(); for (String sName : fieldMasterNames) { if (sName.startsWith(sPrefix)) { names.add(sName.substring(sPrefix.length())); } } return names; } } writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/helper/MacroExpander.java0000644000175000017500000000434111360606615027722 0ustar renerene/************************************************************************ * * MacroExpander.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2010 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2010-03-12) * */ package org.openoffice.da.comp.w2lcommon.helper; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.util.XMacroExpander; public class MacroExpander { private XMacroExpander xExpander; /** Convenience wrapper class for the UNO Macro Expander singleton * * @param xContext the UNO component context from which "theMacroExpander" can be created */ public MacroExpander(XComponentContext xContext) { Object expander = xContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander"); xExpander = (XMacroExpander) UnoRuntime.queryInterface (XMacroExpander.class, expander); } /** Expand macros in a string * * @param s the string * @return the expanded string */ public String expandMacros(String s) { if (xExpander!=null && s.startsWith("vnd.sun.star.expand:")) { // The string contains a macro, usually as a result of using %origin% in the registry s = s.substring(20); try { return xExpander.expandMacros(s); } catch (IllegalArgumentException e) { // Unknown macro name found, proceed and hope for the best return s; } } else { return s; } } } writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/helper/DialogAccess.java0000644000175000017500000003004712425376526027525 0ustar renerene/************************************************************************ * * DialogAccess.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-10-27) * */ package org.openoffice.da.comp.w2lcommon.helper; import com.sun.star.awt.XControl; import com.sun.star.awt.XControlContainer; import com.sun.star.awt.XControlModel; import com.sun.star.awt.XDialog; import com.sun.star.beans.XPropertySet; import com.sun.star.uno.UnoRuntime; import com.sun.star.util.Date; /** This class provides some convenient methods to access a uno dialog */ public class DialogAccess { /** The XDialog containing the controls. The subclass must override this */ private Object xDialog = null; // State of a checkbox public static final short CHECKBOX_NOT_CHECKED = 0; public static final short CHECKBOX_CHECKED = 1; public static final short CHECKBOX_DONT_KNOW = 2; public DialogAccess(XDialog xDialog) { this.xDialog = xDialog; } ////////////////////////////////////////////////////////////////////////// // Helpers to access controls in the dialog (to be used by the subclass) // Note: The helpers fail silently if an exception occurs. Could query the // the ClassId property for the control type and check that the property // exists to ensure a correct behaviour in all cases, but as long as the // helpers are used correctly, this doesn't really matter. // Get the properties of a named control in the dialog public XPropertySet getControlProperties(String sControlName) { XControlContainer xContainer = (XControlContainer) UnoRuntime.queryInterface(XControlContainer.class, xDialog); XControl xControl = xContainer.getControl(sControlName); XControlModel xModel = xControl.getModel(); XPropertySet xPropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xModel); return xPropertySet; } public boolean getControlEnabled(String sControlName) { XPropertySet xPropertySet = getControlProperties(sControlName); try { return ((Boolean) xPropertySet.getPropertyValue("Enabled")).booleanValue(); } catch (Exception e) { // Will fail if the control does not exist return false; } } public void setControlEnabled(String sControlName, boolean bEnabled) { XPropertySet xPropertySet = getControlProperties(sControlName); try { xPropertySet.setPropertyValue("Enabled", new Boolean(bEnabled)); } catch (Exception e) { // Will fail if the control does not exist } } public short getCheckBoxState(String sControlName) { XPropertySet xPropertySet = getControlProperties(sControlName); try { return ((Short) xPropertySet.getPropertyValue("State")).shortValue(); } catch (Exception e) { // Will fail if the control does not exist or is not a checkbox return CHECKBOX_DONT_KNOW; } } public boolean getCheckBoxStateAsBoolean(String sControlName) { return getCheckBoxState(sControlName)==CHECKBOX_CHECKED; } public void setCheckBoxState(String sControlName, short nState) { XPropertySet xPropertySet = getControlProperties(sControlName); try { xPropertySet.setPropertyValue("State",new Short(nState)); } catch (Exception e) { // will fail if the control does not exist or is not a checkbox or // nState has an illegal value } } public void setCheckBoxStateAsBoolean(String sControlName, boolean bChecked) { setCheckBoxState(sControlName,bChecked ? CHECKBOX_CHECKED : CHECKBOX_NOT_CHECKED); } public String[] getListBoxStringItemList(String sControlName) { XPropertySet xPropertySet = getControlProperties(sControlName); try { return (String[]) xPropertySet.getPropertyValue("StringItemList"); } catch (Exception e) { // Will fail if the control does not exist or is not a list box return new String[0]; } } public void setListBoxStringItemList(String sControlName, String[] items) { XPropertySet xPropertySet = getControlProperties(sControlName); try { xPropertySet.setPropertyValue("StringItemList",items); } catch (Exception e) { // Will fail if the control does not exist or is not a list box } } public short getListBoxSelectedItem(String sControlName) { // Returns the first selected element in case of a multiselection XPropertySet xPropertySet = getControlProperties(sControlName); try { short[] selection = (short[]) xPropertySet.getPropertyValue("SelectedItems"); return selection[0]; } catch (Exception e) { // Will fail if the control does not exist or is not a list box return -1; } } public void setListBoxSelectedItem(String sControlName, short nIndex) { XPropertySet xPropertySet = getControlProperties(sControlName); try { short[] selection = new short[1]; selection[0] = nIndex; xPropertySet.setPropertyValue("SelectedItems",selection); } catch (Exception e) { // Will fail if the control does not exist or is not a list box or // nIndex is an illegal value } } public short getListBoxLineCount(String sControlName) { XPropertySet xPropertySet = getControlProperties(sControlName); try { return ((Short) xPropertySet.getPropertyValue("LineCount")).shortValue(); } catch (Exception e) { // Will fail if the control does not exist or is not a list box return 0; } } public void setListBoxLineCount(String sControlName, short nLineCount) { XPropertySet xPropertySet = getControlProperties(sControlName); try { xPropertySet.setPropertyValue("LineCount",new Short(nLineCount)); } catch (Exception e) { // Will fail if the control does not exist or is not a list box or // nLineCount is an illegal value } } public String getComboBoxText(String sControlName) { // Returns the text of a combobox XPropertySet xPropertySet = getControlProperties(sControlName); try { return (String) xPropertySet.getPropertyValue("Text"); } catch (Exception e) { // Will fail if the control does not exist or is not a combo return ""; } } public void setComboBoxText(String sControlName, String sText) { XPropertySet xPropertySet = getControlProperties(sControlName); try { xPropertySet.setPropertyValue("Text", sText); } catch (Exception e) { // Will fail if the control does not exist or is not a combo box or // nText is an illegal value } } public String getLabelText(String sControlName) { XPropertySet xPropertySet = getControlProperties(sControlName); try { return (String) xPropertySet.getPropertyValue("Label"); } catch (Exception e) { // Will fail if the control does not exist or is not a label return ""; } } public void setLabelText(String sControlName, String sLabel) { XPropertySet xPropertySet = getControlProperties(sControlName); try { xPropertySet.setPropertyValue("Label",sLabel); } catch (Exception e) { // Will fail if the control does not exist or is not a label } } public String getTextFieldText(String sControlName) { XPropertySet xPropertySet = getControlProperties(sControlName); try { return (String) xPropertySet.getPropertyValue("Text"); } catch (Exception e) { // Will fail if the control does not exist or is not a text field return ""; } } public void setTextFieldText(String sControlName, String sText) { XPropertySet xPropertySet = getControlProperties(sControlName); try { xPropertySet.setPropertyValue("Text",sText); } catch (Exception e) { // Will fail if the control does not exist or is not a text field } } public String getFormattedFieldText(String sControlName) { XPropertySet xPropertySet = getControlProperties(sControlName); try { return (String) xPropertySet.getPropertyValue("Text"); } catch (Exception e) { // Will fail if the control does not exist or is not a formatted field return ""; } } public void setFormattedFieldText(String sControlName, String sText) { XPropertySet xPropertySet = getControlProperties(sControlName); try { xPropertySet.setPropertyValue("Text",sText); } catch (Exception e) { // Will fail if the control does not exist or is not a formatted field } } public int getDateFieldValue(String sControlName) { XPropertySet xPropertySet = getControlProperties(sControlName); try { Object dateObject = xPropertySet.getPropertyValue("Date"); if (dateObject instanceof Date) { // Since LO 4.1 Date date = (Date) dateObject; return 10000*date.Year+100*date.Month+date.Day; } else if (dateObject instanceof Integer) { // AOO and older versions of LO return ((Integer) dateObject).intValue(); } else { // The date field does not have a value return 0; } } catch (Exception e) { // Will fail if the control does not exist or is not a date field return 0; } } public void setDateFieldValue(String sControlName, int nValue) { XPropertySet xPropertySet = getControlProperties(sControlName); Date date = new Date(); date.Year = (short) (nValue/10000); date.Month = (short) ((nValue%10000)/100); date.Day = (short) (nValue%100); // TODO: Use reflection to identify the correct type of the property try { // Since LO 4.1 xPropertySet.setPropertyValue("Date", date); } catch (Exception e) { // AOO and older versions of LO try { xPropertySet.setPropertyValue("Date", nValue); } catch (Exception e1) { } } } public int getNumericFieldValue(String sControlName) { XPropertySet xPropertySet = getControlProperties(sControlName); try { return ((Double) xPropertySet.getPropertyValue("Value")).intValue(); } catch (Exception e) { // Will fail if the control does not exist or is not a numeric field return 0; } } public void setNumericFieldValue(String sControlName, int nValue) { XPropertySet xPropertySet = getControlProperties(sControlName); try { xPropertySet.setPropertyValue("Value",new Double(nValue)); } catch (Exception e) { // Will fail if the control does not exist or is not a numeric field } } }writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/helper/PropertyHelper.java0000644000175000017500000000425311164073375030163 0ustar renerene/************************************************************************ * * PropertyHelper.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2008 by Henrik Just * * All Rights Reserved. * * Version 1.0 (2008-07-21) * */ package org.openoffice.da.comp.w2lcommon.helper; import java.util.Enumeration; import java.util.Hashtable; import com.sun.star.beans.PropertyValue; /** This class provides access by name to a PropertyValue array */ public class PropertyHelper { private Hashtable data; public PropertyHelper() { data = new Hashtable(); } public PropertyHelper(PropertyValue[] props) { data = new Hashtable(); int nLen = props.length; for (int i=0; i keys() { return data.keys(); } public PropertyValue[] toArray() { int nSize = data.size(); PropertyValue[] props = new PropertyValue[nSize]; int i=0; Enumeration keys = keys(); while (keys.hasMoreElements()) { String sKey = keys.nextElement(); props[i] = new PropertyValue(); props[i].Name = sKey; props[i++].Value = get(sKey); } return props; } } writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/helper/SimpleDialog.java0000644000175000017500000000513111531425761027542 0ustar renerene/************************************************************************ * * SimpleDialog.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2011 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2011-02-23) * */ package org.openoffice.da.comp.w2lcommon.helper; import com.sun.star.awt.XDialog; import com.sun.star.awt.XDialogProvider2; import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; /** This is a simple helper class to display and access a dialog based on an * XML description (using the DialogProvider2 service). * Unlike DialogBase, this class creates a dialog without event handlers. * * TODO: Use this class in ConfigurationDialogBase */ public class SimpleDialog { private XDialog xDialog; private DialogAccess dialogAccess; /** Create a new dialog * * @param xContext the component context from which to get the service manager * @param sDialogPath the path to the dialog */ public SimpleDialog(XComponentContext xContext, String sDialogPath) { XMultiComponentFactory xMCF = xContext.getServiceManager(); try { Object provider = xMCF.createInstanceWithContext("com.sun.star.awt.DialogProvider2", xContext); XDialogProvider2 xDialogProvider = (XDialogProvider2) UnoRuntime.queryInterface(XDialogProvider2.class, provider); String sDialogUrl = "vnd.sun.star.script:"+sDialogPath+"?location=application"; xDialog = xDialogProvider.createDialog(sDialogUrl); dialogAccess = new DialogAccess(xDialog); } catch (com.sun.star.uno.Exception e) { xDialog = null; dialogAccess = null; } } /** Get the UNO dialog * * @return the dialog, or null if creation failed */ public XDialog getDialog() { return xDialog; } /** Get access to the controls of the dialog * * @return the control access helper, or null if creation failed */ public DialogAccess getControls() { return dialogAccess; } } writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/helper/FilePicker.java0000644000175000017500000000751512411031012027172 0ustar renerene/************************************************************************ * * FilePicker.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-24) * */ package org.openoffice.da.comp.w2lcommon.helper; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lang.XComponent; import com.sun.star.ui.dialogs.ExecutableDialogResults; import com.sun.star.ui.dialogs.XExecutableDialog; import com.sun.star.ui.dialogs.XFilePicker; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; public class FilePicker { private XComponentContext xContext; // The default directory for the dialog private String sDirectoryURL; /** Convenience wrapper class for the UNO file picker service * * @param xContext the UNO component context from which the file picker can be created */ public FilePicker(XComponentContext xContext) { this.xContext = xContext; sDirectoryURL = null; } /** Get one or more user selected paths with a file picker * * Warning: This does not work on all platforms when using native file pickers * (but always when using Office file pickers) * * @return array containing the path URLs or null if the dialog is canceled */ public String[] getPaths() { return getPaths(true); } /** Get a user selected path with a file picker * * @return the path URL or null if the dialog is canceled */ public String getPath() { String[] sPaths = getPaths(false); if (sPaths!=null && sPaths.length>0) { return sPaths[0]; } return null; } private String[] getPaths(boolean bAllowMultiSelection) { // Create FilePicker Object filePicker = null; try { // Note: Could be changed for OfficeFilePicker to always use internal file pickers filePicker = xContext.getServiceManager().createInstanceWithContext("com.sun.star.ui.dialogs.FilePicker", xContext); } catch (com.sun.star.uno.Exception e) { return null; } // Get the required interfaces XFilePicker xFilePicker = (XFilePicker) UnoRuntime.queryInterface(XFilePicker.class, filePicker); XExecutableDialog xExecutable = (XExecutableDialog) UnoRuntime.queryInterface(XExecutableDialog.class, xFilePicker); // Configure the file picker xFilePicker.setMultiSelectionMode(bAllowMultiSelection); if (sDirectoryURL!=null) { try { xFilePicker.setDisplayDirectory(sDirectoryURL); } catch (IllegalArgumentException e) { e.printStackTrace(); } } // Get the paths String[] sPaths = null; if (xExecutable.execute() == ExecutableDialogResults.OK) { sDirectoryURL = xFilePicker.getDisplayDirectory(); String[] sPathList = xFilePicker.getFiles(); int nCount = sPathList.length; if (nCount>1) { // According to the spec, the first entry is the path and remaining entries are file names sPaths = new String[nCount-1]; for (int i=1; i> displayNameCollection; private Map> internalNameCollection; /** Construct a new StyleNameProvider * * @param xContext the componemt context to get the desktop from */ public StyleNameProvider(XComponentContext xContext) { displayNameCollection = new HashMap>(); internalNameCollection = new HashMap>(); // Get the model for the current frame XModel xModel = null; try { Object desktop = xContext.getServiceManager().createInstanceWithContext("com.sun.star.frame.Desktop", xContext); XDesktop xDesktop = (XDesktop)UnoRuntime.queryInterface(XDesktop.class, desktop); XController xController = xDesktop.getCurrentFrame().getController(); if (xController!=null) { xModel = xController.getModel(); } } catch (Exception e) { // do nothing } // Get the styles from the model if (xModel!=null) { XStyleFamiliesSupplier xSupplier = (XStyleFamiliesSupplier) UnoRuntime.queryInterface( XStyleFamiliesSupplier.class, xModel); if (xSupplier!=null) { XNameAccess xFamilies = xSupplier.getStyleFamilies(); String[] sFamilyNames = xFamilies.getElementNames(); for (String sFamilyName : sFamilyNames) { Map displayNames = new HashMap(); displayNameCollection.put(sFamilyName, displayNames); Map internalNames = new HashMap(); internalNameCollection.put(sFamilyName, internalNames); try { XNameContainer xFamily = (XNameContainer) UnoRuntime.queryInterface( XNameContainer.class, xFamilies.getByName(sFamilyName)); if (xFamily!=null) { String[] sStyleNames = xFamily.getElementNames(); for (String sStyleName : sStyleNames) { XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, xFamily.getByName(sStyleName)); if (xProps!=null) { String sDisplayName = (String) xProps.getPropertyValue("DisplayName"); displayNames.put(sStyleName, sDisplayName); internalNames.put(sDisplayName, sStyleName); } } } } catch (WrappedTargetException e) { // ignore } catch (NoSuchElementException e) { // will not happen } catch (UnknownPropertyException e) { // will not happen } } } } } /** Get the mapping of internal names to display names for a style family * * @param sFamily the style family (for text documents this should be CharacterStyles, ParagraphStyles, FrameStyles, PageStyles or NumberingStyles) * @return a read only map from internal names to display names, or null if the family is not known to the provider */ public Map getDisplayNames(String sFamily) { if (displayNameCollection.containsKey(sFamily)) { return Collections.unmodifiableMap(displayNameCollection.get(sFamily)); } return null; } /** Get the mapping of display names to internal names for a style family * * @param sFamily the style family (for text documents this should be CharacterStyles, ParagraphStyles, FrameStyles, PageStyles or NumberingStyles) * @return a read only map from display names to internal names, or null if the family is not known to the provider */ public Map getInternalNames(String sFamily) { if (internalNameCollection.containsKey(sFamily)) { return Collections.unmodifiableMap(internalNameCollection.get(sFamily)); } return null; } } writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/helper/MessageBox.java0000644000175000017500000000735711251136744027241 0ustar renerene/************************************************************************ * * MessageBox.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2008 by Henrik Just * * All Rights Reserved. * * Version 1.0 (2008-07-21) * */ package org.openoffice.da.comp.w2lcommon.helper; import com.sun.star.awt.Rectangle; import com.sun.star.awt.WindowAttribute; import com.sun.star.awt.WindowClass; import com.sun.star.awt.WindowDescriptor; import com.sun.star.awt.XMessageBox; import com.sun.star.awt.XToolkit; import com.sun.star.awt.XWindowPeer; import com.sun.star.frame.XDesktop; import com.sun.star.frame.XFrame; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; /** This class provides simple access to a uno awt message box */ public class MessageBox { private XFrame xFrame; private XToolkit xToolkit; /** Create a new MessageBox belonging to the current frame */ public MessageBox(XComponentContext xContext) { this(xContext,null); } /** Create a new MessageBox belonging to a specific frame */ public MessageBox(XComponentContext xContext, XFrame xFrame) { try { Object toolkit = xContext.getServiceManager() .createInstanceWithContext("com.sun.star.awt.Toolkit",xContext); xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class,toolkit); if (xFrame==null) { Object desktop = xContext.getServiceManager() .createInstanceWithContext("com.sun.star.frame.Desktop",xContext); XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,desktop); xFrame = xDesktop.getCurrentFrame(); } this.xFrame = xFrame; } catch (Exception e) { // Failed to get toolkit or frame xToolkit = null; xFrame = null; } } public void showMessage(String sTitle, String sMessage) { if (xToolkit==null || xFrame==null) { return; } try { WindowDescriptor descriptor = new WindowDescriptor(); descriptor.Type = WindowClass.MODALTOP; descriptor.WindowServiceName = "infobox"; descriptor.ParentIndex = -1; descriptor.Parent = (XWindowPeer) UnoRuntime.queryInterface( XWindowPeer.class,xFrame.getContainerWindow()); descriptor.Bounds = new Rectangle(0,0,300,200); descriptor.WindowAttributes = WindowAttribute.BORDER | WindowAttribute.MOVEABLE | WindowAttribute.CLOSEABLE; XWindowPeer xPeer = xToolkit.createWindow(descriptor); if (xPeer!=null) { XMessageBox xMessageBox = (XMessageBox) UnoRuntime.queryInterface(XMessageBox.class,xPeer); if (xMessageBox!=null) { xMessageBox.setCaptionText(sTitle); xMessageBox.setMessageText(sMessage); xMessageBox.execute(); } } } catch (Exception e) { // ignore, give up... } } } writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/helper/RegistryHelper.java0000644000175000017500000000557311455250660030152 0ustar renerene/** * RegistryHelper.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2009 by Henrik Just * * All Rights Reserved. * * Version 1.2 (2009-05-01) * * */ package org.openoffice.da.comp.w2lcommon.helper; import com.sun.star.beans.PropertyValue; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; /** This class defines convenience methods to access the OOo registry * using a given base path */ public class RegistryHelper { private XComponentContext xContext; /** Construct a new RegistryHelper using a given component context * * @param xContext the context to use to create new services */ public RegistryHelper(XComponentContext xContext) { this.xContext = xContext; } /** Get a registry view relative to the given path * * @param sPath the base path within the registry * @param bUpdate true if we need update access * @return the registry view * @throws com.sun.star.uno.Exception */ public Object getRegistryView(String sPath, boolean bUpdate) throws com.sun.star.uno.Exception { //Object provider = xMSF.createInstance( Object provider = xContext.getServiceManager().createInstanceWithContext( "com.sun.star.configuration.ConfigurationProvider", xContext); XMultiServiceFactory xProvider = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class,provider); PropertyValue[] args = new PropertyValue[1]; args[0] = new PropertyValue(); args[0].Name = "nodepath"; args[0].Value = sPath; String sServiceName = bUpdate ? "com.sun.star.configuration.ConfigurationUpdateAccess" : "com.sun.star.configuration.ConfigurationAccess"; Object view = xProvider.createInstanceWithArguments(sServiceName,args); return view; } /** Dispose a previously obtained registry view * * @param view the view to dispose */ public void disposeRegistryView(Object view) { XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class,view); xComponent.dispose(); } } writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/helper/XPropertySetHelper.java0000644000175000017500000000673411176671674031006 0ustar renerene/************************************************************************ * * XPropertySetHelper.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2008 by Henrik Just * * All Rights Reserved. * * Version 1.0 (2008-07-21) * */ package org.openoffice.da.comp.w2lcommon.helper; import com.sun.star.beans.PropertyVetoException; import com.sun.star.beans.UnknownPropertyException; import com.sun.star.beans.XPropertySet; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lang.WrappedTargetException; /** Helper class providing staic convenience methods for accesing an XPropertySet * The helpers will fail silently if names or data is provided, but the user is expected to * apply them with correct data only... */ public class XPropertySetHelper { public static Object getPropertyValue(XPropertySet xProps, String sName) { try { return xProps.getPropertyValue(sName); } catch (UnknownPropertyException e) { return null; } catch (WrappedTargetException e) { return null; } } public static void setPropertyValue(XPropertySet xProps, String sName, Object value) { try { xProps.setPropertyValue(sName,value); } catch (UnknownPropertyException e) { } catch (PropertyVetoException e) { // unacceptable value } catch (IllegalArgumentException e) { } catch (WrappedTargetException e) { } } public static String getPropertyValueAsString(XPropertySet xProps, String sName) { Object value = getPropertyValue(xProps,sName); return value instanceof String ? (String) value : ""; } public static int getPropertyValueAsInteger(XPropertySet xProps, String sName) { Object value = getPropertyValue(xProps,sName); return value instanceof Integer ? ((Integer) value).intValue() : 0; } public static void setPropertyValue(XPropertySet xProps, String sName, int nValue) { setPropertyValue(xProps,sName,new Integer(nValue)); } public static short getPropertyValueAsShort(XPropertySet xProps, String sName) { Object value = getPropertyValue(xProps,sName); return value instanceof Short ? ((Short) value).shortValue() : 0; } public static void setPropertyValue(XPropertySet xProps, String sName, short nValue) { setPropertyValue(xProps,sName,new Short(nValue)); } public static boolean getPropertyValueAsBoolean(XPropertySet xProps, String sName) { Object value = getPropertyValue(xProps,sName); return value instanceof Boolean ? ((Boolean) value).booleanValue() : false; } public static void setPropertyValue(XPropertySet xProps, String sName, boolean bValue) { setPropertyValue(xProps,sName,new Boolean(bValue)); } } writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/filter/0000755000175000017500000000000012603463650024334 5ustar renerenewriter2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/filter/ByteArrayXStream.java0000644000175000017500000001652211251136744030412 0ustar renerene/************************************************************************ * * ByteArrayXStream.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2008 by Henrik Just * * All Rights Reserved. * * Version 1.0 (2008-07-22) * */ package org.openoffice.da.comp.w2lcommon.filter; // This class is based on these java uno adapter classes: // com.sun.star.lib.uno.adapter.ByteArrayToXInputStreamAdapter; // com.sun.star.lib.uno.adapter.XOutputStreamToByteArrayAdapter; // See http://go-oo.org/lxr/source/udk/javaunohelper/com/sun/star/lib/uno/adapter/XOutputStreamToByteArrayAdapter.java // and http://go-oo.org/lxr/source/udk/javaunohelper/com/sun/star/lib/uno/adapter/ByteArrayToXInputStreamAdapter.java // for original source import com.sun.star.io.XInputStream; import com.sun.star.io.XOutputStream; import com.sun.star.io.XSeekable; import com.sun.star.io.XStream; /**

This is a java-uno adapter class which implements XStream using a * byte array. (We need this because XGraphicProvider demans read/write access * when storing a graphic to a stream.)

*/ public class ByteArrayXStream implements XInputStream, XOutputStream, XSeekable, XStream { // Keep data about our byte array (we read and write to the same byte array) private int initialSize = 100240; // 10 kb private int size = 0; // The current buffer size private int position = 0; // The current write position, always<=size private int readPosition = 0; // The current read position, always<=position private boolean closed = false; // The XStream is closed private byte[] buffer; // The buffer // Constructor: Initialize the byte array public ByteArrayXStream() { size = initialSize; buffer = new byte[size]; } // Implementation of XOutputStream public void closeOutput() throws com.sun.star.io.NotConnectedException, com.sun.star.io.BufferSizeExceededException, com.sun.star.io.IOException { // trim buffer if ( buffer.length > position) { byte[] newBuffer = new byte[position]; System.arraycopy(buffer, 0, newBuffer, 0, position); buffer = newBuffer; } closed = true; } public void flush() throws com.sun.star.io.NotConnectedException, com.sun.star.io.BufferSizeExceededException, com.sun.star.io.IOException { } public void writeBytes(byte[] values) throws com.sun.star.io.NotConnectedException, com.sun.star.io.BufferSizeExceededException, com.sun.star.io.IOException { if ( values.length > size-position ) { byte[] newBuffer = null; while ( values.length > size-position ) size *= 2; newBuffer = new byte[size]; System.arraycopy(buffer, 0, newBuffer, 0, position); buffer = newBuffer; } System.arraycopy(values, 0, buffer, position, values.length); position += values.length; } // Implementation of XInputStream private void _check() throws com.sun.star.io.NotConnectedException, com.sun.star.io.IOException { if(closed) { throw new com.sun.star.io.IOException("input closed"); } } public int available() throws com.sun.star.io.NotConnectedException, com.sun.star.io.IOException { _check(); return position - readPosition; } public void closeInput() throws com.sun.star.io.NotConnectedException, com.sun.star.io.IOException { closed = true; } public int readBytes(byte[][] values, int param) throws com.sun.star.io.NotConnectedException, com.sun.star.io.BufferSizeExceededException, com.sun.star.io.IOException { _check(); try { int remain = (int)(position - readPosition); if (param > remain) param = remain; /* ARGH!!! */ if (values[0] == null){ values[0] = new byte[param]; // System.err.println("allocated new buffer of "+param+" bytes"); } System.arraycopy(buffer, readPosition, values[0], 0, param); // System.err.println("readbytes() -> "+param); readPosition += param; return param; } catch (ArrayIndexOutOfBoundsException ae) { // System.err.println("readbytes() -> ArrayIndexOutOfBounds"); ae.printStackTrace(); throw new com.sun.star.io.BufferSizeExceededException("buffer overflow"); } catch (Exception e) { // System.err.println("readbytes() -> Exception: "+e.getMessage()); e.printStackTrace(); throw new com.sun.star.io.IOException("error accessing buffer"); } } public int readSomeBytes(byte[][] values, int param) throws com.sun.star.io.NotConnectedException, com.sun.star.io.BufferSizeExceededException, com.sun.star.io.IOException { // System.err.println("readSomebytes()"); return readBytes(values, param); } public void skipBytes(int param) throws com.sun.star.io.NotConnectedException, com.sun.star.io.BufferSizeExceededException, com.sun.star.io.IOException { // System.err.println("skipBytes("+param+")"); _check(); if (param > (position - readPosition)) throw new com.sun.star.io.BufferSizeExceededException("buffer overflow"); readPosition += param; } // Implementation of XSeekable public long getLength() throws com.sun.star.io.IOException { // System.err.println("getLength() -> "+m_length); if (buffer != null) return position; else throw new com.sun.star.io.IOException("no bytes"); } public long getPosition() throws com.sun.star.io.IOException { // System.err.println("getPosition() -> "+m_pos); if (buffer != null) return readPosition; else throw new com.sun.star.io.IOException("no bytes"); } public void seek(long param) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.io.IOException { // System.err.println("seek("+param+")"); if (buffer != null) { if (param < 0 || param > position) throw new com.sun.star.lang.IllegalArgumentException("invalid seek position"); else readPosition = (int)param; } else throw new com.sun.star.io.IOException("no bytes"); } // Implementation of XStream public XInputStream getInputStream() { return this; } public XOutputStream getOutputStream() { return this; } // Get the buffer public byte[] getBuffer() { return buffer; } } writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/filter/ConfigurationDialogBase.java0000644000175000017500000007045412406234417031731 0ustar renerene/************************************************************************ * * ConfigurationDialogBase.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-09-16) * */ package org.openoffice.da.comp.w2lcommon.filter; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.HashMap; import java.util.Map; import java.util.Set; import com.sun.star.awt.XContainerWindowEventHandler; import com.sun.star.awt.XDialog; import com.sun.star.awt.XDialogProvider2; import com.sun.star.awt.XWindow; import com.sun.star.container.NoSuchElementException; import com.sun.star.io.NotConnectedException; import com.sun.star.io.XInputStream; import com.sun.star.io.XOutputStream; import com.sun.star.lang.XMultiComponentFactory; import com.sun.star.ucb.CommandAbortedException; import com.sun.star.ucb.XSimpleFileAccess2; import com.sun.star.ui.dialogs.ExecutableDialogResults; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.util.XStringSubstitution; import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.lib.uno.adapter.XInputStreamToInputStreamAdapter; import com.sun.star.lib.uno.adapter.XOutputStreamToOutputStreamAdapter; import writer2latex.api.ComplexOption; import writer2latex.api.Config; import writer2latex.api.ConverterFactory; import writer2latex.util.Misc; import org.openoffice.da.comp.w2lcommon.helper.DialogAccess; import org.openoffice.da.comp.w2lcommon.helper.FilePicker; import org.openoffice.da.comp.w2lcommon.helper.StyleNameProvider; /** This is a base implementation of a uno component which supports several option pages * with a single XContainerWindowEventHandler. The title of the dialogs * are used to differentiate between the individual pages */ public abstract class ConfigurationDialogBase extends WeakBase implements XContainerWindowEventHandler { // The full path to the configuration file we handle private String sConfigFileName = null; // The component context protected XComponentContext xContext; // File picker wrapper protected FilePicker filePicker = null; // UNO simple file access service protected XSimpleFileAccess2 sfa2 = null; // UNO path substitution protected XStringSubstitution xPathSub = null; // The configuration implementation protected Config config; // The individual page handlers (the subclass must populate this) protected Map pageHandlers = new HashMap(); // The subclass must provide these: // MIME type of the document type we configure protected abstract String getMIMEType(); // The dialog library containing the "new" and "delete" dialogs protected abstract String getDialogLibraryName(); // The file name used for persistent storage of the edited configuration protected abstract String getConfigFileName(); /** Create a new ConfigurationDialogBase */ public ConfigurationDialogBase(XComponentContext xContext) { this.xContext = xContext; // Get the file picker filePicker = new FilePicker(xContext); // Get the SimpleFileAccess service try { Object sfaObject = xContext.getServiceManager().createInstanceWithContext( "com.sun.star.ucb.SimpleFileAccess", xContext); sfa2 = (XSimpleFileAccess2) UnoRuntime.queryInterface(XSimpleFileAccess2.class, sfaObject); } catch (com.sun.star.uno.Exception e) { // failed to get SimpleFileAccess service (should not happen) } // Create the config file name try { Object psObject = xContext.getServiceManager().createInstanceWithContext( "com.sun.star.util.PathSubstitution", xContext); xPathSub = (XStringSubstitution) UnoRuntime.queryInterface(XStringSubstitution.class, psObject); sConfigFileName = xPathSub.substituteVariables("$(user)/"+getConfigFileName(), false); } catch (com.sun.star.uno.Exception e) { // failed to get PathSubstitution service (should not happen) } // Create the configuration config = ConverterFactory.createConverter(getMIMEType()).getConfig(); } // Implement XContainerWindowEventHandler public boolean callHandlerMethod(XWindow xWindow, Object event, String sMethod) throws com.sun.star.lang.WrappedTargetException { XDialog xDialog = (XDialog)UnoRuntime.queryInterface(XDialog.class, xWindow); String sTitle = xDialog.getTitle(); if (!pageHandlers.containsKey(sTitle)) { throw new com.sun.star.lang.WrappedTargetException("Unknown dialog "+sTitle); } DialogAccess dlg = new DialogAccess(xDialog); try { if (sMethod.equals("external_event") ) { return handleExternalEvent(dlg, sTitle, event); } } catch (com.sun.star.uno.RuntimeException e) { throw e; } catch (com.sun.star.uno.Exception e) { throw new com.sun.star.lang.WrappedTargetException(sMethod, this, e); } return pageHandlers.get(sTitle).handleEvent(dlg, sMethod); } private boolean handleExternalEvent(DialogAccess dlg, String sTitle, Object aEventObject) throws com.sun.star.uno.Exception { try { String sMethod = AnyConverter.toString(aEventObject); if (sMethod.equals("ok")) { loadConfig(); // The file may have been changed by other pages, thus we reload pageHandlers.get(sTitle).getControls(dlg); saveConfig(); return true; } else if (sMethod.equals("back") || sMethod.equals("initialize")) { loadConfig(); pageHandlers.get(sTitle).setControls(dlg); return true; } } catch (com.sun.star.lang.IllegalArgumentException e) { throw new com.sun.star.lang.IllegalArgumentException( "Method external_event requires a string in the event object argument.", this,(short) -1); } return false; } // Load the user configuration from file private void loadConfig() { if (sfa2!=null && sConfigFileName!=null) { try { XInputStream xIs = sfa2.openFileRead(sConfigFileName); if (xIs!=null) { InputStream is = new XInputStreamToInputStreamAdapter(xIs); config.read(is); is.close(); xIs.closeInput(); } } catch (IOException e) { // ignore } catch (NotConnectedException e) { // ignore } catch (CommandAbortedException e) { // ignore } catch (com.sun.star.uno.Exception e) { // ignore } } } // Save the user configuration private void saveConfig() { if (sfa2!=null && sConfigFileName!=null) { try { //Remove the file if it exists if (sfa2.exists(sConfigFileName)) { sfa2.kill(sConfigFileName); } // Then write the new contents XOutputStream xOs = sfa2.openFileWrite(sConfigFileName); if (xOs!=null) { OutputStream os = new XOutputStreamToOutputStreamAdapter(xOs); config.write(os); os.close(); xOs.closeOutput(); } } catch (IOException e) { // ignore } catch (NotConnectedException e) { // ignore } catch (CommandAbortedException e) { // ignore } catch (com.sun.star.uno.Exception e) { // ignore } } } // Inner class to handle the individual option pages protected abstract class PageHandler { protected abstract void getControls(DialogAccess dlg); protected abstract void setControls(DialogAccess dlg); protected abstract boolean handleEvent(DialogAccess dlg, String sMethodName); // Methods to set and get controls based on config protected void checkBoxFromConfig(DialogAccess dlg, String sCheckBoxName, String sConfigName) { dlg.setCheckBoxStateAsBoolean(sCheckBoxName, "true".equals(config.getOption(sConfigName))); } protected void checkBoxToConfig(DialogAccess dlg, String sCheckBoxName, String sConfigName) { config.setOption(sConfigName, Boolean.toString(dlg.getCheckBoxStateAsBoolean(sCheckBoxName))); } protected void textFieldFromConfig(DialogAccess dlg, String sTextBoxName, String sConfigName) { dlg.setTextFieldText(sTextBoxName, config.getOption(sConfigName)); } protected void textFieldToConfig(DialogAccess dlg, String sTextBoxName, String sConfigName) { config.setOption(sConfigName, dlg.getTextFieldText(sTextBoxName)); } protected void listBoxFromConfig(DialogAccess dlg, String sListBoxName, String sConfigName, String[] sConfigValues, short nDefault) { String sCurrentValue = config.getOption(sConfigName); int nCount = sConfigValues.length; for (short i=0; i=0 && deleteItem(sItems[nSelected])) { int nOldLen = sItems.length; String[] sNewItems = new String[nOldLen-1]; if (nSelected>0) { System.arraycopy(sItems, 0, sNewItems, 0, nSelected); } if (nSelected suggestions) { XDialog xDialog=getDialog(getDialogLibraryName()+".NewDialog"); if (xDialog!=null) { String[] sItems = Misc.sortStringSet(suggestions); DialogAccess ndlg = new DialogAccess(xDialog); ndlg.setListBoxStringItemList("Name", sItems); String sResult = null; if (xDialog.execute()==ExecutableDialogResults.OK) { DialogAccess dlg = new DialogAccess(xDialog); sResult = dlg.getTextFieldText("Name"); } xDialog.endExecute(); return sResult; } return null; } protected String appendItem(DialogAccess dlg, String sListName, Set suggestions) { String[] sItems = dlg.getListBoxStringItemList(sListName); String sNewItem = newItem(suggestions); if (sNewItem!=null) { int nOldLen = sItems.length; for (short i=0; i attr); protected abstract void setControls(DialogAccess dlg, Map attr); protected abstract void clearControls(DialogAccess dlg); protected abstract void prepareControls(DialogAccess dlg, boolean bHasDefinitions); // Constructor protected StylesPageHandler(int nCount) { // Get the style name provider styleNameProvider = new StyleNameProvider(xContext); // Reset the options styleMap = new ComplexOption[nCount]; for (int i=0; i displayNames = styleNameProvider.getDisplayNames(sOOoFamilyNames[i]); copyStyles(configMap, styleMap[i], displayNames); } // Display paragraph maps first nCurrentFamily = -1; sCurrentStyleName = null; dlg.setListBoxSelectedItem("StyleFamily", (short)1); styleFamilyChange(dlg); } protected void getControls(DialogAccess dlg) { updateStyleMaps(dlg); // Save style maps to config (translating keys back to internal names) int nCount = sFamilyNames.length; for (int i=0; i internalNames = styleNameProvider.getInternalNames(sOOoFamilyNames[i]); copyStyles(styleMap[i], configMap, internalNames); } } protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("StyleFamilyChange")) { styleFamilyChange(dlg); return true; } else if (sMethod.equals("StyleNameChange")) { styleNameChange(dlg); return true; } else if (sMethod.equals("NewStyleClick")) { newStyleClick(dlg); return true; } else if (sMethod.equals("DeleteStyleClick")) { deleteStyleClick(dlg); return true; } else if (sMethod.equals("LoadDefaultsClick")) { loadDefaultsClick(dlg); return true; } return false; } // Internal methods private void updateStyleMaps(DialogAccess dlg) { // Save the current style map, if any if (nCurrentFamily>-1 && sCurrentStyleName!=null) { getControls(dlg,styleMap[nCurrentFamily].get(sCurrentStyleName)); } } private void styleFamilyChange(DialogAccess dlg) { short nNewFamily = dlg.getListBoxSelectedItem("StyleFamily"); if (nNewFamily>-1 && nNewFamily!=nCurrentFamily) { // The user has changed the family; load and display the corresponding style names updateStyleMaps(dlg); nCurrentFamily = nNewFamily; sCurrentStyleName = null; String[] sStyleNames = Misc.sortStringSet(styleMap[nNewFamily].keySet()); dlg.setListBoxStringItemList("StyleName", sStyleNames); if (sStyleNames.length>0) { dlg.setListBoxSelectedItem("StyleName", (short)0); } else { dlg.setListBoxSelectedItem("StyleName", (short)-1); } updateStyleControls(dlg); styleNameChange(dlg); } } private void styleNameChange(DialogAccess dlg) { if (nCurrentFamily>-1) { updateStyleMaps(dlg); short nStyleNameItem = dlg.getListBoxSelectedItem("StyleName"); if (nStyleNameItem>=0) { sCurrentStyleName = dlg.getListBoxStringItemList("StyleName")[nStyleNameItem]; setControls(dlg,styleMap[nCurrentFamily].get(sCurrentStyleName)); } else { sCurrentStyleName = null; clearControls(dlg); } } } private void newStyleClick(DialogAccess dlg) { if (nCurrentFamily>-1) { updateStyleMaps(dlg); // Invalidate current style name in any case (appendItem returns null if the user // selects an existing style, but it still changes the current item) sCurrentStyleName = null; String sNewName = appendItem(dlg, "StyleName",styleNameProvider.getInternalNames(sOOoFamilyNames[nCurrentFamily]).keySet()); if (sNewName!=null) { styleMap[nCurrentFamily].put(sNewName, new HashMap()); clearControls(dlg); } styleNameChange(dlg); updateStyleControls(dlg); } } private void deleteStyleClick(DialogAccess dlg) { if (nCurrentFamily>-1 && sCurrentStyleName!=null) { String sStyleName = sCurrentStyleName; if (deleteCurrentItem(dlg,"StyleName")) { styleMap[nCurrentFamily].remove(sStyleName); sCurrentStyleName=null; styleNameChange(dlg); } updateStyleControls(dlg); } } private void loadDefaultsClick(DialogAccess dlg) { updateStyleMaps(dlg); // Count styles that we will overwrite Config clean = ConverterFactory.createConverter(getMIMEType()).getConfig(); clean.readDefaultConfig(getDefaultConfigName()); int nCount = 0; int nFamilyCount = sFamilyNames.length; for (int i=0; i displayNames = styleNameProvider.getDisplayNames(sOOoFamilyNames[i]); for (String sName : cleanMap.keySet()) { String sDisplayName = (displayNames!=null && displayNames.containsKey(sName)) ? displayNames.get(sName) : ""; if (styleMap[i].containsKey(sDisplayName)) { nCount++; } } } // Display confirmation dialog boolean bConfirm = false; XDialog xDialog=getDialog(getDialogLibraryName()+".LoadDefaults"); if (xDialog!=null) { DialogAccess ldlg = new DialogAccess(xDialog); if (nCount>0) { String sLabel = ldlg.getLabelText("OverwriteLabel"); sLabel = sLabel.replaceAll("%s", Integer.toString(nCount)); ldlg.setLabelText("OverwriteLabel", sLabel); } else { ldlg.setLabelText("OverwriteLabel", ""); } bConfirm = xDialog.execute()==ExecutableDialogResults.OK; xDialog.endExecute(); } // Do the replacement if (bConfirm) { for (int i=0; i displayNames = styleNameProvider.getDisplayNames(sOOoFamilyNames[i]); copyStyles(cleanMap, styleMap[i], displayNames); } } // Force update of the user interface nCurrentFamily = -1; sCurrentStyleName = null; styleFamilyChange(dlg); } private void updateStyleControls(DialogAccess dlg) { boolean bHasMappings = dlg.getListBoxStringItemList("StyleName").length>0; dlg.setControlEnabled("DeleteStyleButton", bHasMappings); prepareControls(dlg,bHasMappings); } private void copyStyles(ComplexOption source, ComplexOption target, Map nameTranslation) { for (String sName : source.keySet()) { String sNewName = sName; if (nameTranslation!=null && nameTranslation.containsKey(sName)) { sNewName = nameTranslation.get(sName); } target.copy(sNewName, source.get(sName)); } } } protected abstract class AttributePageHandler extends PageHandler { // The subclass must define this protected String[] sAttributeNames; // Our data private ComplexOption attributeMap = new ComplexOption(); private int nCurrentAttribute = -1; // Some methods to be implemented by subclass protected abstract void getControls(DialogAccess dlg, Map attr); protected abstract void setControls(DialogAccess dlg, Map attr); protected abstract void prepareControls(DialogAccess dlg, boolean bEnable); // Implement abstract methods from our super protected void setControls(DialogAccess dlg) { // Load attribute maps from config attributeMap.clear(); attributeMap.copyAll(config.getComplexOption("text-attribute-map")); // Update the dialog nCurrentAttribute = -1; dlg.setListBoxSelectedItem("FormattingAttribute", (short)0); formattingAttributeChange(dlg); } protected void getControls(DialogAccess dlg) { updateAttributeMaps(dlg); // Save attribute maps to config ComplexOption configMap = config.getComplexOption("text-attribute-map"); configMap.clear(); for (String s: attributeMap.keySet()) { Map attr = attributeMap.get(s); if (!attr.containsKey("deleted") || attr.get("deleted").equals("false")) { configMap.copy(s, attr); } } } protected boolean handleEvent(DialogAccess dlg, String sMethod) { if (sMethod.equals("FormattingAttributeChange")) { formattingAttributeChange(dlg); return true; } else if (sMethod.equals("CustomAttributeChange")) { customAttributeChange(dlg); return true; } return false; } // Internal methods private void updateAttributeMaps(DialogAccess dlg) { // Save the current attribute map, if any if (nCurrentAttribute>-1) { String sName = sAttributeNames[nCurrentAttribute]; if (!attributeMap.containsKey(sName)) { attributeMap.put(sName, new HashMap()); } Map attr = attributeMap.get(sName); attr.put("deleted", Boolean.toString(!dlg.getCheckBoxStateAsBoolean("CustomAttribute"))); getControls(dlg,attr); attributeMap.put(sName, attr); } } private void formattingAttributeChange(DialogAccess dlg) { updateAttributeMaps(dlg); short nNewAttribute = dlg.getListBoxSelectedItem("FormattingAttribute"); if (nNewAttribute>-1 && nNewAttribute!=nCurrentAttribute) { nCurrentAttribute = nNewAttribute; String sName = sAttributeNames[nCurrentAttribute]; if (!attributeMap.containsKey(sName)) { attributeMap.put(sName, new HashMap()); attributeMap.get(sName).put("deleted", "true"); } Map attr = attributeMap.get(sName); dlg.setCheckBoxStateAsBoolean("CustomAttribute", !attr.containsKey("deleted") || attr.get("deleted").equals("false")); customAttributeChange(dlg); setControls(dlg,attr); } } private void customAttributeChange(DialogAccess dlg) { prepareControls(dlg,dlg.getCheckBoxStateAsBoolean("CustomAttribute")); } } } writer2latex-1.4/source/java/org/openoffice/da/comp/w2lcommon/filter/OptionsDialogBase.java0000644000175000017500000005253612425376526030567 0ustar renerene/************************************************************************ * * OptionsDialogBase.java * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License version 2.1, as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * * Copyright: 2002-2014 by Henrik Just * * All Rights Reserved. * * Version 1.4 (2014-11-01) * */ package org.openoffice.da.comp.w2lcommon.filter; import java.util.HashSet; import com.sun.star.awt.XDialogEventHandler; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertyAccess; import com.sun.star.beans.XPropertySet; import com.sun.star.container.XNameAccess; import com.sun.star.document.XDocumentPropertiesSupplier; import com.sun.star.frame.XDesktop; import com.sun.star.lang.XComponent; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.lang.XServiceInfo; import com.sun.star.lang.XServiceName; import com.sun.star.lang.XTypeProvider; import com.sun.star.ui.dialogs.XExecutableDialog; import com.sun.star.uno.Type; import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XComponentContext; import com.sun.star.util.XChangesBatch; import org.openoffice.da.comp.w2lcommon.helper.DialogBase; import org.openoffice.da.comp.w2lcommon.helper.MacroExpander; import org.openoffice.da.comp.w2lcommon.helper.PropertyHelper; import org.openoffice.da.comp.w2lcommon.helper.XPropertySetHelper; /** This class provides an abstract uno component which implements a filter ui */ public abstract class OptionsDialogBase extends DialogBase implements XPropertyAccess { // Filter ui requires XExecutableDialog + XPropertyAccess ////////////////////////////////////////////////////////////////////////// // The subclass must override the following; and override the // implementation of XDialogEventHandler if needed /** Load settings from the registry to the dialog * The subclass must implement this */ protected abstract void loadSettings(XPropertySet xRegistryProps); /** Save settings from the dialog to the registry and create FilterData * The subclass must implement this */ protected abstract void saveSettings(XPropertySet xRegistryProps, PropertyHelper filterData); /** Return the name of the library containing the dialog */ public abstract String getDialogLibraryName(); /** Return the name of the dialog within the library */ public abstract String getDialogName(); /** Return the path to the options in the registry */ public abstract String getRegistryPath(); /** Create a new OptionsDialogBase */ public OptionsDialogBase(XComponentContext xContext) { super(xContext); this.xMSF = null; // must be set properly by subclass mediaProps = null; sConfigNames = null; lockedOptions = new HashSet(); } ////////////////////////////////////////////////////////////////////////// // Implement some methods required by DialogBase /** Initialize the dialog (eg. with settings from the registry) */ public void initialize() { try { // Prepare registry view Object view = getRegistryView(false); XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,view); // Load settings using method from subclass loadSettings(xProps); // Dispose the registry view disposeRegistryView(view); } catch (com.sun.star.uno.Exception e) { // Failed to get registry view } } /** Finalize the dialog after execution (eg. save settings to the registry) */ public void endDialog() { try { // Prepare registry view Object rwview = getRegistryView(true); XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,rwview); // Save settings and create FilterData using method from subclass PropertyHelper filterData = new PropertyHelper(); saveSettings(xProps, filterData); // Commit registry changes XChangesBatch xUpdateContext = (XChangesBatch) UnoRuntime.queryInterface(XChangesBatch.class,rwview); try { xUpdateContext.commitChanges(); } catch (Exception e) { // ignore } // Dispose the registry view disposeRegistryView(rwview); // Update the media properties with the FilterData PropertyHelper helper = new PropertyHelper(mediaProps); helper.put("FilterData",filterData.toArray()); mediaProps = helper.toArray(); } catch (com.sun.star.uno.Exception e) { // Failed to get registry view } } ////////////////////////////////////////////////////////////////////////// // Some private global variables // The service factory protected XMultiServiceFactory xMSF; // The media properties (set/get via XPropertyAccess implementation) private PropertyValue[] mediaProps; // Configuration names (stored during execution of dialog) private String[] sConfigNames; // Set of locked controls private HashSet lockedOptions; ////////////////////////////////////////////////////////////////////////// // Some private utility methods // Get the template name from the document with ui focus private String getTemplateName() { try { // Get current component Object desktop = xContext.getServiceManager() .createInstanceWithContext("com.sun.star.frame.Desktop",xContext); XDesktop xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,desktop); XComponent xComponent = xDesktop.getCurrentComponent(); // Get the document info property set XDocumentPropertiesSupplier xDocPropsSuppl = UnoRuntime.queryInterface(XDocumentPropertiesSupplier.class, xComponent); return xDocPropsSuppl.getDocumentProperties().getTemplateName(); } catch (Exception e) { return ""; } } // Get a view of the options root in the registry private Object getRegistryView(boolean bUpdate) throws com.sun.star.uno.Exception { Object provider = xMSF.createInstance( "com.sun.star.configuration.ConfigurationProvider"); XMultiServiceFactory xProvider = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class,provider); PropertyValue[] args = new PropertyValue[1]; args[0] = new PropertyValue(); args[0].Name = "nodepath"; args[0].Value = getRegistryPath(); String sServiceName = bUpdate ? "com.sun.star.configuration.ConfigurationUpdateAccess" : "com.sun.star.configuration.ConfigurationAccess"; Object view = xProvider.createInstanceWithArguments(sServiceName,args); return view; } // Dispose a previously obtained registry view private void disposeRegistryView(Object view) { XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class,view); xComponent.dispose(); } ////////////////////////////////////////////////////////////////////////// // Implement uno interfaces // Override getTypes() from the interface XTypeProvider public Type[] getTypes() { Type[] typeReturn = {}; try { typeReturn = new Type[] { new Type( XServiceName.class ), new Type( XServiceInfo.class ), new Type( XTypeProvider.class ), new Type( XExecutableDialog.class ), new Type( XPropertyAccess.class ), new Type( XDialogEventHandler.class ) }; } catch(Exception exception) { } return typeReturn; } // Implement the interface XPropertyAccess public PropertyValue[] getPropertyValues() { return mediaProps; } public void setPropertyValues(PropertyValue[] props) { mediaProps = props; } ////////////////////////////////////////////////////////////////////////// // Various utility methods to be used by the sublasses // Helpers to load and save settings protected void updateLockedOptions() { lockedOptions.clear(); short nItem = getListBoxSelectedItem("Config"); int nStdConfigs = getListBoxStringItemList("Config").length - sConfigNames.length; if (nItem>=nStdConfigs) { // Get current configuration name String sName = sConfigNames[nItem-nStdConfigs]; try { // Prepare registry view Object view = getRegistryView(false); XPropertySet xProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,view); // Get the available configurations Object configurations = XPropertySetHelper.getPropertyValue(xProps,"Configurations"); XNameAccess xConfigurations = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,configurations); // Get the LockedOptions node from the desired configuration String sLockedOptions = ""; Object config = xConfigurations.getByName(sName); XPropertySet xCfgProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,config); sLockedOptions = XPropertySetHelper.getPropertyValueAsString(xCfgProps,"LockedOptions"); // Dispose the registry view disposeRegistryView(view); // Feed lockedOptions with the comma separated list of options int nStart = 0; for (int i=0; i=nStdConfigs) { // only handle registry configurations int i = nConfig-nStdConfigs; XPropertySetHelper.setPropertyValue(xProps,"ConfigName",sConfigNames[i]); try { Object config = xNameAccess.getByName(sConfigNames[i]); XPropertySet xCfgProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,config); MacroExpander expander = new MacroExpander(xContext); filterData.put("ConfigURL",expander.expandMacros(XPropertySetHelper.getPropertyValueAsString(xCfgProps,"ConfigURL"))); filterData.put("TemplateURL",expander.expandMacros(XPropertySetHelper.getPropertyValueAsString(xCfgProps,"TargetTemplateURL"))); filterData.put("StyleSheetURL",expander.expandMacros(XPropertySetHelper.getPropertyValueAsString(xCfgProps,"StyleSheetURL"))); // The resources are provided as a set Object resources = XPropertySetHelper.getPropertyValue(xCfgProps,"Resources"); XNameAccess xResourceNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,resources); if (xResourceNameAccess!=null) { StringBuilder buf = new StringBuilder(); String[] sResourceNames = xResourceNameAccess.getElementNames(); for (String sName : sResourceNames) { Object resource = xResourceNameAccess.getByName(sName); XPropertySet xResourceProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,resource); String sURL = expander.expandMacros(XPropertySetHelper.getPropertyValueAsString(xResourceProps,"URL")); String sFileName = expander.expandMacros(XPropertySetHelper.getPropertyValueAsString(xResourceProps,"FileName")); String sMediaType = expander.expandMacros(XPropertySetHelper.getPropertyValueAsString(xResourceProps,"MediaType")); if (buf.length()>0) { buf.append(';'); } buf.append(sURL).append("::").append(sFileName).append("::").append(sMediaType); } filterData.put("Resources",buf.toString()); } } catch (Exception e) { } } else { // Standard configurations have no name XPropertySetHelper.setPropertyValue(xProps,"ConfigName",""); } XPropertySetHelper.setPropertyValue(xProps,"Config",nConfig); return nConfig; } // Check box option (boolean) protected boolean loadCheckBoxOption(XPropertySet xProps, String sName) { boolean bValue = XPropertySetHelper.getPropertyValueAsBoolean(xProps,sName); setCheckBoxStateAsBoolean(sName, bValue); return bValue; } protected boolean saveCheckBoxOption(XPropertySet xProps, String sName) { boolean bValue = getCheckBoxStateAsBoolean(sName); XPropertySetHelper.setPropertyValue(xProps, sName, bValue); return bValue; } protected boolean saveCheckBoxOption(XPropertySet xProps, PropertyHelper filterData, String sName, String sOptionName) { boolean bValue = saveCheckBoxOption(xProps, sName); if (!isLocked(sOptionName)) { filterData.put(sOptionName, Boolean.toString(bValue)); } return bValue; } // List box option protected short loadListBoxOption(XPropertySet xProps, String sName) { short nValue = XPropertySetHelper.getPropertyValueAsShort(xProps, sName); setListBoxSelectedItem(sName ,nValue); return nValue; } protected short saveListBoxOption(XPropertySet xProps, String sName) { short nValue = getListBoxSelectedItem(sName); XPropertySetHelper.setPropertyValue(xProps, sName, nValue); return nValue; } protected short saveListBoxOption(XPropertySet xProps, PropertyHelper filterData, String sName, String sOptionName, String[] sValues) { short nValue = saveListBoxOption(xProps, sName); if (!isLocked(sOptionName) && (nValue>=0) && (nValue