Writer2xhtml custom config ui

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@57 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2010-04-12 12:09:49 +00:00
parent 7644cf2eba
commit 977a2f7d6b
22 changed files with 993 additions and 195 deletions

View file

@ -2,17 +2,20 @@ Changelog for Writer2LaTeX version 1.0 -> 1.2
---------- version 1.1.2 ----------
[w2x] The custom configuration now supports an optional xhtml template (writer2xhtml-template.xhtml)
in the same directory as writer2xhtml.xml
[w2x] The xhtml configuration now also supports complex options in the API
[w2x] Bugfix: Corrected problem with relative links (this affected package format only)
[w2x] Added EPUB export
[all] API change: The interface ConverterResult supports an additional method
to access the meta data of the source document. A new interface MetaData has
been introduced to support this
[all] API change: The interface ConverterResult supports an additional method to access the
meta data of the source document. A new interface MetaData has been introduced to support this
[all] API change: The interface ConverterResult supports additional methods
providing pointers to headings and index tables in the document.
A new interface TocEntry has been introduced to support this
[all] API change: The interface ConverterResult supports additional methods providing pointers to
headings and index tables in the document. A new interface TocEntry has been introduced to support this
[all] API change: New methods getMIMEType() and isMasterDocument() added to the OutputFile
interface. The latter is used to identify files that are part of the main document flow

Binary file not shown.

View file

