w2l: Finished support cross references to list items + a few minor w2l and w2x bugfixes

git-svn-id: svn://svn.code.sf.net/p/writer2latex/code/trunk@136 f0f2a975-2e09-46c8-9428-3b39399b9f3c
This commit is contained in:
henrikjust 2012-03-05 14:56:56 +00:00
parent 9cb0e43ef2
commit 568d0d01f8
9 changed files with 169 additions and 84 deletions

View file

@ -20,7 +20,7 @@
*
* All Rights Reserved.
*
* Version 1.2 (2012-02-27)
* Version 1.2 (2012-03-05)
*
*/
@ -40,6 +40,7 @@ import org.w3c.dom.Node;
import writer2latex.latex.util.Context;
import writer2latex.latex.util.HeadingMap;
import writer2latex.office.ListStyle;
import writer2latex.office.OfficeReader;
import writer2latex.office.XMLString;
import writer2latex.util.CSVList;
@ -789,8 +790,31 @@ public class FieldConverter extends ConverterHelper {
ldp.append("\\ref{bkm:"+bookmarknames.getExportName(sName)+"}");
}
else if (("number".equals(sFormat) || "number-no-superior".equals(sFormat) || "number-all-superior".equals(sFormat)) &&
ofr.bookmarkInList(sName)) {
ldp.append("\\ref{bkm:"+bookmarknames.getExportName(sName)+"}");
(ofr.bookmarkInHeading(sName) || ofr.bookmarkInList(sName))) {
ListStyle style=null;
int nLevel = 0;
String sPrefix=null;
String sSuffix=null;
// Only convert the prefix and suffix if it is converted at the reference target
if (ofr.bookmarkInHeading(sName)) {
if (config.formatting()>=LaTeXConfig.CONVERT_MOST) {
style = ofr.getOutlineStyle();
}
nLevel = ofr.getBookmarkHeadingLevel(sName);
}
else {
if (config.formatting()>=LaTeXConfig.CONVERT_BASIC) {
style = ofr.getListStyle(ofr.getBookmarkListStyle(sName));
}
nLevel = ofr.getBookmarkListLevel(sName);
}
if (style!=null) {
sPrefix = style.getLevelProperty(nLevel, XMLString.STYLE_NUM_PREFIX);
sSuffix = style.getLevelProperty(nLevel, XMLString.STYLE_NUM_SUFFIX);
}
if (sPrefix!=null) ldp.append(palette.getI18n().convert(sPrefix,false,oc.getLang()));
ldp.append("\\ref{bkm:").append(bookmarknames.getExportName(sName)).append("}");
if (sSuffix!=null) ldp.append(palette.getI18n().convert(sSuffix,false,oc.getLang()));
}
else { // use current value
palette.getInlineCv().traversePCDATA(node,ldp,oc);

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2011 by Henrik Just
* Copyright: 2002-2012 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.2 (2011-03-29)
* Version 1.2 (2012-03-05)
*
*/
@ -356,9 +356,9 @@ public class HeadingConverter extends ConverterHelper {
ldp.append("\\protect\\makebox[").append(sLabelWidth).append("][").append(sAlignmentChar).append("]{");
}
ldp.append(baText.getBefore())
.append(sPrefix!=null ? sPrefix : "")
.append(sPrefix!=null ? palette.getI18n().convert(sPrefix,false,"en") : "")
.append("#1")
.append(sSuffix!=null ? sSuffix : "")
.append(sSuffix!=null ? palette.getI18n().convert(sSuffix,false,"en") : "")
.append(sSpaceChar)
.append(baText.getAfter());
if (!bOnlyNum && sLabelWidth!=null) {

View file

@ -16,11 +16,11 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
* Copyright: 2002-2011 by Henrik Just
* Copyright: 2002-2012 by Henrik Just
*
* All Rights Reserved.
*
* Version 1.2 (2011-03-22)
* Version 1.2 (2012-03-05)
*
*/
@ -391,9 +391,9 @@ public class ListStyleConverter extends StyleConverter {
String sSuffix = style.getLevelProperty(i,XMLString.STYLE_NUM_SUFFIX);
// Apply style
ldp.append(baText.getBefore());
if (sPrefix!=null) { ldp.append(sPrefix); }
if (sPrefix!=null) { ldp.append(palette.getI18n().convert(sPrefix,false,"en")); }
ldp.append("\\the").append(sName[i]);
if (sSuffix!=null) { ldp.append(sSuffix); }
if (sSuffix!=null) { ldp.append(palette.getI18n().convert(sSuffix,false,"en")); }
ldp.append(baText.getAfter());
}
else if (style.isBullet(i)) {

View file

@ -18,7 +18,7 @@
*
* Copyright: 2002-2012 by Henrik Just
*
* Version 1.2 (2012-02-24)
* Version 1.2 (2012-02-27)
*
* All Rights Reserved.
*/
@ -1119,7 +1119,7 @@ public final class StarMathConverter implements writer2latex.api.StarMathConvert
while (tokenInGroup(TGroup.PRODUCT)){
if (curToken.eType==Token.OVER){
nextToken();
sProduct="\\frac"+groupsp(sProduct)+group(power(fSize,eAlign));
sProduct="\\frac"+groupsp(sProduct)+groupsp(power(fSize,eAlign));
} else if (curToken.eType==Token.BOPER){
nextToken();
sProduct+=special()+power(fSize,eAlign);