Add support for before/after attributes in xhtml style maps

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@187 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2014-10-27 06:56:26 +00:00
parent 049bf052bc
commit de72a4f49e
16 changed files with 201 additions and 86 deletions

View file

@ -2,6 +2,9 @@ Changelog for Writer2LaTeX version 1.4 -> 1.6
---------- version 1.5.1 ---------- ---------- version 1.5.1 ----------
[w2x] Style maps for paragraphs and headings now support the attributes before and after. These define fixed texts
to add before/after the content. (This is similar to the pseudo-elements ::before and ::after in CSS.)
[w4l] Replaced menu with a toolbar with four buttons: Insert BibTeX citation (not yet implemented), publish to LaTeX, [w4l] Replaced menu with a toolbar with four buttons: Insert BibTeX citation (not yet implemented), publish to LaTeX,
view log files and edit custom format. (Publishing without showing the dialog is currently removed.) view log files and edit custom format. (Publishing without showing the dialog is currently removed.)

Binary file not shown.

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.4 (2014-09-23) * Version 1.4 (2014-09-26)
* *
*/ */
@ -363,6 +363,18 @@ public class ConfigurationDialog extends ConfigurationDialogBase implements XSer
if (!attr.containsKey("css")) { attr.put("css", ""); } if (!attr.containsKey("css")) { attr.put("css", ""); }
dlg.setComboBoxText("Element", attr.get("element")); dlg.setComboBoxText("Element", attr.get("element"));
dlg.setTextFieldText("Css", none2empty(attr.get("css"))); dlg.setTextFieldText("Css", none2empty(attr.get("css")));
if (nCurrentFamily==1 || nCurrentFamily==2) {
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"));
}
else {
dlg.setTextFieldText("Before", "");
dlg.setTextFieldText("After", "");
}
if (nCurrentFamily==1 || nCurrentFamily==2) { if (nCurrentFamily==1 || nCurrentFamily==2) {
if (!attr.containsKey("block-element")) { attr.put("block-element", ""); } if (!attr.containsKey("block-element")) { attr.put("block-element", ""); }
if (!attr.containsKey("block-css")) { attr.put("block-css", ""); } if (!attr.containsKey("block-css")) { attr.put("block-css", ""); }
@ -378,6 +390,10 @@ public class ConfigurationDialog extends ConfigurationDialogBase implements XSer
protected void getControls(DialogAccess dlg, Map<String,String> attr) { protected void getControls(DialogAccess dlg, Map<String,String> attr) {
attr.put("element", dlg.getComboBoxText("Element")); attr.put("element", dlg.getComboBoxText("Element"));
attr.put("css", empty2none(dlg.getTextFieldText("Css"))); attr.put("css", empty2none(dlg.getTextFieldText("Css")));
if (nCurrentFamily==1 || nCurrentFamily==2) {
attr.put("before", dlg.getTextFieldText("Before"));
attr.put("after", dlg.getTextFieldText("After"));
}
if (nCurrentFamily==1 || nCurrentFamily==2) { if (nCurrentFamily==1 || nCurrentFamily==2) {
attr.put("block-element", dlg.getComboBoxText("BlockElement")); attr.put("block-element", dlg.getComboBoxText("BlockElement"));
attr.put("block-css", empty2none(dlg.getTextFieldText("BlockCss"))); attr.put("block-css", empty2none(dlg.getTextFieldText("BlockCss")));
@ -387,6 +403,8 @@ public class ConfigurationDialog extends ConfigurationDialogBase implements XSer
protected void clearControls(DialogAccess dlg) { protected void clearControls(DialogAccess dlg) {
dlg.setComboBoxText("Element", ""); dlg.setComboBoxText("Element", "");
dlg.setTextFieldText("Css", ""); dlg.setTextFieldText("Css", "");
dlg.setTextFieldText("Before", "");
dlg.setTextFieldText("After", "");
dlg.setComboBoxText("BlockElement", ""); dlg.setComboBoxText("BlockElement", "");
dlg.setTextFieldText("BlockCss", ""); dlg.setTextFieldText("BlockCss", "");
} }
@ -397,7 +415,11 @@ public class ConfigurationDialog extends ConfigurationDialogBase implements XSer
dlg.setControlEnabled("ElementLabel", bHasMappings && nCurrentFamily<=2); dlg.setControlEnabled("ElementLabel", bHasMappings && nCurrentFamily<=2);
dlg.setControlEnabled("Element", bHasMappings && nCurrentFamily<=2); dlg.setControlEnabled("Element", bHasMappings && nCurrentFamily<=2);
dlg.setControlEnabled("CssLabel", bHasMappings); dlg.setControlEnabled("CssLabel", bHasMappings);
dlg.setControlEnabled("Css", bHasMappings); dlg.setControlEnabled("Css", bHasMappings);
dlg.setControlEnabled("BeforeLabel", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2));
dlg.setControlEnabled("Before", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2));
dlg.setControlEnabled("AfterLabel", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2));
dlg.setControlEnabled("After", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2));
dlg.setControlEnabled("BlockElementLabel", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2)); dlg.setControlEnabled("BlockElementLabel", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2));
dlg.setControlEnabled("BlockElement", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2)); dlg.setControlEnabled("BlockElement", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2));
dlg.setControlEnabled("BlockCssLabel", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2)); dlg.setControlEnabled("BlockCssLabel", bHasMappings && (nCurrentFamily==1 || nCurrentFamily==2));