@ -20,15 +20,18 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-03-26)
* Version 1.2 (2010-04-12)
*
*/
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.text.Collator;
import java.util.Arrays;
import java.util.HashMap;
@ -39,6 +42,7 @@ 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;
@ -55,10 +59,12 @@ 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 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
@ -73,11 +79,14 @@ public abstract class ConfigurationDialogBase extends WeakBase implements XConta
// The component context
protected XComponentContext xContext;
// File picker wrapper
private FilePicker filePicker = null;
// UNO simple file access service
protected XSimpleFileAccess2 sfa2 = null;
// Access to display names of the styles in the current document
protected StyleNameProvider styleNameProvider = null;
// UNO path substitution
private XStringSubstitution xPathSub = null;
// The configuration implementation
protected Config config;
@ -99,6 +108,9 @@ public abstract class ConfigurationDialogBase extends WeakBase implements XConta
/** Create a new <code>ConfigurationDialogBase</code> */
public ConfigurationDialogBase(XComponentContext xContext) {
this.xContext = xContext;
// Get the file picker
filePicker = new FilePicker(xContext);
// Get the SimpleFileAccess service
try {
@ -111,7 +123,6 @@ public abstract class ConfigurationDialogBase extends WeakBase implements XConta
}
// Create the config file name
XStringSubstitution xPathSub = null;
try {
Object psObject = xContext.getServiceManager().createInstanceWithContext(
"com.sun.star.util.PathSubstitution", xContext);
@ -125,8 +136,6 @@ public abstract class ConfigurationDialogBase extends WeakBase implements XConta
// Create the configuration
config = ConverterFactory.createConverter(getMIMEType()).getConfig();
// Get the style name provider
styleNameProvider = new StyleNameProvider(xContext);
}
// Implement XContainerWindowEventHandler
@ -134,7 +143,7 @@ public abstract class ConfigurationDialogBase extends WeakBase implements XConta
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);
}
@ -245,6 +254,205 @@ public abstract class ConfigurationDialogBase extends WeakBase implements XConta
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<nCount; i++) {
if (sConfigValues[i].equals(sCurrentValue)) {
dlg.setListBoxSelectedItem(sListBoxName, i);
return;
}
}
dlg.setListBoxSelectedItem(sListBoxName, nDefault);
}
protected void listBoxToConfig(DialogAccess dlg, String sListBoxName, String sConfigName, String[] sConfigValues) {
config.setOption(sConfigName, sConfigValues[dlg.getListBoxSelectedItem(sListBoxName)]);
}
}
protected abstract class CustomFileHandler extends PageHandler {
// The file name
private String sCustomFileName;
public CustomFileHandler() {
super();
try {
sCustomFileName = xPathSub.substituteVariables("$(user)/"+getFileName(), false);
}
catch (NoSuchElementException e) {
sCustomFileName = getFileName();
}
}
// The subclass must provide these
protected abstract String getSuffix();
protected abstract String getFileName();
protected abstract void useCustomInner(DialogAccess dlg, boolean bUseCustom);
@Override protected void setControls(DialogAccess dlg) {
String sText = "";
boolean bUseCustom = false;
if (fileExists(sCustomFileName)) {
sText = loadFile(sCustomFileName);
bUseCustom = true;
}
else if (fileExists(sCustomFileName+".bak")) {
sText = loadFile(sCustomFileName+".bak");
}
// Currently ignore failure to load the file
if (sText==null) { sText=""; }
dlg.setCheckBoxStateAsBoolean("UseCustom"+getSuffix(), bUseCustom);
dlg.setTextFieldText("Custom"+getSuffix(), sText);
useCustomChange(dlg);
}
@Override protected void getControls(DialogAccess dlg) {
if (dlg.getCheckBoxStateAsBoolean("UseCustom"+getSuffix())) {
saveFile(sCustomFileName,dlg.getTextFieldText("Custom"+getSuffix()));
killFile(sCustomFileName+".bak");
}
else {
saveFile(sCustomFileName+".bak",dlg.getTextFieldText("Custom"+getSuffix()));
killFile(sCustomFileName);
}
}
@Override protected boolean handleEvent(DialogAccess dlg, String sMethod) {
if (sMethod.equals("UseCustom"+getSuffix()+"Change")) {
useCustomChange(dlg);
return true;
}
else if (sMethod.equals("Load"+getSuffix()+"Click")) {
loadCustomClick(dlg);
return true;
}
return false;
}
private void useCustomChange(DialogAccess dlg) {
boolean bUseCustom = dlg.getCheckBoxStateAsBoolean("UseCustom"+getSuffix());
dlg.setControlEnabled("Custom"+getSuffix(), bUseCustom);
dlg.setControlEnabled("Load"+getSuffix()+"Button", bUseCustom);
useCustomInner(dlg,bUseCustom);
}
private void loadCustomClick(DialogAccess dlg) {
String sFileName=filePicker.getPath();
if (sFileName!=null) {
String sText = loadFile(sFileName);
if (sText!=null) {
dlg.setTextFieldText("Custom"+getSuffix(), sText);
}
}
}
// Helpers for sfa2
// Checks that the file exists
private boolean fileExists(String sFileName) {
try {
return sfa2!=null && sfa2.exists(sFileName);
}
catch (CommandAbortedException e) {
}
catch (com.sun.star.uno.Exception e) {
}
return false;
}
// Delete a file if it exists, return true on success
private boolean killFile(String sFileName) {
try {
if (sfa2!=null && sfa2.exists(sFileName)) {
sfa2.kill(sFileName);
return true;
}
}
catch (com.sun.star.uno.Exception e) {
}
return false;
}
// Load a text file, returns null on failure
private String loadFile(String sFileName) {
if (sfa2!=null) {
try {
XInputStream xIs = sfa2.openFileRead(sFileName);
if (xIs!=null) {
InputStream is = new XInputStreamToInputStreamAdapter(xIs);
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuffer buf = new StringBuffer();
String sLine;
try {
while ((sLine = reader.readLine())!=null) {
buf.append(sLine).append('\n');
}
}
catch (IOException e) {
}
return buf.toString();
}
}
catch (com.sun.star.uno.Exception e) {
}
}
return null;
}
// Save a text file, return true on success
protected boolean saveFile(String sFileName, String sText) {
killFile(sFileName);
try {
XOutputStream xOs = sfa2.openFileWrite(sFileName);
if (xOs!=null) {
OutputStream os = new XOutputStreamToOutputStreamAdapter(xOs);
try {
OutputStreamWriter osw = new OutputStreamWriter(os,"UTF-8");
osw.write(sText);
osw.flush();
os.close();
}
catch (IOException e) {
xOs.closeOutput();
return false;
}
xOs.closeOutput();
return true;
}
}
catch (com.sun.star.uno.Exception e) {
}
return false;
}
}
protected abstract class UserListPageHandler extends PageHandler {
// Methods to handle user controlled lists
protected XDialog getDialog(String sDialogName) {
XMultiComponentFactory xMCF = xContext.getServiceManager();
@ -275,7 +483,7 @@ public abstract class ConfigurationDialogBase extends WeakBase implements XConta
return false;
}
private boolean deleteCurrentItem(DialogAccess dlg, String sListName) {
protected boolean deleteCurrentItem(DialogAccess dlg, String sListName) {
String[] sItems = dlg.getListBoxStringItemList(sListName);
short nSelected = dlg.getListBoxSelectedItem(sListName);
if (nSelected>=0 && deleteItem(sItems[nSelected])) {
@ -318,7 +526,7 @@ public abstract class ConfigurationDialogBase extends WeakBase implements XConta
return null;
}
private String appendItem(DialogAccess dlg, String sListName, Set<String> suggestions) {
protected String appendItem(DialogAccess dlg, String sListName, Set<String> suggestions) {
String[] sItems = dlg.getListBoxStringItemList(sListName);
String sNewItem = newItem(suggestions);
if (sNewItem!=null) {
@ -339,46 +547,339 @@ public abstract class ConfigurationDialogBase extends WeakBase implements XConta
return sNewItem;
}
// Utilities
protected String[] sortStringSet(Set<String> theSet) {
String[] theArray = new String[theSet.size()];
int i=0;
for (String s : theSet) {
theArray[i++] = s;
}
sortStringArray(theArray);
return theArray;
}
protected void sortStringArray(String[] theArray) {
// TODO: Get locale from OOo rather than the system
Collator collator = Collator.getInstance();
Arrays.sort(theArray, collator);
}
// 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<nCount; i++) {
if (sConfigValues[i].equals(sCurrentValue)) {
dlg.setListBoxSelectedItem(sListBoxName, i);
return;
}
}
dlg.setListBoxSelectedItem(sListBoxName, nDefault);
}
protected void listBoxToConfig(DialogAccess dlg, String sListBoxName, String sConfigName, String[] sConfigValues) {
config.setOption(sConfigName, sConfigValues[dlg.getListBoxSelectedItem(sListBoxName)]);
}
}
protected abstract class StylesPageHandler extends UserListPageHandler {
// The subclass must define these
protected String[] sFamilyNames;
protected String[] sOOoFamilyNames;
// Our data
private ComplexOption[] styleMap;
protected short nCurrentFamily = -1;
private String sCurrentStyleName = null;
// Access to display names of the styles in the current document
private StyleNameProvider styleNameProvider = null;
// Some methods to be implemented by the subclass
protected abstract String getDefaultConfigName();
protected abstract void getControls(DialogAccess dlg, Map<String,String> attr);
protected abstract void setControls(DialogAccess dlg, Map<String,String> attr);
protected abstract void clearControls(DialogAccess dlg);
protected abstract void prepareControls(DialogAccess dlg);
// 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<nCount; i++) {
styleMap[i] = new ComplexOption();
}
}
// Implement abstract methods from super
protected void setControls(DialogAccess dlg) {
// Load style maps from config (translating keys to display names)
int nCount = sFamilyNames.length;
for (int i=0; i<nCount; i++) {
ComplexOption configMap = config.getComplexOption(sFamilyNames[i]+"-map");
styleMap[i].clear();
Map<String,String> 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<nCount; i++) {
ComplexOption configMap = config.getComplexOption(sFamilyNames[i]+"-map");
configMap.clear();
Map<String,String> 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 = sortStringSet(styleMap[nNewFamily].keySet());
dlg.setListBoxStringItemList("StyleName", sStyleNames);
if (sStyleNames.length>0) {
dlg.setListBoxSelectedItem("StyleName", (short)0);
}
else {
dlg.setListBoxSelectedItem("StyleName", (short)-1);
}
updateDeleteButton(dlg);
prepareControls(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);
String sNewName = appendItem(dlg, "StyleName",styleNameProvider.getInternalNames(sOOoFamilyNames[nCurrentFamily]).keySet());
if (sNewName!=null) {
styleMap[nCurrentFamily].put(sNewName, new HashMap<String,String>());
clearControls(dlg);
}
updateDeleteButton(dlg);
}
}
private void deleteStyleClick(DialogAccess dlg) {
if (nCurrentFamily>-1 && sCurrentStyleName!=null) {
String sStyleName = sCurrentStyleName;
if (deleteCurrentItem(dlg,"StyleName")) {
styleMap[nCurrentFamily].remove(sStyleName);
styleNameChange(dlg);
}
updateDeleteButton(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<nFamilyCount; i++) {
ComplexOption cleanMap = clean.getComplexOption(sFamilyNames[i]+"-map");
Map<String,String> 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<nFamilyCount; i++) {
ComplexOption cleanMap = clean.getComplexOption(sFamilyNames[i]+"-map");
Map<String,String> displayNames = styleNameProvider.getDisplayNames(sOOoFamilyNames[i]);
copyStyles(cleanMap, styleMap[i], displayNames);
}
}
// Force update of the user interface
nCurrentFamily = -1;
sCurrentStyleName = null;
styleFamilyChange(dlg);
}
private void updateDeleteButton(DialogAccess dlg) {
dlg.setControlEnabled("DeleteStyleButton", dlg.getListBoxStringItemList("StyleName").length>0);
}
private void copyStyles(ComplexOption source, ComplexOption target, Map<String,String> 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<String,String> attr);
protected abstract void setControls(DialogAccess dlg, Map<String,String> 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<String,String> 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<String,String>());
}
Map<String,String> 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<String,String>());
attributeMap.get(sName).put("deleted", "true");
}
Map<String,String> 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"));
}
}
}

