diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-09-14 11:15:24 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-09-14 11:15:24 +0200 |
commit | c9802c9c9481ef47c8bb5225fb5be640ed4f4c87 (patch) | |
tree | 6556f726ff835a8e8fad0c58dcd759ac88842bcd | |
parent | 37676cddbfa10f29efea49aafd07acb40aa6b7d4 (diff) |
libwps.diff: WPS Import filter - create a libwps module
-rw-r--r-- | libwpd/makefile.mk | 2 | ||||
-rw-r--r-- | libwps/libwps-0.1.1.diff | 93 | ||||
-rw-r--r-- | libwps/makefile.mk | 60 | ||||
-rw-r--r-- | libwps/prj/build.lst | 3 | ||||
-rw-r--r-- | libwps/prj/d.lst | 6 |
5 files changed, 163 insertions, 1 deletions
diff --git a/libwpd/makefile.mk b/libwpd/makefile.mk index 104d79f..d12173d 100644 --- a/libwpd/makefile.mk +++ b/libwpd/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite diff --git a/libwps/libwps-0.1.1.diff b/libwps/libwps-0.1.1.diff new file mode 100644 index 0000000..6977cf3 --- /dev/null +++ b/libwps/libwps-0.1.1.diff @@ -0,0 +1,93 @@ +*** misc/libwps-0.1.1/src/lib/WPSListener.h Thu Nov 29 20:58:57 2007 +--- misc/build/libwps-0.1.1/src/lib/WPSListener.h Sun Dec 2 20:54:35 2007 +*************** +*** 39,45 **** + virtual ~WPSListener(); + + bool isUndoOn() { return m_isUndoOn; } +! void setUndoOn(bool isUndoOn) { m_isUndoOn = isUndoOn; } + + std::list<WPSPageSpan> &m_pageList; + +--- 39,45 ---- + virtual ~WPSListener(); + + bool isUndoOn() { return m_isUndoOn; } +! void setUndoOn(bool undoOn) { m_isUndoOn = undoOn; } + + std::list<WPSPageSpan> &m_pageList; + +*** misc/libwps-0.1.1/src/lib/WPSContentListener.cpp Thu Nov 29 20:58:57 2007 +--- misc/build/libwps-0.1.1/src/lib/WPSContentListener.cpp Sun Dec 2 21:09:11 2007 +*************** +*** 36,62 **** + #define LIBWPS_MAX std::max + #endif + +- namespace { +- +- WPXString doubleToString(const double value) +- { +- WPXString tempString; +- tempString.sprintf("%.4f", value); +- std::string decimalPoint(localeconv()->decimal_point); +- if ((decimalPoint.size() == 0) || (decimalPoint == ".")) +- return tempString; +- std::string stringValue(tempString.cstr()); +- if (!stringValue.empty()) +- { +- std::string::size_type pos; +- while ((pos = stringValue.find(decimalPoint)) != std::string::npos) +- stringValue.replace(pos,decimalPoint.size(),"."); +- } +- return WPXString(stringValue.c_str()); +- } +- +- } // namespace +- + _WPSContentParsingState::_WPSContentParsingState() : + m_textAttributeBits(0), + m_fontSize(12.0f/*WP6_DEFAULT_FONT_SIZE*/), // FIXME ME!!!!!!!!!!!!!!!!!!! HELP WP6_DEFAULT_FONT_SIZE +--- 36,41 ---- +*************** +*** 578,585 **** + _closePageSpan(); + } + +- const float WPS_DEFAULT_SUPER_SUB_SCRIPT = 58.0f; +- + void WPSContentListener::_openSpan() + { + if (!m_ps->m_isParagraphOpened && !m_ps->m_isListElementOpened) +--- 557,562 ---- +*************** +*** 622,639 **** + } + + WPXPropertyList propList; +! if (attributeBits & WPS_SUPERSCRIPT_BIT) { +! WPXString sSuperScript("super "); +! sSuperScript.append(doubleToString(WPS_DEFAULT_SUPER_SUB_SCRIPT)); +! sSuperScript.append("%"); +! propList.insert("style:text-position", sSuperScript); +! } +! else if (attributeBits & WPS_SUBSCRIPT_BIT) { +! WPXString sSubScript("sub "); +! sSubScript.append(doubleToString(WPS_DEFAULT_SUPER_SUB_SCRIPT)); +! sSubScript.append("%"); +! propList.insert("style:text-position", sSubScript); +! } + if (attributeBits & WPS_ITALICS_BIT) + propList.insert("fo:font-style", "italic"); + if (attributeBits & WPS_BOLD_BIT) +--- 599,608 ---- + } + + WPXPropertyList propList; +! if (m_ps->m_textAttributeBits & WPS_SUPERSCRIPT_BIT) +! propList.insert("style:text-position", "super 58%"); +! else if (m_ps->m_textAttributeBits & WPS_SUBSCRIPT_BIT) +! propList.insert("style:text-position", "sub 58%"); + if (attributeBits & WPS_ITALICS_BIT) + propList.insert("fo:font-style", "italic"); + if (attributeBits & WPS_BOLD_BIT) diff --git a/libwps/makefile.mk b/libwps/makefile.mk new file mode 100644 index 0000000..3d9cefe --- /dev/null +++ b/libwps/makefile.mk @@ -0,0 +1,60 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# 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=wps +TARGET=wps + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- + +.IF "$(SYSTEM_LIBWPS)" == "YES" +@all: + @echo "Using system libwps..." +.ENDIF + +# libwps depends on the libwpd framework +.IF "$(SYSTEM_LIBWPD)" == "YES" +INCPRE+=$(LIBWPD_CFLAGS) +.ELSE +INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/libwpd +.ENDIF + +TARFILE_NAME=libwps-0.1.2 +TARFILE_MD5=799fc3b835a79adce8c88a3fee0150c1 +BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS) +BUILD_DIR=src/lib + +# --- Targets ------------------------------------------------------ + +.INCLUDE : set_ext.mk +.INCLUDE : target.mk +.INCLUDE : tg_ext.mk diff --git a/libwps/prj/build.lst b/libwps/prj/build.lst new file mode 100644 index 0000000..85004e1 --- /dev/null +++ b/libwps/prj/build.lst @@ -0,0 +1,3 @@ +lwps libwps : LIBWPD:libwpd soltools NULL +lwps libwps usr1 - all lwps_mkout NULL +lwps libwps nmake - all lwps_libwps NULL diff --git a/libwps/prj/d.lst b/libwps/prj/d.lst new file mode 100644 index 0000000..fe897d7 --- /dev/null +++ b/libwps/prj/d.lst @@ -0,0 +1,6 @@ +mkdir: %_DEST%\inc%_EXT%\libwps +..\%__SRC%\misc\build\libwps*\src\lib\libwps.h %_DEST%\inc%_EXT%\libwps\ +..\%__SRC%\misc\build\libwps*\src\lib\WPSStream.h %_DEST%\inc%_EXT%\libwps\ +..\%__SRC%\misc\build\libwps*\src\lib\WPSDocument.h %_DEST%\inc%_EXT%\libwps\ +..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a +..\%__SRC%\slb\*.lib %_DEST%\lib%_EXT%\*.lib |