View file

@ -34,9 +34,6 @@ import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import com.sun.star.beans.PropertyValue;
import com.sun.star.frame.XDispatchHelper;
import com.sun.star.frame.XDispatchProvider;
import com.sun.star.frame.XFrame; import com.sun.star.frame.XFrame;
import com.sun.star.lang.XComponent; import com.sun.star.lang.XComponent;
import com.sun.star.lib.uno.helper.WeakBase; import com.sun.star.lib.uno.helper.WeakBase;

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.4 (2014-09-16) * Version 1.6 (2014-10-24)
* *
*/package writer2latex.xhtml; */package writer2latex.xhtml;
@ -82,9 +82,10 @@ public class HeadingStyleConverter extends StyleConverterHelper {
String sDisplayName = style.getDisplayName(); String sDisplayName = style.getDisplayName();
if (styleMap.contains(sDisplayName)) { if (styleMap.contains(sDisplayName)) {
// Apply attributes as specified in style map from user // Apply attributes as specified in style map from user
info.sTagName = styleMap.getBlockElement(sDisplayName); XhtmlStyleMapItem map = styleMap.get(sDisplayName);
if (!"(none)".equals(styleMap.getBlockCss(sDisplayName))) { info.sTagName = map.sBlockElement;
info.sClass = styleMap.getBlockCss(sDisplayName); if (!"(none)".equals(map.sBlockCss)) {
info.sClass = map.sBlockCss;
} }
} }
else { else {
@ -113,9 +114,10 @@ public class HeadingStyleConverter extends StyleConverterHelper {
String sDisplayName = style.getDisplayName(); String sDisplayName = style.getDisplayName();
if (styleMap.contains(sDisplayName)) { if (styleMap.contains(sDisplayName)) {
// Apply attributes as specified in style map from user // Apply attributes as specified in style map from user
info.sTagName = styleMap.getElement(sDisplayName); XhtmlStyleMapItem map = styleMap.get(sDisplayName);
if (!"(none)".equals(styleMap.getCss(sDisplayName))) { info.sTagName = map.sElement;
info.sClass = styleMap.getCss(sDisplayName); if (!"(none)".equals(map.sCss)) {
info.sClass = map.sCss;
} }
} }
} }

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.4 (2014-09-16) * Version 1.6 (2014-10-24)
* *
*/ */
@ -64,11 +64,12 @@ public class ListStyleConverter extends StyleConverterHelper {
else { else {
String sDisplayName = style.getDisplayName(); String sDisplayName = style.getDisplayName();
if (styleMap.contains(sDisplayName)) { if (styleMap.contains(sDisplayName)) {
if (styleMap.getElement(sDisplayName).length()>0) { XhtmlStyleMapItem map = styleMap.get(sDisplayName);
info.sTagName = styleMap.getElement(sDisplayName); if (map.sElement.length()>0) {
info.sTagName = map.sElement;
} }
if (!"(none)".equals(styleMap.getCss(sDisplayName))) { if (!"(none)".equals(map.sCss)) {
info.sClass = styleMap.getCss(sDisplayName); info.sClass = map.sCss;
} }
} }
else { else {

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.4 (2014-09-16) * Version 1.6 (2014-10-24)
* *
*/ */
@ -73,11 +73,12 @@ public abstract class StyleWithPropertiesConverterHelper
String sDisplayName = style.getDisplayName(); String sDisplayName = style.getDisplayName();
if (styleMap.contains(sDisplayName)) { if (styleMap.contains(sDisplayName)) {
// Apply attributes as specified in style map from user // Apply attributes as specified in style map from user
if (styleMap.getElement(sDisplayName).length()>0) { XhtmlStyleMapItem map = styleMap.get(sDisplayName);
info.sTagName = styleMap.getElement(sDisplayName); if (map.sElement.length()>0) {
info.sTagName = map.sElement;
} }
if (!"(none)".equals(styleMap.getCss(sDisplayName))) { if (!"(none)".equals(map.sCss)) {
info.sClass = styleMap.getCss(sDisplayName); info.sClass = map.sCss;
} }
} }
else { else {

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.4 (2014-09-23) * Version 1.6 (2014-10-26)
* *
*/ */
@ -395,12 +395,13 @@ public class TextConverter extends ConverterHelper {
if (sDisplayName!=null && xpar.contains(sDisplayName)) { if (sDisplayName!=null && xpar.contains(sDisplayName)) {
Node curHnode = hnode; Node curHnode = hnode;
String sBlockElement = xpar.getBlockElement(sDisplayName); XhtmlStyleMapItem map = xpar.get(sDisplayName);
String sBlockCss = xpar.getBlockCss(sDisplayName); String sBlockElement = map.sBlockElement;
if (xpar.getBlockElement(sDisplayName).length()>0) { String sBlockCss = map.sBlockCss;
Element block = converter.createElement(xpar.getBlockElement(sDisplayName)); if (map.sBlockElement.length()>0) {
if (!"(none)".equals(xpar.getBlockCss(sDisplayName))) { Element block = converter.createElement(map.sBlockElement);
block.setAttribute("class",xpar.getBlockCss(sDisplayName)); if (!"(none)".equals(map.sBlockCss)) {
block.setAttribute("class",map.sBlockCss);
} }
hnode.appendChild(block); hnode.appendChild(block);
curHnode = block; curHnode = block;
@ -415,8 +416,9 @@ public class TextConverter extends ConverterHelper {
if (cnodeName.equals(XMLString.TEXT_P)) { if (cnodeName.equals(XMLString.TEXT_P)) {
String sCurDisplayName = ofr.getParStyles().getDisplayName(Misc.getAttribute(child,XMLString.TEXT_STYLE_NAME)); String sCurDisplayName = ofr.getParStyles().getDisplayName(Misc.getAttribute(child,XMLString.TEXT_STYLE_NAME));
if (sCurDisplayName!=null && xpar.contains(sCurDisplayName)) { if (sCurDisplayName!=null && xpar.contains(sCurDisplayName)) {
if (sBlockElement.equals(xpar.getBlockElement(sCurDisplayName)) && XhtmlStyleMapItem newmap = xpar.get(sCurDisplayName);
sBlockCss.equals(xpar.getBlockCss(sCurDisplayName))) { if (sBlockElement.equals(newmap.sBlockElement) &&
sBlockCss.equals(newmap.sBlockCss)) {
bMoreParagraphs = true; bMoreParagraphs = true;
} }
} }
@ -701,7 +703,7 @@ public class TextConverter extends ConverterHelper {
if (!bUnNumbered) { if (!bUnNumbered) {
insertListLabel(listStyle,nListLevel,"SectionNumber",null,sLabel,heading); insertListLabel(listStyle,nListLevel,"SectionNumber",null,sLabel,heading);
} }
// Add to toc // Add to toc
if (!bInToc) { if (!bInToc) {
String sTarget = "toc"+(++nTocIndex); String sTarget = "toc"+(++nTocIndex);
@ -734,7 +736,11 @@ public class TextConverter extends ConverterHelper {
applyStyle(innerInfo, content); applyStyle(innerInfo, content);
} }
traverseInlineText(onode,content); traverseInlineText(onode,content);
// Keep track of current headings for split output
// Add before/after text if required
addBeforeAfter(heading,ofr.getParStyle(getParSc().getRealParStyleName(sStyleName)),config.getXHeadingStyleMap());
// Keep track of current headings for split output
currentHeading[nLevel] = heading; currentHeading[nLevel] = heading;
for (int i=nLevel+1; i<=6; i++) { for (int i=nLevel+1; i<=6; i++) {
currentHeading[i] = null; currentHeading[i] = null;
@ -817,10 +823,14 @@ public class TextConverter extends ConverterHelper {
sCurrentListLabel = null; sCurrentListLabel = null;
} }
// Finally, in EPUB export, if the exported paragraph turns out to be empty, remove it
if (converter.isOPS() && !par.hasChildNodes()) { if (converter.isOPS() && !par.hasChildNodes()) {
// Finally, in EPUB export, if the exported paragraph turns out to be empty, remove it
hnode.removeChild(par); hnode.removeChild(par);
} }
else {
// Otherwise, add before/after text if required
addBeforeAfter(par,ofr.getParStyle(getParSc().getRealParStyleName(sStyleName)),config.getXParStyleMap());
}
} }
private void prependAsapNode(Node node) { private void prependAsapNode(Node node) {
@ -1979,6 +1989,26 @@ public class TextConverter extends ConverterHelper {
// UTILITY METHODS // UTILITY METHODS
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// Insert text before/after in an element
private void addBeforeAfter(Element elm, StyleWithProperties style, XhtmlStyleMap styleMap) {
if (style!=null && styleMap.contains(style.getDisplayName())) {
XhtmlStyleMapItem mapItem = styleMap.get(style.getDisplayName());
if (mapItem.sBefore!=null && mapItem.sBefore.length()>0) {
Node child = elm.getFirstChild();
if (child!=null) {
elm.insertBefore(converter.createTextNode(mapItem.sBefore),child);
}
else {
elm.appendChild(converter.createTextNode(mapItem.sBefore));
}
}
if (mapItem.sAfter!=null && mapItem.sAfter.length()>0) {
elm.appendChild(converter.createTextNode(mapItem.sAfter));
}
}
}
// Methods to query individual formatting properties (no inheritance) // Methods to query individual formatting properties (no inheritance)
// Does this style contain the bold attribute? // Does this style contain the bold attribute?
@ -2079,10 +2109,11 @@ public class TextConverter extends ConverterHelper {
private Element applyAttribute(Element node, String sAttr, boolean bApply) { private Element applyAttribute(Element node, String sAttr, boolean bApply) {
if (bApply) { if (bApply) {
XhtmlStyleMap xattr = config.getXAttrStyleMap(); XhtmlStyleMap xattr = config.getXAttrStyleMap();
if (xattr.contains(sAttr) && xattr.getElement(sAttr).length()>0) { if (xattr.contains(sAttr) && xattr.get(sAttr).sElement.length()>0) {
Element attr = converter.createElement(xattr.getElement(sAttr)); XhtmlStyleMapItem map = xattr.get(sAttr);
if (!"(none)".equals(xattr.getCss(sAttr))) { Element attr = converter.createElement(map.sElement);
attr.setAttribute("class",xattr.getCss(sAttr)); if (!"(none)".equals(map.sCss)) {
attr.setAttribute("class",map.sCss);
} }
node.appendChild(attr); node.appendChild(attr);
return attr; return attr;
@ -2157,6 +2188,4 @@ public class TextConverter extends ConverterHelper {
Misc.getPosInteger(node.getAttribute(XMLString.TEXT_LEVEL),1); Misc.getPosInteger(node.getAttribute(XMLString.TEXT_LEVEL),1);
} }
} }

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.4 (2014-09-16) * Version 1.6 (2014-10-24)
* *
*/ */
@ -107,8 +107,9 @@ public class TextStyleConverter extends StyleWithPropertiesConverterHelper {
// Look for a style map // Look for a style map
String sDisplayName = ofr.getTextStyles().getDisplayName(sStyleName); String sDisplayName = ofr.getTextStyles().getDisplayName(sStyleName);
if (styleMap.contains(sDisplayName)) { // class name from config if (styleMap.contains(sDisplayName)) { // class name from config
if (!"(none)".equals(styleMap.getCss(sDisplayName))) { XhtmlStyleMapItem map = styleMap.get(sDisplayName);
info.sClass = styleMap.getCss(sDisplayName); if (!"(none)".equals(map.sCss)) {
info.sClass = map.sCss;
} }
return; return;
} }

View file

@ -20,7 +20,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 1.4 (2014-09-23) * Version 1.6 (2014-10-24)
* *
*/ */
@ -295,27 +295,38 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
if (sFamily.length()==0) { // try old name if (sFamily.length()==0) { // try old name
sFamily = elm.getAttribute("class"); sFamily = elm.getAttribute("class");
} }
Map<String,String> attr = new HashMap<String,String>();
String sElement = elm.getAttribute("element"); String sElement = elm.getAttribute("element");
String sCss = elm.getAttribute("css"); String sCss = elm.getAttribute("css");
if (sCss.length()==0) { sCss="(none)"; } if (sCss.length()==0) { sCss="(none)"; }
Map<String,String> attr = new HashMap<String,String>();
attr.put("element", sElement); attr.put("element", sElement);
attr.put("css", sCss); attr.put("css", sCss);
String sBlockElement = elm.getAttribute("block-element"); String sBlockElement = elm.getAttribute("block-element");
String sBlockCss = elm.getAttribute("block-css"); String sBlockCss = elm.getAttribute("block-css");
if (sBlockCss.length()==0) { sBlockCss="(none)"; } if (sBlockCss.length()==0) { sBlockCss="(none)"; }
String sBefore = elm.getAttribute("before");
String sAfter = elm.getAttribute("after");
if ("heading".equals(sFamily)) { if ("heading".equals(sFamily)) {
attr.put("block-element", sBlockElement); attr.put("block-element", sBlockElement);
attr.put("block-css", sBlockCss); attr.put("block-css", sBlockCss);
attr.put("before", sBefore);
attr.put("after", sAfter);
xheading.put(sName,attr); xheading.put(sName,attr);
} }
if ("paragraph".equals(sFamily)) { if ("paragraph".equals(sFamily)) {
attr.put("block-element", sBlockElement); attr.put("block-element", sBlockElement);
attr.put("block-css", sBlockCss); attr.put("block-css", sBlockCss);
attr.put("before", sBefore);
attr.put("after", sAfter);
xpar.put(sName,attr); xpar.put(sName,attr);
} }
else if ("text".equals(sFamily)) { else if ("text".equals(sFamily)) {
attr.put("before", sBefore);
attr.put("after", sAfter);
xtext.put(sName,attr); xtext.put(sName,attr);
} }
else if ("frame".equals(sFamily)) { else if ("frame".equals(sFamily)) {
@ -351,6 +362,8 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
smNode.setAttribute("css",attr.get("css")); smNode.setAttribute("css",attr.get("css"));
if (attr.containsKey("block-element")) smNode.setAttribute("block-element",attr.get("block-element")); if (attr.containsKey("block-element")) smNode.setAttribute("block-element",attr.get("block-element"));
if (attr.containsKey("block-css")) smNode.setAttribute("block-css",attr.get("block-css")); if (attr.containsKey("block-css")) smNode.setAttribute("block-css",attr.get("block-css"));
if (attr.containsKey("before")) smNode.setAttribute("before",attr.get("before"));
if (attr.containsKey("after")) smNode.setAttribute("after",attr.get("after"));
dom.getDocumentElement().appendChild(smNode); dom.getDocumentElement().appendChild(smNode);
} }
} }
@ -428,7 +441,9 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
String sCss = attr.containsKey("css") ? attr.get("css") : ""; String sCss = attr.containsKey("css") ? attr.get("css") : "";
String sBlockElement = attr.containsKey("block-element") ? attr.get("block-element") : ""; String sBlockElement = attr.containsKey("block-element") ? attr.get("block-element") : "";
String sBlockCss = attr.containsKey("block-css") ? attr.get("block-css") : ""; String sBlockCss = attr.containsKey("block-css") ? attr.get("block-css") : "";
map.put(sName, sBlockElement, sBlockCss, sElement, sCss); String sBefore = attr.containsKey("before") ? attr.get("before") : "";
String sAfter = attr.containsKey("after") ? attr.get("after") : "";
map.put(sName, new XhtmlStyleMapItem(sBlockElement, sBlockCss, sElement, sCss, sBefore, sAfter));
} }
return map; return map;

View file

@ -16,54 +16,37 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA * MA 02111-1307 USA
* *
* Copyright: 2002-2003 by Henrik Just * Copyright: 2002-2014 by Henrik Just
* *
* All Rights Reserved. * All Rights Reserved.
* *
* Version 0.3.2 (2003-11-25) * Version 1.6 (2014-10-24)
* *
*/ */
package writer2latex.xhtml; package writer2latex.xhtml;
import java.util.Hashtable; import java.util.HashMap;
import java.util.Enumeration; import java.util.Iterator;
import java.util.Map;
public class XhtmlStyleMap { public class XhtmlStyleMap {
private Hashtable<String, String> blockElement = new Hashtable<String, String>(); private Map<String,XhtmlStyleMapItem> items = new HashMap<String,XhtmlStyleMapItem>();
private Hashtable<String, String> blockCss = new Hashtable<String, String>();
private Hashtable<String, String> element = new Hashtable<String, String>(); public boolean contains(String sName) {
private Hashtable<String, String> css = new Hashtable<String, String>(); return sName!=null && items.containsKey(sName);
public void put(String sName, String sBlockElement, String sBlockCss, String sElement, String sCss) {
blockElement.put(sName,sBlockElement);
blockCss.put(sName,sBlockCss);
element.put(sName,sElement);
css.put(sName,sCss);
} }
public boolean contains(String sName) { public void put(String sName, XhtmlStyleMapItem item) {
return sName!=null && element.containsKey(sName); items.put(sName, item);
}
public String getBlockElement(String sName) {
return blockElement.get(sName);
} }
public String getBlockCss(String sName) { public XhtmlStyleMapItem get(String sName) {
return blockCss.get(sName); return items.get(sName);
}
public String getElement(String sName) {
return element.get(sName);
} }
public String getCss(String sName) { public Iterator<String> getNames() {
return css.get(sName); return items.keySet().iterator();
}
public Enumeration<String> getNames() {
return element.keys();
} }
} }

View file

@ -0,0 +1,47 @@
/************************************************************************
*
* XhtmlStyleMapItem.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.6 (2014-10-24)
*
*/
package writer2latex.xhtml;
/** This is a simple struct to hold data about a single style map
*/
public class XhtmlStyleMapItem {
public String sBlockElement=null;
public String sBlockCss=null;
public String sElement=null;
public String sCss=null;
public String sBefore=null;
public String sAfter=null;
public XhtmlStyleMapItem(String sBlockElement, String sBlockCss, String sElement, String sCss, String sBefore, String sAfter) {
this.sBlockElement=sBlockElement;
this.sBlockCss=sBlockCss;
this.sElement=sElement;
this.sCss=sCss;
this.sBefore=sBefore;
this.sAfter=sAfter;
}
}

View file

@ -28,11 +28,15 @@
<dlg:combobox dlg:id="Element" dlg:tab-index="8" dlg:left="80" dlg:top="54" dlg:width="170" dlg:height="12" dlg:spin="true" dlg:linecount="11" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:Element"/> <dlg:combobox dlg:id="Element" dlg:tab-index="8" dlg:left="80" dlg:top="54" dlg:width="170" dlg:height="12" dlg:spin="true" dlg:linecount="11" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:Element"/>
<dlg:text dlg:id="CssLabel" dlg:tab-index="9" dlg:left="10" dlg:top="70" dlg:width="60" dlg:height="12" dlg:value="CSS class"/> <dlg:text dlg:id="CssLabel" dlg:tab-index="9" dlg:left="10" dlg:top="70" dlg:width="60" dlg:height="12" dlg:value="CSS class"/>
<dlg:textfield dlg:id="Css" dlg:tab-index="10" dlg:left="80" dlg:top="68" dlg:width="170" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:Css"/> <dlg:textfield dlg:id="Css" dlg:tab-index="10" dlg:left="80" dlg:top="68" dlg:width="170" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:Css"/>
<dlg:text dlg:id="BlockElementLabel" dlg:tab-index="11" dlg:left="10" dlg:top="84" dlg:width="60" dlg:height="12" dlg:value="Block XHTML element"/> <dlg:text dlg:id="BeforeLabel" dlg:tab-index="11" dlg:left="10" dlg:top="84" dlg:width="60" dlg:height="12" dlg:value="Text before"/>
<dlg:combobox dlg:id="BlockElement" dlg:tab-index="12" dlg:left="80" dlg:top="82" dlg:width="170" dlg:height="12" dlg:spin="true" dlg:linecount="10" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:BlockElement"/> <dlg:textfield dlg:id="Before" dlg:tab-index="12" dlg:left="80" dlg:top="82" dlg:width="170" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:Before"/>
<dlg:text dlg:id="BlockCssLabel" dlg:tab-index="13" dlg:left="10" dlg:top="98" dlg:width="60" dlg:height="12" dlg:value="Block CSS class"/> <dlg:text dlg:id="AfterLabel" dlg:tab-index="13" dlg:left="10" dlg:top="98" dlg:width="60" dlg:height="12" dlg:value="Text after"/>
<dlg:textfield dlg:id="BlockCss" dlg:tab-index="14" dlg:left="80" dlg:top="96" dlg:width="170" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:BlockCss"/> <dlg:textfield dlg:id="After" dlg:tab-index="14" dlg:left="80" dlg:top="96" dlg:width="170" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:After"/>
<dlg:button dlg:id="LoadDefaultsButton" dlg:tab-index="15" dlg:left="10" dlg:top="118" dlg:width="120" dlg:height="12" dlg:value="Load default mappings..." dlg:help-url="org.openoffice.da.writer2xhtml.oxt:LoadDefaults"> <dlg:text dlg:id="BlockElementLabel" dlg:tab-index="15" dlg:left="10" dlg:top="112" dlg:width="60" dlg:height="12" dlg:value="Block XHTML element"/>
<dlg:combobox dlg:id="BlockElement" dlg:tab-index="16" dlg:left="80" dlg:top="110" dlg:width="170" dlg:height="12" dlg:spin="true" dlg:linecount="10" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:BlockElement"/>
<dlg:text dlg:id="BlockCssLabel" dlg:tab-index="17" dlg:left="10" dlg:top="126" dlg:width="60" dlg:height="12" dlg:value="Block CSS class"/>
<dlg:textfield dlg:id="BlockCss" dlg:tab-index="18" dlg:left="80" dlg:top="124" dlg:width="170" dlg:height="12" dlg:help-url="org.openoffice.da.writer2xhtml.oxt:BlockCss"/>
<dlg:button dlg:id="LoadDefaultsButton" dlg:tab-index="19" dlg:left="10" dlg:top="146" dlg:width="120" dlg:height="12" dlg:value="Load default mappings..." dlg:help-url="org.openoffice.da.writer2xhtml.oxt:LoadDefaults">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:LoadDefaultsClick" script:language="UNO"/> <script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:LoadDefaultsClick" script:language="UNO"/>
</dlg:button> </dlg:button>
</dlg:bulletinboard> </dlg:bulletinboard>

View file

@ -44,6 +44,16 @@
<paragraph role="heading" level="3" xml-lang="en-US">CSS class</paragraph> <paragraph role="heading" level="3" xml-lang="en-US">CSS class</paragraph>
<paragraph role="paragraph" xml-lang="en-US">Enter the name of a CSS class. If you leave this field empty, the <paragraph role="paragraph" xml-lang="en-US">Enter the name of a CSS class. If you leave this field empty, the
<emph>class</emph> attribute will not be set.</paragraph> <emph>class</emph> attribute will not be set.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:Before" id="bm_configbefore"/>
<paragraph role="heading" level="3" xml-lang="en-US">Before</paragraph>
<paragraph role="paragraph" xml-lang="en-US">The text you enter here will be added to the beginning of
each paragraph formatted with this style.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:After" id="bm_configafter"/>
<paragraph role="heading" level="3" xml-lang="en-US">After</paragraph>
<paragraph role="paragraph" xml-lang="en-US">The text you enter here will be added to the end of
each paragraph formatted with this style.</paragraph>
<bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:BlockElement" id="bm_configblockelement"/> <bookmark xml-lang="en-US" branch="hid/org.openoffice.da.writer2xhtml.oxt:BlockElement" id="bm_configblockelement"/>
<paragraph role="heading" level="3" xml-lang="en-US">Block XHTML element</paragraph> <paragraph role="heading" level="3" xml-lang="en-US">Block XHTML element</paragraph>

View file

@ -12,7 +12,7 @@
<prop oor:name="FilterService"><value>com.sun.star.comp.Writer.XmlFilterAdaptor</value></prop> <prop oor:name="FilterService"><value>com.sun.star.comp.Writer.XmlFilterAdaptor</value></prop>
<prop oor:name="TemplateName"/> <prop oor:name="TemplateName"/>
<prop oor:name="UIName"> <prop oor:name="UIName">
<value>HTML 5 [Writer2xhtml]</value> <value>HTML5 [Writer2xhtml]</value>
</prop> </prop>
<prop oor:name="Flags"><value>EXPORT ALIEN 3RDPARTYFILTER</value></prop> <prop oor:name="Flags"><value>EXPORT ALIEN 3RDPARTYFILTER</value></prop>
</node> </node>

View file

@ -10,7 +10,7 @@
<prop oor:name="MediaType"/> <prop oor:name="MediaType"/>
<prop oor:name="Preferred"><value>false</value></prop> <prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="UIName"> <prop oor:name="UIName">
<value>HTML 5</value> <value>HTML5</value>
</prop> </prop>
<prop oor:name="ClipboardFormat"/> <prop oor:name="ClipboardFormat"/>
</node> </node>