View file

@ -169,7 +169,6 @@ public class DialogAccess {
}
public short getListBoxLineCount(String sControlName) {
// Returns the first selected element in case of a multiselection
XPropertySet xPropertySet = getControlProperties(sControlName);
try {
return ((Short) xPropertySet.getPropertyValue("LineCount")).shortValue();

View file

@ -0,0 +1,83 @@
/************************************************************************
*
* 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-2010 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.2 (2010-04-12)
*
*/
package org.openoffice.da.comp.w2lcommon.helper;
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;
/** 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;
}
/** Get a user selected path with a file picker
*
* @return the path or null if the dialog is canceled
*/
public String getPath() {
// Create FilePicker
Object filePicker = null;
try {
filePicker = xContext.getServiceManager().createInstanceWithContext("com.sun.star.ui.dialogs.FilePicker", xContext);
}
catch (com.sun.star.uno.Exception e) {
return null;
}
// Display the FilePicker
XFilePicker xFilePicker = (XFilePicker) UnoRuntime.queryInterface(XFilePicker.class, filePicker);
XExecutableDialog xExecutable = (XExecutableDialog) UnoRuntime.queryInterface(XExecutableDialog.class, xFilePicker);
// Get the path
String sPath = null;
if (xExecutable.execute() == ExecutableDialogResults.OK) {
String[] sPathList = xFilePicker.getFiles();
if (sPathList.length > 0) {
sPath = sPathList[0];
}
}
// Dispose the file picker
XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xFilePicker);
xComponent.dispose();
return sPath;
}
}

View file

