[ooo-build-commit] Branch 'ooo/master' - writer2latex/download writer2latex/makefile.mk writer2latex/prj writer2latex/writer2latex05.patch writerfilter/source writerfilter/util
Jan Holesovsky
kendy at kemper.freedesktop.org
Sat Jun 13 17:33:19 PDT 2009
writer2latex/download/writer2latex0502.zip |binary
writer2latex/makefile.mk | 70 +++++++++++++++++
writer2latex/prj/build.lst | 2
writer2latex/prj/d.lst | 1
writer2latex/writer2latex05.patch | 91 +++++++++++++++++++++++
writerfilter/source/dmapper/ConversionHelper.cxx | 51 ------------
writerfilter/source/dmapper/ConversionHelper.hxx | 1
writerfilter/source/dmapper/DomainMapper.cxx | 24 +++---
writerfilter/source/dmapper/PropertyMap.cxx | 10 +-
writerfilter/util/makefile.mk | 1
10 files changed, 185 insertions(+), 66 deletions(-)
New commits:
commit a3467f4e3b43c6314fc9f0ec9ad955d4127495d8
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date: Fri Jun 12 09:36:34 2009 +0000
CWS-TOOLING: integrate CWS unifypaper01
2009-05-27 17:14:41 +0200 cmc r272362 : #i92819#, psprint moved into vcl
2009-05-19 15:45:46 +0200 cmc r272083 : #i92819# having difficultly in getting this right under windows
2009-05-18 18:04:22 +0200 cmc r272043 : #i92819# missing some export magic somewhere
2009-05-18 15:34:18 +0200 cmc r272028 : #i92819# get depends right
2009-05-18 11:50:43 +0200 cmc r272010 : ##i92819# fix import/export stuff
2009-05-18 10:07:00 +0200 cmc r272000 : #i92819# fix window imp name
2009-05-16 15:17:23 +0200 cmc r271975 : #i92819# fix win paper names
2009-05-16 11:11:29 +0200 cmc r271974 : #i92819# std::abs prolematic for msvc
2009-05-15 15:36:56 +0200 cmc r271941 : #i92819# handle missing setting, at least on mac
2009-05-15 10:13:44 +0200 cmc r271927 : #i92819# adjust for moved page dialog
2009-05-14 13:47:14 +0200 cmc r271887 : remove dead files that reappeared
2009-05-14 09:57:17 +0200 cmc r271872 : CWS-TOOLING: rebase CWS unifypaper01 to trunk at 271830 (milestone: DEV300:m48)
2009-05-11 12:27:18 +0200 cmc r271763 : #i92819# check return value
2009-05-06 17:28:25 +0200 cmc r271602 : #i92819# these B4/B5s are the JIS ones according to their dimensions
2009-05-06 17:17:03 +0200 cmc r271601 : #i92819# micro-optimization
2009-05-03 18:20:48 +0200 cmc r271434 : #i92819# paper libs
2009-05-03 16:08:32 +0200 cmc r271433 : CWS-TOOLING: rebase CWS unifypaper01 to trunk at 271427 (milestone: DEV300:m47)
2009-04-06 15:33:37 +0200 cmc r270556 : CWS-TOOLING: rebase CWS unifypaper01 to trunk at 270033 (milestone: DEV300:m45)
2009-03-12 14:36:35 +0100 cmc r269415 : #i92819# merge paper utilities
2009-03-11 13:44:27 +0100 cmc r269328 : CWS-TOOLING: rebase CWS unifypaper01 to trunk at 269297 (milestone: DEV300:m43)
2009-03-09 14:42:07 +0100 cmc r269190 : remove config_office from synced version
2009-03-09 14:34:50 +0100 cmc r269187 : CWS-TOOLING: rebase CWS unifypaper01 to trunk at 268395 (milestone: DEV300:m42)
2009-03-09 12:11:29 +0100 cmc r269077 : CWS-TOOLING: rebase CWS unifypaper01 to trunk at 265758 (milestone: DEV300:m38)
2009-03-06 17:17:39 +0100 cmc r269027 : #i92819# paper goo
2008-12-04 11:29:30 +0100 cmc r264826 : CWS-TOOLING: rebase CWS unifypaper01 to trunk at 264807 (milestone: DEV300:m37)
2008-11-26 10:33:06 +0100 cmc r264357 : CWS-TOOLING: rebase CWS unifypaper01 to trunk at 264325 (milestone: DEV300:m36)
2008-11-21 14:09:36 +0100 cmc r264138 : #i92819# paper consolidation
diff --git a/writer2latex/download/writer2latex0502.zip b/writer2latex/download/writer2latex0502.zip
new file mode 100644
index 0000000..33f3c9f
Binary files /dev/null and b/writer2latex/download/writer2latex0502.zip differ
diff --git a/writer2latex/makefile.mk b/writer2latex/makefile.mk
new file mode 100755
index 0000000..ea0a129
--- /dev/null
+++ b/writer2latex/makefile.mk
@@ -0,0 +1,70 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.3 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=.
+
+PRJNAME=writer2latex
+TARGET=so_writer2latex
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE : antsettings.mk
+
+.IF "$(WITH_WRITER2LATEX)" == "NO"
+ at all:
+ echo "building without writer2latex"
+.ELSE
+.IF "$(SOLAR_JAVA)" != ""
+# --- Files --------------------------------------------------------
+
+TARFILE_NAME=writer2latex0502
+
+TARFILE_ROOTDIR=writer2latex05
+
+PATCH_FILES=writer2latex05.patch
+
+CONVERTFILES=build.xml
+JARFILES = ridl.jar unoil.jar jurt.jar juh.jar
+BUILD_ACTION=$(ANT) $(ANT_FLAGS) -DSOLVER=$(SOLARVER)/$(INPATH) -Dsolarbindir=$(SOLARBINDIR) oxt
+
+.ENDIF # $(SOLAR_JAVA)!= ""
+.ENDIF
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : set_ext.mk
+.INCLUDE : target.mk
+
+.IF "$(SOLAR_JAVA)" != ""
+.INCLUDE : tg_ext.mk
+.ENDIF
+
diff --git a/writer2latex/prj/build.lst b/writer2latex/prj/build.lst
new file mode 100755
index 0000000..2c15793
--- /dev/null
+++ b/writer2latex/prj/build.lst
@@ -0,0 +1,2 @@
+w2l writer2latex : solenv jurt unoil javaunohelper NULL
+w2l writer2latex nmake - all w2l_mkout NULL
diff --git a/writer2latex/prj/d.lst b/writer2latex/prj/d.lst
new file mode 100755
index 0000000..765096c
--- /dev/null
+++ b/writer2latex/prj/d.lst
@@ -0,0 +1 @@
+..\%__SRC%\misc\build\writer2latex05\target\lib/writer2latex.oxt %_DEST%\bin%_EXT%\writer2latex.oxt
diff --git a/writer2latex/writer2latex05.patch b/writer2latex/writer2latex05.patch
new file mode 100644
index 0000000..9d9da31
--- /dev/null
+++ b/writer2latex/writer2latex05.patch
@@ -0,0 +1,91 @@
+--- misc/build/writer2latex05/build.xml-old 2008-06-12 00:53:19.000000000 +0200
++++ misc/build/writer2latex05/build.xml 2008-06-12 00:53:38.000000000 +0200
+@@ -7,9 +7,6 @@
+ -->
+ <project name="w2l" default="help" basedir=".">
+
+- <!-- set this property to the location of your SO/OOo installation -->
+- <property name="OFFICE_HOME" location="c:/programmer/sun/staroffice 8"/>
+-
+ <description>writer2latex - build file</description>
+
+ <target name="help" description="Displays usage information">
+@@ -40,7 +37,7 @@
+ <property name="target.lib" location="target/lib"/>
+ <!-- classpath for the application; needs java-uno classes -->
+ <path id="main.class.path">
+- <filelist dir="${OFFICE_HOME}/program/classes"
++ <filelist dir="${solar.jar}"
+ files="jurt.jar,unoil.jar,ridl.jar,juh.jar"/>
+ </path>
+
+@@ -85,7 +85,7 @@
+ <attribute name="Main-Class" value="writer2latex.Application"/>
+ <!-- OOo needs this to register the filter: -->
+ <attribute name="RegistrationClassName" value="writer2latex.filter.W2LExportFilter" />
+- <attribute name="Class-Path" value="jaxp.jar parser.jar"/>
++ <attribute name="Class-Path" value="jaxp.jar jaxp_parser_impl.jar"/>
+ </manifest>
+ </jar>
+ </target>
+--- misc/build/writer2latex05/source/writer2latex/office/ImageLoader.java 2007-04-17 09:30:42.000000000 +0200
++++ misc/build/writer2latex05/source/writer2latex/office/ImageLoader.java 2007-11-20 21:18:32.000000000 +0100
+@@ -107,8 +107,8 @@
+ }
+ // TODO: Use another base64 decoder. This one is "nonstandard"
+ try {
+- blob = new sun.misc.BASE64Decoder().decodeBuffer(buf.toString());
+- } catch (IOException e) {
++ blob = org.apache.xerces.impl.dv.util.Base64.decode(buf.toString());
++ } catch (Exception e) {
+ System.err.println("Oops - error converting base64");
+ }
+ sMIME = MIMETypes.getMagicMIMEType(blob);
+diff --git source/oxt/writer2latex/w2l_types.xcu source/oxt/writer2latex/w2l_types.xcu
+index 99b5b32..dfce54c 100644
+--- misc/build/writer2latex05/source/oxt/writer2latex/w2l_types.xcu
++++ misc/build/writer2latex05/source/oxt/writer2latex/w2l_types.xcu
+@@ -9,7 +9,6 @@
+ <prop oor:name="Extensions"><value>bib</value></prop>
+ <prop oor:name="MediaType"/>
+ <prop oor:name="Preferred"><value>false</value></prop>
+- <prop oor:name="PreferredFilter"><value>BibTeX Data File</value></prop>
+ <prop oor:name="UIName">
+ <value>BibTeX Data File</value>
+ </prop>
+@@ -22,7 +21,6 @@
+ <prop oor:name="Extensions"><value>tex</value></prop>
+ <prop oor:name="MediaType"/>
+ <prop oor:name="Preferred"><value>false</value></prop>
+- <prop oor:name="PreferredFilter"><value>LaTeX File</value></prop>
+ <prop oor:name="UIName">
+ <value>LaTeX 2e</value>
+ </prop>
+diff --git source/oxt/writer2xhtml/w2x_types.xcu source/oxt/writer2xhtml/w2x_types.xcu
+index ee4d4fd..c9dad65 100644
+--- misc/build/writer2latex05/source/oxt/writer2xhtml/w2x_types.xcu
++++ misc/build/writer2latex05/source/oxt/writer2xhtml/w2x_types.xcu
+@@ -9,7 +9,6 @@
+ <prop oor:name="Extensions"><value>html</value></prop>
+ <prop oor:name="MediaType"/>
+ <prop oor:name="Preferred"><value>false</value></prop>
+- <prop oor:name="PreferredFilter"><value>XHTML 1.0 strict File</value></prop>
+ <prop oor:name="UIName">
+ <value>XHTML 1.0 strict</value>
+ </prop>
+@@ -22,7 +21,6 @@
+ <prop oor:name="Extensions"><value>xhtml</value></prop>
+ <prop oor:name="MediaType"/>
+ <prop oor:name="Preferred"><value>false</value></prop>
+- <prop oor:name="PreferredFilter"><value>XHTML 1.1 plus MathML 2.0 File</value></prop>
+ <prop oor:name="UIName">
+ <value>XHTML 1.1 + MathML 2.0</value>
+ </prop>
+@@ -35,7 +33,6 @@
+ <prop oor:name="Extensions"><value>xml</value></prop>
+ <prop oor:name="MediaType"/>
+ <prop oor:name="Preferred"><value>false</value></prop>
+- <prop oor:name="PreferredFilter"><value>XHTML 1.1 plus MathML 2.0 (xsl) File</value></prop>
+ <prop oor:name="UIName">
+ <value>XHTML 1.1 + MathML 2.0 (xsl)</value>
+ </prop>
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index 18196b3..b05c771 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -36,7 +36,6 @@
#include <ooxml/resourceids.hxx>
#include <tools/color.hxx>
#include <rtl/ustrbuf.hxx>
-# include <svx/paperinf.hxx> //lA0Width...
#include <algorithm>
#include <functional>
@@ -485,56 +484,6 @@ sal_Int32 ConvertColor(sal_Int32 nWordColor)
sal_Int32 nRet = (t<<24) + (r<<16) + (g<<8) + b;
return nRet;
}
-/*-- 12.12.2006 08:59:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-class closeenough : public std::unary_function<long, bool>
-{
-private:
- long mnValue;
- long mnWriggleRoom;
-public:
- closeenough(long nValue, long nWriggleRoom)
- : mnValue(nValue), mnWriggleRoom(nWriggleRoom) {}
- bool operator()(long nTest) const
- {
- return (
- (mnValue - nTest < mnWriggleRoom) &&
- (mnValue - nTest > -mnWriggleRoom)
- );
- }
-};
-/*-- 12.12.2006 08:59:42---------------------------------------------------
-
- -----------------------------------------------------------------------*/
-sal_Int32 SnapPageDimension( sal_Int32 nVal )
-{
- static const long aSizes[] =
- {
- lA0Width, lA0Height, lA1Width, lA2Width, lA3Width, lA4Width,
- lA5Width, lB4Width, lB4Height, lB5Width, lB6Width, lC4Width,
- lC4Height, lC5Width, lC6Width, lC65Width, lC65Height, lDLWidth,
- lDLHeight, lJISB4Width, lJISB4Height, lJISB5Width, lJISB6Width,
- lLetterWidth, lLetterHeight, lLegalHeight, lTabloidWidth,
- lTabloidHeight, lDiaWidth, lDiaHeight, lScreenWidth,
- lScreenHeight, lAWidth, lAHeight, lBHeight, lCHeight, lDHeight,
- lEHeight, lExeWidth, lExeHeight, lLegal2Width, lLegal2Height,
- lCom675Width, lCom675Height, lCom9Width, lCom9Height,
- lCom10Width, lCom10Height, lCom11Width, lCom11Height,
- lCom12Width, lMonarchHeight, lKai16Width, lKai16Height,
- lKai32Width, lKai32BigWidth, lKai32BigHeight
- };
-
- const long nWriggleRoom = 5;
- const long *pEnd = aSizes + sizeof(aSizes) / sizeof(aSizes[0]);
- const long *pEntry =
- std::find_if(aSizes, pEnd, closeenough(nVal, nWriggleRoom));
-
- if (pEntry != pEnd)
- nVal = *pEntry;
-
- return nVal;
-}
/*-- 27.06.2007 13:42:32---------------------------------------------------
-----------------------------------------------------------------------*/
diff --git a/writerfilter/source/dmapper/ConversionHelper.hxx b/writerfilter/source/dmapper/ConversionHelper.hxx
index 9b709ce..e84e624 100644
--- a/writerfilter/source/dmapper/ConversionHelper.hxx
+++ b/writerfilter/source/dmapper/ConversionHelper.hxx
@@ -57,7 +57,6 @@ namespace ConversionHelper{
// probably the most useless unit in the world - English Metric Units (EMU) 360 000 EMU == 1cm
sal_Int32 convertEMUToMM100(sal_Int32 _t);
sal_Int32 ConvertColor(sal_Int32 nWordColor );
- sal_Int32 SnapPageDimension( sal_Int32 nVal );
sal_Int16 convertTableJustification( sal_Int32 nIntValue );
::com::sun::star::util::DateTime convertDateTime( const ::rtl::OUString& rDateTimeString );
sal_Int16 ConvertNumberingType(sal_Int32 nNFC);
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index b806706..d61cf50 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -36,6 +36,7 @@
#include <MeasureHandler.hxx>
#include <OLEHandler.hxx>
#include <i18npool/mslangid.hxx>
+#include <i18npool/paper.hxx>
#include <ooxml/OOXMLFastTokens.hxx>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XOOXMLDocumentPropertiesImporter.hpp>
@@ -1816,8 +1817,8 @@ void DomainMapper::attribute(Id nName, Value & val)
case NS_ooxml::LN_CT_PageSz_h:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
{
- sal_Int32 nHeight = ConversionHelper::SnapPageDimension(nIntValue);
- CT_PageSz.h = ConversionHelper::convertTwipToMM100(nHeight);
+ sal_Int32 nHeight = ConversionHelper::convertTwipToMM100(nIntValue);
+ CT_PageSz.h = PaperInfo::sloppyFitPageDimension(nHeight);
}
break;
case NS_ooxml::LN_CT_PageSz_orient:
@@ -1827,8 +1828,8 @@ void DomainMapper::attribute(Id nName, Value & val)
case NS_ooxml::LN_CT_PageSz_w:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
{
- sal_Int32 nWidth = ConversionHelper::SnapPageDimension(nIntValue);
- CT_PageSz.w = ConversionHelper::convertTwipToMM100(nWidth);
+ sal_Int32 nWidth = ConversionHelper::convertTwipToMM100(nIntValue);
+ CT_PageSz.w = PaperInfo::sloppyFitPageDimension(nWidth);
}
break;
@@ -3346,16 +3347,16 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
{
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
//page height, rounded to default values, default: 0x3dc0 twip
- sal_Int32 nHeight = ConversionHelper::SnapPageDimension( nIntValue );
- rContext->Insert( PROP_HEIGHT, false, uno::makeAny( ConversionHelper::convertTwipToMM100( nHeight ) ) );
+ sal_Int32 nHeight = ConversionHelper::convertTwipToMM100( nIntValue );
+ rContext->Insert( PROP_HEIGHT, false, uno::makeAny( PaperInfo::sloppyFitPageDimension( nHeight ) ) );
}
break;
case NS_sprm::LN_SXaPage: // sprmSXaPage
{
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
//page width, rounded to default values, default 0x2fd0 twip
- sal_Int32 nWidth = ConversionHelper::SnapPageDimension( nIntValue );
- rContext->Insert( PROP_WIDTH, false, uno::makeAny( ConversionHelper::convertTwipToMM100( nWidth ) ) );
+ sal_Int32 nWidth = ConversionHelper::convertTwipToMM100( nIntValue );
+ rContext->Insert( PROP_WIDTH, false, uno::makeAny( PaperInfo::sloppyFitPageDimension( nWidth ) ) );
}
break;
case 166:
@@ -3801,8 +3802,11 @@ void DomainMapper::sprm( Sprm& rSprm, PropertyMapPtr rContext, SprmType eSprmTyp
case NS_ooxml::LN_EG_SectPrContents_pgSz:
/* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
CT_PageSz.code = 0;
- CT_PageSz.h = ConversionHelper::convertTwipToMM100( ConversionHelper::SnapPageDimension( sal_Int32(15840) ));
- CT_PageSz.w = ConversionHelper::convertTwipToMM100( ConversionHelper::SnapPageDimension( sal_Int32(12240) ));
+ {
+ PaperInfo aLetter(PAPER_LETTER);
+ CT_PageSz.w = aLetter.getWidth();
+ CT_PageSz.h = aLetter.getHeight();
+ }
CT_PageSz.orient = false;
resolveSprmProps(rSprm);
OSL_ENSURE(pSectionContext, "SectionContext unavailable!");
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 0ca1023..7ccf38d 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -32,6 +32,7 @@
#include <ooxml/resourceids.hxx>
#include <DomainMapper_Impl.hxx>
#include <ConversionHelper.hxx>
+#include <i18npool/paper.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/table/BorderLine.hpp>
@@ -209,10 +210,11 @@ SectionPropertyMap::SectionPropertyMap(bool bIsFirstSection) :
m_nBorderDistances[ nBorder ] = -1;
//todo: set defaults in ApplyPropertiesToPageStyles
//initialize defaults
- //page height, todo: rounded to default values, default: 0x3dc0 (15808) twip 27883 1/100 mm
- Insert( PROP_HEIGHT, false, uno::makeAny( (sal_Int32) 27883 ) );
- //page width, todo: rounded to default values, default 0x2fd0 (12240) twip -> 21590 1/100 mm
- Insert( PROP_WIDTH, false, uno::makeAny( (sal_Int32)21590 ) );
+ PaperInfo aLetter(PAPER_LETTER);
+ //page height, 1/100mm
+ Insert( PROP_HEIGHT, false, uno::makeAny( (sal_Int32) aLetter.getHeight() ) );
+ //page width, 1/100mm
+ Insert( PROP_WIDTH, false, uno::makeAny( (sal_Int32) aLetter.getWidth() ) );
//page left margin, default 0x708 (1800) twip -> 3175 1/100 mm
Insert( PROP_LEFT_MARGIN, false, uno::makeAny( (sal_Int32) 3175 ) );
//page right margin, default 0x708 (1800) twip -> 3175 1/100 mm
diff --git a/writerfilter/util/makefile.mk b/writerfilter/util/makefile.mk
index a210a9d..08033ab 100644
--- a/writerfilter/util/makefile.mk
+++ b/writerfilter/util/makefile.mk
@@ -56,6 +56,7 @@ SHL1LIBS=$(SLB)$/$(TARGET).lib
SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
SHL1STDLIBS=\
$(I18NISOLANGLIB) \
+ $(I18NPAPERLIB) \
$(SOTLIB) \
$(TOOLSLIB) \
$(UNOTOOLSLIB) \
More information about the ooo-build-commit
mailing list