@ -1,6 +1,6 @@
/************************************************************************
*
* OptionsDialogBase.java
* MacroExpander.java
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public

View file

@ -20,11 +20,14 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-03-26)
* Version 1.2 (2010-04-09)
*
*/
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;
@ -68,22 +71,28 @@ public class ConfigurationDialog extends ConfigurationDialogBase implements XSer
super(xContext);
pageHandlers.put("General", new GeneralHandler());
//pageHandlers.put("Template", new TemplateHandler());
pageHandlers.put("Template", new TemplateHandler());
pageHandlers.put("Stylesheets", new StylesheetsHandler());
pageHandlers.put("Formatting", new FormattingHandler());
//pageHandlers.put("Styles1", new StylesPartIHandler());
//pageHandlers.put("Styles2", new StylesPartIIHandler());
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" };
String[] sNames = { "EncodingChange", // General
"CustomTemplateChange", "LoadTemplateClick", // Template
"UseCustomStylesheetChange", "IncludeCustomStylesheetClick", "LoadStylesheetClick", // 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" };
@ -134,20 +143,74 @@ public class ConfigurationDialog extends ConfigurationDialogBase implements XSer
}
}
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) {
}
private class StylesheetsHandler extends PageHandler {
@Override protected void setControls(DialogAccess dlg) {
dlg.setCheckBoxStateAsBoolean("UseCustomStylesheet", config.getOption("custom_stylesheet").length()>0);
textFieldFromConfig(dlg, "CustomStylesheet", "custom_stylesheet");
super.setControls(dlg);
dlg.setCheckBoxStateAsBoolean("LinkCustomStylesheet", config.getOption("custom_stylesheet").length()>0);
textFieldFromConfig(dlg, "CustomStylesheetURL", "custom_stylesheet");
useCustomStylesheetChange(dlg);
includeCustomStylesheetChange(dlg);
linkCustomStylesheetChange(dlg);
}
@Override protected void getControls(DialogAccess dlg) {
if (dlg.getCheckBoxStateAsBoolean("UseCustomStylesheet")) {
textFieldToConfig(dlg, "CustomStylesheet", "custom_stylesheet");
super.getControls(dlg);
if (dlg.getCheckBoxStateAsBoolean("LinkCustomStylesheet")) {
textFieldToConfig(dlg, "CustomStylesheetURL", "custom_stylesheet");
}
else {
config.setOption("custom_stylesheet", "");
@ -155,35 +218,133 @@ public class ConfigurationDialog extends ConfigurationDialogBase implements XSer
}
@Override protected boolean handleEvent(DialogAccess dlg, String sMethod) {
if (sMethod.equals("UseCustomStylesheetChange")) {
useCustomStylesheetChange(dlg);
if (super.handleEvent(dlg, sMethod)) {
return true;
}
else if (sMethod.equals("IncludeCustomStylesheetChange")) {
includeCustomStylesheetChange(dlg);
return true;
}
else if (sMethod.equals("LoadButtonClick")) {
loadButtonClick(dlg);
if (sMethod.equals("LinkCustomStylesheetChange")) {
linkCustomStylesheetChange(dlg);
return true;
}
return false;
}
private void useCustomStylesheetChange(DialogAccess dlg) {
boolean bUseCustomStylesheet = dlg.getCheckBoxStateAsBoolean("UseCustomStylesheet");
dlg.setControlEnabled("CustomStylesheetLabel", bUseCustomStylesheet);
dlg.setControlEnabled("CustomStylesheet", bUseCustomStylesheet);
private void linkCustomStylesheetChange(DialogAccess dlg) {
boolean bLinkCustomStylesheet = dlg.getCheckBoxStateAsBoolean("LinkCustomStylesheet");
dlg.setControlEnabled("CustomStylesheetURLLabel", bLinkCustomStylesheet);
dlg.setControlEnabled("CustomStylesheetURL", bLinkCustomStylesheet);
}
private void includeCustomStylesheetChange(DialogAccess dlg) {
dlg.setControlEnabled("IncludedCustomStylesheet", dlg.getCheckBoxStateAsBoolean("IncludeCustomStylesheet"));
}
private class Styles1Handler extends StylesPageHandler {
private final String[] sXhtmlFamilyNames = { "text", "paragraph", "list", "frame" };
private final String[] sXhtmlOOoFamilyNames = { "CharacterStyles", "ParagraphStyles", "NumberingStyles", "FrameStyles" };
private final String[] sParElements = { "p", "h1", "h2", "h3", "h4", "h5", "h6", "address", "dd", "dt", "pre" };
private final String[] sParBlockElements = { "div", "blockquote", "dl" };
private final String[] sEmpty = { };
private String[][] sElements = new String[4][];
private String[][] sBlockElements = new String[4][];
protected Styles1Handler() {
super(4);
sFamilyNames = sXhtmlFamilyNames;
sOOoFamilyNames = sXhtmlOOoFamilyNames;
sElements[0] = sCharElements;
sElements[1] = sParElements;
sElements[2] = sEmpty;
sElements[3] = sEmpty;
sBlockElements[0] = sEmpty;
sBlockElements[1] = sParBlockElements;
sBlockElements[2] = sEmpty;
sBlockElements[3] = sEmpty;
}
private void loadButtonClick(DialogAccess dlg) {
// TODO
protected String getDefaultConfigName() {
return "cleanxhtml.xml";
}
protected void setControls(DialogAccess dlg, Map<String,String> 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) {
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<String,String> attr) {
attr.put("element", dlg.getComboBoxText("Element"));
attr.put("css", empty2none(dlg.getTextFieldText("Css")));
if (nCurrentFamily==1) {
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) {
dlg.setListBoxStringItemList("Element", sElements[nCurrentFamily]);
dlg.setListBoxStringItemList("BlockElement", sBlockElements[nCurrentFamily]);
dlg.setControlEnabled("Element", nCurrentFamily<=1);
dlg.setControlEnabled("BlockElement", nCurrentFamily==1);
dlg.setControlEnabled("BlockCss", nCurrentFamily==1);
}
}
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<String,String> 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<String,String> 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 {
@ -203,8 +364,9 @@ public class ConfigurationDialog extends ConfigurationDialogBase implements XSer
checkBoxFromConfig(dlg, "IgnoreTableDimensions", "ignore_table_dimensions");
checkBoxFromConfig(dlg, "UseListHack", "use_list_hack");
checkBoxFromConfig(dlg, "ConvertToPx", "convert_to_px");
checkBoxFromConfig(dlg, "SeparateStylesheet", "separate_stylesheet");
//TODO: These have been postponed
//checkBoxFromConfig(dlg, "ConvertToPx", "convert_to_px");
//checkBoxFromConfig(dlg, "SeparateStylesheet", "separate_stylesheet");
}
@Override protected void getControls(DialogAccess dlg) {
@ -216,8 +378,9 @@ public class ConfigurationDialog extends ConfigurationDialogBase implements XSer
checkBoxToConfig(dlg, "IgnoreTableDimensions", "ignore_table_dimensions");
checkBoxToConfig(dlg, "UseListHack", "use_list_hack");
checkBoxToConfig(dlg, "ConvertToPx", "convert_to_px");
checkBoxToConfig(dlg, "SeparateStylesheet", "separate_stylesheet");
//TODO: These have been postponed
//checkBoxToConfig(dlg, "ConvertToPx", "convert_to_px");
//checkBoxToConfig(dlg, "SeparateStylesheet", "separate_stylesheet");
}
@Override protected boolean handleEvent(DialogAccess dlg, String sMethod) {
@ -242,6 +405,15 @@ public class ConfigurationDialog extends ConfigurationDialogBase implements XSer
}
}
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;
}
}

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2008 by Henrik Just
* Copyright: 2002-2010 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.0 (2008-11-16)
* Version 1.2 (2010-04-11)
*
*/
@ -113,6 +113,8 @@ public class XhtmlOptionsDialog extends OptionsDialogBase {
"http://www.w3.org/StyleSheets/Core/"+sCoreStyles[nConfig-1]);
break;
case 9: helper.put("ConfigURL","$(user)/writer2xhtml.xml");
helper.put("TemplateURL", "$(user)/writer2xhtml-template.xhtml");
//helper.put("StyleSheetURL", "$(user)/writer2xhtml-style.css");
helper.put("AutoCreate","true");
}

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-03-05)
* Version 1.2 (2010-04-12)
*
*/
@ -29,6 +29,7 @@ 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.Vector;
import com.sun.star.awt.XControl;
@ -52,6 +53,7 @@ import com.sun.star.uno.XComponentContext;
import com.sun.star.lib.uno.helper.WeakBase;
import org.openoffice.da.comp.w2lcommon.helper.DialogAccess;
import org.openoffice.da.comp.w2lcommon.helper.FilePicker;
/** This class provides a uno component which implements the configuration
* of Writer4LaTeX
@ -61,6 +63,7 @@ public final class ConfigurationDialog
implements XServiceInfo, XContainerWindowEventHandler {
private XComponentContext xContext;
private FilePicker filePicker;
private ExternalApps externalApps;
@ -76,6 +79,7 @@ public final class ConfigurationDialog
public ConfigurationDialog(XComponentContext xContext) {
this.xContext = xContext;
externalApps = new ExternalApps(xContext);
filePicker = new FilePicker(xContext);
}
// Implement XContainerWindowEventHandler
@ -161,42 +165,18 @@ public final class ConfigurationDialog
}
private boolean browseForExecutable(XWindow xWindow) {
XComponent xComponent = null;
try {
// Create FilePicker
Object filePicker = xContext.getServiceManager()
.createInstanceWithContext("com.sun.star.ui.dialogs.FilePicker", xContext);
XFilePicker xFilePicker = (XFilePicker)
UnoRuntime.queryInterface(XFilePicker.class, filePicker);
xComponent = (XComponent)
UnoRuntime.queryInterface(XComponent.class, xFilePicker);
// Display the FilePicker
XExecutableDialog xExecutable = (XExecutableDialog)
UnoRuntime.queryInterface(XExecutableDialog.class, xFilePicker);
// Get the path
if (xExecutable.execute() == ExecutableDialogResults.OK) {
String[] sPathList = xFilePicker.getFiles();
if (sPathList.length > 0) {
setComboBoxText(xWindow, "Executable", new File(new URI(sPathList[0])).getCanonicalPath());
updateApplication(xWindow);
}
}
}
catch (com.sun.star.uno.Exception e) {
}
catch (java.net.URISyntaxException e) {
}
catch (java.io.IOException e) {
}
finally{
// Always dispose the FilePicker component
if (xComponent!=null) {
xComponent.dispose();
}
}
return true;
String sPath = filePicker.getPath();
if (sPath!=null) {
try {
setComboBoxText(xWindow, "Executable", new File(new URI(sPath)).getCanonicalPath());
}
catch (IOException e) {
}
catch (URISyntaxException e) {
}
updateApplication(xWindow);
}
return true;
}
private boolean updateApplication(XWindow xWindow) {

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-03-31)
* Version 1.2 (2010-04-12)
*
*/
@ -33,7 +33,7 @@ public class ConverterFactory {
// Version information
private static final String VERSION = "1.1.2";
private static final String DATE = "2010-03-31";
private static final String DATE = "2010-04-12";
/** Return the Writer2LaTeX version in the form
* (major version).(minor version).(patch level)<br/>

View file

@ -20,17 +20,20 @@
*
* All Rights Reserved.
*
* Version 1.2 (2010-03-04)
* Version 1.2 (2010-04-09)
*
*/
package writer2latex.xhtml;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import writer2latex.api.ComplexOption;
import writer2latex.base.BooleanOption;
import writer2latex.base.IntegerOption;
import writer2latex.base.Option;
@ -106,11 +109,11 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
private static final int DIRECTORY_ICON = 40;
private static final int DOCUMENT_ICON = 41;
protected XhtmlStyleMap xpar = new XhtmlStyleMap();
protected XhtmlStyleMap xtext = new XhtmlStyleMap();
protected XhtmlStyleMap xframe = new XhtmlStyleMap();
protected XhtmlStyleMap xlist = new XhtmlStyleMap();
protected XhtmlStyleMap xattr = new XhtmlStyleMap();
protected ComplexOption xpar = addComplexOption("paragraph-map");
protected ComplexOption xtext = addComplexOption("text-map");
protected ComplexOption xframe = addComplexOption("frame-map");
protected ComplexOption xlist = addComplexOption("list-map");
protected ComplexOption xattr = addComplexOption("text-attribute-map");
public XhtmlConfig() {
super();
@ -184,26 +187,31 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
if (sFamily.length()==0) { // try old name
sFamily = elm.getAttribute("class");
}
String sBlockElement = elm.getAttribute("block-element");
String sBlockCss = elm.getAttribute("block-css");
if (sBlockCss.length()==0) { sBlockCss="(none)"; }
String sElement = elm.getAttribute("element");
String sCss = elm.getAttribute("css");
if (sCss.length()==0) { sCss="(none)"; }
Map<String,String> attr = new HashMap<String,String>();
attr.put("element", sElement);
attr.put("css", sCss);
if ("paragraph".equals(sFamily)) {
xpar.put(sName,sBlockElement,sBlockCss,sElement,sCss);
String sBlockElement = elm.getAttribute("block-element");
String sBlockCss = elm.getAttribute("block-css");
if (sBlockCss.length()==0) { sBlockCss="(none)"; }
attr.put("block-element", sBlockElement);
attr.put("block-css", sBlockCss);
xpar.put(sName,attr);
}
else if ("text".equals(sFamily)) {
xtext.put(sName,sBlockElement,sBlockCss,sElement,sCss);
xtext.put(sName,attr);
}
else if ("frame".equals(sFamily)) {
xframe.put(sName,sBlockElement,sBlockCss,sElement,sCss);
xframe.put(sName,attr);
}
else if ("list".equals(sFamily)) {
xlist.put(sName,sBlockElement,sBlockCss,sElement,sCss);
xlist.put(sName,attr);
}
else if ("attribute".equals(sFamily)) {
xattr.put(sName,sBlockElement,sBlockCss,sElement,sCss);
xattr.put(sName,attr);
}
}
}
@ -213,22 +221,21 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
writeXStyleMap(dom,xtext,"text");
writeXStyleMap(dom,xlist,"list");
writeXStyleMap(dom,xframe,"frame");
writeXStyleMap(dom,xframe,"attribute");
writeXStyleMap(dom,xattr,"attribute");
}
private void writeXStyleMap(Document dom, XhtmlStyleMap sm, String sFamily) {
Enumeration<String> smEnum = sm.getNames();
while (smEnum.hasMoreElements()) {
String sName = smEnum.nextElement();
private void writeXStyleMap(Document dom, ComplexOption option, String sFamily) {
Iterator<String> iter = option.keySet().iterator();
while (iter.hasNext()) {
String sName = iter.next();
Element smNode = dom.createElement("xhtml-style-map");
smNode.setAttribute("name",sName);
smNode.setAttribute("family",sFamily);
smNode.setAttribute("element",sm.getElement(sName));
smNode.setAttribute("css",sm.getCss(sName));
String sBlockElement = sm.getBlockElement(sName);
if (sBlockElement!=null) { smNode.setAttribute("block-element",sm.getCss(sBlockElement)); }
String sBlockCss = sm.getBlockCss(sName);
if (sBlockCss!=null) { smNode.setAttribute("block-css",sm.getCss(sBlockCss)); }
Map<String,String> attr = option.get(sName);
smNode.setAttribute("element",attr.get("element"));
smNode.setAttribute("css",attr.get("css"));
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"));
dom.getDocumentElement().appendChild(smNode);
}
}
@ -277,11 +284,24 @@ public class XhtmlConfig extends writer2latex.base.ConfigBase {
public String getXhtmlDirectoryIcon() { return options[DIRECTORY_ICON].getString(); }
public String getXhtmlDocumentIcon() { return options[DOCUMENT_ICON].getString(); }
public XhtmlStyleMap getXParStyleMap() { return xpar; }
public XhtmlStyleMap getXTextStyleMap() { return xtext; }
public XhtmlStyleMap getXFrameStyleMap() { return xframe; }
public XhtmlStyleMap getXListStyleMap() { return xlist; }
public XhtmlStyleMap getXAttrStyleMap() { return xattr; }
public XhtmlStyleMap getXParStyleMap() { return getStyleMap(xpar); }
public XhtmlStyleMap getXTextStyleMap() { return getStyleMap(xtext); }
public XhtmlStyleMap getXFrameStyleMap() { return getStyleMap(xframe); }
public XhtmlStyleMap getXListStyleMap() { return getStyleMap(xlist); }
public XhtmlStyleMap getXAttrStyleMap() { return getStyleMap(xattr); }
private XhtmlStyleMap getStyleMap(ComplexOption co) {
XhtmlStyleMap map = new XhtmlStyleMap();
for (String sName : co.keySet()) {
Map<String,String> attr = co.get(sName);
String sElement = attr.containsKey("element") ? attr.get("element") : "";
String sCss = attr.containsKey("css") ? attr.get("css") : "";
String sBlockElement = attr.containsKey("block-element") ? attr.get("block-element") : "";
String sBlockCss = attr.containsKey("block-css") ? attr.get("block-css") : "";
map.put(sName, sBlockElement, sBlockCss, sElement, sCss);
}
return map;
}
}

View file

@ -77,7 +77,7 @@
<value>%origin%/W2XDialogs2/Template.xdl</value>
</prop>
<prop oor:name="EventHandlerService">
<value></value>
<value>org.openoffice.da.writer2xhtml.ConfigurationDialog</value>
</prop>
</node>
@ -115,13 +115,13 @@
<value>3</value>
</prop>
<prop oor:name="Label">
<value xml:lang="en-US">Styles part 1</value>
<value xml:lang="en-US">Master styles</value>
</prop>
<prop oor:name="OptionsPage">
<value>%origin%/W2XDialogs2/Styles1.xdl</value>
</prop>
<prop oor:name="EventHandlerService">
<value></value>
<value>org.openoffice.da.writer2xhtml.ConfigurationDialog</value>
</prop>
</node>
@ -137,13 +137,13 @@
<value>4</value>
</prop>
<prop oor:name="Label">
<value xml:lang="en-US">Styles part 2</value>
<value xml:lang="en-US">Other styles</value>
</prop>
<prop oor:name="OptionsPage">
<value>%origin%/W2XDialogs2/Styles2.xdl</value>
</prop>
<prop oor:name="EventHandlerService">
<value></value>
<value>org.openoffice.da.writer2xhtml.ConfigurationDialog</value>
</prop>
</node>

View file

@ -7,7 +7,7 @@
</dlg:styles>
<dlg:bulletinboard>
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="0" dlg:left="6" dlg:top="32" dlg:width="248" dlg:height="2"/>
<dlg:img dlg:style-id="0" dlg:id="ImageControl1" dlg:tab-index="1" dlg:left="8" dlg:top="6" dlg:width="21" dlg:height="21" dlg:scale-image="false"/>
<dlg:img dlg:style-id="0" dlg:id="ImageControl1" dlg:tab-index="1" dlg:left="8" dlg:top="6" dlg:width="21" dlg:height="21" dlg:scale-image="false" dlg:src="../images/w2licon.png"/>
<dlg:text dlg:style-id="1" dlg:id="Label1" dlg:tab-index="2" dlg:left="34" dlg:top="10" dlg:width="193" dlg:height="16" dlg:value="Writer2xhtml Custom Configuration"/>
<dlg:text dlg:id="Label2" dlg:tab-index="3" dlg:left="34" dlg:top="43" dlg:width="194" dlg:height="78" dlg:value="This is where you create a custom configuration for the Writer2xhtml export filter. You can define technical details of the generated XHTML documents and you can define how to map formatting to CSS. Creating a custom configuration requires some knowledge of XHTML and CSS." dlg:multiline="true"/>
</dlg:bulletinboard>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="DeleteDialog" dlg:left="255" dlg:top="145" dlg:width="160" dlg:height="50" dlg:closeable="true" dlg:moveable="true" dlg:title="Delete">
<dlg:bulletinboard>
<dlg:text dlg:id="DeleteLabel" dlg:tab-index="0" dlg:left="5" dlg:top="8" dlg:width="150" dlg:height="12" dlg:value="Delete %s?"/>
<dlg:button dlg:id="YesButton" dlg:tab-index="1" dlg:left="5" dlg:top="28" dlg:width="50" dlg:height="12" dlg:value="Yes" dlg:button-type="ok"/>
<dlg:button dlg:id="NoButton" dlg:tab-index="2" dlg:left="60" dlg:top="28" dlg:width="50" dlg:height="12" dlg:value="No" dlg:button-type="cancel"/>
</dlg:bulletinboard>
</dlg:window>

View file

@ -24,7 +24,7 @@
<dlg:checkbox dlg:id="TableFormatting" dlg:tab-index="5" dlg:left="10" dlg:top="50" dlg:width="240" dlg:height="12" dlg:value="Convert table formatting" dlg:checked="false"/>
<dlg:checkbox dlg:id="IgnoreTableDimensions" dlg:tab-index="6" dlg:left="10" dlg:top="64" dlg:width="240" dlg:height="12" dlg:value="Ignore table dimensions" dlg:checked="false"/>
<dlg:checkbox dlg:id="UseListHack" dlg:tab-index="7" dlg:left="10" dlg:top="78" dlg:width="240" dlg:height="12" dlg:value="Use non-standard continued lists" dlg:checked="false"/>
<dlg:checkbox dlg:id="ConvertToPx" dlg:tab-index="8" dlg:left="10" dlg:top="92" dlg:width="240" dlg:height="12" dlg:value="Convert units to px (pixels)" dlg:checked="false"/>
<dlg:checkbox dlg:id="ConvertToPx" dlg:tab-index="8" dlg:visible="false" dlg:left="10" dlg:top="92" dlg:width="240" dlg:height="12" dlg:value="Convert units to px (pixels)" dlg:checked="false"/>
<dlg:checkbox dlg:id="SeparateStylesheet" dlg:tab-index="9" dlg:visible="false" dlg:left="10" dlg:top="106" dlg:width="240" dlg:height="12" dlg:value="Create separate styles sheet on file split" dlg:checked="false"/>
</dlg:bulletinboard>
</dlg:window>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="LoadDefaults" dlg:left="255" dlg:top="145" dlg:width="160" dlg:height="64" dlg:closeable="true" dlg:moveable="true" dlg:title="Load default mappings">
<dlg:bulletinboard>
<dlg:text dlg:id="InfoLabel" dlg:tab-index="0" dlg:left="5" dlg:top="8" dlg:width="150" dlg:height="12" dlg:value="Do you wish to load the default mappings?"/>
<dlg:text dlg:id="OverwriteLabel" dlg:tab-index="1" dlg:left="5" dlg:top="22" dlg:width="150" dlg:height="12" dlg:value="(This will overwrite %s existing mappings)"/>
<dlg:button dlg:id="YesButton" dlg:tab-index="2" dlg:left="5" dlg:top="42" dlg:width="50" dlg:height="12" dlg:value="Yes" dlg:button-type="ok"/>
<dlg:button dlg:id="NoButton" dlg:tab-index="3" dlg:left="60" dlg:top="42" dlg:width="50" dlg:height="12" dlg:value="No" dlg:button-type="cancel"/>
</dlg:bulletinboard>
</dlg:window>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="NewDialog" dlg:left="255" dlg:top="145" dlg:width="160" dlg:height="50" dlg:closeable="true" dlg:moveable="true" dlg:title="New">
<dlg:bulletinboard>
<dlg:text dlg:id="NameLabel" dlg:tab-index="0" dlg:left="5" dlg:top="8" dlg:width="50" dlg:height="12" dlg:value="Name"/>
<dlg:combobox dlg:id="Name" dlg:tab-index="1" dlg:left="60" dlg:top="6" dlg:width="90" dlg:height="12" dlg:spin="true" dlg:linecount="15">
<dlg:menupopup>
</dlg:menupopup>
</dlg:combobox>
<dlg:button dlg:id="OKButton" dlg:tab-index="2" dlg:left="5" dlg:top="28" dlg:width="50" dlg:height="12" dlg:value="OK" dlg:button-type="ok"/>
<dlg:button dlg:id="CancelButton" dlg:tab-index="3" dlg:left="60" dlg:top="28" dlg:width="50" dlg:height="12" dlg:value="Cancel" dlg:button-type="cancel"/>
</dlg:bulletinboard>
</dlg:window>

View file

@ -4,7 +4,7 @@
<dlg:bulletinboard>
<dlg:text dlg:id="StyleMappingsLabel" dlg:tab-index="0" dlg:left="5" dlg:top="8" dlg:width="245" dlg:height="12" dlg:value="Style mappings"/>
<dlg:text dlg:id="StyleFamilyLabel" dlg:tab-index="1" dlg:left="10" dlg:top="22" dlg:width="60" dlg:height="12" dlg:value="Style family"/>
<dlg:menulist dlg:id="ListBox1" dlg:tab-index="2" dlg:left="80" dlg:top="20" dlg:width="170" dlg:height="12" dlg:spin="true">
<dlg:menulist dlg:id="StyleFamily" dlg:tab-index="2" dlg:left="80" dlg:top="20" dlg:width="170" dlg:height="12" dlg:spin="true">
<dlg:menupopup>
<dlg:menuitem dlg:value="Character"/>
<dlg:menuitem dlg:value="Paragraph"/>
@ -14,7 +14,7 @@
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:StyleFamilyChange" script:language="UNO"/>
</dlg:menulist>
<dlg:text dlg:id="StyleNameLabel" dlg:tab-index="3" dlg:left="10" dlg:top="42" dlg:width="60" dlg:height="12" dlg:value="Style name"/>
<dlg:menulist dlg:id="StyleName" dlg:tab-index="4" dlg:left="80" dlg:top="40" dlg:width="80" dlg:height="12" dlg:spin="true">
<dlg:menulist dlg:id="StyleName" dlg:tab-index="4" dlg:left="80" dlg:top="40" dlg:width="80" dlg:height="12" dlg:spin="true" dlg:linecount="10">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:StyleNameChange" script:language="UNO"/>
</dlg:menulist>
<dlg:button dlg:id="NewStyleButton" dlg:tab-index="5" dlg:left="165" dlg:top="40" dlg:width="40" dlg:height="12" dlg:value="New...">
@ -23,15 +23,15 @@
<dlg:button dlg:id="DeleteStyleButton" dlg:tab-index="6" dlg:left="210" dlg:top="40" dlg:width="40" dlg:height="12" dlg:value="Delete...">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:DeleteStyleClick" script:language="UNO"/>
</dlg:button>
<dlg:text dlg:id="XhtmlLabel" dlg:tab-index="7" dlg:left="10" dlg:top="56" dlg:width="60" dlg:height="12" dlg:value="XHTML element"/>
<dlg:combobox dlg:id="Xhtml" dlg:tab-index="8" dlg:left="80" dlg:top="54" dlg:width="170" dlg:height="12" dlg:spin="true"/>
<dlg:text dlg:id="ElementLabel" dlg:tab-index="7" dlg:left="10" dlg:top="56" dlg:width="60" dlg:height="12" dlg:value="XHTML 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: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:text dlg:id="BlockXhtmlLabel" dlg:tab-index="11" dlg:left="10" dlg:top="84" dlg:width="60" dlg:height="12" dlg:value="Block XHTML element"/>
<dlg:combobox dlg:id="BlockXhtml" dlg:tab-index="12" dlg:left="80" dlg:top="82" dlg:width="170" dlg:height="12" dlg:spin="true"/>
<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: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: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:textfield dlg:id="BlockCss" dlg:tab-index="14" dlg:left="80" dlg:top="96" dlg:width="170" dlg:height="12"/>
<dlg:button dlg:id="LoadDefaults" dlg:tab-index="15" dlg:left="10" dlg:top="118" dlg:width="120" dlg:height="12" dlg:value="Load default mappings...">
<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...">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:LoadDefaultsClick" script:language="UNO"/>
</dlg:button>
</dlg:bulletinboard>

View file

@ -14,13 +14,17 @@
<dlg:menuitem dlg:value="Underline"/>
<dlg:menuitem dlg:value="Overstrike"/>
</dlg:menupopup>
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:FormattingAttributeChange" script:language="UNO"/>
</dlg:menulist>
<dlg:text dlg:id="XhtmlLabel" dlg:tab-index="3" dlg:left="10" dlg:top="36" dlg:width="100" dlg:height="12" dlg:value="XHTML element"/>
<dlg:combobox dlg:id="Xhtml" dlg:tab-index="4" dlg:left="120" dlg:top="34" dlg:width="130" dlg:height="12" dlg:spin="true"/>
<dlg:text dlg:id="CSSLabel" dlg:tab-index="5" dlg:left="10" dlg:top="50" dlg:width="100" dlg:height="12" dlg:value="CSS class"/>
<dlg:textfield dlg:id="Css" dlg:tab-index="6" dlg:left="120" dlg:top="48" dlg:width="130" dlg:height="12"/>
<dlg:text dlg:id="OtherStylesLabel" dlg:tab-index="7" dlg:left="5" dlg:top="64" dlg:width="245" dlg:height="12" dlg:value="Other styles"/>
<dlg:text dlg:id="TabstopLabel" dlg:tab-index="8" dlg:left="10" dlg:top="78" dlg:width="100" dlg:height="12" dlg:value="CSS class for tabulator stop"/>
<dlg:textfield dlg:id="TabstopStyle" dlg:tab-index="9" dlg:left="120" dlg:top="76" dlg:width="130" dlg:height="12"/>
<dlg:checkbox dlg:id="CustomAttribute" dlg:tab-index="3" dlg:left="10" dlg:top="36" dlg:width="240" dlg:height="12" dlg:value="Apply custom style" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:CustomAttributeChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="ElementLabel" dlg:tab-index="4" dlg:left="10" dlg:top="50" dlg:width="100" dlg:height="12" dlg:value="XHTML element"/>
<dlg:combobox dlg:id="Element" dlg:tab-index="5" dlg:left="120" dlg:top="48" dlg:width="130" dlg:height="12" dlg:spin="true" dlg:linecount="10"/>
<dlg:text dlg:id="CssLabel" dlg:tab-index="6" dlg:left="10" dlg:top="64" dlg:width="100" dlg:height="12" dlg:value="CSS class"/>
<dlg:textfield dlg:id="Css" dlg:tab-index="7" dlg:left="120" dlg:top="62" dlg:width="130" dlg:height="12"/>
<dlg:text dlg:id="OtherStylesLabel" dlg:tab-index="8" dlg:left="5" dlg:top="78" dlg:width="245" dlg:height="12" dlg:value="Other styles"/>
<dlg:text dlg:id="TabstopLabel" dlg:tab-index="9" dlg:left="10" dlg:top="92" dlg:width="100" dlg:height="12" dlg:value="CSS class for tabulator stop"/>
<dlg:textfield dlg:id="TabstopStyle" dlg:tab-index="10" dlg:left="120" dlg:top="90" dlg:width="130" dlg:height="12"/>
</dlg:bulletinboard>
</dlg:window>

View file

@ -2,18 +2,20 @@
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Stylesheets" dlg:left="139" dlg:top="84" dlg:width="260" dlg:height="185" dlg:closeable="true" dlg:moveable="true" dlg:title="Stylesheets" dlg:withtitlebar="false">
<dlg:bulletinboard>
<dlg:checkbox dlg:id="UseCustomStylesheet" dlg:tab-index="1" dlg:left="10" dlg:top="22" dlg:width="240" dlg:height="12" dlg:value="Insert link to custom style sheet" dlg:checked="false">
<dlg:text dlg:id="IncludedCustomStylesheetLabel" dlg:tab-index="0" dlg:left="5" dlg:top="8" dlg:width="245" dlg:height="12" dlg:value="Custom style sheets"/>
<dlg:checkbox dlg:id="LinkCustomStylesheet" dlg:tab-index="1" dlg:left="10" dlg:top="22" dlg:width="240" dlg:height="12" dlg:value="Insert link to custom style sheet" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:LinkCustomStylesheetChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="CustomStylesheetURLLabel" dlg:tab-index="2" dlg:left="19" dlg:top="36" dlg:width="55" dlg:height="12" dlg:value="URL"/>
<dlg:textfield dlg:id="CustomStylesheetURL" dlg:tab-index="3" dlg:left="80" dlg:top="34" dlg:width="170" dlg:height="12"/>
<dlg:checkbox dlg:id="UseCustomStylesheet" dlg:tab-index="4" dlg:left="10" dlg:top="50" dlg:width="240" dlg:height="12" dlg:value="Include custom style sheet" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:UseCustomStylesheetChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="CustomStylesheetLabel" dlg:tab-index="2" dlg:left="19" dlg:top="36" dlg:width="55" dlg:height="12" dlg:value="URL"/>
<dlg:textfield dlg:id="CustomStylesheet" dlg:tab-index="3" dlg:left="80" dlg:top="34" dlg:width="170" dlg:height="12"/>
<dlg:checkbox dlg:id="IncludeCustomStylesheet" dlg:tab-index="4" dlg:left="10" dlg:top="50" dlg:width="240" dlg:height="12" dlg:value="Include custom style sheet" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:IncludeCustomStylesheetChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:text dlg:id="IncludedCustomStylesheetLabel" dlg:tab-index="0" dlg:left="5" dlg:top="8" dlg:width="245" dlg:height="12" dlg:value="Custom style sheets"/>
<dlg:textfield dlg:id="IncludedCustomStylesheet" dlg:tab-index="5" dlg:left="18" dlg:top="64" dlg:width="232" dlg:height="84" dlg:hscroll="true" dlg:vscroll="true" dlg:multiline="true"/>
<dlg:button dlg:id="LoadButton" dlg:tab-index="6" dlg:left="18" dlg:top="156" dlg:width="60" dlg:height="12" dlg:value="Load...">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:LoadButtonClick" script:language="UNO"/>
<dlg:textfield dlg:id="CustomStylesheet" dlg:tab-index="5" dlg:left="18" dlg:top="64" dlg:width="232" dlg:height="84" dlg:hscroll="true" dlg:vscroll="true" dlg:multiline="true"/>
<dlg:button dlg:id="LoadStylesheetButton" dlg:tab-index="6" dlg:left="18" dlg:top="156" dlg:width="60" dlg:height="12" dlg:value="Load...">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:LoadStylesheetClick" script:language="UNO"/>
</dlg:button>
</dlg:bulletinboard>
</dlg:window>

View file

@ -2,15 +2,12 @@
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Template" dlg:left="139" dlg:top="84" dlg:width="260" dlg:height="185" dlg:closeable="true" dlg:moveable="true" dlg:title="Template" dlg:withtitlebar="false">
<dlg:bulletinboard>
<dlg:checkbox dlg:id="CustomTemplate" dlg:tab-index="0" dlg:left="10" dlg:top="8" dlg:width="240" dlg:height="12" dlg:value="Use custom XHTML template" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:CustomTemplateChange" script:language="UNO"/>
<dlg:checkbox dlg:id="UseCustomTemplate" dlg:tab-index="0" dlg:left="10" dlg:top="8" dlg:width="240" dlg:height="12" dlg:value="Use custom XHTML template" dlg:checked="false">
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.UNO:UseCustomTemplateChange" script:language="UNO"/>
</dlg:checkbox>
<dlg:textfield dlg:id="Template" dlg:tab-index="1" dlg:left="18" dlg:top="22" dlg:width="232" dlg:height="96" dlg:hscroll="true" dlg:vscroll="true" dlg:multiline="true"/>
<dlg:button dlg:id="Load" dlg:tab-index="2" dlg:left="18" dlg:top="120" dlg:width="60" dlg:height="12" dlg:value="Load...">
<script:event script:event-name="on-keyup" script:macro-name="vnd.sun.star.UNO:LoadClick" script:language="UNO"/>
</dlg:button>
<dlg:button dlg:id="Test" dlg:tab-index="3" dlg:left="190" dlg:top="120" dlg:width="60" dlg:height="12" dlg:value="Test">
<script:event script:event-name="on-keyup" script:macro-name="vnd.sun.star.UNO:TestClick" script:language="UNO"/>
<dlg:textfield dlg:id="CustomTemplate" dlg:tab-index="1" dlg:left="18" dlg:top="22" dlg:width="232" dlg:height="96" dlg:hscroll="true" dlg:vscroll="true" dlg:multiline="true"/>
<dlg:button dlg:id="LoadTemplateButton" dlg:tab-index="2" dlg:left="18" dlg:top="120" dlg:width="60" dlg:height="12" dlg:value="Load...">
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.UNO:LoadTemplateClick" script:language="UNO"/>
</dlg:button>
<dlg:text dlg:id="ContentIdLabel" dlg:tab-index="4" dlg:left="18" dlg:top="140" dlg:width="50" dlg:height="12" dlg:value="Content id"/>
<dlg:combobox dlg:id="ContentId" dlg:tab-index="5" dlg:left="72" dlg:top="138" dlg:width="50" dlg:height="12" dlg:spin="true">

View file

@ -9,4 +9,7 @@
<library:element library:name="Styles2"/>
<library:element library:name="Formatting"/>
<library:element library:name="Content"/>
<library:element library:name="NewDialog"/>
<library:element library:name="DeleteDialog"/>
<library:element library:name="LoadDefaults"/>
</library:library>